infra-rules
MUST NOT / SHOULD NOT rules for infrastructure and ops scripts: OpenTofu or Terraform, IAM, secrets stores, provisioning and cleanup scripts, shell, runtime state, probes, and data ownership. Use when writing or reviewing infrastructure code, machine setup, shell scripts, or code whose correctness depends on how many instances run.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 11
- Forks
- 1
01 前言 Front Matter
- name
- infra-rules
- description
- MUST NOT / SHOULD NOT rules for infrastructure and ops scripts: OpenTofu or Terraform, IAM, secrets stores, provisioning and cleanup scripts, shell, runtime state, probes, and data ownership. Use when writing or reviewing infrastructure code, machine setup, shell scripts, or code whose correctness depends on how many instances run.
03 SKILL.md 正文
Infrastructure and shell rules
MUST NOT is a defect. SHOULD NOT needs a stated reason.
Infrastructure as code
- MUST NOT apply, force-unlock, or mutate live infrastructure without authorization for that environment and a reviewed saved plan.
- MUST NOT post sensitive plan output in PRs or shared notes.
- MUST NOT manage long-lived IAM users in code; use roles and trust policies.
- MUST NOT use IAM wildcard resources without a reason beside the statement.
- MUST NOT rely on generated names that other systems reference; set stable names.
- MUST NOT put browser-visible values in secret stores.
- SHOULD NOT put topology (counts, scaling, resource ids) in application repos.
- SHOULD NOT rely on alerts and runbooks where automatic detection and scoped remediation are possible.
Runtime
- MUST NOT run side-effecting scheduled work from an in-process timer in a service with more than one replica; use a scheduler that runs it once.
- MUST NOT make a liveness probe check a shared dependency; one outage restarts every instance.
- SHOULD NOT keep state that request correctness depends on (sessions, uploads, counters, locks) in process memory or on local disk; the next request may land on another instance.
- SHOULD NOT read or write another service's database, cache, or queue directly; call its API or consume its events.
- SHOULD NOT open a database connection per request; pool, and size the pool against the database limit across all instances.
Scripts and shell
- MUST NOT make destructive scripts act by default; report first, then require
--apply. - MUST NOT write non-idempotent provisioning; detect before acting and support
--dry-run. - MUST NOT hardcode owners, repos, host names, or labels; take parameters.
- MUST NOT persist registration tokens or read credential files; fetch at runtime and use immediately.
- MUST NOT append duplicate rc lines on rerun; guard with
grep -qxF. - MUST NOT ship shell scripts that fail ShellCheck.
- MUST NOT assign shell read-only names such as zsh
status; expand arrays safely underset -u. - SHOULD NOT write shell scripts longer than about 300 lines; split them into steps.
04 同仓库更多 Skills
rollout-rules
MUST NOT / SHOULD NOT rules for shipping changes safely: feature flags, deploy order across services, API and message compatibility, irreversible actions, and string-referenced config. Use when adding a flag, changing an API or message contract, deploying a change that spans services, or touching money-moving or irreversible actions.
observability-rules
MUST NOT / SHOULD NOT rules for logs, metrics, and alerts: static messages and structured fields, personal data, metric cardinality, fields monitors depend on, absence alerts, and context binding. Use when adding or reviewing logging, metrics, or monitors.
integrations-rules
MUST NOT / SHOULD NOT rules for third-party APIs and inbound webhooks: response classification, retries and idempotency, delivery records, payload mapping, timestamps and units, batch failure policy, and signature verification. Use when calling, parsing, or receiving a partner or vendor API.
typescript-rules
MUST NOT / SHOULD NOT rules for TypeScript, JavaScript, and Node.js: async and promises, errors, mutation, aliases and dead paths, static analysis, process lifecycle, HTTP clients, caches like Redis or Valkey, and package boundaries. Use when writing or reviewing TS/JS or Node code.
security-rules
MUST NOT / SHOULD NOT rules for application security and HTTP APIs: secrets, auth and sessions, SSRF, injection, CSRF, CSP, LLM prompts, response exposure, and API shape. Use when writing or reviewing an endpoint, auth code, secret handling, outbound fetches, or LLM calls.
rust-rules
MUST NOT / SHOULD NOT rules for Rust: lints, test layout, file size, parallelism, hot loops, caching, build hygiene, and performance claims. Use when writing or reviewing Rust code or running heavy cargo builds.