Skip to content

fix: /qa skill should handle 'no implementation' case gracefully #102

Closed

Description

@admarble

Summary

When /qa is run on an issue with no implementation (no worktree, no commits, no PR), the skill still attempts to run the full QA workflow including spawning sub-agents for quality checks. This wastes tokens and produces confusing output.

Problem

Current behavior when running /qa 97 on an unimplemented issue:

  • Skill instructions say "MUST spawn sub-agents for quality checks"
  • But git diff main...HEAD returns nothing - sub-agents have nothing to check
  • The workflow completes but feels incomplete/awkward

Proposed Solution

Add early-exit logic to /qa skill:

### Early Exit: No Implementation

Before spawning quality check agents, verify implementation exists:

\`\`\`bash
# Check for worktree
worktree_exists=$(git worktree list | grep -i "<issue-number>" | head -1)

# Check for commits on a feature branch
commits_exist=$(git log --oneline main..HEAD 2>/dev/null | head -1)

# Check for open PR
pr_exists=$(gh pr list --search "<issue-number>" --state open --json number -q '.[0].number')
\`\`\`

**If none exist:**
- Skip sub-agent spawning (nothing to check)
- Skip code review (no code to review)
- Proceed directly to verdict: `AC_NOT_MET`
- Output: "No implementation found. Run `/exec <issue>` first."

Acceptance Criteria

  • /qa skill includes early-exit check for missing implementation
  • Sub-agents are NOT spawned when no implementation exists
  • Clear message directs user to run /exec first
  • Verdict is AC_NOT_MET with appropriate explanation

Files to Modify

.claude/skills/qa/SKILL.md

Discovered From

Session reflection after running /qa 97 on an unimplemented issue - the skill ran through its full workflow unnecessarily.

Activity

  1. admarble commented on Jan 17, 2026

    @admarble
    ContributorAuthor

    📋 Implementation Plan

    Acceptance Criteria (with Verification)

    AC Description Verification Test Scenario
    AC-1 Early-exit check for missing implementation Manual Test Run /qa on issue with no worktree/commits/PR → exits early
    AC-2 Sub-agents NOT spawned when no implementation Manual Test Verify no Task agents spawned → reduced token usage
    AC-3 Clear message to run /exec first Manual Test Output includes "Run /exec <issue> first"
    AC-4 Verdict is AC_NOT_MET Manual Test Output shows AC_NOT_MET with explanation

    Verification Summary

    AC Verification Method Key Assumption
    AC-1 Manual Test git worktree/log commands reliably detect state
    AC-2 Manual Test Early-exit runs before sub-agent section
    AC-3 Manual Test None
    AC-4 Manual Test None

    Assumptions to Validate (Before Implementation)

    • git worktree list can find worktrees by issue number
    • git log main..HEAD returns empty when no commits exist
    • gh pr list --search works for finding PRs by issue number

    Implementation Plan

    Phase 1: Add Implementation Status Check

    1. Add "Phase 0: Implementation Status Check" section in SKILL.md
    2. Insert BEFORE "Quality Checks (Multi-Agent)" section (line ~174)
    3. Define detection logic for worktree, commits, uncommitted changes, PR

    Phase 2: Add Early Exit Output Format

    1. Create standardized early-exit output block with verdict AC_NOT_MET
    2. Skip Quality Metrics, Code Review, Self-Evaluation sections
    3. Direct user to run /exec first

    Phase 3: Integration

    1. Respect orchestration context (SEQUANT_WORKTREE, SEQUANT_ORCHESTRATOR)
    2. Update Output Verification checklist for early-exit scenario

    Effort Breakdown

    Phase Effort Files
    Phase 1 Small .claude/skills/qa/SKILL.md
    Phase 2 Small .claude/skills/qa/SKILL.md
    Phase 3 Small .claude/skills/qa/SKILL.md

    Total: Single-file modification, ~30-50 lines of markdown additions


    Open Questions

    1. Post GitHub comment on early-exit? → Recommended: No (reduces noise)
    2. Update labels on early-exit? → Recommended: No (issue state unchanged)

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: Disabled
    Reasoning: Single-file skill modification with clear AC. No complex refactoring.

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

    @admarble
    ContributorAuthor

    Implementation Complete

    AC Coverage

    AC Description Status Notes
    AC-1 /qa skill includes early-exit check for missing implementation ✅ MET Added "Phase 0: Implementation Status Check" section with detection logic
    AC-2 Sub-agents are NOT spawned when no implementation exists ✅ MET Early exit template explicitly skips sub-agent spawning
    AC-3 Clear message directs user to run /exec first ✅ MET Template includes "Run /exec <issue-number> to implement the feature"
    AC-4 Verdict is AC_NOT_MET with appropriate explanation ✅ MET Template includes AC_NOT_MET verdict with explanation

    Coverage: 4/4 AC items fully met

    Files Changed

    • .claude/skills/qa/SKILL.md (+87 lines)

    Implementation Details

    1. Phase 0: Implementation Status Check - Added before "Quality Checks (Multi-Agent)" section

      • Detection logic for worktree, commits, uncommitted changes, and open PR
      • Implementation Status Matrix for clear decision logic
      • Early exit condition: no commits AND no uncommitted changes AND no PR
    2. Early Exit Output Template - Streamlined output when no implementation exists

      • Clear "Implementation Status: NOT FOUND" header
      • Lists what was checked (commits, uncommitted changes, PR)
      • AC_NOT_MET verdict with explanation
      • Next steps directing to run /exec first
    3. Updated Output Verification - Split into two sections

      • "Standard QA (Implementation Exists)" - original checklist
      • "Early Exit (No Implementation)" - new checklist for early-exit scenario

    Test Results

    • ✅ npm test - 368 passed, 1 skipped
    • ✅ npm run build - successful

    PR Status

    Created: #105

    Self-Evaluation

    • Worked as expected: Yes - all changes are markdown additions to the skill file
    • Test coverage confidence: Medium - this is a skill instruction file, tested via manual execution
    • Weakest part: Skill instructions depend on LLM following the logic correctly; no automated enforcement
    • Honest assessment: The implementation is straightforward markdown additions. Real testing will occur when /qa is run on an unimplemented issue.

    Next Steps

    1. Run /qa 102 to verify the implementation
    2. Merge PR after QA approval
  5. admarble commented on Jan 17, 2026

    @admarble
    ContributorAuthor

    QA Review ✅

    AC Coverage

    AC Description Status Notes
    AC-1 Early-exit check for missing implementation ✅ MET "Phase 0: Implementation Status Check" section added with detection logic
    AC-2 Sub-agents NOT spawned when no implementation ✅ MET Early exit instructions explicitly skip sub-agent spawning
    AC-3 Clear message to run /exec first ✅ MET Template includes "Run /exec <issue-number> to implement the feature"
    AC-4 Verdict is AC_NOT_MET ✅ MET Template shows AC_NOT_MET with appropriate explanation

    Coverage: 4/4 AC items fully met


    Quality Metrics

    Metric Value Status
    Type issues 0 ✅ OK
    Deleted tests 0 ✅ OK
    Files changed 1 ✅ OK
    Lines added +87 -
    Lines deleted -1 -

    Code Review Summary

    Strengths:

    • Well-structured with clear section headers ("Phase 0", "Early Exit Output Template")
    • Implementation Status Matrix provides clear decision logic
    • Detection covers all indicators: worktree, commits, uncommitted changes, PR
    • Output Verification checklist updated for early-exit scenario

    Issues: None


    Verdict: READY_FOR_MERGE

    All acceptance criteria fully met. Implementation is minimal, focused, and well-documented.


    Documentation: Before merging, run /docs 102 to generate feature documentation.

  6. added
    ready-for-review
    on Jan 17, 2026
  7. added a commit that references this issue on Jan 17, 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

    plannedready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions