Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions promptbook/prompts.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,24 @@
],
"formatNotes": "Paste into Copilot Chat / Claude Code / Codex. Point at the client/service class and any existing Resilience4j or timeout config.",
"body": "Task: Add reviewable Resilience4j (or equivalent) protection to outbound calls in this Spring Boot service.\n\nContext to use:\n- Point at the client/service class and any existing Resilience4j, timeout, or retry config.\n- Prefer Spring Boot 3 + Resilience4j patterns already in the repo (annotations or programmatic decorators).\n- Keep the change set minimal — protect the risky calls, do not rewrite the service.\n\nRequirements:\n1. Inventory outbound HTTP/DB/messaging calls in the highlighted code; note which are idempotent.\n2. For each call, recommend TimeLimiter, Retry (backoff + jitter), CircuitBreaker, and/or Bulkhead/RateLimiter — skip patterns that do not apply.\n3. Add named config in application.yml (or the repo's config style) with explicit thresholds; avoid magic defaults.\n4. Implement fallbacks or typed error mapping; never swallow exceptions. Document fail-fast vs fail-open per dependency.\n5. Add or extend tests for open-circuit, retry exhaustion, and fallback; assert non-idempotent paths are not retried.\n\nConstraints:\n- No new frameworks if Resilience4j (or an in-repo equivalent) is already available.\n- Do not weaken timeouts \"to make tests pass.\"\n- No secrets in config or tests; keep diffs small and reviewable.\n\nOutput:\n1) Inventory table (call → patterns → idempotent?)\n2) Code + YAML changes\n3) Tests for open-circuit / fallback\n4) Verification checklist (boot, breaker force-open, metrics/health)\n5) Residual risks"
},
{
"id": "review-helm-chart-aks",
"title": "Review This Helm Chart for AKS",
"whenToUse": "You have a Helm chart (or PR diff) and want a structured AKS-oriented review before merge.",
"tools": [
"copilot",
"claude-code",
"codex"
],
"tags": [
"azure",
"aks",
"helm",
"review"
],
"formatNotes": "All three. Point the tool at the chart directory or PR files first. Prefer editing templates/values in place.",
"body": "Review the Helm chart at the path I provide for Azure AKS production readiness.\n\nCheck and report on:\n- values.yaml / schema: safe defaults, documented keys, no committed secrets\n- Image pinning (no latest), resource requests/limits, probes\n- securityContext (non-root, capabilities, read-only FS, privilege escalation)\n- ServiceAccount / RBAC least privilege\n- AKS identity and secrets approach (Workload Identity, Key Vault CSI, external secrets vs embedded kube secrets)\n- Ingress/Service exposure and TLS assumptions\n- Rollout safety (strategy, PDB, config checksum restarts)\n- Template correctness (helpers, labels/selectors, required checks)\n\nOutput format:\n1. Severity-ordered findings (blocker / major / minor)\n2. Concrete patches (values or template snippets) for each blocker/major\n3. Validation commands (`helm lint`, `helm template` overlays)\n4. Explicit assumptions if cluster add-ons are not evidenced in-repo\n\nDo not invent operators or ingress controllers that are not present in the repository."
}
]
}
18 changes: 18 additions & 0 deletions skillbook/skills.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,24 @@
],
"formatNotes": "All three. Copilot: `.github/instructions/resilience.instructions.md` with applyTo for `**/*.{java,yml,yaml}` and Spring config. Claude Code: `.claude/skills/spring-resilience4j/SKILL.md`. Codex: section in root `AGENTS.md` or `docs/agents/resilience4j.md` linked from AGENTS.md.",
"body": "# Skill: Spring Boot Resilience4j Guardrails\n\n## Goal\nAdd timeouts, retries, circuit breakers, and bulkheads to Spring Boot 3 services so outbound calls fail predictably and recover safely.\n\n## When to apply\n- HTTP/DB/messaging clients without explicit resilience\n- PRs calling unreliable dependencies with only default timeouts\n- Hardening services that rely on ad-hoc try/catch\n\n## Preferred patterns\n1. **TimeLimiter** — bound every outbound call; prefer fail-fast over hanging threads.\n2. **Retry** — exponential backoff + jitter; only idempotent ops and transient faults (timeouts, 502/503/504), never business 4xx.\n3. **CircuitBreaker** — open on error-rate/slow-call thresholds; choose fail-fast vs fail-open explicitly.\n4. **Bulkhead / RateLimiter** — isolate concurrency so one dependency cannot starve the JVM.\n5. **YAML config** — named instances in `application.yml`; avoid magic defaults in code.\n6. **Metrics & health** — expose breaker state via Actuator/health already in-repo.\n\n## Implementation steps\n1. Inventory outbound calls; mark which are idempotent.\n2. Match existing Resilience4j / Spring Boot starter usage in-repo.\n3. Decorate with named `@TimeLimiter`, `@Retry`, `@CircuitBreaker`, `@Bulkhead` / `@RateLimiter`.\n4. Fallbacks return safe degraded responses or typed errors — never swallow exceptions.\n5. Wire YAML per instance; document fail-fast vs fail-open per dependency.\n6. Tests: open-circuit, retry exhaustion, fallback, no retries on non-idempotent calls.\n\n## Review checklist\n- End-to-end timeouts (client + resilience layer)\n- Retries gated on idempotency + transient errors only\n- CircuitBreaker thresholds and half-open behavior documented\n- Bulkhead/RateLimiter prevents thread-pool exhaustion\n- No silent catch-and-ignore; stable API/problem error mapping\n- Metrics/health visible; config in YAML not hardcoded literals\n\n## Done when\nNamed Resilience4j protection, YAML config, open-circuit/fallback tests, and a fail-fast vs fail-open note per dependency are in place."
},
{
"id": "helm-chart-aks-guardrails",
"title": "Helm Chart Guardrails for AKS",
"whenToUse": "Authoring or reviewing Helm charts and values destined for Azure AKS (templates, values schema, RBAC, secrets wiring).",
"tools": [
"copilot",
"claude-code",
"codex"
],
"tags": [
"azure",
"aks",
"helm",
"kubernetes"
],
"formatNotes": "All three. Copilot: path-scoped `.github/instructions/helm.instructions.md` with applyTo for `**/charts/**`, `**/helm/**`, `**/values*.yaml`. Claude Code: `.claude/skills/helm-aks-guardrails/SKILL.md`. Codex: `deploy/AGENTS.md` or root `AGENTS.md` section titled Helm/AKS.",
"body": "# Skill: Helm Chart Guardrails for AKS\n\n## Goal\nProduce Helm charts that render secure, operable workloads on Azure AKS and are reviewable in PR.\n\n## When to apply\n- New or changed chart templates, helpers, values.yaml, values.schema.json\n- Chart bumps that touch ServiceAccount, RBAC, Ingress, probes, or secrets\n\n## Chart structure rules\n1. Keep templates DRY via `_helpers.tpl`; name resources with the chart fullname helper.\n2. Prefer `values.schema.json` for required keys and safe defaults; document every public value.\n3. Defaults must be production-safe (ClusterIP, non-root, resources set); loosen only in env overlays.\n4. Pin image repository + tag (or digest); never default to `latest`.\n5. Separate chart config from secrets: no raw credentials in values committed to git.\n\n## Security and operability checklist\n1. **Pod/container securityContext**: runAsNonRoot, allowPrivilegeEscalation false, drop ALL capabilities, readOnlyRootFilesystem when feasible, seccomp RuntimeDefault when the platform supports it.\n2. **Resources**: requests and limits on every container; note intentional burstable cases.\n3. **Probes**: readiness + liveness (startup when slow); avoid identical probes that hide failures.\n4. **Identity/secrets on AKS**: prefer Workload Identity + Key Vault CSI / external secrets over long-lived kube secrets in values.\n5. **RBAC**: least-privilege Role/RoleBinding; no ClusterRole unless justified and documented.\n6. **Networking**: configurable Service type (default ClusterIP); NetworkPolicy templates optional but default-deny when the chart ships policies.\n7. **Rollouts**: sensible rollingUpdate; PodDisruptionBudget for user-facing services; checksum annotations for ConfigMap/Secret changes that should restart pods.\n\n## Validation steps\n1. `helm lint` on the chart.\n2. `helm template` for at least two value overlays (e.g. base + prod-like).\n3. Dry-run apply or kubeconform/kubeval if the repo already uses them.\n4. Confirm rendered manifests match in-repo AKS conventions (ingress class, labels, identity annotations).\n\n## Constraints\n- Do not invent cluster operators/CRDs not evidenced in-repo.\n- Do not hardcode subscription, tenant, or Key Vault URIs — parameterize.\n- Keep NOTES.txt accurate and free of secrets.\n\n## Output format\n- Files touched + why\n- Key values additions (names + purpose)\n- Rendered-manifest highlights or patches\n- Commands run / to run\n- Residual risks (RBAC breadth, secret path, ingress exposure)"
}
]
}
Loading