@pdlc-os/pdlc 0.1.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/.claude/commands/brainstorm.md +360 -0
- package/.claude/commands/build.md +383 -0
- package/.claude/commands/init.md +371 -0
- package/.claude/commands/ship.md +349 -0
- package/.claude/settings.json +40 -0
- package/CLAUDE.md +179 -0
- package/README.md +452 -0
- package/agents/bolt.md +84 -0
- package/agents/echo.md +87 -0
- package/agents/friday.md +83 -0
- package/agents/jarvis.md +87 -0
- package/agents/muse.md +87 -0
- package/agents/neo.md +78 -0
- package/agents/oracle.md +81 -0
- package/agents/phantom.md +85 -0
- package/agents/pulse.md +95 -0
- package/bin/pdlc.js +221 -0
- package/hooks/pdlc-context-monitor.js +129 -0
- package/hooks/pdlc-guardrails.js +307 -0
- package/hooks/pdlc-session-start.sh +73 -0
- package/hooks/pdlc-statusline.js +183 -0
- package/package.json +48 -0
- package/scripts/frame-template.html +332 -0
- package/scripts/helper.js +88 -0
- package/scripts/server.cjs +357 -0
- package/scripts/start-server.sh +173 -0
- package/scripts/stop-server.sh +54 -0
- package/skills/reflect.md +189 -0
- package/skills/repo-scan.md +266 -0
- package/skills/review.md +156 -0
- package/skills/safety-guardrails.md +168 -0
- package/skills/ship.md +148 -0
- package/skills/tdd.md +88 -0
- package/skills/test.md +153 -0
- package/templates/CONSTITUTION.md +254 -0
- package/templates/INTENT.md +120 -0
- package/templates/OVERVIEW.md +93 -0
- package/templates/PRD.md +212 -0
- package/templates/STATE.md +113 -0
- package/templates/episode.md +182 -0
- package/templates/review.md +215 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run the Inception phase for a feature (Discover → Define → Design → Plan)
|
|
3
|
+
argument-hint: <feature-name>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are running the Inception phase for a feature. The argument passed to this command is: `$ARGUMENTS`
|
|
7
|
+
|
|
8
|
+
If `$ARGUMENTS` is empty, ask the user: "What feature would you like to brainstorm? (Provide a short slug, e.g. `user-auth` or `billing-integration`)"
|
|
9
|
+
|
|
10
|
+
The feature name (slug) must be kebab-case (lowercase, hyphens, no spaces). If the user provides a name with spaces, convert it automatically (e.g. "user auth" → `user-auth`) and confirm with them.
|
|
11
|
+
|
|
12
|
+
Store the feature slug as `[feature-name]`. Use today's date as `[YYYY-MM-DD]` wherever dates appear in file names and metadata.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Pre-flight: Load project context
|
|
17
|
+
|
|
18
|
+
Before anything else, read these two files completely:
|
|
19
|
+
|
|
20
|
+
1. `docs/pdlc/memory/CONSTITUTION.md` — for tech stack, architectural constraints, test gates, and coding standards
|
|
21
|
+
2. `docs/pdlc/memory/INTENT.md` — for the core problem, target user, and value proposition
|
|
22
|
+
|
|
23
|
+
If either file is missing, stop and tell the user:
|
|
24
|
+
|
|
25
|
+
> "PDLC memory files not found. Please run `/pdlc init` first to set up this project."
|
|
26
|
+
|
|
27
|
+
Update `docs/pdlc/memory/STATE.md`:
|
|
28
|
+
- **Current Phase**: `Inception`
|
|
29
|
+
- **Current Feature**: `[feature-name]`
|
|
30
|
+
- **Current Sub-phase**: `Discover`
|
|
31
|
+
- **Last Checkpoint**: `Inception / Discover / [now ISO 8601]`
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Sub-phase 1: DISCOVER
|
|
36
|
+
|
|
37
|
+
### Step 1 — Start the Visual Companion Server
|
|
38
|
+
|
|
39
|
+
Run:
|
|
40
|
+
```bash
|
|
41
|
+
bash scripts/start-server.sh --project-dir $(pwd)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Capture the URL from the output (it will be a `localhost` address on a random high port, e.g. `http://localhost:49823`).
|
|
45
|
+
|
|
46
|
+
Tell the user:
|
|
47
|
+
|
|
48
|
+
> "Visual companion is running at [URL] — open it in your browser. It will update live as we work through discovery."
|
|
49
|
+
|
|
50
|
+
If the script is not yet available (scripts directory missing), note it and continue without the visual companion — do not block the workflow.
|
|
51
|
+
|
|
52
|
+
### Step 2 — Socratic discovery
|
|
53
|
+
|
|
54
|
+
Before asking the first question, print this notice in blue text using ANSI escape codes:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
\x1b[34mTip: You can type 'skip' at any time to stop the questions and proceed to PRD generation with whatever information has been collected so far.\x1b[0m
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Ask the user probing questions **one at a time**. Wait for each answer before asking the next. Minimum 6 questions. Use the answers to build a rich understanding of the feature before generating any output.
|
|
61
|
+
|
|
62
|
+
After each answer, check: **if the user's response is exactly `skip` (case-insensitive), stop asking questions immediately and proceed to Step 3 (external context ingestion) using whatever answers have been collected so far.** Mark unanswered questions as `TBD — skipped during discovery` in the PRD draft.
|
|
63
|
+
|
|
64
|
+
Ask these questions in this order:
|
|
65
|
+
|
|
66
|
+
1. "What problem does this specific feature solve? (Be concrete — what is the user unable to do today, and what is the cost of that gap?)"
|
|
67
|
+
|
|
68
|
+
2. "Who specifically will use this feature — and in what context? (Reference the personas in INTENT.md if relevant, or describe a more specific sub-group.)"
|
|
69
|
+
|
|
70
|
+
3. "What does success look like for this feature? What specific metric moves, and by how much?"
|
|
71
|
+
|
|
72
|
+
4. "What are the technical constraints or dependencies for this feature? (Think: existing services it must integrate with, database schemas it must respect, APIs it calls, performance requirements.)"
|
|
73
|
+
|
|
74
|
+
5. "What is explicitly out of scope for this feature? (Name at least 2 things you are deliberately not doing here.)"
|
|
75
|
+
|
|
76
|
+
6. "What are the key risks or assumptions we are making? (What could invalidate this feature or make it harder than expected?)"
|
|
77
|
+
|
|
78
|
+
Ask follow-up questions as needed based on the answers. Good follow-ups probe:
|
|
79
|
+
- Vague success metrics ("What does 'faster' mean in measurable terms?")
|
|
80
|
+
- Unstated dependencies ("Does this feature require any infrastructure that doesn't exist yet?")
|
|
81
|
+
- Thin out-of-scope lists ("Is mobile support out of scope? What about admin tooling?")
|
|
82
|
+
- Undisclosed prior art ("Has anything like this been tried before in this codebase?")
|
|
83
|
+
|
|
84
|
+
Continue until you have a clear, concrete picture of the feature. Stop when you are confident you can write a complete PRD.
|
|
85
|
+
|
|
86
|
+
### Step 3 — Ingest external context (if applicable)
|
|
87
|
+
|
|
88
|
+
If during the conversation the user mentions:
|
|
89
|
+
- A URL → use WebFetch to retrieve the content and summarize what is relevant
|
|
90
|
+
- "my Figma file" or "the Figma link" → ask them to share the URL; retrieve and summarize the design intent
|
|
91
|
+
- "the Notion doc" or "our spec in Notion" → ask for the URL; retrieve and summarize
|
|
92
|
+
- "a Word doc" or shared document → ask them to paste the relevant content directly if you cannot retrieve it
|
|
93
|
+
|
|
94
|
+
Summarize any external content you retrieve and confirm with the user what you have extracted as relevant requirements.
|
|
95
|
+
|
|
96
|
+
### Step 4 — Present discovery summary
|
|
97
|
+
|
|
98
|
+
After the Socratic session is complete, present a structured summary to the user for confirmation before proceeding to Define. Format it clearly:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
DISCOVERY SUMMARY — [feature-name]
|
|
102
|
+
|
|
103
|
+
Feature: [Feature Name]
|
|
104
|
+
Problem: [1–2 sentences]
|
|
105
|
+
User: [who and context]
|
|
106
|
+
Success metric: [specific, measurable]
|
|
107
|
+
Technical constraints: [bullet list]
|
|
108
|
+
Out of scope: [bullet list]
|
|
109
|
+
Key risks / assumptions: [bullet list]
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Ask: "Does this capture what you have in mind? Confirm to continue to Define, or tell me what to adjust."
|
|
113
|
+
|
|
114
|
+
Iterate until the user confirms.
|
|
115
|
+
|
|
116
|
+
Update `docs/pdlc/memory/STATE.md`: Current Sub-phase → `Define`.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Sub-phase 2: DEFINE
|
|
121
|
+
|
|
122
|
+
### Step 5 — Generate the PRD draft
|
|
123
|
+
|
|
124
|
+
Auto-generate a complete PRD draft from the discovery conversation. Use `templates/PRD.md` as the exact structure. Fill in every section:
|
|
125
|
+
|
|
126
|
+
- **Overview**: 2–4 sentences connecting the feature to a goal in INTENT.md
|
|
127
|
+
- **Problem Statement**: concrete, feature-specific problem from the discovery
|
|
128
|
+
- **Target User**: from the discovery answer, cross-referencing INTENT.md personas
|
|
129
|
+
- **Requirements**: numbered list using MUST/SHOULD/MAY (RFC 2119). Derive from the discovery answers. Minimum 4 requirements.
|
|
130
|
+
- **Assumptions**: surfaced from the discovery session. Minimum 3.
|
|
131
|
+
- **Acceptance Criteria**: numbered, binary pass/fail conditions. Map 1:1 or 1:many with requirements. Minimum 4.
|
|
132
|
+
- **User Stories**: BDD Given/When/Then format. Label as US-001, US-002, etc. One story per major acceptance criterion group. Cross-reference AC numbers.
|
|
133
|
+
- **Non-Functional Requirements**: performance, security, accessibility derived from constraints and CONSTITUTION.md
|
|
134
|
+
- **Out of Scope**: from the discovery answer
|
|
135
|
+
- **Design Docs**: leave as template placeholder — will be filled in after Design sub-phase
|
|
136
|
+
- **Approval**: leave blank — to be filled by human
|
|
137
|
+
|
|
138
|
+
Set **Status**: `Draft` and **Date**: today's date.
|
|
139
|
+
|
|
140
|
+
Save the file to: `docs/pdlc/prds/PRD_[feature-name]_[YYYY-MM-DD].md`
|
|
141
|
+
|
|
142
|
+
### Step 6 — PRD approval gate
|
|
143
|
+
|
|
144
|
+
Tell the user:
|
|
145
|
+
|
|
146
|
+
> "PRD draft is ready at `docs/pdlc/prds/PRD_[feature-name]_[YYYY-MM-DD].md`
|
|
147
|
+
>
|
|
148
|
+
> Please review it. Reply **approve** to continue to Design, or provide feedback and I will revise."
|
|
149
|
+
|
|
150
|
+
Wait for explicit approval. Do not proceed to Design until the user approves.
|
|
151
|
+
|
|
152
|
+
If the user provides feedback: revise the PRD, save the updated file, and re-present for approval. Repeat until approved.
|
|
153
|
+
|
|
154
|
+
When approved: update the PRD's **Status** field to `Approved` and record the approver's name/initials and date in the Approval section.
|
|
155
|
+
|
|
156
|
+
Update `docs/pdlc/memory/STATE.md`: Current Sub-phase → `Design`.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Sub-phase 3: DESIGN
|
|
161
|
+
|
|
162
|
+
### Step 7 — Create the design directory
|
|
163
|
+
|
|
164
|
+
Run:
|
|
165
|
+
```bash
|
|
166
|
+
mkdir -p docs/pdlc/design/[feature-name]
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Step 8 — Generate design documents
|
|
170
|
+
|
|
171
|
+
Generate three design documents based on the approved PRD and the tech stack from `CONSTITUTION.md`:
|
|
172
|
+
|
|
173
|
+
**8a. `docs/pdlc/design/[feature-name]/ARCHITECTURE.md`**
|
|
174
|
+
|
|
175
|
+
Document how this feature fits into the existing architecture. Include:
|
|
176
|
+
- Where this feature lives in the system (which layer, which service)
|
|
177
|
+
- What existing modules or services it integrates with or extends
|
|
178
|
+
- New modules or services introduced (if any) and their boundaries
|
|
179
|
+
- Data flow: how data moves through the system for this feature's key user journeys
|
|
180
|
+
- Architectural decisions made for this feature (with rationale)
|
|
181
|
+
- How this conforms to the constraints in `CONSTITUTION.md` §3
|
|
182
|
+
- A Mermaid flowchart showing the high-level component interactions
|
|
183
|
+
|
|
184
|
+
Use the tech stack from CONSTITUTION.md to ensure the architecture is specific to the actual stack, not generic.
|
|
185
|
+
|
|
186
|
+
**8b. `docs/pdlc/design/[feature-name]/data-model.md`**
|
|
187
|
+
|
|
188
|
+
Document any new or modified data structures. Include:
|
|
189
|
+
- New database tables or collections, with all columns/fields and their types
|
|
190
|
+
- Modifications to existing tables (new columns, index changes)
|
|
191
|
+
- Relationships (foreign keys, references) and cardinality
|
|
192
|
+
- A Mermaid entity-relationship diagram
|
|
193
|
+
- Migration notes: what migration file(s) will be needed
|
|
194
|
+
- Any data that is deliberately NOT persisted and why
|
|
195
|
+
|
|
196
|
+
If this feature requires no data model changes, write: "No data model changes. This feature operates on existing schema." and explain why.
|
|
197
|
+
|
|
198
|
+
**8c. `docs/pdlc/design/[feature-name]/api-contracts.md`**
|
|
199
|
+
|
|
200
|
+
Document any new or modified API endpoints. For each endpoint:
|
|
201
|
+
- Method and path
|
|
202
|
+
- Authentication requirements
|
|
203
|
+
- Request body schema (with field types, required/optional, validation rules)
|
|
204
|
+
- Response body schema for success (200/201)
|
|
205
|
+
- Response body schemas for each error case (400, 401, 403, 404, 500)
|
|
206
|
+
- Example request and example response
|
|
207
|
+
- Rate limiting or pagination notes (if applicable)
|
|
208
|
+
|
|
209
|
+
If this feature requires no new API endpoints, write: "No new API endpoints. This feature is [client-only / uses existing endpoints / etc.]" and explain.
|
|
210
|
+
|
|
211
|
+
### Step 9 — Update PRD design doc links
|
|
212
|
+
|
|
213
|
+
Update `docs/pdlc/prds/PRD_[feature-name]_[YYYY-MM-DD].md` to fill in the Design Docs section with relative links to the three files just created.
|
|
214
|
+
|
|
215
|
+
### Step 10 — Design approval gate
|
|
216
|
+
|
|
217
|
+
Tell the user:
|
|
218
|
+
|
|
219
|
+
> "Design documents are ready in `docs/pdlc/design/[feature-name]/`:
|
|
220
|
+
> - `ARCHITECTURE.md`
|
|
221
|
+
> - `data-model.md`
|
|
222
|
+
> - `api-contracts.md`
|
|
223
|
+
>
|
|
224
|
+
> Please review them. Reply **approve** to continue to Plan, or provide feedback and I will revise."
|
|
225
|
+
|
|
226
|
+
Wait for explicit approval. Do not proceed to Plan until the user approves.
|
|
227
|
+
|
|
228
|
+
If the user provides feedback: revise the relevant design doc(s), save the updated files, and re-present for approval. Repeat until approved.
|
|
229
|
+
|
|
230
|
+
Update `docs/pdlc/memory/STATE.md`: Current Sub-phase → `Plan`.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Sub-phase 4: PLAN
|
|
235
|
+
|
|
236
|
+
### Step 11 — Break the feature into tasks
|
|
237
|
+
|
|
238
|
+
Analyze the approved PRD and design documents. Break the feature into discrete, implementable tasks. Follow these rules:
|
|
239
|
+
|
|
240
|
+
- Each task corresponds to one coherent unit of work (one service method, one API endpoint, one UI component, one migration). Do not make tasks too large (no "build the whole feature in one task") or too small (no "add a single variable").
|
|
241
|
+
- Each task must have a clear title, description, and direct link to one or more acceptance criteria from the PRD.
|
|
242
|
+
- Assign tech domain labels to each task: `backend`, `frontend`, `ux`, `devops`, or combinations.
|
|
243
|
+
- Group tasks under their relevant user stories using the `story:[US-id]` label.
|
|
244
|
+
- Identify dependency relationships: which tasks must complete before others can begin.
|
|
245
|
+
|
|
246
|
+
### Step 12 — Create tasks in Beads
|
|
247
|
+
|
|
248
|
+
For each task, run:
|
|
249
|
+
```bash
|
|
250
|
+
bd create "[Task title]" \
|
|
251
|
+
--description "[Detailed description. Reference PRD acceptance criteria by number. Include any context the implementing agent will need.]" \
|
|
252
|
+
--label "epic:[feature-name],story:[US-id],[domain-label]" \
|
|
253
|
+
--type feature
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Capture the Beads task ID returned for each task (format: `bd-XXXX`).
|
|
257
|
+
|
|
258
|
+
### Step 13 — Set up task dependencies
|
|
259
|
+
|
|
260
|
+
For each dependency relationship (task B cannot start before task A completes), run:
|
|
261
|
+
```bash
|
|
262
|
+
bd dep add [task-b-id] --blocks [task-a-id]
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Set up all dependency relationships before generating the tree.
|
|
266
|
+
|
|
267
|
+
### Step 14 — Generate the dependency tree
|
|
268
|
+
|
|
269
|
+
Run:
|
|
270
|
+
```bash
|
|
271
|
+
bd dep tree --format mermaid
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Capture the Mermaid output. If the visual companion server is running, write this Mermaid diagram as an HTML fragment to display in the browser.
|
|
275
|
+
|
|
276
|
+
### Step 15 — Save the plan file
|
|
277
|
+
|
|
278
|
+
Create `docs/pdlc/prds/plans/plan_[feature-name]_[YYYY-MM-DD].md` with this content:
|
|
279
|
+
|
|
280
|
+
```markdown
|
|
281
|
+
# Plan: [Feature Name]
|
|
282
|
+
|
|
283
|
+
**Feature:** [feature-name]
|
|
284
|
+
**Date:** [YYYY-MM-DD]
|
|
285
|
+
**PRD:** [PRD_[feature-name]_[YYYY-MM-DD].md](../PRD_[feature-name]_[YYYY-MM-DD].md)
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Tasks
|
|
290
|
+
|
|
291
|
+
| Beads ID | Title | Labels | Depends On |
|
|
292
|
+
|----------|-------|--------|-----------|
|
|
293
|
+
[one row per task, filled in from Step 12 and 13]
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Dependency Graph
|
|
298
|
+
|
|
299
|
+
[paste the Mermaid output from Step 14 here in a code block]
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Implementation Order
|
|
304
|
+
|
|
305
|
+
[A numbered list describing the natural wave order: which tasks can run in parallel in each wave, based on the dependency graph]
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Step 16 — Plan approval gate
|
|
309
|
+
|
|
310
|
+
Tell the user:
|
|
311
|
+
|
|
312
|
+
> "Task plan is ready at `docs/pdlc/prds/plans/plan_[feature-name]_[YYYY-MM-DD].md`
|
|
313
|
+
>
|
|
314
|
+
> [N] tasks created in Beads. The dependency graph shows [X] waves of parallel work.
|
|
315
|
+
>
|
|
316
|
+
> Please review the plan. Reply **approve** to move to Construction, or provide feedback and I will revise."
|
|
317
|
+
|
|
318
|
+
Wait for explicit approval. Do not proceed until approved.
|
|
319
|
+
|
|
320
|
+
If the user requests changes (add/remove/split tasks): make the changes in Beads and update the plan file. Re-present for approval.
|
|
321
|
+
|
|
322
|
+
### Step 17 — Wrap up Inception
|
|
323
|
+
|
|
324
|
+
After plan approval:
|
|
325
|
+
|
|
326
|
+
**Stop the visual companion server** (if it was running):
|
|
327
|
+
```bash
|
|
328
|
+
bash scripts/stop-server.sh
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
**Update `docs/pdlc/memory/STATE.md`**:
|
|
332
|
+
- **Current Phase**: `Inception Complete — Ready for /pdlc build`
|
|
333
|
+
- **Current Sub-phase**: `none`
|
|
334
|
+
- **Last Checkpoint**: `Inception / Plan / [now ISO 8601]`
|
|
335
|
+
|
|
336
|
+
Append to Phase History:
|
|
337
|
+
```
|
|
338
|
+
| [now] | inception_complete | Inception Complete | Plan | [feature-name] |
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
**Tell the user**:
|
|
342
|
+
|
|
343
|
+
> "Inception complete for `[feature-name]`.
|
|
344
|
+
>
|
|
345
|
+
> - PRD: `docs/pdlc/prds/PRD_[feature-name]_[YYYY-MM-DD].md`
|
|
346
|
+
> - Design: `docs/pdlc/design/[feature-name]/`
|
|
347
|
+
> - Plan: `docs/pdlc/prds/plans/plan_[feature-name]_[YYYY-MM-DD].md`
|
|
348
|
+
> - Beads tasks created: [N]
|
|
349
|
+
>
|
|
350
|
+
> Run `/pdlc build` to begin Construction."
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## Rules
|
|
355
|
+
|
|
356
|
+
- Never generate a PRD, design doc, or plan without completing the Discover phase first.
|
|
357
|
+
- Never proceed past an approval gate without explicit human confirmation. "Looks good" counts as approval; "not yet" or silence does not.
|
|
358
|
+
- Do not create the feature branch during Inception — that happens at the start of Construction.
|
|
359
|
+
- If the user wants to change scope mid-Inception (after PRD is approved), update the PRD first and re-obtain approval before updating the design docs.
|
|
360
|
+
- The visual companion server runs only during Inception. It must be stopped before Inception ends.
|