duaer-spec 0.5.1 → 0.6.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.
@@ -1,52 +1,56 @@
1
1
  ---
2
- description: duaer-spec agent ops (isolated branch/worktree, commits, push opt-in)
2
+ description: duaer-spec agent ops (develop+main, feat/fix, .worktree, push opt-in)
3
3
  alwaysApply: true
4
4
  ---
5
5
 
6
6
  # Agent development workflow
7
7
 
8
- Part of **duaer-spec**. Authoritative over Duaer when they conflict. This
9
- repository integrates on `main`. Adopting projects may document another
10
- integration branch in their baseline.
8
+ Part of **duaer-spec**. Authoritative over Duaer when they conflict.
11
9
 
12
- ## Language
10
+ ## Required branches
13
11
 
14
- Use English for code, identifiers, comments, commits, specs, and docs unless
15
- the project explicitly overrides.
12
+ | Branch | Role |
13
+ |---|---|
14
+ | `main` | Production / online |
15
+ | `develop` | Day-to-day integration |
16
+ | `feat/<name>` | Feature → merge to `develop` |
17
+ | `fix/<name>` | Bugfix → `develop` (hotfix: from `main` → `main` then `develop`) |
18
+
19
+ Detail: `docs/agent/branching-and-release.md`.
16
20
 
17
21
  ## Isolated development (mandatory worktree)
18
22
 
19
23
  Before editing files for a new request:
20
24
 
21
- 1. Update local integration branch (`main` here; or project override)
22
- 2. Create a unique branch: `<type>/<short-description>`
23
- 3. Create a dedicated worktree at **`.worktree/<request-id>`** (required — not optional)
25
+ 1. Update local **`develop`** (hotfix: **`main`**)
26
+ 2. Create `feat/<name>` or `fix/<name>`
27
+ 3. Create worktree at **`.worktree/<request-id>`** (required)
24
28
  4. Develop only inside that worktree
25
- 5. Never develop in the primary checkout or on the long-lived branch
26
- 6. Never reuse or modify another agent's branch/worktree
27
- 7. Never commit `.worktree/` (must stay gitignored)
29
+ 5. Never develop on `main` / `develop` or in the primary checkout
30
+ 6. Never reuse another agent's branch/worktree
31
+ 7. Never commit `.worktree/`
28
32
 
29
33
  ```bash
30
34
  mkdir -p .worktree
31
- git worktree add .worktree/<request-id> -b <type>/<request-id> main
35
+ git worktree add .worktree/<request-id> -b feat/<name> develop
32
36
  cd .worktree/<request-id>
33
37
  ```
38
+
34
39
  ## Immutable habits
35
40
 
36
- - Spec-sync: behavior changes update the relevant project specs/docs (and ADR when architecture/security/contracts change)
41
+ - Spec-sync for behavior changes; ADR when architecture/security/contracts change
37
42
  - One logical change per commit; leave the worktree clean
38
- - User/protocol-visible changes update the project's E2E scenario docs
39
- - Merge the request branch back into the local integration branch when done
40
- - Remove the request worktree and delete the merged branch after merge
41
- - Push only when the user explicitly asks for this request
42
-
43
- ## GitHub issue intake
44
-
45
- If the user links an issue for this repo: verify the claim first; do not implement until it exists. Comment in the issue's language; close when conclusive. An issue link does not authorize push.
43
+ - User/protocol-visible changes update E2E scenario docs
44
+ - Merge into **`develop`** when done (hotfix: **`main`**, then back-merge **`develop`**)
45
+ - Stop worktree services → remove worktree delete short branch
46
+ - Push only when the user explicitly asks
47
+ - Promote **`develop` → `main`** only when the user asks to go online
46
48
 
47
- ## GitHub PR intake
49
+ ## GitHub issue / PR intake
48
50
 
49
- If the user links a PR: judge the principle first. If sound, merge that PR (preserve commits); completeness gaps are follow-up after merge. Do not silently reimplement. A PR link does not authorize unrelated pushes or force-push of the contributor branch.
51
+ Issue: verify before work; comment in issue language; close when conclusive.
52
+ PR: judge principle; merge sound PRs; no silent reimplementation.
53
+ Neither authorizes push by itself.
50
54
 
51
55
  ## Commits
52
56
 
