Skip to content

Instantly share code, notes, and snippets.

@kishorek
Last active July 28, 2025 10:20
Show Gist options
  • Select an option

  • Save kishorek/b698af1e0e87ac55c3fb4140d84007a4 to your computer and use it in GitHub Desktop.

Select an option

Save kishorek/b698af1e0e87ac55c3fb4140d84007a4 to your computer and use it in GitHub Desktop.
Cursor Best Practices - Jul 2025

Cursor Best Practices

I’m using Cursor, so I’m wondering if I should go over best practices of using it first. This is to ensure as I work on my projects, I don’t get overwhelmed by complexity.


🔁 Before Using Cursor

  • Ask Claude to create a clear and detailed plan in Markdown:

    • Ask it to ask clarifying questions.
    • Let it critique and regenerate its own plan.
    • Add this to instructions.md for future reference.
  • Example Workflow:

    • I tell ChatGPT what I want to create.
    • Then I ask it to provide instructions for another AI which will do the coding.
    • I paste everything into the Cursor composer agent.
    • This adds a layer of planning and reduces coding issues.
  • When stuck, restart with clearer instructions (works better than debugging loops).

    • E.g. like charm after rewriting clear instructions.

⚙️ Use .cursorrules

  • Always present in AI context.
  • Tells AI broad rules (e.g., "Write tests first, then run tests and update code until tests pass").
  • See Cursor Directory for more examples.

🧪 Get Agent to Write Code Incrementally

Break code into small chunks of Edit-Test loops:

  1. Define a small task/feature.
  2. Write (or have AI write) a failing test.
  3. Instruct AI (Agent mode) to write the code to pass the test.
  4. Instruct AI to run the test.
  5. If test fails, AI analyzes and retries from step 3.
  6. Once the test passes, developer reviews changes.

🧠 Prompting Practices

  • Encourage Chain of Thought in your prompts.
  • If stuck:
    • Ask Cursor to write a report with all files, what they do, and the problem.
    • Ask Claude/ChatGPT to fix issues based on the report.

📂 Tools and Tips

  • Use GitIgnore.io to get scripts/configs grouped in one page. Use chatgpt to make it markdown-ingestible.
  • Context7.com or MCP for referring latest docs.
  • Use Git frequently. Avoid too many uncommitted changes.
  • Add files using @ to make context explicit. The longer the context, the better.
    • Start new chats when context gets too long.

🔄 Resync / Index Code Frequently

  • Use .cursignore to exclude irrelevant files.
  • Use /Reference on open editors to bring context quickly.
  • Notepads are frequently used prompts.

⚡️ YOLO Mode (Optional)

  • Enable to let the system write tests for you.
    • Tests: vitest, npm test, nr test, etc.
    • Also supports basic build commands: build, tsc, mkdir, touch, etc.

⚙️ Optional: System Prompt in “Rules for AI”

  • Keep answers concise and direct.
  • Suggest alternative solutions.
  • Avoid unnecessary explanations.
  • Prioritize technical details over generic advice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment