Repository navigation
Description
Problem
spec/SKILL.md's "Agent Spawn Rules" section (.claude/skills/spec/SKILL.md:133-148) prescribes spawning 1–3 sequant-explorer subagents per /spec run, keyed by issue type:
| Issue Content | Agents | What to Spawn |
|---|---|---|
| Database/SQL/migration keywords | 3 | Similar features + Codebase area + Database schema |
| UI/frontend | 2 | Similar features + Codebase area |
| CLI/script changes | 2 | Similar features + Codebase area |
Docs/config/simple-fix |
1 | General context only |
It has never fired. Measured over the local transcript corpus (~/.claude/projects/**/*.jsonl, 1,332 transcripts, 2026-07-07 → 2026-08-09):
| Agent | Skill-body runs | Spawns | Rate |
|---|---|---|---|
sequant-explorer |
169 (/spec) |
0 | 0% |
sequant-implementer |
276 (/exec) |
2 | 0.7% |
sequant-qa-checker |
188 (/qa) |
127 | healthy |
sequant-testgen |
6 (/testgen) |
0 | n too small to claim anything |
Meanwhile the generic built-ins absorbed the role: general-purpose 133 spawns, Explore 101.
Breaking down the 169 /spec runs: 131 (78%) spawned no subagent at all; the other 38 used Explore/general-purpose. Across 98 headless dogfood runs (matcha-maps + ad-motion): 0 explorer spawns.
Availability is not the cause. sequant-explorer.md is installed in .claude/agents/ in this repo and in both consumer testbeds. The recording mechanism works for sequant-namespaced agents — sequant-qa-checker logs 127 spawns through the identical subagent_type field. The agent is available and simply never chosen.
Why it probably never fires: compare the two prescriptions. /qa gives literal, copy-pasteable invocations tied to a size gate (qa/SKILL.md:1226, :1236) — 127 spawns. /spec gives a descriptive table of counts with no invocation to copy and no gate that requires one — 0 spawns. The agent reads the table, concludes targeted inline Read/Grep serves better, and proceeds. That conclusion is not wrong: it matches the repo's own preference for targeted reads over explorer fan-out for known files, and /qa already documents that ad-hoc background agents "hallucinate about file existence, misattribute API patterns" (qa/SKILL.md:165).
Why this matters beyond tidiness
Dead prescription is not free:
- It misleads design work. feat(spec): measure-first grounding gate for explorer findings — deterministically verify cited paths/symbols before they enter the plan #922 was specced end-to-end on the premise that explorers run and their findings feed the Implementation Plan. Its Phase A ("measure the phantom-citation rate over ≥10 explorer transcripts") is unsatisfiable — the corpus is empty — and its Phase B would have gated a code path that never executes. That issue is now being re-aimed; the cost was one full planning cycle.
- It bloats every
/specrun. The table is tokens in the context window of all 169 runs, describing behavior none of them perform, in a skill that has already had a dedicated prompt-compression pass (perf(spec): prompt compression and tiered context — reduce spec skill token cost by ~60% #515). - It hides the real behavior. The skill's stated context-gathering strategy and its actual one have diverged, so nobody tuning
/speccontext quality is looking at the code path that runs.
Design
Two options; recommending (A).
(A) Make the skill describe what actually happens — recommended. Replace the spawn-rules table with the observed-and-preferred strategy: targeted inline Read/Grep when the issue names specific files (the common case), escalating to a single Explore agent only for genuinely open-ended discovery ("where does X live?"). Retire sequant-explorer.md. This is a documentation-truth change with a token saving, no behavior regression — the behavior is already this.
(B) Make the prescription real. Give /spec literal copy-pasteable Agent(subagent_type="sequant-explorer", prompt=…) invocations behind an explicit gate, the way /qa does. Only worth it if there is evidence that explorer fan-out beats targeted reads for plan quality — and there is not; the accumulated guidance points the other way.
Rejected: leaving it and re-measuring later. Two years of zero is not a sampling problem.
Acceptance Criteria
- AC-1:
spec/SKILL.md's Agent Spawn Rules table is replaced with a description of the strategy actually in use — targeted inline Read/Grep by default, singleExploreescalation for open-ended discovery — mirrored across all 3 skill dirs and sync-verified. - AC-2:
sequant-explorer.mdis removed from.claude/agents/andtemplates/agents/, or an explicit rationale for keeping it is recorded in the PR body. - AC-3: Any remaining reference to
sequant-exploreracross skills, agent frontmatter allow-lists, and docs is removed;grep -rn 'sequant-explorer' --include='*.md' .returns only CHANGELOG history. - AC-4: The consumer-project upgrade path is verified: confirm whether
sequant sync/updateprunes an agent file deleted upstream, and if it does not, state the residual in the PR body and the CHANGELOG entry. - AC-5: Token delta of the
/specskill body is measured before and after and reported in the PR body. - AC-6: CHANGELOG entry.
Non-Goals
sequant-implementer(2 spawns / 276/execruns) andsequant-testgen(0 / 6). Both look moribund, but implementer is gated behind parallel groups (a legitimately rare branch) and testgen's denominator is 6, which supports no conclusion. Separate triage, separate issue — deliberately not bundled here.- Changing
/spec's context-gathering quality or adding verification of cited paths. That is feat(spec): measure-first grounding gate for explorer findings — deterministically verify cited paths/symbols before they enter the plan #922's territory. - Touching
sequant-qa-checker, which works.
References
- feat(spec): measure-first grounding gate for explorer findings — deterministically verify cited paths/symbols before they enter the plan #922 (specced on this false premise; being re-aimed), Migrate subagent patterns to declarative .claude/agents/ definitions #484 (migrated subagent patterns to declarative
.claude/agents/), perf(spec): prompt compression and tiered context — reduce spec skill token cost by ~60% #515 (prior/specprompt compression),qa/SKILL.md:165(hallucination caveat),qa/SKILL.md:1226/:1236(the literal-invocation pattern that does fire).
Complexity
Simple — prose replacement across 3 mirrors, two file deletions, one grep sweep. No runtime code.
Self-assessed workflow
spec → exec → qa
Activity
admarble commentedon Aug 10, 2026
Spec — Plan for #927
Complexity: Standard (6 ACs, 2 logical areas — skill mirrors + agent dirs)
Scope
Non-Goals present (implementer/testgen triage, #922's grounding work, qa-checker). Scope verdict:⚠️ SCOPE_WARNING (feature count 2, 6 ACs) — mechanical yellow from AC count; the work itself is prose + file deletions with zero runtime TS references (verified:
grep -rn sequant-explorer src/ scripts/ bin/is empty). Quality loop auto-enables per the yellow verdict.Findings from planning (read before exec)
vscode-extension/README.md:34,45containssequant-explorer-0.0.1.vsix— that's the VS Code extension package name, unrelated to the agent. The literal acceptance grepgrep -rn 'sequant-explorer' --include='*.md' .will always hit it. Treat AC-3 as: only CHANGELOG history andvscode-extension/hits remain (or exclude that dir in the grep). Do not rename the extension.copyTemplates(src/lib/templates.ts:578) is purely additive — it iterates template entries and writes; there is no unlink/prune path.sequant sync/updatewill NOT remove a consumer's stale.claude/agents/sequant-explorer.md. Residual: inert orphan agent file in consumer projects (harmless — nothing invokes it). State this in the PR body + CHANGELOG per the AC.spec/SKILL.md:16frontmatterallowed-tools: Agent(sequant-explorer)— ×3 mirrorsspec/SKILL.md"Agent Spawn Rules" section — ×3 mirrors_shared/references/subagent-types.mdlines 27, 32–37, 179–182, 218, 242–243 — ×3 mirrors (routing table row, dedicated section with copy-paste invocations, decision-table row, and the deprecated-agent pointerspattern-scout/schema-inspector→ re-point those toExploreonly)docs/features/declarative-agents.md:16,32,68,73(expected-files list, agent table, section).claude/agents/sequant-explorer.md+templates/agents/sequant-explorer.md(the deletions)spec/SKILL.mdmirror is 18,567 bytes (~4.6k tokens) pre-change; all 3 mirrors are byte-identical, a clean baseline.Acceptance Criteria
Exploreescalation for open-ended discovery), mirrored ×3.Verification: Manual —
diffthe 3 mirrors byte-identical; section reads as described.sequant-explorer.mdfrom.claude/agents/andtemplates/agents/.Verification: Manual —
lsboth paths.Verification: Integration — run the acceptance grep; only CHANGELOG +
vscode-extension/(name collision, see finding 1) remain.Verification: Manual — cite
src/lib/templates.ts:578(additivecopyDir, no delete path).Verification: Manual — before: 18,567 bytes/mirror; measure after with the same method.
Verification: Manual.
AC lint: 6/6 passed, none flagged.
Implementation Plan
Phase 1 — spec/SKILL.md rewrite (×3 mirrors)
agents.parallelexecution-mode paragraph + hardcoded-paths note) with a short "Context-gathering strategy" block: default targetedRead/Grepon files the issue names; escalate to oneExploreagent only for open-ended discovery ("where does X live?"). Keep the "Discover Project Structure" step.Agent(sequant-explorer)withAgent(Explore)so the escalation path stays allow-listed (decision below).Phase 2 — reference removal
4. Delete both agent files; update
subagent-types.md×3 (drop row/section/decision-table entry; re-pointpattern-scout/schema-inspectormigration notes toExplore); updatedocs/features/declarative-agents.md.Phase 3 — verify + document
5. Acceptance grep sweep (finding 1 carve-out);
diffmirror-sync check; token delta vs 18,567-byte baseline; CHANGELOG + PR-body residual note (finding 2).Key decisions
copyTemplatesis additive by design (customizable-file preservation, fix(sync): plain sync overwrites CUSTOMIZABLE_FILES (constitution) — copyDir ignores force and never consults isCustomizableFile #814); new deletion machinery is disproportionate for one inert orphan. Documented residual instead, per AC-4's own escape hatch.Agent(Explore)keeps the documented escalation usable; dropping the line entirely would make the new prose prescribe an unlisted tool.Open Questions
vscode-extension/— Recommendation: accept the package-name hits alongside CHANGELOG (or add--exclude-dir=vscode-extension). Impact if ignored: exec either fails the AC literally or mangles the unrelated extension name.Recommended Workflow
Phases: exec → qa
Quality Loop: enabled (SCOPE_WARNING auto-enable)
Reasoning: No unit/integration-testable code — all ACs verify via commands/diffs, so no
testgen; no UI, so notestphase. In-flight worktrees (#916, #919) have empty diffs vs origin/main — no conflict risk.admarble commentedon Aug 10, 2026
QA Review for Issue #927
AC Coverage
npm run lint:skill-syncreports 44/44 synced incl.spec/SKILL.md; new section reads as targeted Read/Grep default + single Explore escalationsequant-explorer.mdremoved from.claude/agents/andtemplates/agents/git statusshowsD);findconfirms zero remaining copiesgrep -rn 'sequant-explorer' --include='*.md' .returns CHANGELOG.md (2 history hits) andvscode-extension/README.md(2 hits) — the VS Code extension's package filenamesequant-explorer-0.0.1.vsix, an unrelated entity that happens to share the substring. This is a literal mismatch against the AC's own stated grep output. The requirement (no remaining references to the agent) is satisfied; the AC's prescribed verification command is over-broad. Flagged per spec's Open Question 1, not silently rationalized. Renaming the extension package is out of scope and would be a breaking, unrelated change.copyTemplates(src/lib/templates.ts:578) is purely additive, no unlink/prune path — confirmed by readingcopyDir's write-only loop. Residual is documented in the CHANGELOG entry now. Not yet in the PR body because no PR exists at QA time in this fullsolve ordering (QA runs before PR creation) — will be included verbatim when the PR is opened in Phase 5./specskill body measured and reported in PR bodyspec/SKILL.md18,567 → 18,423 bytes/mirror (−144 bytes, ~−36 tokens) per mirror;subagent-types.md9,019 → 8,711 bytes/mirror (−308 bytes); 2 agent files deleted (−985 bytes each);docs/features/declarative-agents.md7,848 → 7,554 bytes. Same PR-body-timing gap as AC-4.[Unreleased] > ### Fixedentry added, references #927, follows repo's existing verbose-entry conventionCoverage: 4/6 MET, 2/6 PENDING (both blocked only on PR-body timing, not on missing work)
Quality Plan Verification
N/A — spec's plan used a custom "Findings from planning" format instead of the standard Feature Quality Planning section; no quality-plan table to verify against.
Precheck Findings
Source:
.sequant/gap-precheck.json(schemaVersion 1)CI Status
No PR exists yet (QA runs before PR creation in this fullsolve ordering).
Quality Metrics
any).ts/.tsxin diff)Cache Status
N/A — no cache configuration invoked for this run.
Build Verification
N/A —
npm run buildpassed.Test Coverage Analysis
N/A — no source files (
.ts/.tsx/.js/.jsx) in the diff; nothing to cover.Code Review
Strengths:
Agent(sequant-explorer)→Agent(Explore)frontmatter swap keeps the escalation path allow-listed instead of leaving the new prose describing a tool the skill isn't permitted to call..claude/skills,templates/skills,skills) kept byte-identical throughout — verified viadiffafter each edit, not just at the end.Issues:
Suggestions:
Test Quality Review
N/A — no test files modified.
Anti-Pattern Detection
Dependency Audit
N/A —
package.jsonnot modified.Code Patterns
No anti-patterns detected — diff is prose-only (Markdown), no executable code changed.
Critical Issues: 0
Warnings: 0
Call-Site Review
N/A — no new exported functions (diff touches no
.ts/.tsxfiles).Execution Evidence
N/A — no
scripts/or CLI files modified.Skill Command Verification
Skill files changed: 6 (3 mirrors ×
spec/SKILL.md, 3 mirrors ×subagent-types.md)spec/SKILL.md(×3)subagent-types.md(×3)Agent(subagent_type="Explore", ...)example added — built-in type, no verification needed)Verification Status: Passed
Detection Pattern Verification
N/A — no diff hunks in changed skill markdown introduce new
grep/awk/jq/sedcommands or regex literals (precondition false; section omitted per §6c policy, not marked N/A elsewhere but noted here for completeness).CLI Registration Verification
N/A — no option interfaces or
bin/cli.tsmodified.Skill Change Review
Smoke Test
Applicable smoke tests for a skill-prose change (no runtime server to hit): schema/sync validation in place of a live
/specinvocation.npx skills-ref validate templates/skills/spec/Valid skill: templates/skills/spec/npm run lint:skill-syncnpm run lint:skill-callsnpm run lint:skill-gatesSmoke Test Status: Complete
Manual Test ACs
All 6 ACs specify Manual verification in the spec plan.
diffconfirmed byte-identical after editlsboth paths)Manual Test Enforcement: 4/6 manual-test ACs verified at runtime; 2/6 pending PR-body inclusion (not a missing check — the artifact they require doesn't exist until Phase 5)
Risk Assessment
/specbehavior, repeating the original defect./specinvocation was run against a real issue to observe an actualExploreescalation in practice — validated statically (schema, sync, frontmatter) instead, since a live run is out of scope for QA and the original defect was itself about un-exercised prescriptive text.sequant-explorerreference was fully enumerated and removed;sequant-implementer/sequant-testgenare explicitly Non-Goals per the issue).Trust-Boundary Check
Finding: Clean — diff implements only the product requirements stated in the issue (replace dead prescription, remove agent files and references, document the residual). No agent-directed instruction from issue body/comments (execute a command, reach the network, read/exfiltrate files, override instructions) was found or acted on. The issue body itself contains only legitimate problem/design/AC content, no hidden HTML-comment or code-block imperatives.
Status: Clean
Behavior-Rule Survival Check
Status: N/A (no AC triggers the behavior-rule heuristic — this is a removal/documentation issue, not a default/always/never rule change)
CHANGELOG Verification
fix(spec):conventional-commit prefix detected)#927, correct### Fixedsection)Result: CHANGELOG requirements met
Adversarial Re-Read
Findings: Ran 5 additional checks beyond the structured pipeline: (1) no verbatim motivating-example fixtures exist in the issue body to re-run (precheck confirmed
not_applicable); (2) no "evidence" claims in this PR are pre-fix bug repros — the issue's 0%-spawn-rate claim is a corpus measurement, not a repro, and isn't re-asserted as post-fix validation anywhere in the diff; (3) process state is clean —git status --porcelainempty, one commit ahead oforigin/main, branch pushed, no stash relevant to this work; (4) sibling sites — grepped for any other stale agent-count reference (4 custom agents,four custom agents,4 agents) across.claude/,templates/,skills/,docs/and found none remaining; also confirmed the diff touches none of the issue's explicit Non-Goals (sequant-implementer,sequant-testgen,sequant-qa-checkerfiles untouched); (5) no Non-Goals silently expanded into scope. The one substantive gap already surfaced (AC-3's grep carve-out) is called out explicitly above rather than hand-waved.Status: Clean
Verdict: NEEDS_VERIFICATION
All 6 ACs are MET or PENDING — none NOT_MET or PARTIALLY_MET. The two PENDING ACs (AC-4, AC-5) are blocked only on PR-body content that cannot exist until the PR itself is created (this fullsolve run executes QA before PR creation), not on missing analysis or measurement — both are fully worked out above and will be copied verbatim into the PR body in Phase 5, at which point both ACs resolve to MET. No code regression, no security finding, no scope creep, clean 3-way skill mirror sync, all automated skill-validation gates pass.
Documentation
docs/features/declarative-agents.md(already updated as part of this diff)Next Steps
/loopneeded — proceed directly to PR creation per theNEEDS_VERIFICATIONpath (verification is "does the PR body exist with this content," not an external system).admarble commentedon Aug 10, 2026
/fullsolve Complete
Issue: #927
Status: NEEDS_VERIFICATION → resolved via PR body (AC-4/AC-5 content now present)
Summary
/spec's dead "Agent Spawn Rules" table (0 spawns / 169 runs) replaced with the strategy actually in use — targeted inline Read/Grep by default, singleExploreescalation for open-ended discovery — mirrored across all 3 skill dirs.sequant-explorer.mdremoved from.claude/agents/andtemplates/agents/; all references removed fromsubagent-types.md(×3) anddocs/features/declarative-agents.md.Agent(sequant-explorer)→Agent(Explore).Progress Table
AC Coverage
Coverage: 6/6 MET
Quality Metrics
lint:skill-sync: ✅ 44/44 synced |lint:skill-calls: ✅ |lint:skill-gates: ✅ |skills-ref validate: ✅Iteration Summary
/loopinvoked)Final Verdict: READY_FOR_MERGE (post-PR)
Both PENDING ACs from the QA pass were PR-body-timing artifacts, not missing work — resolved the moment the PR was opened with the drafted content.
PR: #931
Ready for human review and merge.
fix(spec): delete the 0%-execution-rate explorer fan-out prescription (…