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
21 changes: 21 additions & 0 deletions promptbook/prompts.json
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,27 @@
],
"formatNotes": "All three. Point the tool at the root/module `pom.xml`, enforcer config, suppressions file, and the CI workflow (or Jenkinsfile) that should fail on CVSS policy. Copilot: maven-dependency-cve path instructions plus those files in agent mode. Claude Code: the maven-dependency-cve-hygiene-guardrails skill plus the POM. Codex: AGENTS.md Maven supply-chain section, then the diff.",
"body": "Task: Review and harden Maven dependency CVE hygiene for the reactor or module I specify. Produce a small, reviewable diff: BOM/override fixes, enforcer rules, CI scan gate, and only justified suppressions.\n\nContext placeholders (fill from the repo or ask only if missing):\n- Reactor / module path: {{MODULE_PATH}} (root pom or -pl module)\n- CVE or finding ids: {{CVE_IDS}} (comma-separated, or \"scan-first\")\n- Scanner: {{SCANNER}} (owasp-dependency-check | dependabot-only | org-sca | trivy-fs)\n- Fail threshold: {{FAIL_CVSS}} (e.g. 7.0)\n- BOM in use: {{BOM}} (spring-boot | custom-parent | none | unknown)\n- CI entrypoint: {{CI}} (path to workflow or Jenkinsfile)\n- Suppressions file: {{SUPPRESSIONS}} (path or \"create\")\n- Allowed fix style: {{FIX_STYLE}} (bom-bump | dependencyManagement-override | exclusion-last-resort | mixed)\n\nRequirements:\n\n1. Inventory\n - Parent/BOM imports and `dependencyManagement` order under {{MODULE_PATH}}\n - Existing `maven-enforcer-plugin` rules (convergence, upper-bound, release deps)\n - Current {{SCANNER}} config, plugin/action pins, and fail thresholds\n - {{SUPPRESSIONS}} contents: owners, dates, broad wildcards\n - Dependabot/Renovate Maven entries if present\n - For each id in {{CVE_IDS}} (or after a local scan): `mvn -q -pl … dependency:tree` path to the vulnerable GAV\n\n2. Design\n - Prefer {{FIX_STYLE}} with this order unless blocked: bump {{BOM}} / parent → post-BOM `dependencyManagement` override → exclusion only if unused and documented\n - Ensure overrides appear **after** BOM import so they win\n - Enable or tighten enforcer: `dependencyConvergence`, `requireUpperBoundDeps`, and release-profile `requireReleaseDeps` when missing\n - {{SCANNER}}=owasp-dependency-check: pin plugin version; set `failBuildOnCVSS` to {{FAIL_CVSS}}; wire into {{CI}}; note NVD/data-feed cache or mirror if the repo already has one — do not invent corporate URLs\n - {{SCANNER}}=dependabot-only: ensure Maven ecosystem + PR CI must pass; do not claim transitive CVEs are covered if only manifests are updated\n - Suppressions: add or keep only entries that cite {{CVE_IDS}}, specific GAV, justification, and a review-by date; remove eternal wildcards\n\n3. Author artifacts (prefer concrete diffs)\n - `pom.xml` / parent changes for versions and enforcer\n - {{CI}} job/steps for the scan (fail the PR on policy breach)\n - {{SUPPRESSIONS}} updates when unavoidable\n - Short note in existing AGENTS.md / copilot-instructions / CLAUDE.md only if those files already exist — one line on BOM + scan gate\n\n4. Verification\n - Re-run tree for {{CVE_IDS}} and show fixed version on the path\n - Run the module test command already used in-repo\n - Confirm scanner would fail on a known High finding (or document how to dry-run)\n - Grep for version ranges, `LATEST`, and duplicate managed versions\n\nConstraints:\n- Minimal diff; match existing POM style (properties vs direct versions).\n- Do not invent Nexus/Artifactory URLs, company BOM coordinates, or NVD mirror hosts — use placeholders if absent.\n- Do not disable enforcer or the scan gate to \"get green\".\n- Do not confuse container base-image CVEs with Maven artifact CVEs.\n- Optimize for GitHub Copilot, Claude Code, and Codex — concrete POM/XML and checklist output.\n\nOutput format:\n1. Plan (fix per CVE + gate changes)\n2. Diffs (pom, enforcer, CI, suppressions)\n3. Tree snippets before/after for {{CVE_IDS}}\n4. Verification checklist + residual risk\n\nStart from {{MODULE_PATH}}. Prefer BOM bumps and post-BOM overrides over exclusions.\n"
},
{
"id": "tune-aks-hpa-requests-limits",
"title": "Tune AKS HPA With Requests and Limits",
"whenToUse": "Take an AKS workload and produce evidence-based requests/limits, an HPA (or KEDA) metric and target, sane min/max replicas, and scale-down behavior as a small YAML or Helm diff.",
"tools": [
"copilot",
"claude-code",
"codex"
],
"tags": [
"aks",
"kubernetes",
"hpa",
"autoscaling",
"resources",
"devops",
"azure"
],
"formatNotes": "All three. Point the tool at the Deployment/StatefulSet manifest or Helm chart + values file, the HPA or KEDA ScaledObject, and the namespace's ResourceQuota/LimitRange. Copilot: aks-hpa-requests-limits path instructions plus those files in agent mode. Claude Code: the aks-hpa-requests-limits-guardrails skill plus the manifests. Codex: AGENTS.md autoscaling section, then the diff.",
"body": "Task: Review and tune resource requests/limits and HorizontalPodAutoscaler settings for the AKS workload I specify. Produce a small, reviewable YAML or Helm values diff with the reasoning behind every number.\n\nContext placeholders (fill from the repo or ask only if missing):\n- Workload: {{WORKLOAD}} (Deployment/StatefulSet name)\n- Namespace: {{NAMESPACE}}\n- Manifest path: {{MANIFEST_PATH}} (raw YAML, kustomize overlay, or Helm chart + values file)\n- Scaling metric: {{METRIC}} (cpu | memory | custom | keda)\n- Target: {{TARGET}} (e.g. 70% CPU, 200 RPS per pod, 50 messages per replica)\n- Min replicas: {{MIN_REPLICAS}}\n- Max replicas: {{MAX_REPLICAS}}\n- Cluster Autoscaler on node pool: {{HAS_CLUSTER_AUTOSCALER}} (yes + min/max nodes | no | unknown)\n- Evidence available: {{EVIDENCE}} (load test | VPA recommendation | p95 from Container Insights/Prometheus | none)\n\nRequirements:\n\n1. Inventory\n - Every container in {{WORKLOAD}} (app, sidecars, init): current requests, limits, and resulting QoS class\n - Existing HPA / KEDA ScaledObject for {{WORKLOAD}}: metric, target, min/max, `behavior`\n - PodDisruptionBudget, LimitRange, and ResourceQuota in {{NAMESPACE}}\n - Any VPA object targeting {{WORKLOAD}} and its `updateMode`\n - Whether metrics-server (resource metrics) or the custom/external metrics adapter needed for {{METRIC}} is present\n\n2. Design\n - Add missing requests first; HPA utilization is a percentage of requests\n - Propose requests/limits from {{EVIDENCE}}; if none, give conservative starting values and say they must be validated\n - State the chosen QoS class (Burstable by default; Guaranteed only with a latency/noisy-neighbor reason)\n - {{METRIC}}=cpu: start {{TARGET}} in the 60–80% band unless evidence says otherwise\n - {{METRIC}}=custom or keda: name the metric/scaler and confirm only one autoscaler owns the Deployment\n - Check `{{MAX_REPLICAS}} × per-pod requests` against ResourceQuota and node pool capacity; with {{HAS_CLUSTER_AUTOSCALER}}=yes, check against max nodes and note scale-up lag\n - Prod: `{{MIN_REPLICAS}} >= 2` and consistent with the PDB\n - Add `behavior.scaleDown` stabilization and policies to stop flapping\n - Flag VPA in update mode on the same metrics as a conflict; recommend `updateMode: \"Off\"`\n\n3. Author artifacts\n - Minimal diff to {{MANIFEST_PATH}} (values file for Helm; keep template defaults safe)\n - Inline comments recording where each number came from\n - Do not change Cluster Autoscaler, node pool, or quota settings unless I ask — list recommended changes separately\n\n4. Verification\n - `kubectl apply --dry-run=server -f …` (or `helm template … | kubectl apply --dry-run=server -f -`)\n - `kubectl -n {{NAMESPACE}} describe hpa {{WORKLOAD}}` shows real targets, not `<unknown>`\n - `kubectl -n {{NAMESPACE}} top pods -l app={{WORKLOAD}}` during a ramp\n - `kubectl -n {{NAMESPACE}} describe quota` and pending-pod events after scale-up\n\nConstraints:\n- Match existing manifest/Helm style; no unrelated refactors.\n- Do not invent metric names, cluster sizes, or quota values — use placeholders if unknown.\n- Do not rewrite probes; reference the probes skill if they block readiness.\n- Optimize for GitHub Copilot, Claude Code, and Codex — concrete YAML and a checklist.\n\nOutput format:\n1. Summary table: container | old req/lim | new req/lim | QoS | rationale; plus HPA old vs new (metric, target, min, max, behavior)\n2. Patch (YAML or values diff)\n3. Risks: VPA/KEDA conflicts, missing metrics pipeline, quota or Cluster Autoscaler limits\n4. Verification commands and expected output\n\nStart from {{MANIFEST_PATH}}. Add missing requests before touching HPA targets.\n"
}
]
}
Loading
Loading