agentleFS
mirekondromirekondro/The-Pre-Flight-Check/skills/pre-flight-check/SKILL.md

pre-flight-check

Skill2 starsChanged 5 months agoMITView on GitHub

Run this quality gate pipeline before committing code, completing a task, or when validating if a bug fix worked. It strictly checks Typechecking, Linting, Testing, and Security Audits sequentially.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. pskoett/pskoett-ai-skills★ 327same name
    2. Heverton-web/fabrica-universal★ 0same name
    3. MyAiFreedomSystems/pre-flight-check★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 8 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run this skill without being asked at every one of these checkpoints:

    line 12
  2. Distinctive:

    If you are about to say "done", "fixed", "complete", "ready to commit", or similar — stop and run this skill first.

    line 19
  3. Very specific:

    If the script outputs ### ❌ PRE-FLIGHT FAILURE: [STAGE_NAME], you are FORBIDDEN from:

    line 37
  4. Very specific:

    Read the offending file at that line with the Read tool.

    line 51
  5. Very specific:

    Do not add any, as unknown as X, # type: ignore, or equivalent escape hatches to silence the checker.

    line 53
  6. Distinctive:

    Run the project's auto-fix command first:

    line 58
  7. Very specific:

    Do not add the file to .eslintignore / ruff exclude lists, do not add file-level disables, do not weaken the rule globally.

    line 62
  8. Distinctive:

    Read the assertion message and the failing test name from the context block.

    line 66
  9. Distinctive:

    Do not add the advisory to an ignore list to silence the audit without explicitly stating the risk acceptance to the user and getting …

    line 74
  10. Distinctive:

    Open the named file at the named line first: Do not search the codebase, do not re-read unrelated files, do not refactor surrounding code.

    line 87
  11. Distinctive:

    One failure, one fix, one re-run: Do not bundle speculative changes alongside the repair.

    line 88
  12. Distinctive:

    When the script prints:

    line 101

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Pre-Flight Check

A mandatory, fail-fast quality gate. Runs Typecheck → Lint → Test → Security Audit sequentially via scripts/run-pipeline.py. The script auto-detects the project runtime (Node.js or Python) and exits with code 1 on the first failing stage, emitting a structured Markdown block you must parse.

When to invoke

Run this skill without being asked at every one of these checkpoints:

  • Before announcing a task is "done" — any task involving code edits.
  • Before staging, committing, or pushing any change.
  • After applying a bug fix — to confirm the fix holds across all gates, not just the failing test.
  • Before opening a PR or marking work ready for review.

If you are about to say "done", "fixed", "complete", "ready to commit", or similar — stop and run this skill first.

How to run

Execute from the repository root:

python .claude/skills/pre-flight-check/scripts/run-pipeline.py

The script writes a header per stage as it progresses, then emits one of:

  • ### ✅ PRE-FLIGHT PASSED — exit 0. Safe to proceed.
  • ### ❌ PRE-FLIGHT FAILURE: [STAGE_NAME] — exit 1. Stop and fix.
  • ### ⚠️ PRE-FLIGHT SKIPPED: … — exit 1. Runtime undetected or no stages resolved. Resolve tooling before proceeding.

Strict Fail-Fast Protocol

If the script outputs ### ❌ PRE-FLIGHT FAILURE: [STAGE_NAME], you are FORBIDDEN from:

  • Declaring the task done.
  • Committing, staging, or pushing any code.
  • Switching to a different task, file, or feature.
  • Suppressing the error (no // @ts-ignore, no # noqa, no eslint-disable, no pytest.skip, no removing the failing test, no widening ignore globs).
  • Re-running the pipeline hoping for a flake. Failures are real until proven otherwise by a fix in source.

Your only permitted next action is to repair the specific error reported by the failing stage and re-run the pipeline. Continue this loop until you see ### ✅ PRE-FLIGHT PASSED.

Stage-specific repair rules

TYPECHECK failure

  1. Parse Context for AI Fix for the file path and line number (e.g. src/foo.ts:42).
  2. Read the offending file at that line with the Read tool.
  3. Fix the type at its source — narrow the type, add the missing field, correct the signature, or update the call site.
  4. Do not add any, as unknown as X, # type: ignore, or equivalent escape hatches to silence the checker. If a cast is genuinely required (e.g. external untyped boundary), it must be the minimum-width cast at the narrowest possible scope, with a one-line comment explaining why.
  5. Re-run the pipeline.

LINT failure

  1. Identify the rule ID and file from the context block.
  2. Run the project's auto-fix command first:
    • Node: npm run lint -- --fix / pnpm lint --fix / yarn lint --fix / npx eslint . --fix.
    • Python: ruff check . --fix or the equivalent formatter (ruff format ., black .).
  3. For rules the auto-fixer cannot resolve, edit the file manually to satisfy the rule.
  4. Do not add the file to .eslintignore / ruff exclude lists, do not add file-level disables, do not weaken the rule globally. Inline rule disables are allowed only for a single line with a comment justifying why.
  5. Re-run the pipeline.

TEST failure

  1. Read the assertion message and the failing test name from the context block.
  2. Determine whether the production code is wrong or the test's expectation is wrong. Default assumption: production code is wrong.
  3. Fix the root cause. Do not delete, skip, or relax the assertion to make it pass.
  4. Re-run the pipeline.

SECURITY AUDIT failure

  1. Identify the vulnerable package and CVE / advisory ID from the context block.
  2. Upgrade to the patched version range. If no patch exists, evaluate whether the package can be replaced or the affected code path is reachable.
  3. Do not add the advisory to an ignore list to silence the audit without explicitly stating the risk acceptance to the user and getting confirmation.
  4. Re-run the pipeline.

Reading the structured error context — avoid the lazy loop

The ### ❌ PRE-FLIGHT FAILURE block is engineered so you can act decisively. Use it as follows; do not spin in vague attempts.

  1. Command Executed — confirms which tool produced the error. Use this to pick the correct repair recipe above. If you are guessing what tool failed, you are about to make a wrong fix.
  2. Context for AI Fix (the fenced code block) — extract, in order:
    • The file path (relative or absolute).
    • The line and column (e.g. :42:17).
    • The rule ID or error code (e.g. TS2345, E501, no-unused-vars, CVE-2024-xxxxx).
    • The diagnostic message verbatim.
  3. Open the named file at the named line first. Do not search the codebase, do not re-read unrelated files, do not refactor surrounding code. Repair the exact diagnostic.
  4. One failure, one fix, one re-run. Do not bundle speculative changes alongside the repair. If the next pipeline run reveals a new failure, treat it as a new cycle.

Lazy-loop anti-patterns — refuse these

  • Re-running the pipeline unchanged hoping the result differs.
  • Editing a file you were not directed to by the diagnostic.
  • "Fixing" by deleting the failing test, suppressing the rule, or relaxing the type.
  • Reporting "done" while a failure is on screen.
  • Declaring a flake without evidence (a reproducible non-determinism, a network/timing issue documented in the test).
  • Switching strategy after a single failure — repair, re-run, repeat.

Success state

When the script prints:

### ✅ PRE-FLIGHT PASSED
All quality gates verified successfully.

…and exits 0, you may proceed with the original action (commit, mark done, open PR). Not before.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.