Skip to content

feat(#571): /spec ac-linter — detect title/body verification-method tension - #586

Merged
admarble merged 2 commits into
mainfrom
feature/571-ac-linter-title-body-tension
May 7, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/571-ac-linter-title-body-tension

Conversation

@admarble

@admarble admarble commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a new title-body-tension rule to the /spec AC quality linter (src/lib/ac-linter.ts). Warns when an AC's title implies a documentation bar (head text up to first ./\n contains note/comment/documentation/description/snippet/entry/mention) while its body specifies a runtime/execution bar (execute/trigger/capture/verify by running/reproduce/confirm at runtime, or a run /<slash-command> pattern). Suggestion offers two resolutions: (a) tighten the title to match the body, or (b) split the runtime requirement into a separate AC.

Closes the gap motivated by #562 AC-5: title said "note in PR description" while body required runtime evidence capture; exec implemented to the title, QA marked MET, the gap surfaced post-merge.

Changes

  • src/lib/ac-linter.ts — extend ACLintIssueType with "title-body-tension"; add detectTitleBodyTension() helper; wire after the regex pattern loop in lintAcceptanceCriterion.
  • src/lib/ac-linter.test.ts — new describe("title-body-tension patterns") block with 5 tests: positive (bug(fullsolve): unqualified Skill("loop") resolves to recurring-prompt skill, breaking quality loop #562 AC-5 verbatim), 2 negatives (consistent docs / consistent runtime), suggestion-text contract, does-not-throw.
  • .claude/skills/spec/SKILL.md, skills/spec/SKILL.md, templates/skills/spec/SKILL.md — new row in the AC Quality Check table (3-dir sync).
  • CHANGELOG.md — [Unreleased] → ### Added entry.

Test plan

  • npm run build passes
  • npm run lint passes (0 errors, 0 warnings)
  • npx vitest run src/lib/ac-linter.test.ts — 39/39 passed (34 existing + 5 new)
  • Self-test: /spec linter does NOT fire on this issue's own ACs (correct — title and body agree on the bar in each)
  • Motivating-example fixture: linter fires on verbatim bug(fullsolve): unqualified Skill("loop") resolves to recurring-prompt skill, breaking quality loop #562 AC-5 with matchedPattern = title="note" + body="trigger", suggestion contains both (a) and (b)
  • 3-dir SKILL.md sync verified (grep -c "Title/body tension" returns 1 per file)

Verdict from /qa

READY_FOR_MERGE — all 5 ACs MET, no scope creep, warning-only convention preserved, word-list philosophy ("start small, expand as false-negatives surface") honoured.

Closes #571

…ension

Adds a new ACLintIssueType variant `title-body-tension` to warn when an AC's
head (text up to first `.` or `\n`) contains a documentation noun ("note",
"comment", "documentation", "description", "snippet", "entry", "mention")
while the body contains a runtime imperative ("execute", "trigger", "capture",
"verify by running", "reproduce", "confirm at runtime", or a `run /<slash>`
pattern). Two different verification bars in one AC silently pass /spec, get
implemented to the looser bar, and surface as gaps post-merge — the linter
now flags the divergence so the reviewer can either tighten the title to match
the runtime body, or split the runtime requirement into a separate AC.

Implementation lives next to DEFAULT_LINT_PATTERNS as a small helper
`detectTitleBodyTension(ac)` that runs after the regex pattern loop. Helper
is structural (needs the title/body split) rather than another regex row, so
it stays a function rather than expanding the LintPattern shape. Same
warning-only return convention as the existing four issue types.

5 new tests in describe("title-body-tension patterns"):
- positive: AC-5 from #562 verbatim ("Smoke test note... trigger /fullsolve...")
- negative-1: consistent docs ("Add CHANGELOG entry. Write a single bullet...")
- negative-2: consistent runtime ("Run end-to-end test, capture output.")
- suggestion contains both (a) and (b) resolutions
- emits warning, does not throw

SKILL.md AC Quality Check table mirrored across .claude/skills/spec/,
skills/spec/, and templates/skills/spec/.

Closes #571
Resolves CHANGELOG.md conflict by keeping both #571 and #568 entries
under the same Unreleased '### Added' section.
@admarble
admarble merged commit 3713571 into main May 7, 2026
8 checks passed
@admarble
admarble deleted the feature/571-ac-linter-title-body-tension branch May 7, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(spec): ac-linter — detect title/body verification-method tension

1 participant