@dezkareid/osddt 1.3.2 → 1.5.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.
- package/AGENTS.md +44 -16
- package/README.md +6 -5
- package/dist/index.js +116 -55
- package/dist/templates/claude.d.ts +1 -1
- package/dist/templates/gemini.d.ts +1 -1
- package/dist/templates/shared.d.ts +7 -2
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -131,14 +131,29 @@ osddt/
|
|
|
131
131
|
|
|
132
132
|
### CLI Commands
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
#### Invocation forms
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
136
|
+
There are two contexts in which osddt commands are invoked:
|
|
137
|
+
|
|
138
|
+
| Context | Command prefix | When to use |
|
|
139
|
+
| ------- | -------------- | ----------- |
|
|
140
|
+
| **Local development of this package** | `osddt` | Working inside this repository — the binary is available directly because the package is installed locally |
|
|
141
|
+
| **External project** (using osddt as a dependency) | `npx @dezkareid/osddt` | Running from a project that lists `@dezkareid/osddt` as a dependency |
|
|
142
|
+
|
|
143
|
+
When `osddt setup` is run, it reads the `name` field of `package.json` in the target directory. If the name is `@dezkareid/osddt`, templates are written with `npx osddt`. Otherwise they fall back to `npx @dezkareid/osddt`. The resolution lives in `resolveNpxCommand()` in `src/commands/setup.ts`.
|
|
144
|
+
|
|
145
|
+
#### Available commands
|
|
146
|
+
|
|
147
|
+
| Command | Context | Description |
|
|
148
|
+
| -------------------------------------------------------------------- | ------------- | ------------------------------------------------------------- |
|
|
149
|
+
| `osddt setup` | Local dev | Generate agent command files for Claude and Gemini |
|
|
150
|
+
| `osddt setup --agents <list> --repo-type <type>` | Local dev | Non-interactive setup (for CI/scripted environments) |
|
|
151
|
+
| `npx @dezkareid/osddt setup` | External | Generate agent command files for Claude and Gemini |
|
|
152
|
+
| `npx @dezkareid/osddt setup --agents <list> --repo-type <type>` | External | Non-interactive setup (for CI/scripted environments) |
|
|
153
|
+
| `osddt meta-info` | Local dev | Output current branch and date as JSON |
|
|
154
|
+
| `npx @dezkareid/osddt meta-info` | External | Output current branch and date as JSON |
|
|
155
|
+
| `osddt done <feature-name> --dir <project-path>` | Local dev | Move `working-on/<feature>` to `done/<feature>` |
|
|
156
|
+
| `npx @dezkareid/osddt done <feature-name> --dir <project-path>` | External | Move `working-on/<feature>` to `done/<feature>` |
|
|
142
157
|
|
|
143
158
|
#### `osddt setup` options
|
|
144
159
|
|
|
@@ -160,6 +175,7 @@ Templates are generated by `npx @dezkareid/osddt setup` and placed in each agent
|
|
|
160
175
|
| `osddt.research` | Research a topic and write a research file to inform the spec |
|
|
161
176
|
| `osddt.start` | Start a new feature by creating a branch and working-on folder |
|
|
162
177
|
| `osddt.spec` | Analyze requirements and write a feature specification |
|
|
178
|
+
| `osddt.clarify` | Resolve open questions in the spec and record decisions (optional) |
|
|
163
179
|
| `osddt.plan` | Create a technical implementation plan from a specification |
|
|
164
180
|
| `osddt.tasks` | Generate actionable tasks from an implementation plan |
|
|
165
181
|
| `osddt.implement` | Execute tasks from the task list one by one |
|
|
@@ -167,20 +183,21 @@ Templates are generated by `npx @dezkareid/osddt setup` and placed in each agent
|
|
|
167
183
|
|
|
168
184
|
#### Template Workflow
|
|
169
185
|
|
|
170
|
-
`osddt.research` and `osddt.start` are **peer entry points** — use whichever fits your situation. Both lead to `osddt.spec`.
|
|
186
|
+
`osddt.research` and `osddt.start` are **peer entry points** — use whichever fits your situation. Both lead to `osddt.spec`. If you close the coding session, you should execute the `osddt.continue` command to resume the workflow.
|
|
171
187
|
|
|
172
188
|
```
|
|
173
|
-
osddt.continue
|
|
174
|
-
|
|
175
|
-
osddt.research ──┐
|
|
176
|
-
├──► osddt.spec → osddt.plan → osddt.tasks → osddt.implement → osddt.done ◄─┘
|
|
189
|
+
osddt.continue ──────────────────────────────────────────────────────────────────────────────────────┐
|
|
190
|
+
│
|
|
191
|
+
osddt.research ──┐ │
|
|
192
|
+
├──► osddt.spec → [osddt.clarify] → osddt.plan → osddt.tasks → osddt.implement → osddt.done ◄─┘
|
|
177
193
|
osddt.start ──┘
|
|
178
194
|
```
|
|
179
195
|
|
|
180
|
-
- Use **`osddt.continue`**
|
|
196
|
+
- Use **`osddt.continue`** if you closed the coding session to detect the current phase and get the exact command to run next. It inspects the `working-on/<feature-name>/` folder for phase files and reports which one was found.
|
|
181
197
|
- Use **`osddt.research`** when you want to explore the codebase and gather findings before writing the spec. It creates the `working-on/<feature-name>/` folder and writes `osddt.research.md`.
|
|
182
198
|
- Use **`osddt.start`** when you are ready to begin implementation directly. It creates the git branch and the `working-on/<feature-name>/` folder.
|
|
183
199
|
- Both `osddt.research` and `osddt.start` check whether the working directory already exists and ask to **Resume** or **Abort** if it does.
|
|
200
|
+
- Use **`osddt.clarify`** (optional) to resolve any Open Questions in the spec before planning. It can be invoked at any point in the workflow; after each session it always prompts to run (or re-run) `osddt.plan`.
|
|
184
201
|
|
|
185
202
|
#### Generated File Locations
|
|
186
203
|
|
|
@@ -195,7 +212,8 @@ osddt.start ──┘
|
|
|
195
212
|
- **Actions performed by the agent**:
|
|
196
213
|
1. Runs `npx @dezkareid/osddt meta-info` and reads `.osddtrc` to resolve the project path.
|
|
197
214
|
2. Checks the `working-on/<feature-name>/` folder for the following phase files **in order**: `osddt.tasks.md` (with unchecked tasks), `osddt.tasks.md` (all checked), `osddt.plan.md`, `osddt.spec.md`, `osddt.research.md`.
|
|
198
|
-
3. Reports the file found, the current phase, and the **exact command** the user should run next.
|
|
215
|
+
3. Reports the file found, the current phase, and the **exact command** the user should run next. Commands that require no further arguments (`/osddt.implement`, `/osddt.done`, `/osddt.tasks`) are suggested without arguments; commands that still need feature context (`/osddt.plan`, `/osddt.spec`, `/osddt.research`, `/osddt.clarify`) are suggested with the feature name.
|
|
216
|
+
4. If the detected phase is **Spec done** or **Planning done** and the spec has unanswered open questions, additionally recommends running `/osddt.clarify`.
|
|
199
217
|
|
|
200
218
|
#### osddt.start behaviour
|
|
201
219
|
|
|
@@ -214,12 +232,22 @@ osddt.start ──┘
|
|
|
214
232
|
2. Checks for an existing `working-on/<feature-name>/` folder — offers **Resume** or **Abort** if found, otherwise creates it.
|
|
215
233
|
3. Researches the topic (codebase exploration, external references) and writes `osddt.research.md`.
|
|
216
234
|
|
|
235
|
+
#### osddt.clarify behaviour
|
|
236
|
+
|
|
237
|
+
- **Input**: A feature name or branch name identifying the feature whose spec to clarify.
|
|
238
|
+
- **Actions performed by the agent**:
|
|
239
|
+
1. Locates `osddt.spec.md` in `working-on/<feature-name>/`; if absent, suggests running `osddt.spec` first.
|
|
240
|
+
2. Reads the **Open Questions** section and the **Decisions** section (if present) to determine which questions are already answered.
|
|
241
|
+
3. Informs the user of any already-resolved questions and only asks the remaining unanswered ones.
|
|
242
|
+
4. Records all new answers in a `## Decisions` section of `osddt.spec.md` and removes each answered question from the **Open Questions** section (removing the section heading too if it becomes empty).
|
|
243
|
+
5. Always prompts the user to run (or re-run) `osddt.plan` to reflect the updated decisions.
|
|
244
|
+
|
|
217
245
|
#### osddt.done behaviour
|
|
218
246
|
|
|
219
|
-
- **Input**:
|
|
247
|
+
- **Input**: None — the feature is identified automatically.
|
|
220
248
|
- **Actions performed by the agent**:
|
|
221
249
|
1. Reads `.osddtrc` to resolve the project path (single vs monorepo). For monorepos, asks the user which package.
|
|
222
|
-
2.
|
|
250
|
+
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.
|
|
223
251
|
3. Confirms all tasks in `osddt.tasks.md` are checked off (`- [x]`).
|
|
224
252
|
4. Runs `npx @dezkareid/osddt done <feature-name> --dir <project-path>` to move the folder.
|
|
225
253
|
|
package/README.md
CHANGED
|
@@ -32,13 +32,13 @@ npx @dezkareid/osddt setup --agents claude,gemini --repo-type single
|
|
|
32
32
|
|
|
33
33
|
Run `npx @dezkareid/osddt setup` once to generate the agent command files.
|
|
34
34
|
|
|
35
|
-
`osddt.research` and `osddt.start` are **peer entry points** — use whichever fits your situation. Both lead to `osddt.spec`.
|
|
35
|
+
`osddt.research` and `osddt.start` are **peer entry points** — use whichever fits your situation. Both lead to `osddt.spec`. If you close the coding session, you should execute the `osddt.continue` command to resume the workflow.
|
|
36
36
|
|
|
37
37
|
```
|
|
38
|
-
osddt.continue
|
|
39
|
-
|
|
40
|
-
osddt.research ──┐
|
|
41
|
-
├──► osddt.spec → osddt.plan → osddt.tasks → osddt.implement → osddt.done ◄─┘
|
|
38
|
+
osddt.continue ──────────────────────────────────────────────────────────────────────────────────────┐
|
|
39
|
+
│
|
|
40
|
+
osddt.research ──┐ │
|
|
41
|
+
├──► osddt.spec → [osddt.clarify] → osddt.plan → osddt.tasks → osddt.implement → osddt.done ◄─┘
|
|
42
42
|
osddt.start ──┘
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -48,6 +48,7 @@ osddt.start ──┘
|
|
|
48
48
|
| `osddt.research` | Research a topic and write a research file to inform the spec |
|
|
49
49
|
| `osddt.start` | Start a new feature by creating a branch and working-on folder |
|
|
50
50
|
| `osddt.spec` | Analyze requirements and write a feature specification |
|
|
51
|
+
| `osddt.clarify` | Resolve open questions in the spec and record decisions (optional) |
|
|
51
52
|
| `osddt.plan` | Create a technical implementation plan from a specification |
|
|
52
53
|
| `osddt.tasks` | Generate actionable tasks from an implementation plan |
|
|
53
54
|
| `osddt.implement` | Execute tasks from the task list one by one |
|
package/dist/index.js
CHANGED
|
@@ -6,12 +6,13 @@ import select from '@inquirer/select';
|
|
|
6
6
|
import checkbox from '@inquirer/checkbox';
|
|
7
7
|
import { execSync } from 'child_process';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function getRepoPreamble(npxCommand) {
|
|
10
|
+
return `## Context
|
|
10
11
|
|
|
11
12
|
Before proceeding, run the following command and parse the JSON output to get the current branch and date:
|
|
12
13
|
|
|
13
14
|
\`\`\`
|
|
14
|
-
|
|
15
|
+
${npxCommand} meta-info
|
|
15
16
|
\`\`\`
|
|
16
17
|
|
|
17
18
|
## Repository Configuration
|
|
@@ -28,11 +29,12 @@ Before proceeding, read the \`.osddtrc\` file in the root of the repository to d
|
|
|
28
29
|
|
|
29
30
|
## Working Directory
|
|
30
31
|
|
|
31
|
-
All generated files live under \`<project-path>/working-on/<feature-name>/\`.
|
|
32
|
+
All generated files live under \`<project-path>/working-on/<feature-name>/\`.
|
|
32
33
|
|
|
33
34
|
> All file paths in the instructions below are relative to \`<project-path>/working-on/<feature-name>/\`.
|
|
34
35
|
|
|
35
36
|
`;
|
|
37
|
+
}
|
|
36
38
|
const FEATURE_NAME_RULES = `### Feature Name Constraints
|
|
37
39
|
|
|
38
40
|
When deriving a feature name from a description:
|
|
@@ -62,25 +64,41 @@ const WORKING_DIR_STEP = `Check whether the working directory \`<project-path>/w
|
|
|
62
64
|
- If it **already exists**, warn the user and ask whether to:
|
|
63
65
|
- **Resume** — continue into the existing folder (proceed to the next step without recreating it)
|
|
64
66
|
- **Abort** — stop and do nothing`;
|
|
67
|
+
const RESOLVE_FEATURE_NAME = `### Resolving the Feature Name
|
|
68
|
+
|
|
69
|
+
Use the following logic to determine \`<feature-name>\`:
|
|
70
|
+
|
|
71
|
+
1. If arguments were provided, derive the feature name from them:
|
|
72
|
+
- If the argument looks like a branch name (no spaces, kebab-case or slash-separated), use the last segment (after the last \`/\`, or the full value if no \`/\` is present).
|
|
73
|
+
- Otherwise treat it as a human-readable description and convert it to a feature name following the constraints in the Feature Name Constraints section.
|
|
74
|
+
2. If **no arguments were provided**:
|
|
75
|
+
- List all folders under \`<project-path>/working-on/\`.
|
|
76
|
+
- If there is **only one folder**, use it automatically and inform the user.
|
|
77
|
+
- If there are **multiple folders**, present the list to the user and ask them to pick one.
|
|
78
|
+
- If there are **no folders**, inform the user that no in-progress features were found and stop.`;
|
|
65
79
|
const COMMAND_DEFINITIONS = [
|
|
66
80
|
{
|
|
67
81
|
name: 'osddt.continue',
|
|
68
82
|
description: 'Detect the current workflow phase and prompt the next command to run',
|
|
69
|
-
body: (args) => `${
|
|
83
|
+
body: ({ args, npxCommand }) => `${getRepoPreamble(npxCommand)}${RESOLVE_FEATURE_NAME}
|
|
84
|
+
|
|
85
|
+
## Instructions
|
|
70
86
|
|
|
71
87
|
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:
|
|
72
88
|
|
|
73
89
|
| Condition | Current phase | Run next |
|
|
74
90
|
| --------- | ------------- | -------- |
|
|
75
|
-
| \`osddt.tasks.md\` exists **and** has at least one unchecked task (\`- [ ]\`) | Implementing | \`/osddt.implement
|
|
76
|
-
| \`osddt.tasks.md\` exists **and** all tasks are checked (\`- [x]\`) | Ready to close | \`/osddt.done
|
|
77
|
-
| \`osddt.plan.md\` exists | Planning done | \`/osddt.tasks
|
|
78
|
-
| \`osddt.spec.md\` exists | Spec done | \`/osddt.plan
|
|
79
|
-
| \`osddt.research.md\` exists | Research done | \`/osddt.spec
|
|
80
|
-
| None of the above | Not started | \`/osddt.spec
|
|
91
|
+
| \`osddt.tasks.md\` exists **and** has at least one unchecked task (\`- [ ]\`) | Implementing | \`/osddt.implement\` |
|
|
92
|
+
| \`osddt.tasks.md\` exists **and** all tasks are checked (\`- [x]\`) | Ready to close | \`/osddt.done\` |
|
|
93
|
+
| \`osddt.plan.md\` exists | Planning done | \`/osddt.tasks\` |
|
|
94
|
+
| \`osddt.spec.md\` exists | Spec done | \`/osddt.plan <tech stack and key technical decisions>\` |
|
|
95
|
+
| \`osddt.research.md\` exists | Research done | \`/osddt.spec <brief feature description>\` |
|
|
96
|
+
| None of the above | Not started | \`/osddt.spec <brief feature description>\` (or \`/osddt.research <topic>\` if research is needed first) |
|
|
81
97
|
|
|
82
98
|
Report which file was found, which phase that corresponds to, and the exact command the user should run next.
|
|
83
99
|
|
|
100
|
+
> **Open Questions check**: After reporting the phase, if the detected phase is **Spec done** or **Planning done**, also check whether \`osddt.spec.md\` contains any unanswered open questions (items in the **Open Questions** section with no corresponding entry in the **Decisions** section). If unanswered questions exist, inform the user and recommend running \`/osddt.clarify <feature-name>\` before (or in addition to) the suggested next command.
|
|
101
|
+
|
|
84
102
|
## Arguments
|
|
85
103
|
|
|
86
104
|
${args}
|
|
@@ -89,7 +107,7 @@ ${args}
|
|
|
89
107
|
{
|
|
90
108
|
name: 'osddt.research',
|
|
91
109
|
description: 'Research a topic and write a research file to inform the feature specification',
|
|
92
|
-
body: (args) => `${
|
|
110
|
+
body: ({ args, npxCommand }) => `${getRepoPreamble(npxCommand)}## Instructions
|
|
93
111
|
|
|
94
112
|
The argument provided is: ${args}
|
|
95
113
|
|
|
@@ -132,14 +150,14 @@ ${args}
|
|
|
132
150
|
Run the following command to write the feature specification:
|
|
133
151
|
|
|
134
152
|
\`\`\`
|
|
135
|
-
/osddt.spec
|
|
153
|
+
/osddt.spec <brief description of the feature or topic researched>
|
|
136
154
|
\`\`\`
|
|
137
155
|
`,
|
|
138
156
|
},
|
|
139
157
|
{
|
|
140
158
|
name: 'osddt.start',
|
|
141
159
|
description: 'Start a new feature by creating a branch and working-on folder',
|
|
142
|
-
body: (args) => `${
|
|
160
|
+
body: ({ args, npxCommand }) => `${getRepoPreamble(npxCommand)}## Instructions
|
|
143
161
|
|
|
144
162
|
The argument provided is: ${args}
|
|
145
163
|
|
|
@@ -178,14 +196,14 @@ ${args}
|
|
|
178
196
|
Run the following command to write the feature specification:
|
|
179
197
|
|
|
180
198
|
\`\`\`
|
|
181
|
-
/osddt.spec
|
|
199
|
+
/osddt.spec <brief description of the feature being built>
|
|
182
200
|
\`\`\`
|
|
183
201
|
`,
|
|
184
202
|
},
|
|
185
203
|
{
|
|
186
204
|
name: 'osddt.spec',
|
|
187
205
|
description: 'Analyze requirements and write a feature specification',
|
|
188
|
-
body: (args) => `## Instructions
|
|
206
|
+
body: ({ args }) => `## Instructions
|
|
189
207
|
|
|
190
208
|
1. Check whether \`osddt.research.md\` exists in the working directory.
|
|
191
209
|
- If it exists, read it and use its findings (key insights, constraints, open questions, codebase findings) as additional context when writing the specification.
|
|
@@ -217,14 +235,50 @@ ${args}
|
|
|
217
235
|
Run the following command to create the implementation plan:
|
|
218
236
|
|
|
219
237
|
\`\`\`
|
|
220
|
-
/osddt.plan
|
|
238
|
+
/osddt.plan <tech stack and key technical decisions, e.g. "use Node.js with SQLite, REST API, no auth">
|
|
239
|
+
\`\`\`
|
|
240
|
+
`,
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: 'osddt.clarify',
|
|
244
|
+
description: 'Resolve open questions in the spec and record decisions',
|
|
245
|
+
body: () => `## Instructions
|
|
246
|
+
|
|
247
|
+
1. Check whether \`osddt.spec.md\` exists in the working directory:
|
|
248
|
+
- If it **does not exist**, inform the user that no spec was found and suggest running \`/osddt.spec <brief feature description>\` first. Stop here.
|
|
249
|
+
|
|
250
|
+
2. Read \`osddt.spec.md\` and extract all items listed under the **Open Questions** section.
|
|
251
|
+
- If the **Open Questions** section is absent or empty, inform the user that there are no open questions to resolve. Skip to step 6.
|
|
252
|
+
|
|
253
|
+
3. Read the **Decisions** section of \`osddt.spec.md\` (if it exists) to determine which questions have already been answered.
|
|
254
|
+
- A question is considered answered if there is a corresponding numbered entry in the **Decisions** section.
|
|
255
|
+
- List the already-answered questions to the user and inform them they will be skipped.
|
|
256
|
+
|
|
257
|
+
4. For each **unanswered** question (in order), present it to the user and collect a response.
|
|
258
|
+
- If all questions were already answered, inform the user and skip to step 6.
|
|
259
|
+
|
|
260
|
+
5. Update \`osddt.spec.md\`:
|
|
261
|
+
- Remove each answered question from the **Open Questions** section.
|
|
262
|
+
- If the **Open Questions** section becomes empty after removal, remove the section heading as well.
|
|
263
|
+
- If a **Decisions** section already exists, append new entries to it (do not modify existing entries).
|
|
264
|
+
- If no **Decisions** section exists, add one at the end of the file.
|
|
265
|
+
- Each decision entry uses the format: \`N. **<short question summary>**: <answer>\`
|
|
266
|
+
|
|
267
|
+
6. Inform the user that all questions are now resolved (or were already resolved). Then prompt them to run (or re-run) the plan step so it reflects the updated decisions:
|
|
268
|
+
|
|
269
|
+
\`\`\`
|
|
270
|
+
/osddt.plan <tech stack and key technical decisions, e.g. "use Node.js with SQLite, REST API, no auth">
|
|
221
271
|
\`\`\`
|
|
272
|
+
|
|
273
|
+
> Note: if \`osddt.plan.md\` already exists, the plan should be regenerated to incorporate the decisions.
|
|
222
274
|
`,
|
|
223
275
|
},
|
|
224
276
|
{
|
|
225
277
|
name: 'osddt.plan',
|
|
226
278
|
description: 'Create a technical implementation plan from a specification',
|
|
227
|
-
body: (args) =>
|
|
279
|
+
body: ({ args }) => `${RESOLVE_FEATURE_NAME}
|
|
280
|
+
|
|
281
|
+
## Instructions
|
|
228
282
|
|
|
229
283
|
1. Check whether \`osddt.plan.md\` already exists in the working directory:
|
|
230
284
|
- If it **does not exist**, proceed to generate it.
|
|
@@ -233,9 +287,16 @@ Run the following command to create the implementation plan:
|
|
|
233
287
|
- **Update** — read the existing file and apply targeted changes based on ${args}
|
|
234
288
|
- **Do nothing** — stop here and leave the file as-is
|
|
235
289
|
2. Read \`osddt.spec.md\` from the working directory
|
|
236
|
-
3.
|
|
237
|
-
|
|
238
|
-
|
|
290
|
+
3. Check for unanswered open questions in the spec:
|
|
291
|
+
- Count the items in the **Open Questions** section that have no corresponding entry in the **Decisions** section.
|
|
292
|
+
- If there are any unanswered questions, inform the user: "This spec has X unanswered open question(s)."
|
|
293
|
+
- Ask the user whether to:
|
|
294
|
+
- **Clarify first** — stop here and suggest running \`/osddt.clarify <feature-name>\` instead
|
|
295
|
+
- **Proceed anyway** — continue with plan generation using the spec as-is
|
|
296
|
+
- If there are no unanswered questions, proceed silently.
|
|
297
|
+
4. Break down the implementation into logical phases and steps
|
|
298
|
+
5. Identify technical decisions, dependencies, and risks
|
|
299
|
+
6. Write the plan to \`osddt.plan.md\` in the working directory
|
|
239
300
|
|
|
240
301
|
## Plan Format
|
|
241
302
|
|
|
@@ -255,20 +316,21 @@ ${args}
|
|
|
255
316
|
Run the following command to generate the task list:
|
|
256
317
|
|
|
257
318
|
\`\`\`
|
|
258
|
-
/osddt.tasks
|
|
319
|
+
/osddt.tasks
|
|
259
320
|
\`\`\`
|
|
260
321
|
`,
|
|
261
322
|
},
|
|
262
323
|
{
|
|
263
324
|
name: 'osddt.tasks',
|
|
264
325
|
description: 'Generate actionable tasks from an implementation plan',
|
|
265
|
-
body: (
|
|
326
|
+
body: () => `${RESOLVE_FEATURE_NAME}
|
|
327
|
+
|
|
328
|
+
## Instructions
|
|
266
329
|
|
|
267
330
|
1. Check whether \`osddt.tasks.md\` already exists in the working directory:
|
|
268
331
|
- If it **does not exist**, proceed to generate it.
|
|
269
332
|
- If it **already exists**, ask the user whether to:
|
|
270
333
|
- **Regenerate** — discard the existing file and create a fresh task list from scratch
|
|
271
|
-
- **Update** — read the existing file and apply targeted changes based on ${args}
|
|
272
334
|
- **Do nothing** — stop here and leave the file as-is
|
|
273
335
|
2. Read \`osddt.plan.md\` from the working directory
|
|
274
336
|
3. Break each phase into discrete, executable tasks
|
|
@@ -283,26 +345,22 @@ The task list should include:
|
|
|
283
345
|
- **Dependencies**: Note which tasks must complete before others
|
|
284
346
|
- **Definition of Done**: Clear completion criteria per phase
|
|
285
347
|
|
|
286
|
-
## Arguments
|
|
287
|
-
|
|
288
|
-
${args}
|
|
289
|
-
|
|
290
348
|
## Next Step
|
|
291
349
|
|
|
292
350
|
Run the following command to start implementing tasks:
|
|
293
351
|
|
|
294
352
|
\`\`\`
|
|
295
|
-
/osddt.implement
|
|
353
|
+
/osddt.implement
|
|
296
354
|
\`\`\`
|
|
297
355
|
`,
|
|
298
356
|
},
|
|
299
357
|
{
|
|
300
358
|
name: 'osddt.implement',
|
|
301
359
|
description: 'Execute tasks from the task list one by one',
|
|
302
|
-
body: (
|
|
360
|
+
body: () => `## Instructions
|
|
303
361
|
|
|
304
362
|
1. Check whether \`osddt.tasks.md\` exists in the working directory:
|
|
305
|
-
- If it **does not exist**, stop and ask the user to run \`/osddt.tasks
|
|
363
|
+
- If it **does not exist**, stop and ask the user to run \`/osddt.tasks\` first.
|
|
306
364
|
2. Read \`osddt.tasks.md\` from the working directory
|
|
307
365
|
3. Find the next unchecked task (\`- [ ]\`)
|
|
308
366
|
4. Implement that task following the spec (\`osddt.spec.md\`) and plan (\`osddt.plan.md\`) in the working directory
|
|
@@ -316,44 +374,31 @@ Run the following command to start implementing tasks:
|
|
|
316
374
|
- Write tests for new functionality when applicable
|
|
317
375
|
- Ask for clarification if requirements are ambiguous
|
|
318
376
|
|
|
319
|
-
## Arguments
|
|
320
|
-
|
|
321
|
-
${args}
|
|
322
|
-
|
|
323
377
|
## Next Step
|
|
324
378
|
|
|
325
379
|
Once all tasks are checked off, run the following command to mark the feature as done:
|
|
326
380
|
|
|
327
381
|
\`\`\`
|
|
328
|
-
/osddt.done
|
|
382
|
+
/osddt.done
|
|
329
383
|
\`\`\`
|
|
330
384
|
`,
|
|
331
385
|
},
|
|
332
386
|
{
|
|
333
387
|
name: 'osddt.done',
|
|
334
388
|
description: 'Mark a feature as done and move it from working-on to done',
|
|
335
|
-
body: (
|
|
389
|
+
body: ({ npxCommand }) => `## Instructions
|
|
336
390
|
|
|
337
|
-
1.
|
|
338
|
-
|
|
339
|
-
- If \`repoType\` is \`"single"\`: the project path is the repository root.
|
|
340
|
-
- If \`repoType\` is \`"monorepo"\`: ask the user which package to work on (e.g. \`packages/my-package\`), then use \`<repo-root>/<package>\` as the project path.
|
|
341
|
-
2. Derive the feature name from ${args} using the same rules as the other commands (last segment of a branch name, or a kebab-cased slug — subject to the 30-character limit). This must match the folder name under \`working-on/\`.
|
|
342
|
-
3. Confirm all tasks in \`osddt.tasks.md\` are checked off (\`- [x]\`)
|
|
343
|
-
4. Run the following command to move the feature folder from \`working-on\` to \`done\`:
|
|
391
|
+
1. Confirm all tasks in \`osddt.tasks.md\` are checked off (\`- [x]\`)
|
|
392
|
+
2. Run the following command to move the feature folder from \`working-on\` to \`done\`:
|
|
344
393
|
|
|
345
394
|
\`\`\`
|
|
346
|
-
|
|
395
|
+
${npxCommand} done <feature-name> --dir <project-path>
|
|
347
396
|
\`\`\`
|
|
348
397
|
|
|
349
398
|
The command will automatically prefix the destination folder name with today's date in \`YYYY-MM-DD\` format.
|
|
350
399
|
For example, \`working-on/feature-a\` will be moved to \`done/YYYY-MM-DD-feature-a\`.
|
|
351
400
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
## Arguments
|
|
355
|
-
|
|
356
|
-
${args}
|
|
401
|
+
3. Report the result of the command, including the full destination path
|
|
357
402
|
`,
|
|
358
403
|
},
|
|
359
404
|
];
|
|
@@ -366,11 +411,11 @@ description: "${description}"
|
|
|
366
411
|
|
|
367
412
|
${body}`;
|
|
368
413
|
}
|
|
369
|
-
function getClaudeTemplates(cwd) {
|
|
414
|
+
function getClaudeTemplates(cwd, npxCommand) {
|
|
370
415
|
const dir = path.join(cwd, CLAUDE_COMMANDS_DIR);
|
|
371
416
|
return COMMAND_DEFINITIONS.map((cmd) => ({
|
|
372
417
|
filePath: path.join(dir, `${cmd.name}.md`),
|
|
373
|
-
content: formatClaudeCommand(cmd.description, cmd.body('$ARGUMENTS')),
|
|
418
|
+
content: formatClaudeCommand(cmd.description, cmd.body({ args: '$ARGUMENTS', npxCommand })),
|
|
374
419
|
}));
|
|
375
420
|
}
|
|
376
421
|
|
|
@@ -382,11 +427,11 @@ prompt = """
|
|
|
382
427
|
${body}"""
|
|
383
428
|
`;
|
|
384
429
|
}
|
|
385
|
-
function getGeminiTemplates(cwd) {
|
|
430
|
+
function getGeminiTemplates(cwd, npxCommand) {
|
|
386
431
|
const dir = path.join(cwd, GEMINI_COMMANDS_DIR);
|
|
387
432
|
return COMMAND_DEFINITIONS.map((cmd) => ({
|
|
388
433
|
filePath: path.join(dir, `${cmd.name}.toml`),
|
|
389
|
-
content: formatGeminiCommand(cmd.description, cmd.body('{{args}}')),
|
|
434
|
+
content: formatGeminiCommand(cmd.description, cmd.body({ args: '{{args}}', npxCommand })),
|
|
390
435
|
}));
|
|
391
436
|
}
|
|
392
437
|
|
|
@@ -431,6 +476,21 @@ async function askAgents() {
|
|
|
431
476
|
});
|
|
432
477
|
}
|
|
433
478
|
|
|
479
|
+
const CANONICAL_PACKAGE_NAME = '@dezkareid/osddt';
|
|
480
|
+
const NPX_COMMAND = 'npx osddt';
|
|
481
|
+
const NPX_COMMAND_FALLBACK = `npx ${CANONICAL_PACKAGE_NAME}`;
|
|
482
|
+
async function resolveNpxCommand(cwd) {
|
|
483
|
+
const pkgPath = path.join(cwd, 'package.json');
|
|
484
|
+
try {
|
|
485
|
+
const pkg = await fs.readJson(pkgPath);
|
|
486
|
+
if (pkg.name === CANONICAL_PACKAGE_NAME)
|
|
487
|
+
return NPX_COMMAND;
|
|
488
|
+
}
|
|
489
|
+
catch {
|
|
490
|
+
// no package.json or unreadable — fall through to default
|
|
491
|
+
}
|
|
492
|
+
return NPX_COMMAND_FALLBACK;
|
|
493
|
+
}
|
|
434
494
|
const VALID_AGENTS = ['claude', 'gemini'];
|
|
435
495
|
const VALID_REPO_TYPES = ['single', 'monorepo'];
|
|
436
496
|
function parseAgents(raw) {
|
|
@@ -470,9 +530,10 @@ async function runSetup(cwd, rawAgents, rawRepoType) {
|
|
|
470
530
|
const repoType = rawRepoType !== undefined ? parseRepoType(rawRepoType) : await askRepoType();
|
|
471
531
|
if (rawRepoType === undefined)
|
|
472
532
|
console.log('');
|
|
533
|
+
const npxCommand = await resolveNpxCommand(cwd);
|
|
473
534
|
console.log('Setting up OSDDT command files...\n');
|
|
474
535
|
if (agents.includes('claude')) {
|
|
475
|
-
const claudeFiles = getClaudeTemplates(cwd);
|
|
536
|
+
const claudeFiles = getClaudeTemplates(cwd, npxCommand);
|
|
476
537
|
console.log('Claude Code commands (.claude/commands/):');
|
|
477
538
|
for (const file of claudeFiles) {
|
|
478
539
|
await writeCommandFile(file);
|
|
@@ -480,7 +541,7 @@ async function runSetup(cwd, rawAgents, rawRepoType) {
|
|
|
480
541
|
console.log('');
|
|
481
542
|
}
|
|
482
543
|
if (agents.includes('gemini')) {
|
|
483
|
-
const geminiFiles = getGeminiTemplates(cwd);
|
|
544
|
+
const geminiFiles = getGeminiTemplates(cwd, npxCommand);
|
|
484
545
|
console.log('Gemini CLI commands (.gemini/commands/):');
|
|
485
546
|
for (const file of geminiFiles) {
|
|
486
547
|
await writeCommandFile(file);
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare function getRepoPreamble(npxCommand: string): string;
|
|
2
2
|
export declare const FEATURE_NAME_RULES = "### Feature Name Constraints\n\nWhen deriving a feature name from a description:\n\n- Use only lowercase letters, digits, and hyphens (`a-z`, `0-9`, `-`)\n- Replace spaces and special characters with hyphens\n- Remove consecutive hyphens (e.g. `--` \u2192 `-`)\n- Remove leading and trailing hyphens\n- **Maximum length: 30 characters** \u2014 if the derived name exceeds 30 characters, truncate at the last hyphen boundary before or at the 30th character\n- If the input is already a valid branch name (no spaces, kebab-case or slash-separated), apply the 30-character limit to the last segment only (after the last `/`)\n- Reject (and ask the user to provide a shorter name) if no valid name can be derived after truncation\n\n**Examples:**\n\n| Input | Derived feature name |\n| ----------------------------------------------------- | ---------------------------- |\n| `Add user authentication` | `add-user-authentication` |\n| `Implement real-time notifications for dashboard` | `implement-real-time` |\n| `feat/add-user-authentication` | `add-user-authentication` |\n| `feat/implement-real-time-notifications-for-dashboard` | `implement-real-time` |\n";
|
|
3
3
|
export declare const WORKING_DIR_STEP = "Check whether the working directory `<project-path>/working-on/<feature-name>` already exists:\n - If it **does not exist**, create it:\n ```\n mkdir -p <project-path>/working-on/<feature-name>\n ```\n - If it **already exists**, warn the user and ask whether to:\n - **Resume** \u2014 continue into the existing folder (proceed to the next step without recreating it)\n - **Abort** \u2014 stop and do nothing";
|
|
4
|
+
export declare const RESOLVE_FEATURE_NAME = "### Resolving the Feature Name\n\nUse the following logic to determine `<feature-name>`:\n\n1. If arguments were provided, derive the feature name from them:\n - If the argument looks like a branch name (no spaces, kebab-case or slash-separated), use the last segment (after the last `/`, or the full value if no `/` is present).\n - Otherwise treat it as a human-readable description and convert it to a feature name following the constraints in the Feature Name Constraints section.\n2. If **no arguments were provided**:\n - List all folders under `<project-path>/working-on/`.\n - If there is **only one folder**, use it automatically and inform the user.\n - If there are **multiple folders**, present the list to the user and ask them to pick one.\n - If there are **no folders**, inform the user that no in-progress features were found and stop.";
|
|
4
5
|
export type ArgPlaceholder = '$ARGUMENTS' | '{{args}}';
|
|
6
|
+
export interface CommandDefinitionContext {
|
|
7
|
+
args: ArgPlaceholder;
|
|
8
|
+
npxCommand: string;
|
|
9
|
+
}
|
|
5
10
|
export interface CommandDefinition {
|
|
6
11
|
name: string;
|
|
7
12
|
description: string;
|
|
8
|
-
body: (
|
|
13
|
+
body: (ctx: CommandDefinitionContext) => string;
|
|
9
14
|
}
|
|
10
15
|
export declare const COMMAND_DEFINITIONS: CommandDefinition[];
|