docs(claude): scope conditional instructions to avoid priority conflicts#659
docs(claude): scope conditional instructions to avoid priority conflicts#659carlos-alm wants to merge 2 commits intomainfrom
Conversation
Replace unconditional "must"/"always"/"every" language with contextual guidance so agents can prioritize correctly: - Codegraph workflow: from mandatory 4-step checklist to pick-what-fits with explicit skip clause for non-code files and trivial edits - Bug mandate: from "fix the bug" (unconditional derail) to "flag it, fix if blocking" (scoped response) - Worktree: from "every session" to "before making code changes", with explicit skip for read-only tasks - Sync with main: from "always" to "before new feature work", with carve-out for continuing existing PR work
|
Claude finished @carlos-alm's task —— View job PR Review AnalysisReviewing PR #659: "docs(claude): scope conditional instructions to avoid priority conflicts" Todo List
Root Cause AnalysisProblem Being Solved: The current CLAUDE.md contains overly rigid "must"/"always"/"every" language that creates priority conflicts when AI agents need to balance competing requirements. Agents may mechanically follow all instructions even when contextually inappropriate (e.g., running full codegraph workflow on documentation fixes, creating worktrees for read-only reviews). Why This Approach: Converting absolute mandates to contextual guidance allows agents to exercise appropriate judgment. The changes preserve the intent while enabling smart prioritization:
Risk Assessment: ✅ LOW RISK - This is pure documentation refinement that improves agent behavior without weakening any actual behavioral requirements. Configuration Change Detection✅ NO HIGH-RISK CHANGES DETECTED - No linting rules, test configurations, build settings, or TypeScript strict flags touched. This is purely documentation improvement. Test Integrity✅ NO TEST-RELATED RED FLAGS - No test files modified, assertions weakened, timeouts increased, or coverage thresholds lowered. Code Quality Assessment✅ EXCELLENT DOCUMENTATION QUALITY - Clear language improvements, maintains all behavioral intent, adds helpful contextual guidance, eliminates poor agent prioritization triggers. Backlog Compliance
Critical ConcernsNONE - This is exemplary documentation improvement work. Final RecommendationRoot Cause AnalysisProblem Being Solved: CLAUDE.md contained rigid mandatory language causing agents to mechanically execute inappropriate workflows (e.g., full codegraph analysis on doc-only changes, worktrees for read-only reviews) Backlog Compliance
Critical ConcernsNone. Final Recommendation
|
Greptile SummaryThis PR refines Changes:
Confidence Score: 5/5Safe to merge — documentation-only change with no runtime impact, and no P0/P1 issues found. All findings are P2. The only substantive concern (ambiguous "Skip these" referent) was resolved in aa6f647 per the prior review thread. The remaining vagueness around "sync only if needed" is minor and doesn't affect correctness. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
Start([Agent starts task]) --> IsCodeChange{Making code\nchanges?}
IsCodeChange -- No --> ReadOnly[Read-only task\nSkip worktree\nSkip pre-commands]
IsCodeChange -- Yes --> Worktree[Run /worktree]
Worktree --> IsNewFeature{New feature\nor continuing PR?}
IsNewFeature -- New feature --> SyncMain[Sync with origin/main]
IsNewFeature -- Continuing PR --> SyncIfNeeded[Sync only if needed]
SyncMain --> PreCommands
SyncIfNeeded --> PreCommands
PreCommands{Non-code file,\ntrivial edit, or\nsufficient context?}
PreCommands -- Yes --> SkipAbove[Skip the four\npre-modification commands]
PreCommands -- No --> RunCommands[Pick relevant codegraph\ncommands: where / audit /\ncontext / fn-impact]
RunCommands --> Modify[Modify code]
SkipAbove --> Modify
Modify --> DiffImpact[codegraph diff-impact\n--staged -T\nunconditional]
DiffImpact --> Commit[Commit staged files]
Reviews (2): Last reviewed commit: "fix(docs): disambiguate skip-clause refe..." | Re-trigger Greptile |
CLAUDE.md
Outdated
| - `codegraph context <name> -T` — get full context (source, deps, callers) | ||
| - `codegraph fn-impact <name> -T` — check blast radius before editing | ||
|
|
||
| Skip these for non-code files, trivial edits, or when you already have sufficient context. |
There was a problem hiding this comment.
Ambiguous referent for "these"
The word "these" at line 20 immediately follows the four "Before modifying code" bullets, but a reader (or an agent) parsing the document linearly could interpret it as applying to all commands in the Codegraph Workflow section — including codegraph diff-impact --staged -T in the "After modifying code" subsection. That post-commit check is the most important safety step and should stay unconditional.
Consider making the scope explicit:
| Skip these for non-code files, trivial edits, or when you already have sufficient context. | |
| Skip the above commands for non-code files, trivial edits, or when you already have sufficient context. |
There was a problem hiding this comment.
Fixed — changed "Skip these" to "Skip the above commands" in aa6f647, making it explicit that the skip clause applies only to the four pre-modification bullets and not to the unconditional codegraph diff-impact --staged -T post-commit check.
Summary
Test plan