@dezkareid/osddt 1.11.10 → 1.11.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -112,7 +112,7 @@ osddt/
112
112
  │ │ └── gemini.ts # Formats COMMAND_DEFINITIONS as TOML (.gemini/commands/osddt.<name>.toml)
113
113
  │ └── utils/
114
114
  │ ├── prompt.ts # Inquirer prompts: askAgents() (checkbox), askRepoType() (select), askWorktreeUrl() (input)
115
- │ └── worktree.ts # Shared worktree helpers: git version check, not-a-worktree check, writable check, state file init
115
+ │ └── worktree.ts # Shared worktree helpers: git version check, not-a-worktree check, writable check, worktree listing
116
116
  ├── dist/ # Compiled output (single ESM bundle, gitignored)
117
117
  ├── rollup.config.js # Bundles src/index.ts → dist/index.js (ESM, shebang injected)
118
118
  ├── tsconfig.json # TypeScript config
@@ -159,8 +159,8 @@ The selected agents are saved in `.osddtrc` alongside `repoType`. When `osddt up
159
159
  | `npx @dezkareid/osddt meta-info` | External | Output current branch and date as JSON |
160
160
  | `osddt done <feature-name> --dir <project-path>` | Local dev | Move `working-on/<feature>` to `done/<feature>` |
161
161
  | `npx @dezkareid/osddt done <feature-name> --dir <project-path>` | External | Move `working-on/<feature>` to `done/<feature>` |
162
- | `osddt done <feature-name> --dir <project-path> --worktree` | Local dev | Archive feature, remove git worktree, and clean state file |
163
- | `npx @dezkareid/osddt done <feature-name> --dir <project-path> --worktree` | External | Archive feature, remove git worktree, and clean state file |
162
+ | `osddt done <feature-name> --dir <project-path> --worktree` | Local dev | Archive feature and remove the git worktree |
163
+ | `npx @dezkareid/osddt done <feature-name> --dir <project-path> --worktree` | External | Archive feature and remove the git worktree |
164
164
  | `osddt update` | Local dev | Regenerate agent command files from the existing `.osddtrc` |
165
165
  | `npx @dezkareid/osddt update` | External | Regenerate agent command files from the existing `.osddtrc` |
166
166
  | `osddt start-worktree <feature-name>` | Local dev | Create a git worktree for a feature and scaffold working-on/ |
@@ -179,7 +179,7 @@ The selected agents are saved in `.osddtrc` alongside `repoType`. When `osddt up
179
179
  | `--worktree-repository <url>` | any git URL | Enable worktree workflow; saves URL as `"worktree-repository"` in `.osddtrc` |
180
180
  | `-d, --dir <directory>` | any path | Target directory (defaults to current working directory) |
181
181
 
182
- All flags are optional. Providing neither runs the fully interactive mode. When `--worktree-repository` is provided, environment checks run and `.osddt-worktrees` is initialised.
182
+ All flags are optional. Providing neither runs the fully interactive mode. When `--worktree-repository` is provided, a bare clone is created at `.bare/`, the default branch is checked out as a linked worktree, environment checks run, and all config is written to `.osddtrc`.
183
183
 
184
184
  ### Command Templates
185
185
 
@@ -268,10 +268,37 @@ Enable worktree mode once during setup by providing the repository URL:
268
268
  npx @dezkareid/osddt setup --agents claude --repo-type single --worktree-repository https://github.com/org/repo.git
