@markjaquith/agency 1.11.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +313 -117
- package/cli.ts +124 -420
- package/index.ts +1 -1
- package/package.json +12 -17
- package/skills/agency/SKILL.md +266 -0
- package/src/cli.test.ts +290 -0
- package/src/commands/description.test.ts +103 -0
- package/src/commands/epic.test.ts +103 -0
- package/src/commands/epic.ts +101 -0
- package/src/commands/init.test.ts +42 -290
- package/src/commands/init.ts +15 -123
- package/src/commands/phase.ts +120 -0
- package/src/commands/pr.test.ts +19 -170
- package/src/commands/pr.ts +23 -179
- package/src/commands/repo.test.ts +80 -0
- package/src/commands/repo.ts +83 -0
- package/src/commands/status.test.ts +35 -477
- package/src/commands/status.ts +24 -213
- package/src/commands/task-phase.test.ts +206 -0
- package/src/commands/task.ts +83 -1285
- package/src/commands/validate.test.ts +91 -0
- package/src/commands/validate.ts +50 -0
- package/src/commands/work.test.ts +326 -399
- package/src/commands/work.ts +153 -153
- package/src/services/EpicService.test.ts +71 -0
- package/src/services/EpicService.ts +135 -0
- package/src/services/FileSystemService.ts +61 -92
- package/src/services/PhaseService.ts +323 -0
- package/src/services/PullRequestService.test.ts +386 -0
- package/src/services/PullRequestService.ts +143 -0
- package/src/services/RepositoryService.test.ts +106 -0
- package/src/services/RepositoryService.ts +159 -0
- package/src/services/TaskPhaseService.test.ts +217 -0
- package/src/services/TaskService.ts +192 -0
- package/src/services/WorkbaseService.test.ts +446 -0
- package/src/services/WorkbaseService.ts +493 -0
- package/src/services/WorktreeService.test.ts +599 -0
- package/src/services/WorktreeService.ts +357 -0
- package/src/test-utils.ts +41 -438
- package/src/types.ts +1 -215
- package/src/utils/command.ts +1 -5
- package/src/utils/effect.test.ts +24 -0
- package/src/utils/effect.ts +3 -273
- package/src/utils/process.test.ts +0 -15
- package/src/utils/process.ts +1 -60
- package/src/workbase/frontmatter.test.ts +50 -0
- package/src/workbase/frontmatter.ts +77 -0
- package/src/workbase/repository-reference.test.ts +25 -0
- package/src/workbase/repository-reference.ts +18 -0
- package/src/workbase/schemas.test.ts +146 -0
- package/src/workbase/schemas.ts +78 -0
- package/src/workbase/work-target.test.ts +77 -0
- package/src/workbase/work-target.ts +180 -0
- package/src/workbase/worktree-command.test.ts +61 -0
- package/src/workbase/worktree-command.ts +52 -0
- package/src/commands/base.test.ts +0 -198
- package/src/commands/base.ts +0 -198
- package/src/commands/clean.test.ts +0 -299
- package/src/commands/clean.ts +0 -274
- package/src/commands/completions.test.ts +0 -51
- package/src/commands/completions.ts +0 -308
- package/src/commands/emit.integration.test.ts +0 -549
- package/src/commands/emit.test.ts +0 -576
- package/src/commands/emit.ts +0 -700
- package/src/commands/emitted.test.ts +0 -226
- package/src/commands/emitted.ts +0 -57
- package/src/commands/loop.test.ts +0 -621
- package/src/commands/loop.ts +0 -406
- package/src/commands/merge.integration.test.ts +0 -195
- package/src/commands/merge.test.ts +0 -246
- package/src/commands/merge.ts +0 -244
- package/src/commands/pull.test.ts +0 -395
- package/src/commands/pull.ts +0 -205
- package/src/commands/push.test.ts +0 -641
- package/src/commands/push.ts +0 -482
- package/src/commands/rebase.test.ts +0 -521
- package/src/commands/rebase.ts +0 -232
- package/src/commands/save.test.ts +0 -247
- package/src/commands/save.ts +0 -162
- package/src/commands/source.test.ts +0 -195
- package/src/commands/source.ts +0 -72
- package/src/commands/switch.test.ts +0 -194
- package/src/commands/switch.ts +0 -84
- package/src/commands/task-branching.test.ts +0 -633
- package/src/commands/task-continue.test.ts +0 -311
- package/src/commands/task-edit.test.ts +0 -235
- package/src/commands/task-main.test.ts +0 -1066
- package/src/commands/task-squash.test.ts +0 -266
- package/src/commands/tasks.test.ts +0 -391
- package/src/commands/tasks.ts +0 -161
- package/src/commands/template-delete.test.ts +0 -178
- package/src/commands/template-delete.ts +0 -98
- package/src/commands/template-list.test.ts +0 -135
- package/src/commands/template-list.ts +0 -87
- package/src/commands/template-view.test.ts +0 -158
- package/src/commands/template-view.ts +0 -86
- package/src/commands/template.test.ts +0 -32
- package/src/commands/template.ts +0 -96
- package/src/commands/use.test.ts +0 -87
- package/src/commands/use.ts +0 -97
- package/src/constants.ts +0 -10
- package/src/errors.ts +0 -17
- package/src/schemas.ts +0 -33
- package/src/services/AgencyMetadataService.ts +0 -311
- package/src/services/ClaudeService.test.ts +0 -184
- package/src/services/ClaudeService.ts +0 -91
- package/src/services/ConfigService.ts +0 -115
- package/src/services/FilterRepoService.ts +0 -164
- package/src/services/FormatterService.test.ts +0 -432
- package/src/services/FormatterService.ts +0 -219
- package/src/services/GitService.ts +0 -1187
- package/src/services/MockFilterRepoService.ts +0 -140
- package/src/services/OpencodeService.ts +0 -263
- package/src/services/PromptService.ts +0 -183
- package/src/services/TemplateService.ts +0 -81
- package/src/types/native-exec.d.ts +0 -8
- package/src/utils/colors.ts +0 -178
- package/src/utils/git-path.ts +0 -6
- package/src/utils/glob.test.ts +0 -161
- package/src/utils/glob.ts +0 -78
- package/src/utils/paths.ts +0 -51
- package/src/utils/pr-branch.test.ts +0 -376
- package/src/utils/pr-branch.ts +0 -508
- package/src/utils/spinner.test.ts +0 -45
- package/src/utils/spinner.ts +0 -96
- package/src/utils/task-parser.test.ts +0 -172
- package/src/utils/task-parser.ts +0 -93
- package/templates/AGENCY.md +0 -22
- package/templates/AGENTS.md +0 -11
- package/templates/CLAUDE.md +0 -3
- package/templates/TASK.md +0 -5
- package/templates/opencode.json +0 -4
package/README.md
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
# @markjaquith/agency
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Agency manages durable agentic work across repositories. Epics, tasks, and
|
|
4
|
+
phases live as Markdown documents in a filesystem-backed workbase. Repository
|
|
5
|
+
aliases and Git worktrees provide each execution unit with the code it may read
|
|
6
|
+
or write.
|
|
7
|
+
|
|
8
|
+
## Requirements
|
|
9
|
+
|
|
10
|
+
- [Bun](https://bun.sh) 1.0 or newer
|
|
11
|
+
- Git
|
|
12
|
+
- [GitHub CLI](https://cli.github.com/) for `agency pr create`
|
|
13
|
+
- OpenCode or Claude Code for `agency work`
|
|
14
|
+
- [fzf](https://github.com/junegunn/fzf) for interactive work target selection
|
|
4
15
|
|
|
5
16
|
## Installation
|
|
6
17
|
|
|
@@ -8,170 +19,355 @@ Smuggle project-level LLM instruction into any Git repo. Plan your tasks. Commit
|
|
|
8
19
|
bun install -g @markjaquith/agency
|
|
9
20
|
```
|
|
10
21
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
**
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
For development, run `bun link` from this repository.
|
|
23
|
+
|
|
24
|
+
## Core Model
|
|
25
|
+
|
|
26
|
+
- A **workbase** is the root containing durable documents and local repository
|
|
27
|
+
state.
|
|
28
|
+
- An **epic** orchestrates tasks, may inspect repositories, and never writes
|
|
29
|
+
code.
|
|
30
|
+
- A **task** describes one durable outcome and may stand alone or belong to an
|
|
31
|
+
epic.
|
|
32
|
+
- A **phase** belongs to a multi-phase task and represents one PR or intended
|
|
33
|
+
PR.
|
|
34
|
+
- An **execution unit** is either a single-phase task or a phase. It has exactly
|
|
35
|
+
one writable `repo`, optional read-only `repos`, a branch, a base, and a
|
|
36
|
+
`string | null` PR URL.
|
|
37
|
+
|
|
38
|
+
Entity IDs come from directory names. Structured metadata lives in YAML 1.2
|
|
39
|
+
frontmatter; prose below it supplies human and agent context.
|
|
40
|
+
|
|
41
|
+
## Workbase Layout
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
workbase/
|
|
45
|
+
agency.json
|
|
46
|
+
repos/
|
|
47
|
+
frontend/ # bare Git repository or symlink
|
|
48
|
+
backend/
|
|
49
|
+
epics/
|
|
50
|
+
checkout/
|
|
51
|
+
EPIC.md
|
|
52
|
+
tasks/
|
|
53
|
+
refresh-copy/ # single-phase task
|
|
54
|
+
TASK.md
|
|
55
|
+
code/ # created by agency work
|
|
56
|
+
frontend/
|
|
57
|
+
build-checkout/ # multi-phase task
|
|
58
|
+
TASK.md
|
|
59
|
+
phases/
|
|
60
|
+
backend-api/
|
|
61
|
+
PHASE.md
|
|
62
|
+
code/
|
|
63
|
+
backend/
|
|
64
|
+
frontend-ui/
|
|
65
|
+
PHASE.md
|
|
66
|
+
code/
|
|
67
|
+
frontend/
|
|
68
|
+
backend/
|
|
30
69
|
```
|
|
31
70
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
71
|
+
Repository metadata comes directly from Git under `repos/{alias}`. Workbase
|
|
72
|
+
configuration may provide a custom writable-worktree creation command.
|
|
73
|
+
|
|
74
|
+
### Custom Worktree Command
|
|
75
|
+
|
|
76
|
+
By default, Agency creates worktrees with Git. Set `worktreeCreateCommand` to an
|
|
77
|
+
argv template when another tool should create writable worktrees:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"version": 2,
|
|
82
|
+
"worktreeCreateCommand": [
|
|
83
|
+
"my-worktree-tool",
|
|
84
|
+
"--repo",
|
|
85
|
+
"{repo}",
|
|
86
|
+
"--destination",
|
|
87
|
+
"{worktree}",
|
|
88
|
+
"--branch",
|
|
89
|
+
"{branch}"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
```
|
|
37
93
|
|
|
38
|
-
|
|
94
|
+
Available placeholders are:
|
|
95
|
+
|
|
96
|
+
- `{repo}`: absolute repository alias path under `repos/`
|
|
97
|
+
- `{worktree}`: absolute checkout path Agency requires
|
|
98
|
+
- `{branch}`: execution branch the custom command must create or check out
|
|
99
|
+
- `{base}`: configured execution base
|
|
100
|
+
|
|
101
|
+
`{repo}` and `{worktree}` are required. Agency invokes the command directly
|
|
102
|
+
without a shell, sets matching `AGENCY_REPO`, `AGENCY_WORKTREE`,
|
|
103
|
+
`AGENCY_BRANCH`, and `AGENCY_BASE` environment variables, and verifies that the
|
|
104
|
+
requested destination exists afterward.
|
|
105
|
+
|
|
106
|
+
Worktrunk can be configured per workbase without changing the user's Worktrunk
|
|
107
|
+
path settings:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"version": 2,
|
|
112
|
+
"worktreeCreateCommand": [
|
|
113
|
+
"wt",
|
|
114
|
+
"-C",
|
|
115
|
+
"{repo}",
|
|
116
|
+
"-y",
|
|
117
|
+
"--config-set",
|
|
118
|
+
"worktree-path=\"{worktree}\"",
|
|
119
|
+
"switch",
|
|
120
|
+
"--create",
|
|
121
|
+
"--base",
|
|
122
|
+
"{base}",
|
|
123
|
+
"{branch}",
|
|
124
|
+
"--no-cd",
|
|
125
|
+
"--format",
|
|
126
|
+
"json"
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
```
|
|
39
130
|
|
|
40
|
-
|
|
131
|
+
Custom commands own writable branch creation. Agency checks for conflicting
|
|
132
|
+
worktrees first, invokes the command only when the branch is not checked out,
|
|
133
|
+
and verifies that `{worktree}` exists afterward.
|
|
134
|
+
|
|
135
|
+
The configured command applies only to the writable checkout. Supplemental
|
|
136
|
+
read-only repositories remain detached Git worktrees at their declared refs so
|
|
137
|
+
they do not acquire writable branches.
|
|
138
|
+
|
|
139
|
+
## Frontmatter
|
|
140
|
+
|
|
141
|
+
### Epic
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
---
|
|
145
|
+
ticketUrl: https://example.com/tickets/checkout
|
|
146
|
+
description: Coordinate the checkout experience across frontend and backend.
|
|
147
|
+
repos:
|
|
148
|
+
- repo: frontend
|
|
149
|
+
ref: main
|
|
150
|
+
- repo: backend
|
|
151
|
+
ref: main
|
|
152
|
+
tasks:
|
|
153
|
+
- id: backend-api
|
|
154
|
+
- id: frontend-ui
|
|
155
|
+
dependsOn:
|
|
156
|
+
- backend-api
|
|
157
|
+
---
|
|
158
|
+
```
|
|
41
159
|
|
|
42
|
-
|
|
43
|
-
|
|
160
|
+
### Single-Phase Task
|
|
161
|
+
|
|
162
|
+
```yaml
|
|
163
|
+
---
|
|
164
|
+
ticketUrl: https://example.com/tickets/refresh-copy
|
|
165
|
+
description: Refresh user-facing checkout copy.
|
|
166
|
+
epic: checkout
|
|
167
|
+
repo: frontend
|
|
168
|
+
repos:
|
|
169
|
+
- repo: backend
|
|
170
|
+
ref: main
|
|
171
|
+
branch: task/refresh-copy
|
|
172
|
+
base: main
|
|
173
|
+
pr: null
|
|
174
|
+
---
|
|
175
|
+
```
|
|
44
176
|
|
|
45
|
-
|
|
177
|
+
### Multi-Phase Task
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
---
|
|
181
|
+
ticketUrl: https://example.com/tickets/build-checkout
|
|
182
|
+
description: Deliver checkout through sequenced backend and frontend changes.
|
|
183
|
+
epic: checkout
|
|
184
|
+
phases:
|
|
185
|
+
- id: backend-api
|
|
186
|
+
- id: frontend-ui
|
|
187
|
+
dependsOn:
|
|
188
|
+
- backend-api
|
|
189
|
+
---
|
|
190
|
+
```
|
|
46
191
|
|
|
47
|
-
|
|
192
|
+
Each listed phase has a `phases/{id}/PHASE.md` containing its execution fields:
|
|
193
|
+
|
|
194
|
+
```yaml
|
|
195
|
+
---
|
|
196
|
+
description: Build the checkout interface against the new backend API.
|
|
197
|
+
repo: frontend
|
|
198
|
+
repos:
|
|
199
|
+
- repo: backend
|
|
200
|
+
ref: main
|
|
201
|
+
branch: task/checkout-ui
|
|
202
|
+
base: task/checkout-api
|
|
203
|
+
pr: null
|
|
204
|
+
---
|
|
205
|
+
```
|
|
48
206
|
|
|
49
|
-
|
|
50
|
-
|
|
207
|
+
Epic task dependencies belong in `EPIC.md`. Phase dependencies belong in the
|
|
208
|
+
owning `TASK.md`. Stable IDs do not encode ordering in directory names.
|
|
51
209
|
|
|
52
|
-
|
|
210
|
+
## Quick Start
|
|
53
211
|
|
|
54
212
|
```bash
|
|
55
|
-
agency
|
|
213
|
+
agency init ~/work
|
|
214
|
+
cd ~/work
|
|
215
|
+
|
|
216
|
+
agency repo add frontend git@github.com:example/frontend.git
|
|
217
|
+
agency repo link backend ~/Dev/backend
|
|
218
|
+
|
|
219
|
+
agency task create refresh-copy \
|
|
220
|
+
--ticket-url https://example.com/tickets/refresh-copy \
|
|
221
|
+
--description "Refresh user-facing checkout copy" \
|
|
222
|
+
--repo frontend \
|
|
223
|
+
--reference backend:main \
|
|
224
|
+
--branch task/refresh-copy \
|
|
225
|
+
--base main
|
|
226
|
+
|
|
227
|
+
agency validate
|
|
228
|
+
agency work refresh-copy
|
|
229
|
+
agency pr create refresh-copy
|
|
56
230
|
```
|
|
57
231
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Create an emit branch with smuggled files reverted to their merge-base state (removes additions/modifications to those files made on feature branch). Default branch name is current branch with `--PR` suffix.
|
|
61
|
-
|
|
62
|
-
### `agency push [base-branch]`
|
|
63
|
-
|
|
64
|
-
Runs `agency emit`, pushes the branch, and then switches back to the source branch.
|
|
65
|
-
|
|
66
|
-
**Options:**
|
|
67
|
-
|
|
68
|
-
- `--pr` - Open GitHub PR in browser after pushing (requires `gh` CLI)
|
|
69
|
-
- `--force` - Force push to remote if branch has diverged
|
|
70
|
-
- `--branch <name>` - Custom name for emit branch
|
|
71
|
-
|
|
72
|
-
### `agency merge`
|
|
73
|
-
|
|
74
|
-
Runs `agency emit`, and then merges the PR back into the base branch locally.
|
|
75
|
-
|
|
76
|
-
**Options:**
|
|
232
|
+
## Commands
|
|
77
233
|
|
|
78
|
-
|
|
79
|
-
- `--push` - Push the base branch to origin after merging
|
|
234
|
+
### Workbase and Repositories
|
|
80
235
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### `agency template save <files...>`
|
|
88
|
-
|
|
89
|
-
Save the specified files back to the configured template directory (so they will be used for future `agency task` commands).
|
|
90
|
-
|
|
91
|
-
### `agency base get`
|
|
92
|
-
|
|
93
|
-
Get the base branch for the current feature branch.
|
|
236
|
+
```text
|
|
237
|
+
agency init [path] [--json]
|
|
238
|
+
agency repo add <alias> <remote> [--json]
|
|
239
|
+
agency repo link <alias> <path> [--json]
|
|
240
|
+
agency repo list [--json]
|
|
241
|
+
```
|
|
94
242
|
|
|
95
|
-
|
|
243
|
+
`repo add` creates a bare clone. `repo link` creates a symlink to an existing Git
|
|
244
|
+
repository. Alias names are then used by all documents and commands.
|
|
96
245
|
|
|
97
|
-
|
|
246
|
+
Commands that print Agency-owned results accept `--json`, including initialization,
|
|
247
|
+
repository mutations, entity creation/list/show, status, validation, and PR creation.
|
|
98
248
|
|
|
99
|
-
###
|
|
249
|
+
### Epics
|
|
100
250
|
|
|
101
|
-
|
|
251
|
+
```text
|
|
252
|
+
agency epic create <id> --ticket-url <url> [--description <text>] [--json]
|
|
253
|
+
--repo <alias>:<ref> [--repo <alias>:<ref>...]
|
|
254
|
+
agency epic list [--json]
|
|
255
|
+
agency epic show <id> [--json]
|
|
256
|
+
```
|
|
102
257
|
|
|
103
|
-
|
|
258
|
+
Creating a task with `--epic <id>` adds the task to the epic and writes the task
|
|
259
|
+
back-reference.
|
|
104
260
|
|
|
105
|
-
|
|
261
|
+
### Tasks
|
|
106
262
|
|
|
107
|
-
|
|
263
|
+
Create a single-phase task:
|
|
108
264
|
|
|
109
|
-
|
|
265
|
+
```text
|
|
266
|
+
agency task create <id> --ticket-url <url> --repo <alias>
|
|
267
|
+
--branch <name> --base <name>
|
|
268
|
+
[--description <text>] [--epic <id>] [--reference <alias>:<ref>...] [--json]
|
|
269
|
+
```
|
|
110
270
|
|
|
111
|
-
|
|
271
|
+
Create a multi-phase task container:
|
|
112
272
|
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
|
|
273
|
+
```text
|
|
274
|
+
agency task create <id> --ticket-url <url> --multi-phase
|
|
275
|
+
[--description <text>] [--epic <id>] [--json]
|
|
116
276
|
```
|
|
117
277
|
|
|
118
|
-
|
|
278
|
+
Inspect tasks:
|
|
119
279
|
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
|
|
280
|
+
```text
|
|
281
|
+
agency task list [--json]
|
|
282
|
+
agency task show <id> [--json]
|
|
123
283
|
```
|
|
124
284
|
|
|
125
|
-
|
|
285
|
+
To add a phase to an existing single-phase task, name the phase that will own
|
|
286
|
+
the task's current execution fields with `--first-phase`:
|
|
126
287
|
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
|
|
288
|
+
```text
|
|
289
|
+
agency phase create refresh-copy verification
|
|
290
|
+
--first-phase implementation
|
|
291
|
+
--repo frontend --branch task/refresh-copy-verification --base main
|
|
292
|
+
--depends-on implementation
|
|
130
293
|
```
|
|
131
294
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
- TypeScript ^5
|
|
295
|
+
Agency converts `TASK.md` to the multi-phase shape, creates both phase documents,
|
|
296
|
+
and moves existing worktrees from the task's `code/` directory into the first
|
|
297
|
+
phase. Dependencies remain explicit through `--depends-on`.
|
|
136
298
|
|
|
137
|
-
|
|
299
|
+
### Phases
|
|
138
300
|
|
|
139
|
-
|
|
301
|
+
```text
|
|
302
|
+
agency phase create <task-id> <phase-id>
|
|
303
|
+
--repo <alias> --branch <name> --base <name>
|
|
304
|
+
[--description <text>] [--reference <alias>:<ref>...]
|
|
305
|
+
[--depends-on <phase-id>...] [--first-phase <phase-id>] [--json]
|
|
140
306
|
|
|
141
|
-
|
|
142
|
-
|
|
307
|
+
agency phase list <task-id> [--json]
|
|
308
|
+
agency phase show <task-id> <phase-id> [--json]
|
|
143
309
|
```
|
|
144
310
|
|
|
145
|
-
|
|
311
|
+
### Work and Pull Requests
|
|
146
312
|
|
|
147
|
-
```
|
|
148
|
-
|
|
313
|
+
```text
|
|
314
|
+
agency work [<task-id> [phase-id] | --epic <epic-id>] [--opencode | --claude]
|
|
315
|
+
agency pr create <task-id> [phase-id] [--draft] [--json]
|
|
149
316
|
```
|
|
150
317
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
318
|
+
`agency work` infers an epic, task, or phase from the current directory. From
|
|
319
|
+
elsewhere in the workbase, it presents the full hierarchy in `fzf`. If `fzf` is
|
|
320
|
+
not installed, Agency prints the hierarchy and asks for an explicit target.
|
|
321
|
+
|
|
322
|
+
Epic and multi-phase task targets launch orchestration agents beside their
|
|
323
|
+
documents. Single-phase tasks and phases fetch repositories, create or reuse
|
|
324
|
+
worktrees under `code/`, and launch an execution agent in the writable checkout
|
|
325
|
+
with absolute context paths. Explicit task, phase, and `--epic` targets override
|
|
326
|
+
current-directory inference.
|
|
327
|
+
|
|
328
|
+
Each writable `(repo, branch)` pair may belong to only one task or phase. Agency
|
|
329
|
+
validation reports duplicate ownership, and `agency work` checks Git's worktree
|
|
330
|
+
registry before creating or reusing a checkout. It reuses only an exact
|
|
331
|
+
path/branch match; if the branch is checked out elsewhere or the target path has
|
|
332
|
+
the wrong branch, the command fails with the conflicting path instead of forcing
|
|
333
|
+
another checkout.
|
|
334
|
+
|
|
335
|
+
Read-only references use `<alias>:<ref>` on the CLI and `{ repo, ref }` in YAML.
|
|
336
|
+
Agency resolves the ref to a commit and creates a detached worktree. Existing
|
|
337
|
+
reference worktrees are reused only while their commit still matches the declared
|
|
338
|
+
ref; use a commit SHA as `ref` when reproducibility matters.
|
|
339
|
+
|
|
340
|
+
`agency pr create` requires a clean writable worktree. It pushes the branch,
|
|
341
|
+
runs `gh pr create --fill`, and writes the returned GitHub PR URL into `pr` in
|
|
342
|
+
the owning `TASK.md` or `PHASE.md`.
|
|
343
|
+
|
|
344
|
+
### Status and Validation
|
|
345
|
+
|
|
346
|
+
```text
|
|
347
|
+
agency status [--json]
|
|
348
|
+
agency validate [--json]
|
|
159
349
|
```
|
|
160
350
|
|
|
161
|
-
|
|
351
|
+
Validation checks JSON and YAML parsing, Effect Schema conformance, repository
|
|
352
|
+
aliases, parent/child backlinks, phase directories, duplicate references,
|
|
353
|
+
unknown dependencies, and dependency cycles. YAML duplicate keys, anchors,
|
|
354
|
+
aliases, and custom tags are rejected.
|
|
162
355
|
|
|
163
|
-
|
|
164
|
-
- Knip (unused code detection)
|
|
165
|
-
- TypeScript type checking
|
|
356
|
+
## Agent Skill
|
|
166
357
|
|
|
167
|
-
|
|
358
|
+
`skills/agency/SKILL.md` contains an agent-oriented operating guide for Agency.
|
|
359
|
+
Install or link that directory into your agent's skill location when you want
|
|
360
|
+
Agency workflows to be discovered automatically.
|
|
168
361
|
|
|
169
|
-
|
|
170
|
-
- Commit message history
|
|
362
|
+
## Development
|
|
171
363
|
|
|
172
|
-
|
|
364
|
+
```bash
|
|
365
|
+
bun install
|
|
366
|
+
bun link
|
|
367
|
+
bun run build
|
|
368
|
+
```
|
|
173
369
|
|
|
174
|
-
|
|
370
|
+
Run focused tests with `bun test <test-file>`. Run formatting with `bun format`.
|
|
175
371
|
|
|
176
372
|
## License
|
|
177
373
|
|