#claude code
4 prompts found

Claude Code Security Review Prompt: Threat Model to Findings
Paste this into Claude Code with your change summary, stack, and sensitive data to get a threat model, a findings table with file and line, and a test plan.
Act as an application security engineer who runs security reviews inside Claude Code: you map the attack surface of a branch, write a short threat model for the change, and report only findings you can point to at a file and line, with an exploit scenario and a fix. Inputs: - What this branch changes and why: [ChangeSummary] - Framework, language, auth method, and data stores: [StackAndAuth] - Data that would hurt if exposed or changed: [SensitiveData] - Entry points and trust boundaries touched: routes, jobs, webhooks, file uploads: [EntryPoints] - Risks or past incidents you already know about: [KnownRisks] - Files or folders in scope, and anything out of scope: [ReviewScope] Generate: 1. Read only first: run git diff against origin's default branch for the files in ReviewScope and list every entry point the change adds or touches. Do not edit files in this pass. 2. Threat model for the change: a table of asset (from SensitiveData), entry point, threat, existing control, and gap. 3. Security review findings table: file:line, severity (high, medium, low), category (for example IDOR, injection, CSV injection, auth bypass, secrets), exploit scenario in one or two sentences, fix, and confidence. Keep only findings with high confidence; put the rest under NEEDS HUMAN CHECK. 4. Checked and fine: controls you verified, so the reviewer knows what was covered. 5. Fix plan: the smallest change for each finding, in order, as a plan for approval before any edit. 6. Tests to add: one failing test per finding that passes after the fix. Rules: - Never print secrets, tokens, or real customer data from the repo or environment; refer to them by file and variable name. - Do not run exploits against shared, staging, or production systems; describe them. - Report only issues the change introduces or touches; list older issues separately in one line each. - If a line number is unclear, quote the code instead of guessing.

Claude Code Review Prompt: Branch Diff Review Before a PR
Have Claude Code review your branch diff before a pull request: read-only, severity ranked findings with file and line, test gaps, and a fix plan you approve.
Act as a senior staff engineer doing a pre pull request code review inside Claude Code. You read the repository and the branch diff, run only read-only commands unless I approve otherwise, and report findings the way a careful human reviewer would: specific, ranked, and tied to file and line. Inputs: - Base branch to compare against and the branch under review: [BaseAndBranch] - What this change is supposed to do, in a sentence or two, and the ticket or spec if there is one: [ChangeIntent] - Areas I am least sure about: [RiskAreas] - Repo conventions and where they are written (CLAUDE.md, CONTRIBUTING, lint config): [Conventions] - Commands that are safe to run for checks (tests, linters, type checker) and any that are not: [SafeCommands] - Review depth (quick pass or full review) and the maximum number of findings to report: [Depth] - Output format: [Format] Generate: 1. Scope: run git diff --stat and git log for BaseAndBranch, then list files changed, approximate lines added and removed, and any file that looks unrelated to ChangeIntent. 2. Intent check: does the diff do what ChangeIntent says? List anything missing or anything extra. 3. Findings ranked by severity (blocker, major, minor, nit), up to the limit in Depth. Each finding gives file and line, what is wrong, why it matters, and a concrete suggested change. Cover correctness, error handling, security (input validation, secrets, injection, auth checks), data and migrations, concurrency, and performance where relevant. 4. A focused pass on RiskAreas with what you checked and what you could not verify. 5. Convention check against Conventions: naming, structure, logging, and patterns used elsewhere in the repo, citing an existing file as the example. 6. Test review: which changed behavior has tests, which does not, and the specific test cases to add. Run only SafeCommands and report their actual output; never claim tests passed without running them. 7. A questions list for things you cannot decide from the code, such as product behavior or intent. 8. A fix plan: the blocker and major findings as numbered steps. Do not edit any file until I reply with the step numbers to apply. 9. A short pull request description draft: summary, what changed, how it was tested, and risks. Constraints: - Read-only by default: no edits, commits, pushes, or installs without my explicit approval. - Quote code exactly as it appears; do not invent functions, files, or line numbers. - Prefer fewer, important findings over long lists of style nits. - No em dashes.

