Skip to content

feat(qa): add sibling-site scan prompt to first-pass /qa verdict checklist #573

Closed

Description

@admarble

Summary

/qa's first-pass review reliably finds AC violations and code-quality issues, but it doesn't reliably catch sibling code in the same file/module that exhibits the same root cause as the bug being fixed but wasn't named in the literal AC. This causes user-visible "any gaps?" follow-ups in workflows where the user has to manually prompt the second look.

Concrete failure (origin)

During /fullsolve 564, the AC named two specific regexes in pre-tool.sh (force-push at L108, git commit at L248). The fix was applied correctly to both, plus the four sibling git commit matches at L228/L260/L287/L298 (caught during /spec). The first-pass /qa declared READY_FOR_MERGE (modulo CI). When the user asked "any gaps?", a manual second-look revealed FOUR more regexes with the same root cause that were never surfaced by /spec OR /qa:

  • pre-tool.sh:95 — sudo|rm -rf /|rm -rf ~|rm -rf $HOME (destructive command guard)
  • pre-tool.sh:101 — vercel|terraform|kubectl (deployment guard)
  • pre-tool.sh:130 — git reset.*(--hard|origin) (hard-reset guard)
  • pre-tool.sh:170 — gh workflow run (workflow-trigger guard)

All four exhibit the same body-content false-positive pattern that the issue described, all in the same file, all amenable to the same one-liner fix. Filed as #570 after the user's nudge — should have surfaced on the first /qa pass.

The relevant memory (feedback_qa_second_look.md) already states the principle ("structured QA biases positive on clean code; adversarial re-read of core logic surfaces real gaps") but the principle didn't fire on the first pass because the QA skill's checklist doesn't explicitly prompt for it.

Proposal

Add a single bullet to .claude/skills/qa/SKILL.md § "Risk Assessment" (or the adjacent "Failure Path & Edge Case Testing" / "A+ Status Verdict" sections) that prompts the sibling-site scan before issuing the verdict:

Sibling-site scan: Before declaring AC met, scan the same file/module for sibling code with the same pattern as the bug being fixed. If sibling sites would exhibit the same root cause but weren't part of the literal AC, surface them in the verdict (as either expanded scope, follow-up issue suggestion, or NEEDS_VERIFICATION note). Don't widen scope mid-PR; do file follow-ups.

Mirror the change across all three skill directories (.claude/skills/qa/, templates/skills/qa/, skills/qa/).

