Skip to content

feat(spec): mirror /qa sibling-site scan prompt into /spec planning checklist #580

Closed

Description

@admarble

Summary

#573 added a sibling-site scan prompt to /qa (PR #576) that fires before the verdict on focused-AC PRs touching multi-pattern files. The issue body's Risks section explicitly flagged that the same prompt belongs in /spec too — earlier in the workflow — but deferred it as out-of-scope for #573. This issue closes the loop.

From #573 / Risks: "Worth doing in /spec instead of /qa? /spec already has Open Questions and could surface sibling sites earlier (and #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."

Rationale

Catching sibling sites at /spec time is strictly cheaper than catching them at /qa time:

  • Pre-implementation: scope can still be widened in the same PR with no merge cost.
  • Pre-implementation: the planner can ask the user up front whether to expand scope.
  • Post-implementation: any expansion either pads the PR (already implemented) or becomes a follow-up issue (process tax).

The /qa prompt is the safety net — /spec should be the front line.

Proposal

Add a single bullet to .claude/skills/spec/SKILL.md in the Open Questions / planning section that prompts a sibling-site scan during plan generation:

Sibling-site scan (Conditional): When the AC is focused and the fix is localized to a multi-pattern file (≥3 instances of the affected pattern in the same file — e.g. the regex blocks in `pre-tool.sh`), scan the same file/module for sibling code matching the bug's root cause. Surface findings as either (a) an Open Question proposing scope expansion (if trivial), or (b) a recommended follow-up issue. Don't silently widen scope; the user decides.

Mirror across all three spec/SKILL.md directories.

