import { Cards, Card } from 'fumadocs-ui/components/card'; import { Callout } from 'fumadocs-ui/components/callout'; import { Tabs, Tab } from 'fumadocs-ui/components/tabs'; import { Steps, Step } from 'fumadocs-ui/components/steps'; import { Files, Folder, File } from 'fumadocs-ui/components/files';
AI Development Guides Setup Guide
This guide will help you install and configure Motia's AI Development Guides in your project. These guides are designed to work with any AI tool or IDE—including Cursor, VS Code, Claude, ChatGPT, and more.
Prerequisites
npx motia@latest create
Installation Methods
<Tabs items={["CLI (Recommended)", "Manual Setup", "Git Submodule"]}>
bash npx motia@latest create my-motia-app cd my-motia-app
bash npx motia@latest rules pull
This will create the following in your project root:
- AGENTS.md – Universal AI guide for ANY AI tool or IDE
- CLAUDE.md – Claude-specific guide with advanced techniques
- .cursor/rules/ – IDE-specific patterns for Cursor
- .claude/ – Claude IDE configurations and commands
bash mkdir -p .cursor/rules
# Copy Cursor IDE rules
cp -r node_modules/motia/dist/dot-files/.cursor/rules/* .cursor/rules/
# Copy AI development guides to project root
cp node_modules/motia/dist/dot-files/AGENTS.md ./AGENTS.md
cp node_modules/motia/dist/dot-files/CLAUDE.md ./CLAUDE.md
# Copy Claude IDE configurations
cp -r node_modules/motia/dist/dot-files/.claude ./.claude
```
> **Important:** Only copy `.mdc` rule files into `.cursor/rules/`.
> **CLAUDE.md** should be in your project root, **not** inside `.cursor/rules/`.
</Step>
<Step>
### Or download from GitHub
```bash
# Download and extract Motia repository
curl -L https://github.com/MotiaDev/motia/archive/main.zip -o motia.zip
unzip motia.zip
# Create directories
mkdir -p .cursor/rules
# Copy Cursor IDE rules
cp -r motia-main/packages/snap/dist/dot-files/.cursor/rules/* .cursor/rules/
# Copy AI development guides to project root
cp motia-main/packages/snap/dist/dot-files/AGENTS.md ./AGENTS.md
cp motia-main/packages/snap/dist/dot-files/CLAUDE.md ./CLAUDE.md
# Copy Claude IDE configurations
cp -r motia-main/packages/snap/dist/dot-files/.claude ./.claude
# Clean up
rm -rf motia.zip motia-main
```
> **Critical:** Do **not** place AGENTS.md or CLAUDE.md inside `.cursor/rules/`. They belong in project root.
> The `.claude` folder contains Claude IDE-specific configurations and should be in your project root.
</Step>
</Steps>
# Symlink Cursor IDE rules
ln -s ../.motia-source/packages/snap/dist/dot-files/.cursor/rules/* .cursor/rules/
# Copy AI development guides to project root
cp .motia-source/packages/snap/dist/dot-files/CLAUDE.md ./CLAUDE.md
cp .motia-source/packages/snap/dist/dot-files/AGENTS.md ./AGENTS.md
```
> **Important:** Do **not** symlink or copy AGENTS.md or CLAUDE.md into `.cursor/rules/`.
> These files should always be in your project root.
</Step>
<Step>
### Update AI guides and rules (when needed)
```bash
# Update submodule to latest version
git submodule update --remote
# Re-copy AI guides if they were updated
cp .motia-source/packages/snap/dist/dot-files/CLAUDE.md ./CLAUDE.md
cp .motia-source/packages/snap/dist/dot-files/AGENTS.md ./AGENTS.md
```
</Step>
</Steps>
Project Structure After Setup
After installation, your project should look like this:
Important:
- AGENTS.md and CLAUDE.md should be in your project root, not inside
.cursor/rules/.- The
.claudefolder should be in your project root and contains Claude IDE configurations.- Only
.mdcrule files go inside.cursor/rules/.
Configuration for Different AI Tools
Cursor IDE Setup
- Open your project in Cursor.
- Cursor will automatically detect the
.cursor/rules/directory and use the.mdcrule files for suggestions. - Reference AGENTS.md (in your project root) for universal patterns and guidance.
- Use CLAUDE.md for Claude-specific advanced techniques.
VS Code with GitHub Copilot
- Install the GitHub Copilot extension.
- Open AGENTS.md in VS Code to understand available patterns.
- Reference specific guides in your prompts to Copilot.
- Use CLAUDE.md patterns when working with Claude.
Claude AI Assistant
- Open CLAUDE.md (from your project root)—this is specifically designed for Claude.
- Copy relevant sections into your Claude conversations.
- Reference AGENTS.md for broader architectural guidance.
- Use the structured templates provided in CLAUDE.md.
ChatGPT or Other AI Tools
- Start with AGENTS.md—it's universal for all AI tools.
- Copy relevant patterns into your AI conversations.
- Reference specific Cursor rules (
.mdcfiles) as needed. - Adapt the patterns to your AI tool's prompt format.
Sharing AI Guides with Team Members
<Tabs items={["Git Commit", "Shared Drive", "NPM Package"]}>
# Commit with descriptive message
git commit -m "feat: add Motia AI development guides and Cursor rules
- AGENTS.md: Universal AI guide for all AI tools and IDEs
- CLAUDE.md: Claude-specific advanced techniques
- .cursor/rules/: IDE-specific patterns for Cursor
These guides enable one-shot complete backend development
using proven Motia architectural patterns."
# Push to your repository
git push origin main
```
**Benefits:**
- Automatic distribution to all team members
- Version control with your project
- No additional setup required for new developers
# Create setup script
cat > motia-ai-development-guide-v1.0.0/setup.sh << 'EOF'
#!/bin/bash
echo "Setting up Motia AI Development Guides..."
# Copy to current directory
cp AGENTS.md ./AGENTS.md
cp CLAUDE.md ./CLAUDE.md
cp -r .cursor ./ 2>/dev/null || mkdir -p .cursor && cp -r .cursor/rules .cursor/
echo "✅ AI guides installed successfully!"
echo "📖 Open AGENTS.md to get started"
EOF
chmod +x motia-ai-development-guide-v1.0.0/setup.sh
```
```javascript
// team-motia-guides/setup.js
const fs = require('fs');
const path = require('path');
console.log('🚀 Installing Motia AI Development Guides...');
// Copy AGENTS.md
if (fs.existsSync(path.join(__dirname, 'AGENTS.md'))) {
fs.copyFileSync(path.join(__dirname, 'AGENTS.md'), './AGENTS.md');
console.log('✅ AGENTS.md installed');
}
// Copy CLAUDE.md
if (fs.existsSync(path.join(__dirname, 'CLAUDE.md'))) {
fs.copyFileSync(path.join(__dirname, 'CLAUDE.md'), './CLAUDE.md');
console.log('✅ CLAUDE.md installed');
}
// Copy .cursor rules
const cursorSrc = path.join(__dirname, '.cursor');
if (fs.existsSync(cursorSrc)) {
const cursorDest = './.cursor';
if (!fs.existsSync(cursorDest)) {
fs.mkdirSync(cursorDest, { recursive: true });
}
fs.cpSync(cursorSrc, cursorDest, { recursive: true });
console.log('✅ Cursor rules installed');
}
console.log('');
console.log('🎉 Installation complete!');
console.log('📖 Open AGENTS.md to start building with AI');
```
Verification
Test that AI guides are set up correctly:
# Verify content (should not be empty)
wc -l AGENTS.md CLAUDE.md
```
# Count number of rule files
ls .cursor/rules/*.mdc | wc -l
```
# Test showing guides
npx motia@latest rules show agents
npx motia@latest rules show claude
# Test showing a specific rule
npx motia@latest rules show api-steps
```
# Verify no empty files
find .cursor/rules/ -name "*.mdc" -size 0
```