Pre-flight Check
Universal pre-flight validation across commit, PR, release, and deploy boundaries. Orchestrates the validator suite that lives under .claude-plugin/skills/validation/ and dispatches the right check set for the current context.
When to Use
- User asks "is this ready to commit / PR / release / deploy?"
- User says "pre-flight", "validate", "check readiness", or runs
/craft:check
- Before staging a commit, opening a PR, or kicking off the release pipeline
- After a session of edits, to confirm nothing regressed
- When the user wants to scaffold a new custom validator (
gen-validator flow)
Scope Boundary (Read This First)
This skill is broader than its siblings — understand the seams:
| Skill |
Concern |
Does NOT cover |
| preflight-check (this) |
Cross-cutting validators: lint, tests, types, version sync, stale refs, link integrity, hook conflicts, CLAUDE.md health, docs staleness, badge URLs, formula desc, skill standards (release-gated) |
Detection logic, release orchestration, guard rule editing |
project-detector (skills/ci/) |
Detect project type / build tool / test framework to recommend a CI template |
Validation orchestration. It answers "what kind of project is this?" not "is it ready?" |
release (skills/release/) |
The full release pipeline (version bump → PR → merge → GitHub release → Homebrew → verify). Calls this skill internally for its Step 2 pre-flight gate |
Standalone commit/PR validation |
guard-audit (skills/guard-audit/) |
Tune branch-guard.sh rules via .claude/branch-guard.json to reduce false positives |
Running checks. It edits guard config, doesn't validate the project |
Rule of thumb: if the user wants to run validators, use this skill. If they want to change which rules block them, route to guard-audit. If they want a release, route to release (which calls back into this skill).
Backing Commands
/craft:check — primary entry point; mode-aware, context-aware orchestrator
The skill should prefer invoking the commands rather than re-implementing their logic. The commands handle dry-run, orchestration, and hot-reload validator discovery.
Context Flags (--for ...)
Pick the check set by what the user is preparing for. This is the primary axis of behavior:
--for |
Run when user is about to... |
Adds beyond default |
commit |
Stage and commit on a feature branch |
Fast lint on changed files, fail-fast tests, basic version-sync, no-secrets scan |
pr |
Open a PR to dev/main |
Full lint, full test suite, coverage ≥ 80%, internal links, merge-conflict detect, stale-ref scan, hook-conflict audit, CLAUDE.md health |
release |
Cut a release (called by skills/release/) |
Full audit: strict lint, all tests + coverage ≥ 90%, all links, full version audit (fatal on drift), security audit, badge URL both-branch check, formula desc count check |
deploy |
Deploy docs site or downstream artifact |
Same as release minus formula-desc; plus tag-exists check |
If no --for is specified, run the "general" check set (lint + tests + git status + docs if changed).
Mode-Aware Behavior
Modes are orthogonal to --for — they tune verbosity, fail-fast, and threshold strictness:
| Mode |
Budget |
Behavior |
default |
< 30s |
Fast path, fail-fast, summary output |
debug |
< 120s |
Verbose output, no fail-fast, surface all warnings |
thorough |
< 180s |
Full lint + types + security + docs sweep |
release |
< 300s |
Strictest thresholds (coverage ≥ 90%, version drift = fatal) |
Mode applies to the hot-reload validators too via $CRAFT_MODE — see the validator template generator output for the per-mode threshold table.
Recommended Flow
- Confirm intent. Ask which context (
commit/pr/release/deploy) if the user didn't say. Default to the most conservative reasonable guess based on the current branch (feature/* → commit or pr; dev → release).
- Dry-run first when stakes are high. For
--for release or --for deploy, suggest /craft:check --for release --dry-run to preview the validator plan and time estimate before executing.
- Run the appropriate command. Invoke
/craft:check --for <context> [mode]. Let the command's Step 0 plan + AskUserQuestion gate handle confirmation.
- On failure, route specifically. Don't just dump errors — point at the right follow-up:
- Lint failures → suggest
/craft:ci:fix or /craft:code:lint
- Version drift → suggest
/craft:check --version release for the focused validator
- Stale refs from a rename → list the files that need updating
- CLAUDE.md staleness → suggest the docs/claude-md skill (sync)
- Hook-conflict false positives → route to
guard-audit skill
- On all-green, summarize and stop. Don't recommend "next steps" past the immediate gate the user asked about (per feature-branch-workflow rules: no PR-merge nudging).
Validator Generation (Separate Operation)
Generating a new custom validator is a distinct workflow from running checks. Trigger conditions:
- User says "create a validator", "add a custom validator", "generate a validator template"
- User wants to extend
/craft:check with project-specific validation logic
check:gen-validator was folded into this skill in the v4 consolidation (Phase 3.5,
2026-07-12) — no standalone command remains. Full scaffolding walkthrough (template
structure, interactive-mode prompts, mode-aware threshold examples, the community
validator marketplace convention): references/gen-validator.md.
In that flow:
- Generate the validator file directly under
.claude-plugin/skills/validation/<name>.md
with hot_reload: true (see references/gen-validator.md for the full template).
- After generation, suggest a smoke test:
CRAFT_MODE=default bash .claude-plugin/skills/validation/<name>.md then /craft:check to confirm auto-discovery.
Do not auto-generate a validator while the user is running checks — these are independent concerns. If both are in flight, finish the check pass first.
Context Header (--context)
The check command supports a --context flag that skips validation and emits only a one-screen session header (project, branch, worktree, base, guard status, phase, test count, docs status, insights). When the user asks "what's the state of this branch?" or "what session am I in?", prefer /craft:check --context over running validators. It's read-only and < 1s.
Output Conventions
The backing command uses box-drawing output (see commands/check.md). When this skill summarizes results in chat, mirror that structure compactly:
Project: <name> (<type>) Context: <for-value> Mode: <mode>
Lint: PASS / N issues
Tests: N/M passed
Version: in sync / DRIFT (file:line)
Docs: GREEN / YELLOW / RED
Status: READY / BLOCKED — <reason>
Next: <single actionable suggestion or none>
Keep summaries terse. The command's own output is the system of record.
Anti-Patterns
- Don't re-implement project detection here — defer to
project-detector via the command.
- Don't edit branch-guard rules — that's
guard-audit.
- Don't chain into the release pipeline — let the user invoke
release explicitly. This skill stops at "READY FOR RELEASE."
- Don't silently expand scope. If the user asked
--for commit, don't also run the release-tier validators just because "they're cheap." Mode budgets exist for a reason.
- Don't fix issues the validators report unless the user asks. Surface, then wait.
See Also
commands/check.md — full check command spec (validators, modes, dry-run output)
references/gen-validator.md — validator scaffolding (folded from a command into this
skill in the v4 consolidation)
.claude-plugin/skills/validation/ — hot-reload validator directory
skills/release/SKILL.md — orchestrates this skill at Step 2 of releases
skills/ci/SKILL.md — project detection (used internally to pick check set)
skills/guard-audit/SKILL.md — tune what blocks operations (not what validates them)
1---2name: preflight-check3description: This skill should be used when the user asks to "pre-flight check", "validate before commit", "validate before PR", "validate before deploy", "is this ready to ship", "check readiness", "run pre-flight", "validate project state", or wants context-aware validation across commit/PR/release/deploy boundaries. Orchestrates universal validators (lint, tests, types, version sync, stale refs, docs, hook conflicts) and supports generating new custom validators.4---56# Pre-flight Check78Universal pre-flight validation across commit, PR, release, and deploy boundaries. Orchestrates the validator suite that lives under `.claude-plugin/skills/validation/` and dispatches the right check set for the current context.910## When to Use1112- User asks "is this ready to commit / PR / release / deploy?"13- User says "pre-flight", "validate", "check readiness", or runs `/craft:check`14- Before staging a commit, opening a PR, or kicking off the release pipeline15- After a session of edits, to confirm nothing regressed16- When the user wants to scaffold a new custom validator (`gen-validator` flow)1718## Scope Boundary (Read This First)1920This skill is broader than its siblings — understand the seams:2122| Skill | Concern | Does NOT cover |23|---|---|---|24| **preflight-check** (this) | Cross-cutting validators: lint, tests, types, version sync, stale refs, link integrity, hook conflicts, CLAUDE.md health, docs staleness, badge URLs, formula desc, skill standards (release-gated) | Detection logic, release orchestration, guard rule editing |25| `project-detector` (`skills/ci/`) | Detect project type / build tool / test framework to recommend a CI template | Validation orchestration. It answers "what kind of project is this?" not "is it ready?" |26| `release` (`skills/release/`) | The full release pipeline (version bump → PR → merge → GitHub release → Homebrew → verify). Calls this skill internally for its Step 2 pre-flight gate | Standalone commit/PR validation |27| `guard-audit` (`skills/guard-audit/`) | Tune `branch-guard.sh` rules via `.claude/branch-guard.json` to reduce false positives | Running checks. It edits guard config, doesn't validate the project |2829**Rule of thumb:** if the user wants to *run validators*, use this skill. If they want to *change which rules block them*, route to `guard-audit`. If they want a *release*, route to `release` (which calls back into this skill).3031## Backing Commands3233- `/craft:check` — primary entry point; mode-aware, context-aware orchestrator3435The skill should prefer invoking the commands rather than re-implementing their logic. The commands handle dry-run, orchestration, and hot-reload validator discovery.3637## Context Flags (`--for ...`)3839Pick the check set by what the user is preparing for. This is the primary axis of behavior:4041| `--for` | Run when user is about to... | Adds beyond default |42|---|---|---|43| `commit` | Stage and commit on a feature branch | Fast lint on changed files, fail-fast tests, basic version-sync, no-secrets scan |44| `pr` | Open a PR to dev/main | Full lint, full test suite, coverage ≥ 80%, internal links, merge-conflict detect, stale-ref scan, hook-conflict audit, CLAUDE.md health |45| `release` | Cut a release (called by `skills/release/`) | Full audit: strict lint, all tests + coverage ≥ 90%, all links, full version audit (fatal on drift), security audit, badge URL both-branch check, formula desc count check |46| `deploy` | Deploy docs site or downstream artifact | Same as `release` minus formula-desc; plus tag-exists check |4748If no `--for` is specified, run the "general" check set (lint + tests + git status + docs if changed).4950## Mode-Aware Behavior5152Modes are orthogonal to `--for` — they tune verbosity, fail-fast, and threshold strictness:5354| Mode | Budget | Behavior |55|---|---|---|56| `default` | < 30s | Fast path, fail-fast, summary output |57| `debug` | < 120s | Verbose output, no fail-fast, surface all warnings |58| `thorough` | < 180s | Full lint + types + security + docs sweep |59| `release` | < 300s | Strictest thresholds (coverage ≥ 90%, version drift = fatal) |6061Mode applies to the hot-reload validators too via `$CRAFT_MODE` — see the validator template generator output for the per-mode threshold table.6263## Recommended Flow64651. **Confirm intent.** Ask which context (`commit`/`pr`/`release`/`deploy`) if the user didn't say. Default to the most conservative reasonable guess based on the current branch (`feature/*` → `commit` or `pr`; `dev` → `release`).662. **Dry-run first when stakes are high.** For `--for release` or `--for deploy`, suggest `/craft:check --for release --dry-run` to preview the validator plan and time estimate before executing.673. **Run the appropriate command.** Invoke `/craft:check --for <context> [mode]`. Let the command's Step 0 plan + AskUserQuestion gate handle confirmation.684. **On failure, route specifically.** Don't just dump errors — point at the right follow-up:69 - Lint failures → suggest `/craft:ci:fix` or `/craft:code:lint`70 - Version drift → suggest `/craft:check --version release` for the focused validator71 - Stale refs from a rename → list the files that need updating72 - CLAUDE.md staleness → suggest the docs/claude-md skill (sync)73 - Hook-conflict false positives → route to `guard-audit` skill745. **On all-green, summarize and stop.** Don't recommend "next steps" past the immediate gate the user asked about (per feature-branch-workflow rules: no PR-merge nudging).7576## Validator Generation (Separate Operation)7778Generating a new custom validator is a *distinct* workflow from running checks. Trigger conditions:7980- User says "create a validator", "add a custom validator", "generate a validator template"81- User wants to extend `/craft:check` with project-specific validation logic8283`check:gen-validator` was folded into this skill in the v4 consolidation (Phase 3.5,842026-07-12) — no standalone command remains. Full scaffolding walkthrough (template85structure, interactive-mode prompts, mode-aware threshold examples, the community86validator marketplace convention): `references/gen-validator.md`.8788In that flow:89901. Generate the validator file directly under `.claude-plugin/skills/validation/<name>.md`91 with `hot_reload: true` (see `references/gen-validator.md` for the full template).922. After generation, suggest a smoke test: `CRAFT_MODE=default bash .claude-plugin/skills/validation/<name>.md` then `/craft:check` to confirm auto-discovery.9394**Do not** auto-generate a validator while the user is running checks — these are independent concerns. If both are in flight, finish the check pass first.9596## Context Header (`--context`)9798The check command supports a `--context` flag that *skips* validation and emits only a one-screen session header (project, branch, worktree, base, guard status, phase, test count, docs status, insights). When the user asks "what's the state of this branch?" or "what session am I in?", prefer `/craft:check --context` over running validators. It's read-only and < 1s.99100## Output Conventions101102The backing command uses box-drawing output (see `commands/check.md`). When this skill summarizes results in chat, mirror that structure compactly:103104```text105Project: <name> (<type>) Context: <for-value> Mode: <mode>106Lint: PASS / N issues107Tests: N/M passed108Version: in sync / DRIFT (file:line)109Docs: GREEN / YELLOW / RED110Status: READY / BLOCKED — <reason>111Next: <single actionable suggestion or none>112```113114Keep summaries terse. The command's own output is the system of record.115116## Anti-Patterns117118- **Don't** re-implement project detection here — defer to `project-detector` via the command.119- **Don't** edit branch-guard rules — that's `guard-audit`.120- **Don't** chain into the release pipeline — let the user invoke `release` explicitly. This skill stops at "READY FOR RELEASE."121- **Don't** silently expand scope. If the user asked `--for commit`, don't also run the release-tier validators just because "they're cheap." Mode budgets exist for a reason.122- **Don't** fix issues the validators report unless the user asks. Surface, then wait.123124## See Also125126- `commands/check.md` — full check command spec (validators, modes, dry-run output)127- `references/gen-validator.md` — validator scaffolding (folded from a command into this128 skill in the v4 consolidation)129- `.claude-plugin/skills/validation/` — hot-reload validator directory130- `skills/release/SKILL.md` — orchestrates this skill at Step 2 of releases131- `skills/ci/SKILL.md` — project detection (used internally to pick check set)132- `skills/guard-audit/SKILL.md` — tune what blocks operations (not what validates them)