@dezkareid/osddt 1.5.0 → 1.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.
package/AGENTS.md CHANGED
@@ -183,17 +183,65 @@ Templates are generated by `npx @dezkareid/osddt setup` and placed in each agent
183
183
 
184
184
  #### Template Workflow
185
185
 
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.
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, execute `osddt.continue` to resume the workflow.
187
187
 
188
+ **Standard steps:**
189
+
190
+ 1. Pick an entry point:
191
+ - **`osddt.research <topic>`** — explore the codebase or gather external findings first, then proceed to spec.
192
+ - **`osddt.start <feature>`** — jump straight to creating the branch and working directory, then write the spec.
193
+ 2. **`osddt.spec <feature>`** — analyse requirements and write the feature specification.
194
+ 3. *(optional)* **`osddt.clarify <feature>`** — resolve any Open Questions in the spec and record decisions.
195
+ 4. **`osddt.plan <tech decisions>`** — create a technical implementation plan from the spec.
196
+ 5. **`osddt.tasks`** — generate a checklist of actionable tasks from the plan.
197
+ 6. **`osddt.implement`** — execute tasks one by one until all are checked off.
198
+ 7. **`osddt.done`** — verify all tasks are complete and move the feature folder to `done/`.
199
+
200
+ > **Note:** You can re-run any step to go back and revise it — except once `osddt.done` has been executed, the feature is considered finished and cannot be revisited.
201
+
202
+ **If you close a session:**
203
+
204
+ - Run **`osddt.continue <feature>`** — it inspects the `working-on/<feature-name>/` folder, identifies the current phase, and tells you the exact next command to run.
205
+
206
+ ---
207
+
208
+ ##### Example A — Starting with research
209
+
210
+ ```
211
+ /osddt.research add payment gateway
212
+ /osddt.spec add-payment-gateway
213
+ /osddt.clarify add-payment-gateway # optional — resolve open questions
214
+ /osddt.plan use Stripe SDK, REST endpoints, no webhooks
215
+ /osddt.tasks
216
+ /osddt.implement
217
+ /osddt.done
188
218
  ```
189
- osddt.continue ──────────────────────────────────────────────────────────────────────────────────────┐
190
-
191
- osddt.research ──┐ │
192
- ├──► osddt.spec → [osddt.clarify] → osddt.plan → osddt.tasks → osddt.implement → osddt.done ◄─┘
193
- osddt.start ──┘
219
+
220
+ ##### Example B — Starting directly
221
+
222
+ ```
223
+ /osddt.start add user profile page
224
+ /osddt.spec add-user-profile-page
225
+ /osddt.plan React with React Query, REST API
226
+ /osddt.tasks
227
+ /osddt.implement
228
+ /osddt.done
194
229
  ```
