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.
💬 Prompts
- 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.
- Prompt Engineering Techniques
- Prompt Engineering Techniques
- GPT-4.1 Prompting Guide - OpenAI Cookbook
- Here’s how to get ChatGPT to stop being an overly flattering yes man : ChatGPT
Examples
- https://github.com/olimorris/codecompanion.nvim/blob/de312b952235a5e2ab9355b0fcbfdbbd5fafa5cf/lua/codecompanion/config.lua#L1008-L1039
- https://github.com/CopilotC-Nvim/CopilotChat.nvim/blob/75653259442a8eb895abfc70d7064e07aeb7134c/lua/CopilotChat/config/prompts.lua#L1-L31
- https://github.com/yingmanwumen/nvim/blob/8e25d926f8e011ca65cd2c65aeaab8f912a4eb17/lua/plugins/ai/codecompanion/system_prompt.lua
- https://majesticlabs.dev/blog/202502/rules_for_ai.txt
- https://dev.to/dpaluy/mastering-cursor-rules-a-developers-guide-to-smart-ai-integration-1k65
- https://stal.blogspot.com/2025/04/prompt-engineering-techniques.html
🦮 Guiding the LLM
Guiding the Coding Assistant towards satisfactory outcomes is therefore of ever-growing importance in our daily work.
So far, I’ve identified three 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.
- 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
- 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
📏 Convention
Some example:
# Coding pattern preference
- Always prefer simple solution.
- Avoid duplication of code whenever possible, which means checking for other areas of the codebase that might already have similar code and functionality.
- Write code that takes into account the different environments: dev, test and prod.
- You are careful to only make changes that are requested or you are confident you understood well to the topics related to the change being requested.
- When fixing an issue or bug, do not introduce a new pattern or technology without first exhausting all options for the existing implementation. And if you finally do this, make sure to remove the old implementation afterwards so we don't have duplicate logic.
- Keep the codebase very clean and organized.
- Avoid writing scripts in files if possible, especially if the script is likely only to be run once.
- Avoid having files over 200-300 lines of code. Refactor at that point.
- Mocking data is only needed for tests, never mock data for dev or prod.
- Never add stubbing or fake data patterns to code that affects the dev or prod environments.
- Never overwrite my .env file without first asking and confirming.
# Coding workflow preferences
- Focus on the areas of code relevant to the task.
- Do not touch code that is unreleated to the task
- Write through tests for all major functionality.
- Avoid making major changes to the patterns and architecture of how a feature works, after it has shown to work well, unless explicitly instructed.
- Always think about what other methods and areas of code might be affected by code changes.
- 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
🔬 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.