diff --git a/promptbook/prompts.json b/promptbook/prompts.json index 0038d20..01416a7 100644 --- a/promptbook/prompts.json +++ b/promptbook/prompts.json @@ -141,6 +141,25 @@ ], "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." + }, + { + "id": "scaffold-instruction-layers", + "title": "Scaffold Copilot / Claude / Codex Instruction Layers", + "whenToUse": "Greenfield or thin repos that need a clean split between always-on instructions and on-demand skills for Copilot, Claude Code, and Codex.", + "tools": [ + "copilot", + "claude-code", + "codex" + ], + "tags": [ + "agents", + "copilot", + "claude-code", + "codex", + "developer-workflow" + ], + "formatNotes": "Paste into Copilot Chat, Claude Code, or Codex with the repo open. Ask the tool to write the files (not just describe them).", + "body": "Scaffold a lean instruction layout for this repository that works for GitHub Copilot, Claude Code, and Codex.\n\nCreate (or propose exact paths + full file contents):\n\n1) Copilot\n- `.github/copilot-instructions.md` — short always-on house style (stack, tests, boundaries). Keep under ~150 lines.\n- Optional path-scoped `.github/instructions/.instructions.md` with YAML frontmatter `applyTo` globs only where rules differ by path.\n\n2) Claude Code\n- `CLAUDE.md` — facts, commands, and hard constraints only (target under ~200 lines).\n- Move any multi-step procedure into `.claude/skills//SKILL.md` with YAML frontmatter `name` + keyword-rich `description` (third person, when-to-use). Keep SKILL.md body lean; put long reference material under `references/`.\n\n3) Codex\n- Root `AGENTS.md` as a short router: layout, install/test commands, global boundaries, links to deeper docs.\n- For packages/areas with different commands, add nested `AGENTS.md` closer to that code (Codex walks root→cwd; nearer files override). Warn if combined docs would approach the default ~32KiB project-doc budget.\n- Do not commit `AGENTS.override.md` unless the user asks for a local-only override.\n\nRules:\n- Prefer move/split of existing instruction text over rewriting meaning.\n- No proprietary vendor prompt dumps; original practical wording only.\n- No secrets, tokens, or personal data.\n- Explicit \"never touch\" boundaries (secrets, generated/, vendor/).\n\nOutput order:\n1) File map\n2) Full contents for each new/changed file\n3) What was left out and why\n4) Verification checklist (line counts, links resolve, no duplicate conflicting rules)" } ] } diff --git a/skillbook/skills.json b/skillbook/skills.json index c9849fe..c732eab 100644 --- a/skillbook/skills.json +++ b/skillbook/skills.json @@ -145,6 +145,23 @@ ], "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" + }, + { + "id": "azure-bicep-iac-guardrails", + "title": "Azure Bicep IaC Guardrails", + "whenToUse": "Authoring or reviewing Azure Bicep modules, main.bicep, or parameter files before deploy.", + "tools": [ + "copilot", + "claude-code", + "codex" + ], + "tags": [ + "azure", + "bicep", + "iac" + ], + "formatNotes": "All three. Copilot: path-scoped `.github/instructions/bicep.instructions.md` with applyTo `**/*.{bicep,bicepparam}`. Claude Code: `.claude/skills/azure-bicep-guardrails/SKILL.md`. Codex: nested `infra/AGENTS.md` or root `AGENTS.md` Azure IaC section.", + "body": "# Skill: Azure Bicep IaC Guardrails\n\n## Goal\nProduce Bicep that is least-privilege, parameterized, and safe to review before Azure deployment.\n\n## When to apply\n- New or changed `.bicep` / `.bicepparam` modules\n- Reviews of infra PRs that touch resource IDs, RBAC, networking, or secrets\n\n## Rules\n1. Prefer modules with clear inputs/outputs; avoid giant monolithic main files when the repo already uses modules.\n2. Parameterize environment-specific values (names, SKUs, CIDRs); never hardcode subscription IDs or secrets in committed params.\n3. Use `@secure()` for secrets and Key Vault references where the pattern already exists; never echo secure params in outputs.\n4. Scope RBAC to the narrowest principal and role; prefer role assignments at resource/RG scope over subscription-wide.\n5. Explicitly set required tags used by the platform (owner, env, cost-center) when the repo already expects them.\n6. Prefer existing verified modules / patterns in-repo over inventing new resource types.\n7. For public endpoints: justify exposure; prefer private endpoints / VNet integration when sibling modules do.\n8. Keep API versions pinned and consistent with neighboring modules; do not float to latest without a reason.\n\n## Review checklist\n- What resources are created/updated/deleted?\n- Any wildcard `*` permissions or Owner assignments?\n- Are diagnostics / logging hooks aligned with existing modules?\n- Are dependsOn / existing resource references correct?\n- What is the rollback story if deploy fails mid-way?\n\n## Constraints\n- Do not invent tenant, subscription, or object IDs — use parameters or existing symbols.\n- Do not weaken network or RBAC controls \"just to make deploy work\".\n- Prefer what-if / validation commands the repo already documents.\n\n## Output format\n- Summary of modules/files touched\n- Bicep diffs ready to apply\n- Parameter changes (names only for secrets)\n- Validation commands (`az bicep build`, what-if, or repo scripts)\n- Residual risks" } ] }