Optimize code-related prompts for clarity, investigation-first thinking, and verification.
text
$ARGUMENTS
Evaluate the input prompt across these dimensions:
DimensionWhat to checkTask ClarityIs the task type clear? (implement, fix, refactor, review, test) Are boundaries defined?InvestigationDoes it specify reading/understanding before acting?VerificationAre there appropriate checks? (run tests, build, lint)Context AnchoringDoes it reference specific files, functions, or patterns?Action SpecificityIs the desired outcome explicit? Quality expectations stated?Scope ControlIs it appropriately scoped? Clear stopping points?
Identify which dimensions are weak or missing in the input prompt.
Complete in order; do not skip steps.
text
Original: "fix the login bug"
Optimized:
Fix the login bug. First, read the authentication-related files to understand
the current implementation. Reproduce the bug to confirm the issue. Identify
the root cause before making changes. Implement the fix and run existing tests
to verify no regressions.
text
Original: "add dark mode"
Optimized:
Implement dark mode for the application. First, check how theming/styling is
currently handled in the codebase. Look for existing color variables or theme
patterns. Implement the toggle and theme switching with minimal changes to
existing components. Run tests and verify the UI renders correctly in both modes.
text
Original: "clean up the user service"
Optimized:
Refactor the user service for improved maintainability. Read the current
implementation and understand its responsibilities. Identify specific issues
(duplication, unclear naming, tight coupling). Make incremental changes,
running tests after each step to ensure behavior is unchanged.
Task TypeTipBug fixesInclude reproduction steps if known. Specify whether this is a quick fix or needs root cause analysis.Feature implementationReference similar features in the codebase. Specify if tests are expected.RefactoringState the goal (readability, performance, testability). Emphasize incremental changes.Code reviewSpecify focus areas (security, performance, style). Mention what to ignore.TestingSpecify test type (unit, integration, e2e). Reference existing test patterns.
Follow the Gates under Step 1 (audit → transform → output). Produce output in this exact format:
[2-3 sentences identifying the prompt type, which dimensions are weak or missing, or why all dimensions are already adequate]
text
[The improved prompt, ready to copy and use]
[1-2 sentences of relevant tips from the Task-Type Tips table]