Skip to content

feat: Shift-left gap detection in workflow phases #196

Closed

Description

@admarble

Summary

Rather than adding gap analysis to /qa (which treats symptoms), strengthen earlier phases to catch gaps when they occur.

Principle: QA should validate, not discover. Gaps found at QA indicate earlier phase failures.

Problem

Currently, gaps can slip through to QA:

  • Features in AC but not implemented
  • Code without test coverage
  • New code not integrated into existing systems

Proposed Solution

1. /exec: AC Checkpoint Before PR Creation

Before creating a PR, /exec should:

### Pre-PR AC Verification
- [ ] Review each AC item
- [ ] Confirm implementation exists for each
- [ ] Flag any AC items not addressed (with justification)

2. /test: Coverage Threshold Check

After running tests, /test should:

  • Report coverage delta (if coverage tools available)
  • Warn if new files have 0% coverage
  • Check that modified functions have corresponding test changes

3. /spec: Generate Testable AC

Improve AC generation to be more verifiable:

  • Each AC should map to a concrete verification method
  • Flag vague AC items that can't be objectively validated

Acceptance Criteria

  • AC-1: /exec includes AC checkpoint before PR creation that lists each AC with implementation status
  • AC-2: /test warns when new/modified files lack test coverage
  • AC-3: /spec generates AC items with explicit verification methods

Why This Matters

Approach Phase Cost to Fix
Catch at /exec Implementation Low
Catch at /test Testing Medium
Catch at /qa Review High
Catch post-merge Production Very High

Shifting left reduces rework and improves velocity.

Labels

enhancement, workflow

Activity

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

    @admarble
    ContributorAuthor

    📋 Planning Phase Complete

    Acceptance Criteria

    AC Description Verification Method Key Assumption
    AC-1 /exec includes AC checkpoint before PR creation Integration Test AC items stored in state by /spec
    AC-2 /test warns when new/modified files lack coverage Integration Test Test files follow .test.ts naming
    AC-3 /spec generates AC with explicit verification methods Manual Test Output template enforces field

    Verification Criteria

    AC-1: /exec AC Checkpoint

    Test Scenario:

    • Given: Issue with 3 AC items in workflow state
    • When: /exec reaches PR creation phase
    • Then: Output includes "Pre-PR AC Verification" listing each AC with implementation status

    AC-2: /test Coverage Warning

    Test Scenario:

    • Given: Worktree with new src/lib/feature.ts file
    • When: /test executes
    • Then: Warning appears if src/lib/feature.test.ts doesn't exist

    AC-3: /spec Verification Methods

    Test Scenario:

    • Given: Issue with AC items
    • When: /spec runs
    • Then: Each AC has **Verification Method:** field in output

    Implementation Plan

    Phase 1: AC Checkpoint in /exec

    • File: .claude/skills/exec/SKILL.md (~line 310)
    • Change: Add "Pre-PR AC Verification" section before PR creation
    • Behavior: List each AC with status, warn if any not implemented

    Phase 2: Coverage Warning in /test

    • File: .claude/skills/test/SKILL.md (Phase 1)
    • Change: Add "Coverage Analysis" substep in Setup phase
    • Behavior: Check for .test.ts files matching modified source files

    Phase 3: Verification Methods in /spec

    • File: .claude/skills/spec/SKILL.md (~line 308)
    • Change: Make verification method REQUIRED, add decision framework
    • Behavior: Enforce explicit method assignment for each AC

    Assumptions to Validate

    • AC items are stored in state by /spec before /exec runs
    • StateManager.getAcceptanceCriteria() works with issue number
    • Test files follow naming convention <file>.test.ts
    • /test can access git diff from worktree

    Recommended Workflow

    Phases: spec → exec → qa
    Quality Loop: disabled


    Open Questions

    1. AC checkpoint strictness: Recommend soft checkpoint (warning, allow override)
    2. Coverage threshold: Recommend warning only on missing test files (0% coverage)

    🤖 Plan generated by /spec skill

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

    @admarble
    ContributorAuthor

    🚀 Implementation Complete

    AC Coverage Summary

    AC Description Status Evidence
    AC-1 /exec includes AC checkpoint before PR creation ✅ Implemented Pre-PR AC Verification section in exec/SKILL.md
    AC-2 /test warns when new/modified files lack coverage ✅ Implemented Test Coverage Analysis section 1.5 in test/SKILL.md
    AC-3 /spec generates AC with explicit verification methods ✅ Implemented Decision framework in spec/SKILL.md

    Key Files Changed

    File Change
    .claude/skills/exec/SKILL.md Added Pre-PR AC Verification section (+58 lines)
    .claude/skills/test/SKILL.md Added Test Coverage Analysis section 1.5 (+92 lines)
    .claude/skills/spec/SKILL.md Added verification method decision framework (+83 lines)

    Implementation Details

    AC-1 (/exec): Added a "Pre-PR AC Verification (REQUIRED)" section before PR creation that:

    • Retrieves AC from workflow state or issue body
    • Generates a verification checklist table with status (✅ Implemented, ⚠️ Partial, ❌ Not addressed, 🔄 Deferred)
    • Includes evidence for each AC item
    • Adds AC verification to PR description

    AC-2 (/test): Added "1.5 Test Coverage Analysis (REQUIRED)" section that:

    • Gets changed source files from git diff
    • Checks for corresponding test files in multiple locations
    • Classifies changes by tier (Critical, Standard, UI, Config)
    • Flags critical path changes without tests
    • Generates a coverage report table

    AC-3 (/spec): Enhanced AC output structure with:

    • Verification Method Decision Framework table
    • Good/bad examples for verification methods
    • "⚠️ UNCLEAR" flag for AC that cannot be verified
    • Updated Output Verification checklist to require verification methods

    Checks Run

    • npm test: 669 passed, 13 pre-existing failures (unrelated to this change)
    • npm run build: ✅ Passed

    PR Status

    ✅ Created: #206


    🤖 Generated by /exec skill

  6. added 2 commits that reference this issue on Jan 31, 2026
  7. added a commit that references this issue on Jan 31, 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