Files
ECC/docs/zh-TW/rules/git-workflow.md
T
haelyraandGitHub 569b1d5b32 fix: disable Claude co-author attribution by default (#2758)
* fix: disable Claude co-author attribution by default

* fix: harden default co-author opt-out and correct the docs

Follow-up on the co-author default in this PR.

- Remove the existsSync/writeFileSync race in the installer settings write
  (CodeQL js/file-system-race, high). A single guarded read now covers the
  fresh-install case, and unreadable or non-object settings are left untouched.
- Respect `attribution` as an explicit user choice. It supersedes
  `includeCoAuthoredBy` in Claude Code 2.1.x, so a user who configured it would
  otherwise have had a dead key written into their settings.
- Share one opt-out rule via scripts/lib/claude-commit-attribution.js instead of
  duplicating it across the installer and plugin setup.
- Update the git-workflow rule and its nine mirrors and translations, which
  still told users ECC does not ship this setting.

We keep writing the deprecated `includeCoAuthoredBy` key rather than
`attribution`: unknown keys fail Claude Code settings validation, so writing
`attribution` would break users on older versions.
2026-08-12 00:43:58 -04:00

1.3 KiB
Raw Blame History

Git 工作流程

Commit 訊息格式

<type>: <description>

<optional body>

類型:feat、fix、refactor、docs、test、chore、perf、ci

注意:ECC 管理的安裝會在 ~/.claude/settings.json 中設定 "includeCoAuthoredBy": false,因此提交預設不會附帶 Co-Authored-By。若要保留 Claude 的歸屬,請設定 "includeCoAuthoredBy": true 或設定 attributionECC 不會覆寫使用者的明確選擇。

Pull Request 工作流程

建立 PR 時:

  1. 分析完整 commit 歷史(不只是最新 commit
  2. 使用 git diff [base-branch]...HEAD 查看所有變更
  3. 起草全面的 PR 摘要
  4. 包含帶 TODO 的測試計畫
  5. 如果是新分支,使用 -u flag 推送

功能實作工作流程

  1. 先規劃

    • 使用 planner Agent 建立實作計畫
    • 識別相依性和風險
    • 拆解為階段
  2. TDD 方法

    • 使用 tdd-guide Agent
    • 先撰寫測試(RED
    • 實作使測試通過(GREEN
    • 重構(IMPROVE
    • 驗證 80%+ 覆蓋率
  3. 程式碼審查

    • 撰寫程式碼後立即使用 code-reviewer Agent
    • 處理關鍵和高優先問題
    • 盡可能修復中優先問題
  4. Commit 與推送

    • 詳細的 commit 訊息
    • 遵循 conventional commits 格式