Skip to content

feat(#813): pre-flight the skills install — missing .claude/skills/ fails fast - #821

Merged
admarble merged 2 commits into
mainfrom
feature/813-feat-run-pre-flight-the-skills-install-missing
Jul 27, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/813-feat-run-pre-flight-the-skills-install-missing

Conversation

@admarble

@admarble admarble commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • sequant run now pre-flights the skills install in RunOrchestrator.run() — after issue info is fetched, before any worktree is provisioned or state entry written — and exits 1 naming the missing skills and the remedy (sequant sync). This replaces the motivating incident's failure mode: 30 minutes of a phase agent hunting for a slash command that can never resolve, misreported as a transient "spec retry" (feat(run): pre-flight the skills install — missing .claude/skills/ should fail fast, not flail for 30 minutes as a spec retry #813).
  • The required-skills set is computed from the phases resolved for that run (explicit --phases, label auto-detect, additive --testgen/--security-review, UI-label test, loop when the quality loop is on) — not a hardcoded spec, exec, qa triple. See src/lib/workflow/skills-preflight.ts.
  • The path-layout check is extracted to src/lib/skills-check.ts and shared with doctor's Skills/Core Skills checks, so the two cannot drift (AC-4).
  • New AgentDriver.resolvesSkills capability gates the check: claude-code true, aider false — aider's inline driverOverrides prompts never resolve skills, so an aider run on a skills-less tree still executes (AC-3). --dry-run also skips it.
  • Docs (README, installation, troubleshooting) now state .claude/skills/ is a hard runtime dependency of the claude-code driver (settingSources: ["project"], Fix sequant run to use Claude Agent SDK #19/bug(customization): .claude/.local/skills (and likely hooks) never load — documented override layer is non-functional #711) and worth committing.

AC Verification

AC Status Evidence
AC-1 pre-flight before provisioning, exit non-zero + remedy ✅ Smoke: skills-less repo → exit 1, missing .claude/skills/ directory (needs: exec, qa) + sequant sync; no worktree, no state entry
AC-2 phases resolved for the run, not hardcoded triple ✅ resolveRequiredSkills unit tests (--phases exec,qa → exec,qa only; additive flags; UI labels; auto-detect)
AC-3 skipped for non-skill drivers ✅ aider integration test executes past pre-flight with no .claude/skills/; driver capability unit tests
AC-4 reuses doctor's logic ✅ doctor Checks 2+3 now call checkSkillsInstalled; path literal exists in one module
AC-5 test: non-zero exit, no worktree, no state entry ✅ skills-preflight.integration.test.ts
AC-6 docs: runtime dep worth committing ✅ README, docs/getting-started/installation.md, docs/troubleshooting.md

Test plan

  • Unit: skills-check.test.ts (5), skills-preflight.test.ts (12), driver capability assertions
  • Integration: skills-less tree → exit 1 / no worktree / no state entry; aider bypass
  • Full suite: 198 files, 4120 tests pass; build + lint clean
  • Manual smoke: fail-fast message, then sequant sync remedy loop with the built CLI

Fixes #813

🤖 Generated with Claude Code

…/ fails fast

The claude-code driver loads skills from project scope only
(settingSources: ["project"], #19/#711), so a missing .claude/skills/
sends every phase agent hunting for a slash command that can never
resolve — surfacing ~30 minutes later as a bogus "spec retry" failure.

- New shared lib/skills-check.ts owns the .claude/skills/<skill>/SKILL.md
  layout; doctor's Skills/Core Skills checks now consume it (AC-4).
- workflow/skills-preflight.ts resolves the skills required by the
  phases of *this* run (explicit --phases, label auto-detect, additive
  --testgen/--security-review, UI-label test, loop when quality loop is
  on) — not a hardcoded triple (AC-2).
- RunOrchestrator.run() aborts with exit 1 naming the missing skills and
  the remedy (sequant sync) before any worktree or state entry (AC-1),
  covering MCP-initiated runs too.
- New AgentDriver.resolvesSkills gates the check: claude-code true,
  aider false — aider's inline driverOverrides prompts never resolve
  skills, so a skills-less aider run still executes (AC-3).
- Integration test asserts a skills-less tree exits non-zero with no
  worktree provisioned and no state entry (AC-5); docs note the
  directory is a runtime dependency worth committing (AC-6).

Fixes #813
…ookup

Post-QA gap fixes surfaced in review of PR #821:

- Explicit --testgen/--security-review now require their skill even when
  spec is absent from the pipeline: on resume-after-spec, batch-executor
  inserts the phase via specAlreadyRan, which the pre-flight cannot
  cheaply know. Requiring the skill the flag names is the safe superset.
- The loop skill is required when any issue's labels would auto-enable
  the quality loop (detectPhasesFromLabels().qualityLoop), not only when
  the loop was enabled up front.
- An unknown settings.run.agent no longer throws raw from run()'s
  pre-flight; the check steps aside and phase-executor surfaces the
  unknown-driver error through its normal per-issue failure path.
@admarble

Copy link
Copy Markdown
Contributor Author

Follow-up commit a50a5d2 from the post-QA gap review: (1) explicit --testgen/--security-review now require their skill even when spec is absent from the pipeline (covers the resume-after-spec path where batch-executor inserts the phase via specAlreadyRan); (2) the loop skill is required when labels would auto-enable the quality loop, not only with -Q; (3) an unknown settings.run.agent no longer throws raw from the pre-flight — phase-executor surfaces it per-issue as before. +4 unit tests; full suite green (4124).

@admarble
admarble merged commit 6f6d538 into main Jul 27, 2026
5 checks passed
admarble added a commit that referenced this pull request Sep 9, 2026
…ookup

Post-QA gap fixes surfaced in review of PR #821:

- Explicit --testgen/--security-review now require their skill even when
  spec is absent from the pipeline: on resume-after-spec, batch-executor
  inserts the phase via specAlreadyRan, which the pre-flight cannot
  cheaply know. Requiring the skill the flag names is the safe superset.
- The loop skill is required when any issue's labels would auto-enable
  the quality loop (detectPhasesFromLabels().qualityLoop), not only when
  the loop was enabled up front.
- An unknown settings.run.agent no longer throws raw from run()'s
  pre-flight; the check steps aside and phase-executor surfaces the
  unknown-driver error through its normal per-issue failure path.
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(run): pre-flight the skills install — missing .claude/skills/ should fail fast, not flail for 30 minutes as a spec retry

1 participant