agentleFS
PierreAndreisPierreAndreis/pierre-skills/skills/infrastructure-autopilot/SKILL.md

infrastructure-autopilot

Skill1 starsChanged 3 months agoMITView on GitHub

Operates a repository's infrastructure as a measured, persistent control loop. Use this skill for continuous SRE work: watching production, responding to outages, improving latency and capacity, reducing cost per useful unit, tuning slow SQL and indexes, refining alarms, creating monitoring scripts, auditing autonomous changes, or scheduling a recurring infrastructure agent—even when the user asks indirectly to keep a service healthy or make it cheaper over time.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    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. Distinctive:

    Before the first mutation, ask one compact question for:

    line 14
  2. Distinctive:

    Read Shared contracts whenever defining schemas, severity, prioritization, freshness, or completion.

    line 41
  3. Very specific:

    Run scripts/autopilot_ledger.py start <state-dir>.

    line 45
  4. Distinctive:

    Read the control-loop playbook, then the focused domain selected by the ledger.

    line 46
  5. Distinctive:

    Check active incidents and due validation windows before new optimization work.

    line 47
  6. Distinctive:

    Run the cheap broad scan, then the focused scan.

    line 48
  7. Very specific:

    Prefer adapting these scripts over regenerating their logic.

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Infrastructure Autopilot

Operate a service through evidence, bounded actions, and durable memory. Treat missing or stale evidence as unknown, never healthy.

Useful production operation requires Python 3.11+, repository access, GitHub issue access for the audit trail, and authorized provider telemetry credentials.

Authority gate

Before the first mutation, ask one compact question for:

  1. Git workflow: direct main, auto-merge PR after gates, reviewed PR, or observe-only.
  2. Production policy: named reversible runbooks and environments allowed without approval.
  3. Human owner: GitHub login for assigned decision issues.

Remain observe-only until recorded. Merge authority and production authority are separate. Destructive data work, secrets, permissions, security controls, irreversible deletion, and new paid commitments always need explicit scoped authority.

Behavioral index

Load only the files whose trigger matches the current branch. References are direct from this entrypoint so routing never depends on a second index.

SituationRequired playbook
First run, missing control plane, or changed authorityBootstrap
Every scheduled wake-up, including no-change loopsControl loop
SLO violation, outage, severe degradation, or failed deployIncident response
Latency, throughput, cold start, cache, payload, or CPU workPerformance
Cloud bill, idle resources, storage, egress, logs, or unit economicsCost
Slow query, index, lock, deadlock, pool, replication, or plan workDatabase
Alert creation, tuning, noise, missing coverage, or escalation policyAlerting
Saturation, quota, autoscaling, retention, or exhaustion forecastCapacity
Probe, background script, scheduler, credentials, or runner failureProbes and runtime
Commit, PR, deploy, canary, rollback, or observation windowChange safety
GitHub control issue, loop comment, human decision, or deduplicationGitHub audit
Stale docs, missing context, tunnel vision, or adding a new domainKnowledge index

Read Shared contracts whenever defining schemas, severity, prioritization, freshness, or completion. Use Examples for issue and comment formats.

Every wake-up

  1. Run scripts/autopilot_ledger.py start <state-dir>; an active lease means this run exits without mutation.
  2. Read the control-loop playbook, then the focused domain selected by the ledger. Add incident, change-safety, or audit playbooks when their triggers fire.
  3. Check active incidents and due validation windows before new optimization work.
  4. Run the cheap broad scan, then the focused scan. Corroborate material signals.
  5. Rank opportunities and advance no more than one material optimization at once.
  6. Invoke agent-laboratory: baseline, invariant gates, one hypothesis, repeated measurements, winner or revert.
  7. Record structured evidence, post the GitHub audit entry, and finish or explicitly abort the ledger loop.

Bundled tools

  • scripts/autopilot_ledger.py — lease, rotation, append-only events, and recovery.
  • scripts/probe_runner.py — bounded non-shell probe execution with redaction and JSON output.
  • scripts/slow_query_rank.py — privacy-preserving ranking of PostgreSQL statement statistics.
  • scripts/cost_efficiency.py — cost-per-unit trend and regression analysis.
  • scripts/alarm_quality.py — actionability, duplication, acknowledgement, and resolution evidence.
  • scripts/render_audit.py — render one loop's GitHub-ready audit comment.
  • scripts/validate_skill.py — verify routing links, playbook contracts, and script interfaces.

Prefer adapting these scripts over regenerating their logic. Read each script's --help before use. Generated provider adapters follow the probes-and-runtime playbook.

Hard stops

Stabilize within recorded authority; escalate the blocked decision. A dashboard color, suppressed page, lower bill, or faster microbenchmark is never proof of user recovery. Complete a change only after its observation window closes with correctness, SLO, cost, and rollback evidence recorded.

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.