269
269
  ```
270
270
 
271
- From that point on, `/osddt.start` automatically uses the worktree workflow:
271
+ This clones a bare repository into `.bare/`, checks out the default branch as a linked worktree at `.bare/main/`, and writes all config to `.osddtrc`. The resulting layout:
272
+
273
+ ```
274
+ project/ ← your working directory (contains .osddtrc)
275
+ └── .bare/
276
+ ├── main/ ← default branch checked out as a linked worktree
277
+ └── add-payment-gateway/ ← created by /osddt.start
278
+ ```
279
+
280
+ From that point on, `/osddt.start` automatically uses the worktree workflow — no further configuration needed:
281
+
282
+ **Single repo:**
283
+
284
+ ```
285
+ /osddt.start add-payment-gateway
286
+ # → creates .bare/add-payment-gateway/, checks out feat/add-payment-gateway
287
+ # → scaffolds .bare/add-payment-gateway/working-on/add-payment-gateway/
288
+ /osddt.spec
289
+ /osddt.plan use Stripe SDK, REST endpoints
290
+ /osddt.tasks
291
+ /osddt.implement
292
+ /osddt.done
293
+ # → archives working-on/, removes .bare/add-payment-gateway/
294
+ ```
295
+
296
+ **Monorepo (prompts for package path on first run):**
272
297
 
273
298
  ```
274
299
  /osddt.start add-payment-gateway
300
+ # → prompts: "Package path (e.g. apps/my-app):" → enter apps/payments
301
+ # → scaffolds .bare/add-payment-gateway/apps/payments/working-on/add-payment-gateway/
275
302
  /osddt.spec
276
303
  /osddt.plan use Stripe SDK, REST endpoints
277
304
  /osddt.tasks
@@ -279,12 +306,17 @@ From that point on, `/osddt.start` automatically uses the worktree workflow:
279
306
  /osddt.done
280
307
  ```
281
308
 
282
- The worktree is created as a sibling of the repo root (e.g. `../my-repo-add-payment-gateway`). Active worktrees are tracked in `.osddt-worktrees` (sibling to the repo root) — a JSON array with entries containing `featureName`, `branch`, `worktreePath`, `workingDir`, and `repoRoot`. `osddt.continue` and `osddt.done` read this file to resolve the correct paths. When `osddt.done` runs, it archives the planning folder **and** removes the worktree automatically.
309
+ Worktrees are tracked by git itself (`git worktree list`). `osddt.continue` and `osddt.done` call `npx @dezkareid/osddt worktree-info <feature-name>` at runtime to resolve paths no separate state file is required. When `osddt.done` runs, it archives the planning folder **and** removes the worktree automatically.
283
310
 
284
- You can customise the worktree base directory via `worktreeBase` in `.osddtrc`:
311
+ You can customise the base directory where feature worktrees are created via `worktreeBase` in `.osddtrc` (defaults to the `bare-path`):
285
312
 
286
313
  ```json
287
- { "repoType": "single", "worktree-repository": "https://github.com/org/repo.git", "worktreeBase": "/Users/me/worktrees" }
314
+ {
315
+ "repoType": "single",
316
+ "worktree-repository": "https://github.com/org/repo.git",
317
+ "bare-path": "/path/to/project/.bare",
318
+ "worktreeBase": "/Users/me/worktrees"
319
+ }
288
320
  ```
289
321
 
290
322
  ---
@@ -353,7 +385,7 @@ You can customise the worktree base directory via `worktreeBase` in `.osddtrc`:
353
385
  2. Lists all folders under `working-on/`. If there is only one, uses it automatically; if there are multiple, asks the user to pick one.
354
386
  3. Confirms all tasks in `osddt.tasks.md` are checked off (`- [x]`).
355
387
  4. Runs `npx @dezkareid/osddt worktree-info <feature-name>` to check if this is a worktree feature.
356
- - If found: runs `npx @dezkareid/osddt done <feature-name> --dir <project-path> --worktree` (archives folder, removes worktree, cleans state file).
388
+ - If found: runs `npx @dezkareid/osddt done <feature-name> --dir <project-path> --worktree` (archives folder, removes worktree via `git worktree remove`).
357
389
  - If not found: runs `npx @dezkareid/osddt done <feature-name> --dir <project-path>` (existing behaviour).
358
390
 
359
391
  Note: the `osddt done` CLI command does **not** read `.osddtrc` — project path resolution is the agent's responsibility, handled in step 1 above.
package/README.md CHANGED
@@ -10,10 +10,10 @@ Other spec driven development tool but for monorepo
10
10
  | `@dezkareid/osddt setup --worktree-repository <url>` | Setup with worktree workflow enabled |
11
11
  | `@dezkareid/osddt meta-info` | Output current branch and date as JSON |
12
12
  | `@dezkareid/osddt done <feature-name> --dir <project-path>` | Move `working-on/<feature>` to `done/<feature>` |
13
- | `@dezkareid/osddt done <feature-name> --dir <project-path> --worktree` | Archive feature, remove git worktree, and clean state file |
13
+ | `@dezkareid/osddt done <feature-name> --dir <project-path> --worktree` | Archive feature and remove the git worktree |
14
14
  | `@dezkareid/osddt update` | Regenerate agent command files from the existing `.osddtrc` |
15
15
  | `@dezkareid/osddt start-worktree <feature-name>` | Create a git worktree for a feature and scaffold working-on/ |
16
- | `@dezkareid/osddt start-worktree <feature-name> --dir <package-path>` | Same, specifying the package path in a monorepo |
16
+ | `@dezkareid/osddt start-worktree <feature-name> --dir <package-path>` | Same, specifying the package subdirectory in a monorepo |
17
17
  | `@dezkareid/osddt worktree-info <feature-name>` | Look up worktree paths for a feature (JSON output) |
18
18
 
19
19
  ### `osddt setup` options
@@ -25,7 +25,7 @@ Other spec driven development tool but for monorepo
25
25
  | `--worktree-repository <url>` | any git URL | Enable worktree workflow and save the repository URL |
26
26
  | `-d, --dir <directory>` | any path | Target directory (defaults to current working directory) |
27
27
 
28
- All flags are optional. Providing neither runs the fully interactive mode. Providing `--agents` and `--repo-type` together skips all standard prompts. Adding `--worktree-repository` also runs environment checks and initialises the worktree state file.
28
+ All flags are optional. Providing neither runs the fully interactive mode. Providing `--agents` and `--repo-type` together skips all standard prompts. Adding `--worktree-repository` clones a bare repository, sets up the default branch worktree, runs environment checks, and writes all worktree config to `.osddtrc`.
29
29
 
30
30
  The selected agents and config are saved in `.osddtrc` so that `osddt update` can regenerate the correct files without prompting.
31
31
 
@@ -33,8 +33,15 @@ The selected agents and config are saved in `.osddtrc` so that `osddt update` ca
33
33
  // Standard mode
34
34
  { "repoType": "single", "agents": ["claude"] }
35
35
 
36
- // Worktree mode — the "worktree-repository" field enables the worktree workflow
37
- { "repoType": "single", "agents": ["claude"], "worktree-repository": "https://github.com/org/repo.git" }
36
+ // Worktree mode — written automatically by osddt setup --worktree-repository
37
+ {
38
+ "repoType": "monorepo",
39
+ "agents": ["claude"],
40
+ "worktree-repository": "https://github.com/org/repo.git",
41
+ "bare-path": "/path/to/project/.bare",
42
+ "packageManager": "pnpm",
43
+ "mainBranch": "main"
44
+ }
38
45
  ```
39
46
 
40
47
  ```bash
@@ -43,6 +50,9 @@ npx @dezkareid/osddt setup
43
50
 
44
51
  # Non-interactive (CI-friendly)
45
52
  npx @dezkareid/osddt setup --agents claude,gemini --repo-type single
53
+
54
+ # Enable worktree workflow
55
+ npx @dezkareid/osddt setup --agents claude --repo-type monorepo --worktree-repository https://github.com/org/repo.git
46
56
  ```
47
57
 
48
58
  ## Command Templates
@@ -122,38 +132,76 @@ flowchart LR
122
132
 
123
133
  #### Parallel feature workflow (git worktree)
124
134
 
125
- Enable worktree mode by providing the repository URL during setup:
135
+ Enable worktree mode once during setup by providing the repository URL:
126
136
 
127
137
  ```bash
128
138
  npx @dezkareid/osddt setup --agents claude --repo-type single --worktree-repository https://github.com/org/repo.git
129
139
  ```
130
140
 
131
- This saves `"worktree-repository"` in `.osddtrc`, runs environment checks, and initialises the `.osddt-worktrees` state file. From that point on, `/osddt.start` automatically uses the worktree workflow:
141
+ This clones a bare repository into `.bare/`, checks out the default branch as a linked worktree at `.bare/main/`, runs environment checks, and writes all config to `.osddtrc`. From that point on, `/osddt.start` automatically uses the worktree workflow — no further configuration needed.
142
+
143
+ **Resulting directory structure after setup:**
144
+
145
+ ```
146
+ project/ ← your working directory (contains .osddtrc, CLAUDE.md, GEMINI.md)
147
+ └── .bare/
148
+ ├── main/ ← default branch checked out as a linked worktree
149
+ ├── add-payment-gateway/ ← feature worktree created by /osddt.start
150
+ └── fix-login-bug/ ← another feature worktree
151
+ ```
152
+
153
+ For a **monorepo**, `working-on/` lives inside the package subdirectory within the worktree:
154
+
155
+ ```
156
+ .bare/add-payment-gateway/
157
+ ├── apps/
158
+ │ └── my-app/
159
+ │ └── working-on/
160
+ │ └── add-payment-gateway/ ← spec, plan, tasks live here
161
+ └── packages/
162
+ ```
163
+
164
+ **Example workflow (single repo):**
132
165
 
133
166
  ```
134
167
  /osddt.start add-payment-gateway
168
+ # → creates .bare/add-payment-gateway/, checks out feat/add-payment-gateway
169
+ # → scaffolds .bare/add-payment-gateway/working-on/add-payment-gateway/
170
+
135
171
  /osddt.spec
136
172
  /osddt.plan use Stripe SDK, REST endpoints
137
173
  /osddt.tasks
138
174
  /osddt.implement
139
175
  /osddt.done
176
+ # → archives working-on/, removes the worktree from .bare/
177
+ ```
178
+
179
+ **Example workflow (monorepo — prompts for package path):**
180
+
140
181
  ```
182
+ /osddt.start add-payment-gateway
183
+ # → prompts: "Package path (e.g. apps/my-app):" → enter apps/payments
184
+ # → creates .bare/add-payment-gateway/apps/payments/working-on/add-payment-gateway/
141
185
 
142
- The worktree is created as a sibling of your repo (e.g. `../my-repo-add-payment-gateway`). The `working-on/` planning folder lives inside the worktree alongside the code. When `osddt.done` runs, it archives the planning folder **and** removes the worktree automatically.
186
+ /osddt.spec
187
+ /osddt.plan use Stripe SDK, REST endpoints
188
+ /osddt.tasks
189
+ /osddt.implement
190
+ /osddt.done
191
+ ```
143
192
 
144
- You can customise the worktree base directory by adding `worktreeBase` to `.osddtrc`:
193
+ You can customise the base directory where feature worktrees are created by adding `worktreeBase` to `.osddtrc` (defaults to the `bare-path`):
145
194
 
146
195
  ```json
147
196
  {
148
197
  "repoType": "single",
149
198
  "worktree-repository": "https://github.com/org/repo.git",
199
+ "bare-path": "/path/to/project/.bare",
150
200
  "worktreeBase": "/Users/me/worktrees"
151
201
  }
152
202
  ```
153
203
 
154
- Active worktrees are tracked in `.osddt-worktrees` (sibling to the repo root), a JSON array with entries containing `featureName`, `branch`, `worktreePath`, `workingDir`, and `repoRoot`. This file is the single source of truth used by `osddt.continue` and `osddt.done` to resolve the correct paths.
155
-
156
- > **Migration note**: If you previously used `osddt setup-worktree` or `/osddt.start-worktree`, those commands have been removed. Re-run `osddt setup --worktree-repository <url>` to configure the new unified workflow. Manually delete any `osddt.start-worktree.*` files from your agent command directories — `osddt update` will not regenerate them.
204
+ Worktrees are tracked by git itself (`git worktree list`). `osddt.continue` and `osddt.done` call `npx @dezkareid/osddt worktree-info <feature-name>` at runtime to resolve the correct paths no separate state file is required.
157
205
 
158
206
  #### Resuming after closing a session
159
207
 
package/dist/index.js CHANGED
@@ -152,7 +152,7 @@ Use the following logic to determine the working directory:
152
152
 
153
153
  ## Instructions
154
154
 
155
- Check the working directory \`<project-path>/working-on/<feature-name>\` for the files listed below **in order** to determine the current phase. Use the first matching condition:
155
+ Check the working directory for the files listed below **in order** to determine the current phase. Use the \`workingDir\` resolved above (from \`worktree-info\` in worktree mode, or \`{project-path}/working-on/{feature-name}\` in standard mode). Use the first matching condition:
156
156
 
157
157
  | Condition | Current phase | Run next |
158
158
  | --------- | ------------- | -------- |
@@ -1012,10 +1012,9 @@ function todayPrefix() {
1012
1012
  async function runDone(featureName, cwd, worktree) {
1013
1013
  const barePath = worktree ? await resolveBarePath(process.cwd()) : undefined;
1014
1014
  const worktreePath = worktree ? findWorktreeByFeature(barePath, featureName) : undefined;
1015
- const projectDir = worktreePath ?? cwd;
1016
- const src = path.join(projectDir, 'working-on', featureName);
1015
+ const src = path.join(cwd, 'working-on', featureName);
1017
1016
  const destName = `${todayPrefix()}-${featureName}`;
1018
- const dest = path.join(projectDir, 'done', destName);
1017
+ const dest = path.join(cwd, 'done', destName);
1019
1018
  if (!(await fs.pathExists(src))) {
1020
1019
  console.error(`Error: working-on/${featureName} does not exist.`);
1021
1020
  process.exit(1);
@@ -1308,13 +1307,24 @@ async function resolveWorkingDir(worktreePath, featureName) {
1308
1307
  if (await fs.pathExists(path.join(worktreePath, target))) {
1309
1308
  return path.join(worktreePath, target);
1310
1309
  }
1311
- // Search one level deep (monorepo packages)
1310
+ // Search up to two levels deep (monorepo packages, e.g. apps/my-app or packages/my-pkg)
1312
1311
  try {
1313
- const entries = await fs.readdir(worktreePath);
1314
- for (const entry of entries) {
1315
- const candidate = path.join(worktreePath, entry, target);
1316
- if (await fs.pathExists(candidate)) {
1317
- return candidate;
1312
+ const topEntries = await fs.readdir(worktreePath);
1313
+ for (const top of topEntries) {
1314
+ const topCandidate = path.join(worktreePath, top, target);
1315
+ if (await fs.pathExists(topCandidate)) {
1316
+ return topCandidate;
1317
+ }
1318
+ // Second level (e.g. apps/collectstory/working-on/...)
1319
+ const topStat = await fs.stat(path.join(worktreePath, top)).catch(() => null);
1320
+ if (topStat?.isDirectory()) {
1321
+ const subEntries = await fs.readdir(path.join(worktreePath, top)).catch(() => []);
1322
+ for (const sub of subEntries) {
1323
+ const subCandidate = path.join(worktreePath, top, sub, target);
1324
+ if (await fs.pathExists(subCandidate)) {
1325
+ return subCandidate;
1326
+ }
1327
+ }
1318
1328
  }
1319
1329
  }
1320
1330
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dezkareid/osddt",
3
- "version": "1.11.10",
3
+ "version": "1.11.12",
4
4
  "description": "Package for Spec-Driven Development workflow",
5
5
  "keywords": [
6
6
  "spec-driven",