Community生產力與協作github.com

gener8v/gener8v.claude-skills.engineering

在提交前,找出並更新每個被改動觸及的文件,或一行確認無需改動。避免過時文字、遺漏文件與重複資訊。用於任何提交或 PR 之前,以及被問「文件是否最新」、「為此改動更新文件」或「我是否漏了 README 改動」時。

gener8v.claude-skills.engineering 是什麼?

此技能確保程式碼與其文件在同一提交中同步更新,解決文件老化、遺漏與重複三種常見問題。支援所有版本控制驅動的開發環境(如 Claude Code、Cursor、Codex),透過一系列步驟引導使用者:先查看暫存區改動,讀取專案自有規則(如 CLAUDE.md、CONTRIBUTING.md),再利用路由表將每個改動歸檔到唯一文件。若需重新命名或刪除名稱,使用 git grep 找出所有過時參考並修正。編輯時僅改動因程式碼變更而變得不正確或不完整的部分,最後將文件變更與程式碼一同提交。當文件歸屬不明確時,技能會詢問使用者而非自行新建文件。若專案有 SPEC.md 或 gener8v 規格文件則優先遵循規格定義的行為。此技能不處理 .gener8v/ 下的管線文件,也不適用於建立整套文件或填補大量空缺(此時應使用 documentation-bootstrap 技能)。與 github-pr-merge 和 github-release 技能配合,能在 PR 合併前檢查文件狀態,並確保 CHANGELOG 的 Unreleased 區段保持最新。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/gener8v/gener8v.claude-skills.engineering/tree/HEAD/skills/documentation-sync

Installed? Explore more 生產力與協作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

文件同步

程式碼與其文件應在同一提交中一起變更。錯誤的文件比沒有文件更糟。

文件出錯的三種方式

  • 過時。 文件仍描述舊的行為、名稱或指令。
  • 遺漏。 新的行為、指令或設定沒有對應文件。
  • 重複。 同一件事出現在兩處,後來其中一處修改而另一處沒有。

步驟

  1. 查看改動內容。
    git diff --cached --stat
    git diff --stat
    
  2. 找出專案自有規則。 閱讀 CLAUDE.md、CONTRIBUTING.md 和 docs/README.md。如果它們說明了哪份文件負責哪個主題,就遵循這些規則。這些規則優先於步驟 3。
  3. 將每個改動歸檔到對應的文件。 使用 resources/doc-routing.md。一件事只屬於一個文件,其他文件則連結到它。
  4. 尋找過時的參考。 針對每個重新命名或移除的名稱(函式、旗標、端點、設定、檔案路徑、指令):
    git grep -n '<舊名稱>'
    
    修正每個在文件中出現的結果。再次執行 grep。後置條件是:沒有結果,或僅保留必須存在的結果(例如關於重新命名的 CHANGELOG 條目)。
  5. 編輯。 僅改動程式碼變更所導致的不正確或不完整之處。不要改寫無關的段落。如需清晰的措辭,若已安裝 simple-english 技能則可使用它。
  6. 一起提交。 將文件變更與程式碼一同放入暫存區。不要將它們放在後續的 PR 中。
  7. 報告。 列出你修改過的文件。如果無需改動,用一行說明原因。例如:「無需文件:內部重構,行為、指令或設定均無變更。」

當歸屬不明確時

請詢問使用者。不要為了迴避問題而建立新文件。

一個有用的判斷:它是關於當前狀態的事實(設定、版本、狀態)嗎?如果是,放入參考文件或狀態文件。它是程序(步驟)嗎?如果是,放入擁有該程序的操作指南、操作手冊或技能中。

規格優先

如果倉庫中有 SPEC.md(參見 engineering:spec-writing)或 .gener8v/specifications/ 下的 gener8v 規格檔,它們定義了預期的行為。

  • 若你的變更符合規格所述,則規格無需編輯。
  • 若你的變更與規格矛盾,請停止。告知使用者。先透過該規格的負責人修改規格:engineering:spec-writing 負責 SPEC.md,gener8v:specification 負責管線規格。不要為了符合程式碼而默默地修改規格。

管線文件

請勿手動編輯 .gener8v/ 下的檔案。gener8v 管線技能會撰寫並更新它們。

相關技能

  • engineering:documentation-bootstrap:當整份文件缺失,而不僅僅是一個段落時使用。
  • engineering:github-pr-merge:在 PR 合併前執行此檢查。
  • engineering:github-release:讀取此技能持續維護的 CHANGELOG Unreleased 區段。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

gener8v/gener8v.claude-skills.engineering

Find and run a project's test, lint, type-check, build and dev-server commands, read the results correctly, and seed a throwaway database when UI work needs realistic data. Never seeds the project's real or default database. Use before 'run the tests', 'lint this', 'does it build', 'start the app so I can see it', 'seed some demo data', and before you claim that a change works. Not for deployment or CI pipeline design; use the project's own deploy tooling for those.

gener8v/gener8v.claude-skills.engineering

Create or top up a project's documentation set: list what exists, let the user choose which document types to add, collect one shared fact sheet from the code, write the documents (in parallel when there are several), then check them against each other and against the code. Use when asked to 'bootstrap the docs', 'start the documentation', 'we have no README or ARCHITECTURE', or 'fill in the missing docs'. Not for the per-commit update of existing documents (documentation-sync), and not for gener8v pipeline documents (gener8v:brownfield and gener8v:planning make those).

gener8v/gener8v.claude-skills.engineering

Put work on the correct branch before the first edit. Finds the base branch, starts a well-named branch from the current remote tip, and sets up one worktree per agent for parallel work. Use at the start of any change to a tracked file, such as 'start on issue 42', 'fix this typo', 'set up branches for these three tickets', or before you start sub-agents that edit code. Not for opening or merging a PR (github-pr-merge) or for history rewrites and other risky git commands (git-safety).

gener8v/gener8v.claude-skills.engineering

Approval gate for git commands that destroy work or skip checks: force-push, --no-verify, signing bypass, reset --hard, clean -f, discarding uncommitted edits, branch or tag deletion, rewriting pushed commits and push --mirror. Each one needs the user's explicit approval at that moment; an earlier approval never carries over. Also covers a secrets check before a commit and what to do when a secret is already committed. Use before any of these commands, or when asked to 'force push', 'skip the hooks', 'throw away my changes' or 'delete that branch'. Not for normal branching (git-branching) or the PR flow (github-pr-merge).

相關技能