fettle: Command for Claude Code

.github/prompts/fettle-preflight.prompt.md

fettle-preflight is a command for Claude Code, GitHub Copilot from MilindGaharwar/fettle. It costs 18 tokens per session (994 once invoked), scanned A, original, Apache-2.0.

A pre-deployment FMEA checklist for a service or agent. FMEA, or Failure Mode and Effects Analysis, is a structured review of how something could fail and what those failures would affect.

In plain words
What is it for?
Use it to create a dated checklist, scan a service for selected anti-patterns, and record pass or fail findings in a .fettle directory.
Why use it?
It turns automated code checks and known risk areas into a documented review before deployment.

Command for Claude CodeGitHub Copilot

Written for Claude Code and GitHub Copilot: argument-hint in frontmatter, but also a Copilot chat mode or prompt.

This is MilindGaharwar/fettle's own configuration. It tells Claude Code and GitHub Copilot how to work on fettle itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything fettle configures →

Part of the fettle plugin — 34 commands, 4 hooks shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to MilindGaharwar/fettle. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/MilindGaharwar/fettle/main/.github/prompts/fettle-preflight.prompt.md
Clone the repo
git clone --depth 1 https://github.com/MilindGaharwar/fettle

Made for: Claude Code, GitHub Copilot.

Or install fettle, the plugin that ships this one along with the rest of its 34 commands, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fettle-preflight

README.md
[![agentmods](https://agentmods.dev/badge/commands/milindgaharwar/fettle/fettle-preflight/github.svg)](https://agentmods.dev/commands/milindgaharwar/fettle/fettle-preflight)
Your own site
<a href="https://agentmods.dev/commands/milindgaharwar/fettle/fettle-preflight"><img src="https://agentmods.dev/badge/commands/milindgaharwar/fettle/fettle-preflight/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fettle-preflight

Your own site · 80×15
<a href="https://agentmods.dev/commands/milindgaharwar/fettle/fettle-preflight"><img src="https://agentmods.dev/badge/commands/milindgaharwar/fettle/fettle-preflight.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 994 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.00994
Opus 5.5 $0.00007 $0.00398
Sonnet 5.5 $0.00004 $0.00199
Haiku 4.5 $0.00002 $0.00099

Measured 1mo ago against content hash a4af5b61f271, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

fettle-preflight scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Search for `AsyncClient` (or `httpx.Client`, `requests.get`, `requests.post`) without `timeout` on the same line or within 5 lines. Flag as [FAIL] if timeout is missing.
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • preflight — 94% identical, 9 lines differ
.github/prompts/fettle-preflight.prompt.md · 83 lines

What it actually says

$ARGUMENTS refers to any text the user typed after the slash command.

Run a pre-deployment FMEA (Failure Mode and Effects Analysis) quality checklist for the target service.

Procedure

  1. Determine service name. Use $ARGUMENTS if provided. If not provided, derive the name from the current working directory basename.

  2. Create output directory. Create .fettle/ in the current working directory if it doesn't already exist:

    mkdir -p .fettle
    
  3. Copy the preflight template. Locate the bundled template and write it to .fettle/preflight-{name}.md, replacing {SERVICE_NAME} with the service name and {DATE} with today's date:

    python3 -c "from fettle._resources import templates_dir; print(templates_dir() / 'preflight.md')"
    

    Read the file at the printed path.

  4. Run automated checks on the codebase. Use Grep and Glob to scan for known anti-patterns and pre-fill the template sections:

    Time Model (Section 1):

    • Search for datetime.now across all Python files. Any hit is a [FAIL] — record file:line.
    • Search for datetime.utcnow as well (deprecated in Python 3.12+). Any hit is a [FAIL].
    • If no hits, mark as [PASS].

    Error Handling (Section 2):

    • Search for except.*:.*pass or bare except: patterns. Any hit is a [FAIL] — record file:line.
    • Search for AsyncClient (or httpx.Client, requests.get, requests.post) without timeout on the same line or within 5 lines. Flag as [FAIL] if timeout is missing.
    • If no hits, mark as [PASS].

    LLM Output Parsing (Section 3):

    • Search for re.search, re.findall, re.match patterns that appear to parse LLM output (look in pipeline/, agents/, or similar directories). Any hit is a [FAIL] — record file:line.
    • If no hits, mark as [PASS].

    Data Persistence (Section 4):

    • Search for .write_text( or .write_bytes( on paths that are NOT in /tmp or using tempfile. Flag as [?] for manual review with file:line.
    • Search for absence of atomic write patterns (no tempfile + rename/replace pattern). Flag as [?].

    External Dependencies (Section 5):

    • Search for HTTP client instantiations without explicit timeout. Flag as [FAIL] with file:line.
    • Mark remaining items as [?] for manual review.

    Resource Lifecycle (Section 6):

    • Search for open( without a with statement context manager. Flag as [?] with file:line.
    • Mark as [?] for manual review.

    Observability (Section 7):

    • Search for logging. or logger. or structlog usage. If found, mark as [PASS]. If absent, mark as [FAIL].
    • Mark remaining items as [?].

    Testing Coverage (Section 8):

    • Count test files matching test_*.py or *_test.py using Glob.
    • Count total test functions (def test_) using Grep.
    • Pre-fill {TEST_COUNT} and {TEST_FILES} in the template.
    • If zero test files, mark as [FAIL]. Otherwise mark as [?] for manual assessment of coverage quality.
  5. Fill the summary table. For each section, set the status based on findings:

    • PASS — all auto-checks passed and no issues found
    • FAIL — at least one auto-detected issue
    • REVIEW — needs manual inspection (items marked [?])
  6. Write the completed checklist to .fettle/preflight-{name}.md.

  7. Present the results to the user. Show:

    • A summary of auto-detected issues (with file:line references)
    • The overall pass/fail count
    • Which sections still need manual review ([?] items)
  8. Ask the user to review and complete any remaining [?] items.

  9. Suggest running the full automated scan:

    fettle check --all
    
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +2 lines · +5 tokens per session a4af5b61f271
  2. 1mo ago First seen · 81 lines · 13 tokens per session scan A 87355d48ae0e

Subscribe to this mod's changes

fettle-preflight is a command published in the GitHub repository MilindGaharwar/fettle (4 stars, last pushed yesterday), licensed Apache-2.0. It adds 18 tokens to every session and 994 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.