Claude Code Website Design Prompt: Build Session Planner
Plan a Claude Code session that builds a polished website: CLAUDE.md design rules, design tokens, phased prompts, screenshot reviews, and accessibility checks.
Act as a front end design engineer who uses Claude Code to build websites that look designed rather than generated, by fixing the design system first and then working section by section with review checkpoints. Inputs: - What the site is for, who visits it, and the one action a visitor should take: [SiteBrief] - Brand colors, fonts, logo files, and any existing style guide: [BrandTokens] - Pages and sections in order (for example hero, services, pricing, FAQ, contact): [PageSections] - Framework, styling approach, and hosting (for example Astro with Tailwind on Netlify, or plain HTML and CSS): [TechStack] - Two or three sites I like, described in words: what to borrow (spacing, type, layout), not their content: [VisualReferences] - Accessibility target and any must haves (for example WCAG 2.2 AA, reduced motion): [AccessibilityTarget] - Output format: [Format] Generate: 1. A design direction for the website in five lines (audience, mood, layout density, type pairing, imagery) from SiteBrief and VisualReferences, described in my own words without copying any site. 2. A CLAUDE.md design section for the repo: stack, folder structure, token rules (use variables, no hard coded colors or spacing), a spacing and type scale, component rules, and a do-not list. 3. A design tokens file draft from BrandTokens for TechStack (CSS custom properties or a Tailwind theme), with each text and background color pair listed for a contrast check. 4. A phased Claude Code prompt sequence: plan first with no code, then the layout shell, then each section in PageSections order, then real content, then responsive fixes, then polish. Each prompt names the files to touch and a stop point where Claude Code waits for my review. 5. A screenshot review loop: what to capture at mobile, tablet, and desktop widths, and a critique prompt I paste with the screenshots that compares them against the design direction and lists fixes by priority. 6. An accessibility pass for AccessibilityTarget: heading order, alt text, focus states, color contrast, keyboard navigation, and reduced motion, with a prompt for Claude Code to check each. 7. Commit checkpoints after each phase and a rollback rule for when a change makes the design worse. Constraints: - Use placeholder images labeled as placeholders; never invent logos, testimonials, client names, or pricing. - Only rely on Claude Code reading files, editing code, running commands, and looking at screenshots I provide; tell me to confirm any command in my own setup. - No em dashes.

Claude Code Hooks Config Writer for Team Repos: settings.json PreToolUse and PostToolUse Matchers, Exit Code 2 Blocking, stdin JSON Parsing with jq, Auto Format After Edits, Stop Hook Loop Guard, and a Hook Test Plan
Write Claude Code hooks a team can commit: the right settings file scope, PreToolUse guards that block destructive shell commands and edits to protected paths with exit code 2 and a reason Claude can read, PostToolUse formatting on edited files, a Stop hook that checks work without looping forever, and a plan to test each hook before trusting it.
Act as a developer productivity engineer who maintains Claude Code setups for a team, writes hooks as small shell or Python scripts under .claude/hooks, and treats every hook as code that runs with the developer's own permissions. Inputs: - Repo stack, package manager, formatter, linter, and test or typecheck commands: [RepoStack] - Commands or actions Claude must never run without asking: [BlockedActions] - Files or folders Claude must not edit: [ProtectedPaths] - What should happen automatically after edits or at the end of a task: [Automations] - Scope: personal only, shared with the team, or both: [Scope] - Output format: [Format] Generate: 1. Settings file choice from Scope: user settings in the home .claude folder, project settings in .claude/settings.json committed to git, or .claude/settings.local.json for personal overrides that stay out of git. 2. A hooks block in valid JSON: hook events as keys (PreToolUse, PostToolUse, Stop, and Notification or UserPromptSubmit only if Automations needs them), each with a matcher for tool names such as Bash or Edit|Write|MultiEdit, and command hooks pointing at scripts via the CLAUDE_PROJECT_DIR environment variable. 3. A PreToolUse guard for BlockedActions: read the JSON on stdin with jq, pull tool_input.command, match the dangerous patterns, print a reason to stderr, and exit 2 so the call is blocked and Claude sees why. Exit 0 lets the call through. 4. A path guard for ProtectedPaths on edit tools: read tool_input.file_path, block matches with exit 2 and a clear message. 5. PostToolUse automations from Automations and RepoStack: format only the edited file, keep output quiet, set a timeout, and never fail the session because a formatter is missing. 6. A Stop hook when Automations asks for a final check: run the typecheck or tests, exit 2 with the failures on stderr so Claude keeps working, and read stop_hook_active from stdin so it does not loop forever. 7. Each script in full with a shebang, set options, and a comment on what it reads and returns. Remind the team to make scripts executable. 8. A test plan: pipe sample JSON into each script by hand and check the exit code, then open the hooks menu in Claude Code to confirm they loaded, then try one blocked command in a scratch branch. 9. A security note: hooks run arbitrary commands with your account's access, so review hook changes in pull requests like any other code. Constraints: - Only use hook events, fields, and exit code behavior you are sure of; mark anything else "confirm in the current Claude Code hooks docs". - Quote paths that may contain spaces. No em dashes.