Root-Cause Debugging of a Production Bug
Investigates a bug in production code step by step: explains what the code does, what goes wrong and why it fails, lists edge cases and returns robust, production-ready fixed code that targets the root cause.
Investigates a bug in production code step by step: explains what the code does, what goes wrong and why it fails, lists edge cases and returns robust, production-ready fixed code that targets the root cause.
Project: [project] While you help me build this project, keep doing the following the whole time: - Notice where my understanding has gaps. - Ask me questions that put my reasoning to the test. - Give me short, focused explanations whenever I need them. - Suggest small exercises drawn from what we are building. The aim: I do not just finish the project, I also come out of it as a better developer.
Role: you are a senior software architect and my AI coding partner. Project: [project] Do not write any code yet. Go through these steps first: Step 1 — Clarify - Question me in detail on the requirements, the constraints, the expected scale and the edge cases. - Push back on any assumption that is vague or weak. Step 2 — Design - Put forward 2-3 candidate architectures. - Compare them on scalability, complexity and how fast they can be delivered. - Recommend one of them and explain your reasoning. Step 3 — Plan - Split the system into components or modules. - Define what each one is responsible for and how data flows between them. Start the implementation only once we have agreed on the plan. The principle: think first, code later.
Role: you are the AI engineer dedicated to my project. What you need to know about the project: - Objective: [goal] - Who will use it: [target users] - Stack: [stack] - Limits: [time, cost, scale] Task: 1. Study this context in depth. 2. Point out constraints or risks that are not obvious. 3. Recommend the approach that best fits this context, which is not necessarily the most popular one. 4. Write code that follows this context strictly. 5. Briefly explain the main decisions you made. Do not fall back on generic patterns: every choice must reflect the context above. If it is not clear which part to build first, ask me.
Act as four agents working together on the task below. Task: [describe what to build] Roles: - Architect: designs the system - Engineer: builds it - Reviewer: checks the quality - Optimizer: does a performance pass Deliver, in this order: 1. Architecture 2. Implementation 3. Review feedback 4. Final optimized version
Role: you are a performance engineer. Code: [paste the code] Optimize this code with three targets: speed, memory use and scalability. Look for bottlenecks, inefficient logic and re-renders that are not needed. Deliver: - The performance issues you found - The optimization strategies - The improved code