2025-01-09

Getting AI Coding Assistants From OK To Great ⚙

Working with AI

I’ve been experimenting with AI coding tools to see if I could improve their effectiveness. My focus has been on training Cursor AI for a specific project I’m working on at RiseKit.

Here’s what I done so far:

✅ Rules and Templates

I created a rules file with project-specific coding standards, architecture patterns, testing guidelines, and documentation requirements.

💬 Pre-composed Prompts

These covered common tasks like code reviews, test writing, and generating documentation.

🔁 Stateful Prompts

For more complex, multi-step tasks, I built prompts that maintain context across sessions, ensuring consistency in longer operations.

The AI Composer updates the stateful prompt as the task progresses, sometimes with my direction, othertimes it will prompt me to confirm when a step appears complete.

🛠️ How I built the rules and templates

One of the most useful aspects was using AI itself to refine these rules and templates.

I started with a short paragraph of instructions on a topic, like coding standards, documenation, testing or implementation planning, and would ask the AI expand on the concept and come up with an AI optimized version of the rules.

I then iterated on a rule file. That involved some editing by myself and also asking the AI to analyze and improve the rules.

If the rules had to do with coding, I would ask it repeadly to analyze the code base for certain patterns regarding specific layers of the codebase like views, controllers, models, business rules, etc. If sensible patterns were missing, I would introduce one based on best practices. Coding examples are paired with the rules.

Don’t be shy with the instructions you give to the AI, you won’t frighten it or bore it to death. You’ll be turning it into a domain expert for your project and ideals.

This approach has worked well for a few established codebases. Refactoring becomes easier, and the AI performs better as the codebase becomes cleaner and more consistent.

Good code quality and documentation are just as important with AI tools as without, they rely on clear patterns to function effectively.

If the codebase is messy, the AI can get off track or produce a lot more inaccurate suggestions. But when you invest in training the tools and maintaining code quality, you create a positive feedback loop: each improvement makes the AI faster and more accurate.

AI coding assistants are not a replacement for good practices—they are a way to enhance them.

Working with AI

Working with AI

Working with AI