Repository navigation
Description
Summary
/spec's AC quality linter currently flags vague ("should work"), unmeasurable ("fast"), and open-ended ("etc.") AC patterns. It does NOT flag a more subtle class: ACs whose title specifies one verification bar while the body specifies a different, stricter bar. These ACs pass through /spec, get implemented to the looser bar, and surface as gaps during /qa or post-merge review.
Motivating Example (from #562)
**AC-5: Smoke test note in PR description.** Manually trigger `/fullsolve` on
an issue that will fail QA (e.g., a known AC gap) to verify `sequant:loop` is
invoked, not the recurring-prompt skill. Capture the first line of /loop
output (\"Quality loop - Parse test/QA findings...\") as evidence.- Title bar: "note in PR description" → satisfied by writing a documentation note.
- Body bar: "capture the first line of /loop output... as evidence" → requires runtime execution and evidence capture.
Two different requirements in one AC. The exec phase implemented to the title (wrote a note); QA marked MET; the gap surfaced only on post-merge review ("any gaps?"). Mechanical evidence was eventually captured as a follow-up, but cleaner if /spec had flagged this during plan review.
Proposed Detection
Add a new AC quality category in src/lib/ac-linter.ts and the /spec AC Quality Check section:
| Pattern | Examples | Issue |
|---|---|---|
| Title/body tension | Title contains noun ("note", "comment", "documentation", "snippet"); body contains runtime imperative ("execute", "trigger", "capture", "verify by running", "reproduce") | AC has two different verification bars |
Heuristic:
- Extract the AC title — text up to the first period or newline.
- Tokenize title for documentation-nouns:
note,comment,documentation,description,snippet,entry,mention. - Tokenize body for runtime-imperatives:
execute,trigger,capture,verify by running,reproduce,confirm at runtime,run /(slash command). - If both present in the same AC: warn.
Acceptance Criteria
- AC-1: Linter rule added.
lintAcceptanceCriteriainsrc/lib/ac-linter.tsadds a new checktitle-body-tensionwith the heuristic above. - AC-2: Warning, not blocking. Per the existing AC linter convention (warnings don't block planning), this rule emits warnings only.
- AC-3: SKILL.md update.
/spec's AC Quality Check table gains a row for the new pattern. 3-dir sync (.claude/skills/spec/SKILL.md,skills/spec/SKILL.md,templates/skills/spec/SKILL.md). - AC-4: Test cases.
src/lib/ac-linter.test.tsadds three fixtures:- Positive: AC with documentation-noun title + runtime-imperative body (e.g., the AC-5 from bug(fullsolve): unqualified Skill("loop") resolves to recurring-prompt skill, breaking quality loop #562) → should warn.
- Negative-1: AC with documentation-noun title + matching documentation body (e.g., "Add CHANGELOG entry... write a single bullet under Unreleased") → should NOT warn.
- Negative-2: AC with runtime-imperative title + runtime-imperative body (e.g., "Run end-to-end test, capture output") → should NOT warn (consistent within AC).
- AC-5: Suggested wording. When the warning fires, suggest one of two resolutions: (a) tighten the title to match the body ("Smoke test execution — capture evidence"); or (b) move the runtime requirement into a separate AC.
Non-Goals
- Not auto-rewriting ACs. Linter warns, human resolves.
- Not an exhaustive synonym dictionary. Start with the small word lists above; expand as false-negatives surface.
- Not changing /qa's AC-literal verification (memory
feedback_qa_ac_literal.md) — that's a separate concern downstream.
Risks / Open Questions
- False positives. Some ACs legitimately have a documentation-noun title and a runtime-implication body that's just describing context, not a different bar. Mitigation: warning-only; reviewer judgment final.
- Overlap with existing checks. Make sure the new check doesn't duplicate the "Vague" or "Incomplete" categories already in the linter.
- Word list maintenance. As false-negatives surface, the noun/imperative lists will grow. Could move to a config file in
.sequant/for project-level customization.
Complexity
small — single linter rule + 3 test fixtures + 3-mirror SKILL.md update. ~80-120 LOC.
Self-Assessed Workflow
spec → testgen → exec → qa — testgen warranted because the heuristic has clear unit-test surface (the three fixtures above).
Related
- bug(fullsolve): unqualified Skill("loop") resolves to recurring-prompt skill, breaking quality loop #562 / fix(#562): qualify Skill("loop") in fullsolve as sequant:loop #565 — motivating example (AC-5 had this tension; gap surfaced post-merge)
- Memory:
feedback_qa_ac_literal.md— downstream sibling about /qa not rationalizing AC text divergence
Activity
admarble commentedon May 4, 2026
Assessment
→ PROCEED — AC linter rule with clear test surface (3 fixtures specified), 3-dir SKILL.md sync
Workflow:
spec → testgen → exec → qawith-q⚠ testgen included per self-assessment — heuristic has clean unit-test fixtures (positive + 2 negative)
admarble commentedon May 6, 2026
Plan Complete
AC Quality Check
✅ All 5 ACs are clear and testable. Linter flags zero issues. (Self-referential: the new
title-body-tensionrule wouldn't fire on this issue's own ACs — title and body agree on the bar in each.)Scope: ✅ SCOPE_OK
1 module (
src/lib/ac-linter.ts+ matching test) + standard 3-dir SKILL.md sync.AC Checklist (verification methods)
title-body-tensionadded insrc/lib/ac-linter.ts— Unit Test.claude/skills/spec/,skills/spec/,templates/skills/spec/) — Manual TestImplementation Plan
ACLintIssueTypeunion to include"title-body-tension". Add helperdetectTitleBodyTension(ac)next to the regex patterns. Wire intolintAcceptanceCriterionafter the regex loop.const [title, ...rest] = ac.description.split(/[.\n]/);. Word lists:DOC_NOUNS(note, comment, documentation, description, snippet, entry, mention) andRUNTIME_IMPERATIVES(execute, trigger, capture, verify by running, reproduce, confirm at runtime). Plus/\bRun\s+\/[a-z][a-z0-9_-]*/ifor slash-command runtime.title-body-tensionissue with suggestion combining both resolutions.describe("title-body-tension patterns"): positive (AC-5 of bug(fullsolve): unqualified Skill("loop") resolves to recurring-prompt skill, breaking quality loop #562 verbatim), negative-1 (consistent docs: "Add CHANGELOG entry. Write a single bullet under Unreleased."), negative-2 (consistent runtime: "Run end-to-end test, capture output.").| Title/body tension | doc-noun title + runtime-imperative body | Two different verification bars |across three SKILL.md files. Grep-verify count = 3.npx vitest run src/lib/ac-linter.test.ts. Build:npm run build.Design Review
src/lib/ac-linter.tsnext toDEFAULT_LINT_PATTERNS. Structural (title/body split) so it's a separate helper, not another regex row.Workflow
spec → testgen → exec → qa(matches /assess and self-assessment).Open Questions
.or\n(matches issue heuristic literally). False negatives from inlinee.g.accepted (warning-only philosophy).runkeyword; bare/specmentions in body are not by themselves runtime-imperative.Worktree:
feature/571-ac-linter-title-body-tension. Proceeding to/testgenthen/exec.admarble commentedon May 6, 2026
Test Stubs Generated
hasIssues=true, no throw)(a)and(b))Target file (existing — extend, do not overwrite)
src/lib/ac-linter.test.ts— add a newdescribe("title-body-tension patterns", ...)block inside the existingdescribe("AC Linter")→describe("lintAcceptanceCriterion")group, alongside the existingdescribe("vague patterns"),describe("unmeasurable patterns"), etc.Stubs (to be implemented in
/exec)Assumptions to validate during
/exec:createAcceptanceCriterionimport already in test file (it is — line 14).description.split(/[.\n]/)[0]returns the title chunk; rest is body."title-body-tension"added to theACLintIssueTypeunion.No new file written. Stubs are added inline to the existing
ac-linter.test.tsduring/exec. This avoids the test-stub-orphan pitfall (memory:Untracked test stubs— implementations sometimes diverge from new files).Proceeding to
/exec.admarble commentedon May 6, 2026
QA Review for Issue #571
AC Coverage
title-body-tensionadded insrc/lib/ac-linter.tsACLintIssueTypeunion;detectTitleBodyTension(ac)helper atac-linter.ts:316; wired intolintAcceptanceCriterionat line 377.passed: falseflag, no exception thrown. Test "emits warning, does not throw" verifies..claude/skills/spec/,skills/spec/,templates/skills/spec/.grep -c "Title/body tension"returns 1 in each (verified).describe("title-body-tension patterns")block inac-linter.test.ts:227. Positive: AC-5 from #562 verbatim. Negative-1: "Add CHANGELOG entry. Write a single bullet…". Negative-2: "Run end-to-end test, capture output." All pass (39/39 vitest).(a)(tighten title) and(b)(split AC). Verified:suggestion contains (a): true,suggestion contains (b): true.Coverage: 5/5 AC items fully met
Original ACs: 5/5 met
Derived ACs: None
Quality Plan Verification
N/A — No
Feature Quality Planningsection in spec comment (skill linter rule is single-feature, no quality dimensions to track separately).CI Status
No PR exists yet (PR creation deferred to /fullsolve Phase 5).
npm run build,npm run lint, and targeted vitest all pass locally ondb8162f.Quality Metrics
anyin source)Build Verification
N/A —
npm run buildandnpm run lintboth pass on the feature branch (no errors, no warnings).Test Coverage Analysis
src/lib/ac-linter.tssrc/lib/ac-linter.test.ts(5 new tests indescribe("title-body-tension patterns"))src/lib/ac-linter.test.ts.claude/skills/spec/SKILL.mdskills/spec/SKILL.mdtemplates/skills/spec/SKILL.mdCHANGELOG.mdCoverage: 1/1 changed source files have corresponding tests
Critical paths without tests: None
Code Review
Strengths:
detectTitleBodyTension(ac)is a focused 30-line function. Clean separation from the regex-drivenDEFAULT_LINT_PATTERNSloop — a structural rule belongs in its own helper, not contorted into the regex shape. Wired in via a single 2-line append atac-linter.ts:377-378.DOC_NOUNS,RUNTIME_IMPERATIVES) are top-of-module constants, easy to extend without touching detection logic. Matches the issue's "start small, expand as false-negatives surface" directive.feedback_motivating_example_regression.mdandfeedback_synthetic_test_fixture_trap.md— production samples, not synthetic constructs).Issues:
Suggestions (non-blocking):
\b${noun}\bwon't match plurals ("notes", "comments", "snippets"). Aligns with issue's word-list philosophy ("expand as false-negatives surface"); acceptable as-is. If a real-world AC with "notes" surfaces, add toDOC_NOUNS.descriptionis the most generic doc-noun in the list and could fire on titles like "API description for X". Per the warning-only convention and reviewer-final philosophy, the false-positive cost is low. Acceptable.splitIdx <= 0(which already ensures non-empty title), but defensive against descriptions ending in a literal.(where body would be empty after.slice(splitIdx + 1)— actually still 1 char trailing, but still: keep the guard).Test Quality Review
result.issues.find(i => i.type === ...)(output shape), not internal regex state.Anti-Pattern Detection
Code Patterns
No
eval,innerHTML, hardcoded secrets, SQL concatenation, or0.0.0.0bind in the diff. No emptycatchblocks. Noawaitin loops. Twonew RegExp()calls insidedetectTitleBodyTension— interpolating only fixed-listnoun/impstrings (no user input), no injection surface.Critical Issues: 0
Warnings: 0
Call-Site Review
New exported functions detected: 0 (helper is module-private; only
lintAcceptanceCriterionis exported and its signature is unchanged).detectTitleBodyTensionis a private helper, called once from insidelintAcceptanceCriterion. Single call site, no loop, no condition gate — every AC goes through the same path. Matches the linter's existing pattern.Execution Evidence
N/A — No
scripts/or CLI files modified (all changes are library code + tests + skill docs + CHANGELOG).Skill Command Verification
N/A — SKILL.md changes are a single documentation row added to the
AC Quality Checktable. No new shell commands, no newgh/npm/npx/gitinvocations.Detection Pattern Verification
N/A — SKILL.md diff adds a documentation row only. No new
grep/awk/jq/sedcommands, no new regex literals inside skill markdown. The two regexes in this PR (RUN_SLASH_RE,\b${noun}\b) live insrc/lib/ac-linter.ts(TypeScript code path covered by the new vitest fixtures), not in skill markdown.CLI Registration Verification
N/A — No changes to
RunOptions,bin/cli.ts, orsrc/lib/workflow/batch-executor.ts.Skill Change Review
run /<cmd>). Verified: linter fires on motivating example (title="note" + body="trigger").Smoke Test
extractAcceptanceCriteria + lintAcceptanceCriteriaagainst issue #571 bodylintAcceptanceCriterionagainst verbatim #562 AC-5title="note" + body="trigger"(a)and(b).npx vitest run src/lib/ac-linter.test.tsnpm run buildnpm run lintSmoke Test Status: Complete
Manual Test ACs
N/A — No
**Verification:** Manual TestACs in this issue. AC-3 was tagged Manual Test (file-diff verification) but reduces to grep-checkable file content; verified mechanically (grep -creturns 1 per mirror).CHANGELOG Verification
CHANGELOG.mdexistsfeat:commit, /spec linter rule reachable via /spec workflow)[Unreleased]entry### Added)(#571), names files and rule semanticsResult: CHANGELOG requirements met.
Risk Assessment
RUNTIME_IMPERATIVES). Per the issue's stated philosophy this is acceptable — warning-only, expand lists as real false-negatives surface. The linter's correctness boundary is "given a doc-noun-titled AC with a runtime-imperative body from the configured lists, fire" — verified.DEFAULT_LINT_PATTERNS). No multi-site duplication to scan; the rule is single-pattern, single-call-site. The existing 4 issue types (vague/unmeasurable/incomplete/open_ended) are unrelated regex categories — extending those is out of scope.Adversarial re-read of core logic
Walked through the helper line-by-line against each test fixture mentally, then re-confirmed via
npx tsx -e:description.search(/[.\n]/)returns -1 if no.or\n(e.g., "Add note for /run") → guardsplitIdx <= 0returns null → no false fire on title-only ACs. Boundary-correct..).body.length === 0→ returns null. Test passes for the right reason.entry(DOC_NOUN), body " Write a single bullet under Unreleased." has neither runtime-imperative norrun /<cmd>→ returns null. Test passes for the right reason.note(DOC_NOUNS.find returns first hit). Body matchestrigger. Issue fires withmatchedPattern = title="note" + body="trigger". Suggestion contains(a)and(b)literally. Verified mechanically.RUN_SLASH_RE = /\brun\s+\/[a-z][a-z0-9_-]*/i— won't match "running /foo" (because\brunfollowed bynnot\s); matches "Run /foo" (case-insensitive). Spec-compliant.No structured-pipeline gaps surfaced.
Verdict: READY_FOR_MERGE
All 5 ACs are MET. Implementation is minimal (one helper + 5 tests + 1 documentation row × 3 mirrors + CHANGELOG entry). Build, lint, and targeted vitest all green. The linter does not fire on this issue's own ACs (zero self-referential false positives) AND fires correctly on the verbatim motivating example from #562 (
title="note" + body="trigger", suggestion contains(a)and(b)). No security surface, no API breakage, no scope creep. Word-list incompleteness is a known and accepted trade-off per the issue's "start small" directive.Documentation
## [Unreleased]→### Added, includes(#571)and explains the rule semantics.AC Quality Checktable row mirrored across all three skill directories (.claude/,skills/,templates/skills/).Next Steps
/specinvocations.admarble commentedon May 6, 2026
/fullsolve Complete
Issue: #571
Status: READY_FOR_MERGE
PR: #586 — #586
Summary
AC Coverage (5/5 MET)
title-body-tensionadded insrc/lib/ac-linter.ts(detectTitleBodyTensionhelper at line 316; wired at line 377)..claude/skills/spec/,skills/spec/,templates/skills/spec/(grep-verified count = 1 per file).(a)tighten title and(b)split AC, verified literally.Quality Metrics
--max-warnings 0)any)Smoke verification
matchedPattern = title="note" + body="trigger", suggestion contains both(a)and(b).Risk Assessment
RUNTIME_IMPERATIVES). Acceptable per issue's "start small, expand as false-negatives surface" directive.Ready for human review and merge. After merge: rule starts surfacing title/body tensions on subsequent
/specinvocations.chore: merge origin/main into feature/571-ac-linter-title-body-tension