@codebehind/agent-workflow 1.1.3 → 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.
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ BUMP="${1:-patch}"
5
+
6
+ if [[ "$BUMP" != "patch" && "$BUMP" != "minor" && "$BUMP" != "major" ]]; then
7
+ echo "Usage: $0 [patch|minor|major]" >&2
8
+ echo " Default: patch" >&2
9
+ exit 1
10
+ fi
11
+
12
+ echo "Bumping ${BUMP} version..."
13
+ npm version "$BUMP"
14
+
15
+ echo "Pushing commits to main..."
16
+ git push origin main
17
+
18
+ echo "Pushing tag..."
19
+ git push origin --tags
20
+
21
+ echo "Done. GitLab pipeline will publish to npm."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebehind/agent-workflow",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Scaffold the agent-workflow spec-driven delivery framework into any repo",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,6 +21,11 @@
21
21
  "scaffold",
22
22
  "spec-driven"
23
23
  ],
24
+ "scripts": {
25
+ "release": "bash bin/publish-new-version.sh",
26
+ "release:minor": "bash bin/publish-new-version.sh minor",
27
+ "release:major": "bash bin/publish-new-version.sh major"
28
+ },
24
29
  "repository": {
25
30
  "type": "git",
26
31
  "url": "git+https://gitlab.com/codebehind/agent-workflow.git"
@@ -142,19 +142,21 @@ For non-trivial changes not described by a new feature spec:
142
142
 
143
143
  ---
144
144
 
145
- ## Meta-repo specifics
145
+ ## Repo mode
146
146
 
147
- This is the project's meta repository. The `.agent-workflow/` directory exists **only here** — there are no per-submodule workflow directories.
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
- | Backend application code | `backend/` submodulecommit and MR in project-backend |
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>/` submodulessee `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 submodule directory to make code changes.
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 repo MR covers only spec, plan, docs, and artifacts.
160
- 4. Reference the submodule MR(s) in the meta repo MR description.
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
- ## Meta-repo note
7
+ ## Where to run acceptance proof
8
8
 
9
- This is the project's meta repository. Application code lives in submodules (for example `backend/`, `web/`, `mobile/`). Acceptance proof that requires a running app (UI screenshots, API curl) must be executed **inside the relevant submodule directory**. Artifacts are then saved here under `.agent-workflow/artifacts/`.
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 `.agent-workflow/README.md`
8
- 2. Read `.agent-workflow/codebase.md` if it exists
9
- 3. Read the target spec and any linked feature doc before planning or implementation
10
- 4. Read relevant existing code (inside the appropriate submodule) before proposing structural changes
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
- ## Meta-repo rule
138
- This is the project's meta repository. Specs, plans, docs, and artifacts live here. Application code changes go inside submodule directories (`backend/`, `web/`, `mobile/`). Each affected submodule gets its own MR in its own GitLab project. Never commit application code directly to the meta repo.
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 (for the current project, run inside the relevant submodule directory)
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
- 1. Stage only the relevant meta-repo files (spec, plan, docs, artifacts — not submodule code).
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. If submodule code was changed, open separate MRs in the affected submodule GitLab projects and reference them in the meta repo MR description.
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 (no submodule code).
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> - - -`.
@@ -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
- ## Meta-repo rule
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
- This is the **Mjaumatish meta repository**. Specs, plans, docs, and artifacts live here. Application code changes go inside submodule directories (`backend/`, `web/`, `mobile/`). Each affected submodule gets its own MR in its own GitLab project.
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
- - Never commit application code directly to the meta repo.
24
- - When running acceptance proof (UI, API), navigate inside the relevant submodule to start the app and capture evidence. Save artifacts back here under `.agent-workflow/artifacts/`.
25
- - Reference submodule MR URLs in the meta repo MR description.
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
- - For this meta repo: run the app inside the relevant submodule directory; save artifacts here.
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: From a Notion page
62
+ ### Option 1: Scripted (worktrees) — from a Notion page
54
63
 
55
- In the repo root worktree start following command (this will create new git worktree, branch and start new claude session with /prepare-spec skill):
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 command:
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 in `~/agent-runs/{PROJECT_NAME}/worktrees/spec-<slug>` on branch `agent/spec/<slug>`
64
- - iniate `/prepare-spec` skill from given <notion-link>
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: From a description
77
+ ### Option 2: Direct (no worktrees) — from a Notion page or description
69
78
 
70
- TBD
71
- ```
72
- # Still in progress...
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
- ### Start a task session
113
+ ### Option 1: Scripted (worktrees)
93
114
 
94
- From the repo root:
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
- scipts/agent/implement-task.sh <task-name> <spec-file or spec-name>
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
- This command:
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) (`backend/`, `web/`, `mobile/`).
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
- ## Meta-repo specifics
167
+ ## Repo mode
134
168
 
135
- In case this is a **meta repository**. Specs, plans, docs, and artifacts all live here under `.agent-workflow/`. Application code changes, however, go inside the submodule directories.
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 meta repo |
140
- | Submodules code changes | `repos/` submodules in sepparate folders with their repositories |
141
- | Acceptance proof (runtime) | Runs inside the relevant submodule; artifacts stored here |
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
- A cross-cutting spec (touching multiple repos) results in one plan here and separate MRs in each affected sub-repo.
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
- In case this is a single repo project, everything will live in this single root folder and repo.
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
- Agent worktrees live outside the main repo clone:
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
- From the repo root (no worktree needed for spec prep):
81
-
80
+ **Scripted (auto worktree + branch):**
82
81
  ```bash
83
82
  scripts/agent/prepare-spec <spec-name> <notion-link>
84
83
  ```
85
84
 
86
- The agent will create a branch `agent/spec/<slug>`, commit the spec, and open a GitLab MR.
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 a implementation session (Phase B)
94
+ ## Running an implementation session (Phase B)
91
95
 
96
+ **Scripted (auto worktree + branch):**
92
97
  ```bash
93
- scipts/agent/implement-task.sh <task-name> <spec-file or spec-name>
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
  ---