Brokk is very different than the typical VSCode based AI Coding agents like cursor etc. See Brokk: AI for Large (Java) Codebases.
Prompt Techniques for AI Code Assistants - @addyosmani
Technique | Prompt Template | Purpose |
---|---|---|
1. Role Prompting | “You are a senior {language} developer. Review this function for {goal}.” | Simulate expert-level code review, debugging, or refactoring |
2. Explicit Context Setup | “Here’s the problem: {summary}. The code is below. It should do {expected behavior}, but instead it’s doing {actual behavior}. Why?” | Frame the problem clearly to avoid generic, surface-level responses |
3. Input/Output Examples | “This function should return {expected output} when given {input}. Can you write or fix the code?” | Guide the assistant by showing intent through examples |
4. Iterative Chaining | “First, generate a skeleton of the component. Next, we’ll add state. Then handle API calls.” | Break larger tasks into steps to avoid overwhelming or vague prompts |
5. Debug with Simulation | “Walk through the function line by line. What are the variable values? Where might it break?” | Get the assistant to simulate runtime behavior and surface hidden bugs |
6. Feature Blueprinting | “I’m building {feature}. Requirements: {bullets}. Using: {tech stack}. Please scaffold the initial component and explain your choices.” | Kick off feature development with AI-led planning and scaffolding |
7. Code Refactor Guidance | “Refactor this code to improve {goal}, such as {e.g., readability, performance, idiomatic style}. Use comments to explain changes.” | Make AI refactors align with your goals, not arbitrary changes |
8. Ask for Alternatives | “Can you rewrite this using a functional style? What would a recursive version look like?” | Explore multiple implementation paths and expand your toolbox |
9. Rubber Ducking | “Here’s what I think this function does: {your explanation}. Am I missing anything? Does this reveal any bugs?” | Let the AI challenge your understanding and spot inconsistencies |
10. Constraint Anchoring | “Please avoid {e.g., recursion} and stick to {e.g., ES6 syntax, no external libraries}. Optimize for {e.g., memory}. Here’s the function:” | Prevent the AI from overreaching or introducing incompatible patterns |
