duaer-spec 0.5.0 → 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,45 +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`) |
16
18
 
17
- ## Isolated development
19
+ Detail: `docs/agent/branching-and-release.md`.
20
+
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 and develop only there
24
- 4. Never develop in the primary checkout or on the long-lived branch
25
- 5. Never reuse or modify another agent's branch/worktree
25
+ 1. Update local **`develop`** (hotfix: **`main`**)
26
+ 2. Create `feat/<name>` or `fix/<name>`
27
+ 3. Create worktree at **`.worktree/<request-id>`** (required)
28
+ 4. Develop only inside that worktree
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/`
32
+
33
+ ```bash
34
+ mkdir -p .worktree
35
+ git worktree add .worktree/<request-id> -b feat/<name> develop
36
+ cd .worktree/<request-id>
37
+ ```
26
38
 
27
39
  ## Immutable habits
28
40
 
29
- - 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
30
42
  - One logical change per commit; leave the worktree clean
31
- - User/protocol-visible changes update the project's E2E scenario docs
32
- - Merge the request branch back into the local integration branch when done
33
- - Remove the request worktree and delete the merged branch after merge
34
- - Push only when the user explicitly asks for this request
35
-
36
- ## GitHub issue intake
37
-
38
- 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
39
48
 
40
- ## GitHub PR intake
49
+ ## GitHub issue / PR intake
41
50
 
42
- 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.
43
54
 
44
55
  ## Commits
45
56
 
@@ -47,4 +58,4 @@ If the user links a PR: judge the principle first. If sound, merge that PR (pres
47
58
  type(scope): description
48
59
  ```
49
60
 
50
- 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,11 +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 **`develop`** (hotfix: **`main`**),
20
+ create `feat|fix/<name>`, add worktree at `.worktree/<request-id>`,
21
+ work only there. Never skip the worktree. Never commit `.worktree/`.
22
+ Never develop on `main` or `develop`.
19
23
  1. **Silently follow** the procedure in `.cursor/skills/duaer-do/SKILL.md`
20
24
  (assign Brief → light tasks → implement → converge → handoff line).
21
25
  2. Do **not** wait for `/duaer-do` or any other skill invocation.
22
26
  3. Do **not** say “please run `/duaer-specify`” — you do it.
23
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`.
24
31
 
25
32
  ## Handoff
26
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,42 +131,45 @@ 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`
118
- 3. Create a dedicated worktree for that branch
119
- 4. Enter the new worktree
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/…`)
137
+ 3. Create a dedicated worktree **under the project** at `.worktree/<request-id>`
138
+ 4. Enter that worktree
120
139
  5. Only then begin development
121
140
 
122
- Example:
141
+ Worktrees live in **`.worktree/`** at the repository root. That directory is
142
+ **mandatory**, not optional, and **must never be committed** (see `.gitignore`).
143
+
144
+ Example (normal feature):
123
145
 
124
146
  ```bash
125
- git switch main
147
+ git switch develop
126
148
  git pull --ff-only
127
- git worktree add ../worktrees/<request-id> -b <type>/<request-id> main
128
- cd ../worktrees/<request-id>
149
+ mkdir -p .worktree
150
+ git worktree add .worktree/<request-id> -b feat/<request-id> develop
151
+ cd .worktree/<request-id>
129
152
  ```
130
153
 
131
154
  Branch and worktree names must be unique and clearly associated with the request.
132
-
133
- **This repository's default integration branch is `main`.** Adopting projects
134
- may substitute another long-lived branch (for example `develop`); document that
135
- override in the project baseline. Do not inherit git policy from `examples/`.
136
-
155
+ Do **not** place request worktrees outside the repo (for example `../worktrees/`)
156
+ unless the project baseline explicitly overrides this and still keeps them
157
+ untracked.
137
158
  ## Multi-Agent Isolation
138
159
 
139
160
  * Each agent must use its own branch and worktree
140
161
  * Never develop directly in the primary checkout
141
- * Never develop directly on `main` (or the project's integration branch)
162
+ * Never develop directly on `main` or `develop`
142
163
  * Never reuse another agent's branch or worktree
143
164
  * Never modify files inside another request's worktree
144
165
  * Never switch another agent's branch
145
166
  * Never delete another agent's branch or worktree
146
167
  * Never include unrelated changes from another request
147
- * Do not commit local environment files, caches, databases, or secrets
168
+ * Do not commit local environment files, caches, databases, secrets, or `.worktree/`
148
169
 
149
- The primary checkout is reserved for synchronizing and merging the integration
150
- branch. Shared toolchains and caches may be reused when that cannot modify
151
- 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.
152
173
 
153
174
  ## Immutable Rules
154
175
 
@@ -179,25 +200,33 @@ explicitly requested by the user, **except** for forked third-party pull
179
200
  request heads when the project requires local suites before merge. Record the
180
201
  result in the pull request comment.
181
202
 
182
- ### 4. Merge Back into Local `main`
203
+ ### 4. Merge Back into Local `develop` (or hotfix `main`)
183
204
 
184
- After development:
205
+ After normal development:
185
206
 
186
207
  1. Complete targeted validation
187
208
  2. Review the complete diff
188
209
  3. Commit all logical changes
189
- 4. Update the request branch with the latest local `main`
210
+ 4. Update the request branch with the latest local **`develop`**
190
211
  5. Resolve conflicts inside the request worktree
191
212
  6. Return to the primary checkout
192
- 7. Merge the request branch into local `main`
213
+ 7. Merge the request branch into local **`develop`**
193
214
  8. Verify the expected commits are present
194
- 9. Remove the request worktree
195
- 10. Delete the merged request branch
196
- 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
197
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.
198
226
 
199
- If another agent has updated `main`, refresh the request branch before merging
200
- (`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).
201
230
 
202
231
  Do not overwrite, reset, or discard changes already merged by another agent.
203
232
 
@@ -207,25 +236,28 @@ explicitly requests that exact operation.
207
236
 
208
237
  ### 5. Clean Up the Request Worktree
209
238
 
210
- Once the request branch is merged into local `main`, remove its worktree and
211
- 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.
212
242
 
213
243
  ```bash
214
- git worktree remove ../worktrees/<request-id>
215
- git branch -d <type>/<request-id>
244
+ git worktree remove .worktree/<request-id>
245
+ git branch -d feat|fix/<request-id>
216
246
  git worktree prune
217
247
  ```
218
248
 
219
- * 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
220
250
  * The worktree must be clean first
221
251
  * Use `git branch -d` (not `-D`)
222
252
  * Delete only your own worktree and branch
253
+ * Never commit `.worktree/` (ignored)
254
+ * Stop worktree-bound services before remove; restart from primary checkout if needed
223
255
 
224
256
  ## Development Workflow
225
257
 
226
- 1. Update local `main`
227
- 2. Create a unique request branch
228
- 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>`
229
261
  4. Read the baseline and relevant specs (and Duaer memory when present)
230
262
  5. Identify affected specs, ADRs, E2E scenarios, and validation
231
263
  6. Implement the smallest coherent change
@@ -233,16 +265,18 @@ git worktree prune
233
265
  8. Run targeted, risk-based checks
234
266
  9. Review the complete diff
235
267
  10. Commit each logical change
236
- 11. Refresh the branch against the latest local `main`
237
- 12. Merge into local `main`
238
- 13. Remove the request worktree and delete the merged branch
239
- 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
240
273
 
241
- Development must not begin before steps 1–3 are complete.
274
+ Development must not begin before isolation steps 1–3 are complete.
242
275
 
243
- For feature work that uses Duaer, prefer
244
- `specifyplantasks implement converge` (or the hotfix short path).
245
- 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).
246
280
 
247
281
  ## Commit Format
248
282
 
@@ -258,20 +292,20 @@ Allowed types: `feat fix docs test chore refactor perf build ci`
258
292
 
259
293
  ## Completion Checklist
260
294
 
261
- * [ ] Local `main` was updated before development
262
- * [ ] A unique request branch was created
263
- * [ ] 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/`
264
298
  * [ ] All development occurred inside that worktree
265
299
  * [ ] No other agent's branch or worktree was modified
266
300
  * [ ] Relevant specs and E2E scenarios were updated
267
301
  * [ ] Targeted validation passed or was documented as unnecessary
268
- * [ ] No secrets, local data, or unrelated changes are included
302
+ * [ ] No secrets, local data, `.worktree/`, or unrelated changes are included
269
303
  * [ ] All logical changes were committed
270
- * [ ] The branch was refreshed against the latest local `main`
271
- * [ ] Changes were merged into local `main`
272
- * [ ] The request worktree was removed after the merge
273
- * [ ] 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
274
307
  * [ ] Remote publishing was skipped unless explicitly requested
308
+ * [ ] Promotion **`develop` → `main`** only if the user asked to go online
275
309
  * [ ] If pushed, the remote, branch, commit set, and Git identity were verified
276
310
  * [ ] If a GitHub issue was linked: verified before work; commented in its
277
311
  language; closed when conclusive
@@ -287,7 +321,9 @@ Report:
287
321
  * Documentation updated
288
322
  * Validation performed or skipped
289
323
  * Commit hashes and messages
290
- * Merge result
324
+ * Merge target (`develop` / `main`) and result
291
325
  * Worktree and branch cleanup result
326
+ * Service handoff (stopped in worktree / restarted on develop) if applicable
292
327
  * Push target and result, or confirmation that nothing was pushed
328
+ * Whether `main` was promoted (or N/A)
293
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,
@@ -194,6 +194,21 @@ function installMethod(target, opts) {
194
194
 
195
195
  copyPath(join(PKG_ROOT, 'DUADER.md'), join(target, 'DUADER.md'), opts)
196
196
  console.log(' DUADER.md')
197
+ ensureWorktreeGitignore(target)
198
+ }
199
+
200
+ function ensureWorktreeGitignore(target) {
201
+ const gi = join(target, '.gitignore')
202
+ const line = '.worktree/'
203
+ let text = existsSync(gi) ? readFileSync(gi, 'utf8') : ''
204
+ if (text.split(/\r?\n/).some((l) => l.trim() === line)) {
205
+ console.log(' .gitignore already ignores .worktree/')
206
+ return
207
+ }
208
+ if (text.length && !text.endsWith('\n')) text += '\n'
209
+ text += `# duaer-spec: mandatory request worktrees (do not commit)\n${line}\n`
210
+ writeFileSync(gi, text, 'utf8')
211
+ console.log(' .gitignore ← .worktree/')
197
212
  }