Acceptance Criteria

  • AC-1: .claude/skills/spec/SKILL.md includes a "Sibling-site Scan" bullet in the planning / Open Questions section, with the same trigger definition as the /qa mirror (≥3 instances of the affected pattern + concrete example).
  • AC-2: Mirrored to templates/skills/spec/SKILL.md and skills/spec/SKILL.md; npx tsx scripts/check-skill-sync.ts reports synced spec/SKILL.md — 3/3 match.
  • AC-3: Bullet output options are scoped to planning-stage choices: Open Question proposing scope expansion, OR recommended follow-up issue. (Unlike /qa, no NEEDS_VERIFICATION option — that verdict bucket doesn't apply at spec time.)
  • AC-4: Pointer to feedback_qa_second_look.md included for the underlying principle.
  • AC-5: CHANGELOG entry under [Unreleased] / ### Changed referencing this issue, ≤4 lines (matching neighbor entries).

Non-Goals

  • Not automating the scan via grep or sub-agent. Pure prose prompt, like /qa.
  • Not mandating scope expansion. The bullet's purpose is to surface, not to widen.
  • Not updating /qa — #573 / #576 covers that side.

Risks / Open Questions

  • Could expand /spec plans on tight-AC issues. Mitigation: AC-3 explicitly says the planner offers the choice rather than silently broadening — the user decides.
  • Where exactly in spec/SKILL.md? Likely near the Open Questions / Conflict Risk section so it integrates with existing user-facing planning prompts. Investigate during /spec.

Complexity

simple-fix — one bullet added to one section of one skill, mirrored across 3 dirs. No tests required (skill files are docs).

Self-assessed workflow

spec → exec → qa (skip testgen — docs change).

Related

  • #573 / PR #576 — /qa mirror; this issue is the deferred /spec follow-up
  • feedback_qa_second_look.md — underlying principle
  • #570 — original gap from /fullsolve 564

Activity

  1. added
    enhancement
    on May 6, 2026
  2. admarble commented on May 7, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (5 ACs, 4 directories)

    AC Quality Check

    All 5 ACs are concrete and measurable — file/string presence, CLI exit-state (3/3 match), and CHANGELOG line-count cap. No vague/unmeasurable language. Pass.


    Scope Assessment

    Non-Goals: Provided. (1) No grep/sub-agent automation — pure prose prompt; (2) no mandatory scope expansion — surface only; (3) no /qa changes — already done in #573 / #576.

    Metric Value Status
    Feature count 1 (mirror one prompt + CHANGELOG) ✅
    AC items 5 ✅
    Directory spread 4 (.claude/skills/spec/, templates/skills/spec/, skills/spec/, root for CHANGELOG.md) ✅

    Verdict: ✅ SCOPE_OK — focused docs mirror with a known exemplar (PR #576).


    Conflict Risk Analysis

    ⚠️ Active worktree #571 (PR #586 OPEN) edits all four target files: .claude/skills/spec/SKILL.md, templates/skills/spec/SKILL.md, skills/spec/SKILL.md, and CHANGELOG.md.


    Acceptance Criteria

    AC-1: .claude/skills/spec/SKILL.md includes a "Sibling-site Scan" bullet with same trigger definition as /qa mirror

    Verification: Manual Test
    Scenario: Given .claude/skills/spec/SKILL.md after the change → When grepping for Sibling-site Scan, ≥3, and pre-tool.sh → Then all three strings appear in the same subsection
    Assumptions: Subsection placed under ## Context Gathering (after "Feature Branch Context", before "Verification Method Decision Framework"); trigger phrasing mirrors /qa SKILL.md L1545–1549

    AC-2: Mirrored to all three skill dirs; check-skill-sync.ts reports synced spec/SKILL.md — 3/3 match

    Verification: Integration Test
    Scenario: Given the change applied to all three mirrors → When running npx tsx scripts/check-skill-sync.ts → Then stdout contains the literal line synced spec/SKILL.md — 3/3 match
    Assumptions: scripts/check-skill-sync.ts exists and currently reports spec/SKILL.md — 3/3 match on main (verified — see baseline run); script may exit 1 due to pre-existing drift in unrelated files, which is acceptable per PR #576 precedent

    AC-3: Bullet output options scoped to planning-stage only (Open Question OR follow-up issue; no NEEDS_VERIFICATION)

    Verification: Manual Test
    Scenario: Given the new subsection text → When read end-to-end → Then exactly two output options are listed (scope-expansion via Open Question, or follow-up issue) and the string NEEDS_VERIFICATION does not appear in the new content
    Assumptions: NEEDS_VERIFICATION is a /qa-only verdict bucket that does not exist at planning time

    AC-4: Pointer to feedback_qa_second_look.md included

    Verification: Manual Test
    Scenario: Given the new subsection → When grepping for feedback_qa_second_look.md → Then the filename appears at least once with explanatory framing (matching the precedent in /qa SKILL.md L1553)

    AC-5: CHANGELOG entry under [Unreleased] / ### Changed, ≤4 lines, references #580

    Verification: Manual Test
    Scenario: Given CHANGELOG.md after the change → When inspecting the [Unreleased] / ### Changed block → Then a new bullet appears, line count ≤4, ending with (#580)
    Assumptions: Format matches the existing #573 entry directly above (one-bullet, prose-style, trailing (#NNN))


    Implementation Plan

    Phase 1: Mirror the prompt

    1. Read .claude/skills/qa/SKILL.md L1545–1553 to anchor the exact phrasing pattern (already confirmed — see context).
    2. Locate insertion point in .claude/skills/spec/SKILL.md: end of ## Context Gathering section, after ### Feature Branch Context (line ~143), before ## Verification Method Decision Framework (line ~145). Rationale: this is where the planner finishes gathering context and moves toward verdict synthesis — symmetric to /qa's placement under §5 Risk Assessment.
    3. Insert new ### Sibling-site Scan (Conditional) subsection. Proposed text (3 short paragraphs):
      • When to apply: ≥3 occurrences of the affected pattern in the same file (cite pre-tool.sh regex blocks as concrete example).
      • During plan generation: scan sibling code; surface findings as (a) an Open Question proposing scope expansion (only when trivially co-located), or (b) a recommended follow-up issue in the plan. Explicitly call out that the user decides — no silent widening.
      • Why earlier is cheaper: one-line framing — front-line vs. /qa's safety net. Pointer to feedback_qa_second_look.md.
      • Drop the /qa-specific clauses: no NEEDS_VERIFICATION option (AC-3); no orchestrator-vs-sub-agent split (spec planner is orchestrator end-to-end).

    Phase 2: 3-dir sync + CHANGELOG

    1. Edit each mirror independently (per feedback_read_each_mirrored_file.md): .claude/skills/spec/SKILL.md → templates/skills/spec/SKILL.md → skills/spec/SKILL.md. Verify with diff -q between any two pairs after each edit.
    2. Run npx tsx scripts/check-skill-sync.ts | grep "spec/SKILL.md" — expect synced spec/SKILL.md — 3/3 match.
    3. CHANGELOG entry under [Unreleased] / ### Changed, ≤4 lines, ending (#580). Mirror the structure of the existing feat(qa): add sibling-site scan prompt to first-pass /qa verdict checklist #573 entry (/qa Sibling-site Scan prompt) directly above.

    Design Review

    1. Where does this logic belong? Pure docs — spec/SKILL.md Context Gathering section. No code surface.
    2. What's the simplest correct approach? Prose mirror of /qa §5 subsection, scope-trimmed to planning-stage options (drop NEEDS_VERIFICATION, drop orchestrator/sub-agent split). Rejected: extracting a shared _shared/references/sibling-site-scan.md — premature abstraction for one duplication, and the spec/qa variants diverge on output options anyway.
    3. What existing pattern does this follow? PR feat(#573): /qa sibling-site scan prompt in §5 Risk Assessment #576 (/qa mirror, +14/-1 per skill file, ~+1 CHANGELOG line, identical 3-dir mirror pattern). Same template, same scope.
    4. What would a senior reviewer challenge? "Why a new subsection under Context Gathering instead of folding into Open Questions guidance in the Output Template?" Answer: Open Questions is a template slot in the planner's output; sibling-site scan is a planner behavior that produces an Open Question (or a follow-up issue recommendation). Behavior belongs in Context Gathering; the output slot it populates is Open Questions. Symmetric to /qa, where Sibling-site Scan is a reviewer behavior that populates the Sibling sites considered: Risk Assessment template slot.

    Feature Quality Planning

    All standard checks pass. Notable items:

    • Test fixture: No automated test — skill files are docs. Per issue Non-Goals: pure prose prompt. AC-2's check-skill-sync.ts is the only programmatic verification.
    • Adversarial re-read trigger: This change directly operationalizes feedback_qa_second_look.md and feat(qa): add sibling-site scan prompt to first-pass /qa verdict checklist #573. Worth a manual second read of the new subsection during /qa to confirm the planning-stage scoping reads cleanly without the NEEDS_VERIFICATION clause it inherits from /qa.

    Open Questions

    1. Subsection placement — Recommendation: end of ## Context Gathering, after ### Feature Branch Context. Impact if wrong: a placement under "Open Questions" output template would conflate planner behavior with output structure; placement near "Verification Method Decision Framework" would confuse the reader (this is plan-time scope, not verification choice).

    2. Should the prompt explicitly call out CLI flags --skip-ac-lint / --skip-scope-check as siblings? — Recommendation: No. Those flags govern planner checks, not sibling-site scope. Keep the new subsection narrowly about pattern siblings. Impact: if added, dilutes the focused mirror.

    3. CHANGELOG section choice — ### Changed or ### Added? — Recommendation: ### Changed (matches feat(qa): add sibling-site scan prompt to first-pass /qa verdict checklist #573 entry precedent for the symmetric /qa change). Impact: minor cosmetic if reversed.


    Recommended Workflow

    Phases: spec → exec → qa
    Quality Loop: disabled (default)
    Reasoning: Pure docs mirror; no Unit Test ACs, AC-2's Integration Test is a single one-line CLI assertion against an existing script (no new tests to stub); skip testgen per issue self-assessment. UI/security/breaking labels absent. Standard tier with all-Manual + 1 Integration verification = spec → exec → qa is sufficient.


    Label Review

    Current: enhancement
    Recommended: enhancement, simple-fix, docs-only
    Reason: Issue body self-classifies as simple-fix and the change is genuinely a 3-dir-mirrored prose addition with one CHANGELOG line. Adding simple-fix + docs-only would unlock Simple-tier output for any future /spec re-run and signal scope to reviewers.
    Quality Loop: Will not auto-enable (no complex/refactor/breaking label).

    → gh issue edit 580 --add-label simple-fix --add-label docs-only


    --- DRAFT GITHUB ISSUE COMMENT (PLAN) ---

    Plan

    Mirror the /qa §5 Sibling-site Scan prompt into /spec as a new ### Sibling-site Scan (Conditional) subsection at the end of ## Context Gathering, scope-trimmed to planning-stage output options.

    Acceptance Criteria (verification methods):

    • AC-1: Sibling-site Scan bullet present with ≥3 trigger + pre-tool.sh example (Manual)
    • AC-2: npx tsx scripts/check-skill-sync.ts → synced spec/SKILL.md — 3/3 match (Integration)
    • AC-3: Output options = (Open Question | follow-up issue); no NEEDS_VERIFICATION (Manual)
    • AC-4: Pointer to feedback_qa_second_look.md included (Manual)
    • AC-5: CHANGELOG entry under [Unreleased] / ### Changed, ≤4 lines, ends (#580) (Manual)

    Phases: spec → exec → qa (no testgen — docs change with single CLI verification).

    Conflict watch: PR #586 (issue #571) is open against the same four files but spatially non-overlapping (different sections in spec/SKILL.md; different [Unreleased] entries in CHANGELOG.md). Coordinate at merge time.

    Open Questions to resolve at exec time:

    1. Subsection placement — proposed: end of ## Context Gathering, after ### Feature Branch Context.
    2. CHANGELOG section — proposed: ### Changed (matches feat(qa): add sibling-site scan prompt to first-pass /qa verdict checklist #573 precedent).
  3. added
    planned
    on May 7, 2026
  4. admarble commented on May 7, 2026

    @admarble
    ContributorAuthor

    /fullsolve Complete

    Issue: #580
    Status: READY_FOR_MERGE
    PR: #594 — #594

    AC Coverage

    AC Description Status
    AC-1 ### Sibling-site Scan (Conditional) subsection at .claude/skills/spec/SKILL.md:145; ≥3 instances of the affected pattern in the same file, pre-tool.sh example present ✅ MET
    AC-2 npx tsx scripts/check-skill-sync.ts → synced spec/SKILL.md — 3/3 match ✅ MET
    AC-3 Two output options (Open Question / follow-up issue); NEEDS_VERIFICATION absent in new content ✅ MET
    AC-4 feedback_qa_second_look.md pointer with explanatory framing ✅ MET
    AC-5 CHANGELOG entry under [Unreleased] / ### Changed, 1 source line, ends (#580), mirrors #573 entry style ✅ MET

    Iterations

    Phase Iterations Status
    Spec 1 Complete (prior /spec marker detected, resumed from exec)
    Exec 1 Complete (4 files, +31 lines, 0 deletions)
    Test 0 Skipped (docs-only — no UI labels)
    QA 1 Complete (READY_FOR_MERGE, no /loop needed)

    Quality Metrics

    Risk Assessment (from QA)

    • Likely failure mode: A future planner might parse the trigger example as cross-file. Mitigated by the explicit "in the same file" binding stated twice in the trigger clause. Doc-only change — no runtime risk.
    • Not tested: Manual planner-side dogfooding of the new prompt is the only thing not exercised. The integration AC (check-skill-sync.ts) is the lone programmatic check, which passes.

    Adversarial Re-Read Status

    Clean. All 3 Non-Goals from the issue body honored (no grep automation, no mandatory scope expansion, no /qa modifications). One minor wording polish noted (example phrasing slightly looser than issue body's "regex blocks in pre-tool.sh") but does not affect AC literal compliance — ≥3 instances + pre-tool.sh are both present, which is what AC-1 requires.


    Ready for human review and merge.

  5. added a commit that references this issue on May 7, 2026
  6. admarble commented on May 7, 2026

    @admarble
    ContributorAuthor

    Adversarial Re-Read Round 2 — Gap Fixes Applied

    Second-pass review surfaced 7 gaps in the first-pass implementation. 5 fixed, 2 won't-fix-with-rationale. PR #594 updated.

    Fixed (commit f167d7a)

    Gap Before After
    1 regex blocks repeated across hook scripts like \pre-tool.sh`` (read as cross-file) the regex blocks in \pre-tool.sh`` (intra-file, matches binding)
    3 **During plan generation** (semantically off under Context Gathering) **During planning**
    4 4 paragraphs (incl. meta "Why at /spec time:") 3 paragraphs (framing folded into citation)
    5 "surface as Open Question or follow-up issue" (template-orphan) adds (in \## Open Questions`)and(in `## Implementation Plan` or as a separate plan step)`
    7 binary options, no hybrid guidance adds: "When findings mix trivial and non-trivial sites, surface each separately."

    Won't Fix (defensible as-is)

    • Gap 2 (AC-1's literal "bullet" vs delivered subsection): /qa precedent uses subsection too; AC text is colloquial.
    • Gap 6 (placement vs issue body's "near Conflict Risk" hint): spec comment Open Question 1 explicitly resolved placement with rationale — re-litigating now would override the spec.

    Diff Impact

    Commits on PR #594

    f167d7a chore(#580): tighten /spec sibling-site scan wording — adversarial re-read fixes
    2acea38 feat(#580): mirror /qa sibling-site scan prompt into /spec planning
    
  7. added 2 commits that reference 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

    enhancementplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions