首页/ AI 技能 / @skilllib/skill-2014279416749174786
Skill站外收录 @skilllib/skill-2014279416749174786

observe-before-editing

强调在修改代码前必须先验证系统实际输出,通过检查缓存目录、日志文件、运行失败命令等方式确认真实状态,避免基于假设或代码逻辑主观推断问题根源,确保所有调试动作都建立在可观测证据之上。

0.0 (0) 139 次安装 原作者 编程导航
收录于 2026-01-22
效率工具 AI 技能

Skills.MD

# 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

评论 0

还没有评论,来抢沙发。