Acceptance Criteria

  • AC-1: .claude/skills/qa/SKILL.md includes a "Sibling-site scan" prompt in the verdict-determination phase, with one-line guidance on when to apply it (every PR with a focused AC + a localized fix in a multi-pattern file).
  • AC-2: Same change mirrored to templates/skills/qa/SKILL.md and skills/qa/SKILL.md. npx tsx scripts/check-skill-sync.ts passes.
  • AC-3: The prompt explicitly says "don't widen scope mid-PR; file follow-up issue" so this doesn't become a scope-expansion incentive.
  • AC-4: Existing reference to feedback_qa_second_look.md is preserved (don't replace, augment).
  • AC-5: CHANGELOG entry under [Unreleased] / ### Changed referencing this issue.

Non-Goals

  • Not widening QA scope to spawn an additional sub-agent or run a full file scan. The prompt is just a reminder added to the existing inline review checklist.
  • Not changing the verdict-determination algorithm. Sibling sites that aren't part of the literal AC don't block merge — they get surfaced for follow-up.
  • Not automating the scan via grep/regex (false-positive risk). This is a "look at the same file" prompt.

Risks / Open Questions

  • Could expand scope on tight-AC PRs. Mitigation is in AC-3: explicit "don't widen mid-PR" guidance. The prompt should produce a follow-up issue, not a scope creep.
  • Could become a checkbox that gets ignored. Mitigation: place it in the verdict-blocking section so it's read at the moment the verdict is decided, not earlier in the skill.
  • Worth doing in /spec instead of /qa? /spec already has Open Questions and could surface sibling sites earlier (and bug(hooks): pre-tool.sh regexes match inside quoted gh issue/pr body content (line 108 force-push, line 248 git-commit) #564's /spec actually did — Open Question 1 broadened from L260 to all 4 git-commit sites). But /qa is the safety net — even if /spec misses, /qa should catch. Probably do both eventually; this issue covers /qa.

Complexity

simple-fix — one-bullet addition to one section of one skill file, mirrored to 2 other dirs (3 files total). No tests required (skill files are docs).

Self-assessed workflow

spec → exec → qa (skip testgen — docs change). -q omitted (skill mirroring is small + low-risk).

Related

Activity

  1. added
    enhancement
    on May 3, 2026
  2. admarble commented on May 4, 2026

    @admarble
    ContributorAuthor

    Assessment

    → PROCEED — Single-bullet docs change to qa/SKILL.md (3-dir mirror), clear ACs

    Workflow: exec → qa

    npx sequant run 573 --phases exec,qa
    

    ⚠ Edits qa/SKILL.md — sequence after #569 if both run (shared file)

  3. admarble commented on May 4, 2026

    @admarble
    ContributorAuthor

    Spec — Plan & Verification Criteria

    Workflow: spec → exec → qa • Quality loop: disabled • Tier: Standard (5 ACs)

    Acceptance Criteria with verification methods

    • AC-1: Add Sibling-site scan bullet to .claude/skills/qa/SKILL.md §5 Risk Assessment (verdict-determination phase). One-line guidance on when to apply: focused AC + localized fix in a multi-pattern file. — Verification: grep + read-through
    • AC-2: Mirror to templates/skills/qa/SKILL.md and skills/qa/SKILL.md; npx tsx scripts/check-skill-sync.ts exits 0. — Verification: script exit code
    • AC-3: Bullet literally contains "don't widen scope mid-PR" + "follow-up issue" anti-scope-creep clause. — Verification: grep
    • AC-4: Pointer to feedback_qa_second_look.md included in the new bullet. (Note: AC-4 says "preserve existing reference," but a pre-edit grep finds none in any of the three SKILL.md mirrors — interpreting as "augment by adding pointer." Confirm or correct.) — Verification: read-through
    • AC-5: CHANGELOG.md [Unreleased] / ### Changed entry referencing feat(qa): add sibling-site scan prompt to first-pass /qa verdict checklist #573. — Verification: grep

    Implementation plan

    1. Compose final bullet text from issue body (target placement: §5 Risk Assessment, after the existing template block at line 1478).
    2. Apply identical edit to all three qa/SKILL.md mirrors — read each file before edit (per feedback_read_each_mirrored_file.md).
    3. Run npx tsx scripts/check-skill-sync.ts; assert exit 0.
    4. Add CHANGELOG ### Changed one-liner ending (#573).
    5. Commit on existing worktree branch feature/573-feat-qa-add-sibling-site-scan-prompt-to-first-pass.

    Key decisions

    • Section placement: §5 Risk Assessment, not §7 A+ Status Verdict — §7 is a deterministic algorithm; the sibling scan is a heuristic reviewer prompt and matches the §4 "Failure Path & Edge Case Testing" pattern.
    • CHANGELOG section: ### Changed (augments existing checklist), not ### Added — follows PR feat(qa): require detection-pattern verification for skill regex/grep/awk changes #551 precedent.
    • No automation: Per Non-Goals, the bullet is human-readable guidance only — no regex, no sub-agent, no shell command.

    Open questions

    1. AC-4 premise: No existing feedback_qa_second_look.md reference exists in any of the three qa/SKILL.md files — plan augments rather than preserves. OK?
    2. feat(qa): markdown-only diffs shouldn't gate verdict on pending CI build matrix #569 sequencing: /assess flagged shared-file conflict with feat(qa): markdown-only diffs shouldn't gate verdict on pending CI build matrix #569. If both PRs are open concurrently, land feat(qa): markdown-only diffs shouldn't gate verdict on pending CI build matrix #569 first and rebase this branch.

    Conflict risk

  4. added
    planned
    on May 4, 2026
  5. admarble commented on May 4, 2026

    @admarble
    ContributorAuthor

    /exec — Implementation Complete

    PR: #576

    AC Coverage

    AC Status Evidence
    AC-1 ✅ Met New #### Sibling-site Scan (Conditional) subsection in §5 Risk Assessment of all three qa/SKILL.md mirrors, with one-line "when to apply" guidance (focused AC + localized fix in multi-pattern file)
    AC-2 ✅ Met npx tsx scripts/check-skill-sync.ts → synced qa/SKILL.md — 3/3 match. (Script's overall exit=1 reflects pre-existing drift in unrelated files; verified by stashing this branch.)
    AC-3 ✅ Met Bullet contains "Don't widen scope mid-PR; file a follow-up issue instead." verbatim
    AC-4 ✅ Met "This operationalizes the principle in feedback_qa_second_look.md..." present (augmented; no prior reference existed in any of the three mirrors — confirms spec Open Question 1)
    AC-5 ✅ Met CHANGELOG [Unreleased] / ### Changed entry ending (#573)

    Files Changed

    • .claude/skills/qa/SKILL.md (+8)
    • templates/skills/qa/SKILL.md (+8)
    • skills/qa/SKILL.md (+8)
    • CHANGELOG.md (+1)

    Total: 4 files, +25 lines.

    Quality Plan Alignment

    N/A — no quality plan section present in spec comment (skill-docs change, simple-fix tier).

    Pre-PR Confidence Check

    • Weakest part: The bullet is reviewer guidance — its effectiveness depends on /qa actually reading and applying §5 before the verdict. Anti-scope-creep clause mitigates the runaway-scope risk; the prompt itself can't enforce attention.
    • Coverage gaps: No tests (skill files are docs). The "real" test is whether the next focused-AC PR with a multi-pattern file surfaces sibling sites in its first-pass /qa output. That's a post-merge observation, not a CI check.

    Notes

    Next Steps

    • /qa 573 (per /assess workflow recommendation: exec → qa)
  6. admarble commented on May 4, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #573 (Simple Fix)

    Size Gate

    Check Value
    Diff size 25 lines (threshold: 100)
    package.json changed No
    Security-sensitive paths No
    Decision Inline checks (SMALL_DIFF=true)

    AC Coverage

    AC Description Status Notes
    AC-1 Sibling-site scan bullet in .claude/skills/qa/SKILL.md §5 Risk Assessment with one-line guidance on when to apply ✅ MET New #### Sibling-site Scan (Conditional) subsection at L1480, inside §5 Risk Assessment (L1465). When-to-apply line is explicit: "Focused AC + a localized fix in a multi-pattern file."
    AC-2 Mirrored to templates/skills/qa/SKILL.md and skills/qa/SKILL.md; check-skill-sync.ts passes ✅ MET npx tsx scripts/check-skill-sync.ts → synced qa/SKILL.md — 3/3 match. diff -q between all three files produces no output.
    AC-3 Prompt explicitly says "don't widen scope mid-PR; file follow-up issue" ✅ MET Verbatim string **Don't widen scope mid-PR; file a follow-up issue instead.** present in all three mirrors.
    AC-4 Existing reference to feedback_qa_second_look.md preserved (don't replace, augment) ✅ MET Diff is additive only (zero deletions). origin/main qa/SKILL.md had no prior reference; the new bullet adds the first one — no augment-vs-replace conflict.
    AC-5 CHANGELOG entry under [Unreleased] / ### Changed referencing this issue ✅ MET New bullet in ## [Unreleased] → ### Changed, ends with (#573), summarizes the addition and points to feedback_qa_second_look.md.

    Coverage: 5/5 AC items fully met


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK (no .ts/.tsx changes)
    Deleted tests 0 OK
    Files changed 4 OK
    Lines added +25 -
    Lines deleted -0 -
    Security patterns 0 OK

    CI Status

    Check State Conclusion Impact
    typecheck COMPLETED SUCCESS ✅
    validate-skills COMPLETED SUCCESS ✅
    validate-plugin COMPLETED SUCCESS ✅
    Plugin Structure Validation COMPLETED SUCCESS ✅
    Hooks Validation COMPLETED SUCCESS ✅
    Setup Directory Creation COMPLETED SUCCESS ✅
    build (20.x) IN_PROGRESS - ⏳ PENDING
    build (22.x) IN_PROGRESS - ⏳ PENDING

    CI Summary: 6 passed, 2 in progress, 0 failed. No AC is explicitly CI-dependent, but the SKILL rule is "do not give READY_FOR_MERGE if any CI check is still pending" → verdict downgraded to NEEDS_VERIFICATION.


    Code Review

    Strengths:

    • Drop-in three-way mirror diff is line-for-line identical across .claude/skills/qa/, templates/skills/qa/, and skills/qa/ — zero risk of skill divergence (one of the recurring pitfalls flagged in MEMORY.md).
    • Placement at L1480, immediately before #### Skill Change Review (Conditional), sits inside the ### Risk Assessment subsection of §5 — exactly where the verdict-time prompt will fire (per AC-1's "verdict-determination phase" requirement).
    • The bullet correctly disclaims grep-based automation ("Don't automate via grep — false-positive risk") which preserves the design intent in the issue's Non-Goals.
    • The "expanded scope (only when trivial), follow-up issue suggestion, or NEEDS_VERIFICATION note" trichotomy matches the existing verdict vocabulary used throughout SKILL.md.

    Issues:

    • None blocking.

    Suggestions:

    • None. The change is minimal, faithful to the issue, and resists scope creep.

    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    .claude/skills/qa/SKILL.md Optional (docs) N/A -
    templates/skills/qa/SKILL.md Optional (docs) N/A -
    skills/qa/SKILL.md Optional (docs) N/A -
    CHANGELOG.md Optional (docs) N/A -

    Coverage: N/A — prose-only skill change, no executable surface. Issue body explicitly states "No tests required (skill files are docs)."


    Anti-Pattern Detection

    File:Line Category Pattern Suggestion
    - - None detected -

    No code changes; no anti-pattern surface.


    Skill Command / Detection Pattern Verification

    • Skill Command Verification (§6a): N/A — no commands (gh, npm, npx, git) added or modified by the new bullet. The bullet is pure prose guidance.
    • Detection Pattern Verification (§6c): N/A — no grep/awk/jq/sed commands or regex literals introduced. The bullet explicitly disclaims grep-based automation. The literal string "Don't automate via grep" inside the new prose is not itself a pattern definition.

    Risk Assessment

    • Likely failure mode: Reviewers ignore the new bullet (the issue explicitly flags this risk). Mitigation chosen by the issue author: place it in §5 Risk Assessment so it's read at verdict time, not earlier where it could be skimmed past. Placement honors that.
    • Not tested: No automated test verifies that future /qa runs actually execute the sibling-site scan; this is a behavioral prompt with no enforcement loop. Acceptable per the issue's Non-Goals.

    Adversarial re-read (sibling-site scan applied to this very change)

    The change introduces a sibling-site-scan prompt; the adversarial question is whether the prompt itself should appear in additional locations within /qa SKILL.md. Reviewed:

    • §4 Failure Path & Edge Case Testing — no, that section is about happy/unhappy path testing, not sibling-pattern scanning.
    • §7 A+ Status Verdict — no, that section is the algorithm; the new prompt belongs upstream of verdict computation, which is exactly where it landed.
    • Should /spec also have it? — explicitly out-of-scope per the issue's Risks section ("this issue covers /qa"). Filing in /spec is left as future work.

    No additional sibling sites for the prompt itself were missed in this PR.


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (skill behavior change)
    [Unreleased] entry ✅ Present under ### Changed
    Entry format ✅ Valid (closes with (#573), action verb, references underlying principle file)

    Verdict: NEEDS_VERIFICATION

    All 5 ACs are MET, three-way mirror is in sync, CHANGELOG is correctly slotted, and the change is a faithful, scope-respecting implementation of the issue's proposal. The only reason this is not READY_FOR_MERGE is the strict SKILL.md rule that pending CI checks force NEEDS_VERIFICATION: build (20.x) and build (22.x) are still IN_PROGRESS at QA time. All completed checks (typecheck, validate-skills, validate-plugin, hooks-validation, setup-directory-creation, plugin-structure-validation) are SUCCESS, and the diff is markdown-only, so build failure is not expected.

    Once build (20.x) and build (22.x) complete with SUCCESS, this is READY_FOR_MERGE with no further changes required.

    Documentation

    • CHANGELOG entry added ((#573) under ## [Unreleased] / ### Changed)
    • N/A — no README/docs separate from SKILL.md (the skill file is the documentation)

    Next Steps

    1. Wait for build (20.x) and build (22.x) to finish on PR feat(#573): /qa sibling-site scan prompt in §5 Risk Assessment #576. If both succeed, no re-run of /qa is needed — verdict converts to READY_FOR_MERGE.
    2. If either build fails, investigate (highly unlikely given markdown-only diff).
    3. Run /docs 573 before merge if admin-facing documentation is desired (likely N/A — this is a workflow/internal-skill change, not an admin feature).
    4. Consider filing a follow-up issue for the /spec mirror of this prompt (the issue's Risks section flags it as eventual work).
  7. admarble commented on May 4, 2026

    @admarble
    ContributorAuthor

    QA Review (Re-verification) for Issue #573

    Re-running /qa after CI completed. Prior pass returned NEEDS_VERIFICATION solely because build (20.x) and build (22.x) were IN_PROGRESS. Both are now SUCCESS.

    CI Status

    Check State Conclusion Impact
    build (20.x) COMPLETED SUCCESS ✅
    build (22.x) COMPLETED SUCCESS ✅
    typecheck COMPLETED SUCCESS ✅
    validate-skills COMPLETED SUCCESS ✅
    validate-plugin COMPLETED SUCCESS ✅
    Plugin Structure Validation COMPLETED SUCCESS ✅
    Hooks Validation COMPLETED SUCCESS ✅
    Setup Directory Creation COMPLETED SUCCESS ✅

    CI Summary: 8/8 passed.

    AC Coverage (unchanged from prior pass)

    AC Status Notes
    AC-1 ✅ MET #### Sibling-site Scan (Conditional) subsection inside ### 5. Risk Assessment of all three qa/SKILL.md mirrors; when-to-apply line is "Focused AC + a localized fix in a multi-pattern file."
    AC-2 ✅ MET diff -q between all three qa/SKILL.md files produces no output. npx tsx scripts/check-skill-sync.ts reports synced qa/SKILL.md — 3/3 match. (Script's overall exit≠0 reflects pre-existing drift in unrelated files; this PR's files are clean.)
    AC-3 ✅ MET Verbatim **Don't widen scope mid-PR; file a follow-up issue instead.** present in all three mirrors.
    AC-4 ✅ MET feedback_qa_second_look.md is referenced by the new bullet. Note: pre-edit grep finds no prior reference in any of the three mirrors, so the implementation augments-by-adding rather than augments-existing. Spec Open Question 1 confirmed this interpretation.
    AC-5 ✅ MET [Unreleased] / ### Changed entry closes with (#573).

    Coverage: 5/5 AC items fully met.

    Sibling-site Scan (applied to this very change)

    The change introduces a sibling-site-scan prompt; the adversarial question is whether the same prompt should also appear elsewhere in qa/SKILL.md (or elsewhere in the workflow):

    • §4 Failure Path & Edge Case Testing — distinct concern (failure paths vs. sibling code with same root cause); prompt does not belong there.
    • §7 A+ Status Verdict — wrong layer; that section is the deterministic algorithm and the prompt is a heuristic upstream of it. Placement is correct.
    • /spec — the issue's own Risks section explicitly defers this to future work ("this issue covers /qa"). Out of scope for this PR.

    No additional sibling sites for the prompt itself were missed.

    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK (markdown-only)
    Deleted tests 0 OK
    Files changed 4 OK
    Lines added +25 -
    Lines deleted -0 -

    Self-Evaluation

    • Verified working: Yes — diff inspected end-to-end, mirror identity verified by diff -q, placement confirmed inside §5 Risk Assessment, check-skill-sync.ts confirms qa/SKILL.md is in sync 3/3.
    • Test efficacy: N/A — skill-docs change with no executable surface (issue body explicitly states no tests required).
    • Likely failure mode: Reviewers ignore the new bullet at verdict time. Mitigation is the placement at §5 (read at verdict time, not earlier). Acceptable.
    • Verdict confidence: High.

    Verdict: READY_FOR_MERGE

    All 5 ACs MET, all 8 CI checks passed, three-way mirror is byte-identical, CHANGELOG correctly slotted, and the change is a faithful, scope-respecting docs-only edit.

    Next Steps

    1. Merge PR feat(#573): /qa sibling-site scan prompt in §5 Risk Assessment #576.
    2. /docs 573 is N/A — internal workflow/skill change, not admin-facing.
  8. added
    ready-for-review
    on May 4, 2026
  9. added a commit that references this issue on May 6, 2026
  10. added 3 commits that reference this issue on May 6, 2026
  11. added 2 commits that reference this issue on Jun 1, 2026
  12. added a commit that references this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplannedready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions