Skip to content

Add AC linting to /spec to catch vague acceptance criteria #201

Closed

Description

@admarble

Summary

Add static analysis of acceptance criteria in /spec to flag vague, untestable, or incomplete requirements before implementation begins.

Background

Extracted from #199 (RFC: ML/AI Infrastructure) as a high-value, low-complexity improvement.

Problem

Vague acceptance criteria lead to:

  • Ambiguous implementations
  • Subjective /qa verdicts
  • Wasted iteration cycles

Common issues:

  • "Should work properly" (what does "properly" mean?)
  • "Handle edge cases" (which edge cases?)
  • "Good performance" (what's the threshold?)
  • Missing error scenarios
  • No testable outcomes

Proposed Solution

Add AC linting step in /spec that flags:

Pattern Issue Suggestion
"should work" / "properly" Vague Specify measurable outcome
"handle errors" Incomplete List specific error types
"fast" / "performant" Unmeasurable Add latency/throughput threshold
No test criteria Untestable Add verification method
"etc." / "and more" Open-ended Enumerate all items

Example Output

## AC Quality Check

⚠️ AC-2: "System should handle errors gracefully"
   → Vague: What errors? What is "gracefully"?
   → Suggest: "System returns 400 status with error message for invalid input"

⚠️ AC-4: "Page loads quickly"  
   → Unmeasurable: No threshold defined
   → Suggest: "Page loads in <2 seconds on 3G connection"

✅ AC-1, AC-3, AC-5: Clear and testable

Acceptance Criteria

  • /spec runs AC lint before generating plan
  • Flags common vague patterns (configurable list)
  • Suggests concrete alternatives where possible
  • Warning-only (doesn't block, but surfaces in output)
  • Can be disabled with --skip-ac-lint flag

Effort

Small-Medium (2-3 days)

Labels

  • enhancement
  • spec

Activity

  1. added
    enhancement
    spec
    on Jan 29, 2026
  2. admarble commented on Jan 29, 2026

    @admarble
    ContributorAuthor

    📋 Spec Review: AC Linting for /spec

    Acceptance Criteria with Verification

    AC Description Verification Test Scenario
    AC-1 /spec runs AC lint before generating plan Integration Test Vague AC → Output includes "## AC Quality Check" before plan
    AC-2 Flags common vague patterns (configurable list) Unit Test Patterns like "should work", "fast" → Detected with issue type
    AC-3 Suggests concrete alternatives where possible Unit Test "Page loads quickly" → Suggests "Add latency threshold"
    AC-4 Warning-only (doesn't block) Integration Test Vague AC → Plan still generated, warnings shown
    AC-5 Can be disabled with --skip-ac-lint flag Integration Test /spec N --skip-ac-lint → No lint section, skip message shown

    Implementation Plan

    Phase 1: AC Linter Module

    1. Create src/lib/ac-linter.ts with pattern registry and lint functions
    2. Create src/lib/ac-linter.test.ts with comprehensive test coverage

    Phase 2: Spec Skill Integration
    3. Update .claude/skills/spec/SKILL.md to:

    • Add "AC Quality Check" section after AC extraction
    • Document --skip-ac-lint flag
    • Format output with ⚠️/✅ indicators

    Phase 3: Optional (Deferred)
    4. Add .sequant/ac-lint.json configuration support (future enhancement)

    Pattern Registry

    Pattern Type Examples Suggestion
    Vague "should", "properly", "nicely", "well", "good" Specify measurable outcome
    Unmeasurable "fast", "slow", "performant", "efficient", "responsive" Add latency/throughput threshold
    Incomplete "handle errors", "edge cases", "corner cases" List specific error types
    Open-ended "etc.", "and more", "such as", "including but not limited to" Enumerate all items

    Assumptions to Validate

    • AC extraction runs before plan generation in spec skill
    • Pattern matching is case-insensitive
    • Slash command arguments can be parsed for flags

    Recommended Workflow

    /spec 201 → /exec 201 → /qa 201
    

    Quality Loop: Disabled (standard enhancement)


    Generated by /spec skill

  3. added
    planned
    on Jan 29, 2026
  4. added a commit that references this issue on Jan 29, 2026
  5. admarble commented on Jan 29, 2026

    @admarble
    ContributorAuthor

    Implementation Progress Update

    AC Coverage Summary

    AC Description Status
    AC-1 /spec runs AC lint before generating plan ✅ Met
    AC-2 Flags common vague patterns (configurable list) ✅ Met
    AC-3 Suggests concrete alternatives where possible ✅ Met
    AC-4 Warning-only (doesn't block, but surfaces in output) ✅ Met
    AC-5 Can be disabled with --skip-ac-lint flag ✅ Met

    Implementation Details

    Files Changed:

    • src/lib/ac-linter.ts - Core AC linter module with pattern detection
    • src/lib/ac-linter.test.ts - 34 unit tests with comprehensive coverage
    • .claude/skills/spec/SKILL.md - Updated with "AC Quality Check" section
    • templates/skills/spec/SKILL.md - Template sync

    Pattern Categories Implemented:

    Type Examples Detection
    Vague "should work", "properly", "correctly", "as expected" ✅
    Unmeasurable "fast", "performant", "responsive", "scalable" ✅
    Incomplete "handle errors", "edge cases", "all scenarios" ✅
    Open-ended "etc.", "and more", "such as", "including but not limited to" ✅

    Example Output:

    ## AC Quality Check
    
    ⚠️ **AC-2:** "System should handle errors gracefully"
       → Incomplete: error types not specified
       → Suggest: List specific error types and expected responses
    
    ⚠️ **AC-4:** "Page loads quickly"
       → Unmeasurable: "quickly" has no threshold
       → Suggest: Specify time limit (e.g., completes in <5 seconds)
    
    ✅ AC-1, AC-3, AC-5: Clear and testable
    
    **Summary:** 2/5 AC items flagged for review
    

    Checks Run

    • ✅ npm test - 34 new tests pass (10 pre-existing failures in unrelated state-update-cli.test.ts)
    • ✅ npm run build - Compiles successfully
    • ✅ npm run lint - No warnings

    PR Status

    Created: #202


    Generated by /exec skill

  6. added a commit that references this issue on Jan 30, 2026
  7. admarble commented on Jan 30, 2026

    @admarble
    ContributorAuthor

    Post-Merge Verification

    Integration testing completed successfully after merge.

    Tests Performed

    Test Result
    Parse AC from markdown ✅ 4 items parsed correctly
    Detect vague patterns ✅ "handles errors gracefully" flagged as incomplete
    Detect unmeasurable ✅ "fast" flagged with threshold suggestion
    Detect open-ended ✅ "including but not limited to" flagged
    Pass clear AC ✅ "Returns 404 for missing resources" passed
    Format output ✅ Proper markdown with ⚠️/✅ indicators
    Template sync ✅ .claude/skills and templates/ identical

    Example Output

    ## AC Quality Check
    
    ⚠️ **AC-1:** "System handles errors gracefully"
       → Incomplete: error types not specified
       → Suggest: List specific error types and expected responses
    
    ⚠️ **AC-2:** "Response time is fast under load"
       → Unmeasurable: "fast" has no threshold
       → Suggest: Add latency threshold (e.g., <2 seconds, <100ms)
    
    ✅ AC-3: Clear and testable
    
    **Summary:** 2/3 AC items flagged for review

    Verification Status

    ✅ All integration gaps closed - Feature ready for production use.


    Post-merge verification by /qa

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

    enhancementplannedspec

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions