ai tips
💸 Cost saving
Using ai models with APIs can be expensive and cost you > 300€/month, if you are not careful.
-
Switch models while coding.
-
Use smaller prompts.
-
Cancel subscriptions.
-
Consolidate to on LLM router service.
💬 prompt engineering
- To have faster responses and lower token usage, add urgency in your prompt for models having the “thinking” feature.
- ⚠️ Might not work on all models
- E.g. Groq.
Your response is time critical, get to an answer as quickly as possible. Think as little as possible. If you keep getting the same answer while thinking, stop thinking and provide the final answer. {your_prompt}
- Ask the LLM if it has questions to better clarify the project.
7 keys prompt engineering techniques
src: Claude 3 slides
- User / Assistant role formatting
- Be clear and direct
- Number & list the instructions step by step for complex tasks
- Ex: “Write a haiku about robots” ⇒ “Write a haiku about robots. Skip the preamble; go straight into the poem.”
- Assign roles (aka role prompting)
- Assigning roles changes the LLM’s response in 2 ways:
- changes tone and demeanor to match the specified role
- improves LLM’s accuracy in certain situations
- Ex: “You are a master of …”
- Assigning roles changes the LLM’s response in 2 ways:
- Use XML tags
- Using XML tags helps LLM (especially Claude) understand the prompt’s structure
- Use structured prompt templates
- Think of prompts like functions in programming - separate the variables from the instructions
- wrap variables in XML tags as good organization practice
- More structured prompt templates allow for:
- easier editing of the prompt itself
- much faster processing of multiple datasets
- Think of prompts like functions in programming - separate the variables from the instructions
I will tell you the name of an animal. Please respond with the noise that animal makes.
<animal>{{ANIMAL}}</animal>
- Prefill LLM’s response
Please write a haiku about a cat. Use JSON format with the keys as "first_line", "second_line", and "third_line".
{
- Have LLM think step by step
- Increases intelligence of responses but also increases latency by adding to the length of the output.
- Use examples (aka n-shot prompting)
- Single most effective tool for getting the LLM behave as desired.
Advanced prompt engineering
- Chaining prompts
- For tasks with many steps, you can break the task up and chain together the LLM’s responses
- Ask for rewrites
- Long context prompting
- When dealing with long documents, puts the doc before the details and query
- Have LLM find relevant quotes first before answering, and to answer only if it finds relevant quotes
- Have LLM read the document carefully because it will be asked questions later
- Longform input data MUST be in XML tabs so it’s clearly separated from the instructions
You are a master copy editor. Here's a draft document for you to work on:
<doc>
{{DOCUMENT}}
</doc>
Please thoroughly edit this document, assessing and fixing grammar and spelling as well as making suggestions for where the writing could be improved. Improved writing in this case means:
1. More reading fluidity and sentence variation
2. ...I'm going to give you a document.
Read the document carefully, because I'm going to ask you a question about it.
Here's the document:
<document>{{TEXT}}</document>
First, find the quotes from the document that are most relevant to answering the question, and then print them in numbererd order. Quotes should be relatively short. If there are no relevant quotes, write "No relevant quotes" instead.
Then answer the question, starting with "Answer:". Do not include or reference quotes content verbatim in the answer. Don't say "According to Quote[1]" when answering. Instead, make references to quotes relevant to each section of the answer solely by adding their bracketed numbers at the end of relevant sentences.
Thus, the format of your overall response should look like what's shown between the <examples></examples> tags. Make sure to follow the formatting and spacing exactly.
<examples>
[Examples of question + answer pairs using parts of the given document, with answers written exactly like how the LLM's output should be structured]
</examples>
If the question cannot be answered by the document, say so.
Here is the first question: {{QUESTION}}🦮 Guiding the LLM
Guiding the Coding Assistant towards satisfactory outcomes is therefore of ever-growing importance in our daily work.
3 critical measures that are required to work successfully in an AI-assisted coding setup:
- Well-structured Requirements: defines the destination.
- Tool-based Guard Rails: ensure we take the most direct route towards the destination.
- File-based Keyframing: create near-empty stub files, and the LLM can take over.
📜 References
- Senior Developer Skills in the AI Age: Leveraging Experience for Better Results
- Here’s how I use LLMs to help me write code
- Explore, expand, exploit
- LLM Agents are simply Graph — Tutorial For Dummies
- 2019-12-19 - Building Effective AI Agents \ Anthropic
- 2025-03-03 - From Design doc to code: the Groundhog AI coding assistant (and new Cursor vibecoding meta)
- 2025-02-16 - My LLM codegen workflow atm - Harper Reed’s Blog
- 2025-05-08 - Basic Claude Code - Harper Reed’s Blog
- 2025-05-15 - Amp is now available. Here’s how I use it.
- 2025-05-21 - Practical AI techniques for daily engineering work
- 2025-06-07 - Field Notes From Shipping Real Code With Claude
- 2025-06-08 - How I program with Agents
- 2025-06-12 - Don’t Build Multi-Agents
- 2025-06-20 - how i bring the best out of claude code - part 2
- 2025-06-23 - Context Engineering for Agents
- 2025-06-25 - How I keep up with AI progress (and why you must too)
- 2025-06-26 - How to Fix Your Context
- 2025-06-30 - Developing with GitHub Copilot Agent Mode and MCP
- 2025-07-13 - Context Engineering: Bringing Engineering Discipline to Prompts
- 2025-07-14 - Context Rot: How Increasing Input Tokens Impacts LLM Performance
- 2025-07-21 - The 3P Architecture: A Deep Dive into Software Agent Design (with Manus AI)
- Six principles for Production AI agents
- 2025-07-28 - AI for Coding: Why Most Developers Get It Wrong (2025 Guide)
- 2025-07-29 - Mastering agentic workflows with ADK: the recap
- 2025-08-08 - AI must RTFM: Why technical writers are becoming context curators
- 2025-08-14 - A persona-based approach to AI-assisted software development
- 2025-08-23 - Double your Productivity at Work using these 3 GenAI Prompt Strategies
- 2025-09-04 - Vibe Coding Our Way to Disaster
- 2025-09-15 - The quality of AI-assisted software depends on unit of work management
- 2025-09-24 - humanlayer/advanced-context-engineering-for-coding-agents
- 2025-09-30 - Which Table Format Do LLMs Understand Best?
- 2025-10-09 - Superpowers: How I’m using coding agents in October 2025
- 2025-10-14 - Just Talk To It - the no-bs Way of Agentic Engineering
- 2025-10-15 - Understanding Spec-Driven-Development: Kiro, spec-kit, and Tessl
- 2025-11-02 - What if you don’t need MCP at all?
📏 Convention
- Writing Cursor Rules with a Cursor Rule
- Claude Code Best Practices - Anthropic
- How I use Cursor (+ my best tips)
- I use Cursor daily - here’s how I avoid the garbage parts
- You are using Cursor AI incorrectly…
- Literate Development: AI-Enhanced Software Engineering
- Senior Developer Skills in the AI Age: Leveraging Experience for Better Results
- AI Blindspots
🤖 Agentic
- Design Patterns for Agentic AI and (Multi) AL Agents
- Claude Code Best Practices
- GPT-4.1 Prompting Guide
- Use some framework to build the agent , e.g. Pocket Flow.
- EnzeD/vibe-coding
- VIBE CODING - The Ultimate Guide with Resources
- LLMs are mirrors of operator skill
- 2025-06-12 - Agentic Coding Recommendations
- 2025-06-18 - Parallelizing AI Coding Agents
- 2025-07-29 - Mastering agentic workflows with ADK: the recap
Frameworks
- BMAD-METHOD: Breakthrough Method for Agile Ai Driven Development
- The AI framework that adds the engineering to prompt engineering
🔬 Code exploration
- A Missing Mental Model: Why AI doesn’t Understand Codebases
- Promoted his tool Giga AI to help LLM with less hallucination by creating project maps.
- How Windsurf Breaks Through the Celling for Retrieval
- Rerankers and Two-Stage Retrieval