@pcoliveira90/pdd 0.2.6 → 0.3.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.
@@ -1,320 +1,446 @@
1
- export const PDD_TEMPLATE_VERSION = '0.2.0';
2
-
3
- export const CORE_TEMPLATES = {
4
- '.pdd/constitution.md': `# PDD Constitution
5
-
6
- ## 1. Change First
7
- Every task is a change in an existing system.
8
-
9
- ## 2. Evidence Before Edit
10
- Never change code without understanding current behavior.
11
-
12
- ## 3. Minimal Safe Delta
13
- Prefer the smallest safe change.
14
-
15
- ## 4. Root Cause
16
- Fix the cause, not the symptom.
17
-
18
- ## 5. Regression Awareness
19
- Always consider what can break.
20
-
21
- ## 6. Reuse Patterns
22
- Prefer existing patterns over new ones.
23
-
24
- ## 7. Verifiable Outcome
25
- Every change must be validated.
26
- `,
27
- '.pdd/templates/delta-spec.md': `# Delta Spec
28
-
29
- ## Change ID
30
-
31
- ## Type
32
- bugfix | feature | refactor-safe | hotfix
33
-
34
- ## Context
35
-
36
- ## Current Behavior
37
-
38
- ## Expected Behavior
39
-
40
- ## Evidence
41
-
42
- ## Root Cause Hypothesis
43
-
44
- ## Impacted Areas
45
-
46
- ## Constraints
47
-
48
- ## Minimal Safe Delta
49
-
50
- ## Alternatives Considered
51
-
52
- ## Acceptance Criteria
53
-
54
- ## Verification Strategy
55
- `,
56
- '.pdd/templates/patch-plan.md': `# Patch Plan
57
-
58
- ## Files to Inspect
59
-
60
- ## Files to Change
61
-
62
- ## Execution Steps
63
- 1. Reproduce issue
64
- 2. Confirm root cause
65
- 3. Apply change
66
- 4. Adjust tests
67
- 5. Run validations
68
-
69
- ## Regression Risks
70
-
71
- ## Rollback Strategy
72
- `,
73
- '.pdd/templates/verification-report.md': `# Verification Report
74
-
75
- ## Reproduction
76
-
77
- ## Changes Made
78
-
79
- ## Tests Run
80
-
81
- ## Manual Validation
82
-
83
- ## Residual Risks
84
-
85
- ## Final Status
86
- approved | needs-review | partial
87
- `,
88
- '.pdd/commands/pdd-recon.md': `# pdd.recon
89
-
90
- ## Purpose
91
- Understand the current system before making changes.
92
-
93
- ## Output
94
- - flow mapping
95
- - impacted files
96
- - risks
97
- - unknowns
98
- `,
99
- '.pdd/commands/pdd-fix.md': `# pdd.fix
100
-
101
- ## Purpose
102
- Fix bugs with minimal safe delta.
103
-
104
- ## Steps
105
- 1. reproduce issue
106
- 2. confirm root cause
107
- 3. apply minimal fix
108
- 4. validate
109
- `,
110
- '.pdd/commands/pdd-feature.md': `# pdd.feature
111
-
112
- ## Purpose
113
- Add features safely in existing systems.
114
-
115
- ## Steps
116
- 1. understand current behavior
117
- 2. define minimal extension
118
- 3. ensure compatibility
119
- 4. validate
120
- `,
121
- '.pdd/commands/pdd-verify.md': `# pdd.verify
122
-
123
- ## Purpose
124
- Validate changes and ensure safety.
125
-
126
- ## Checklist
127
- - tests pass
128
- - no regression detected
129
- - expected behavior confirmed
130
- `,
131
- '.pdd/memory/system-map.md': `# System Map
132
-
133
- ## Purpose
134
- Map the structure of the system.
135
-
136
- ## Modules
137
- -
138
-
139
- ## Entry Points
140
- -
141
-
142
- ## Dependencies
143
- -
144
-
145
- ## Hotspots
146
- -
147
- `,
148
- '.pdd/version.json': JSON.stringify({ templateVersion: '0.2.0' }, null, 2) + '\n'
149
- };
150
-
151
- export const IDE_ADAPTERS = {
152
- claude: {
153
- '.claude/commands/pdd.md': `# /pdd
154
-
155
- ## Goal
156
- Execute Patch-Driven Development workflow.
157
-
158
- ## Usage
159
- /pdd fix <issue>
160
- `
161
- },
162
- cursor: {
163
- '.cursor/rules/pdd.mdc': `---
164
- description: PDD — Patch-Driven Development context for this repo (like Spec Kit project rules)
165
- alwaysApply: true
166
- ---
167
-
168
- # Patch-Driven Development
169
-
170
- This repo uses **PDD**: safe changes in existing systems. The agent should:
171
-
172
- - Read \`.pdd/constitution.md\` before substantive edits.
173
- - Prefer **minimal safe deltas**; avoid drive-by refactors.
174
- - Use templates under \`.pdd/templates/\` when producing specs or reports (\`delta-spec\`, \`patch-plan\`, \`verification-report\`).
175
- - Follow playbooks under \`.pdd/commands/\` when the user invokes a PDD slash command.
176
-
177
- Slash commands live in \`.cursor/commands/\` (type \`/\` in Chat/Agent). They mirror the PDD playbooks.
178
- `,
179
- '.cursor/commands/pdd.md': `---
180
- description: "PDD — main workflow (Patch-Driven Development)"
181
- argument-hint: "[issue or goal]"
182
- ---
183
-
184
- # PDD — main workflow
185
-
186
- You are running **Patch-Driven Development** in this repository.
187
-
188
- ## Ground rules
189
-
190
- - Obey \`.pdd/constitution.md\`.
191
- - Evidence before edits: locate behavior in code/tests before changing.
192
- - Smallest change that solves the problem; match local patterns.
193
-
194
- ## User request
195
-
196
- $ARGUMENTS
197
-
198
- (If empty, ask what issue or goal to work on.)
199
-
200
- ## What to do
201
-
202
- 1. Classify: bugfix vs feature vs exploration-only (**recon**).
203
- 2. Name impacted files and risks.
204
- 3. Propose a minimal plan, then implement or outline next steps.
205
- 4. Say how to verify (tests, manual steps).
206
-
207
- ## Output
208
-
209
- - Files touched or to touch
210
- - Risks and what you did not change on purpose
211
- `,
212
- '.cursor/commands/pdd-recon.md': `---
213
- description: "PDD — recon (explore before editing)"
214
- argument-hint: "[area or question]"
215
- ---
216
-
217
- # PDD recon
218
-
219
- **Exploration only** unless the user asks to edit.
220
-
221
- ## Goal
222
-
223
- Map the relevant part of the system before any change. Align with \`.pdd/commands/pdd-recon.md\`.
224
-
225
- ## User focus
226
-
227
- $ARGUMENTS
228
-
229
- ## Deliver
230
-
231
- - Short map: entry points, key modules, data flow if useful
232
- - List of files worth reading next
233
- - Risks and unknowns
234
- - No production edits unless the user explicitly asked to fix something
235
- `,
236
- '.cursor/commands/pdd-fix.md': `---
237
- description: "PDD fix (minimal bugfix)"
238
- argument-hint: "[bug description]"
239
- ---
240
-
241
- # PDD — fix
242
-
243
- Fix a **bug** with a minimal safe delta. Align with \`.pdd/commands/pdd-fix.md\`.
244
-
245
- ## Issue
246
-
247
- $ARGUMENTS
248
-
249
- ## Steps
250
-
251
- 1. Reproduce or infer current vs expected behavior (code/tests).
252
- 2. Confirm root cause (not only symptoms).
253
- 3. Apply the smallest fix; avoid scope creep.
254
- 4. State how to verify (tests or manual).
255
-
256
- ## Output
257
-
258
- - Root cause (brief)
259
- - Files changed
260
- - Verification steps
261
- `,
262
- '.cursor/commands/pdd-feature.md': `---
263
- description: "PDD feature (safe extension)"
264
- argument-hint: "[feature request]"
265
- ---
266
-
267
- # PDD — feature
268
-
269
- Add behavior **safely** in an existing system. Align with \`.pdd/commands/pdd-feature.md\`.
270
-
271
- ## Request
272
-
273
- $ARGUMENTS
274
-
275
- ## Steps
276
-
277
- 1. Understand current behavior and extension points.
278
- 2. Define the smallest extension (APIs, files).
279
- 3. Implement without breaking existing callers.
280
- 4. Verification and rollback idea.
281
-
282
- ## Output
283
-
284
- - Design note (what you extended and why)
285
- - Files changed
286
- - Tests or checks to run
287
- `,
288
- '.cursor/commands/pdd-verify.md': `---
289
- description: "PDD — verify (validation checklist)"
290
- argument-hint: "[scope or PR]"
291
- ---
292
-
293
- # PDD — verify
294
-
295
- Validate a change or the current state. Align with \`.pdd/commands/pdd-verify.md\`.
296
-
297
- ## Scope
298
-
299
- $ARGUMENTS
300
-
301
- ## Checklist
302
-
303
- - Tests run (which)
304
- - Regressions considered
305
- - Manual checks if needed
306
- - Residual risks
307
-
308
- ## Output
309
-
310
- - Pass/fail summary
311
- - What you would still verify before merge
312
- `
313
- },
314
- copilot: {
315
- '.github/copilot/pdd.prompt.md': `# PDD Copilot Prompt
316
-
317
- You are executing a Patch-Driven Development workflow.
318
- `
319
- }
320
- };
1
+ export const PDD_TEMPLATE_VERSION = '0.2.3';
2
+
3
+ export const CORE_TEMPLATES = {
4
+ '.pdd/constitution.md': `# PDD Constitution
5
+
6
+ ## 1. Change First
7
+ Every task is a change in an existing system.
8
+
9
+ ## 2. Evidence Before Edit
10
+ Never change code without understanding current behavior.
11
+
12
+ ## 3. Minimal Safe Delta
13
+ Prefer the smallest safe change.
14
+
15
+ ## 4. Root Cause
16
+ Fix the cause, not the symptom.
17
+
18
+ ## 5. Regression Awareness
19
+ Always consider what can break.
20
+
21
+ ## 6. Reuse Patterns
22
+ Prefer existing patterns over new ones.
23
+
24
+ ## 7. Verifiable Outcome
25
+ Every change must be validated.
26
+
27
+ ## 8. Worktree First
28
+ Always execute code changes from a linked git worktree, not from the primary worktree.
29
+ `,
30
+ '.pdd/templates/delta-spec.md': `# Delta Spec
31
+
32
+ ## Change ID
33
+
34
+ ## Type
35
+ bugfix | feature | refactor-safe | hotfix
36
+
37
+ ## Context
38
+
39
+ ## Current Behavior
40
+
41
+ ## Expected Behavior
42
+
43
+ ## Evidence
44
+
45
+ ## Root Cause Hypothesis
46
+
47
+ ## Impacted Areas
48
+
49
+ ## Constraints
50
+
51
+ ## Minimal Safe Delta
52
+
53
+ ## Alternatives Considered
54
+
55
+ ## Acceptance Criteria
56
+
57
+ ## Verification Strategy
58
+ `,
59
+ '.pdd/templates/patch-plan.md': `# Patch Plan
60
+
61
+ ## Files to Inspect
62
+
63
+ ## Files to Change
64
+
65
+ ## Execution Steps
66
+ 1. Reproduce issue
67
+ 2. Confirm root cause
68
+ 3. Apply change
69
+ 4. Adjust tests
70
+ 5. Run validations
71
+
72
+ ## Regression Risks
73
+
74
+ ## Rollback Strategy
75
+ `,
76
+ '.pdd/templates/verification-report.md': `# Verification Report
77
+
78
+ ## Reproduction
79
+
80
+ ## Changes Made
81
+
82
+ ## Tests Run
83
+
84
+ ## Manual Validation
85
+
86
+ ## Residual Risks
87
+
88
+ ## Final Status
89
+ approved | needs-review | partial
90
+ `,
91
+ '.pdd/commands/pdd-recon.md': `# pdd.recon
92
+
93
+ ## Purpose
94
+ Understand the current system before making changes.
95
+
96
+ ## Scope
97
+ Summary only. For operational guidance in Cursor, use \`.cursor/commands/pdd-recon.md\`.
98
+
99
+ ## Output
100
+ - flow mapping
101
+ - impacted files
102
+ - risks
103
+ - unknowns
104
+ `,
105
+ '.pdd/commands/pdd-fix.md': `# pdd.fix
106
+
107
+ ## Purpose
108
+ Fix bugs with minimal safe delta.
109
+
110
+ ## Scope
111
+ Summary only. For operational guidance in Cursor, use \`.cursor/commands/pdd-fix.md\`.
112
+
113
+ ## Steps
114
+ 1. reproduce issue
115
+ 2. confirm root cause
116
+ 3. apply minimal fix
117
+ 4. validate
118
+ `,
119
+ '.pdd/commands/pdd-feature.md': `# pdd.feature
120
+
121
+ ## Purpose
122
+ Add features safely in existing systems.
123
+
124
+ ## Scope
125
+ Summary only. For operational guidance in Cursor, use \`.cursor/commands/pdd-feature.md\`.
126
+
127
+ ## Steps
128
+ 1. understand current behavior
129
+ 2. define minimal extension
130
+ 3. ensure compatibility
131
+ 4. validate
132
+ `,
133
+ '.pdd/commands/pdd-verify.md': `# pdd.verify
134
+
135
+ ## Purpose
136
+ Validate changes and ensure safety.
137
+
138
+ ## Scope
139
+ Summary only. For operational guidance in Cursor, use \`.cursor/commands/pdd-verify.md\`.
140
+
141
+ ## Checklist
142
+ - tests pass
143
+ - no regression detected
144
+ - expected behavior confirmed
145
+ `,
146
+ '.pdd/commands/README.md': `# PDD Commands (Summary)
147
+
148
+ Files in this directory are concise summaries of each workflow command.
149
+
150
+ When using Cursor, the operational source of truth is:
151
+ - \`.cursor/commands/pdd.md\`
152
+ - \`.cursor/commands/pdd-recon.md\`
153
+ - \`.cursor/commands/pdd-fix.md\`
154
+ - \`.cursor/commands/pdd-feature.md\`
155
+ - \`.cursor/commands/pdd-verify.md\`
156
+ `,
157
+ '.pdd/memory/system-map.md': `# System Map
158
+
159
+ ## Purpose
160
+ Map the structure of the system.
161
+
162
+ ## Modules
163
+ -
164
+
165
+ ## Entry Points
166
+ -
167
+
168
+ ## Dependencies
169
+ -
170
+
171
+ ## Hotspots
172
+ -
173
+ `,
174
+ '.pdd/version.json': JSON.stringify({ templateVersion: '0.2.3' }, null, 2) + '\n'
175
+ };
176
+
177
+ export const IDE_ADAPTERS = {
178
+ claude: {
179
+ '.claude/CLAUDE.md': `# PDD for Claude Code
180
+
181
+ This repository uses Patch-Driven Development (PDD).
182
+
183
+ Operational command guidance lives in:
184
+ - .claude/commands/pdd.md
185
+ - .claude/commands/pdd-recon.md
186
+ - .claude/commands/pdd-fix.md
187
+ - .claude/commands/pdd-feature.md
188
+ - .claude/commands/pdd-verify.md
189
+ `,
190
+ '.claude/commands/pdd.md': `# /pdd
191
+
192
+ ## Goal
193
+ Execute Patch-Driven Development workflow.
194
+
195
+ ## Usage
196
+ /pdd <issue-or-goal>
197
+ `,
198
+ '.claude/commands/pdd-recon.md': `# /pdd-recon
199
+
200
+ ## Goal
201
+ Explore the system before editing.
202
+
203
+ ## Deliver
204
+ - concise context map
205
+ - key files
206
+ - risks/unknowns
207
+ `,
208
+ '.claude/commands/pdd-fix.md': `# /pdd-fix
209
+
210
+ ## Goal
211
+ Fix bug with minimal safe delta.
212
+
213
+ ## Required flow
214
+ 1. map current vs expected behavior
215
+ 2. identify root cause
216
+ 3. present concise editable proposal
217
+ 4. ask explicit user approval
218
+ 5. implement and validate
219
+ `,
220
+ '.claude/commands/pdd-feature.md': `# /pdd-feature
221
+
222
+ ## Goal
223
+ Add feature safely in existing system.
224
+
225
+ ## Required flow
226
+ 1. map context and business rules
227
+ 2. present concise editable proposal
228
+ 3. ask explicit user approval
229
+ 4. implement and validate
230
+ `,
231
+ '.claude/commands/pdd-verify.md': `# /pdd-verify
232
+
233
+ ## Goal
234
+ Verify changes and residual risks.
235
+
236
+ ## Checklist
237
+ - tests and coverage
238
+ - regression risks
239
+ - business rule validation
240
+ - usability/security validation
241
+ `
242
+ },
243
+ cursor: {
244
+ '.cursor/rules/pdd.mdc': `---
245
+ description: PDD — Patch-Driven Development context for this repo (like Spec Kit project rules)
246
+ alwaysApply: true
247
+ ---
248
+
249
+ # Patch-Driven Development
250
+
251
+ This repo uses **PDD**: safe changes in existing systems. The agent should:
252
+
253
+ - Read \`.pdd/constitution.md\` before substantive edits.
254
+ - Prefer **minimal safe deltas**; avoid drive-by refactors.
255
+ - Use templates under \`.pdd/templates/\` when producing specs or reports (\`delta-spec\`, \`patch-plan\`, \`verification-report\`).
256
+ - Follow playbooks under \`.pdd/commands/\` when the user invokes a PDD slash command.
257
+ - Use linked git worktrees for all mutating work. Avoid editing from the primary worktree.
258
+
259
+ Slash commands live in \`.cursor/commands/\` (type \`/\` in Chat/Agent). They are the primary operational guidance for Cursor.
260
+ `,
261
+ '.cursor/commands/pdd.md': `---
262
+ description: "PDD — main workflow (Patch-Driven Development)"
263
+ argument-hint: "[issue or goal]"
264
+ ---
265
+
266
+ # PDD — main workflow
267
+
268
+ You are running **Patch-Driven Development** in this repository.
269
+
270
+ ## Ground rules
271
+
272
+ - Obey \`.pdd/constitution.md\`.
273
+ - Evidence before edits: locate behavior in code/tests before changing.
274
+ - Smallest change that solves the problem; match local patterns.
275
+
276
+ ## User request
277
+
278
+ $ARGUMENTS
279
+
280
+ (If empty, ask what issue or goal to work on.)
281
+
282
+ ## What to do
283
+
284
+ 1. Classify: bugfix vs feature vs exploration-only (**recon**).
285
+ 2. Name impacted files and risks.
286
+ 3. Propose a minimal plan, then implement or outline next steps.
287
+ 4. Say how to verify (tests, manual steps).
288
+
289
+ ## Output
290
+
291
+ - Files touched or to touch
292
+ - Risks and what you did not change on purpose
293
+ `,
294
+ '.cursor/commands/pdd-recon.md': `---
295
+ description: "PDD recon (explore before editing)"
296
+ argument-hint: "[area or question]"
297
+ ---
298
+
299
+ # PDD — recon
300
+
301
+ **Exploration only** unless the user asks to edit.
302
+
303
+ ## Goal
304
+
305
+ Map the relevant part of the system before any change. Align with \`.pdd/commands/pdd-recon.md\`.
306
+
307
+ ## User focus
308
+
309
+ $ARGUMENTS
310
+
311
+ ## Deliver
312
+
313
+ - Short map: entry points, key modules, data flow if useful
314
+ - List of files worth reading next
315
+ - Risks and unknowns
316
+ - No production edits unless the user explicitly asked to fix something
317
+ `,
318
+ '.cursor/commands/pdd-fix.md': `---
319
+ description: "PDD — fix (minimal bugfix)"
320
+ argument-hint: "[bug description]"
321
+ ---
322
+
323
+ # PDD — fix
324
+
325
+ Fix a **bug** with a minimal safe delta. Align with \`.pdd/commands/pdd-fix.md\`.
326
+
327
+ ## Issue
328
+
329
+ $ARGUMENTS
330
+
331
+ ## Steps
332
+
333
+ 1. Reproduce or infer current vs expected behavior (code/tests).
334
+ 2. Confirm root cause (not only symptoms).
335
+ 3. Apply the smallest fix; avoid scope creep.
336
+ 4. State how to verify (tests or manual).
337
+
338
+ ## Output
339
+
340
+ - Root cause (brief)
341
+ - Files changed
342
+ - Verification steps
343
+ `,
344
+ '.cursor/commands/pdd-feature.md': `---
345
+ description: "PDD — feature (safe extension)"
346
+ argument-hint: "[feature request]"
347
+ ---
348
+
349
+ # PDD — feature
350
+
351
+ Add behavior **safely** in an existing system. Align with \`.pdd/commands/pdd-feature.md\`.
352
+
353
+ ## Request
354
+
355
+ $ARGUMENTS
356
+
357
+ ## Steps
358
+
359
+ 1. Understand current behavior and extension points.
360
+ 2. Define the smallest extension (APIs, files).
361
+ 3. Implement without breaking existing callers.
362
+ 4. Verification and rollback idea.
363
+
364
+ ## Output
365
+
366
+ - Design note (what you extended and why)
367
+ - Files changed
368
+ - Tests or checks to run
369
+ `,
370
+ '.cursor/commands/pdd-verify.md': `---
371
+ description: "PDD — verify (validation checklist)"
372
+ argument-hint: "[scope or PR]"
373
+ ---
374
+
375
+ # PDD — verify
376
+
377
+ Validate a change or the current state. Align with \`.pdd/commands/pdd-verify.md\`.
378
+
379
+ ## Scope
380
+
381
+ $ARGUMENTS
382
+
383
+ ## Checklist
384
+
385
+ - Tests run (which)
386
+ - Regressions considered
387
+ - Manual checks if needed
388
+ - Residual risks
389
+
390
+ ## Output
391
+
392
+ - Pass/fail summary
393
+ - What you would still verify before merge
394
+ `
395
+ },
396
+ copilot: {
397
+ '.github/copilot-instructions.md': `# PDD Instructions for GitHub Copilot
398
+
399
+ Use Patch-Driven Development (PDD) in this repository.
400
+
401
+ Before edits:
402
+ - map context and business rules
403
+ - map risks and unknowns
404
+ - propose concise plan and ask for user approval
405
+
406
+ After edits:
407
+ - validate tests/coverage
408
+ - report residual risks
409
+ `,
410
+ '.github/copilot/pdd.prompt.md': `# PDD Copilot Prompt
411
+
412
+ You are executing a Patch-Driven Development workflow.
413
+ `,
414
+ '.github/prompts/pdd-recon.prompt.md': `# PDD Recon Prompt
415
+
416
+ Map the relevant system area before editing:
417
+ - context
418
+ - key files
419
+ - risks
420
+ - unknowns
421
+ `,
422
+ '.github/prompts/pdd-fix.prompt.md': `# PDD Fix Prompt
423
+
424
+ Fix with minimal safe delta:
425
+ 1. identify root cause
426
+ 2. propose concise editable plan
427
+ 3. ask for user approval
428
+ 4. implement and validate
429
+ `,
430
+ '.github/prompts/pdd-feature.prompt.md': `# PDD Feature Prompt
431
+
432
+ Implement feature safely:
433
+ 1. map context/business rules
434
+ 2. propose concise editable plan
435
+ 3. ask for user approval
436
+ 4. implement and validate
437
+ `,
438
+ '.github/prompts/pdd-verify.prompt.md': `# PDD Verify Prompt
439
+
440
+ Validate:
441
+ - tests and coverage
442
+ - regression and structural risks
443
+ - business rule/usability/security checks
444
+ `
445
+ }
446
+ };