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.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 11
- Forks
- 1
01 前言 Front Matter
- name
- observability-rules
- description
- 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.
03 SKILL.md 正文
Observability rules
MUST NOT is a defect. SHOULD NOT needs a stated reason.
- MUST NOT tag a metric with unbounded values (ids, emails, URLs); use a closed set, and apply the personal-data rule below when logging high-cardinality values.
- MUST NOT rename or retype a log field or metric that a monitor or dashboard reads without updating it in the same change.
- MUST NOT assume context bound inside a transaction is cleared when the transaction rolls back.
- MUST NOT create or first use a metrics client before a process forks; create it per process after the fork.
- SHOULD NOT log personal data such as emails, names, postal addresses, or phone numbers in messages, structured fields, bound context, or payloads; omit or redact it, or use a stable pseudonymous identifier when needed for correlation. Pseudonymous identifiers remain linkable. Exceptions for necessary audit or security records need a documented purpose, minimal fields, restricted access, and a defined retention period.
- SHOULD NOT interpolate dynamic values into a log message; keep the message static and put values in structured fields.
- SHOULD NOT alert only on errors for scheduled or queued work; also alert when expected work stops.
- SHOULD NOT load log context by walking relations per line; fetch it with the query.
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.
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.
react-rules
MUST NOT / SHOULD NOT rules for React and Next.js: rendering, server and client boundaries, data fetching, caching, metadata, scripts, routing, and accessibility. Use when writing or reviewing React components or a Next.js app.