agentleFS
DshamirDshamir/slm-forge/skills/forge-preflight/SKILL.md

forge-preflight

Skill1 starsChanged 6 months agoMITView on GitHub

Single-shot environment readiness check. Runs FIRST in every forge invocation, before plan generation. Hard-fails with a structured "what to fix" report if any required credential, tool, quota, or service is missing. The whole forge is gated on this passing — there's no point planning a forge if the environment can't execute it.

  • Reads credentials

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All hard-failing — no recoverable.

    line 71

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “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

forge-preflight

When this fires

Phase position: PREFLIGHT (-2) — before ANALYZE and PLAN. The first thing /slm-forge does. If it fails, the operator sees a fix list and the forge never advances.

What it checks

#CheckPass criterion
1Host toolsdocker, jq, curl, git, python3 all on PATH
2AWS forge credsFORGE_AWS_ACCESS_KEY_ID + secret resolve from vault or env; sts get-caller-identity returns user intellident-forge-provisioner
3S3 bucket reachableaws s3 ls s3://<YOUR_S3_BUCKET>/forge/ succeeds
4HF tokenresolves from vault or env; whoami returns namespace; has repo:create scope
5Anthropic API keyresolves from aiProviders collection; messages.create with 5-token max succeeds
6G+VT vCPU quotasufficient headroom for the planned instance type; surfaces stop-instance-id if dental-prod is consuming the quota
7AZ availabilityg5.xlarge offered in at least one AZ in ca-central-1
8Disk headroom≥ 5 GB free in /tmp (for staging) and ≥ 20 GB in working dir (for HF cache)

Output

On PASS:

{
  "status": "pass",
  "next_phase": "ANALYZE",
  "resolved_creds": {
    "aws_user": "intellident-forge-provisioner",
    "hf_namespace": "Nexless",
    "anthropic_key_id": "sk-ant-api03-Av...",  // truncated, never full key
    "s3_bucket": "<YOUR_S3_BUCKET>",
    "s3_prefix": "forge/"
  },
  "available_quota": {
    "g_vt_vcpu_total": 8,
    "g_vt_vcpu_in_use": 0,
    "g_vt_vcpu_available": 8,
    "blocking_instances": []  // or [{"id":"i-04b...", "name":"dental-prod", "type":"g4dn.2xlarge", "vcpus":8}]
  }
}

On FAIL:

{
  "status": "fail",
  "blockers": [
    {"check":"hf_token_scope","detail":"token has no repo:create scope","fix":"regenerate token at https://huggingface.co/settings/tokens with write+create scope"},
    {"check":"g_vt_vcpu_quota","detail":"0 vCPUs available; dental-prod (g4dn.2xlarge=8 vCPU) is consuming the quota","fix":"`aws ec2 stop-instances --instance-ids i-04b483e8b944738d6` OR request quota increase"}
  ]
}

Inputs

  • (none — environmental check; doesn't read manifest)
  • Optional env: FORGE_REGION (default ca-central-1)

Outputs

  • Stdout: status JSON
  • Side effect: caches resolved creds to /tmp/forge-creds.env (mode 600) for reuse by downstream skills

Failure modes

All hard-failing — no recoverable. The forge cannot proceed without:

  • AWS creds (provision will fail)
  • HF token (register will fail)
  • Anthropic key (synth + plan-fit will fail)
  • vCPU quota (provision will fail)

Usage

bash slm-forge/skills/forge-preflight/run.sh
# Prints JSON to stdout. Exit 0 on pass, 1 on fail.

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.

Reviews can't be read right now.

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.