Observe Before Editing

parcadei/continuous-claude-v3/.claude/skills/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 从公开仓库中收录这些内容。

举报或申请下架