Code Review Prompts with Lexicon
Reusable, templatized review prompts triggered as slash commands
Code review prompts are complex. You want Claude to check for security issues, performance problems, naming conventions, and test coverage -- but retyping that detailed prompt for every review is tedious. A thorough security review prompt might be three paragraphs of specific instructions covering input validation, authentication flows, SQL injection patterns, and error handling. Nobody types that from memory every time.
Copy-pasting from a notes file is the common workaround, but it loses nuance. You have to find the right file, remember which version of the prompt worked best, manually swap out the language and framework references, and paste it into your AI tool. The friction is enough that most developers default to vague instructions like "review this code" and get vague results in return.
The quality of a code review depends heavily on how specific your instructions are. The gap between "review this code" and "review this Python/Django code for SQL injection vulnerabilities, paying special attention to raw query usage in the reporting module" is enormous. But maintaining that level of specificity across dozens of daily reviews requires a system, not willpower.
With Lexicon, you create a "Security Review" prompt template with variables: {{language}}, {{framework}}, {{focus_area}}. One prompt template handles Python/Django, TypeScript/Next.js, or Swift/SwiftUI reviews -- just fill in the variables. Each variable can have a defined type, a default value, and validation rules. The {{language}} variable might default to "Python" and accept a defined set of options. The {{focus_area}} variable might default to "general" but accept "security", "performance", "naming", or "test coverage".
This means your carefully refined review instructions stay consistent across every review. The prompt that took you weeks to perfect -- the one that catches edge cases in error handling and flags missing input validation -- is preserved exactly as you wrote it. When you discover a better way to phrase an instruction, you update it once in Lexicon and every future review benefits.
Slash Command Access
Type /lexicon:security-review in Claude Code and the prompt loads with variable prompts. No switching apps, no copy-paste, no context loss. You stay in your terminal, in your codebase, in your flow. Lexicon's MCP server handles the handoff -- Claude Code requests the prompt, Lexicon resolves the template variables, and the full review instructions arrive in your conversation ready to execute.
This is not text expansion. It is protocol-level integration. The prompt arrives as a structured message with metadata, not a raw string pasted into a text field. Claude Code understands it came from Lexicon and can handle multi-message prompt structures appropriately.
Composable with ContextSwitch
A "Tech Debt Audit" prompt can instruct Claude to review code AND create ContextSwitch tasks for identified issues. The prompt orchestrates multiple tools in one action. "Review this module for tech debt, then create a ContextSwitch task for each issue found with severity and estimated effort." One slash command kicks off a review that produces both analysis and actionable tasks on your kanban board.
Because MCP connects tools together, your prompts are not limited to generating text. They become workflows that span your entire toolchain.
Team Prompt Sharing
Export your review prompts as JSON and share with teammates. Import their prompts. Everyone benefits from the team's collective review expertise without standardizing on a single rigid checklist. One developer's "Performance Review" prompt might catch database N+1 queries that yours misses. Another's "Accessibility Audit" prompt covers ARIA patterns you had not considered. Import both, and your library grows with the team's combined knowledge.
Iterative Improvement
Smart collections track which prompts you use most and which get the best results. Refine your review prompts over time based on actual usage data. If your "Security Review" prompt gets used daily but your "Architecture Review" prompt has not been touched in two months, that signal is visible. Maybe the architecture prompt needs updating, or maybe it should be merged into another template. Lexicon surfaces these patterns so your library stays sharp instead of accumulating dead weight.
Note: Lexicon is coming soon to the Mac App Store.
Learn More About Lexicon