Skip to content

Cursor Rules

AI Scaffolding provides special Cursor rules and configurations that enhance AI-assisted development when using the Cursor editor.

What are Cursor Rules?

Cursor rules help optimize the AI assistant in the Cursor editor for Web3 development. These rules:

  • Provide context about your project structure
  • Define specialized prompts for blockchain development
  • Guide the AI to give better, more relevant suggestions
  • Enhance code generation for Web3 patterns

Updating Rules

AI Scaffolding has built-in support for cursor rules. Based on the packages you've selected, it will automatically generate a set of cursor rules for your project.

Cursor rules are sourced from an external repository that you can configure using CLI commands.

Install AI Scaffolding

Ensure you have AI Scaffolding installed:

npm
npm install -g @appliedblockchain/ai-scaffolding
Update cursor rules

Use the cursor command to update rules:

Global Install
ai-scaffolding cursor

This will fetch the latest rules from the configured repository.

Verify installed version

To verify the installed version:

ai-scaffolding cursor -v

The cursor command is also available when using AI Scaffolding directly through the package manager.

npm
npx @appliedblockchain/ai-scaffolding cursor

Command Options

Options

The cursor command supports several options:

OptionDescription
-v, --versionShow current installed cursor rules version
-r, --repo <repo>Specify repository for one-time use
-b, --branch <branch>Specify branch for one-time use
-c, --cleanRemove all cursor rules
-d, --debugEnable debug mode for troubleshooting

Examples

Some examples of how to use the cursor command:

# Show current installed version
ai-scaffolding cursor -v
 
# Use a specific repository just for this update
ai-scaffolding cursor -r git@github.com:example/cursor-rules.git
 
# Use a specific branch
ai-scaffolding cursor -b develop

Configuration

You can customize the source of cursor rules through configuration settings:

View current configuration

Check the current cursor configuration:

ai-scaffolding config
Modify repository source

Change the source repository:

ai-scaffolding config set cursor.repo <your-repo-url>
Change branch

Specify a different branch for rules:

ai-scaffolding config set cursor.branch <your-branch>

Examples

Some examples of how to use the configuration command:

# Show current configuration
ai-scaffolding config
 
# Set a new repository
ai-scaffolding config set cursor.repo "git@github.com:example/cursor-rules.git"
 
# Set a new branch
ai-scaffolding config set cursor.branch "main"

Package Manager

The config command is also available when using AI Scaffolding directly through the package manager.

npm
npx @appliedblockchain/ai-scaffolding config

Customization

AI Scaffolding provides a powerful feature that allows cursor rules to be imported from an external repository. This gives you the flexibility to:

  • Maintain cursor rules tailored to your organization's specific coding standards
  • Store sensitive prompts or project-specific rules in private repositories
  • Track changes to your cursor rules with git versioning
  • Update rules in one place and distribute to all team members' projects

Creating Your Own Repository

If you want to create your own cursor rules repository, check out the Creating Cursor Rules Repositories.