195
230
 
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.
231
+ ##### Example C Resuming after closing a session
232
+
233
+ ```
234
+ # You closed Claude and want to pick up where you left off:
235
+ /osddt.continue add-payment-gateway
236
+ # → osddt.continue detects osddt.plan.md exists and reports:
237
+ # "Planning phase complete. Run: /osddt.tasks"
238
+ /osddt.tasks
239
+ /osddt.implement
240
+ /osddt.done
241
+ ```
242
+
243
+ ---
244
+
197
245
  - 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`.
198
246
  - Use **`osddt.start`** when you are ready to begin implementation directly. It creates the git branch and the `working-on/<feature-name>/` folder.
199
247
  - Both `osddt.research` and `osddt.start` check whether the working directory already exists and ask to **Resume** or **Abort** if it does.
@@ -223,6 +271,9 @@ osddt.start ──┘
223
271
  1. Checks for an existing branch — offers **Resume** (`git checkout`) or **Abort** if found, otherwise runs `git checkout -b <branch-name>`.
224
272
  2. Reads `.osddtrc` to resolve the project path (single vs monorepo).
225
273
  3. Checks for an existing `working-on/<feature-name>/` folder — offers **Resume** or **Abort** if found, otherwise creates it.
274
+ 4. Reports the branch and working directory, then shows a context-aware next step:
275
+ - If input was a **human-readable description**: informs the user their description will be used as the starting point for the spec and suggests running `/osddt.spec` (with an optional-context note).
276
+ - If input was a **branch name** (or no arguments): prompts the user to run `/osddt.spec` with an optional-context note.
226
277
 
227
278
  #### osddt.research behaviour
228
279
 
@@ -231,10 +282,12 @@ osddt.start ──┘
231
282
  1. Derives the feature name (subject to the 30-character limit).
232
283
  2. Checks for an existing `working-on/<feature-name>/` folder — offers **Resume** or **Abort** if found, otherwise creates it.
233
284
  3. Researches the topic (codebase exploration, external references) and writes `osddt.research.md`.
285
+ 4. Shows a context-aware next step:
286
+ - If input was a **human-readable description**: informs the user their description will be used as the starting point for the spec and suggests running `/osddt.spec` (with an optional-context note).
287
+ - If input was a **branch name** (or no arguments): prompts the user to run `/osddt.spec` with an optional-context note.
234
288
 
235
289
  #### osddt.clarify behaviour
236
290
 
237
- - **Input**: A feature name or branch name identifying the feature whose spec to clarify.
238
291
  - **Actions performed by the agent**:
239
292
  1. Locates `osddt.spec.md` in `working-on/<feature-name>/`; if absent, suggests running `osddt.spec` first.
240
293
  2. Reads the **Open Questions** section and the **Decisions** section (if present) to determine which questions are already answered.
package/README.md CHANGED
@@ -32,14 +32,74 @@ 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`. If you close the coding session, you should execute the `osddt.continue` command to resume the workflow.
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, execute `osddt.continue` to resume the workflow.
36
+
37
+ ```mermaid
38
+ flowchart LR
39
+ continue([osddt.continue])
40
+
41
+ subgraph entry[Entry points]
42
+ research([osddt.research])
43
+ start([osddt.start])
44
+ end
45
+
46
+ spec([osddt.spec])
47
+ clarify([osddt.clarify\noptional])
48
+ plan([osddt.plan])
49
+ tasks([osddt.tasks])
50
+ implement([osddt.implement])
51
+ done([osddt.done])
52
+
53
+ research --> spec
54
+ start --> spec
55
+ spec --> clarify
56
+ clarify --> plan
57
+ spec --> plan
58
+ plan --> tasks
59
+ tasks --> implement
60
+ implement --> done
61
+ done --> continue
62
+ continue -.resume.-> spec & plan & tasks & implement & done
63
+
64
+ note["⚠️ You can go back to any step,\nbut once osddt.done runs\nthe feature is finished."]
65
+ done --- note
66
+ ```
67
+
68
+ ### Example workflows
69
+
70
+ #### Starting with research
71
+
72
+ ```
73
+ /osddt.research add payment gateway
74
+ /osddt.spec add-payment-gateway
75
+ /osddt.clarify add-payment-gateway # optional — resolve open questions
76
+ /osddt.plan use Stripe SDK, REST endpoints, no webhooks
77
+ /osddt.tasks
78
+ /osddt.implement
79
+ /osddt.done
80
+ ```
81
+
82
+ #### Starting directly
83
+
84
+ ```
85
+ /osddt.start add user profile page
86
+ /osddt.spec add-user-profile-page
87
+ /osddt.plan React with React Query, REST API
88
+ /osddt.tasks
89
+ /osddt.implement
90
+ /osddt.done
91
+ ```
92
+
93
+ #### Resuming after closing a session
36
94
 
37
95
  ```
38
- osddt.continue ──────────────────────────────────────────────────────────────────────────────────────┐
39
-
40
- osddt.research ──┐ │
41
- ├──► osddt.spec → [osddt.clarify] osddt.plan → osddt.tasks → osddt.implement → osddt.done ◄─┘
42
- osddt.start ──┘
96
+ # You closed your agent session and want to pick up where you left off:
97
+ /osddt.continue add-payment-gateway
98
+ # → detects osddt.plan.md exists and reports:
99
+ # "Planning phase complete. Run: /osddt.tasks"
100
+ /osddt.tasks
101
+ /osddt.implement
102
+ /osddt.done
43
103
  ```
44
104
 
45
105
  | Template | Description |
package/dist/index.js CHANGED
@@ -76,6 +76,29 @@ Use the following logic to determine \`<feature-name>\`:
76
76
  - If there is **only one folder**, use it automatically and inform the user.
77
77
  - If there are **multiple folders**, present the list to the user and ask them to pick one.
78
78
  - If there are **no folders**, inform the user that no in-progress features were found and stop.`;
79
+ function getNextStepToSpec(args) {
80
+ return `## Next Step
81
+
82
+ - If ${args} was a **human-readable description** (not a branch name):
83
+
84
+ Your description will be used as the starting point for the spec. Run:
85
+
86
+ \`\`\`
87
+ /osddt.spec
88
+ \`\`\`
89
+
90
+ > You can append more details if you want the spec to capture additional context.
91
+
92
+ - If ${args} was a **branch name** (or no arguments were provided):
93
+
94
+ Run the following command to write the feature specification:
95
+
96
+ \`\`\`
97
+ /osddt.spec <brief feature description, e.g. "add user authentication with JWT">
98
+ \`\`\`
99
+
100
+ > Add a short description of what you're building so the spec has the right starting point.`;
101
+ }
79
102
  const COMMAND_DEFINITIONS = [
80
103
  {
81
104
  name: 'osddt.continue',
@@ -145,13 +168,7 @@ The research file should include:
145
168
 
146
169
  ${args}
147
170
 
148
- ## Next Step
149
-
150
- Run the following command to write the feature specification:
151
-
152
- \`\`\`
153
- /osddt.spec <brief description of the feature or topic researched>
154
- \`\`\`
171
+ ${getNextStepToSpec(args)}
155
172
  `,
156
173
  },
157
174
  {
@@ -191,13 +208,7 @@ Where \`<feature-name>\` is the last segment of the branch name (after the last
191
208
 
192
209
  ${args}
193
210
 
194
- ## Next Step
195
-
196
- Run the following command to write the feature specification:
197
-
198
- \`\`\`
199
- /osddt.spec <brief description of the feature being built>
200
- \`\`\`
211
+ ${getNextStepToSpec(args)}
201
212
  `,
202
213
  },
203
214
  {
@@ -205,10 +216,11 @@ Run the following command to write the feature specification:
205
216
  description: 'Analyze requirements and write a feature specification',
206
217
  body: ({ args }) => `## Instructions
207
218
 
208
- 1. Check whether \`osddt.research.md\` exists in the working directory.
209
- - If it exists, read it and use its findings (key insights, constraints, open questions, codebase findings) as additional context when writing the specification.
210
- - If it does not exist, proceed using only the requirements provided in ${args}.
211
- 2. Analyze the requirements provided in ${args}
219
+ 1. Gather requirements from all available sources combine them when multiple sources are present:
220
+ - **Arguments** (${args}): use as the primary description of the feature, if provided.
221
+ - **Conversation context**: consider any additional details, clarifications, or constraints discussed in the current session that are not captured in ${args}.
222
+ - **Research file**: if \`osddt.research.md\` exists in the working directory, read it and incorporate its findings (key insights, constraints, open questions, codebase findings).
223
+ 2. Analyze the combined requirements
212
224
  3. Identify the core problem being solved
213
225
  4. Define the scope, user-facing constraints, and acceptance criteria
214
226
  5. Write the specification to \`osddt.spec.md\` in the working directory
@@ -225,6 +237,7 @@ The spec should include:
225
237
  - **Open Questions**: Ambiguities about desired behaviour or product decisions to resolve
226
238
 
227
239
  > If \`osddt.research.md\` was found, add a **Research Summary** section that briefly references the key insights and user-facing constraints it identified.
240
+ > If additional context was gathered from the conversation session, add a **Session Context** section summarising any extra details, decisions, or constraints discussed beyond what was passed as arguments.
228
241
 
229
242
  ## Arguments
230
243
 
@@ -2,6 +2,7 @@ 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
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.";
5
+ export declare function getNextStepToSpec(args: ArgPlaceholder): string;
5
6
  export type ArgPlaceholder = '$ARGUMENTS' | '{{args}}';
6
7
  export interface CommandDefinitionContext {
7
8
  args: ArgPlaceholder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dezkareid/osddt",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Package for Spec-Driven Development workflow",
5
5
  "keywords": [
6
6
  "spec-driven",