@@ -54,4 +58,4 @@ If the user links a PR: judge the principle first. If sound, merge that PR (pres
54
58
  type(scope): description
55
59
  ```
56
60
 
57
- Types: `feat fix docs test chore refactor perf build ci` — English, imperative, one logical change.
61
+ Types: `feat fix docs test chore refactor perf build ci` — English, imperative.
@@ -16,14 +16,18 @@ If this conflicts with root `AGENTS.md` (worktrees, commits, Issue/PR),
16
16
 
17
17
  For new behavior, fixes, refactors that change product behavior, or architecture:
18
18
 
19
- 0. **Isolate first (mandatory):** update integration branch, create
20
- `<type>/<short-description>`, add worktree at `.worktree/<request-id>`,
19
+ 0. **Isolate first (mandatory):** update **`develop`** (hotfix: **`main`**),
20
+ create `feat|fix/<name>`, add worktree at `.worktree/<request-id>`,
21
21
  work only there. Never skip the worktree. Never commit `.worktree/`.
22
+ Never develop on `main` or `develop`.
22
23
  1. **Silently follow** the procedure in `.cursor/skills/duaer-do/SKILL.md`
23
24
  (assign Brief → light tasks → implement → converge → handoff line).
24
25
  2. Do **not** wait for `/duaer-do` or any other skill invocation.
25
26
  3. Do **not** say “please run `/duaer-specify`” — you do it.
26
27
  4. Do **not** dump a methodology tutorial unless they ask how Duaer works.
28
+ 5. Merge to **`develop`** when done (hotfix: **`main`**, then back-merge
29
+ **`develop`**). Promote to **`main`** only if the user asks to go online.
30
+ See `docs/agent/branching-and-release.md`.
27
31
 
28
32
  ## Handoff
29
33
 
package/ADOPT.md CHANGED
@@ -7,30 +7,37 @@ Brief → work → accept **without** the human operating slash commands or CLI.
7
7
 
8
8
  ```bash
9
9
  npx duaer-spec init --here
10
- # pin: npx github:fujiezee/duaer-spec@v0.5.0 duaer init --here
10
+ # pin: npx github:fujiezee/duaer-spec@v0.6.0 duaer init --here
11
11
  ```
12
12
 
13
13
  ```bash
14
14
  npx duaer-spec init --here --method
15
- npx duaer-spec init --here --ops --branch develop
15
+ npx duaer-spec init --here --ops # default integration note: develop
16
16
  ```
17
17
 
18
+ Ensure the repo has **`main`** and **`develop`**. Agent ops require both, plus
19
+ `feat/*` / `fix/*` for work. See
20
+ [`docs/agent/branching-and-release.md`](docs/agent/branching-and-release.md).
21
+
18
22
  After that: talk to the agent in plain language. Do not teach them `/duaer-*`.
19
23
 
20
24
  ## What gets installed
21
25
 
22
- - Always-on rule: agent must run the autonomous job loop on product work
26
+ - Always-on rule: agent runs the autonomous job loop on product work
23
27
  - Playbook skill `duaer-do` (agent follows it; human need not invoke it)
24
- - Optional step skills for large jobs (agent-only)
25
- - Agent ops (`AGENTS.md`) when using `--all` / `--ops`
28
+ - Agent ops: `AGENTS.md`, branching/release docs, mandatory `.worktree/`
29
+ - Optional step skills for large jobs (agent-only)
26
30
 
27
- ## Power users / agents
31
+ ## Branch model (mandatory)
28
32
 
29
- | Tool | Who uses it |
33
+ | Branch | Role |
30
34
  |---|---|
31
- | `/duaer-do` procedure | Agent (automatic) |
32
- | `/duaer-specify` … `/duaer-converge` | Agent, when splitting a large job |
33
- | `duaer status` / `duaer policy` | Optional diagnostics — not required of humans |
35
+ | `main` | Production / online |
36
+ | `develop` | Day-to-day integration |
37
+ | `feat/<name>` | Features `develop` |
38
+ | `fix/<name>` | Fixes → `develop` (hotfix via `main` then back to `develop`) |
39
+
40
+ Go-live: promote `develop` → `main` only when you ask to ship.
34
41
 
35
42
  ## Precedence
36
43
 
package/AGENTS.md CHANGED
@@ -35,7 +35,8 @@ until the reported problem has been independently verified.
35
35
  close the issue when the conclusion is clear. If verification is
36
36
  inconclusive, comment with what was tried and leave the issue open.
37
37
  4. If the problem **does** exist: follow the isolated development workflow,
38
- implement the smallest coherent fix, merge into local `main`, then comment
38
+ implement the smallest coherent fix, merge into local `develop` (or
39
+ hotfix into `main` then back-merge `develop`), then comment
39
40
  on the issue and close it.
40
41
  5. Write the issue comment in the issue's language (the language of the
41
42
  original title and body). Repository docs, code, and commits stay English
@@ -103,6 +104,23 @@ copy limited to the information and actions users need to complete the task:
103
104
  * Put rationale and implementation detail in documentation or code comments,
104
105
  not in the page UI, unless the user explicitly requests explanatory content.
105
106
 
107
+ ## Mandatory branch model
108
+
109
+ Repositories that adopt this agent-ops contract **must** use:
110
+
111
+ | Branch | Role |
112
+ |---|---|
113
+ | **`main`** | Production / officially online |
114
+ | **`develop`** | Day-to-day integration and debugging |
115
+ | **`feat/<name>`** | Feature work (from `develop` → merge to `develop`) |
116
+ | **`fix/<name>`** | Bug fixes (from `develop` → `develop`; hotfixes from `main` → `main` then back to `develop`) |
117
+
118
+ Do **not** develop on `main` or `develop`. Full flows (including go-live by
119
+ issue type): [branching-and-release](docs/agent/branching-and-release.md).
120
+
121
+ **duaer-spec itself** uses this model: integrate on **`develop`**, promote to
122
+ **`main`** only when shipping.
123
+
106
124
  ## Mandatory Isolated Development
107
125
 
108
126
  Every request must use its own dedicated branch and worktree.
@@ -113,8 +131,9 @@ Landing-blocker commits, if needed, go on top of the author's branch.
113
131
 
114
132
  Before modifying any file, the agent must:
115
133
 
116
- 1. Update the primary checkout's local `main`
117
- 2. Create a unique branch from the updated `main`
134
+ 1. Update the primary checkout's local **`develop`** (or **`main`** for a
135
+ production hotfix)
136
+ 2. Create a unique branch from that base (`feat/…` or `fix/…`)
118
137
  3. Create a dedicated worktree **under the project** at `.worktree/<request-id>`
119
138
  4. Enter that worktree
120
139
  5. Only then begin development
@@ -122,13 +141,13 @@ Before modifying any file, the agent must:
122
141
  Worktrees live in **`.worktree/`** at the repository root. That directory is
123
142
  **mandatory**, not optional, and **must never be committed** (see `.gitignore`).
124
143
 
125
- Example:
144
+ Example (normal feature):
126
145
 
127
146
  ```bash
128
- git switch main
147
+ git switch develop
129
148
  git pull --ff-only
130
149
  mkdir -p .worktree
131
- git worktree add .worktree/<request-id> -b <type>/<request-id> main
150
+ git worktree add .worktree/<request-id> -b feat/<request-id> develop
132
151
  cd .worktree/<request-id>
133
152
  ```
134
153
 
@@ -136,26 +155,21 @@ Branch and worktree names must be unique and clearly associated with the request
136
155
  Do **not** place request worktrees outside the repo (for example `../worktrees/`)
137
156
  unless the project baseline explicitly overrides this and still keeps them
138
157
  untracked.
139
-
140
- **This repository's default integration branch is `main`.** Adopting projects
141
- may substitute another long-lived branch (for example `develop`); document that
142
- override in the project baseline. Do not inherit git policy from `examples/`.
143
-
144
158
  ## Multi-Agent Isolation
145
159
 
146
160
  * Each agent must use its own branch and worktree
147
161
  * Never develop directly in the primary checkout
148
- * Never develop directly on `main` (or the project's integration branch)
162
+ * Never develop directly on `main` or `develop`
149
163
  * Never reuse another agent's branch or worktree
150
164
  * Never modify files inside another request's worktree
151
165
  * Never switch another agent's branch
152
166
  * Never delete another agent's branch or worktree
153
167
  * Never include unrelated changes from another request
154
- * Do not commit local environment files, caches, databases, or secrets
168
+ * Do not commit local environment files, caches, databases, secrets, or `.worktree/`
155
169
 
156
- The primary checkout is reserved for synchronizing and merging the integration
157
- branch. Shared toolchains and caches may be reused when that cannot modify
158
- tracked files or interfere with another worktree.
170
+ The primary checkout is reserved for synchronizing and merging **`develop`**
171
+ (and **`main`** on promote / hotfix). Shared toolchains and caches may be
172
+ reused when that cannot modify tracked files or interfere with another worktree.
159
173
 
160
174
  ## Immutable Rules
161
175
 
@@ -186,25 +200,33 @@ explicitly requested by the user, **except** for forked third-party pull
186
200
  request heads when the project requires local suites before merge. Record the
187
201
  result in the pull request comment.
188
202
 
189
- ### 4. Merge Back into Local `main`
203
+ ### 4. Merge Back into Local `develop` (or hotfix `main`)
190
204
 
191
- After development:
205
+ After normal development:
192
206
 
193
207
  1. Complete targeted validation
194
208
  2. Review the complete diff
195
209
  3. Commit all logical changes
196
- 4. Update the request branch with the latest local `main`
210
+ 4. Update the request branch with the latest local **`develop`**
197
211
  5. Resolve conflicts inside the request worktree
198
212
  6. Return to the primary checkout
199
- 7. Merge the request branch into local `main`
213
+ 7. Merge the request branch into local **`develop`**
200
214
  8. Verify the expected commits are present
201
- 9. Remove the request worktree
202
- 10. Delete the merged request branch
203
- 11. Push only when the user explicitly requested remote publishing for the
215
+ 9. Stop any server/process started from the request worktree; if the user still
216
+ needs a local service, start it from the primary checkout on **`develop`**
217
+ 10. Remove the request worktree
218
+ 11. Delete the merged request branch
219
+ 12. Push only when the user explicitly requested remote publishing for the
204
220
  current request
221
+ 13. Promote **`develop` → `main`** only when the user explicitly asks to ship /
222
+ go online (see [branching-and-release](docs/agent/branching-and-release.md))
223
+
224
+ **Production hotfix:** base and merge into **`main`**, then merge the fix into
225
+ **`develop`** so integration does not regress. Then clean up the worktree.
205
226
 
206
- If another agent has updated `main`, refresh the request branch before merging
207
- (`git fetch` then `git rebase main`, or merge if project policy requires it).
227
+ If another agent has updated `develop`, refresh the request branch before
228
+ merging (`git fetch` then `git rebase develop`, or merge if project policy
229
+ requires it).
208
230
 
209
231
  Do not overwrite, reset, or discard changes already merged by another agent.
210
232
 
@@ -214,26 +236,28 @@ explicitly requests that exact operation.
214
236
 
215
237
  ### 5. Clean Up the Request Worktree
216
238
 
217
- Once the request branch is merged into local `main`, remove its worktree and
218
- delete the merged branch. Never leave a merged worktree on disk.
239
+ Once the request branch is merged into local **`develop`** (or **`main`** for a
240
+ hotfix), remove its worktree and delete the merged branch. Never leave a merged
241
+ worktree on disk.
219
242
 
220
243
  ```bash
221
244
  git worktree remove .worktree/<request-id>
222
- git branch -d <type>/<request-id>
245
+ git branch -d feat|fix/<request-id>
223
246
  git worktree prune
224
247
  ```
225
248
 
226
- * Remove only after verifying merge commits are present in local `main`
249
+ * Remove only after verifying merge commits are present on the target long-lived branch
227
250
  * The worktree must be clean first
228
251
  * Use `git branch -d` (not `-D`)
229
252
  * Delete only your own worktree and branch
230
253
  * Never commit `.worktree/` (ignored)
254
+ * Stop worktree-bound services before remove; restart from primary checkout if needed
231
255
 
232
256
  ## Development Workflow
233
257
 
234
- 1. Update local `main`
235
- 2. Create a unique request branch
236
- 3. Create and enter a dedicated worktree
258
+ 1. Update local **`develop`** (or **`main`** for hotfix)
259
+ 2. Create a unique `feat/` or `fix/` branch
260
+ 3. Create and enter `.worktree/<request-id>`
237
261
  4. Read the baseline and relevant specs (and Duaer memory when present)
238
262
  5. Identify affected specs, ADRs, E2E scenarios, and validation
239
263
  6. Implement the smallest coherent change
@@ -241,16 +265,18 @@ git worktree prune
241
265
  8. Run targeted, risk-based checks
242
266
  9. Review the complete diff
243
267
  10. Commit each logical change
244
- 11. Refresh the branch against the latest local `main`
245
- 12. Merge into local `main`
246
- 13. Remove the request worktree and delete the merged branch
247
- 14. Push only when explicitly requested for the current request
268
+ 11. Refresh against latest **`develop`** (or **`main`** for hotfix)
269
+ 12. Merge into local **`develop`** (hotfix: **`main`**, then back-merge to **`develop`**)
270
+ 13. Stop worktree services; remove worktree; delete short branch
271
+ 14. Push only when explicitly requested
272
+ 15. Promote **`develop` → `main`** only when the user explicitly asks to go online
248
273
 
249
- Development must not begin before steps 1–3 are complete.
274
+ Development must not begin before isolation steps 1–3 are complete.
250
275
 
251
- For feature work that uses Duaer, prefer
252
- `specifyplantasks implement converge` (or the hotfix short path).
253
- Agent ops in this file still govern isolation, commits, and merge.
276
+ For feature work that uses Duaer, the agent runs the job loop autonomously
277
+ (Briefworkaccept). Agent ops in this file still govern isolation, commits,
278
+ and merge. Branch/release detail:
279
+ [branching-and-release](docs/agent/branching-and-release.md).
254
280
 
255
281
  ## Commit Format
256
282
 
@@ -266,20 +292,20 @@ Allowed types: `feat fix docs test chore refactor perf build ci`
266
292
 
267
293
  ## Completion Checklist
268
294
 
269
- * [ ] Local `main` was updated before development
270
- * [ ] A unique request branch was created
271
- * [ ] A dedicated worktree was created
295
+ * [ ] Local **`develop`** was updated before development (or **`main`** for hotfix)
296
+ * [ ] A unique `feat/` or `fix/` branch was created
297
+ * [ ] A dedicated worktree was created under `.worktree/`
272
298
  * [ ] All development occurred inside that worktree
273
299
  * [ ] No other agent's branch or worktree was modified
274
300
  * [ ] Relevant specs and E2E scenarios were updated
275
301
  * [ ] Targeted validation passed or was documented as unnecessary
276
- * [ ] No secrets, local data, or unrelated changes are included
302
+ * [ ] No secrets, local data, `.worktree/`, or unrelated changes are included
277
303
  * [ ] All logical changes were committed
278
- * [ ] The branch was refreshed against the latest local `main`
279
- * [ ] Changes were merged into local `main`
280
- * [ ] The request worktree was removed after the merge
281
- * [ ] The merged request branch was deleted
304
+ * [ ] The branch was refreshed against the latest local **`develop`** (or hotfix base)
305
+ * [ ] Changes were merged into local **`develop`** (hotfix: **`main`** + back-merge **`develop`**)
306
+ * [ ] Worktree-bound services stopped; worktree removed; short branch deleted
282
307
  * [ ] Remote publishing was skipped unless explicitly requested
308
+ * [ ] Promotion **`develop` → `main`** only if the user asked to go online
283
309
  * [ ] If pushed, the remote, branch, commit set, and Git identity were verified
284
310
  * [ ] If a GitHub issue was linked: verified before work; commented in its
285
311
  language; closed when conclusive
@@ -295,7 +321,9 @@ Report:
295
321
  * Documentation updated
296
322
  * Validation performed or skipped
297
323
  * Commit hashes and messages
298
- * Merge result
324
+ * Merge target (`develop` / `main`) and result
299
325
  * Worktree and branch cleanup result
326
+ * Service handoff (stopped in worktree / restarted on develop) if applicable
300
327
  * Push target and result, or confirmation that nothing was pushed
328
+ * Whether `main` was promoted (or N/A)
301
329
  * Linked GitHub issue / PR outcomes (or N/A)
package/CHANGELOG.md CHANGED
@@ -1,35 +1,46 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0 — 2026-09-15
4
+
5
+ ### Mandatory branch model + release flows
6
+
7
+ - Required branches: **`main`** (production), **`develop`** (integration),
8
+ **`feat/*`**, **`fix/*`**
9
+ - New doc: [`docs/agent/branching-and-release.md`](docs/agent/branching-and-release.md)
10
+ — day-to-day, go-live, feature / bug / hotfix / issue / PR flows
11
+ - Agent ops merge target is **`develop`**; promote to **`main`** only when
12
+ shipping; hotfixes from `main` then back-merge `develop`
13
+ - Worktree cleanup includes stopping services and restarting on `develop` if needed
14
+ - `duaer init` default `--branch` is `develop`
15
+
16
+ ## 0.5.1 — 2026-09-15
17
+
18
+ ### Mandatory in-repo worktrees
19
+
20
+ - Request worktrees **must** live under **`.worktree/<request-id>`**
21
+ - `.worktree/` is gitignored; `duaer init` ensures the ignore rule
22
+
3
23
  ## 0.5.0 — 2026-09-15
4
24
 
5
25
  ### Autonomous digital employee
6
26
 
7
- - **Simplicity = humans do not operate the workflow**
8
- - Always-on rule: on product asks, the agent runs Brief → work → accept itself
9
- - Do not require `/duaer-do`, phase slash commands, or `duaer status` from humans
10
- - `duaer-do` is the agent’s internal playbook; install once, then talk
11
- - README / init / ADOPT / DUADER rewritten around “ask, don’t operate”
27
+ - Humans ask; agents run Brief work → accept without slash-command ops
12
28
 
13
29
  ## 0.4.0 — 2026-09-15
14
30
 
15
- ### Simple everyday ops
16
-
17
- - `/duaer-do` one-shot skill + `duaer status`
18
- - Step skills demoted to advanced (later reframed as agent-only in 0.5)
31
+ - `/duaer-do` + `duaer status` everyday path (later reframed as agent-internal)
19
32
 
20
33
  ## 0.3.0 — 2026-09-15
21
34
 
22
- ### Job handoff (not a repo lock)
23
-
24
- - `coach` / `strict` / `off` policy; active job; `duaer job` / `policy`
35
+ - Job handoff policy (`coach` / `strict` / `off`)
25
36
 
26
37
  ## 0.2.0 — 2026-09-15
27
38
 
28
- - `delivery.json` + checkable handoff state
39
+ - `delivery.json` handoff stamp
29
40
 
30
41
  ## 0.1.1 — 2026-09-15
31
42
 
32
- - Digital-employee delivery OS positioning
43
+ - Digital-employee positioning
33
44
 
34
45
  ## 0.1.0 — 2026-09-15
35
46
 
package/README.md CHANGED
@@ -26,10 +26,22 @@ required.
26
26
  Step skills and CLI checks exist for agents and power users — not as the
27
27
  everyday human UI.
28
28
 
29
+ ## Branches (mandatory)
30
+
31
+ | Branch | Role |
32
+ |---|---|
33
+ | `main` | Production / online |
34
+ | `develop` | Day-to-day integration |
35
+ | `feat/<name>` | Features → `develop` |
36
+ | `fix/<name>` | Fixes → `develop` (hotfix via `main`) |
37
+
38
+ Go-live and flows by issue type:
39
+ [`docs/agent/branching-and-release.md`](docs/agent/branching-and-release.md).
40
+
29
41
  ## Optional
30
42
 
31
43
  ```bash
32
- npx duaer-spec@0.5.0 init --here --method # method only
44
+ npx duaer-spec@0.6.0 init --here --method # method only
33
45
  ```
34
46
 
35
47
  Details: [`ADOPT.md`](ADOPT.md) · Method: [`DUADER.md`](DUADER.md) · Ops: [`AGENTS.md`](AGENTS.md)
package/bin/duaer.mjs CHANGED
@@ -35,7 +35,7 @@ Agent / optional diagnostics:
35
35
  duaer status [dir]
36
36
  duaer check | policy | version
37
37
 
38
- Init: --all (default) | --method | --ops | --force | --branch <n> | --here
38
+ Init: --all (default) | --method | --ops | --force | --branch <n> (default: develop) | --here
39
39
 
40
40
  Example:
41
41
  npx duaer-spec init --here
@@ -48,7 +48,7 @@ function parseArgs(argv) {
48
48
  dir: '.',
49
49
  mode: 'all',
50
50
  force: false,
51
- branch: 'main',
51
+ branch: 'develop',
52
52
  workplace: false,
53
53
  delivery: false,
54
54
  job: false,
@@ -227,7 +227,13 @@ function installOps(target, opts) {
227
227
  console.log(' .cursor/rules/agents-workflow.mdc, ai-ui-copy.mdc')
228
228
 
229
229
  ensureDir(join(target, 'docs', 'agent'))
230
- for (const name of ['workflow.md', 'change-checklist.md', 'e2e-test-plan.md', 'README.md']) {
230
+ for (const name of [
231
+ 'workflow.md',
232
+ 'change-checklist.md',
233
+ 'e2e-test-plan.md',
234
+ 'branching-and-release.md',
235
+ 'README.md',
236
+ ]) {
231
237
  copyPath(
232
238
  join(PKG_ROOT, 'docs', 'agent', name),
233
239
  join(target, 'docs', 'agent', name),
@@ -6,6 +6,7 @@ Wins over Duaer and `examples/` when they conflict.
6
6
  | Doc | Description |
7
7
  |---|---|
8
8
  | [workflow.md](workflow.md) | Rules R1–R6, development loop, spec guidance |
9
+ | [branching-and-release.md](branching-and-release.md) | **Required** `main`/`develop`/`feat`/`fix` + go-live by issue type |
9
10
  | [change-checklist.md](change-checklist.md) | Finish checklist |
10
11
  | [e2e-test-plan.md](e2e-test-plan.md) | E2E scenario catalog template |
11
12
 
@@ -0,0 +1,176 @@
1
+ # Branching and release flows
2
+
3
+ > Part of **duaer-spec** agent ops. Precedence: [`AGENTS.md`](../../AGENTS.md) ·
4
+ > [workflow](workflow.md).
5
+ > Language: English for branch names and docs.
6
+
7
+ This is **mandatory** for repositories that adopt duaer-spec agent ops.
8
+ Yes: every such repo **must** have a production main branch, a development
9
+ integration branch, feature branches, and bugfix branches.
10
+
11
+ ---
12
+
13
+ ## 1. Required branch model
14
+
15
+ | Branch | Role | Who merges here |
16
+ |---|---|---|
17
+ | **`main`** | Production / officially online | Only **promotion / release** (or emergency hotfix) |
18
+ | **`develop`** | Day-to-day integration and debugging | Finished `feat/*` and normal `fix/*` |
19
+ | **`feat/<name>`** | One feature / one request | → `develop` when ready to integrate |
20
+ | **`fix/<name>`** | One bugfix / one request | → `develop` (normal); or → `main` then `develop` (hotfix) |
21
+
22
+ ### Rules
23
+
24
+ 1. **Do not develop on `main` or `develop`.** Those are long-lived only.
25
+ 2. **Every request** uses a short-lived `feat/` or `fix/` branch **and** a
26
+ mandatory worktree at `.worktree/<request-id>` (never commit `.worktree/`).
27
+ 3. **Default base for new work:** updated local **`develop`**.
28
+ 4. **Going online** means promoting `develop` → `main` (or a release PR into
29
+ `main`) when the user **explicitly** asks to ship / go online.
30
+ 5. **Push** is always opt-in; never infer push from “merge” or “done”.
31
+
32
+ ### Naming
33
+
34
+ ```text
35
+ feat/<short-description> # new capability / improvement
36
+ fix/<short-description> # defect
37
+ ```
38
+
39
+ Optional types when the project already uses them: `docs/`, `chore/`, `refactor/`,
40
+ `test/`, `ci/` — still branch from `develop`, merge back to `develop` first.
41
+
42
+ ---
43
+
44
+ ## 2. Day-to-day development (feature or normal bug)
45
+
46
+ ```text
47
+ update develop
48
+ → git worktree add .worktree/<id> -b feat|fix/<name> develop
49
+ → work only in that worktree (Duaer job loop as needed)
50
+ → merge into local develop
51
+ → stop any server started in the worktree
52
+ → remove .worktree/<id>; delete feat|fix/<name>
53
+ → (optional) start/restart services from the primary checkout on develop
54
+ → push develop only if the user asked
55
+ ```
56
+
57
+ Example:
58
+
59
+ ```bash
60
+ git switch develop
61
+ git pull --ff-only
62
+ mkdir -p .worktree
63
+ git worktree add .worktree/feat-login -b feat/login develop
64
+ cd .worktree/feat-login
65
+ # ... implement, commit ...
66
+ cd ../.. # primary checkout
67
+ git switch develop
68
+ git merge feat/login
69
+ # stop processes that used .worktree/feat-login
70
+ git worktree remove .worktree/feat-login
71
+ git branch -d feat/login
72
+ ```
73
+
74
+ **After merge / before delete worktree:** if a local service was running from the
75
+ worktree, stop it; if the user still needs it, start it again from the primary
76
+ checkout on **`develop`** (merged tree). Do not expect the old worktree process
77
+ to survive directory removal.
78
+
79
+ ---
80
+
81
+ ## 3. Go-live / online (promote to production)
82
+
83
+ Use when the user explicitly asks to **ship**, **go online**, **release**, or
84
+ **promote to production**.
85
+
86
+ ```text
87
+ develop is green / accepted for release
88
+ → update local main and develop
89
+ → merge develop → main (or open/merge release PR main ← develop)
90
+ → tag / release notes if the project uses them
91
+ → push main (and tags) only if the user asked to publish
92
+ → deploy per project runbook (out of scope for duaer-spec itself)
93
+ ```
94
+
95
+ Never merge a random `feat/*` straight into `main` for a normal feature.
96
+ Features land on **`develop` first**, then ride a promotion to **`main`**.
97
+
98
+ ---
99
+
100
+ ## 4. Flows by problem type
101
+
102
+ ### A. New feature / improvement
103
+
104
+ | Step | Action |
105
+ |---|---|
106
+ | Branch | `feat/<name>` from **`develop`** |
107
+ | Worktree | `.worktree/<id>` (required) |
108
+ | Integrate | Merge → **`develop`** |
109
+ | Online | Later promotion **`develop` → `main`** when user asks to ship |
110
+
111
+ ### B. Normal bug (not blocking production)
112
+
113
+ | Step | Action |
114
+ |---|---|
115
+ | Branch | `fix/<name>` from **`develop`** |
116
+ | Worktree | `.worktree/<id>` |
117
+ | Integrate | Merge → **`develop`** |
118
+ | Online | Same as features: ship when promoting `develop` → `main` |
119
+
120
+ ### C. Production hotfix (must go live immediately)
121
+
122
+ | Step | Action |
123
+ |---|---|
124
+ | Branch | `fix/<name>` from **`main`** |
125
+ | Worktree | `.worktree/<id>` |
126
+ | Online | Merge → **`main`** first (after validation) |
127
+ | Backport | Merge the same fix into **`develop`** (or merge `main` into `develop`) so develop does not regress |
128
+ | Cleanup | Remove worktree; delete `fix/<name>` |
129
+ | Push | Only if the user asked to publish |
130
+
131
+ ### D. Docs / chore / CI-only
132
+
133
+ Same as **A**: from `develop`, merge to `develop`. Promote with the next
134
+ `develop` → `main` ship unless the user asks for an urgent docs-only release.
135
+
136
+ ### E. Linked GitHub issue
137
+
138
+ Still: verify the claim (R5), then use **A/B/C** by issue type. Closing the
139
+ issue does not mean push or promote to `main`.
140
+
141
+ ### F. Linked GitHub PR
142
+
143
+ Judge principle (R6). Merge that PR into the correct target (`develop` for
144
+ normal work, `main` only if it is already a production/hotfix PR). Completeness
145
+ follow-up stays on `develop` unless it is a landing blocker.
146
+
147
+ ---
148
+
149
+ ## 5. What agents must not do
150
+
151
+ - Develop or commit directly on `main` or `develop`
152
+ - Skip `.worktree/` isolation
153
+ - Merge feature work only to `main` and leave `develop` behind
154
+ - Push, tag, or deploy without an explicit user ask for that action
155
+ - Leave a merged worktree on disk
156
+ - Assume a server started inside a worktree still runs after `worktree remove`
157
+
158
+ ---
159
+
160
+ ## 6. Primary checkout role
161
+
162
+ The primary clone is for:
163
+
164
+ - updating and merging **`develop`** (and **`main`** on promote/hotfix)
165
+ - creating/removing `.worktree/<id>` entries
166
+
167
+ All implementation edits happen inside the request worktree.
168
+
169
+ ---
170
+
171
+ ## Related
172
+
173
+ - [workflow.md](workflow.md) — R4 and development loop
174
+ - [change-checklist.md](change-checklist.md) — finish checklist
175
+ - [baseline.md](../baseline.md) — frozen: `develop` + `main`
176
+ - [ADOPT.md](../../ADOPT.md) — install into another repo
@@ -43,11 +43,12 @@ See [R6](workflow.md#r6--merge-a-linked-pull-request-whose-principle-is-sound-th
43
43
  ## 1. Request Start
44
44
 
45
45
  - [ ] Existing uncommitted work is identified and preserved.
46
- - [ ] `origin/main` fetched; local `main` fast-forwarded when clean.
47
- - [ ] Dedicated `<type>/<short-description>` branch and worktree created from
48
- that commit under **`.worktree/<request-id>`** (mandatory; never commit `.worktree/`).
46
+ - [ ] `origin/develop` fetched; local `develop` fast-forwarded when clean
47
+ (hotfix: `main`).
48
+ - [ ] Dedicated `feat/` or `fix/` branch and worktree under
49
+ **`.worktree/<request-id>`** (mandatory; never commit `.worktree/`).
49
50
  - [ ] Shared toolchains/caches reused where safe; mutable state stays local.
50
- - [ ] Current branch is not `main` before implementation begins.
51
+ - [ ] Current branch is not `main` or `develop` before implementation begins.
51
52
 
52
53
  ---
53
54
 
@@ -95,10 +96,12 @@ See [spec update guidance](workflow.md#3-spec-update-guidance).
95
96
  ## 6. Merge / PR
96
97
 
97
98
  - [ ] Active job handoff considered by the **agent** (do not require the human to run CLI for routine work).
98
- - [ ] Branch refreshed against latest `main`.
99
- - [ ] Merged into local `main` (and/or remote PR/MR when required).
99
+ - [ ] Branch refreshed against latest `develop` (hotfix: `main`).
100
+ - [ ] Merged into local `develop` (hotfix: `main`, then back-merge `develop`).
101
+ - [ ] Worktree services stopped; worktree removed; short branch deleted.
100
102
  - [ ] Only this request's logical changes included.
101
103
  - [ ] Push performed only if the user explicitly asked for this request.
104
+ - [ ] `develop` → `main` promotion only if the user asked to go online.
102
105
 
103
106
  ---
104
107
 
@@ -117,15 +120,16 @@ See [spec update guidance](workflow.md#3-spec-update-guidance).
117
120
 
118
121
  | # | Gate | Source |
119
122
  |---|---|---|
120
- | 1 | Branch + worktree from up-to-date `main` | [R4](workflow.md#r4--request-branch--worktree--merge-gate) |
123
+ | 1 | Branch + `.worktree/` from up-to-date `develop` (hotfix: `main`) | [R4](workflow.md#r4--request-branch--worktree--merge-gate) · [branching](branching-and-release.md) |
121
124
  | 2 | Change implements the planned work | [Development loop](workflow.md#2-development-loop) |
122
125
  | 3 | Impacted specs updated | [R1](workflow.md#r1--spec-first--spec-sync) |
123
126
  | 4 | E2E docs updated or confirmed unnecessary | [R3](workflow.md#r3--e2e-coverage-doc) |
124
127
  | 5 | Targeted validation done or waived with reason | Development loop |
125
- | 5a | Active job handoff via `duaer job` (coach/strict) | Delivery OS — not a git lock |
128
+ | 5a | Active job handoff by the agent (coach/strict) | Delivery OS — not a git lock |
126
129
  | 6 | Conventional commits | [R2](workflow.md#r2--commit-per-change) |
127
- | 7 | No secrets or local data | [§4](workflow.md#4-what-never-to-commit) |
128
- | 8 | Merged into `main`; worktree and branch removed | [R4](workflow.md#r4--request-branch--worktree--merge-gate) · [§6.1](#61-merge-cleanup) |
130
+ | 7 | No secrets, local data, or `.worktree/` | [§4](workflow.md#4-what-never-to-commit) |
131
+ | 8 | Merged to `develop` (hotfix: `main` + back-merge); worktree cleaned | [R4](workflow.md#r4--request-branch--worktree--merge-gate) |
132
+ | 8a | `develop` → `main` only if user asked to go online | [branching-and-release](branching-and-release.md) |
129
133
  | 9 | Linked issue: verified, commented, closed when conclusive | [R5](workflow.md#r5--verify-linked-github-issues-before-work-then-reply-and-close) |
130
134
  | 10 | Linked PR: principle reviewed; merged when sound; follow-up after | [R6](workflow.md#r6--merge-a-linked-pull-request-whose-principle-is-sound-then-follow-up) |
131
135
 
@@ -31,6 +31,8 @@ the table for their app.
31
31
  | E2E-004 | Default `coach`: unfinished job — agent must not claim done | manual |
32
32
  | E2E-005 | Converge stamps `accepted`; agent reports ready for review | manual |
33
33
  | E2E-006 | `duaer-do` skill describes agent-triggered loop | manual |
34
+ | E2E-007 | Request worktrees use `.worktree/<id>`; `.worktree/` gitignored | manual |
35
+ | E2E-008 | Docs require main+develop+feat+fix and typed go-live flows | manual |
34
36
 
35
37
  ## Traceability
36
38
 
@@ -42,3 +44,5 @@ the table for their app.
42
44
  | E2E-004 | policy coach | Handoff etiquette |
43
45
  | E2E-005 | `delivery.json` | Accept stamp |
44
46
  | E2E-006 | `duaer-do` | Internal playbook |
47
+ | E2E-007 | `.worktree/` + `.gitignore` | Mandatory isolation |
48
+ | E2E-008 | `branching-and-release.md` | Branch + release matrix |
@@ -41,27 +41,29 @@ handling. They cannot be relaxed without explicit human override.
41
41
 
42
42
  ### R4 — Request branch + worktree + merge gate
43
43
 
44
- > **Every new request starts from `main` in a dedicated worktree on a dedicated
45
- > branch and finishes only after it is merged into `main`.**
44
+ > **Every new request starts from `develop` (hotfix: `main`) in a dedicated
45
+ > `.worktree/<id>` on a `feat/*` or `fix/*` branch, and finishes after merge
46
+ > into that long-lived target. Going online is a separate `develop` → `main`
47
+ > promotion when the user asks to ship.**
46
48
 
47
49
  - Before editing: preserve existing uncommitted work; fetch and fast-forward
48
- local `main` when clean; create a new request branch and a dedicated worktree
49
- at **`.worktree/<request-id>`** under the project root. Worktrees are
50
+ local **`develop`** when clean (hotfix: **`main`**); create a new request
51
+ branch and worktree at **`.worktree/<request-id>`**. Worktrees are
50
52
  **mandatory**. Never stash or overwrite another agent's work merely to start.
51
- - Name branches `<type>/<short-description>` (for example `feat/adopt-docs`).
52
- - Do not implement in the primary checkout or reuse another request's worktree.
53
+ - Name branches `feat/<short-description>` or `fix/<short-description>`.
54
+ - Do not implement in the primary checkout or on `main` / `develop`.
53
55
  - Keep `.worktree/` gitignored — never commit request worktrees.
54
- - Reuse shared toolchains and caches where safe; keep mutable or
55
- concurrency-sensitive state worktree-local and ignored.
56
- - After validation: merge into local `main` (or via PR/MR when required), then
57
- remove the request worktree and delete the merged branch immediately.
58
- - Push only when the user explicitly requests remote publishing for this
59
- request.
56
+ - After validation: merge into local **`develop`** (hotfix: **`main`**, then
57
+ back-merge **`develop`**), stop worktree-bound services, remove the worktree,
58
+ delete the short branch.
59
+ - Push only when the user explicitly requests remote publishing.
60
+ - Promote **`develop` → `main`** only when the user explicitly asks to go online.
60
61
 
61
- Adopting projects may replace `main` with another integration branch; document
62
- it in the project baseline. **duaer-spec itself uses `main`.** Example overlays
63
- under `examples/` do not change this repo's default.
62
+ Full matrix by issue type:
63
+ [branching-and-release](branching-and-release.md).
64
64
 
65
+ **duaer-spec itself** requires `main` + `develop` + `feat/*` + `fix/*`.
66
+ Example overlays under `examples/` do not change this.
65
67
  ### R5 — Verify linked GitHub issues before work, then reply and close
66
68
 
67
69
  > **A linked GitHub issue is not a task until the reported problem is shown to
@@ -84,16 +86,18 @@ unrelated pushes.
84
86
  ## 2. Development Loop
85
87
 
86
88
  1. **Intake** — If an issue or PR is linked, complete R5 / R6 first.
87
- 2. **Isolate** — Update `main`, create branch + worktree (R4).
89
+ 2. **Isolate** — Update `develop` (hotfix: `main`), create `feat|fix` + `.worktree/` (R4).
88
90
  3. **Orient** — Read baseline, relevant specs, and Duaer memory when present.
89
- 4. **Specify (when using Duaer)** — Feature / hotfix specs before coding.
91
+ 4. **Specify (when using Duaer)** — Agent runs Brief work → accept autonomously.
90
92
  5. **Implement** — Smallest coherent change; update specs alongside (R1).
91
93
  6. **Verify** — Targeted checks; E2E runs only if the user asks (except fork
92
94
  landing rules in `AGENTS.md`).
93
95
  7. **Commit** — One logical change per commit (R2).
94
- 8. **Merge & clean** — Refresh against `main`, merge, remove worktree (R4 / R5).
95
- 9. **Report** Use the Final Report section in `AGENTS.md`.
96
-
96
+ 8. **Merge & clean** — Merge to `develop` (hotfix: `main` + back-merge), stop
97
+ worktree services, remove worktree (R4).
98
+ 9. **Go online** — Only if asked: promote `develop` → `main`
99
+ ([branching-and-release](branching-and-release.md)).
100
+ 10. **Report** — Use the Final Report section in `AGENTS.md`.
97
101
  ---
98
102
 
99
103
  ## 3. Spec Update Guidance
@@ -114,6 +118,7 @@ when changing duaer-spec's own agent-ops contract.
114
118
 
115
119
  - Secrets, tokens, credentials, private keys
116
120
  - Local databases, caches, build artifacts, `node_modules/`
121
+ - `.worktree/` (mandatory request worktrees)
117
122
  - Machine-specific paths or environment files with secrets
118
123
  - Unrelated changes from another request or agent
119
124
 
package/docs/baseline.md CHANGED
@@ -1,10 +1,22 @@
1
1
  # Baseline (project-specific)
2
2
 
3
3
  Frozen decisions for the adopting project: language, stack, architecture
4
- boundaries, and integration-branch override (if not `main`).
4
+ boundaries, and branch model.
5
5
 
6
- **duaer-spec itself:** English docs and commits; integration branch `main`;
7
- no application runtime.
6
+ ## Branch model (mandatory)
8
7
 
9
- When you copy agent ops into another repository, replace this file with that
10
- product's baseline (or point agents at the project's existing baseline path).
8
+ | Branch | Role |
9
+ |---|---|
10
+ | `main` | Production / officially online |
11
+ | `develop` | Day-to-day integration |
12
+ | `feat/<name>` | Features |
13
+ | `fix/<name>` | Bug fixes |
14
+
15
+ See [branching-and-release](agent/branching-and-release.md).
16
+
17
+ **duaer-spec itself:** English docs and commits; integrate on **`develop`**;
18
+ promote to **`main`** when shipping; no application runtime.
19
+
20
+ When you copy agent ops into another repository, keep this branch model unless
21
+ the project explicitly documents a justified exception in an ADR (not
22
+ recommended).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duaer-spec",
3
- "version": "0.5.1",
4
- "description": "Digital employees that run Spec→work→accept themselves — humans just ask",
3
+ "version": "0.6.0",
4
+ "description": "Digital employees: autonomous Spec→work→accept; mandatory main/develop/feat/fix",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "duaer": "bin/duaer.mjs",