You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Find a task file with `task_name: fix-bug` in its frontmatter.
66
66
2. Find all rule files in the search paths.
67
67
3. Filter the rules based on selectors.
68
68
4. Execute any associated bootstrap scripts.
@@ -72,7 +72,7 @@ This command will:
72
72
73
73
### Example Tasks
74
74
75
-
The `<task-name>` is the name of the task you want the agent to perform. Here are some common examples:
75
+
The `<task-name>` is the value of the `task_name` field in the frontmatter of task files. Here are some common examples:
76
76
77
77
-`triage-bug`
78
78
-`review-pull-request`
@@ -82,7 +82,7 @@ The `<task-name>` is the name of the task you want the agent to perform. Here ar
82
82
-`remove-feature-flag`
83
83
-`speed-up-build`
84
84
85
-
Each of these would have a corresponding `.md` file in a `tasks` directory (e.g., `triage-bug.md`).
85
+
Each of these would have a corresponding `.md` file with `task_name` in the frontmatter (e.g., a file with `task_name: triage-bug`).
86
86
87
87
## How It Works
88
88
@@ -91,7 +91,7 @@ The tool assembles the context in the following order:
91
91
1.**Rule Files**: It searches a list of predefined locations for rule files (`.md` or `.mdc`). These locations include the current directory, ancestor directories, user's home directory, and system-wide directories.
92
92
2.**Bootstrap Scripts**: For each rule file found (e.g., `my-rule.md`), it looks for an executable script named `my-rule-bootstrap`. If found, it runs the script before processing the rule file. These scripts are meant for bootstrapping the environment (e.g., installing tools) and their output is sent to `stderr`, not into the main context.
93
93
3.**Filtering**: If `-s` (include) flag is used, it parses the YAML frontmatter of each rule file to decide whether to include it.
94
-
4.**Task Prompt**: It finds the task prompt file (e.g., `<task-name>.md`) in one of the search paths.
94
+
4.**Task Prompt**: It searches for a task file with `task_name: <task-name>` in its frontmatter. The filename doesn't matter. If selectors are provided with `-s`, they are used to filter between multiple task files with the same `task_name`.
95
95
5.**Parameter Expansion**: It substitutes variables in the task prompt using the `-p` flags.
96
96
6.**Output**: It prints the content of all included rule files, followed by the expanded task prompt, to standard output.
97
97
7.**Token Count**: A running total of estimated tokens is printed to standard error.
@@ -101,9 +101,9 @@ The tool assembles the context in the following order:
101
101
The tool looks for task and rule files in the following locations, in order of precedence:
102
102
103
103
**Tasks:**
104
-
-`./.agents/tasks/<task-name>.md`
105
-
-`~/.agents/tasks/<task-name>.md`
106
-
-`/etc/agents/tasks/<task-name>.md`
104
+
-`./.agents/tasks/*.md` (any `.md` file with matching `task_name` in frontmatter)
105
+
-`~/.agents/tasks/*.md`
106
+
-`/etc/agents/tasks/*.md`
107
107
108
108
**Rules:**
109
109
The tool searches for a variety of files and directories, including:
@@ -118,15 +118,49 @@ The tool searches for a variety of files and directories, including:
118
118
119
119
### Task Files
120
120
121
-
Task files are Markdown files that can contain variables for substitution.
121
+
Task files are Markdown files with a required `task_name` field in the frontmatter. The filename itself doesn't matter - only the `task_name` value is used for selection. Task files can contain variables for substitution and can use selectors in frontmatter to provide different prompts for the same task.
122
122
123
123
**Example (`.agents/tasks/fix-bug.md`):**
124
124
```markdown
125
+
---
126
+
task_name: fix-bug
127
+
---
125
128
# Task: Fix Bug in ${jira_issue_key}
126
129
127
130
Here is the context for the bug. Please analyze the following files and provide a fix.
128
131
```
129
132
133
+
**Example with selectors for multiple prompts (`.agents/tasks/deploy-staging.md`):**
134
+
```markdown
135
+
---
136
+
task_name: deploy
137
+
environment: staging
138
+
---
139
+
# Deploy to Staging
140
+
141
+
Deploy the application to the staging environment with extra validation.
142
+
```
143
+
144
+
**Example for production (`.agents/tasks/deploy-prod.md`):**
145
+
```markdown
146
+
---
147
+
task_name: deploy
148
+
environment: production
149
+
---
150
+
# Deploy to Production
151
+
152
+
Deploy the application to production with all safety checks.
0 commit comments