@applica-software-guru/sdd-core 1.8.1 → 1.8.3
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/dist/agent/agent-defaults.js +2 -2
- package/dist/agent/agent-defaults.js.map +1 -1
- package/dist/agent/agent-runner.d.ts +17 -0
- package/dist/agent/agent-runner.d.ts.map +1 -1
- package/dist/agent/agent-runner.js +163 -11
- package/dist/agent/agent-runner.js.map +1 -1
- package/dist/agent/worker-daemon.d.ts +12 -0
- package/dist/agent/worker-daemon.d.ts.map +1 -0
- package/dist/agent/worker-daemon.js +220 -0
- package/dist/agent/worker-daemon.js.map +1 -0
- package/dist/git/git.d.ts +6 -0
- package/dist/git/git.d.ts.map +1 -1
- package/dist/git/git.js +60 -0
- package/dist/git/git.js.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -3
- package/dist/index.js.map +1 -1
- package/dist/parser/bug-parser.d.ts.map +1 -1
- package/dist/parser/bug-parser.js +2 -1
- package/dist/parser/bug-parser.js.map +1 -1
- package/dist/parser/cr-parser.d.ts.map +1 -1
- package/dist/parser/cr-parser.js +2 -1
- package/dist/parser/cr-parser.js.map +1 -1
- package/dist/prompt/draft-prompt-generator.d.ts +1 -1
- package/dist/prompt/draft-prompt-generator.d.ts.map +1 -1
- package/dist/prompt/draft-prompt-generator.js +23 -35
- package/dist/prompt/draft-prompt-generator.js.map +1 -1
- package/dist/prompt/prompt-generator.d.ts.map +1 -1
- package/dist/prompt/prompt-generator.js +5 -0
- package/dist/prompt/prompt-generator.js.map +1 -1
- package/dist/remote/api-client.d.ts +2 -2
- package/dist/remote/api-client.d.ts.map +1 -1
- package/dist/remote/api-client.js +4 -4
- package/dist/remote/api-client.js.map +1 -1
- package/dist/remote/sync-engine.d.ts.map +1 -1
- package/dist/remote/sync-engine.js +13 -8
- package/dist/remote/sync-engine.js.map +1 -1
- package/dist/remote/worker-client.d.ts +22 -0
- package/dist/remote/worker-client.d.ts.map +1 -0
- package/dist/remote/worker-client.js +88 -0
- package/dist/remote/worker-client.js.map +1 -0
- package/dist/remote/worker-types.d.ts +38 -0
- package/dist/remote/worker-types.d.ts.map +1 -0
- package/dist/remote/worker-types.js +3 -0
- package/dist/remote/worker-types.js.map +1 -0
- package/dist/scaffold/skill-adapters.d.ts +0 -9
- package/dist/scaffold/skill-adapters.d.ts.map +1 -1
- package/dist/scaffold/skill-adapters.js +17 -0
- package/dist/scaffold/skill-adapters.js.map +1 -1
- package/dist/scaffold/templates.d.ts +1 -5
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.generated.d.ts +7 -0
- package/dist/scaffold/templates.generated.d.ts.map +1 -0
- package/dist/scaffold/templates.generated.js +482 -0
- package/dist/scaffold/templates.generated.js.map +1 -0
- package/dist/scaffold/templates.js +8 -338
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/sdd.d.ts +0 -1
- package/dist/sdd.d.ts.map +1 -1
- package/dist/sdd.js +1 -18
- package/dist/sdd.js.map +1 -1
- package/package.json +2 -1
- package/scripts/generate-templates.mjs +38 -0
- package/src/agent/agent-defaults.ts +2 -2
- package/src/agent/agent-runner.ts +184 -12
- package/src/agent/worker-daemon.ts +254 -0
- package/src/git/git.ts +61 -0
- package/src/index.ts +8 -3
- package/src/parser/bug-parser.ts +5 -3
- package/src/parser/cr-parser.ts +5 -3
- package/src/prompt/draft-prompt-generator.ts +26 -38
- package/src/prompt/prompt-generator.ts +8 -0
- package/src/remote/api-client.ts +2 -2
- package/src/remote/sync-engine.ts +16 -15
- package/src/remote/worker-client.ts +141 -0
- package/src/remote/worker-types.ts +40 -0
- package/src/scaffold/skill-adapters.ts +18 -11
- package/src/scaffold/templates.generated.ts +484 -0
- package/src/scaffold/templates.ts +9 -342
- package/src/sdd.ts +1 -19
- package/tests/agent-defaults.test.ts +24 -0
- package/tests/api-client.test.ts +6 -6
- package/tests/draft-prompt.test.ts +78 -0
- package/dist/prompt/apply-prompt-generator.d.ts +0 -4
- package/dist/prompt/apply-prompt-generator.d.ts.map +0 -1
- package/dist/prompt/apply-prompt-generator.js +0 -97
- package/dist/prompt/apply-prompt-generator.js.map +0 -1
- package/src/prompt/apply-prompt-generator.ts +0 -117
- package/tests/apply.test.ts +0 -117
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
// @generated — DO NOT EDIT. Source of truth: packages/skill/
|
|
2
|
+
// Regenerate with: node packages/core/scripts/generate-templates.mjs
|
|
3
|
+
|
|
4
|
+
export const SKILL_MD_TEMPLATE = `---
|
|
5
|
+
name: sdd
|
|
6
|
+
description: >
|
|
7
|
+
Story Driven Development workflow. Use when working in a project
|
|
8
|
+
with .sdd/config.yaml, or when the user mentions SDD, sdd sync,
|
|
9
|
+
story driven development, or spec-driven development.
|
|
10
|
+
license: MIT
|
|
11
|
+
compatibility: Requires sdd CLI (npm i -g @applica-software-guru/sdd)
|
|
12
|
+
allowed-tools: Bash(sdd:*) Read Glob Grep
|
|
13
|
+
metadata:
|
|
14
|
+
author: applica-software-guru
|
|
15
|
+
version: "1.0"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# SDD — Story Driven Development
|
|
19
|
+
|
|
20
|
+
## Detection
|
|
21
|
+
|
|
22
|
+
This project uses SDD if \`.sdd/config.yaml\` exists in the project root.
|
|
23
|
+
|
|
24
|
+
## Workflow
|
|
25
|
+
|
|
26
|
+
Follow this loop every time you work on an SDD project:
|
|
27
|
+
|
|
28
|
+
1. Run \`sdd bug open\` — check if there are open bugs to fix first
|
|
29
|
+
2. If there are open bugs, fix the code/docs, then run \`sdd mark-bug-resolved\`
|
|
30
|
+
3. Run \`sdd cr pending\` — check if there are change requests to process
|
|
31
|
+
4. If there are pending CRs, apply them to the docs, then run \`sdd mark-cr-applied\`
|
|
32
|
+
5. Run \`sdd sync\` to see what needs to be implemented
|
|
33
|
+
6. Read the documentation files listed in the sync output
|
|
34
|
+
7. Implement what each file describes, writing code inside \`code/\`
|
|
35
|
+
8. After implementing, mark files as synced:
|
|
36
|
+
|
|
37
|
+
\`\`\`
|
|
38
|
+
sdd mark-synced product/features/auth.md
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
Or mark all pending files at once:
|
|
42
|
+
|
|
43
|
+
\`\`\`
|
|
44
|
+
sdd mark-synced
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
9. **Commit immediately after mark-synced** — this is mandatory:
|
|
48
|
+
|
|
49
|
+
\`\`\`
|
|
50
|
+
git add -A && git commit -m "sdd sync: <brief description of what was implemented>"
|
|
51
|
+
\`\`\`
|
|
52
|
+
|
|
53
|
+
Do NOT skip this step. Every mark-synced must be followed by a git commit.
|
|
54
|
+
|
|
55
|
+
10. If remote sync is configured (remote section in \`.sdd/config.yaml\` and API key available), remind the user they can publish updates with:
|
|
56
|
+
|
|
57
|
+
\`\`\`
|
|
58
|
+
sdd push
|
|
59
|
+
\`\`\`
|
|
60
|
+
|
|
61
|
+
### Removing a feature
|
|
62
|
+
|
|
63
|
+
If a documentation file has \`status: deleted\`, it means that feature should be removed.
|
|
64
|
+
Delete the related code in \`code/\`, then run \`sdd mark-synced <file>\` (the doc file will be removed automatically), then commit.
|
|
65
|
+
|
|
66
|
+
## Available commands
|
|
67
|
+
|
|
68
|
+
- \`sdd status\` — See all documentation files and their state (new/changed/deleted/synced)
|
|
69
|
+
- \`sdd diff\` — See what changed since last sync
|
|
70
|
+
- \`sdd sync\` — Get the sync prompt for pending files (includes git diff for changed files)
|
|
71
|
+
- \`sdd validate\` — Check for broken references and issues
|
|
72
|
+
- \`sdd mark-synced [files...]\` — Mark specific files (or all) as synced
|
|
73
|
+
- \`sdd cr list\` — List all change requests with their status
|
|
74
|
+
- \`sdd cr pending\` — Show pending change requests to process
|
|
75
|
+
- \`sdd mark-cr-applied [files...]\` — Mark change requests as applied
|
|
76
|
+
- \`sdd bug list\` — List all bugs with their status
|
|
77
|
+
- \`sdd bug open\` — Show open bugs to fix
|
|
78
|
+
- \`sdd mark-bug-resolved [files...]\` — Mark bugs as resolved
|
|
79
|
+
|
|
80
|
+
## Rules
|
|
81
|
+
|
|
82
|
+
1. **Always commit after mark-synced** — run \`git add -A && git commit -m "sdd sync: ..."\` immediately after \`sdd mark-synced\`. Never leave synced files uncommitted.
|
|
83
|
+
2. Before running \`sdd sync\`, check for open bugs with \`sdd bug open\` and pending change requests with \`sdd cr pending\`
|
|
84
|
+
3. If there are pending CRs, apply them to the docs first, then mark them with \`sdd mark-cr-applied\`
|
|
85
|
+
4. Only implement what the sync prompt asks for
|
|
86
|
+
5. All generated code goes inside \`code/\`
|
|
87
|
+
6. Respect all constraints in \`## Agent Notes\` sections (if present)
|
|
88
|
+
7. Do not edit files inside \`.sdd/\` manually
|
|
89
|
+
8. If remote is configured, suggest \`sdd push\` after successful local sync + commit
|
|
90
|
+
|
|
91
|
+
## Project structure
|
|
92
|
+
|
|
93
|
+
- \`product/\` — What to build (vision, users, features)
|
|
94
|
+
- \`system/\` — How to build it (entities, architecture, tech stack, interfaces)
|
|
95
|
+
- \`code/\` — All generated source code goes here
|
|
96
|
+
- \`change-requests/\` — Change requests to the documentation
|
|
97
|
+
- \`bugs/\` — Bug reports
|
|
98
|
+
- \`.sdd/\` — Project config and sync state (do not edit)
|
|
99
|
+
|
|
100
|
+
## References
|
|
101
|
+
|
|
102
|
+
For detailed information on specific topics, see:
|
|
103
|
+
|
|
104
|
+
- [File format and status lifecycle](references/file-format.md)
|
|
105
|
+
- [Change Requests workflow](references/change-requests.md)
|
|
106
|
+
- [Bug workflow](references/bugs.md)
|
|
107
|
+
- [Remote pull/enrich/push workflow](../sdd-remote/SKILL.md)
|
|
108
|
+
- [UI Component workflow](../sdd-ui/SKILL.md)
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
export const SKILL_UI_MD_TEMPLATE = `---
|
|
112
|
+
name: sdd-ui
|
|
113
|
+
description: >
|
|
114
|
+
UI Component Editor workflow. Use when the user wants to implement a React component
|
|
115
|
+
from a screenshot in an SDD project, iterating visually with live preview.
|
|
116
|
+
license: MIT
|
|
117
|
+
compatibility: >
|
|
118
|
+
Requires sdd CLI (npm i -g @applica-software-guru/sdd).
|
|
119
|
+
Requires Playwright MCP configured in Claude Code
|
|
120
|
+
(e.g. @playwright/mcp or @executeautomation/playwright-mcp).
|
|
121
|
+
allowed-tools: Bash(sdd:*) Read Glob Grep Edit Write mcp__playwright__screenshot mcp__playwright__navigate mcp__playwright__click
|
|
122
|
+
metadata:
|
|
123
|
+
author: applica-software-guru
|
|
124
|
+
version: "1.1"
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
# SDD UI — Visual Component Editor
|
|
128
|
+
|
|
129
|
+
## Purpose
|
|
130
|
+
|
|
131
|
+
Use this workflow when implementing a React component from a screenshot reference in an SDD project.
|
|
132
|
+
The split-panel editor shows the spec screenshot on the left and the live component on the right,
|
|
133
|
+
so you can iterate visually until they match.
|
|
134
|
+
|
|
135
|
+
## Prerequisites
|
|
136
|
+
|
|
137
|
+
- \`sdd\` CLI installed globally
|
|
138
|
+
- Playwright MCP configured in Claude Code settings
|
|
139
|
+
- e.g. \`@playwright/mcp\` or \`@executeautomation/playwright-mcp\`
|
|
140
|
+
- If not configured, inform the user and stop — visual feedback won't work without it
|
|
141
|
+
|
|
142
|
+
## Workflow
|
|
143
|
+
|
|
144
|
+
### Step 1 — Read the spec
|
|
145
|
+
|
|
146
|
+
Read the SDD feature file to understand what the component should look like and do.
|
|
147
|
+
Look for any screenshot paths referenced in the feature doc.
|
|
148
|
+
|
|
149
|
+
### Step 2 — Launch the editor
|
|
150
|
+
|
|
151
|
+
\`\`\`bash
|
|
152
|
+
# Single screenshot — detached (recommended when run by an agent)
|
|
153
|
+
sdd ui launch-editor LoginForm \\
|
|
154
|
+
--screenshot product/features/auth/login.png \\
|
|
155
|
+
--detach
|
|
156
|
+
|
|
157
|
+
# Multiple screenshots (e.g. desktop + mobile)
|
|
158
|
+
sdd ui launch-editor LoginForm \\
|
|
159
|
+
--screenshot product/features/auth/login-desktop.png \\
|
|
160
|
+
--screenshot product/features/auth/login-mobile.png \\
|
|
161
|
+
--detach
|
|
162
|
+
\`\`\`
|
|
163
|
+
|
|
164
|
+
The command will:
|
|
165
|
+
- Scaffold \`code/components/LoginForm.tsx\` if it doesn't exist
|
|
166
|
+
- Print the exact component file path to edit
|
|
167
|
+
- Start the editor at \`http://localhost:5174\`
|
|
168
|
+
|
|
169
|
+
With \`--detach\` the process runs in background and the terminal is immediately free.
|
|
170
|
+
Without \`--detach\` it runs in foreground (use Ctrl+C to stop).
|
|
171
|
+
|
|
172
|
+
With multiple screenshots, the left panel shows a tab per screenshot.
|
|
173
|
+
With a single screenshot, no tab bar is shown.
|
|
174
|
+
|
|
175
|
+
### Step 3 — Implement the component
|
|
176
|
+
|
|
177
|
+
Edit the file printed by \`sdd ui launch-editor\` (e.g. \`code/components/LoginForm.tsx\`).
|
|
178
|
+
|
|
179
|
+
Write a React component that matches the screenshot. Use standard HTML/CSS or inline styles —
|
|
180
|
+
no external UI library unless the project already uses one.
|
|
181
|
+
|
|
182
|
+
Vite HMR will update the right panel automatically on every save.
|
|
183
|
+
|
|
184
|
+
### Step 4 — Visual check with Playwright
|
|
185
|
+
|
|
186
|
+
After each save, screenshot the live preview and compare it with the spec:
|
|
187
|
+
|
|
188
|
+
\`\`\`
|
|
189
|
+
mcp__playwright__navigate http://localhost:5174
|
|
190
|
+
mcp__playwright__screenshot
|
|
191
|
+
\`\`\`
|
|
192
|
+
|
|
193
|
+
The left panel already shows the spec screenshot for direct comparison.
|
|
194
|
+
Note differences in layout, spacing, typography, colors, and component structure.
|
|
195
|
+
|
|
196
|
+
### Step 5 — Iterate
|
|
197
|
+
|
|
198
|
+
Edit component → Playwright screenshot → compare → repeat until the preview matches the spec.
|
|
199
|
+
|
|
200
|
+
### Step 6 — Finalize
|
|
201
|
+
|
|
202
|
+
\`\`\`bash
|
|
203
|
+
sdd ui stop
|
|
204
|
+
sdd mark-synced product/features/auth/login.md
|
|
205
|
+
git add -A && git commit -m "sdd sync: implement LoginForm component"
|
|
206
|
+
\`\`\`
|
|
207
|
+
|
|
208
|
+
## Notes
|
|
209
|
+
|
|
210
|
+
- The component file is permanent — it lives in \`code/components/\` and is part of your project
|
|
211
|
+
- Port \`5174\` by default (not \`5173\`) to avoid conflicts with the user's app dev server
|
|
212
|
+
- If the component needs props, scaffold it with hardcoded sample data for the preview
|
|
213
|
+
|
|
214
|
+
## Troubleshooting
|
|
215
|
+
|
|
216
|
+
**Playwright MCP not configured:**
|
|
217
|
+
Stop and ask the user to add it to their Claude Code MCP settings before continuing.
|
|
218
|
+
|
|
219
|
+
**Component import fails in preview:**
|
|
220
|
+
Check that the component file has a valid default export and no TypeScript errors.
|
|
221
|
+
|
|
222
|
+
**Port already in use:**
|
|
223
|
+
\`sdd ui launch-editor LoginForm --screenshot login.png --port 5175\`
|
|
224
|
+
`;
|
|
225
|
+
|
|
226
|
+
export const SKILL_REMOTE_MD_TEMPLATE = `---
|
|
227
|
+
name: sdd-remote
|
|
228
|
+
description: >
|
|
229
|
+
Remote sync workflow for Story Driven Development. Use when the user asks
|
|
230
|
+
to update local state from remote changes, process remote drafts, and push
|
|
231
|
+
enriched items back. Also applies when running a remote worker job (enrich
|
|
232
|
+
or sync).
|
|
233
|
+
license: MIT
|
|
234
|
+
compatibility: Requires sdd CLI (npm i -g @applica-software-guru/sdd)
|
|
235
|
+
allowed-tools: Bash(sdd:*) Read Glob Grep
|
|
236
|
+
metadata:
|
|
237
|
+
author: applica-software-guru
|
|
238
|
+
version: "1.1"
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
# SDD Remote - Pull, Enrich, Push
|
|
242
|
+
|
|
243
|
+
## Purpose
|
|
244
|
+
|
|
245
|
+
Use this skill to synchronize local SDD docs with remote updates, enrich draft content,
|
|
246
|
+
and publish the enriched result to remote in active states.
|
|
247
|
+
|
|
248
|
+
This skill also applies when a **remote worker job** is dispatched from SDD Flow, as the
|
|
249
|
+
worker runs these same workflows on behalf of the user.
|
|
250
|
+
|
|
251
|
+
## Detection
|
|
252
|
+
|
|
253
|
+
This workflow applies when:
|
|
254
|
+
|
|
255
|
+
- \`.sdd/config.yaml\` exists in the project root
|
|
256
|
+
- The user asks to update local state from remote, pull pending CRs/bugs/docs,
|
|
257
|
+
enrich drafts, or push pending remote updates
|
|
258
|
+
- A remote worker job prompt instructs you to follow this workflow
|
|
259
|
+
|
|
260
|
+
## Workflows
|
|
261
|
+
|
|
262
|
+
### Enrich Workflow (CR)
|
|
263
|
+
|
|
264
|
+
Follow this sequence to enrich a draft Change Request:
|
|
265
|
+
|
|
266
|
+
1. Pull remote updates:
|
|
267
|
+
|
|
268
|
+
\`\`\`bash
|
|
269
|
+
sdd pull --crs-only
|
|
270
|
+
\`\`\`
|
|
271
|
+
|
|
272
|
+
3. Generate draft TODO list:
|
|
273
|
+
|
|
274
|
+
\`\`\`bash
|
|
275
|
+
sdd drafts
|
|
276
|
+
\`\`\`
|
|
277
|
+
|
|
278
|
+
4. Enrich the draft with technical details, acceptance criteria, edge cases, and
|
|
279
|
+
any relevant information from the project documentation and comments.
|
|
280
|
+
|
|
281
|
+
5. Transition the enriched CR to pending:
|
|
282
|
+
|
|
283
|
+
\`\`\`bash
|
|
284
|
+
sdd mark-drafts-enriched
|
|
285
|
+
\`\`\`
|
|
286
|
+
|
|
287
|
+
This performs: \`draft → pending\`
|
|
288
|
+
|
|
289
|
+
6. Push the enriched content:
|
|
290
|
+
|
|
291
|
+
\`\`\`bash
|
|
292
|
+
sdd push
|
|
293
|
+
\`\`\`
|
|
294
|
+
|
|
295
|
+
### Enrich Workflow (Document)
|
|
296
|
+
|
|
297
|
+
Follow this sequence to enrich a document:
|
|
298
|
+
|
|
299
|
+
1. Pull remote updates:
|
|
300
|
+
|
|
301
|
+
\`\`\`bash
|
|
302
|
+
sdd pull --docs-only
|
|
303
|
+
\`\`\`
|
|
304
|
+
|
|
305
|
+
3. Locate the document file in \`product/\` or \`system/\` and update its content
|
|
306
|
+
with the enriched version.
|
|
307
|
+
|
|
308
|
+
4. Push the enriched content:
|
|
309
|
+
|
|
310
|
+
\`\`\`bash
|
|
311
|
+
sdd push
|
|
312
|
+
\`\`\`
|
|
313
|
+
|
|
314
|
+
If the document was in \`draft\` status, it will transition to \`new\` on the server.
|
|
315
|
+
|
|
316
|
+
### Sync Workflow (Project-level)
|
|
317
|
+
|
|
318
|
+
Follow this sequence for a full project sync (all pending items):
|
|
319
|
+
|
|
320
|
+
1. Pull the latest specs:
|
|
321
|
+
|
|
322
|
+
\`\`\`bash
|
|
323
|
+
sdd pull
|
|
324
|
+
\`\`\`
|
|
325
|
+
|
|
326
|
+
3. Run the \`sdd\` skill — it handles the full loop: open bugs, pending CRs,
|
|
327
|
+
documentation sync, code implementation, mark-synced, and commit.
|
|
328
|
+
|
|
329
|
+
4. Push:
|
|
330
|
+
|
|
331
|
+
\`\`\`bash
|
|
332
|
+
sdd push
|
|
333
|
+
\`\`\`
|
|
334
|
+
|
|
335
|
+
## Rules
|
|
336
|
+
|
|
337
|
+
1. Always check remote configuration before pull/push (\`sdd remote status\`)
|
|
338
|
+
3. Do not use \`sdd push --all\` unless the user explicitly asks for a full reseed
|
|
339
|
+
4. If pull reports conflicts, do not overwrite local files blindly; report conflicts and ask how to proceed
|
|
340
|
+
5. Do not edit files inside \`.sdd/\` manually
|
|
341
|
+
6. Keep status transitions explicit: enrich first, then \`sdd mark-drafts-enriched\`, then push
|
|
342
|
+
7. **Always commit before pushing** when the sync workflow makes code changes
|
|
343
|
+
|
|
344
|
+
## Related commands
|
|
345
|
+
|
|
346
|
+
- \`sdd remote init\`
|
|
347
|
+
- \`sdd remote status\`
|
|
348
|
+
- \`sdd pull\`
|
|
349
|
+
- \`sdd drafts\`
|
|
350
|
+
- \`sdd mark-drafts-enriched\`
|
|
351
|
+
- \`sdd sync\`
|
|
352
|
+
- \`sdd mark-synced\`
|
|
353
|
+
- \`sdd push\`
|
|
354
|
+
`;
|
|
355
|
+
|
|
356
|
+
export const FILE_FORMAT_REFERENCE = `# File Format and Status Lifecycle
|
|
357
|
+
|
|
358
|
+
## YAML Frontmatter
|
|
359
|
+
|
|
360
|
+
Every \`.md\` file in \`product/\` and \`system/\` must start with this YAML frontmatter:
|
|
361
|
+
|
|
362
|
+
\`\`\`yaml
|
|
363
|
+
---
|
|
364
|
+
title: "File title"
|
|
365
|
+
status: new
|
|
366
|
+
author: ""
|
|
367
|
+
last-modified: "2025-01-01T00:00:00.000Z"
|
|
368
|
+
version: "1.0"
|
|
369
|
+
---
|
|
370
|
+
\`\`\`
|
|
371
|
+
|
|
372
|
+
## Status values
|
|
373
|
+
|
|
374
|
+
- **\`new\`** — new file, needs to be implemented
|
|
375
|
+
- **\`changed\`** — modified since last sync, code needs updating
|
|
376
|
+
- **\`deleted\`** — feature to be removed, agent should delete related code
|
|
377
|
+
- **\`synced\`** — already implemented, up to date
|
|
378
|
+
|
|
379
|
+
## Version
|
|
380
|
+
|
|
381
|
+
Patch-bump on each edit: 1.0 → 1.1 → 1.2
|
|
382
|
+
|
|
383
|
+
## Last-modified
|
|
384
|
+
|
|
385
|
+
ISO 8601 datetime, updated on each edit.
|
|
386
|
+
|
|
387
|
+
## How sync works
|
|
388
|
+
|
|
389
|
+
\`sdd sync\` generates a structured prompt for the agent based on pending files:
|
|
390
|
+
|
|
391
|
+
- **\`new\` files**: the agent reads the full documentation and implements it from scratch
|
|
392
|
+
- **\`changed\` files**: SDD uses \`git diff\` to compute what changed in the documentation since the last commit, and includes the diff in the sync prompt — this way the agent sees exactly what was modified and can update only the affected code
|
|
393
|
+
- **\`deleted\` files**: the agent removes the related code
|
|
394
|
+
|
|
395
|
+
This is why **committing after every mark-synced is mandatory** — the git history is what SDD uses to detect changes.
|
|
396
|
+
|
|
397
|
+
## UX and screenshots
|
|
398
|
+
|
|
399
|
+
When a feature has UX mockups or screenshots, place them next to the feature doc:
|
|
400
|
+
|
|
401
|
+
- **Simple feature** (no screenshots): \`product/features/auth.md\`
|
|
402
|
+
- **Feature with screenshots**: use a folder with \`index.md\`:
|
|
403
|
+
|
|
404
|
+
\`\`\`
|
|
405
|
+
product/features/auth/
|
|
406
|
+
index.md ← feature doc
|
|
407
|
+
login.png ← screenshot
|
|
408
|
+
register.png ← screenshot
|
|
409
|
+
\`\`\`
|
|
410
|
+
|
|
411
|
+
Reference images in the markdown with relative paths:
|
|
412
|
+
|
|
413
|
+
\`\`\`markdown
|
|
414
|
+
## UX
|
|
415
|
+
|
|
416
|
+

|
|
417
|
+

|
|
418
|
+
\`\`\`
|
|
419
|
+
|
|
420
|
+
Both formats work — use a folder only when you have screenshots or multiple files for a feature.
|
|
421
|
+
`;
|
|
422
|
+
|
|
423
|
+
export const CHANGE_REQUESTS_REFERENCE = `# Change Requests
|
|
424
|
+
|
|
425
|
+
Change Requests (CRs) are markdown files in \`change-requests/\` that describe modifications to the documentation.
|
|
426
|
+
|
|
427
|
+
## CR format
|
|
428
|
+
|
|
429
|
+
\`\`\`yaml
|
|
430
|
+
---
|
|
431
|
+
title: "Add authentication feature"
|
|
432
|
+
status: draft
|
|
433
|
+
author: "user"
|
|
434
|
+
created-at: "2025-01-01T00:00:00.000Z"
|
|
435
|
+
---
|
|
436
|
+
\`\`\`
|
|
437
|
+
|
|
438
|
+
- **status**: \`draft\` (pending) or \`applied\` (already processed)
|
|
439
|
+
- **status**: \`draft\` (needs enrichment), \`pending\` (ready to process), or \`applied\` (already processed)
|
|
440
|
+
|
|
441
|
+
## CR workflow
|
|
442
|
+
|
|
443
|
+
1. Check for pending CRs: \`sdd cr pending\`
|
|
444
|
+
2. Read each pending CR and apply the described changes to the documentation files (marking them as \`new\`, \`changed\`, or \`deleted\`)
|
|
445
|
+
3. After applying a CR to the docs, mark it: \`sdd mark-cr-applied change-requests/CR-001.md\`
|
|
446
|
+
4. Then run \`sdd sync\` to implement the code changes
|
|
447
|
+
|
|
448
|
+
## CR commands
|
|
449
|
+
|
|
450
|
+
- \`sdd cr list\` — See all change requests and their status
|
|
451
|
+
- \`sdd cr pending\` — Show only pending CRs to process
|
|
452
|
+
- \`sdd mark-cr-applied [files...]\` — Mark CRs as applied after updating the docs
|
|
453
|
+
`;
|
|
454
|
+
|
|
455
|
+
export const BUGS_REFERENCE = `# Bugs
|
|
456
|
+
|
|
457
|
+
Bugs are markdown files in \`bugs/\` that describe problems found in the codebase.
|
|
458
|
+
|
|
459
|
+
## Bug format
|
|
460
|
+
|
|
461
|
+
\`\`\`yaml
|
|
462
|
+
---
|
|
463
|
+
title: "Login fails with empty password"
|
|
464
|
+
status: open
|
|
465
|
+
author: "user"
|
|
466
|
+
created-at: "2025-01-01T00:00:00.000Z"
|
|
467
|
+
---
|
|
468
|
+
\`\`\`
|
|
469
|
+
|
|
470
|
+
- **status**: \`draft\` (needs enrichment), \`open\` (needs fixing), or \`resolved\` (already fixed)
|
|
471
|
+
|
|
472
|
+
## Bug workflow
|
|
473
|
+
|
|
474
|
+
1. Check for open bugs: \`sdd bug open\`
|
|
475
|
+
2. Read each open bug and fix the code and/or documentation
|
|
476
|
+
3. After fixing a bug, mark it: \`sdd mark-bug-resolved bugs/BUG-001.md\`
|
|
477
|
+
4. Commit the fix
|
|
478
|
+
|
|
479
|
+
## Bug commands
|
|
480
|
+
|
|
481
|
+
- \`sdd bug list\` — See all bugs and their status
|
|
482
|
+
- \`sdd bug open\` — Show only open bugs to fix
|
|
483
|
+
- \`sdd mark-bug-resolved [files...]\` — Mark bugs as resolved after fixing
|
|
484
|
+
`;
|