Repository navigation
Description
Problem
When a new CLI option is added to a TypeScript interface (e.g., RunOptions.force) and used in runtime code (mergedOptions.force), but NOT registered in the CLI argument parser (bin/cli.ts), the flag is silently unreachable from the command line. Commander.js will error on the unrecognized option.
This class of bug is invisible to:
- TypeScript compilation (interface field is valid)
- Build (compiles fine)
- Unit tests (mock the option directly, never go through CLI parsing)
- CI (all checks pass)
Incident: #305 --force flag (2026-02-20)
Issue #305 added a force?: boolean field to RunOptions, checked it at runtime with mergedOptions.force, and displayed "use --force to re-run" in user-facing warnings. But --force was never registered as a .option() on the run command in bin/cli.ts. The previous QA pass gave READY_FOR_MERGE. The bug was caught by manual cross-reference during a second QA run.
Root cause
The QA skill has no mechanical check for CLI wiring completeness. It reviews code quality, tests, security, and AC coverage — but not whether new interface fields have corresponding CLI registrations.
Proposed Solution
Add a CLI Registration Verification section to the QA skill that triggers when option interfaces or bin/cli.ts are modified.
Detection
# Check if option interfaces or CLI file were modified
cli_modified=$(git diff main...HEAD --name-only | grep -E "bin/cli\.ts|RunOptions" | wc -l | xargs)Verification Logic
# Extract user-facing option fields from RunOptions (exclude internal-only fields)
interface_fields=$(git diff main...HEAD -- src/commands/run.ts | grep -E '^\+\s+\w+\??: ' | sed 's/.*+ *//' | sed 's/\?.*//')
# Extract registered CLI options
registered=$(grep '\.option(' bin/cli.ts | grep -oE '\-\-[a-z-]+')
# Cross-reference: flag any new field with runtime usage but no CLI registrationOutput Format
### CLI Registration Verification
| Interface Field | Runtime Usage | CLI Registered | Status |
|----------------|--------------|----------------|--------|
| `force` | `mergedOptions.force` (line 2447) | `--force` in bin/cli.ts | OK |
| `newField` | `mergedOptions.newField` (line 500) | NOT REGISTERED | FAIL |Acceptance Criteria
- AC-1: QA skill detects when
RunOptions(or similar CLI option interfaces) are modified in the diff - AC-2: For each new field with runtime usage (
mergedOptions.X), QA verifies a corresponding.option()exists inbin/cli.ts - AC-3: Missing CLI registrations are flagged as issues in the QA output
- AC-4: Verdict cannot be
READY_FOR_MERGEif CLI registration verification fails - AC-5: Internal-only fields (e.g.,
autoDetectPhases,worktreeIsolation) are excluded from the check (no runtimemergedOptions.X→--Xexpectation)
Files to Modify
| File | Changes |
|---|---|
.claude/skills/qa/SKILL.md |
Add CLI Registration Verification section (Section 2f) |
Context
- Origin: QA gap found during fix: pre-flight state guard and worktree lifecycle management #305 review
- Related: fix: pre-flight state guard and worktree lifecycle management #305 (pre-flight state guard —
--forceflag was unreachable) - Related: feat: Add call-site review check to QA skill for new functions #299 (call-site review — complementary but different: feat: Add call-site review check to QA skill for new functions #299 checks WHERE functions are called, this checks WHETHER options are wired)
Merged from #308: Exec-Side Prevention
In addition to QA-side detection, add a CLI wiring checklist to the exec skill that triggers when option interfaces are modified.
Exec Skill Addition
Add to the exec skill's pre-PR checklist:
CLI Wiring Check: If you added a new field to
RunOptionsor any CLI command's option interface:
- Register the flag in
bin/cli.tswith.option("--flag-name", "description")- Verify with
npx sequant <command> --helpthat the flag appears- Boolean flags:
--flag/--no-flag- Value flags:
--flag <value>with optional parser (e.g.,parseInt)
Key File Map (from #308)
| Interface | CLI Registration |
|---|---|
RunOptions in src/commands/run.ts |
run command in bin/cli.ts |
MergeOptions in src/commands/merge.ts |
merge command in bin/cli.ts |
Combined Acceptance Criteria
- QA skill detects new option interface fields and verifies CLI registration (original feat: CLI wiring completeness — QA verification + exec prevention for new option fields #307)
- Exec skill includes CLI wiring checklist when option interfaces are modified (feat(exec): Add CLI wiring reminder when modifying option interfaces #308)
- Both skills reference the key file map for interface → CLI registration lookup
Activity
[-]feat(qa): Add CLI registration verification for new option fields[/-][+]feat: CLI wiring completeness — QA verification + exec prevention for new option fields[/+]admarble commentedon Mar 12, 2026
Solve Analysis
Recommended Phases: spec → exec → qa
Skip Spec: No (complex cross-skill verification logic needs design)
Browser Testing: No (skill file changes, not UI)
Quality Loop: Yes (part of 3-issue chain, includes merged #308 scope)
Reasoning
Flags
📝 Generated by
/solveadmarble commentedon Mar 12, 2026
Spec Review Complete
Acceptance Criteria
RunOptionsmodified.option()exists for runtimemergedOptions.XusageKey File Map
RunOptionssrc/lib/workflow/batch-executor.tsruncommand inbin/cli.tsMergeOptionssrc/commands/merge.tsmergecommand inbin/cli.tsImplementation Plan
Phase 1: QA Skill Updates (
.claude/skills/qa/SKILL.md)git diff main...HEAD --name-only | grep -E "RunOptions|MergeOptions".option()registrationsAC_NOT_METPhase 2: Exec Skill Updates (
.claude/skills/exec/SKILL.md)--help, follow conventionsConflict Coordination
.claude/skills/qa/SKILL.md.claude/skills/qa/SKILL.md,.claude/skills/exec/SKILL.md.claude/skills/exec/SKILL.md,bin/cli.tsChain position: Last of #254, #304, #307 QA skill chain (per solve analysis)
Open Questions
Internal-only field detection: Explicit allowlist vs heuristic?
Cross-command coverage: Just
runor all commands?run, expand laterRecommended Workflow
feat(#307): add CLI wiring completeness checks to /exec and /qa skills
admarble commentedon Mar 12, 2026
/exec Phase Complete
AC Coverage Summary
.claude/skills/qa/SKILL.md:931-1028.claude/skills/exec/SKILL.md:575-640Files Changed
.claude/skills/qa/SKILL.md- Added Section 2g: CLI Registration Verification + output template.claude/skills/exec/SKILL.md- Added Section 3g: CLI Wiring Checklist + output verification checklist itemQuality Plan Alignment
N/A - No quality plan in issue
Check Results
npm run buildsucceededstate-utils.test.ts(not related to changes)PR Status
✅ Created: #351
Implementation Highlights
QA Skill (Section 2g): Comprehensive detection of option interface fields with runtime usage but missing CLI registration. Includes:
git diffandgrepRunOptionstobin/cli.tsExec Skill (Section 3g): Proactive implementation-time checklist with:
admarble commentedon Mar 12, 2026
QA Review — Issue #307
PR: #351
Branch:
feature/307-feat-cli-wiring-completeness-qa-verification-exec-Commit:
e6777ac— feat(#307): add CLI wiring completeness checks to /exec and /qa skillsPhase 0: Pre-flight
/Users/tony/Projects/worktrees/feature/307-feat-cli-wiring-completeness-qa-verification-exec-Phase 1: CI Status
--max-warnings 0with 5 pre-existing warningsCI Verdict: FAIL — Lint failure on Node 18.x. The 5 warnings are in
src/commands/run.tsandsrc/lib/workflow/batch-executor.ts(unused imports:PhaseResult,determinePhasesForIssue,parseQaVerdict,formatDuration,hasUILabels). These appear to be pre-existing issues not introduced by this PR (only.mdfiles changed), but CI is red nonetheless.Phase 2: Code Review
2a. Scope & Size
.claude/skills/qa/SKILL.md,.claude/skills/exec/SKILL.mdonly2b. Type Safety
N/A — Only markdown files changed.
2c. Security
No security concerns — skill markdown documentation only.
2d. Anti-Pattern Detection
Issue found: grep commands without
|| trueThe exec skill's Quick Verification Script (Section 3g) contains grep commands without
|| true:Per project MEMORY.md: "grep returns exit code 1 on 0 matches, which kills parallel Bash tool calls." All grep commands in SKILL.md code blocks must have
|| true.Severity: Medium — These are instructional code blocks that agents copy-paste into bash calls. Without
|| true, zero-match scenarios will kill sibling tool calls.2e. Template Sync
Issue found:
templates/skills/not updatedChanges were made to:
.claude/skills/qa/SKILL.md(128 lines added).claude/skills/exec/SKILL.md(67 lines added)But the corresponding template files were NOT updated:
templates/skills/qa/SKILL.md— NOT SYNCEDtemplates/skills/exec/SKILL.md— NOT SYNCEDPer project MEMORY.md: "Skill templates live in both
.claude/skills/andtemplates/skills/— fix both orsequant initregenerates the bug."Severity: High —
sequant initwill overwrite the new sections with stale template versions.2f. CHANGELOG
No CHANGELOG entry. Since this modifies skill files (internal tooling, not user-facing code), a CHANGELOG entry is not strictly required but would be nice for traceability.
Phase 3: QA vs AC
RunOptionsmodified in diffbatch-executor.ts,run.ts,cli.ts.option()for runtimemergedOptions.Xusagebin/cli.tsregistrationsgrep "mergedOptions.$field"returns no matches → internal-only. Examples:autoDetectPhases,worktreeIsolationAC Verdict: All acceptance criteria MET.
Phase 4: Call-Site Review
N/A — No TypeScript code changes, only skill markdown.
CLI Registration Verification
N/A — No option interface changes in this PR.
Test Coverage
N/A — No testable code changes. Skill markdown files are validated by
validate-skillsCI job (PASSED).Phase 5: Adversarial Self-Evaluation
templates/skills/sync issue was caught.|| trueissues real? Yes — documented in MEMORY.md as a known pattern that causes agent failures.Verdict
REVISIONS_NEEDED
Verdict Algorithm:
Blocking Issues:
templates/skills/qa/SKILL.mdandtemplates/skills/exec/SKILL.mdmust be updated with the same additions. Without this,sequant initwill overwrite the changes.|| truemissing (MEDIUM) — Exec skill Section 3g Quick Verification Script has 2 grep commands without|| truesafety guards.Non-blocking:
3. CI lint failure is pre-existing (5 unused import warnings in unrelated files). Should be fixed separately but does not block this PR conceptually.
Remediation:
.claude/skills/qa/SKILL.mdtotemplates/skills/qa/SKILL.md.claude/skills/exec/SKILL.mdtotemplates/skills/exec/SKILL.md|| trueto grep commands in exec skill Section 3g Quick Verification Scriptadmarble commentedon Mar 12, 2026
RE-QA Review — Issue #307
PR: #351
Branch:
feature/307-feat-cli-wiring-completeness-qa-verification-exec-Commits:
e6777ac(feat) +dff4dcf(fix)Previous QA: REVISIONS_NEEDED (2 blocking issues)
Phase 0: Pre-flight
/Users/tony/Projects/worktrees/feature/307-feat-cli-wiring-completeness-qa-verification-exec-Phase 1: CI Status
CI Verdict: FAIL (pre-existing). The 5 lint warnings are in
src/commands/run.tsandsrc/lib/workflow/batch-executor.ts(unused imports:PhaseResult,determinePhasesForIssue,parseQaVerdict,formatDuration,hasUILabels). These exist onmainand are NOT introduced by this PR (only.mdfiles changed). Plugin test failures are also pre-existing and unrelated.Phase 2: Code Review
2a. Scope & Size
.claude/skills/{qa,exec}/SKILL.md,templates/skills/{qa,exec}/SKILL.md,skills/{qa,exec}/SKILL.md2b. Type Safety
N/A — Only markdown files changed.
2c. Security
No security concerns — skill markdown documentation only.
2d. Anti-Pattern Detection — grep || true
Previous issue: 2 grep commands without
|| truein exec skill Section 3gRE-QA verification:
grep -E '^\s+\w+\??: ' src/lib/workflow/batch-executor.ts | head -30 || true— FIXEDgrep -A 50 'command("run")' bin/cli.ts | grep '\.option(' | head -30 || true— FIXEDgrep -q "\-\-$cli_flag" bin/cli.ts && echo "..." || echo "..."— Safe (|| echo handles non-zero)|| trueStatus: RESOLVED
2e. Template Sync
Previous issue: Changes only in
.claude/skills/, not synced totemplates/skills/orskills/RE-QA verification:
.claude/skills/exec/SKILL.md==templates/skills/exec/SKILL.md— IDENTICAL (diff empty).claude/skills/exec/SKILL.md==skills/exec/SKILL.md— IDENTICAL (diff empty).claude/skills/qa/SKILL.md==templates/skills/qa/SKILL.md— IDENTICAL (diff empty).claude/skills/qa/SKILL.md==skills/qa/SKILL.md— IDENTICAL (diff empty)All 3 directories fully synced for both qa and exec skills.
Status: RESOLVED
2f. CHANGELOG
No CHANGELOG entry. Acceptable for internal skill file changes (not user-facing code).
Phase 3: AC Verification
RunOptionsmodified in diffbatch-executor.ts,run.ts,cli.ts(qa/SKILL.md:941-949).option()for runtimemergedOptions.Xusagebin/cli.tsregistrations (qa/SKILL.md:957-990)grep "mergedOptions.$field"returns no matches -> internal-only (qa/SKILL.md:992-999)AC Verdict: All acceptance criteria MET.
Phase 4: Previous Blocking Issues Resolution
diffconfirms all 3 directories identical for both skillsBoth blocking issues from the previous QA are fully resolved in commit
dff4dcf.Phase 5: Adversarial Self-Evaluation
diffon all 6 file pairs (3 dirs x 2 skills). All pairs are identical.|| true, in a pipeline ending with|| true, or use the&& ... || ...pattern.Verdict
READY_FOR_MERGE
Verdict Algorithm:
Note: CI lint failures are pre-existing unused import warnings in
src/commands/run.tsandsrc/lib/workflow/batch-executor.ts. These should be cleaned up in a separate PR but do not block this change (only.mdfiles modified).feat(#307): add CLI wiring completeness checks to /exec and /qa skills
feat(#307): add CLI wiring completeness checks to /exec and /qa skills (
admarble commentedon Mar 12, 2026
Documentation Review Complete
This issue contains documentation-only changes. No additional documentation generation required.
Files Modified:
.claude/skills/exec/SKILL.md— Added Section 3g: CLI Wiring Checklist.claude/skills/qa/SKILL.md— Added Section 2g: CLI Registration Verificationskills/exec/SKILL.md— Mirror of exec skill updateskills/qa/SKILL.md— Mirror of QA skill updatetemplates/skills/exec/SKILL.md— Template mirror of exec skill updatetemplates/skills/qa/SKILL.md— Template mirror of QA skill updateWhat Was Built:
READY_FOR_MERGEis blocked on failures.Status:
Documentation changes are ready for review and merge.
Ready to merge!