Observe Before Editing

作者 parcadeid07ff4b06b62無授權條款3.9K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫8 個月前更新

Observe Before Editing

AI 產生的概覽

指導在修改程式碼修正缺陷前,先確認系統實際產生了什麼輸出。

功能
這項技能提供一套簡短的除錯紀律:在改動程式碼之前,先核實系統實際產生了什麼。它列出若干步驟,例如列出預期存在的目錄與檔案、查看日誌中的錯誤、手動執行失敗的指令以看到真實錯誤。它也列出應避免的做法,包括在未檢查輸出的情況下假定鉤子沒有執行,以及混淆全域路徑與專案路徑。
適用情境
當懷疑有缺陷或失敗、但原因尚未確認時使用,尤其是在鉤子、快取或索引步驟看起來沒有執行時。它應在進行程式碼修改之前套用。
執行需求
不需要指令碼或特殊工具,僅為說明性指示。它假定代理能夠執行 ls、tail 等 shell 指令,並能檢視專案目錄與家目錄。

Observe Before Editing

Before editing code to fix a bug, confirm what the system actually produced.

Pattern

Outputs don't lie. Code might. Check outputs first.

DO

  1. Check if expected directories exist: ls -la .claude/cache/
  2. Check if expected files were created: ls -la .claude/cache/learnings/
  3. Check logs for errors: tail .claude/cache/*.log
  4. Run the failing command manually to see actual error
  5. Only then edit code

DON'T

  • Assume "hook didn't run" without checking outputs
  • Edit code based on what you think should happen
  • Confuse global vs project paths (check both: .claude/ and ~/.claude/)

Source Sessions

  • a541f08a: Token limit error was invisible until manual run revealed it
  • 6a9f2d7a: Looked in wrong cache path (~/.claude/ vs .claude/), assumed hook failure
  • a8bd5cea: Confirmed hook worked by finding output files in project cache
  • 1c21e6c8: Verified Artifact Index indexing by checking DB file exists

來源與署名

來源:parcadei/continuous-claude-v3位於.claude/skills/observe-before-editing提交d07ff4b

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架