Using AI Agents in Cursor: Rules, Context, and Review

By Darus S Alfatah · 2025-09-09 · Tutorial · 6 menit

Using AI Agents in Cursor: Rules, Context, and Review

Author note: We give Cursor a short project rule so its suggestions match our code style.

Why Rules Matter

An agent without project context guesses conventions. It invents naming styles, imports libraries you do not use, and writes tests in a framework you abandoned. A short rules file fixes most of this before it happens.

Write the rules once, keep them current, and treat them as part of the repository rather than personal notes.

Step-by-Step Workflow

  1. Add a rules file describing language, style, and test framework.
  2. Ask the agent to summarise the project structure first.
  3. Give one specific, verifiable task at a time.
  4. Review the diff before running tests.
  5. Run the build and test suite.
  6. Commit with a message explaining the change.
  7. Start a new session for the next unrelated task.

Keeping Context Small

Large context is expensive and dilutes attention. Reference only the files involved, and close unrelated tabs. When a task spans many files, describe the flow in words instead of attaching everything.

Review Discipline

Read every change. Pay attention to error handling, database queries, and configuration, where plausible mistakes hide. If a diff is too large to review carefully, ask for it to be split.

When to Stop

If three attempts fail on the same task, stop and restructure. Repeated failures usually mean the task is too broad or the code is too tangled for the agent to navigate, and continuing simply burns tokens.

Frequently Asked Questions

Should the agent commit? Let it prepare changes; commit yourself after review.

How large should tasks be? Small enough that the diff can be read in a few minutes.

Do rules really help? Yes; they reduce style churn more than any prompt trick.

What about secrets? Never give the agent production credentials.

How do I measure benefit? Track review time and defects, not just typing speed.

Conclusion

Agents accelerate mechanical work when the project has clear rules and tasks stay small. The review step is what keeps the speed-up from becoming technical debt.

Working With Tests

Ask the agent to write tests first, review them for coverage of edge cases, then request the implementation. This order makes the acceptance criteria explicit and prevents the agent from inventing behaviour that was never asked for.

If the project has few tests, spend one session adding them around the module you are about to change. It is the highest-leverage preparation before delegating work to an agent.

Documentation of Changes

Require a short summary per change: what was modified, why, and what was verified. When something breaks two weeks later, that note is the fastest path to the cause. It also slows down careless edits, since the agent must state its intent.

Team Adoption

Share the rules file and a short guide with the team. When everyone uses the same conventions, agent output becomes predictable and review faster. Revisit the guide monthly as the project evolves.

Track two numbers after adoption: time to review and defects found after merge. If review time grows faster than coding time shrinks, tasks are too large and should be split.

An example project rule: A short rule like use TypeScript, avoid new dependencies, and keep comments short keeps suggestions aligned with the team style.

Frequently Asked Questions

Can beginners follow this tutorial?

Yes. The steps are explained in order with code examples, suitable for beginners and experienced developers alike.

Is BankAI’s endpoint compatible with the library I already use?

Yes, BankAI is 100% OpenAI-compatible, so libraries such as the OpenAI SDK and LangChain work without code changes beyond the Base URL and API key.

Where do I get an API key to follow this tutorial?

You get the API key (and Secret Token) after registering and completing payment in the BankAI dashboard.

Sources & References

About the author

Darus S Alfatah — Founder & Writer

Darus S Alfatah is the founder of BankAI. He builds and operates the LLM API gateway that serves Indonesian developers, and writes about LLM integration, gateway architecture, and using AI practically and cost-effectively. Every guide is tested in a real environment — including code, configuration, and token calculations — before it is published, and updated when provider documentation or pricing changes.

Editorial policy

Related articles

🚀 Ready to Use the All-in-One API Key?

Sign up, top up with QRIS, and start building with ChatGPT, Claude, DeepSeek and every other model through one key.

🔑 SIGN UP NOW · Pricing