agentleFS
mazze93mazze93/claude-code-skills/skills/preflight/SKILL.md

preflight

Skill1 starsChanged 11 days agoMITView on GitHub

Probe session environment readiness for committing, signing, or deploying — TTY, GPG/pinentry, ssh-agent, git remote↔auth match, and MCP connectivity. Reports an applied fix or an exact paste-into-your-own-terminal command for every failure. Use at the start of any session that will commit, sign, tag, push, or deploy, or when a commit/push fails for environment reasons.

  • Reads credentials

47 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use adr, report and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • asterkinSkill

    adr

    Create Architecture Decision Records (ADRs) following project standards. Guides template usage, process, and best practices for documenting architecturally significant decisions.

    Also in 3 projects that use this

  • MicrosoftSkill

    report

    Turn an exploration (threads, findings, charts) into a single Markdown report — note, blog post, executive summary, KPI dashboard, slide brief, or multi-section analytical report, with embedded charts.

    Also in 3 projects that use this

  • Google CloudSkill

    triage

    Gather context on a change or bug and plan the implementation.

    Also in 4 projects that use this

  • AnthropicSkill

    status

    Case status summary by audience — client-facing (plain language), internal (for the professor), or court-ready (formal caption format per local rules). Same facts, different framing and depth. Use when a student needs to update the client, brief the professor, or prepare a court status report.

    Also in 3 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 3 projects that use this

  • DockerSkill

    review-pr

    Review one or more incoming Docker documentation pull requests as a maintainer. Independently validate technical claims, assess editorial fit and information architecture, choose a verdict, and draft exact inline or PR-wide feedback behind a confirmation gate. Use for requests such as "review PR 123", "is this PR correct?", "does this information belong here?", "validate this PR", or "help review backlog PRs". Do not use to maintain or fix a PR you own; use maintain-pr for that.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 42 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run bash "$(dirname "$0")/preflight.sh" — in practice:

    line 13
  2. Very specific:

    Never conclude a key is absent from one failed command: Check ~/.ssh *and* the agent, and distinguish "no agent" from "agent with no keys" …

    line 34
  3. Distinctive:

    Never downgrade auth to route around a lock: If the remote is SSH and the key is merely locked, fix the agent.

    line 37
  4. Distinctive:

    Never emit a vague instruction ("make sure your agent is running").

    line 90

“Common” is measured: kept by at least 6 in 10 of the 42 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

/preflight

Environment failures are the most expensive kind, because they surface after the work is done — at the commit, at the push, at the deploy — when there is finished work sitting in a dirty tree and a session limit approaching. This skill front-loads them into the first thirty seconds.

Run bash "$(dirname "$0")/preflight.sh" — in practice:

bash /Users/Shared/claude-code-skills/skills/preflight/preflight.sh

Exit code 0 means safe to proceed; 1 means at least one item needs the human. Pass --fix to opt into the (few) persistent fixes; without it only idempotent runtime fixes are applied.

Hard rules — these are not style preferences

  1. Never ask the user to type a passphrase, token, or private key into the conversation. If a step needs a secret, print the exact command and stop. A passphrase pasted into a transcript is a compromised passphrase and must be rotated. This has actually happened; that is why this skill exists.
  2. Never echo credential material. Fingerprints, key IDs, and public keys are fine — they are public by construction. Private key contents, tokens, and passphrases are not. All probe output passes through redact().
  3. Never read a private key file to determine whether it exists. Use the directory listing and the agent.
  4. Never conclude a key is absent from one failed command. Check ~/.ssh and the agent, and distinguish "no agent" from "agent with no keys" from "key present but locked" — three different problems with three different fixes.
  5. Never downgrade auth to route around a lock. If the remote is SSH and the key is merely locked, fix the agent. Switching the remote to HTTPS to dodge an unlock trades thirty seconds for a credential you now have to manage.

What it probes, and why each one earns its place

ProbeQuestion it answers
Controlling TTYCan anything prompt in this shell at all?
pinentry kindDoes the missing TTY actually matter here?
GPG_TTYOnly load-bearing for terminal pinentry
gpg-agent socketIs the agent up? (auto-launched — idempotent)
signing key in keyringDoes user.signingkey resolve to a real secret key?
passphrase cachedCan we sign right now without a human?
~/.ssh contentsWhich keys exist, by fingerprint
key file modeIs a private key group/world-readable? (ssh hard-refuses these, and the error masquerades as an auth failure)
ssh-agent stateAgent absent / empty / loaded — three distinct states
ssh -T git@github.comDoes GitHub actually accept us?
remote protocol ↔ authDoes the remote's protocol match the auth we have?
claude mcp listWhich MCP servers are actually connected?

On loopback pinentry — deliberately not enabled

The obvious-looking fix for "no TTY for pinentry" is --pinentry-mode loopback. It is the wrong fix for an agent shell, and this skill will not use it for signing.

Loopback means gpg stops asking its own pinentry and instead takes the passphrase from the calling process. In a terminal that is fine. Here, the calling process is the agent — so the passphrase would have to be supplied by Claude, which means it would have to appear in the transcript. That is precisely the failure mode rule 1 exists to prevent.

The correct arrangement on macOS is a GUI pinentry (pinentry-mac), which needs no controlling TTY because it draws its own window, plus a generous default-cache-ttl so one unlock covers a working session. If allow-loopback-pinentry is already present in gpg-agent.conf the skill reports it and leaves it alone — it is legitimately needed by some CI tooling — but it is never the mechanism used to sign from here.

The one non-interactive use of pinentry-mode that is safe is --pinentry-mode error, used by the cache probe: it makes gpg fail instantly instead of prompting, which is how the skill asks "is this key unlocked?" without risking a hang or a dialog.

Reporting

For each failure emit exactly one of:

  • auto-fixed — what was done, and that it was idempotent.
  • an exact single command — copy-pasteable, for the user's own terminal, with any placeholder in obvious <ANGLE_BRACKETS>.

Never emit a vague instruction ("make sure your agent is running"). Never emit a multi-step narrative where one command would do. If a fix's applicability depends on OS or tool version, verify against --help or the man page on this machine rather than recalling it — deprecated advice (spctl --add) has burned this workspace before.

End with the one-line verdict: ready, or N items needing the human.

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.