start
Entry point for infrastructure work on AWS, Azure or GCP across local, test, staging and production: fixes the environment and cloud, then routes to design, implement or review.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 13
- Forks
- 1
01 前言 Front Matter
- model
- sonnet
- description
- Entry point for infrastructure work on AWS, Azure or GCP across local, test, staging and production: fixes the environment and cloud, then routes to design, implement or review.
- allowed-tools
- [ "Bash(${CLAUDE_PLUGIN_ROOT}/tools/update-okf-bundle.sh *)", "Bash(\"${CLAUDE_PLUGIN_ROOT}/tools/update-okf-bundle.sh\" *)" ]
- argument-hint
- [target] [--env=<env>] [--cloud=<cloud>]
03 SKILL.md 正文
Infrastructure Triage and Routing
Shared files: a path written @rules/…, @skills/…, @templates/… or @docs/… is relative to the
plugin root, ${CLAUDE_PLUGIN_ROOT} — not to the project being worked on. Read it from there.
Usage: /infra:start [target] [--env=<env>] [--cloud=<cloud>]
Ground every infrastructure decision in the OKF okf-k8s-tf bundle
(@rules/okf-k8s-tf-bundle.md) rather than in model memory, and hand the real work to the skill
that is sized for it.
Desired Outcome
Four things are settled and passed downstream, so the mode skill never re-asks them:
- The resolved bundle root
$OKF, and its freshness list: the documents paststale_afterand those awaiting re-verification, each with its reason - The target environment(s) —
local/test/staging/production - The target cloud(s) — AWS / Azure / GCP, and which environments exist in each
- The mode — design, implement or review — and the target path
Decision Criteria
| The user wants | Mode | Route to |
|---|---|---|
| A configuration decided from requirements; technology selection; an approach | design | /infra:design |
| Terraform / manifests / values / CI written or fixed | implement | /infra:implement |
| Existing code or a design document assessed, with findings | review | /infra:review |
Ambiguous? Ask one question with AskUserQuestion. A compound request ("design it and then build it") splits into design → user confirmation → implement; never proceed to implementation without agreement on the design.
Route by invoking the mode skill with the Skill tool, passing the four settled facts as arguments. This skill does triage only — design and review carry a higher reasoning tier (see Model Policy).
The exception is a single factual lookup ("what does the bundle say about Vault HA?") or a request whose whole point is the triage itself. Answer those here.
Prerequisites
| Input | Required/Recommended | Source |
|---|---|---|
knowledge/okf-k8s-tf/ (the bundle) |
Required | Vendored; tools/update-okf-bundle.sh status --bundle=k8s-tf |
| The target repository or design document | Recommended | The user |
| reports/03_design/target-architecture.md | Recommended | /architect:design-microservices |
| reports/08_infrastructure/infrastructure-design.md | Recommended | /architect:design-infrastructure |
Step 1 — Resolve the bundle
Run ${CLAUDE_PLUGIN_ROOT}/tools/update-okf-bundle.sh status --bundle=k8s-tf and take the
resolved path as $OKF. The resolution order, where its upstream comes from, and what to do when
it cannot be found are all in @rules/okf-k8s-tf-bundle.md §1.
If the bundle cannot be resolved, do not answer from memory. It is the primary source for this skill, not a convenience.
Step 2 — Check freshness
The same status output ends with the freshness list, in two parts:
past stale_after— computed for today from each document's frontmatter.awaiting re-verification— the list the weekly upstream refresh recorded, with the reasons: a cited page changed, redirected to a different page or stopped answering, a stated version fell further behind or reached end of life. It is dated (as of); a list older than the latest Monday means the refresh has not run since.
Carry both parts forward unchanged as the freshness list. A listed document is still citable,
as dated evidence: every claim resting on it says it awaits re-verification and why, and when the
claim matters, check the locally held page (knowledge/okf-k8s-tf-upstream/pages/) or the
official source (@rules/okf-k8s-tf-bundle.md §1, §6). Revising the document is not this skill's
job — tell the user /architect:revise-knowledge does it.
Step 3 — Fix the environment
Infrastructure has four environments and no output is produced before the environment is
settled. Use --env=<env>; when absent, ask with AskUserQuestion. When several are in scope,
the deliverable gets one section per environment.
Coverage differs sharply per environment, and the difference is not cosmetic:
| Environment | Bundle | Posture in the output |
|---|---|---|
local |
Absent | Say "outside the bundle's scope". Do not assert |
test |
Observed implementation (a procedure or CI kubectl apply, direct apply) |
Citable as fact |
staging |
Observed implementation (Argo CD app-of-apps, GitOps) | Citable as fact |
production |
No observed implementation — guidance only | Say the investigated repositories contain no production implementation, and present production as staging plus approval/protection/sync windows |
Full matrix and promotion path: @rules/infra/environments.md.
Step 4 — Fix the cloud
Multi-cloud is the default premise; never answer as if one cloud were assumed. Use
--cloud=<cloud>; when absent, ask. Settle the four items in @rules/infra/multi-cloud.md §0 and
fill the cloud × environment grid before routing — an empty cell means "not deployed here", and
must not be left implicit.
Step 5 — Route
Pick the mode from Decision Criteria and invoke the corresponding skill, passing environment,
cloud, target path, $OKF and the freshness list.
Non-Negotiable Rules
These bind the mode skills too.
- Cite the bundle for anything it covers. Never write from memory. Attach
[foundation/terraform.md]-style sources to each claim (@rules/okf-k8s-tf-bundle.md §7). A claim resting on a document on the freshness list says the document awaits re-verification, and why. - Say "outside the bundle's scope" when it is. Then WebFetch official documentation, or leave it as an open question. Do not assert.
- Keep fact, guidance and open question separate. The bundle itself distinguishes observed implementation / design guidance / open question; the output preserves the same three tiers (@rules/okf-k8s-tf-bundle.md §4).
- Multi-cloud is the default. Pass every conclusion through the portability boundary in @rules/infra/multi-cloud.md before writing it.
- There are four environments. Differences stay in overlay and values as value
differences; base, chart and image digest stay identical everywhere. Never write
if env == "production"into a base (@rules/infra/environments.md §2). - One resource, one owner. A resource managed by two or more of Terraform / Argo CD / CI / manual is the highest-priority finding there is — in a design, in an implementation, or as something a review missed [architecture/platform-architecture.md].
- Pin versions. Terraform, providers, charts, images and CI templates never reference a
moving target (
main,latest, a floating tag). Resolve the version rather than recalling it (@rules/dependency-versions.md). - No secrets in deliverables. Never propose putting plaintext secrets in tfvars, values, a plan artifact, CI logs or Git.
- Write deliverables in the project's
options.output_language; code identifiers stay English.
Output Location
The user's choice wins. Otherwise resolve $OUT in this order:
- A location the user named
reports/08_infrastructure/— whenwork/pipeline-progress.jsonexists (pipeline context)docs/infra/at the target repository root (git rev-parse --show-toplevel), or in the working directory when there is no repository context
| Deliverable | Path | File name |
|---|---|---|
| Design document | $OUT/ |
infra-design-<system>.md |
| Environment matrix | $OUT/ |
env-matrix-<system>.md |
| ADR | $OUT/adr/ |
adr-<NNN>-<slug>.md |
| Review report | $OUT/reviews/ |
review-<target>-r<round>.md |
- Review rounds are numbered from the existing files; round 2 and later open with a reconciliation against the previous round (resolved / still open / new).
- Anything written under
reports/must carry YAML frontmatter and valid Mermaid — the repository's hooks enforce both (@rules/output-conventions.md). - Never write deliverables into
${CLAUDE_PLUGIN_ROOT}. The plugin is replaced on update and the deliverable would be lost.
Model Policy
| Skill | Model | Why |
|---|---|---|
/infra:start |
sonnet | Triage: resolution, freshness, environment/mode. The heavy work is delegated |
/infra:design |
opus | Design judgement, trade-offs, ADRs. A wrong structural call propagates to everything downstream |
/infra:implement |
sonnet | The conventions are written down and verification commands back them. Highest output volume, so the largest cost saving |
/infra:review |
opus | Multi-step reasoning and finding what is absent. A missed finding stays as risk |
The criterion is "how hard the error is to undo" times "how many tokens it generates". When
implementation hits genuinely hard ground — a complex migration, state surgery, a CRD upgrade —
do not push through on sonnet; suggest the user switch with /model opus.
Related Skills
| Skill | Relationship |
|---|---|
| /infra:design, /infra:implement, /infra:review | The three modes this skill routes to |
| /architect:design-infrastructure | Upstream — the logical infrastructure design this refines into a concrete multi-cloud configuration |
| /architect:generate-infra-code | Sibling — emits IaC into generated/ as a pipeline codegen step; /infra:implement writes into a real infrastructure repository |
| /architect:design-security, /architect:design-observability, /architect:design-disaster-recovery | Upstream — policy (authorization model, SLI/SLO, RTO/RPO); this plugin decides the implementation means |
| /scalardb:* | ScalarDB schema and transaction design. This plugin treats ScalarDB only as something that runs on Kubernetes |
| /architect:update-knowledge | Reports the bundle's state (--bundle=k8s-tf) |
04 同仓库更多 Skills
doctor
Check the install and a project: plugins at the repository's version, hooks and skills in place, the two knowledge bundles present and fresh, the project's registry, question store, audit log, learned rules and claims readable. Run it first when a command misbehaves.
verify-sql-migration
Prove a SQL migration on data: golden checks against an authorized source database and differential tests against ScalarDB. Never touches production.
verify-implementation
Check code against the design (API contract, transactions, security, requirements, the example chain) and report every divergence; optionally runs the eight-stage quality gate.
update-knowledge
Fetch or update an OKF knowledge bundle: ScalarDB/ScalarDL, or the vendored Kubernetes/Terraform bundle.
start
Interactive entry point for system architecture work: refactor a legacy application into services, or design a new system from requirements; picks the path from the project's state. To move a database to ScalarDB, use migrate-database.
select-scalardb-edition
Choose the ScalarDB edition (Community, Enterprise Standard or Premium, plus Enterprise Options), deployment mode and cluster topology through a short interview.