docs/mcp-agent-rules.mdx
Trigger.dev agent rules are comprehensive instruction sets that guide AI assistants to write optimal Trigger.dev code. These rules ensure your AI assistant understands best practices, current APIs, and recommended patterns when working with Trigger.dev projects.
<Note> Agent Rules are one of three AI tools we provide. You can also install [Skills](/skills) for portable cross-editor instruction sets or the [MCP Server](/mcp-introduction) for live project interaction. See the [comparison table](/building-with-ai#skills-vs-agent-rules-vs-mcp) for details. </Note>Install the agent rules with the following command:
npx trigger.dev@latest install-rules
We provide five specialized rule sets, each optimized for different aspects of Trigger.dev development:
| Rule set | Tokens | Description | GitHub |
|---|---|---|---|
| Basic tasks | 1,200 | Essential rules for writing basic Trigger.dev tasks and fundamental patterns | View |
| Advanced tasks | 3,000 | Comprehensive rules for complex workflows, error handling, and advanced task patterns | View |
| Scheduled tasks | 780 | Specialized guidance for cron jobs, scheduled workflows, and time-based triggers | View |
| Configuration | 1,900 | Complete guide for trigger.config.ts setup, environment configuration, and project structure | View |
| Realtime | 1,700 | Using Trigger.dev Realtime features and frontend integration patterns | View |
For Claude Code users, we provide a subagent called trigger-dev-expert that's an expert at writing well-structured Trigger.dev code.
The subagent is available as an option when running the rules installation command. Select "Claude Code" as your client and choose to include the subagent when prompted.
Activate the subagent in your prompts by requesting it explicitly:
use the trigger-dev-expert subagent to create a trigger.dev job that accepts a video url, processes it with ffmpeg to extract the audio, runs the audio through a text-to-speech API like openai, and then uploads both the transcription and the audio to s3
The subagent works best when combined with the appropriate rule sets installed alongside it, providing both high-level architectural guidance and detailed implementation knowledge.
The Trigger.dev rules work across a wide range of AI coding assistants and editors:
| Client | Rule activation | Docs |
|---|---|---|
| Cursor | Automatic when working in trigger directories | Link |
| Claude Code | Context-aware activation + custom subagent | Link |
| VSCode Copilot | Integration with GitHub Copilot chat | Link |
| Windsurf | Automatic activation in Trigger.dev projects | Link |
| Gemini CLI | Command-line integration | Link |
| Cline | Automatic context detection | Link |
| Sourcegraph AMP | Code intelligence integration | Link |
| Kilo | Custom rule integration | Link |
| Ruler | Rule management | Link |
| AGENTS.md | Universal format for OpenAI Codex, Jules, OpenCode, etc. |
Different AI tools handle rules differently:
trigger.config.ts is detectedTrigger.dev rules are regularly updated to reflect new features, API changes, and best practices. The CLI includes automatic update detection.
When running npx trigger.dev@latest dev, you'll receive notifications when newer rule versions are available with a simple update command.
Update rules anytime with:
npx trigger.dev@latest install-rules
The update process replaces existing rules without creating duplicates, keeping your configuration files clean and organized.
npx trigger.dev@latest install-rules
Follow the prompts to install the rules for your AI client.
Consider installing the trigger-dev-expert subagent if using Claude Code.