Community程式設計與開發github.com

jaimegago/agent-skills

載入通用開發標準。適用於所有儲存庫。請在會話開始時或需要強化標準時調用。

agent-skills 是什麼?

此AI代理技能(jaimegago/agent-skills)強制執行一套不可協商的開發標準,適用於任何儲存庫。其設計旨在確保AI代理在程式碼庫中操作時,行為遵循嚴謹且可驗證的程序。核心原則包括:在沒有經由搜尋或讀取工具收集會話內證據之前,不得對程式碼狀態做出任何事實性主張(「先驗證再聲明」);在提議或進行編輯之前必須先讀取檔案(「先讀取再編輯」);嚴格實施最小變更,避免不必要的重構或抽象化;以及一套特定的「死程式碼刪除程序」,要求在刪除之前徹底搜尋所有引用。此外,該技能針對程式碼導航提供了詳細指引,優先使用語言伺服器(LSP)進行基於類型圖的操作,同時承認不同語言伺服器在完整性上存在差異,並強調採用文字搜尋作為驗證手段。它還制定了版本控制原則(非經明確請求不得進行git操作)以及一種鼓勵在工具呼叫失敗時進行診斷與替代方案思考的「受阻時」行為模式。此技能可與其他語言專屬技能(如go-backend、frontend-dev)搭配使用,以文件化特定語言伺服器的行為。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/jaimegago/agent-skills/tree/HEAD/dev-standards

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

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

說明文件

您現在必須遵守以下不可協商的開發標準。在本次會話的剩餘時間內,無一例外地套用這些標準。

先驗證再聲明

在沒有先使用適當的搜尋或讀取工具來確認之前,絕對不能對程式碼做出任何陳述——例如「這是未使用的」、「這是死程式碼」、「X 呼叫了 Y」、「這從未被引用」。每一個關於程式碼庫的事實性主張都必須以您在本次會話中收集到的證據為基礎。

如果您尚未搜尋過,您就不會知道。

先讀取再編輯

在提出或進行更改之前,務必先讀取檔案。絕不能根據對檔案內容的假設來進行編輯。

僅做最小變更

只更改直接要求的內容。不要進行重構、重新格式化、清理、添加註解、添加錯誤處理,或超出明確要求範圍的任何「改進」。與其過早進行抽象化,保留三行相似的程式碼會更好。

死程式碼刪除程序

當被要求刪除無用或未使用的程式碼時:

  1. 搜尋整個程式碼庫中所有要被刪除的每個符號的所有引用。
  2. 向使用者顯示搜尋結果。
  3. 然後才進行刪除。 絕不能跳過步驟 1 和步驟 2。

對於步驟 1,LSP 的引用搜尋(findReferences)在某些語言伺服器上可能計數不足(請參閱下方的「程式碼導航」)——對於刪除決策,請同時使用文字搜尋(grep)進行確認。計數不足意味著會刪除實際上正在使用的程式碼。

程式碼導航

在導航或理解現有程式碼時,若檔案類型有可用的語言伺服器(LSP 工具),應優先於文字搜尋使用。語言伺服器能理解型別圖——定義、引用、實作、呼叫階層——而文字搜尋則比對字串,包括註解、文件和不相關的識別碼。

  • 「這個在哪裡定義 / 它的型別是什麼?」→ goToDefinition / hover
  • 「誰使用了這個?」→ findReferences
  • 「在整個專案中按名稱尋找符號」→ workspaceSymbol
  • 「哪個實作了這個介面?」→ goToImplementation
  • 「誰呼叫了這個 / 它呼叫了什麼?」→ incomingCalls / outgoingCalls

運作機制:

  • LSP 操作是基於位置的(filePath + line + character),因此需要一個起始位置。高效的模式:進行一次文字搜尋(或 workspaceSymbol)來找到錨點,然後從那裡使用 LSP 進行語義圖分析。
  • 在某些環境中,LSP 工具是延遲載入的——在首次呼叫前先載入其模式(例如透過 ToolSearch)。在導航任務開始時載入一次;不要因為這一次性設定而反射性地退回使用 grep。
  • 將文字搜尋保留給它真正擅長處理的情況:非程式碼檔案、設定檔、日誌/字串文字和純文字。

完整性因語言伺服器而異,這與「先驗證再聲明」相互作用。 某些伺服器會主動索引並回傳完整結果;其他則被動索引,並可能回傳看似確定但不完整的答案(例如跨檔案的 findReferences 遺漏了尚未載入的檔案)。將可疑的低引用計數視為未經確認,而非事實。語言專屬技能(例如 go-backend、frontend-dev)會記錄各伺服器的行為——請參考它們。

Git 紀律

除非使用者在該訊息中明確要求,否則絕對不要進行提交、修改提交、推送或執行任何破壞性的 git 操作。批准一次推送並不代表授權未來所有的推送。

受阻時

如果工具呼叫失敗、被拒絕或某種方法受阻:請停止、診斷原因、考慮替代方案。不要重試相同的操作。不要強行繞過安全檢查。

誠實勝於流暢

不要在取得證據前就生成聽起來合理的答案。如果您不確定,請說出來。如果您需要先搜尋,就先搜尋——然後再回答。

Individual skills in this repo

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

jaimegago/agent-skills

Senior-level frontend engineering guidance covering architecture, component design, performance, design systems, API integration, and testing. Use this skill for ANY frontend engineering task: building components, reviewing architecture, setting up a project, debugging performance, designing a design system, writing tests, or integrating APIs. Trigger on keywords like "component", "React", "Angular", "TypeScript", "frontend", "UI", "design system", "performance", "bundle", "state management", "GraphQL", "Relay", or any web UI work. Also trigger for vague requests like "build me a page" or "add a feature" when a frontend context is present. This skill covers ALL output types: code, architecture documents, file structure recommendations, performance audits, and test strategies.

jaimegago/agent-skills

Use mid-debugging when a React UI does not reflect data that is known to be correct at its source — a component renders nothing or stale content even though the API returns the right response, a react-query / data-fetching hook seems stuck, or the network panel shows a successful 200 but the UI never updates. For DIAGNOSING this runtime/timing behavior by inspecting live state, distinct from building or styling UI. Not for build/compile errors, styling-only issues, or cases where the API genuinely returns wrong or missing data.

jaimegago/agent-skills

Commit staged and unstaged changes with an auto-generated Conventional Commit message, then sync the branch with the remote. Use this skill whenever the user says "commit", "save my changes", "push this", "commit and push", "sync", or any variation of wanting to commit their work and get it to the remote. Also trigger when the user says "ship it", "land this", "save and sync", or asks to wrap up a coding session. Do NOT use for complex git operations like rebasing, cherry-picking, or merge conflict resolution.

相關技能