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
`AGENTS.md` is the primary file AI agents read when starting a session. It contains workspace instructions, operational guidelines, documentation listings, and your project-specific content. This workspace auto-generates it from a Jinja2 template so that it stays in sync with your configuration and agent docs.
4
+
5
+
## Why auto-generate?
6
+
7
+
A manually maintained `AGENTS.md` falls out of sync as you add agent docs, enable/disable features, or change workspace structure. Auto-generation ensures the file always reflects the current state:
8
+
9
+
-**Agent docs listing** -- Automatically updated when you add, remove, or edit docs in `agent-docs/`
10
+
-**Feature sections** -- Skills and commands sections appear only when those features are enabled and have content
11
+
-**Consistent structure** -- Workspace-level instructions (submodule workflow, pre-commit, temporary files) are maintained in the template, separate from your project-specific content
12
+
13
+
## Writing your instructions
14
+
15
+
Edit `AGENTS.project.md` at the repo root. This is where you write your own instructions and context for AI agents -- the same kind of content you'd normally put in a regular `AGENTS.md`:
16
+
17
+
```markdown
18
+
## Project Overview
19
+
Brief description of what this project does.
20
+
21
+
## Key Concepts
22
+
-**Term 1** -- Definition
23
+
-**Term 2** -- Definition
24
+
25
+
## Repository Structure
26
+
-`repositories/backend/` -- Go API server
27
+
-`repositories/frontend/` -- React web app
28
+
```
29
+
30
+
This content is injected into the generated `AGENTS.md` under a "Project-Specific Context" heading. The file ships with `<placeholder>` tags -- remove them when adding your content (the placeholder content is ignored during generation).
31
+
32
+
## Instruction priority with submodule repositories
33
+
34
+
Each repository under `repositories/` may have its own `AGENTS.md` (or `CLAUDE.md`) with repo-specific instructions. The generated workspace `AGENTS.md` instructs agents to:
35
+
36
+
1.**Read and follow submodule instructions** -- Agents read the submodule's `AGENTS.md` and `README.md` before making changes, and follow repo-specific conventions, commands, and boundaries
37
+
2.**Workspace takes priority on conflicts** -- If a submodule instruction conflicts with the workspace-level `AGENTS.md`, the workspace instruction wins. This covers workspace-wide concerns like submodule workflow, package management, pre-commit, and documentation systems
38
+
39
+
This means submodule `AGENTS.md` files don't need to repeat workspace-level instructions, and teams can maintain repo-specific conventions without worrying about conflicts.
40
+
41
+
## Regeneration
42
+
43
+
`AGENTS.md` is regenerated automatically on every pre-commit run. You can also regenerate it manually:
44
+
45
+
```bash
46
+
# Via pre-commit (also runs all other hooks)
47
+
uv run pre-commit run --all-files
48
+
49
+
# Directly (only runs workspace alignment)
50
+
uv run .ai-workspace/scripts/align-workspace.py
51
+
```
52
+
53
+
!!! warning "Do not edit AGENTS.md directly"
54
+
55
+
Any manual edits to `AGENTS.md` will be overwritten on the next pre-commit run.
56
+
57
+
Edit `AGENTS.project.md` for your instructions, or [modify the template](#modifying-the-template-advanced) to change workspace-level structure.
58
+
59
+
## Modifying the template (advanced)
60
+
61
+
!!! warning
62
+
63
+
The template controls core workspace functionality -- agent docs integration, feature-gated sections, submodule workflow instructions, and more. Incorrect modifications can break these features.
64
+
65
+
Only modify the template if you understand how the workspace uses it.
66
+
67
+
The [Jinja2](https://jinja.palletsprojects.com/en/stable/templates/) template at `.ai-workspace/templates/AGENTS.md.j2` defines the structure and workspace-level instructions of the generated `AGENTS.md`. Most users won't need to touch this file -- `AGENTS.project.md` covers project-specific customization. But if you need to change the workspace-level instructions themselves (reword guidelines, add new sections, remove parts that don't apply), you can edit the template directly.
68
+
69
+
### Available template variables
70
+
71
+
The template receives these variables during rendering:
72
+
73
+
`features.agent_docs.enabled`
74
+
: **Type:** bool -- Whether the agent docs feature is enabled
75
+
76
+
`features.agent_docs.docs`
77
+
: **Type:** list -- Agent doc entries (each has `display_name`, `description`, `when_to_read`, `doc_path`)
78
+
79
+
`features.skills.enabled`
80
+
: **Type:** bool -- Whether the skills feature is enabled
81
+
82
+
`features.skills.count`
83
+
: **Type:** int -- Number of validated skills
84
+
85
+
`features.commands.enabled`
86
+
: **Type:** bool -- Whether the commands feature is enabled
87
+
88
+
`features.commands.count`
89
+
: **Type:** int -- Number of validated commands
90
+
91
+
`project_content`
92
+
: **Type:** str or None -- Content of `AGENTS.project.md` (None if missing or placeholder)
93
+
94
+
!!! note "Template updates and upstream merges"
95
+
96
+
If you modify the template and later pull updates from the template upstream (see [Getting Started](getting-started.md#template-updates)), you may encounter merge conflicts in `AGENTS.md.j2`. Your customizations take priority, but review upstream changes for new features or improvements you might want to incorporate.
AI agents frequently produce transient artifacts during work -- design documents, investigation logs, intermediate outputs, and other files that don't belong in version control. The workspace provides a dedicated `.tmp/` directory for this, with a helper script that keeps it organized.
4
+
5
+
## How it works
6
+
7
+
The `.tmp/` directory is git-ignored (except for its `README.md` and `.gitkeep`). Agents create task-specific subdirectories to isolate artifacts from different tasks, preventing the directory from becoming a dumping ground of mixed files.
8
+
9
+
The generated `AGENTS.md` instructs agents to use this directory and follow the naming conventions below.
10
+
11
+
## Creating a task directory
12
+
13
+
Use the helper script to create a subdirectory:
14
+
15
+
```bash
16
+
uv run .ai-workspace/scripts/mktmpdir.py [name]
17
+
```
18
+
19
+
The script outputs the created path. If a named directory already exists, it returns the existing path.
20
+
21
+
### Naming strategy
22
+
23
+
The `name` argument controls how the directory is named:
24
+
25
+
1.**Work item ID (preferred)** -- Use the canonical identifier when working on tracked items
26
+
27
+
```bash
28
+
uv run .ai-workspace/scripts/mktmpdir.py JIRA-123
29
+
uv run .ai-workspace/scripts/mktmpdir.py gh-issue-456
30
+
uv run .ai-workspace/scripts/mktmpdir.py pr-789
31
+
```
32
+
33
+
2. **Descriptive name** -- When no work item ID exists, derive a name from the task
34
+
35
+
```bash
36
+
uv run .ai-workspace/scripts/mktmpdir.py fix-api-timeout-retry-logic
37
+
```
38
+
39
+
Include distinguishing details -- `fix-api-timeout-retry-logic` rather than `api-fix`.
40
+
41
+
3. **Random (default)** -- Omit the name for exploratory or throwaway work
42
+
43
+
```bash
44
+
uv run .ai-workspace/scripts/mktmpdir.py
45
+
# Creates: .tmp/20260208-a3f7
46
+
```
47
+
48
+
Generates a `YYYYMMDD-xxxx` directory (date + random hex).
49
+
50
+
## Subtask coordination
51
+
52
+
When an agent delegates work to subtasks, passing the directory path keeps all related artifacts together:
53
+
54
+
- **Delegating subtasks** -- Pass the `.tmp/` subdirectory path so subtask output lands in the same place
55
+
- **Coordinating multiple subtasks** -- Create the shared subdirectory before delegating, then pass its path to all subtasks
Copy file name to clipboardExpand all lines: .ai-workspace/docs/features/tool-discovery.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,9 @@ Tool Discovery detects installed CLI tools on your system and tells AI agents ab
4
4
5
5
!!! info "Requires hook support"
6
6
7
-
Tool discovery context is injected via session hooks, which currently work with [Claude Code](https://code.claude.com/docs/en/hooks) and [OpenCode](https://opencode.ai/docs/plugins/). Other tools can still use the workspace but won't receive automatic tool discovery context.
7
+
Tool discovery context is injected via session hooks, which currently work with [Claude Code](https://code.claude.com/docs/en/hooks) and [OpenCode](https://opencode.ai/docs/plugins/).
8
+
9
+
Other tools can still use the workspace but won't receive automatic tool discovery context.
8
10
9
11
## How it works
10
12
@@ -73,10 +75,11 @@ In `ai-workspace.toml`:
73
75
show_unavailable = false
74
76
```
75
77
76
-
| Value | Behavior |
77
-
|-------|----------|
78
-
| `false` (default) | Only tools found on PATH are shown to agents |
79
-
| `true` | All defined tools are shown with availability status. Useful when you want agents to know what they *could* use if installed. |
78
+
`false`(default)
79
+
: Only tools found on PATH are shown to agents
80
+
81
+
`true`
82
+
: All defined tools are shown with availability status. Useful when you want agents to know what they *could* use if installed.
Copy file name to clipboardExpand all lines: .ai-workspace/docs/getting-started.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,11 @@ Click **"Use this template"** on GitHub to create a new repository. This gives y
24
24
25
25
!!! note "Why not clone or fork?"
26
26
27
-
**Cloning** gives you the template's full git history and a remote pointing to the original -- that's not what you want for your own workspace. **Forking** is for contributing back to the template, not for building your own project on top of it. The **"Use this template"** button creates a fresh repo that's entirely yours.
27
+
**Cloning** gives you the template's full git history and a remote pointing to the original -- that's not what you want for your own workspace.
28
+
29
+
**Forking** is for contributing back to the template, not for building your own project on top of it.
30
+
31
+
The **"Use this template"** button creates a fresh repo that's entirely yours.
0 commit comments