Repository navigation
Description
Summary
`/qa` Section 5's sibling-site scan (added in #573) catches cross-file sibling vulnerabilities — code in OTHER files matching the bug pattern. There's a complementary gap at the intra-file level: when the diff fixes a bug at line N, the same root-cause pattern often exists at sibling lines in the same file/function, and the literal-repro discipline doesn't catch it.
Evidence
During `/fullsolve 575` (PR #579, `templates/scripts/cleanup-worktree.sh`):
- The bug: `cd $WORKTREE_PATH; git worktree remove $WORKTREE_PATH` — every subsequent `git` call's cwd was invalidated by the destructive `git worktree remove`.
- Round-1 fix: I added `cd "$MAIN_WORKTREE"` immediately before the line cited by the issue body (the main worktree removal at line 76).
- Live AC repro passed (the literal issue-body scenario).
- Round-1 missed the structurally identical sibling site: three lines earlier, the `.exec-agents/agent-` cleanup loop had the SAME pattern (`for agent_dir in "$EXEC_AGENTS_DIR"/agent-; do ... git worktree remove "$agent_dir"`). The `2>/dev/null || true` guard would have made the failure silent. The user surfaced this with "any gaps?" — round-2 fix moved `cd` earlier to cover both call sites.
This is a structural failure mode: literal-repro testing verifies the cited symptom path but doesn't generalize across sibling call sites within the same file/function. `/qa` Section 5 (cross-file sibling-site scan from #573) would not have caught this either — the sibling site is in the same file, not a different one.
Proposed change
In `templates/skills/qa/SKILL.md` §4 "Failure Path & Edge Case Testing", add a fifth question:
```diff
Before any READY_FOR_MERGE verdict, complete the adversarial thinking checklist:
- "What would break this?" - Identify and test at least 2 failure scenarios
- "What assumptions am I making?" - List and validate key assumptions
- "What's the unhappy path?" - Test invalid inputs, failed dependencies
- "Did I test the feature's PRIMARY PURPOSE?" - If it handles errors, trigger an error
+5. "Does the same root-cause pattern exist at sibling sites in this file?" - The literal repro from the issue body is necessary but not sufficient. After the cited bug is fixed, audit other call sites in the same file (and same function/loop) that share the root-cause pattern. Examples: if a destructive operation invalidates a resource that subsequent code depends on, scan for other destructive operations on the same resource type. If a wrong null-check is the bug, scan for the same access pattern elsewhere. Complementary to Section 5's cross-file sibling-site scan: §4's question is intra-file; §5 is cross-file.
```
Use a language-neutral example in the SKILL prose so the discipline reads as universal, not bash-specific.
Mirror across all three skill directories: `.claude/skills/qa/SKILL.md`, `skills/qa/SKILL.md`, `templates/skills/qa/SKILL.md`.
Acceptance Criteria
- AC-1: §4 includes a fifth question prompting intra-file sibling-site audit, with a language-neutral example (no bash-specific phrasing).
- AC-2: Prose explicitly distinguishes from Section 5: §4 new question is intra-file (other lines/functions in the same file with the same root cause); §5 is cross-file (other files in the codebase with the same vulnerability).
- AC-3: Change is mirrored across all three `qa/SKILL.md` files.
- AC-4: SKILL.md output template's Self-Evaluation section adds a "Sibling-line audit:" line so QA reviewers must report findings (or "None — single-call-site fix"). Skipping the audit becomes visibly absent.
Notes
- Origin: PR fix(#575): cleanup-worktree.sh stays on main worktree before destructive remove #579 round-1 missed the exec-agents nested case; round-2 caught it after user prompted with "any gaps?". The discipline this proposes would have caught it on round 1.
- This is an additive checklist item, not a verdict-blocker. Reviewers who run the audit and find nothing simply note "Sibling-line audit: none." Reviewers who skip the audit are visibly skipping it — that's the lever.
- Cost: ~30 seconds of additional review time per PR for the audit. Worth it for the class of bug it catches.
- Relationship to feat(qa): add sibling-site scan prompt to first-pass /qa verdict checklist #573: complementary, not duplicate. feat(qa): add sibling-site scan prompt to first-pass /qa verdict checklist #573 caught the cross-file gap; this catches the intra-file gap. Together they cover the sibling-site vulnerability class.
Activity
admarble commentedon May 6, 2026
Plan
Acceptance Criteria
qa/SKILL.mdfiles. Verify: Integration —diff -q .claude/skills/qa/SKILL.md skills/qa/SKILL.md && diff -q .claude/skills/qa/SKILL.md templates/skills/qa/SKILL.mdboth clean.**Sibling-line audit:**bullet alongside the existing**Sibling sites considered:**. Verify: Manual — grep all three SKILL.md files forSibling-line audit:returns 3 hits.Implementation
Phase 1 — Resolve framing (REQUIRED before edits): Pick the §4-vs-§5 axis. Recommend Option A: reframe §5 prose ("same file/module" → "other files in the codebase," lines 1483 & 1485) so §4 Q5 owns intra-file. Confirm AC-4 targets the existing Risk Assessment output block (lines 1476 / 2551 / 2872), since no section literally named "Self-Evaluation" exists.
Phase 2 — Draft in
templates/skills/qa/SKILL.md:**Sibling-line audit:** [Adjacent call sites in the same file/function audited, OR "none — single-call-site fix"]to the Risk Assessment template (3 instances).Phase 3 — Mirror: Per
feedback_read_each_mirrored_file.mdandfeedback_grep_as_checklist.md— read each file independently before edits; copytemplates/skills/qa/SKILL.mdverbatim to.claude/skills/qa/SKILL.mdandskills/qa/SKILL.md. Rundiff -qbetween all three pairs as the AC-3 gate; grep all three for the new bullet (must return 3 hits).Phase 4 — Self-dogfood: Run new §4 Q5 mentally against PR #579's exec-agents loop. Confirm a reviewer following the prompt would have caught round-1's missed sibling site. Record one-line evidence in the QA comment.
Key Decisions
templates/skills/qa/SKILL.md; byte-mirror to the other two. Three-way sync is a documented pitfall.Open Questions
Risks & Conflicts
diff -q+ grep all three after.qa/SKILL.mdfiles, but in §3 (~line 793). §4 (~line 1454) is far away; no logical overlap. Standard text merge expected.Recommended Workflow
spec → exec → qa. Testgen skipped (all ACs Manual Test); no browser-test phase (no
.tsx/.jsx); no /verify phase (no scripts/CLI). Quality loop disabled.Label
Recommend
gh issue edit 587 --remove-label cli— this is a skill-prose change, not a CLI/interface change. Repo has nodocs/skillslabel.admarble commentedon May 6, 2026
Implementation Complete
PR: #589
AC Coverage
templates/skills/qa/SKILL.md:1462— Q5 with destructive-operation + null-check examples (no bash-specific phrasing)qa/SKILL.mdfilesdiff -q .claude/skills/qa/SKILL.md skills/qa/SKILL.md && diff -q .claude/skills/qa/SKILL.md templates/skills/qa/SKILL.mdboth clean.**Sibling-line audit:**bullet in 3 Risk Assessment instancesgrep -c "Sibling-line audit:" {templates,.claude,}.skills/qa/SKILL.md→ 3 hits per file (9 total).Files Changed
templates/skills/qa/SKILL.md(+10 / -6).claude/skills/qa/SKILL.md(+10 / -6)skills/qa/SKILL.md(+10 / -6)Spec Open Questions — Resolution
pre-tool.shregex blocks (intra-file) to "regex blocks repeated across multiple hook scripts" (cross-file). Without this reframe, AC-2's "§5 is cross-file" claim would be inaccurate.**Sibling sites considered:**.Quality Gates
npm run buildnpm run lintnpm testnpm run validate:skillsqa/validates (preexisting_shared/warning unrelated)Test Coverage Analysis
templates/skills/qa/SKILL.md.claude/skills/qa/SKILL.mdskills/qa/SKILL.mdSkill markdown is consumed by Claude at runtime, not unit-tested. Verification is the manual grep/diff per spec ACs.
Pre-PR Confidence Check
Next Steps
Run
/qa 587to verify the new prompt works as intended (mentally apply Q5 to PR #579's exec-agents loop and confirm a reviewer would catch round-1's missed sibling site).admarble commentedon May 6, 2026
QA Review for Issue #587 (Simple Fix)
Size Gate
AC Coverage
*/qa/SKILL.md:1462adds Q5 with two abstract examples ("destructive operation invalidates a resource", "wrong null-check") — no bash/shell-specific phrasing.When to apply, scan instructions, and trailing "look at adjacent files" line) so the cross-reference is honest.qa/SKILL.mdfilesdiff -q .claude/skills/qa/SKILL.md skills/qa/SKILL.md && diff -q .claude/skills/qa/SKILL.md templates/skills/qa/SKILL.md→ both clean.**Sibling-line audit:**line in 3 instancesgrep -c "Sibling-line audit:" $f→ 3 hits per file (9 total). Spec correctly resolved "Self-Evaluation" → existing Risk Assessment block (the only such template that exists).Coverage: 4/4 AC items fully met
Quality Metrics
any)CI Status
Plugin Structure Validationvalidate-skillsHooks ValidationtypecheckSetup Directory Creationvalidate-pluginbuild (20.x)build (22.x)CI Summary: 6 passed, 2 pending, 0 failed. No CI-related ACs (markdown-only change). Builds are in flight; ACs are unaffected because the changed files are skill prose with no compiled-code surface.
Code Review
Strengths:
pre-tool.shregex blocks (intra-file) to "regex blocks repeated across multiple hook scripts" (cross-file).feedback_read_each_mirrored_file.mdandfeedback_grep_as_checklist.md, all three skill directories are byte-identical, verified bydiff -q.(other lines/functions in the same file with the same root cause)and(other files in the codebase with the same vulnerability)clarifiers that make the intra/cross distinction unambiguous.Issues:
Suggestions:
'single-pattern file' / 'test-only diff'→'no cross-file siblings' / 'test-only diff'to align with the §5 reframe. ~30-second follow-up issue or rolled into the next QA-skill PR.Test Coverage Analysis
templates/skills/qa/SKILL.md.claude/skills/qa/SKILL.mdskills/qa/SKILL.mdCoverage: N/A — skill markdown is exercised by future
/qaruns, not Vitest. Verification mechanism is the literal grep/diff in the ACs (3 hits per file ✅, three-way mirror clean ✅).Anti-Pattern Detection
No code patterns to flag — all changes are prose in markdown. No
eval, noinnerHTML, no hardcoded secrets. Skill Command Verification + Detection Pattern Verification are both Not Required because:gh/npm/npx/git) in the diff.grep/awk/jq/sedinvocations or regex literals in the diff."Don't automate via grep — false-positive risk") but not as a command.Risk Assessment
**Sibling-line audit:**as boilerplate ("none — single-call-site fix") without doing the actual scan, neutralizing the value of the new prompt. Mitigation is the existingfeedback_qa_first_pass_thoroughness.mddiscipline; the lever here is visible absence, not a verdict-blocker.'single-pattern file'as a justification for "no sibling site exists." That phrase belonged to the pre-reframe §5 (intra-file). After this PR's §5 reframe, the example is stale. This is exactly the bug class the new §4 Q5 catches — and dogfooding it against this very PR surfaces the residue. Non-blocking; recommended as a follow-up.Self-Dogfood: §4 Q5 against PR #579 (the motivating example)
The issue body cites PR #579 (
templates/scripts/cleanup-worktree.sh) as the case study. Round 1 fixed the cited line (git worktree remove $WORKTREE_PATHaftercd $WORKTREE_PATH) but missed the structurally identical sibling site — the.exec-agents/agent-*cleanup loop three lines earlier with the samecd → destructive git worktree removepattern.Mentally applying the new §4 Q5 prompt to PR #579 round-1:
A reviewer following Q5 would have caught round-1's gap before the user prompted "any gaps?". ✅ Prompt works as intended.
Adversarial Re-Read (compact, per Simple Fix)
What the structured pipeline didn't surface:
'single-pattern file'example in §6d Q4 is now inconsistent with §5's cross-file reframe. Caught by dogfooding §4 Q5 on this PR.Examples:→Example:, plus added intra/cross-file parenthetical clarifiers in the closing sentence). No regression.spec:completedandexec:completedpresent; no prior QA marker.MEMORY.mddoes not bite here.Verdict: AC_MET_BUT_NOT_A_PLUS
All 4 ACs are literally MET. The change is small, focused, well-mirrored, and substantively improves the §5 framing while adding a discrete new prompt. CI is green except for two
buildjobs still in progress (markdown-only diff — no functional risk).The downgrade from
READY_FOR_MERGEis for one residue: §6d Q4's'single-pattern file'example is stale after the §5 reframe. The exec phase flagged it honestly and offered to defer; this QA confirms the deferral is safe but the cross-ref should be tidied in a follow-up. Without this small inconsistency, this PR would be A+.Documentation
[Unreleased]entry expected)Next Steps
build (20.x)andbuild (22.x)complete green — they're in progress and the diff is markdown-only, so no functional risk; the verdict is unaffected by their completion..claude/skills/qa/SKILL.md:1927(and mirrors) so §6d Q4's'single-pattern file'example matches the §5 reframe — e.g. change to'no cross-file siblings'. ~30-second fix; could roll into the next QA-skill change.fix(#587): §6d Q4 sibling-line residues — cross-ref §4 Q5 alongside §5
feat(#587): /qa §4 Q5 intra-file sibling-site audit + cross-file §5 r…
admarble commentedon May 7, 2026
QA Review for Issue #587 (Simple Fix)
Size Gate
package.jsonchangedAC Coverage
qa/SKILL.md:1462. Example uses "destructive operation"/"resource"/"null-check"/"access pattern" — all language-neutral; no bash-specific phrasing.qa/SKILL.mddiff -qbetween all three pairs returns no output.**Sibling-line audit:**bullet in 3 Risk Assessment instancesgrep -c '\*\*Sibling-line audit:\*\*' qa/SKILL.mdreturns 3 per file × 3 mirrors = 9 hits total. Bullets at L1478 (§5), L2554 (Simple Fix template), L2876 (Standard template).Coverage: 4/4 AC items fully met
Prior-QA Residue Resolution
The prior QA at
c2d9d796flagged one residue (verdict: AC_MET_BUT_NOT_A_PLUS): §6d Q4 still referenced'single-pattern file'(a §5-specific example phrase) after the §5 cross-file reframe. Commitbb36102efixed exactly that — §6d Q4 row at L1927 now reads: "Cross-file siblings: covered by Section 5's Sibling-site Scan when applicable. Intra-file siblings: covered by Section 4 Q5's audit. If both are Skipped/N/A, briefly justify why no sibling site exists (e.g. 'no cross-file siblings + single-call-site fix' / 'test-only diff')."grep -c 'single-pattern file\|same file/module'returns 0 in all three mirrors — the residue is fully cleaned up.Quality Metrics
any)CI Status
typecheckvalidate-skillsHooks Validationvalidate-pluginSetup Directory Creationbuild (20.x)build (22.x)Plugin Structure ValidationCI Summary: 8 passed, 0 pending, 0 failed.
Markdown-Only Diff Relaxation (post-#569): This QA exercises the relaxation logic that just merged. Helper output:
{"isMdOnly":true,"enabled":true,"relaxed":[],"gating":[]}— structural no-op (correct: relaxation is on, but there's nothing pending to reclassify). Had this QA run while the build matrix was mid-flight, those 3 checks would have been bucketed asrelaxedand the verdict could have resolved without waiting on them.Code Review
Strengths:
git worktree remove/ cwd invalidation bug that triggered this issue. The audit prompt would catch the same bug class on a first-pass review.Issues:
Suggestions:
Test Coverage Analysis
.claude/skills/qa/SKILL.mdskills/qa/SKILL.mdtemplates/skills/qa/SKILL.mdCoverage: N/A — prompt prose changes have no automated test surface. Validation is
npm run validate:skills(skill-structure correctness) plus the prior commit'snpm test(2819 tests passing per PR body).Anti-Pattern Detection
Risk Assessment
qa/SKILL.mdmirrors which are duplicates of one another, not sibling files in the cross-file sense).qa/SKILL.mdwere all updated in lockstep —grep -c 'single-pattern file\|same file/module'returns 0 in all three mirrors, confirming no stale framing residue. Single-call-site fix per AC-3's identical-mirror constraint.Adversarial Re-Read of Core Logic
Per Simple Fix Mode, this is the inline supplement (no formal §6d):
templates/scripts/cleanup-worktree.shexec-agents loop wheregit worktree remove $WORKTREE_PATHinvalidated cwd that subsequent code depended on. The new §4 Q5 example explicitly describes this pattern ("if a destructive operation invalidates a resource that subsequent code depends on, scan for other destructive operations on that resource type in the same function/loop"). The deferred self-dogfood from the PR body's test plan is now satisfied: the new prompt LITERALLY describes the bug it was designed to catch.pr589branch deleted. No untracked stale state.Verdict: READY_FOR_MERGE
All 4 ACs literally met. Prior QA's residue is fully resolved by commit
bb36102e. The §4 Q5 example matches the PR #579 motivating case verbatim, satisfying the deferred self-dogfood. 3 mirrors byte-identical. 8/8 CI green. No blocking issues; no improvement suggestions surfaced.The merged markdown-only-CI-relaxation logic from #569 engaged correctly here as a structural no-op (no pending checks to relax). First real-world post-merge validation passes.
Documentation
[Unreleased]entry expectedNext Steps