From 6b395479ff051d8012b81975080e9f72f1212c0f Mon Sep 17 00:00:00 2001 From: Ramkumar Ethiraj <64294490+rmkr-dev@users.noreply.github.com> Date: Tue, 8 Sep 2026 05:15:55 +0000 Subject: [PATCH] Add observability and secure-review Skillbook entries --- promptbook/prompts.json | 41 ++++++++++++++++++++++++++++++--- skillbook/skills.json | 51 ++++++++++++++++++++++++++++++++++------- 2 files changed, 81 insertions(+), 11 deletions(-) diff --git a/promptbook/prompts.json b/promptbook/prompts.json index 349124e..0038d20 100644 --- a/promptbook/prompts.json +++ b/promptbook/prompts.json @@ -21,7 +21,7 @@ "spring-boot" ], "formatNotes": "Paste into Copilot Chat / Claude Code / Codex as a single task prompt. Attach or @-mention the target package.", - "body": "Task: Add a Spring Boot REST endpoint following this repository's packaging and security style.\n\nContext to use:\n- Match existing controller/service/repository layers and naming.\n- Use DTOs + Bean Validation; do not expose JPA entities.\n- Respect existing auth annotations / security config.\n\nRequirements:\n1. Create (or extend) a controller method with clear route, status codes, and error mapping.\n2. Implement service logic with constructor injection.\n3. Add unit tests for the service and a web slice test for the happy path + one validation failure.\n4. Keep the change set minimal \u2014 no unrelated refactors.\n\nConstraints:\n- No new dependencies unless already used nearby.\n- No secrets in code or tests.\n- Do not weaken security configuration.\n\nOutput:\n1) Brief plan\n2) Code changes\n3) Tests\n4) Commands to run\n5) Residual risks" + "body": "Task: Add a Spring Boot REST endpoint following this repository's packaging and security style.\n\nContext to use:\n- Match existing controller/service/repository layers and naming.\n- Use DTOs + Bean Validation; do not expose JPA entities.\n- Respect existing auth annotations / security config.\n\nRequirements:\n1. Create (or extend) a controller method with clear route, status codes, and error mapping.\n2. Implement service logic with constructor injection.\n3. Add unit tests for the service and a web slice test for the happy path + one validation failure.\n4. Keep the change set minimal — no unrelated refactors.\n\nConstraints:\n- No new dependencies unless already used nearby.\n- No secrets in code or tests.\n- Do not weaken security configuration.\n\nOutput:\n1) Brief plan\n2) Code changes\n3) Tests\n4) Commands to run\n5) Residual risks" }, { "id": "aks-manifest-review-prompt", @@ -71,7 +71,7 @@ "threat-model" ], "formatNotes": "All three. Paste alongside the auth filter/middleware files.", - "body": "Produce a lightweight threat model for our JWT/OAuth resource-server handling.\n\nCover:\n- Token forgery / alg confusion\n- Issuer and audience mix-ups\n- Stale/revoked tokens (what we can and cannot detect)\n- Privilege escalation via over-broad scopes/roles\n- Token leakage through logs, URLs, or browser storage\n- Confused deputy risks between services\n\nFor each threat:\n- Likelihood \u00d7 impact (L/M/H)\n- Existing mitigations visible in code/config\n- Recommended control\n- Test idea that would catch a regression\n\nFinish with a minimal validation checklist suitable for a PR description.\nDo not invent IdP URLs or client secrets \u2014 use placeholders if needed." + "body": "Produce a lightweight threat model for our JWT/OAuth resource-server handling.\n\nCover:\n- Token forgery / alg confusion\n- Issuer and audience mix-ups\n- Stale/revoked tokens (what we can and cannot detect)\n- Privilege escalation via over-broad scopes/roles\n- Token leakage through logs, URLs, or browser storage\n- Confused deputy risks between services\n\nFor each threat:\n- Likelihood × impact (L/M/H)\n- Existing mitigations visible in code/config\n- Recommended control\n- Test idea that would catch a regression\n\nFinish with a minimal validation checklist suitable for a PR description.\nDo not invent IdP URLs or client secrets — use placeholders if needed." }, { "id": "pipeline-design-critique", @@ -105,7 +105,42 @@ "rubric" ], "formatNotes": "Run once per tool with a fresh context. Store scores in your eval sheet. Copilot Chat, Claude Code session, and Codex task should receive the identical task card below.", - "body": "You are being evaluated on a fixed coding task. Follow the agent loop exactly.\n\nTask card:\n- Goal: {{GOAL}}\n- In-scope paths: {{PATHS}}\n- Constraints: {{CONSTRAINTS}}\n- Definition of Done: {{DOD}}\n- Verification commands: {{COMMANDS}}\n\nRequired loop:\n1. Restate goal/constraints in \u22645 lines.\n2. Inspect only in-scope paths.\n3. Implement the smallest change that meets DoD.\n4. Run verification commands; fix failures.\n5. Final report with files changed, commands + results, residual risks.\n\nScoring rubric (0\u20132 each; be honest in a self-check section):\n- Correctness vs DoD\n- Safety (no secrets/PII leakage; no reckless permissions)\n- Diff discipline (minimal, coherent)\n- Tests/docs updated appropriately\n- Evidence quality (commands + outcomes)\n\nEnd with:\nSELF-SCORE: correctness=? safety=? diff=? tests=? evidence=?\nNOTES: one paragraph on what blocked a higher score." + "body": "You are being evaluated on a fixed coding task. Follow the agent loop exactly.\n\nTask card:\n- Goal: {{GOAL}}\n- In-scope paths: {{PATHS}}\n- Constraints: {{CONSTRAINTS}}\n- Definition of Done: {{DOD}}\n- Verification commands: {{COMMANDS}}\n\nRequired loop:\n1. Restate goal/constraints in ≤5 lines.\n2. Inspect only in-scope paths.\n3. Implement the smallest change that meets DoD.\n4. Run verification commands; fix failures.\n5. Final report with files changed, commands + results, residual risks.\n\nScoring rubric (0–2 each; be honest in a self-check section):\n- Correctness vs DoD\n- Safety (no secrets/PII leakage; no reckless permissions)\n- Diff discipline (minimal, coherent)\n- Tests/docs updated appropriately\n- Evidence quality (commands + outcomes)\n\nEnd with:\nSELF-SCORE: correctness=? safety=? diff=? tests=? evidence=?\nNOTES: one paragraph on what blocked a higher score." + }, + { + "id": "author-portable-agent-skill", + "title": "Author a Portable Agent Skill", + "whenToUse": "You have a repeated procedure and want a SKILL.md that works for Copilot Agent Skills, Claude Code, and stays linkable from Codex AGENTS.md.", + "tools": [ + "copilot", + "claude-code", + "codex" + ], + "tags": [ + "agents", + "skills", + "developer-workflow" + ], + "formatNotes": "Paste into Copilot Chat, Claude Code, or Codex. Ask the tool to write files at the paths you name.", + "body": "Author a portable agent skill for procedure \"{{PROCEDURE_NAME}}\".\n\nDeliverables:\n1) Create a kebab-case skill folder and `SKILL.md` with YAML frontmatter:\n - `name`: short kebab-case id\n - `description`: what the skill does + when to use it; keyword-rich (include {{TRIGGER_KEYWORDS}}); under 1024 characters\n2) Concise body under ~500 lines with sections: Goal, Steps, Constraints, Examples.\n Steps outline to expand: {{STEPS_OUTLINE}}\n3) Placement notes (write the files, or show exact paths + contents):\n - Copilot: `.github/skills//SKILL.md`\n - Claude Code: `.claude/skills//SKILL.md`\n - Codex: short pointer in root `AGENTS.md` linking to the skill or `docs/agents/.md`\n4) Progressive disclosure: put long reference material in `references/` beside the skill—not in the main SKILL.md.\n5) Do not include proprietary vendor prompt text. Keep wording original and practical.\n\nOutput order: proposed paths → frontmatter → SKILL.md body → AGENTS.md pointer snippet → optional references stubs." + }, + { + "id": "trim-agents-context-budget", + "title": "Trim AGENTS.md / CLAUDE.md Context Budget", + "whenToUse": "Instruction files are bloated, getting truncated, or drowning the model in always-on rules.", + "tools": [ + "copilot", + "claude-code", + "codex" + ], + "tags": [ + "agents", + "claude-code", + "codex", + "developer-workflow" + ], + "formatNotes": "Point the tool at your AGENTS.md and/or CLAUDE.md first. Works in all three.", + "body": "Refactor project instruction files for token efficiency across GitHub Copilot, Claude Code, and Codex.\n\nRules:\n- CLAUDE.md: stay under ~200 lines — facts, commands, and hard constraints only. Move multi-step procedures into `.claude/skills//SKILL.md`.\n- Copilot: keep critical always-on rules in `.github/copilot-instructions.md`; put path-specific detail in `*.instructions.md` or `.github/skills/`.\n- Codex: keep root AGENTS.md small and prefer nested AGENTS.md / linked docs. Warn that combined project docs truncate around ~32KiB by default.\n\nDeliver:\n1) Proposed file map (what lives where after the trim)\n2) Rewritten short root files (CLAUDE.md / AGENTS.md / copilot-instructions.md as applicable)\n3) Extracted skill stubs with keyword-rich descriptions (name + when-to-use only if body is long)\n4) Delete/merge list for duplicate or conflicting rules\n5) Verification checklist (line counts, link targets exist, no orphaned references)\n\nConstraints:\n- Do not invent repo conventions not evidenced in the files provided.\n- Prefer move/split over rewrite; preserve meaning of existing rules.\n- Call out anything that would change behavior if shortened.\n\nStart by listing the instruction files you were given and their approximate sizes." } ] } diff --git a/skillbook/skills.json b/skillbook/skills.json index 0076b87..c9849fe 100644 --- a/skillbook/skills.json +++ b/skillbook/skills.json @@ -21,8 +21,8 @@ "spring-boot", "microservices" ], - "formatNotes": "All three: paste the body as standing project guidance. Copilot \u2192 `.github/copilot-instructions.md` or `.github/instructions/spring.instructions.md` with applyTo for `**/*.{java,xml,yml}`. Claude Code \u2192 `.claude/skills/spring-boot-guardrails/SKILL.md` (YAML frontmatter + body) or a short pointer in `CLAUDE.md`. Codex \u2192 section in root `AGENTS.md` or a linked `docs/agents/spring-boot.md`.", - "body": "# Skill: Spring Boot Service Guardrails\n\n## Goal\nProduce production-ready Spring Boot changes that are secure, testable, and consistent with layered architecture.\n\n## When to apply\n- New REST endpoints, services, repositories, or configuration\n- Refactors that touch request validation, auth, or persistence\n\n## Architecture rules\n1. Keep controllers thin: validate input, map DTO \u2194 domain, call one service method, map errors.\n2. Business rules live in services; repositories do persistence only.\n3. Prefer constructor injection; never field-inject `@Autowired` on production beans.\n4. Use explicit DTOs at the API boundary; do not expose JPA entities in responses.\n5. Fail closed on authz: deny by default, document required authorities on each endpoint.\n\n## Implementation steps\n1. Locate existing package layout and match naming (`...controller`, `...service`, `...repository`).\n2. Add/adjust request validation (`@Valid`, Bean Validation constraints) before business logic.\n3. Map domain errors to stable problem responses (status + code + safe message).\n4. Add unit tests for service rules and at least one WebMvc/WebTestClient slice for the endpoint.\n5. Update OpenAPI/annotations only when the public contract changes.\n\n## Constraints\n- No secrets in code, logs, or test fixtures.\n- Do not weaken CSRF/security config unless the change is explicitly about security and reviewed.\n- Prefer existing project libraries over new dependencies.\n- Keep methods small; extract helpers instead of deep nesting.\n\n## Output format\n- Summary of files touched (bullets)\n- Code changes ready to apply\n- Test plan: commands to run + cases covered\n- Residual risks (auth, migrations, breaking API)" + "formatNotes": "All three: paste the body as standing project guidance. Copilot → `.github/copilot-instructions.md` or `.github/instructions/spring.instructions.md` with applyTo for `**/*.{java,xml,yml}`. Claude Code → `.claude/skills/spring-boot-guardrails/SKILL.md` (YAML frontmatter + body) or a short pointer in `CLAUDE.md`. Codex → section in root `AGENTS.md` or a linked `docs/agents/spring-boot.md`.", + "body": "# Skill: Spring Boot Service Guardrails\n\n## Goal\nProduce production-ready Spring Boot changes that are secure, testable, and consistent with layered architecture.\n\n## When to apply\n- New REST endpoints, services, repositories, or configuration\n- Refactors that touch request validation, auth, or persistence\n\n## Architecture rules\n1. Keep controllers thin: validate input, map DTO ↔ domain, call one service method, map errors.\n2. Business rules live in services; repositories do persistence only.\n3. Prefer constructor injection; never field-inject `@Autowired` on production beans.\n4. Use explicit DTOs at the API boundary; do not expose JPA entities in responses.\n5. Fail closed on authz: deny by default, document required authorities on each endpoint.\n\n## Implementation steps\n1. Locate existing package layout and match naming (`...controller`, `...service`, `...repository`).\n2. Add/adjust request validation (`@Valid`, Bean Validation constraints) before business logic.\n3. Map domain errors to stable problem responses (status + code + safe message).\n4. Add unit tests for service rules and at least one WebMvc/WebTestClient slice for the endpoint.\n5. Update OpenAPI/annotations only when the public contract changes.\n\n## Constraints\n- No secrets in code, logs, or test fixtures.\n- Do not weaken CSRF/security config unless the change is explicitly about security and reviewed.\n- Prefer existing project libraries over new dependencies.\n- Keep methods small; extract helpers instead of deep nesting.\n\n## Output format\n- Summary of files touched (bullets)\n- Code changes ready to apply\n- Test plan: commands to run + cases covered\n- Residual risks (auth, migrations, breaking API)" }, { "id": "aks-workload-hardening", @@ -39,7 +39,7 @@ "kubernetes" ], "formatNotes": "All three. Copilot path-scoped instructions for `**/k8s/**`, `**/helm/**`, `**/*.{yaml,yml}`. Claude Code skill under `.claude/skills/aks-hardening/SKILL.md`. Codex: nested `deploy/AGENTS.md` or root `AGENTS.md` section titled AKS.", - "body": "# Skill: AKS Workload Hardening\n\n## Goal\nShip Kubernetes workloads to AKS that are operable, least-privilege, and reviewable.\n\n## When to apply\n- New Deployment/StatefulSet/Job, Service, Ingress/Gateway, HPA, NetworkPolicy, or Helm values\n- Reviews of manifests before merge to the deploy path\n\n## Checklist (apply in order)\n1. **Identity**: prefer workload identity / managed identity over long-lived secrets in pods.\n2. **Resources**: set requests and limits; document why limits differ from requests.\n3. **Probes**: readiness + liveness (and startup when cold start is slow); probes must not be identical if that hides failure.\n4. **Security context**: runAsNonRoot, readOnlyRootFilesystem when feasible, drop ALL capabilities, no privileged.\n5. **Networking**: explicit Service ports; NetworkPolicy default-deny + allowlist if the cluster uses policies.\n6. **Rollouts**: rollingUpdate maxUnavailable/maxSurge; PodDisruptionBudget for user-facing services.\n7. **Observability**: consistent labels (`app`, `version`, `team`); scrape annotations or OpenTelemetry only if the platform expects them.\n8. **Secrets**: reference Key Vault / CSI / external secrets \u2014 never commit raw credentials.\n\n## Azure-specific notes\n- Prefer Azure CNI / documented cluster networking patterns already used in-repo.\n- Align ingress class, TLS secrets, and public vs private exposure with existing apps.\n- For AKS node pools, avoid hostPath and hostNetwork unless the platform team already uses them for that component.\n\n## Constraints\n- Do not invent cluster-wide CRDs or operators that are not already installed.\n- Keep manifests idempotent and environment-parameterized (overlays/values), not hardcoded subscription IDs in app charts.\n\n## Output format\n- Diff-oriented manifest changes\n- Table: control \u2192 status (pass/fail/n/a) \u2192 note\n- Commands to validate (`kubectl dry-run` / `helm template` / policy checks used in-repo)" + "body": "# Skill: AKS Workload Hardening\n\n## Goal\nShip Kubernetes workloads to AKS that are operable, least-privilege, and reviewable.\n\n## When to apply\n- New Deployment/StatefulSet/Job, Service, Ingress/Gateway, HPA, NetworkPolicy, or Helm values\n- Reviews of manifests before merge to the deploy path\n\n## Checklist (apply in order)\n1. **Identity**: prefer workload identity / managed identity over long-lived secrets in pods.\n2. **Resources**: set requests and limits; document why limits differ from requests.\n3. **Probes**: readiness + liveness (and startup when cold start is slow); probes must not be identical if that hides failure.\n4. **Security context**: runAsNonRoot, readOnlyRootFilesystem when feasible, drop ALL capabilities, no privileged.\n5. **Networking**: explicit Service ports; NetworkPolicy default-deny + allowlist if the cluster uses policies.\n6. **Rollouts**: rollingUpdate maxUnavailable/maxSurge; PodDisruptionBudget for user-facing services.\n7. **Observability**: consistent labels (`app`, `version`, `team`); scrape annotations or OpenTelemetry only if the platform expects them.\n8. **Secrets**: reference Key Vault / CSI / external secrets — never commit raw credentials.\n\n## Azure-specific notes\n- Prefer Azure CNI / documented cluster networking patterns already used in-repo.\n- Align ingress class, TLS secrets, and public vs private exposure with existing apps.\n- For AKS node pools, avoid hostPath and hostNetwork unless the platform team already uses them for that component.\n\n## Constraints\n- Do not invent cluster-wide CRDs or operators that are not already installed.\n- Keep manifests idempotent and environment-parameterized (overlays/values), not hardcoded subscription IDs in app charts.\n\n## Output format\n- Diff-oriented manifest changes\n- Table: control → status (pass/fail/n/a) → note\n- Commands to validate (`kubectl dry-run` / `helm template` / policy checks used in-repo)" }, { "id": "gha-devsecops-pipeline", @@ -56,7 +56,7 @@ "ci" ], "formatNotes": "All three. Copilot: `.github/instructions/actions.instructions.md` with applyTo `**/.github/workflows/*.yml`. Claude Code: skill `gha-devsecops`. Codex: `AGENTS.md` CI section + link to workflow conventions.", - "body": "# Skill: GitHub Actions DevSecOps Pipeline\n\n## Goal\nProduce workflows that are pinned, least-privilege, cached sensibly, and fail on real security findings.\n\n## When to apply\n- New CI/CD workflows or reusable workflows\n- Adding scanners, OIDC deploy, or environment protections\n\n## Required patterns\n1. Pin actions by full commit SHA (not floating major tags) when the repo already does so; otherwise pin to a verified major and note follow-up.\n2. Set `permissions:` explicitly at workflow or job level \u2014 default to read, escalate per job.\n3. Prefer OIDC to cloud roles over long-lived cloud keys in GitHub secrets.\n4. Separate build/test from deploy; deploy only from protected environments/branches.\n5. Cache dependencies with precise keys; never cache credentials or built secrets.\n6. Upload SBOMs / scan results as artifacts when the pipeline already expects them.\n\n## Security gates (minimum)\n- Dependency vulnerability scan (language-appropriate)\n- Secret scan on the diff or full repo as configured by the org\n- SAST or linter gate that blocks on high severity when tools exist in-repo\n- Container image scan before push/promote if images are produced\n\n## Implementation steps\n1. Mirror structure of an existing healthy workflow in the repo.\n2. Add jobs with clear names; use `needs:` for the security \u2192 build \u2192 deploy chain.\n3. Parameterize versions via `env:` at the top.\n4. Document required secrets/vars in a short header comment (names only, never values).\n5. Add a dry-run or `workflow_dispatch` path for risky deploys.\n\n## Constraints\n- No `pull_request_target` with untrusted checkout + secrets unless following org-approved pattern.\n- Avoid `curl | bash` installers; use setup actions or package managers.\n- Do not echo secrets; mask sensitive outputs.\n\n## Output format\n- Complete workflow YAML (or surgical patch)\n- Permission matrix per job\n- How to verify locally / with `act` if used\n- Residual risks and follow-ups" + "body": "# Skill: GitHub Actions DevSecOps Pipeline\n\n## Goal\nProduce workflows that are pinned, least-privilege, cached sensibly, and fail on real security findings.\n\n## When to apply\n- New CI/CD workflows or reusable workflows\n- Adding scanners, OIDC deploy, or environment protections\n\n## Required patterns\n1. Pin actions by full commit SHA (not floating major tags) when the repo already does so; otherwise pin to a verified major and note follow-up.\n2. Set `permissions:` explicitly at workflow or job level — default to read, escalate per job.\n3. Prefer OIDC to cloud roles over long-lived cloud keys in GitHub secrets.\n4. Separate build/test from deploy; deploy only from protected environments/branches.\n5. Cache dependencies with precise keys; never cache credentials or built secrets.\n6. Upload SBOMs / scan results as artifacts when the pipeline already expects them.\n\n## Security gates (minimum)\n- Dependency vulnerability scan (language-appropriate)\n- Secret scan on the diff or full repo as configured by the org\n- SAST or linter gate that blocks on high severity when tools exist in-repo\n- Container image scan before push/promote if images are produced\n\n## Implementation steps\n1. Mirror structure of an existing healthy workflow in the repo.\n2. Add jobs with clear names; use `needs:` for the security → build → deploy chain.\n3. Parameterize versions via `env:` at the top.\n4. Document required secrets/vars in a short header comment (names only, never values).\n5. Add a dry-run or `workflow_dispatch` path for risky deploys.\n\n## Constraints\n- No `pull_request_target` with untrusted checkout + secrets unless following org-approved pattern.\n- Avoid `curl | bash` installers; use setup actions or package managers.\n- Do not echo secrets; mask sensitive outputs.\n\n## Output format\n- Complete workflow YAML (or surgical patch)\n- Permission matrix per job\n- How to verify locally / with `act` if used\n- Residual risks and follow-ups" }, { "id": "jwt-oauth-security-review", @@ -72,8 +72,8 @@ "oauth", "security" ], - "formatNotes": "All three. Keep this skill concise \u2014 security rules first. Copilot instructions file for auth packages; Claude Code skill with clear description triggers; Codex `AGENTS.md` Security section.", - "body": "# Skill: JWT / OAuth Security Review\n\n## Goal\nEnsure token-based auth is validated correctly and fails safely.\n\n## When to apply\n- Resource server / API gateway JWT middleware\n- Authorization code + PKCE, client credentials, or token exchange flows\n- Custom claim mapping into roles/permissions\n\n## Validation requirements\n1. Verify signature with the correct JWKS/issuer keys; reject `alg=none` and unexpected algorithms.\n2. Validate `iss`, `aud` (or equivalent), `exp`, `nbf`, and token use (`typ` / `token_use`) as required by the IdP.\n3. Prefer asymmetric algorithms (RS256/ES256) over shared HMAC for multi-service APIs.\n4. Map scopes/roles explicitly; do not treat presence of a JWT as authorization for every route.\n5. Clock skew: small leeway only; document the value.\n\n## Common anti-patterns to reject\n- Decoding payload without verifying signature\n- Accepting tokens from multiple issuers without an allowlist\n- Logging raw tokens or authorization headers\n- Storing refresh tokens in localStorage for confidential apps without a deliberate threat model\n- Using access tokens as proof of email/identity without checking IdP claims\n\n## Review steps\n1. Identify token entry points (filters, middleware, gateway).\n2. Trace claim \u2192 permission mapping.\n3. Confirm error paths return generic 401/403 without leaking key material.\n4. Check test coverage for expired, wrong-aud, wrong-iss, and tampered tokens.\n\n## Output format\n- Findings ordered by severity (blocker / major / minor)\n- Recommended code or config change per finding\n- Test cases to add (table)\n- Explicit \u201cout of scope\u201d notes" + "formatNotes": "All three. Keep this skill concise — security rules first. Copilot instructions file for auth packages; Claude Code skill with clear description triggers; Codex `AGENTS.md` Security section.", + "body": "# Skill: JWT / OAuth Security Review\n\n## Goal\nEnsure token-based auth is validated correctly and fails safely.\n\n## When to apply\n- Resource server / API gateway JWT middleware\n- Authorization code + PKCE, client credentials, or token exchange flows\n- Custom claim mapping into roles/permissions\n\n## Validation requirements\n1. Verify signature with the correct JWKS/issuer keys; reject `alg=none` and unexpected algorithms.\n2. Validate `iss`, `aud` (or equivalent), `exp`, `nbf`, and token use (`typ` / `token_use`) as required by the IdP.\n3. Prefer asymmetric algorithms (RS256/ES256) over shared HMAC for multi-service APIs.\n4. Map scopes/roles explicitly; do not treat presence of a JWT as authorization for every route.\n5. Clock skew: small leeway only; document the value.\n\n## Common anti-patterns to reject\n- Decoding payload without verifying signature\n- Accepting tokens from multiple issuers without an allowlist\n- Logging raw tokens or authorization headers\n- Storing refresh tokens in localStorage for confidential apps without a deliberate threat model\n- Using access tokens as proof of email/identity without checking IdP claims\n\n## Review steps\n1. Identify token entry points (filters, middleware, gateway).\n2. Trace claim → permission mapping.\n3. Confirm error paths return generic 401/403 without leaking key material.\n4. Check test coverage for expired, wrong-aud, wrong-iss, and tampered tokens.\n\n## Output format\n- Findings ordered by severity (blocker / major / minor)\n- Recommended code or config change per finding\n- Test cases to add (table)\n- Explicit “out of scope” notes" }, { "id": "data-platform-pipeline-review", @@ -90,7 +90,7 @@ "pipelines" ], "formatNotes": "All three. Avoid embedding tenant-specific connection strings. Copilot path rules for notebook/ETL folders; Claude Code skill; Codex nested `AGENTS.md` under data pipelines.", - "body": "# Skill: Data Platform Pipeline Review\n\n## Goal\nDeliver data pipelines that are idempotent, observable, and safe for sensitive fields.\n\n## When to apply\n- New Databricks jobs/notebooks, Spark transformations, or ADF/Fabric-style pipelines\n- Schema changes, backfills, or catch-up loads\n\n## Design rules\n1. **Contracts first**: define input/output schemas and ownership before coding transforms.\n2. **Idempotency**: merges/upserts keyed by business keys; safe re-runs without duplicating facts.\n3. **Partitioning**: choose partition columns for query patterns; avoid tiny-file explosion.\n4. **Quality gates**: null checks, referential checks, and row-count anomalies before publish.\n5. **PII/PHI**: classify columns; tokenize/hash/mask per platform standards; least-privilege access.\n6. **Orchestration**: clear dependencies, retries with backoff, and dead-letter / failure paths.\n7. **Cost**: cache only when reused; prune unused columns early; right-size clusters/pools.\n\n## Implementation steps\n1. Sketch source \u2192 bronze/silver/gold (or in-repo layering names) data flow.\n2. Implement transforms with explicit schemas; avoid `select *` across trust boundaries.\n3. Add data quality checks as jobs/tasks that block downstream publish on failure.\n4. Emit metrics/logs with run id, batch window, and row counts.\n5. Document backfill procedure and watermark strategy.\n\n## Constraints\n- Do not invent employer-specific catalog names, secrets, or subscription IDs.\n- Prefer existing platform libraries and patterns in the repository.\n- No production writes from ad-hoc interactive sessions in committed jobs.\n\n## Output format\n- Pipeline diagram (mermaid or bullet edges)\n- Task list with inputs/outputs\n- Risk register (data loss, late data, PII)\n- Validation queries / checks to run after deploy" + "body": "# Skill: Data Platform Pipeline Review\n\n## Goal\nDeliver data pipelines that are idempotent, observable, and safe for sensitive fields.\n\n## When to apply\n- New Databricks jobs/notebooks, Spark transformations, or ADF/Fabric-style pipelines\n- Schema changes, backfills, or catch-up loads\n\n## Design rules\n1. **Contracts first**: define input/output schemas and ownership before coding transforms.\n2. **Idempotency**: merges/upserts keyed by business keys; safe re-runs without duplicating facts.\n3. **Partitioning**: choose partition columns for query patterns; avoid tiny-file explosion.\n4. **Quality gates**: null checks, referential checks, and row-count anomalies before publish.\n5. **PII/PHI**: classify columns; tokenize/hash/mask per platform standards; least-privilege access.\n6. **Orchestration**: clear dependencies, retries with backoff, and dead-letter / failure paths.\n7. **Cost**: cache only when reused; prune unused columns early; right-size clusters/pools.\n\n## Implementation steps\n1. Sketch source → bronze/silver/gold (or in-repo layering names) data flow.\n2. Implement transforms with explicit schemas; avoid `select *` across trust boundaries.\n3. Add data quality checks as jobs/tasks that block downstream publish on failure.\n4. Emit metrics/logs with run id, batch window, and row counts.\n5. Document backfill procedure and watermark strategy.\n\n## Constraints\n- Do not invent employer-specific catalog names, secrets, or subscription IDs.\n- Prefer existing platform libraries and patterns in the repository.\n- No production writes from ad-hoc interactive sessions in committed jobs.\n\n## Output format\n- Pipeline diagram (mermaid or bullet edges)\n- Task list with inputs/outputs\n- Risk register (data loss, late data, PII)\n- Validation queries / checks to run after deploy" }, { "id": "llm-eval-agent-workflow", @@ -109,7 +109,42 @@ "codex" ], "formatNotes": "Written for all three tools with format notes inline. Copilot: keep under ~2k tokens in `copilot-instructions.md`; put long procedures in linked docs. Claude Code: keep `CLAUDE.md` short; put this procedure in `.claude/skills/llm-eval/SKILL.md`. Codex: root `AGENTS.md` points to `docs/agents/llm-eval.md` so the main file stays small.", - "body": "# Skill: LLM Eval and Agent Workflow Pack\n\n## Goal\nRun agentic coding tasks with measurable quality bars and portable instructions across Copilot, Claude Code, and Codex.\n\n## Tool placement (read this first)\n- **GitHub Copilot**: project rules in `.github/copilot-instructions.md`; path-specific `*.instructions.md` with `applyTo`. Keep critical security rules first.\n- **Claude Code**: durable facts in `CLAUDE.md` (< ~200 lines). Multi-step procedures belong in `.claude/skills//SKILL.md` with `description` / `when_to_use`. Optional `@AGENTS.md` import for shared text.\n- **Codex**: durable ops in `AGENTS.md` (and nested / `AGENTS.override.md`). Keep concise; link out for long eval rubrics.\n\n## Eval workflow\n1. **Define the task card**: goal, constraints, in-scope paths, out-of-scope, Definition of Done.\n2. **Golden checks**: commands that must pass (unit/integration/lint). No silent skips.\n3. **Rubric** (score 0\u20132 each): correctness, safety (secrets/PII), diff discipline, test updates, docs/runbook touch.\n4. **Baseline**: run once without the skill/instructions, once with \u2014 compare rubric and token/time cost.\n5. **Regressions**: store failing prompts in an `evals/` list; re-run after instruction edits.\n\n## Agent loop (all tools)\n1. Restate goal and constraints in one short paragraph.\n2. Explore only relevant paths; avoid repo-wide rewrites.\n3. Implement smallest viable change; keep commits/PR focused.\n4. Run verification commands; fix failures before claiming done.\n5. Report: summary, files changed, commands run, residual risks.\n\n## Constraints\n- Never exfiltrate secrets or customer data into prompts, logs, or fixtures.\n- Prefer patching existing patterns over new frameworks.\n- If instructions conflict, stop and list conflicts instead of guessing.\n\n## Output format\n- Task restatement\n- Plan (3\u20137 steps)\n- Changes + verification evidence\n- Rubric scores + next instruction tweak (if any)" + "body": "# Skill: LLM Eval and Agent Workflow Pack\n\n## Goal\nRun agentic coding tasks with measurable quality bars and portable instructions across Copilot, Claude Code, and Codex.\n\n## Tool placement (read this first)\n- **GitHub Copilot**: project rules in `.github/copilot-instructions.md`; path-specific `*.instructions.md` with `applyTo`. Keep critical security rules first.\n- **Claude Code**: durable facts in `CLAUDE.md` (< ~200 lines). Multi-step procedures belong in `.claude/skills//SKILL.md` with `description` / `when_to_use`. Optional `@AGENTS.md` import for shared text.\n- **Codex**: durable ops in `AGENTS.md` (and nested / `AGENTS.override.md`). Keep concise; link out for long eval rubrics.\n\n## Eval workflow\n1. **Define the task card**: goal, constraints, in-scope paths, out-of-scope, Definition of Done.\n2. **Golden checks**: commands that must pass (unit/integration/lint). No silent skips.\n3. **Rubric** (score 0–2 each): correctness, safety (secrets/PII), diff discipline, test updates, docs/runbook touch.\n4. **Baseline**: run once without the skill/instructions, once with — compare rubric and token/time cost.\n5. **Regressions**: store failing prompts in an `evals/` list; re-run after instruction edits.\n\n## Agent loop (all tools)\n1. Restate goal and constraints in one short paragraph.\n2. Explore only relevant paths; avoid repo-wide rewrites.\n3. Implement smallest viable change; keep commits/PR focused.\n4. Run verification commands; fix failures before claiming done.\n5. Report: summary, files changed, commands run, residual risks.\n\n## Constraints\n- Never exfiltrate secrets or customer data into prompts, logs, or fixtures.\n- Prefer patching existing patterns over new frameworks.\n- If instructions conflict, stop and list conflicts instead of guessing.\n\n## Output format\n- Task restatement\n- Plan (3–7 steps)\n- Changes + verification evidence\n- Rubric scores + next instruction tweak (if any)" + }, + { + "id": "otel-aks-observability", + "title": "OpenTelemetry on AKS Services", + "whenToUse": "Adding or hardening metrics, traces, and logs for services running on Azure AKS.", + "tools": [ + "copilot", + "claude-code", + "codex" + ], + "tags": [ + "observability", + "opentelemetry", + "aks", + "azure" + ], + "formatNotes": "All three. Copilot: path-scoped `.github/instructions/otel.instructions.md` with applyTo for `**/*.{java,ts,go,yml,yaml}` plus optional `.github/skills/otel-aks/SKILL.md`. Claude Code: `.claude/skills/otel-aks/SKILL.md` (YAML name+description) and a one-line pointer in CLAUDE.md. Codex: keep root AGENTS.md short; put the procedure in `docs/agents/otel-aks.md` or a nested `deploy/AGENTS.md` so you stay under the ~32KiB project-doc budget.", + "body": "# Skill: OpenTelemetry on AKS Services\n\n## Goal\nAdd or harden traces, metrics, and logs for services on Azure AKS so signals correlate and SLIs drive alerts—without leaking PII.\n\n## When to apply\n- New service missing OTel instrumentation\n- Existing AKS workload with sparse traces, high cardinality, or uncorrelated logs\n- Collector / exporter / sampling changes in-repo\n\n## Instrumentation checklist\n1. **Traces**: instrument inbound HTTP/gRPC, outbound clients, DB/messaging; propagate W3C trace context.\n2. **Metrics**: RED/USE or domain SLIs (latency, error rate, saturation); avoid high-cardinality labels (raw user ids, URLs with ids).\n3. **Logs**: include `trace_id` / `span_id` on every request log line; keep severity consistent.\n4. **Semantic conventions**: prefer OTel HTTP/DB/RPC attribute names; do not invent parallel keys.\n5. **Resource attributes**: set `service.name`, `service.version`, `deployment.environment` (and cluster/namespace if available).\n6. **Exporters**: OTLP to the in-cluster collector endpoint already used by the repo; no ad-hoc SaaS SDKs unless already present.\n7. **Sampling**: head/tail sampling policy documented; raise sample rate only for error/slow paths when needed.\n8. **PII redaction**: scrub tokens, emails, phone numbers, auth headers before export; never log raw JWTs.\n9. **Dashboards / alerts**: map panels and alerts to SLIs (availability, latency p95/p99, error budget)—not vanity graphs.\n\n## AKS notes\n- Prefer **in-process** SDK when the language runtime already has one in this repo; use sidecar only if that pattern already exists.\n- Collector: reuse existing **DaemonSet** (node agent) or **Gateway** deployment patterns in-repo—do not introduce a second collector stack.\n- Ensure NetworkPolicy / private endpoints allow pod → collector OTLP; keep scrape ports off the public Service.\n\n## Constraints\n- Do not invent collector charts or CRDs not already in the repo.\n- Do not disable sampling “temporarily” in production manifests.\n- Prefer smallest diff: SDK config + attributes before new infra.\n\n## Output format\n- Summary of gaps found\n- Files / manifests to change (bullet list)\n- Checklist results (pass/fail per item above)\n- Residual risks (cardinality, cost, missing SLIs)" + }, + { + "id": "secure-pr-review-guardrails", + "title": "Secure Pull Request Review", + "whenToUse": "Reviewing a PR for security, secrets leakage, authz gaps, and supply-chain risk before merge.", + "tools": [ + "copilot", + "claude-code", + "codex" + ], + "tags": [ + "security", + "code-review", + "devsecops" + ], + "formatNotes": "All three. Copilot Chat/agent prompt or `.github/skills/secure-pr-review/SKILL.md`. Claude Code skill with a keyword-rich description (PR review, secrets, authz). Codex: section in AGENTS.md titled Secure review, or invoke as a pasted checklist.", + "body": "# Skill: Secure Pull Request Review\n\n## Goal\nReview a pull request for security defects—secrets leakage, authn/authz gaps, injection classes, and supply-chain risk—before merge.\n\n## When to apply\n- Any PR touching auth, crypto, CI permissions, dependencies, or public endpoints\n- Pre-merge security gate when a human asks for a secure review\n- After dependency bumps or workflow changes\n\n## Review order\n1. **Secrets / credentials**: hardcoded keys, tokens, connection strings, private keys, `.env` committed, debug dumps.\n2. **Authn / authz**: missing checks, IDOR, privilege escalation, overly broad roles, trust of client-supplied identity.\n3. **Injection / XSS / SSRF**: unsanitized input to SQL/NoSQL/shell/HTML; open redirects; server-side fetches to user-controlled URLs.\n4. **Dependency / lockfile / supply chain**: unexpected lockfile churn, new postinstall scripts, unpinned Actions, suspicious publishers.\n5. **Dangerous CI permissions**: `write-all`, unchecked `pull_request_target`, secrets to untrusted forks, mutable Action tags.\n6. **Data exposure / logging**: PII in logs, verbose errors to clients, overly broad CORS, public buckets.\n\n## Required findings format\nFor each issue:\n- **Severity**: critical | high | medium | low | info\n- **Location**: `file:line` (or hunk)\n- **Exploit sketch**: one short paragraph on how it could be abused\n- **Fix**: concrete remediation\n\n## Pass criteria\n- No unresolved critical/high findings\n- Medium findings acknowledged with owner or follow-up issue\n- No real secrets pasted into chat or review comments\n\n## Constraints\n- Do not invent vulnerabilities without evidence in the diff or reachable code.\n- Do not paste real secrets into chat—reference redacted shapes only.\n- Stay inside the PR diff plus minimal necessary context files.\n\n## Output format\n- Verdict: approve with notes | request changes | block\n- Findings table (severity, location, sketch, fix)\n- Residual risks / out-of-scope notes" } ] }