fold: Skill for Claude Code

.claude/skills/preflight/SKILL.md

preflight is a skill for Claude Code from fold-run/fold. It costs 70 tokens per session (912 once invoked), scanned A, original, Apache-2.0.

A local readiness check for a code change, running formatting, dependency, build, race, lint, and relevant specialized checks. A race check looks for unsafe simultaneous access by concurrent code.

In plain words
What is it for?
Use it before declaring work finished, committing, opening a pull request, or deciding whether a change is ready to merge.
Why use it?
It finds common problems before a commit or pull request and chooses extra checks based on the files changed. It also explains likely causes when a check fails.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event.

This is fold-run/fold's own configuration. It tells Claude Code how to work on fold 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 fold configures →

Reuse

Borrowing it

Nothing to install: this file belongs to fold-run/fold. 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/fold-run/fold/main/.claude/skills/preflight/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/fold-run/fold

Made for: Claude Code.

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 preflight

README.md
[![agentmods](https://agentmods.dev/badge/skills/fold-run/fold/preflight/github.svg)](https://agentmods.dev/skills/fold-run/fold/preflight)
Your own site
<a href="https://agentmods.dev/skills/fold-run/fold/preflight"><img src="https://agentmods.dev/badge/skills/fold-run/fold/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 preflight

Your own site · 80×15
<a href="https://agentmods.dev/skills/fold-run/fold/preflight"><img src="https://agentmods.dev/badge/skills/fold-run/fold/preflight.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 912 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00070 $0.00912
Opus 5.5 $0.00028 $0.00365
Sonnet 5.5 $0.00014 $0.00182
Haiku 4.5 $0.00007 $0.00091

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

Security

Grade A, and why

preflight scanned grade A with 0 findings 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 2mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/preflight/SKILL.md · 70 lines

How it starts

The opening of the file, as written. The whole thing — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.

fold preflight

CI runs eight jobs: test (gofmt, go mod tidy -diff, vet, build, go test -race + coverage), lint, vuln, bench, helm, conformance, console, and image. make check covers test and lint; everything else is conditional below. This skill runs the local equivalent, cheapest-first, and stops early on failure.

Always

make check        # fmt-check + tidy-check + vet + build + race + lint

Run failures to ground before moving on:

  • fmt-check → make fmt, re-run.
  • tidy-check → go mod tidy, then review the go.mod/go.sum diff — an unexpected dependency change is a finding, not a fix.
  • race failures → these are real bugs in a gateway; never "fix" by removing -race or adding sleeps. Suspect snapshot access outside the atomic load, session-map access outside its lock, or test fixtures sharing state.
  • lint → config is .golangci.yml; fix the code, don't add nolint without saying so.

Conditional gates — run when the diff touches them

  • Proxy path (gateway/router.go, upstream.go, endpoints.go, middleware, egress rewriting) → make bench. Gate: added p50 < 5 ms through the proxy path. A regression means a hot-path allocation or synchronous work that belongs at snapshot-build time.
  • Behavior through the gateway (anything a client could observe) → make conformance. Needs node/npx; expects 40/40. A failed check usually means the gateway stopped being invisible — compare against hitting the upstream directly before touching the pinned commit.
  • deploy/helm/ → make helm-check. Lint, render against every ci/*.yaml, and the required-config guard.
  • go.mod / go.sum / a Go toolchain bump → make vuln. This is its own CI job, not part of make check, so it is easy to skip and easy to be surprised by. A red govulncheck is often the live advisory database rather than the diff — check the Go patch version in go.mod against the advisory before hunting for a bug in the change.
  • gateway/console/, scripts/sync-console.sh, or a CONSOLE_COMMIT bump → make console-check (needs network). Proves the vendored bytes are exactly the pinned fold-console commit. A hand edit under gateway/console/ cannot merge at all — the PreToolUse guard blocks it, and CI's console job would fail it. See /console-sync.
  • deploy/docker/*.Dockerfile, go.mod's Go version, or anything the images build from → build the images locally:
    docker build -f deploy/docker/fold.Dockerfile --build-arg VERSION=ci .
    
    CI's image job covers this per-PR now, but it exists because a builder base pinned below the version go.mod requires sat on main through two green merges and failed after the tag was pushed — with the binaries and chart already published.
  • Untrusted-input parsers (config parse, cursors, discovery docs) → make fuzz for a deeper pass; seed corpora already run in make test.

Read the full file on GitHub · 70 lines

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. 2mo ago First seen · 70 lines · 70 tokens per session scan A 3705438d56fa

Subscribe to this mod's changes

preflight is a skill published in the GitHub repository fold-run/fold (1 stars, last pushed 12d ago), licensed Apache-2.0. It adds 70 tokens to every session and 912 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

preflight compared with skills from other repositories

preflight next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
preflightfold-run/foldSkill112d agoApache-2.0A70Claude Code
vhs-e2e-gifdimetron/pi-goSkill2223d agoMITA106Claude Code, Codex
check-linters-before-commitdimetron/pi-goSkill2223d agoMITA30Claude Code, Codex
gh-labelsUnique-Divine/jiyuuSkill6yesterdayMITA98Claude Code, Codex
gh-prUnique-Divine/jiyuuSkill6yesterdayMITA63Claude Code, Codex
gh-revUnique-Divine/jiyuuSkill6yesterdayMITA89Claude Code, Codex
gh-ci-watchUnique-Divine/jiyuuSkill6yesterdayMITA74Claude Code, Codex