Why Use Cursor

Cursor simplifies AI agent development by reducing the feedback loop on AI-generated code. This enables faster iteration and provides an optimal balance between manual control and AI assistance.

What are Cursor Rules

Cursor Rules are custom instructions that tell Cursor how to work with your code. Agency has a predefined .cursorrules file that contains everything that Cursor needs to know in order to create agents with this framework.

Getting Started with Cursor

Follow these steps to create your first Agency using Cursor:

1

Enable Cursor Rules in Settings

First, you need to enable Cursor Rules in the Cursor IDE:

  • Open the Cursor IDE.
  • Go to Settings… > Cursor Settings.
  • Turn on the Rules for AI option. This allows you to use a .cursorrules file in your project.
2

Add The `.cursorrules` File to Your Project

The .cursorrules file contains the instructions that guide Cursor’s AI. To add it:

  • Download the .cursorrules file from the Agency Swarm repository.
  • Place the file in the main folder (root directory) of your project.
3

Open Cursor Composer

Cursor Composer allows you to create and modify multiple files in parallel.

  • Open Composer by pressing Cmd+I (macOS) or Ctrl+I (Windows/Linux).
4

Send Your First Prompt to Composer

Spend as much time as possible on your first prompt. This will save you a lot of time later. Make sure to include:

  • All agents that you want to create
  • All tools and APIs that the agents must use
  • Communication flows between your agents
5

Verify The Agency Structure

Sometimes Cursor forgets certain files or hallucinates the agency structure. Make sure to verify that:

  • All import statements are correct
  • requirements.txt file exists
  • agency.py file executes properly

If any of these are missing or not working, instruct composer to create them or fix the code.

6

Adjust the Tools

Run each tool file to make sure they work as expected. You will see the test cases that Cursor created at the bottom in if __name__ == "__main__" statements.

  • If any of the tools are not working, send the error message to composer and ask it to fix the code.
  • If you want to adjust the functionality of the tool, either use inline editing Cmd+K (macOS) or Ctrl+K (Windows/Linux) or send another message to composer.
  • If you are stuck, use Chat Cmd+L (macOS) or Ctrl+L (Windows/Linux) to ask questions and brainstorm alternative approaches. For example, ask “What other APIs can I use for this tool?”
7

Adjust the Agents

Verify the agent instructions and parameters are correct after adjustments. Actually think about instructions.

  • Use Chat or Inline Editing to adjust the instruction.md files to your needs.
  • Edit instructions manually and remove all boilerplate text.
  • Make sure each agent has access to all the new tools either by specifying tools_folder path or adding them in tools parameter.
8

Test Your Agency

Run agency.py file to see if it works.

  • Send a realistic task to your agency and see if it can complete it.
  • If it doesn’t work as expected, try to send additional messages with more details and see if it helps.
  • Use these extra messages to guide yourself on how to adjust the instructions, so it can complete it next time.
9

Repeat

Iterate on your agency by repeating the process until you are satisfied with the results.

Agent Development is an Iterative Process

Currently, agent development requires ongoing monitoring and adjustments to ensure desired performance. As larger and more advanced models become available, this process will become more streamlined.

Next Steps