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
Copy file name to clipboardExpand all lines: README.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,12 +151,13 @@ Each of these would have a corresponding `.md` file with `task_name` in the fron
151
151
The tool assembles the context in the following order:
152
152
153
153
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.
154
-
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.
154
+
2.**Rule 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.
155
155
3.**Filtering**: If `-s` (include) flag is used, it parses the YAML frontmatter of each rule file to decide whether to include it. Note that selectors can only match top-level YAML fields (e.g., `language: go`), not nested fields.
156
156
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`.
157
-
5.**Parameter Expansion**: It substitutes variables in the task prompt using the `-p` flags.
158
-
6.**Output**: It prints the content of all included rule files, followed by the expanded task prompt, to standard output.
159
-
7.**Token Count**: A running total of estimated tokens is printed to standard error.
157
+
5.**Task Bootstrap Script**: For the task file found (e.g., `fix-bug.md`), it looks for an executable script named `fix-bug-bootstrap`. If found, it runs the script before processing the task file. This allows task-specific environment setup or data preparation.
158
+
6.**Parameter Expansion**: It substitutes variables in the task prompt using the `-p` flags.
159
+
7.**Output**: It prints the content of all included rule files, followed by the expanded task prompt, to standard output.
160
+
8.**Token Count**: A running total of estimated tokens is printed to standard error.
160
161
161
162
### File Search Paths
162
163
@@ -458,13 +459,17 @@ If you need to filter on nested data, flatten your frontmatter structure to use
458
459
459
460
### Bootstrap Scripts
460
461
461
-
A bootstrap script is an executable file that has the same name as a rule file but with a `-bootstrap` suffix. These scripts are used to prepare the environment, for example by installing necessary tools. The output of these scripts is sent to `stderr` and is not part of the AI context.
462
+
A bootstrap script is an executable file that has the same name as a rule or task file but with a `-bootstrap` suffix. These scripts are used to prepare the environment, for example by installing necessary tools. The output of these scripts is sent to `stderr` and is not part of the AI context.
If `jira-bootstrap` is an executable script, it will be run before its corresponding rule file is processed.
470
+
Bootstrap scripts are executed in the following order:
471
+
1. Rule bootstrap scripts run before their corresponding rule files are processed
472
+
2. Task bootstrap scripts run after all rules are processed but before the task content is emitted
468
473
469
474
**`.agents/rules/jira-bootstrap`:**
470
475
```bash
@@ -477,6 +482,14 @@ then
477
482
fi
478
483
```
479
484
485
+
**`.agents/tasks/fix-bug-bootstrap`:**
486
+
```bash
487
+
#!/bin/bash
488
+
# This script fetches the latest issue details before the task runs.
489
+
echo"Fetching issue information...">&2
490
+
# Fetch and prepare issue data
491
+
```
492
+
480
493
### Emitting Task Frontmatter
481
494
482
495
The `-t` flag allows you to include the task's YAML frontmatter at the beginning of the output. This is useful when the AI agent or downstream tool needs access to metadata about the task being executed.
0 commit comments