๐ฆ๐๐ผ๐ฝ ๐๐๐ธ๐ถ๐ป๐ด ๐๐ ๐๐ผ ๐๐ผ๐ฑ๐ฒ. ๐๐ถ๐๐ฒ ๐๐ ๐ฎ ๐ฅ๐๐น๐ฒ๐ ๐๐ถ๐น๐ฒ ๐๐ป๐๐๐ฒ๐ฎ๐ฑ.
AI coding tools are great. They write functions and find bugs. But most developers use them wrong.
They ask for big things like:
- Build me a dashboard.
- Fix this bug.
- Add authentication.
Then the AI sends a massive block of code. It looks good, but it breaks things. It touches files you did not mention. It invents functions that do not exist. It ignores your project structure.
The problem is not the AI. The problem is a lack of rules.
Stop writing bigger prompts. Start creating a rules file. Create a file named AI_RULES.md or AGENTS.md in your project root.
This file acts like onboarding for a new developer. It tells the AI how to behave.
A good rules file explains:
- Your project structure.
- Your coding style.
- Which files to never touch.
- How to handle errors.
- How to approach testing.
Do not use vague rules like "write clean code." Use specific rules like "reuse existing components before making new ones."
Use this workflow instead:
Set the rules. Add your AI_RULES.md file to your repo.
Ask for a plan. Before any code is written, ask the AI to explain its plan. Ask it to list the files it will change. If the plan is bad, stop it there.
Break tasks down. Small tasks create small diffs. Large tasks create messes. If a task feels too big, split it up.
Review like a human. Treat AI code like a pull request from a fast but messy junior developer. Check for:
- Unrelated file changes.
- Duplicated logic.
- Security risks.
- Missing error states.
The most important rule is this: If you do not understand the code, do not merge it.
AI helps you move faster, but it does not take away your responsibility. You are the owner of the codebase. Use rules to turn a random generator into a disciplined assistant.
Source: https://dev.to/thameemx/stop-asking-ai-to-code-give-it-a-rules-file-instead-2ca7
Optional learning community: https://t.me/GyaanSetuAi