@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.
- package/LICENSE +20 -20
- package/README.en.md +60 -60
- package/README.md +27 -26
- package/README.pt-BR.md +12 -12
- package/bin/pdd-ai.js +23 -23
- package/bin/pdd-pro.js +7 -7
- package/bin/pdd.js +27 -27
- package/package.json +43 -42
- package/src/ai/analyze-change.js +41 -41
- package/src/ai/engine.js +34 -34
- package/src/ai/run-fix-analysis.js +174 -174
- package/src/cli/doctor-command.js +123 -101
- package/src/cli/doctor-fix.js +51 -51
- package/src/cli/index.js +164 -130
- package/src/cli/init-command.js +270 -270
- package/src/cli/status-command.js +33 -33
- package/src/core/fix-runner.js +135 -135
- package/src/core/ide-detector.js +94 -94
- package/src/core/patch-generator.js +126 -126
- package/src/core/pr-manager.js +21 -21
- package/src/core/project-review-agent.js +301 -301
- package/src/core/remediation-advisor.js +91 -91
- package/src/core/state-manager.js +71 -71
- package/src/core/template-registry.js +446 -320
- package/src/core/template-upgrade.js +68 -68
- package/src/core/validator.js +38 -38
- package/src/core/worktree-guard.js +54 -0
|
@@ -1,320 +1,446 @@
|
|
|
1
|
-
export const PDD_TEMPLATE_VERSION = '0.2.
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
##
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
##
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
'.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
##
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
##
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
##
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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
|
+
};
|