198
213
 
199
214
  function installOps(target, opts) {
@@ -212,7 +227,13 @@ function installOps(target, opts) {
212
227
  console.log(' .cursor/rules/agents-workflow.mdc, ai-ui-copy.mdc')
213
228
 
214
229
  ensureDir(join(target, 'docs', 'agent'))
215
- 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
+ ]) {
216
237
  copyPath(
217
238
  join(PKG_ROOT, 'docs', 'agent', name),
218
239
  join(target, 'docs', 'agent', name),
@@ -220,6 +241,7 @@ function installOps(target, opts) {
220
241
  )
221
242
  }
222
243
  console.log(' docs/agent/')
244
+ ensureWorktreeGitignore(target)
223
245
 
224
246
  const baselineSrc = join(PKG_ROOT, 'docs', 'baseline.md')
225
247
  const baselineDst = join(target, 'docs', 'baseline.md')
@@ -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.
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,25 +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 worktree from that
49
- commit. Never stash or overwrite another agent's work merely to start.
50
- - Name branches `<type>/<short-description>` (for example `feat/adopt-docs`).
51
- - Do not implement in the primary checkout or reuse another request's worktree.
52
- - Reuse shared toolchains and caches where safe; keep mutable or
53
- concurrency-sensitive state worktree-local and ignored.
54
- - After validation: merge into local `main` (or via PR/MR when required), then
55
- remove the request worktree and delete the merged branch immediately.
56
- - Push only when the user explicitly requests remote publishing for this
57
- request.
58
-
59
- Adopting projects may replace `main` with another integration branch; document
60
- it in the project baseline. **duaer-spec itself uses `main`.** Example overlays
61
- under `examples/` do not change this repo's default.
62
-
50
+ local **`develop`** when clean (hotfix: **`main`**); create a new request
51
+ branch and worktree at **`.worktree/<request-id>`**. Worktrees are
52
+ **mandatory**. Never stash or overwrite another agent's work merely to start.
53
+ - Name branches `feat/<short-description>` or `fix/<short-description>`.
54
+ - Do not implement in the primary checkout or on `main` / `develop`.
55
+ - Keep `.worktree/` gitignored — never commit request worktrees.
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.
61
+
62
+ Full matrix by issue type:
63
+ [branching-and-release](branching-and-release.md).
64
+
65
+ **duaer-spec itself** requires `main` + `develop` + `feat/*` + `fix/*`.
66
+ Example overlays under `examples/` do not change this.
63
67
  ### R5 — Verify linked GitHub issues before work, then reply and close
64
68
 
65
69
  > **A linked GitHub issue is not a task until the reported problem is shown to
@@ -82,16 +86,18 @@ unrelated pushes.
82
86
  ## 2. Development Loop
83
87
 
84
88
  1. **Intake** — If an issue or PR is linked, complete R5 / R6 first.
85
- 2. **Isolate** — Update `main`, create branch + worktree (R4).
89
+ 2. **Isolate** — Update `develop` (hotfix: `main`), create `feat|fix` + `.worktree/` (R4).
86
90
  3. **Orient** — Read baseline, relevant specs, and Duaer memory when present.
87
- 4. **Specify (when using Duaer)** — Feature / hotfix specs before coding.
91
+ 4. **Specify (when using Duaer)** — Agent runs Brief work → accept autonomously.
88
92
  5. **Implement** — Smallest coherent change; update specs alongside (R1).
89
93
  6. **Verify** — Targeted checks; E2E runs only if the user asks (except fork
90
94
  landing rules in `AGENTS.md`).
91
95
  7. **Commit** — One logical change per commit (R2).
92
- 8. **Merge & clean** — Refresh against `main`, merge, remove worktree (R4 / R5).
93
- 9. **Report** Use the Final Report section in `AGENTS.md`.
94
-
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`.
95
101
  ---
96
102
 
97
103
  ## 3. Spec Update Guidance
@@ -112,6 +118,7 @@ when changing duaer-spec's own agent-ops contract.
112
118
 
113
119
  - Secrets, tokens, credentials, private keys
114
120
  - Local databases, caches, build artifacts, `node_modules/`
121
+ - `.worktree/` (mandatory request worktrees)
115
122
  - Machine-specific paths or environment files with secrets
116
123
  - Unrelated changes from another request or agent
117
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.0",
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",