skills/infra-docs/SKILL.md
--- name: infra-docs description: Generate (and refresh) architect-grade living documentation of an app's deployed cloud infrastructure. Discovers the real, live resources (not just what's in config) — Cloudflare Workers + D1 + R2 + Secrets Store + Workers AI + Durable Objects + Zero Trust/Access + cron, or Fly/Vercel equivalents — reads the codebase to map data flows, and writes a multi-document set under docs/infrastructure/ with C4-style architecture diagrams, per-resource detail, mermaid seq
npx skillsauth add RonanCodes/ronan-skills skills/infra-docsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce the documentation a new architect joining the project would want on day one: what cloud resources exist, why each one, how data and auth flow between them, where the security boundaries are, and how to rebuild it from nothing. The point is understanding, not an inventory dump.
Two hard rules:
wrangler.jsonc/fly.toml/vercel.json for intent, then query the provider (wrangler / CF API / flyctl) for what is actually deployed: resource IDs, regions, table counts, sizes, deployment versions, routes, Access apps. Config drifts from reality; the doc must reflect reality and flag drift.wrangler secret / env)./ro:cf-ship, /ro:gh-ship, /ro:fly-deploy), run this to capture the freshly-stood-up infrastructure while it's fresh. This should be a standing step of standing up any new app.<!-- HAND-EDITED --> blocks.ls wrangler.jsonc wrangler.toml fly.toml vercel.json 2>/dev/null
wrangler.*): the main case. Note name, main, compatibility_date, triggers.crons, vars, and every binding block (d1_databases, r2_buckets, kv_namespaces, secrets_store_secrets, durable_objects, ai, queues, services, hyperdrive, vectorize).fly.toml): apps, machines, volumes, Postgres, secrets.vercel.json / project): functions, env, integrations.Cloudflare (use the deploy token from ~/.claude/.env or the project's configured token; export CLOUDFLARE_API_TOKEN=... CLOUDFLARE_ACCOUNT_ID=...):
pnpm exec wrangler deployments list # current version, history
pnpm exec wrangler d1 list # databases
curl .../accounts/$ACC/d1/database/$ID # region, num_tables, file_size
pnpm exec wrangler r2 bucket list # buckets
pnpm exec wrangler secrets-store store list --remote # secret stores (NOT values)
curl .../accounts/$ACC/access/apps # Zero Trust / Access apps + policies
curl .../accounts/$ACC/workers/subdomain # workers.dev hostname
# routes / custom domains, queues, DO classes as applicable
Record IDs, regions, sizes, the deployed version hash, the live hostname(s), and the Access AUD/team domain. Note any binding present in config but missing live (or vice versa) as drift.
Find the real flows, don't invent them:
main): the fetch handler, scheduled handler (cron), middleware (auth/JWT), DO classes.Identify the 4-8 flows worth a sequence diagram (typical: user-auth/login, primary write path, primary read path, any background/cron job, any AI/model call, any file-upload path, any payment/webhook path).
docs/infrastructure/Create these (merge/skip per what the app actually has). Lead each with a one-line "generated by /ro:infra-docs on <date>, reflects live state" note.
README.md — the entry point. A C4-style System Context + Container diagram (mermaid flowchart), a one-paragraph "what this app is", and a resource inventory table (resource | id | region | purpose | limits/tier). Link to the other docs.resources.md — one section per cloud resource. For each: what it is, why it's used (the decision), its live ID/name/region, its config, relevant limits + cost tier, and how to inspect it (the exact wrangler/curl command). This is the "what exists and why" reference.data-flows.md — a mermaid sequence diagram per key flow from step 3, each with a prose walkthrough naming the participants (browser, edge/Access, Worker, D1, R2, AI, DO, cron). This is the "how it works" doc.security.md — the security architecture: the auth gate (edge + in-Worker), identity, the encryption model (what's encrypted vs plaintext and why, key hierarchy, where keys live), secret management, and an honest threat model + boundary (what it protects against, what it explicitly does not). Reuse any boundary statement already in the repo README/ADRs rather than re-deriving.runbook.md — operational: how to deploy, how to provision the whole thing from scratch in a clean account (ordered commands), the token/scope requirements, env vars, how to roll back a deploy, how to rotate secrets, and the smoke test that proves the gate works.Use mermaid for all diagrams (renders on GitHub). Prefer flowchart for topology, sequenceDiagram for flows, erDiagram for the data model if the app owns its schema. Keep diagrams readable: 5-12 nodes, not everything at once.
<!-- HAND-EDITED START --> / <!-- HAND-EDITED END --> verbatim.KV binding with no live namespace").Commit under the repo's convention (emoji + conventional: 📝 docs:). Respect any commit-timestamp rules in the repo/global CLAUDE.md. Do NOT commit secret values (step 0 rule).
This skill is meant to run automatically once an app is live. Recommended wiring:
/ro:cf-ship, /ro:gh-ship, /ro:fly-deploy: after the post-deploy smoke check passes, if docs/infrastructure/ is absent (first deploy) OR the deploy changed bindings, invoke /ro:infra-docs. First deploy → always generate./ro:app-polish: include "infrastructure docs present + current" as a checklist item./ro:cf-ship / /ro:gh-ship / /ro:fly-deploy — the deploy skills that should call this at their tail on first deploy./ro:generate-spec / /ro:compare-codebase-to-spec — spec-level docs (intended behaviour); this skill is the infrastructure-level companion (what's actually deployed)./ro:doc-standards — house style for docs; follow it for prose./ro:security-audit — the security doc here describes the model; that skill scans for leaks.testing
--- name: linear-pipeline description: The Fable orchestrator for a single dispatched Linear ticket. Holds almost no context itself; it receives `--issue <ID> --detached`, decides the stage sequence, and fans out a sub-agent per stage, passing forward only each stage's artifact (never re-derived, never inlined into its own context). Step zero, before any planning or stage routing, is a boundary triage against `canon/security-boundary.md` (#199): a match tags Ronan Connolly and stops the run, no
development
--- name: in-your-face description: Capture a chat-only answer into a durable artifact (markdown + HTML, PDF when cheap) and launch it automatically so the user cannot miss it. Use when user says "in your face", "don't let me lose this", "save that answer", "make that durable", or right after answering a substantive side question (a recipe, comparison, how-to, or generated prompt) that would otherwise die with the context. category: workflow argument-hint: [--no-open] [--vault <short>] [hint of
tools
One-shot headless OpenAI Codex CLI calls for background/admin AI tasks — summaries, classification, extraction, admin glue. The default engine for anything that runs AI constantly in the background (daemon-driven, per-event), because it bills the flat ChatGPT subscription instead of Claude usage or per-token API spend, and it keeps working while Claude is rate-limited. NEVER for coding — coding stays Claude. Use when a skill or daemon needs a cheap always-on AI call, when the user says "use codex", "ask codex", "codex as backup", or when building a background summarizer/classifier into a listener or loop. Reads auth from ~/.codex/auth.json (ChatGPT account, no API key).
research
Turn a warranty rejection, repair quote, or RMA email into a cited decision brief — legal read (NL/EU consumer law), is the part user-serviceable, live part and new-unit prices, repair-vs-DIY-vs-new economics, before-you-send-it checklist, deadlines. Use when the user pastes or screenshots a repair quote, warranty rejection, "not covered" email, onderzoekskosten fee, or asks "should I repair or replace this".