code-part-modification
局部代码修改技能:最小化修改完成功能,确保无蝴蝶效应,支持独立测试验证和全量关联检查
Skill by hellyguo
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/hellyguo-code-part-modification
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/code-part-modification
What's inside
- Skill name
code-part-modification- Description
- 局部代码修改技能:最小化修改完成功能,确保无蝴蝶效应,支持独立测试验证和全量关联检查
- License
- Apache-2.0
- Instructions
- 299 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- files: referenced but missing: templates/verification.log.md
Files (9)
- SKILL.md
- association-checklist.md · templates/
- butterfly-check.md · templates/
- changes.md · templates/
- impact-analysis.md · templates/
- report.md · templates/
- requirement.md · templates/
- tasks.md · templates/
- test-cases.md · templates/
SKILL.md (first lines)
# 局部代码修改技能(code-part-modification)
## 核心原则
> 本文件中的 `templates/...` 均指本技能目录下的 `templates/` 子目录。
- **最小化修改**:只修改完成目标功能所需的最小代码范围,避免"顺手优化"
- **无蝴蝶效应**:确保修改不影响其他功能,不引入隐性依赖,不破坏现有契约
## 适用场景
| 场景 | 说明 |
| ------ | ------ |
| Bug修复 | 修复特定缺陷,确保不影响其他功能 |
| 功能增加 | 添加新功能,最小化对现有代码的影响 |
| 功能修改 | 修改现有功能,保持向后兼容 |
| 功能封闭 | 废弃或关闭功能,清理相关代码 |
## 执行流程
```dot
digraph code_part {
rankdir=TB;
"理解需求" -> "定位修改点";
"定位修改点" -> "影响范围分析";
"影响范围分析" -> "分解子任务";
"分解子任务" -> "有可测试环境?";
"有可测试环境?" -> "编写单元测试" [label="是"];
"有可测试环境?" -> "提取代码到测试" [label="否"];
"编写单元测试" -> "实现最小修改";
"提取代码到测试" -> "实现最小修改";
"实现最小修改" -> "验证修改";
"验证修改" -> "验证通过?";
"验证通过?" -> "全量关联检查" [label="是"];
"验证通过?" -> "自愈修复" [label="否"];
"自愈修复" -> "验证修改";
"全量关联检查" -> "关联检查通过?";
"关联检查通过?" -> "修改完成" [label="是"];
"关联检查通过?" -> "关联细节修复" [label="否"];
"关联细节修复" -> "全量关联检查";
}
```
---
## Phase 1: 需求理解与修改点定位
### 1.1 需求理解
明确修改目标:
- **Bug修复**:复现路径、错误信息、期望行为
- **功能增加**:新功能描述、输入输出、边界条件
- **功能修改**:修改前行为、修改后行为、兼容性要求
- **功能封闭**:关闭范围、保留功能、清理范围
使用模板 `templates/requirement.md`,产物写入 `docs/code-part-modification/task-{yyyymmdd}-{seq}/requirement.md`。
### 1.2 定位修改点
| 方法 | 工具 | 适用场景 |
| ------ | ------ | ---------- |
| AST 精准搜索 | ast-grep-mcp `find_code_by_rule` | 按方法签名、调用模式精准定位 |
| 简单模式搜索 | ast-grep-mcp `find_code` | 按方法名/字段名快速搜索引用点 |
| 关键字搜索 | grep/rg | 根据错误信息定位(兜底) |
| 调用链追踪 | IDE/代码分析 | 理解数据流 |
| 日志追踪 | 日志文件 | 定位运行时位置 |
| 堆栈分析 | 异常堆栈 | Bug修复定位 |
**ast-grep-mcp 用法**:
按方法签名定位:
```
find_code(pattern: 'void $METHOD($$$ARGS)', language: java, project_folder: "<dir>")
```
按方法调用点定位(蝴蝶效应检查用):
```
find_code(pattern: '$OBJ.methodName($$$ARGS)', language: java, project_folder: "<dir>")
```
按字段读写点定位:
```
find_code(pattern: '$OBJ.fieldName', language: java, project_folder: "<dir>")
```
> **注意**:MCP 不支持 `--globs` 排除目录,需限定 `project_folder` 或人工过滤。大型项目(>10k 文件)可能超时。
输出:修改点清单(文件、行号、修改类型、说明)
### 1.3 影响范围分析
| 检查维度 | 检查项 | 方法 |
| ---------- | -------- | ------ |
| 内部调用 | 谁调用了这个方法/函数? | grep 调用点 |
| 上游系统 | 哪些外部系统调用此接口? | 接口文档、日志 |
| 下游系统 | 此代码调用了哪些外部系统? | 代码分析 |
| 数据库 | 涉及哪些表、字段? | SQL 分析 |
| UI界面 | 界面显示哪些字段? | 前端代码分析 |
| 配置 | 依赖哪些配置项? | 配置文件分析 |
使用模板 `templates/impact-analysis.md`,产物写入 `docs/code-part-modification/task-{yyyymmdd}-{seq}/impact-analysis.md`。
---
## Phase 2: 任务分解
将修改任务分解到**可独立验证**的粒度:
| 粒度 | 标准 | 示例 |
|--------|----------------------|------------------------------|
| 太大 | 无法独立验证 | "重构订单模块" |
| 合适 | 有明确的验证器 | "修改订单状态字段校验逻辑" |
| 太小 | 验证成本高于修改成本 | "修改变量名" |
使用模板 `templates/tasks.md`,产物写入 `docs/code-part-modification/task-{yyyymmdd}-{seq}/tasks.md`。
---From hellyguo/self-ai-spec, Apache-2.0.
More from hellyguo/self-ai-spec
- 0.618score
code-review
hellyguo
代码审查框架:通用审查流程 + 语言特定规则引用,支持多语言代码审查
SkillAFreshness: A★ 8Claude Code +9 - 0.614score
code-deconstruct
hellyguo
读取所有源代码,解构为设计图、设计文档、数据库设计; 没有执行文件,请按流程执行
SkillAFreshness: A★ 8Claude Code +9 - 0.592score
gdb-heap-analysis
hellyguo
GDB heap/arena memory analysis for core dump debugging.
SkillBFreshness: B★ 8Claude Code +9 - 0.589score
java-coverage
hellyguo
Strategies and patterns to boost test coverage to 80%+ line or 60%+ branch coverage.
SkillBFreshness: B★ 8Claude Code +9 - 0.581score
java-check-spotbugs
hellyguo
SpotBugs静态分析技能:使用SpotBugs、Find Security Bugs、fb-contrib进行Java代码缺陷和安全分析
SkillBFreshness: B★ 8Claude Code +9 - 0.581score
cpp-tscancode
hellyguo
TscanCode静态分析技能:使用TscanCode(腾讯开源)进行C/C++代码质量分析,检测缺陷、安全漏洞和代码风格问题
SkillBFreshness: B★ 8Claude Code +9 - 0.580score
ast-grep-block
hellyguo
基于 ast-grep 的代码审查门禁:使用 code-checklist 规则集对 Java/C++/ANSI C 项目分级扫描(high/medium/low),输出命中清单与 CI 退出码。仅使用 CLI 模式(run.sh),适用于交互式审查、CI 质量门禁、批量检测
SkillBFreshness: B★ 8Claude Code +9 - 0.578score
java-check-pmd
hellyguo
PMD静态分析技能:使用PMD进行Java代码质量分析,检测代码坏味道、编码规范和安全问题
SkillBFreshness: B★ 8Claude Code +9 - 0.578score
java-env
hellyguo
该skill没有执行文件,为信息输入:Java开发需要的环境信息
SkillBFreshness: B★ 8Claude Code +9 - 0.575score
code-refactor
hellyguo
该skill没有执行文件,为操作指引:如何重构
SkillBFreshness: B★ 8Claude Code +9 - 0.575score
java-asprof
hellyguo
该skill没有执行文件,为操作指引:采集Java执行情况
SkillBFreshness: B★ 8Claude Code +9 - 0.530score
cpp-clang-tidy
hellyguo
Clang-Tidy 静态分析技能:使用 clang-tidy 进行 C/C++ 代码质量检测,支持自定义检查规则和自动修复
SkillCFreshness: C★ 8Claude Code +9
Signals
- Stars
- 8
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jul 27, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/hellyguo/self-ai-spec
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from hellyguo
- 0.618score
code-review
hellyguo
代码审查框架:通用审查流程 + 语言特定规则引用,支持多语言代码审查
SkillAFreshness: A★ 8Claude Code +9 - 0.614score
code-deconstruct
hellyguo
读取所有源代码,解构为设计图、设计文档、数据库设计; 没有执行文件,请按流程执行
SkillAFreshness: A★ 8Claude Code +9 - 0.592score
gdb-heap-analysis
hellyguo
GDB heap/arena memory analysis for core dump debugging.
SkillBFreshness: B★ 8Claude Code +9 - 0.589score
java-coverage
hellyguo
Strategies and patterns to boost test coverage to 80%+ line or 60%+ branch coverage.
SkillBFreshness: B★ 8Claude Code +9 - 0.581score
cpp-tscancode
hellyguo
TscanCode静态分析技能:使用TscanCode(腾讯开源)进行C/C++代码质量分析,检测缺陷、安全漏洞和代码风格问题
SkillBFreshness: B★ 8Claude Code +9 - 0.581score
java-check-spotbugs
hellyguo
SpotBugs静态分析技能:使用SpotBugs、Find Security Bugs、fb-contrib进行Java代码缺陷和安全分析
SkillBFreshness: B★ 8Claude Code +9
Cite this page
code-part-modification skill. Agent Mart. https://agentmart.dev/skills/hellyguo-code-part-modification (last updated 2026-10-24)