|
1 | 1 | --- |
2 | 2 | title: "Agent rules" |
| 3 | +description: "Trigger.dev agent rules are now agent skills, installed with the trigger.dev CLI." |
3 | 4 | sidebarTitle: "Agent rules" |
4 | | -description: "Install Trigger.dev agent rules to guide AI assistants toward correct, up-to-date code patterns." |
5 | 5 | --- |
6 | 6 |
|
7 | | -## What are Trigger.dev agent rules? |
8 | | - |
9 | | -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. |
10 | | - |
11 | 7 | <Note> |
12 | | - 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. |
| 8 | + Agent rules are now **agent skills**. The standalone rule files have been replaced by skills that |
| 9 | + work across every major AI assistant from a single install. See [Skills](/skills). |
13 | 10 | </Note> |
14 | 11 |
|
15 | | -## Installation |
16 | | - |
17 | | -Install the agent rules with the following command: |
18 | | - |
19 | | -```bash |
20 | | -npx trigger.dev@latest install-rules |
21 | | -``` |
22 | | - |
23 | | -## Available rule sets |
24 | | - |
25 | | -We provide five specialized rule sets, each optimized for different aspects of Trigger.dev development: |
26 | | - |
27 | | -| Rule set | Tokens | Description | GitHub | |
28 | | -|:---------|:-------|:------------|:------------| |
29 | | -| **Basic tasks** | 1,200 | Essential rules for writing basic Trigger.dev tasks and fundamental patterns | [View](https://github.com/triggerdotdev/trigger.dev/blob/main/rules/4.0.0/basic-tasks.md) | |
30 | | -| **Advanced tasks** | 3,000 | Comprehensive rules for complex workflows, error handling, and advanced task patterns | [View](https://github.com/triggerdotdev/trigger.dev/blob/main/rules/4.0.0/advanced-tasks.md) | |
31 | | -| **Scheduled tasks** | 780 | Specialized guidance for cron jobs, scheduled workflows, and time-based triggers | [View](https://github.com/triggerdotdev/trigger.dev/blob/main/rules/4.0.0/scheduled-tasks.md) | |
32 | | -| **Configuration** | 1,900 | Complete guide for trigger.config.ts setup, environment configuration, and project structure | [View](https://github.com/triggerdotdev/trigger.dev/blob/main/rules/4.0.0/config.md) | |
33 | | -| **Realtime** | 1,700 | Using Trigger.dev Realtime features and frontend integration patterns | [View](https://github.com/triggerdotdev/trigger.dev/blob/main/rules/4.0.0/realtime.md) | |
34 | | - |
35 | | -## Claude Code subagent |
36 | | - |
37 | | -For Claude Code users, we provide a subagent called `trigger-dev-expert` that's an expert at writing well-structured Trigger.dev code. |
38 | | - |
39 | | -### Installation |
40 | | - |
41 | | -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. |
42 | | - |
43 | | - |
44 | | - |
45 | | -### Usage |
46 | | - |
47 | | -Activate the subagent in your prompts by requesting it explicitly: |
48 | | - |
49 | | -```markdown |
50 | | -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 |
51 | | -``` |
52 | | - |
53 | | -The subagent works best when combined with the appropriate rule sets installed alongside it, providing both high-level architectural guidance and detailed implementation knowledge. |
54 | | - |
55 | | -## Supported AI clients |
56 | | - |
57 | | -The Trigger.dev rules work across a wide range of AI coding assistants and editors: |
58 | | - |
59 | | -| Client | Rule activation | Docs | |
60 | | -|:--------|:----------------|:--------------| |
61 | | -| **Cursor** | Automatic when working in trigger directories | [Link](https://docs.cursor.com/en/context/rules#rules/) | |
62 | | -| **Claude Code** | Context-aware activation + custom subagent | [Link](https://docs.anthropic.com/en/docs/claude-code) | |
63 | | -| **VSCode Copilot** | Integration with GitHub Copilot chat | [Link](https://code.visualstudio.com/docs/copilot/overview) | |
64 | | -| **Windsurf** | Automatic activation in Trigger.dev projects | [Link](https://docs.windsurf.com/windsurf/cascade/memories#rules) | |
65 | | -| **Gemini CLI** | Command-line integration | [Link](https://ai.google.dev/gemini-api/docs) | |
66 | | -| **Cline** | Automatic context detection | [Link](https://github.com/cline/cline) | |
67 | | -| **Sourcegraph AMP** | Code intelligence integration | [Link](https://sourcegraph.com/docs) | |
68 | | -| **Kilo** | Custom rule integration | [Link](https://kilocode.ai/docs/advanced-usage/custom-rules) | |
69 | | -| **Ruler** | Rule management | [Link](https://github.com/intellectronica/ruler) | |
70 | | -| **AGENTS.md** | Universal format for OpenAI Codex, Jules, OpenCode, etc. | | |
71 | | - |
72 | | -### Rule activation behavior |
73 | | - |
74 | | -Different AI tools handle rules differently: |
75 | | - |
76 | | -- **Automatic Activation**: Cursor, Windsurf, VSCode Copilot, and Cline automatically apply relevant rules when working in Trigger.dev projects or when `trigger.config.ts` is detected |
77 | | -- **Context-Aware**: Claude Code intelligently applies rules based on the current context and file types |
78 | | -- **Manual Integration**: AGENTS.md clients and others append rules to configuration files for manual activation |
79 | | - |
80 | | -## Keeping rules updated |
81 | | - |
82 | | -Trigger.dev rules are regularly updated to reflect new features, API changes, and best practices. The CLI includes automatic update detection. |
83 | | - |
84 | | -### Automatic update notifications |
85 | | - |
86 | | -When running `npx trigger.dev@latest dev`, you'll receive notifications when newer rule versions are available with a simple update command. |
87 | | - |
88 | | -### Manual updates |
89 | | - |
90 | | -Update rules anytime with: |
91 | | - |
92 | | -```bash |
93 | | -npx trigger.dev@latest install-rules |
94 | | -``` |
95 | | - |
96 | | -The update process replaces existing rules without creating duplicates, keeping your configuration files clean and organized. |
97 | | - |
98 | | -### Why updates matter |
99 | | - |
100 | | -- **Current API patterns**: Access the latest Trigger.dev APIs and features |
101 | | -- **Performance optimizations**: Benefit from improved patterns and practices |
102 | | -- **Deprecated pattern avoidance**: Prevent AI assistants from generating outdated code |
103 | | -- **New feature support**: Immediate access to newly released capabilities |
| 12 | +## What changed |
104 | 13 |
|
105 | | -## Getting started |
| 14 | +Trigger.dev used to install per-tool *rule files* (`.cursor/rules/trigger.*.mdc`, regions in `CLAUDE.md`, and so on) fetched from GitHub. That has been replaced by [agent skills](/skills): `SKILL.md` directories in the open [Agent Skills standard](https://agentskills.io) that ship inside the CLI, version-matched to the Trigger.dev version you build against, and load on demand instead of always sitting in your context. |
106 | 15 |
|
107 | | -1. Install the rules: |
| 16 | +The install command is the same, and now installs skills: |
108 | 17 |
|
109 | 18 | ```bash |
110 | | -npx trigger.dev@latest install-rules |
| 19 | +npx trigger.dev@latest skills |
111 | 20 | ``` |
112 | 21 |
|
113 | | -2. Follow the prompts to install the rules for your AI client. |
| 22 | +`npx trigger.dev@latest install-rules` still works as an alias, and `trigger dev` offers to install the skills on first run. |
114 | 23 |
|
115 | | -3. Consider installing the `trigger-dev-expert` subagent if using Claude Code. |
| 24 | +The old task and realtime guidance now lives in the `authoring-tasks` and `realtime-and-frontend` skills, alongside two new skills for building `chat.agent` AI agents. See [Skills](/skills) for the full list and supported assistants. |
116 | 25 |
|
117 | 26 | ## Next steps |
118 | 27 |
|
119 | 28 | <CardGroup cols={2}> |
120 | 29 | <Card title="Skills" icon="wand-magic-sparkles" href="/skills"> |
121 | | - Portable instruction sets that work across all AI coding assistants. |
| 30 | + Install Trigger.dev agent skills into your AI coding assistant. |
122 | 31 | </Card> |
123 | 32 | <Card title="MCP Server" icon="sparkles" href="/mcp-introduction"> |
124 | 33 | Give your AI assistant direct access to Trigger.dev tools and APIs. |
125 | 34 | </Card> |
126 | | - <Card title="Complete AI setup" icon="layer-group" href="/building-with-ai"> |
127 | | - See all AI tools and how they compare. |
| 35 | + <Card title="Building with AI" icon="layer-group" href="/building-with-ai"> |
| 36 | + See how skills and the MCP server compare. |
128 | 37 | </Card> |
129 | 38 | <Card title="Writing tasks" icon="code" href="/tasks/overview"> |
130 | | - Learn the task patterns that agent rules teach your AI assistant. |
| 39 | + Learn the task patterns that skills teach your AI assistant. |
131 | 40 | </Card> |
132 | 41 | </CardGroup> |
0 commit comments