Skip to main contentUse this when you need structured debugging instead of ad hoc fixes. These prompts keep the assistant in analysis-first mode until you choose a path.
Why it works
- Forces read-only analysis before edits, reducing risky guesses.
- Structures findings into causes, options, and validation steps.
- Speeds resolution by making tests and rollback plans explicit.
Core patterns
- Set mode: “No code changes yet. Analyze and propose.”
- Demand artifacts: findings list, hypotheses, repro steps, and test plans.
- Gate execution: require a proposed fix and validation plan before edits.
Prompt templates
- Codebase audit: “Audit
<area/app>. Identify misplaced logic, coupling, and cleanliness. List top issues with suggested reorganizations. No code changes.”
- Fragile change guardrails: “This area is critical. Before editing, restate current behavior, dependencies, and risks. Propose a minimal-change fix and tests. Wait for approval.”
- Performance sweep: “Scan
<component/service> for perf bottlenecks (redundant calls, render hotspots, asset size). Rank issues and propose fixes. No edits.”
- Error loop breaker: “We’re stuck re-running an error. Give likely causes, what evidence to gather, and a step-by-step isolation plan. Pause for my pick.”
Sample flows
- Stuck in error loop: ask for hypotheses → request needed logs/files → choose a fix path → run targeted tests.
- Feature not working right: have it trace the flow, list invariants, and propose minimal fixes with before/after behavior.
- UI disappeared: ask for DOM/state inspection steps, recent diffs to check, and a rollback/redo plan.
Validation asks
- Require specific tests (unit, integration, manual steps) per proposed fix.
- Ask for rollback plan if the fix regresses behavior.
- Have the assistant restate expected behavior after the change.