@codebehind/agent-workflow 1.1.4 → 1.1.5
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/package.json +1 -1
- package/templates/.agent-workflow/README.md +11 -9
- package/templates/.agent-workflow/acceptance-verification.md +5 -2
- package/templates/.claude/rules/agentic-workflow.md +11 -6
- package/templates/.claude/skills/implement-spec/SKILL.md +13 -3
- package/templates/.claude/skills/prepare-spec/SKILL.md +1 -1
- package/templates/AGENTS.md +18 -6
- package/templates/agents-workflow-dev-process.md +69 -27
- package/templates/agents-workflow-env-setup.md +19 -7
package/package.json
CHANGED
|
@@ -142,19 +142,21 @@ For non-trivial changes not described by a new feature spec:
|
|
|
142
142
|
|
|
143
143
|
---
|
|
144
144
|
|
|
145
|
-
##
|
|
145
|
+
## Repo mode
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
Check `AGENTS.md` for the declared repo mode.
|
|
148
|
+
|
|
149
|
+
**Single-repo:** All code, specs, plans, docs, and artifacts live here. Commit and MR everything in this repo. One MR per task branch.
|
|
150
|
+
|
|
151
|
+
**Meta-repo:** The `.agent-workflow/` directory exists only here — there are no per-submodule workflow directories.
|
|
148
152
|
|
|
149
153
|
| Content | Location |
|
|
150
154
|
|---------|---------|
|
|
151
155
|
| Specs, plans, feature docs, artifacts | This repo under `.agent-workflow/` |
|
|
152
|
-
|
|
|
153
|
-
| Web application code | `web/` submodule — commit and MR in project-web |
|
|
154
|
-
| Mobile application code | `mobile/` submodule — commit and MR in project-mobile |
|
|
156
|
+
| Application code | `repos/<module>/` submodules — see `AGENTS.md` for the full list and their GitLab project URLs |
|
|
155
157
|
|
|
156
|
-
When implementing a spec that touches application code:
|
|
157
|
-
1. Navigate into the relevant
|
|
158
|
+
When implementing a spec that touches application code (meta-repo only):
|
|
159
|
+
1. Navigate into the relevant `repos/<module>/` directory to make code changes.
|
|
158
160
|
2. Open a separate MR in that submodule's GitLab project.
|
|
159
|
-
3. The meta
|
|
160
|
-
4. Reference the submodule MR(s) in the meta
|
|
161
|
+
3. The meta-repo MR covers only spec, plan, docs, and artifacts.
|
|
162
|
+
4. Reference the submodule MR(s) in the meta-repo MR description.
|
|
@@ -4,9 +4,12 @@ This document defines how agents **verify acceptance criteria and report proof**
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Where to run acceptance proof
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Check `AGENTS.md` for the repo mode:
|
|
10
|
+
|
|
11
|
+
- **Single-repo:** run the app from the repo root. Save artifacts under `.agent-workflow/artifacts/`.
|
|
12
|
+
- **Meta-repo:** navigate into the relevant `repos/<module>/` directory to start the app and run proof. Save artifacts back here under `.agent-workflow/artifacts/`.
|
|
10
13
|
|
|
11
14
|
---
|
|
12
15
|
|
|
@@ -4,10 +4,11 @@ You are operating inside a spec-driven delivery workflow with GitLab merge-reque
|
|
|
4
4
|
Follow these rules in every session.
|
|
5
5
|
|
|
6
6
|
## Read order at session start
|
|
7
|
-
1. Read
|
|
8
|
-
2. Read `.agent-workflow/
|
|
9
|
-
3. Read
|
|
10
|
-
4. Read
|
|
7
|
+
1. Read `AGENTS.md` — determines repo mode (single-repo vs meta-repo) and project context
|
|
8
|
+
2. Read `.agent-workflow/README.md`
|
|
9
|
+
3. Read `.agent-workflow/codebase.md` if it exists
|
|
10
|
+
4. Read the target spec and any linked feature doc before planning or implementation
|
|
11
|
+
5. Read relevant existing code (in the appropriate directory) before proposing structural changes
|
|
11
12
|
|
|
12
13
|
## Source of truth
|
|
13
14
|
- The spec is the source of truth for scope.
|
|
@@ -134,5 +135,9 @@ When the user invokes `/prepare-spec`, `/implement-spec`, `/acceptance-proof`, o
|
|
|
134
135
|
|
|
135
136
|
For acceptance proof on UI tasks, also read `.agent-workflow/playwright-acceptance.md`.
|
|
136
137
|
|
|
137
|
-
##
|
|
138
|
-
|
|
138
|
+
## Repo mode rule
|
|
139
|
+
Read `AGENTS.md` to determine the repo mode declared for this project.
|
|
140
|
+
|
|
141
|
+
**Single-repo mode:** Application code, specs, plans, docs, and artifacts all live in this repository. Commit everything here. One MR per task branch covers all changes.
|
|
142
|
+
|
|
143
|
+
**Meta-repo mode:** Specs, plans, docs, and artifacts live in this repository. Application code lives in `repos/<module>/` submodules as declared in `AGENTS.md`. Never commit application code directly to this repo. Each affected submodule gets its own MR in its own GitLab project. Reference all submodule MR URLs in the meta-repo MR description. For acceptance proof requiring a running app, navigate into the relevant `repos/<module>/` directory; save artifacts back here under `.agent-workflow/artifacts/`.
|
|
@@ -67,7 +67,7 @@ After approval:
|
|
|
67
67
|
|
|
68
68
|
### 7. Verify
|
|
69
69
|
For each acceptance criterion:
|
|
70
|
-
- run or describe concrete verification steps
|
|
70
|
+
- run or describe concrete verification steps — check `AGENTS.md`: single-repo → run from repo root; meta-repo → run inside the relevant `repos/<module>/` directory
|
|
71
71
|
- save proof into `.agent-workflow/artifacts/acceptance-<spec-slug>-<YYYYMMDD>/`
|
|
72
72
|
- note pass/fail clearly per `.agent-workflow/acceptance-verification.md`
|
|
73
73
|
|
|
@@ -76,12 +76,22 @@ Update the most relevant existing doc in `.agent-workflow/docs/` if one already
|
|
|
76
76
|
Only create a new doc if no existing doc is the right place.
|
|
77
77
|
|
|
78
78
|
### 9. GitLab handoff
|
|
79
|
-
|
|
79
|
+
Check `AGENTS.md` for repo mode:
|
|
80
|
+
|
|
81
|
+
**Single-repo:**
|
|
82
|
+
1. Stage all changed files (code, spec, plan, docs, artifacts).
|
|
83
|
+
2. Commit current changes.
|
|
84
|
+
3. Push with `scripts/agent/git-push-branch.sh`.
|
|
85
|
+
4. Generate MR body content using `scripts/agent/mr-template.sh task <spec-path> <plan-path> <doc-path-or-dash> <artifacts-path-or-dash>`.
|
|
86
|
+
5. Open or update the MR using the scripts in `scripts/agent/`.
|
|
87
|
+
|
|
88
|
+
**Meta-repo:**
|
|
89
|
+
1. Stage only the files in this repo (spec, plan, docs, artifacts — not `repos/<module>/` code).
|
|
80
90
|
2. Commit current changes.
|
|
81
91
|
3. Push with `scripts/agent/git-push-branch.sh`.
|
|
82
92
|
4. Generate MR body content using `scripts/agent/mr-template.sh task <spec-path> <plan-path> <doc-path-or-dash> <artifacts-path-or-dash>`.
|
|
83
93
|
5. Open or update the MR using the scripts in `scripts/agent/`.
|
|
84
|
-
6.
|
|
94
|
+
6. For each `repos/<module>/` that had code changes, open a separate MR in that submodule's GitLab project and reference its URL in the meta-repo MR description.
|
|
85
95
|
|
|
86
96
|
### 10. Final handoff
|
|
87
97
|
Provide:
|
|
@@ -61,7 +61,7 @@ Use filenames that reveal purpose, for example:
|
|
|
61
61
|
- `db-shape-notes.md`
|
|
62
62
|
|
|
63
63
|
## GitLab handoff behavior
|
|
64
|
-
1. Stage only the relevant spec, asset, and doc changes
|
|
64
|
+
1. Stage only the relevant spec, asset, and doc changes.
|
|
65
65
|
2. Create a focused commit.
|
|
66
66
|
3. Push the current branch with `scripts/agent/git-push-branch.sh`.
|
|
67
67
|
4. Generate MR body content using `scripts/agent/mr-template.sh spec <spec-path> - - -`.
|
package/templates/AGENTS.md
CHANGED
|
@@ -6,6 +6,8 @@ This repository uses a structured feature delivery workflow.
|
|
|
6
6
|
|
|
7
7
|
**CRITICAL**: Before starting any work, read `.agent-workflow/README.md` to understand the complete workflow.
|
|
8
8
|
|
|
9
|
+
See `agents-workflow-dev-process.md` for both the **scripted workflow** (bash scripts, auto worktrees) and the **direct workflow** (manual branch + `claude` in the repo root — no worktrees required).
|
|
10
|
+
|
|
9
11
|
## Quick Start
|
|
10
12
|
|
|
11
13
|
1. Read `.agent-workflow/README.md` (workflow process — **Phase A** spec authorship vs **Phase B** delivery).
|
|
@@ -16,13 +18,23 @@ This repository uses a structured feature delivery workflow.
|
|
|
16
18
|
4. For implementation, read `verification` in each open spec (`true|false`, default to `true` when missing).
|
|
17
19
|
5. Follow the workflow: **open** spec → plan → implement → document → mark spec `done`.
|
|
18
20
|
|
|
19
|
-
##
|
|
21
|
+
## Repo Mode
|
|
22
|
+
|
|
23
|
+
**Mode:** single-repo
|
|
24
|
+
<!-- Change to "meta-repo" if this repo holds only specs/plans/docs and application code lives in repos/<module>/ submodules. -->
|
|
25
|
+
|
|
26
|
+
<!-- If meta-repo, fill in the submodule table below and delete this comment block:
|
|
27
|
+
| Directory | GitLab project URL |
|
|
28
|
+
|------------------|--------------------|
|
|
29
|
+
| repos/backend/ | gitlab.com/org/project-backend |
|
|
30
|
+
| repos/web/ | gitlab.com/org/project-web |
|
|
31
|
+
-->
|
|
20
32
|
|
|
21
|
-
|
|
33
|
+
**Single-repo:** All application code, specs, plans, docs, and artifacts live in this repository. Commit everything here. One MR per task branch.
|
|
22
34
|
|
|
23
|
-
|
|
24
|
-
- When running acceptance proof (UI, API), navigate
|
|
25
|
-
|
|
35
|
+
<!-- If meta-repo, replace the line above with:
|
|
36
|
+
**Meta-repo:** Specs, plans, docs, and artifacts live here. Application code lives in `repos/<module>/` submodules (see table above). Never commit application code directly to this repo. Each affected submodule gets its own MR in its own GitLab project. Reference submodule MR URLs in the meta-repo MR description. When running acceptance proof (UI, API), navigate into the relevant `repos/<module>/` directory to start the app and capture evidence; save artifacts back here under `.agent-workflow/artifacts/`.
|
|
37
|
+
-->
|
|
26
38
|
|
|
27
39
|
## Key Points
|
|
28
40
|
|
|
@@ -40,4 +52,4 @@ This is the **Mjaumatish meta repository**. Specs, plans, docs, and artifacts li
|
|
|
40
52
|
- Prefer Playwright screenshots per acceptance criterion or per major UI state.
|
|
41
53
|
- Distinguish clearly between `implemented`, `verified automatically`, and `human QA pending`.
|
|
42
54
|
- Follow `.agent-workflow/acceptance-verification.md` and `.agent-workflow/playwright-acceptance.md`.
|
|
43
|
-
-
|
|
55
|
+
- **Single-repo:** run the app from the repo root. **Meta-repo:** navigate into the relevant `repos/<module>/` directory to start the app; save artifacts here under `.agent-workflow/artifacts/`.
|
|
@@ -15,6 +15,15 @@ Work flows through two phases:
|
|
|
15
15
|
|
|
16
16
|
Phases are kept in **separate Claude sessions** on **separate branches** to keep spec authoring and implementation cleanly isolated.
|
|
17
17
|
|
|
18
|
+
There are two ways to run each phase:
|
|
19
|
+
|
|
20
|
+
| Mode | How |
|
|
21
|
+
|------|-----|
|
|
22
|
+
| **Scripted (worktrees)** | Run the bash scripts — they create a git worktree, branch, and start Claude automatically |
|
|
23
|
+
| **Direct (no worktrees)** | Create the branch manually, open Claude in the repo root, invoke the skill yourself |
|
|
24
|
+
|
|
25
|
+
Both modes are fully supported. Choose based on your preference.
|
|
26
|
+
|
|
18
27
|
---
|
|
19
28
|
|
|
20
29
|
## Prerequisites
|
|
@@ -50,31 +59,43 @@ Use `_template.md` when creating specs by hand.
|
|
|
50
59
|
|
|
51
60
|
## Phase A — Prepare spec
|
|
52
61
|
|
|
53
|
-
### Option 1:
|
|
62
|
+
### Option 1: Scripted (worktrees) — from a Notion page
|
|
54
63
|
|
|
55
|
-
|
|
64
|
+
From the repo root, run:
|
|
56
65
|
|
|
57
66
|
```bash
|
|
58
67
|
scripts/agent/prepare-spec <slug> <notion-link>
|
|
59
68
|
```
|
|
60
69
|
|
|
61
|
-
This
|
|
70
|
+
This script:
|
|
62
71
|
- creates a worktree at `~/agent-runs/{PROJECT_NAME}/worktrees/spec-<slug>` on branch `agent/spec/<slug>`
|
|
63
|
-
- starts Claude session
|
|
64
|
-
-
|
|
72
|
+
- starts a Claude session inside that worktree
|
|
73
|
+
- invokes `/prepare-spec` with the given Notion link
|
|
65
74
|
|
|
66
75
|
The agent fetches the Notion page, maps content to the spec template, asks clarifying questions, then writes `.agent-workflow/specs/<date>_<slug>.md` with `status: draft`.
|
|
67
76
|
|
|
68
|
-
### Option 2:
|
|
77
|
+
### Option 2: Direct (no worktrees) — from a Notion page or description
|
|
69
78
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
Skip the script and run everything yourself:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# 1. Create and switch to a spec branch
|
|
83
|
+
git checkout -b agent/spec/<slug>
|
|
84
|
+
|
|
85
|
+
# 2. Open Claude in the repo root
|
|
86
|
+
claude
|
|
87
|
+
|
|
88
|
+
# 3. Inside Claude, invoke the skill
|
|
89
|
+
/prepare-spec <notion-link>
|
|
90
|
+
# or for a free-form description:
|
|
91
|
+
# "Use prepare-spec skill, here is the feature: ..."
|
|
73
92
|
```
|
|
74
93
|
|
|
94
|
+
The agent will write the spec, commit it, and open a GitLab MR on the current branch — no worktree needed.
|
|
95
|
+
|
|
75
96
|
### Option 3: By hand
|
|
76
97
|
|
|
77
|
-
Copy `.agent-workflow/specs/_template.md` to `.agent-workflow/specs/<name>.md`, fill it in, and set `status: draft` (or `open` if ready).
|
|
98
|
+
Copy `.agent-workflow/specs/_template.md` to `.agent-workflow/specs/<name>.md`, fill it in, and set `status: draft` (or `open` if ready). Then commit and push the branch yourself.
|
|
78
99
|
|
|
79
100
|
### After spec prep
|
|
80
101
|
|
|
@@ -89,26 +110,39 @@ Copy `.agent-workflow/specs/_template.md` to `.agent-workflow/specs/<name>.md`,
|
|
|
89
110
|
|
|
90
111
|
The spec must have `status: open` and be merged to main before starting Phase B.
|
|
91
112
|
|
|
92
|
-
###
|
|
113
|
+
### Option 1: Scripted (worktrees)
|
|
93
114
|
|
|
94
|
-
|
|
115
|
+
```bash
|
|
116
|
+
scripts/agent/implement-task.sh <task-name> <spec-file or spec-name>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
This script:
|
|
120
|
+
- creates a worktree at `~/agent-runs/{PROJECT_NAME}/worktrees/task-<slug>` on branch `agent/task/<slug>`
|
|
121
|
+
- starts a Claude session inside that worktree
|
|
122
|
+
- invokes `/implement-spec` with the given spec file
|
|
123
|
+
|
|
124
|
+
### Option 2: Direct (no worktrees)
|
|
95
125
|
|
|
96
126
|
```bash
|
|
97
|
-
|
|
127
|
+
# 1. Create and switch to a task branch from main
|
|
128
|
+
git checkout main && git pull
|
|
129
|
+
git checkout -b agent/task/<slug>
|
|
130
|
+
|
|
131
|
+
# 2. Open Claude in the repo root
|
|
132
|
+
claude
|
|
133
|
+
|
|
134
|
+
# 3. Inside Claude, invoke the skill
|
|
135
|
+
/implement-spec .agent-workflow/specs/<spec-file>.md
|
|
98
136
|
```
|
|
99
137
|
|
|
100
|
-
|
|
101
|
-
- creates a worktree at `~/agent-runs/{PROJECT_NAME}/worktrees/task-<slug>` on branch `agent/spec/<slug>`
|
|
102
|
-
- starts Claude session in `~/agent-runs/{PROJECT_NAME}/worktrees/task-<slug>` on branch `agent/spec/<slug>`
|
|
103
|
-
- iniate `/implement-spec` skill from given <spec-file or spec-name>
|
|
104
|
-
- this will follow the local GitLab workflow. Create the plan first, push it, and stop for approval (if needed).
|
|
138
|
+
The agent takes it from there — plan, push, MR, wait for approval if `verification: true`.
|
|
105
139
|
|
|
106
140
|
### What the agent does
|
|
107
141
|
|
|
108
142
|
1. Reads the spec, codebase snapshot, and relevant existing docs.
|
|
109
143
|
2. Creates `.agent-workflow/plans/<spec-name>_plan.md`.
|
|
110
144
|
3. If `verification: true` (default): commits the plan, pushes, opens/updates an MR, and **waits for your approval**.
|
|
111
|
-
4. After approval (or immediately if `verification: false`): implements the feature — code changes go into the relevant submodule(s)
|
|
145
|
+
4. After approval (or immediately if `verification: false`): implements the feature — in single-repo mode, code changes go directly in this repo; in meta-repo mode, changes go into the relevant `repos/<module>/` submodule(s) declared in `AGENTS.md`.
|
|
112
146
|
5. Runs acceptance verification per the criteria in the spec.
|
|
113
147
|
6. Writes/updates a feature doc in `.agent-workflow/docs/`.
|
|
114
148
|
7. Opens or updates the MR with the full summary.
|
|
@@ -122,7 +156,7 @@ Reply in the same Claude session:
|
|
|
122
156
|
Proceed with implementation.
|
|
123
157
|
```
|
|
124
158
|
|
|
125
|
-
Or start a fresh session in the same worktree and say:
|
|
159
|
+
Or start a fresh session (in the same worktree or the repo root on the same branch) and say:
|
|
126
160
|
|
|
127
161
|
```
|
|
128
162
|
Use implement-spec skill for .agent-workflow/specs/<spec-file>.md. Plan is approved, proceed with implementation.
|
|
@@ -130,19 +164,27 @@ Use implement-spec skill for .agent-workflow/specs/<spec-file>.md. Plan is appro
|
|
|
130
164
|
|
|
131
165
|
---
|
|
132
166
|
|
|
133
|
-
##
|
|
167
|
+
## Repo mode
|
|
134
168
|
|
|
135
|
-
|
|
169
|
+
The repo mode is declared in `AGENTS.md`. Check it before starting any implementation.
|
|
170
|
+
|
|
171
|
+
**Single-repo:**
|
|
136
172
|
|
|
137
173
|
| What | Where it lives |
|
|
138
174
|
|------|---------------|
|
|
139
|
-
| Spec, plan, docs, artifacts | `.agent-workflow/` in this
|
|
140
|
-
|
|
|
141
|
-
| Acceptance proof (runtime) |
|
|
175
|
+
| Spec, plan, docs, artifacts | `.agent-workflow/` in this repo |
|
|
176
|
+
| Application code | This repo — commit and MR everything here |
|
|
177
|
+
| Acceptance proof (runtime) | Run from the repo root; artifacts stored under `.agent-workflow/artifacts/` |
|
|
178
|
+
|
|
179
|
+
**Meta-repo:**
|
|
142
180
|
|
|
143
|
-
|
|
181
|
+
| What | Where it lives |
|
|
182
|
+
|------|---------------|
|
|
183
|
+
| Spec, plan, docs, artifacts | `.agent-workflow/` in this repo |
|
|
184
|
+
| Application code | `repos/<module>/` submodules — see `AGENTS.md` for the full list |
|
|
185
|
+
| Acceptance proof (runtime) | Run inside the relevant `repos/<module>/` directory; artifacts stored here |
|
|
144
186
|
|
|
145
|
-
|
|
187
|
+
A cross-cutting spec (touching multiple submodules) results in one plan here and separate MRs in each affected `repos/<module>/` GitLab project.
|
|
146
188
|
|
|
147
189
|
---
|
|
148
190
|
|
|
@@ -42,9 +42,9 @@ chmod +x scripts/agent/*.sh
|
|
|
42
42
|
|
|
43
43
|
---
|
|
44
44
|
|
|
45
|
-
## 3. Create the worktree root directory
|
|
45
|
+
## 3. Create the worktree root directory *(optional — scripted workflow only)*
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Only needed if you plan to use the bash scripts (`prepare-spec.sh`, `implement-task.sh`) that create git worktrees automatically. Skip this step if you prefer the direct workflow (manual branch + `claude` in the repo root).
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
50
|
mkdir -p ~/agent-runs/{PROJECT_NAME}/worktrees
|
|
@@ -77,20 +77,32 @@ Claude Code will read `CLAUDE.md` and `.claude/rules/agentic-workflow.md` automa
|
|
|
77
77
|
|
|
78
78
|
## Running a spec session (Phase A)
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
**Scripted (auto worktree + branch):**
|
|
82
81
|
```bash
|
|
83
82
|
scripts/agent/prepare-spec <spec-name> <notion-link>
|
|
84
83
|
```
|
|
85
84
|
|
|
86
|
-
|
|
85
|
+
**Direct (manual branch, no worktree):**
|
|
86
|
+
```bash
|
|
87
|
+
git checkout -b agent/spec/<slug>
|
|
88
|
+
claude
|
|
89
|
+
# then inside Claude: /prepare-spec <notion-link>
|
|
90
|
+
```
|
|
87
91
|
|
|
88
92
|
---
|
|
89
93
|
|
|
90
|
-
## Running
|
|
94
|
+
## Running an implementation session (Phase B)
|
|
91
95
|
|
|
96
|
+
**Scripted (auto worktree + branch):**
|
|
92
97
|
```bash
|
|
93
|
-
|
|
98
|
+
scripts/agent/implement-task.sh <task-name> <spec-file or spec-name>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Direct (manual branch, no worktree):**
|
|
102
|
+
```bash
|
|
103
|
+
git checkout -b agent/task/<slug>
|
|
104
|
+
claude
|
|
105
|
+
# then inside Claude: /implement-spec .agent-workflow/specs/<spec-file>.md
|
|
94
106
|
```
|
|
95
107
|
|
|
96
108
|
---
|