minor-change

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Minor Change Workflow

小幅变更工作流

For small adjustments: text changes, style tweaks, config updates, removing dead code, renaming, etc. No design discussion needed.
针对小幅调整:文本修改、样式微调、配置更新、移除死代码、重命名等。无需进行设计讨论。

1. Sync main

1. 同步主分支

git checkout main && git pull
git checkout main && git pull

2. Create worktree and branch

2. 创建工作树与分支

git worktree add .claude/worktrees/chore-<name> -b chore/<description>   # or fix/<description>
cd .claude/worktrees/chore-<name>
All work happens in the worktree — main stays clean.
git worktree add .claude/worktrees/chore-<name> -b chore/<description>   # or fix/<description>
cd .claude/worktrees/chore-<name>
所有工作都在工作树中进行——主分支保持干净。

3. Make the change

3. 进行变更

  • If the change touches logic, write a test first (TDD)
  • If purely cosmetic (text, style, config), test is optional
  • Run full test suite after changes
  • 若变更涉及逻辑,先编写测试(TDD)
  • 若仅为外观调整(文本、样式、配置),测试为可选
  • 变更完成后运行完整测试套件

4. Verify

4. 验证

  • Run full test suite
  • Verify compilation if code changed
  • 运行完整测试套件
  • 若代码有变更,验证编译是否通过

5. Code Review

5. 代码审查

  • Self-review via
    git diff main...HEAD
  • Or dispatch a code-review subagent if available
  • Fix all issues found before proceeding
  • 通过
    git diff main...HEAD
    进行自我审查
  • 若可用,可调度代码审查子Agent
  • 在继续下一步前修复所有发现的问题

6. Create PR

6. 创建PR

  • Commit with concise message
  • Push and create PR via
    gh pr create
  • Wait for CI/CD checks to complete:
    gh pr checks <number> --watch
  • If checks fail, fix the issues and push again — do not notify the user until all checks are green
  • Once all checks pass, return the PR URL and ask the user to review
  • DO NOT merge — wait for explicit approval
  • 提交时使用简洁的信息
  • 推送并通过
    gh pr create
    创建PR
  • 等待CI/CD检查完成:
    gh pr checks <number> --watch
  • 若检查失败,修复问题后重新推送——在所有检查通过前不要通知用户
  • 所有检查通过后,返回PR链接并请求用户审查
  • 请勿合并——等待明确的批准

7. Merge (only when approved)

7. 合并(仅在获得批准后)

  • gh pr merge <number> --merge
  • Clean up worktree:
    cd <project-root> && git worktree remove .claude/worktrees/chore-<name>
  • git checkout main && git pull && git branch -d chore/<description>
  • gh pr merge <number> --merge
  • 清理工作树:
    cd <project-root> && git worktree remove .claude/worktrees/chore-<name>
  • git checkout main && git pull && git branch -d chore/<description>

Rules

规则

  • Never merge without explicit approval
  • Never push directly to main
  • No dead code, no silent excepts, no string literals for constants
  • Keep changes small and focused — one concern per PR
  • 未经明确批准绝不要合并
  • 绝不要直接推送到主分支
  • 无死代码、无静默异常、无用于常量的字符串字面量
  • 保持变更小而集中——每个PR仅处理一个关注点

Quality Checklist

质量检查清单

Before every PR, answer each item and present as a markdown table:
#CheckAnswer
1What changed — what was tweaked and how[brief]
2Root cause fix — is the change thorough, or surface-level only?[yes/no + evidence]
3Single source of truth — no duplicate data paths or redundant caches introduced?[yes/no + evidence]
4Test regression — do all existing tests pass?[pass count / fail count]
5Reuse — did you reuse existing patterns/functions, or reinvent something?[yes/no + evidence]
  • If any answer is unsatisfactory, fix it before creating the PR
  • Be honest — don't beautify answers
在创建每个PR前,回答以下各项并以Markdown表格形式呈现:
#检查项回答
1变更内容——调整了什么以及如何调整[简要说明]
2根源修复——变更是否彻底,还是仅停留在表面?[是/否 + 依据]
3单一数据源——是否引入了重复的数据路径或冗余缓存?[是/否 + 依据]
4测试回归——所有现有测试是否通过?[通过数量 / 失败数量]
5复用性——是否复用了现有模式/函数,还是重新实现了?[是/否 + 依据]
  • 若任何答案不令人满意,在创建PR前修复问题
  • 请诚实作答——不要美化答案