aped-method 1.0.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/bin/aped-method.js +8 -0
- package/package.json +31 -0
- package/src/index.js +348 -0
- package/src/scaffold.js +21 -0
- package/src/templates/commands.js +65 -0
- package/src/templates/config.js +230 -0
- package/src/templates/data/domain-complexity.csv +15 -0
- package/src/templates/data/project-types.csv +11 -0
- package/src/templates/guardrail.js +171 -0
- package/src/templates/index.js +17 -0
- package/src/templates/references.js +549 -0
- package/src/templates/scripts.js +345 -0
- package/src/templates/skills.js +412 -0
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
export function skills(c) {
|
|
2
|
+
const a = c.apedDir; // .aped (engine: skills, config, templates)
|
|
3
|
+
const o = c.outputDir; // docs/aped (output: generated artifacts)
|
|
4
|
+
return [
|
|
5
|
+
// ── aped-a ──────────────────────────────────────────────
|
|
6
|
+
{
|
|
7
|
+
path: `${a}/aped-a/SKILL.md`,
|
|
8
|
+
content: `---
|
|
9
|
+
name: aped-a
|
|
10
|
+
description: 'Analyze project idea through parallel market, domain, and technical research. Use when user says "analyze project", "research idea", "aped analyze", or invokes /aped-a.'
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# APED Analyze — Parallel Research to Product Brief
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
1. Read \`${a}/config.yaml\` — extract \`user_name\`, \`communication_language\`
|
|
18
|
+
2. Read \`${a}/state.yaml\` — check \`pipeline.phases.analyze\`
|
|
19
|
+
- If status is \`done\`: ask user — redo analysis or skip to next phase?
|
|
20
|
+
- If user skips: invoke Skill tool with \`skill: "aped-p"\` and stop
|
|
21
|
+
|
|
22
|
+
## Discovery (2-3 questions max)
|
|
23
|
+
|
|
24
|
+
Ask the user these questions (adapt to \`communication_language\`):
|
|
25
|
+
|
|
26
|
+
1. **What are we building?** — Core idea, the product/service in one paragraph
|
|
27
|
+
2. **For whom?** — Target users, their pain points, current alternatives
|
|
28
|
+
3. **Why now?** — Market timing, technology enabler, competitive gap
|
|
29
|
+
|
|
30
|
+
Wait for answers before proceeding.
|
|
31
|
+
|
|
32
|
+
## Parallel Research
|
|
33
|
+
|
|
34
|
+
Read \`${a}/aped-a/references/research-prompts.md\` for detailed agent prompts.
|
|
35
|
+
|
|
36
|
+
Launch **3 Agent tool calls in parallel** with \`run_in_background: true\`:
|
|
37
|
+
|
|
38
|
+
### Agent 1: Market Research
|
|
39
|
+
- Customer behavior and pain points in the target segment
|
|
40
|
+
- Competitive landscape: direct and indirect competitors
|
|
41
|
+
- Market size and growth trajectory
|
|
42
|
+
- Pricing models in the space
|
|
43
|
+
- Use WebSearch for current data
|
|
44
|
+
|
|
45
|
+
### Agent 2: Domain Research
|
|
46
|
+
- Industry analysis and key trends
|
|
47
|
+
- Regulatory requirements and compliance needs
|
|
48
|
+
- Technical trends shaping the domain
|
|
49
|
+
- Standards and certifications required
|
|
50
|
+
- Use WebSearch for current data
|
|
51
|
+
|
|
52
|
+
### Agent 3: Technical Research
|
|
53
|
+
- Technology stack overview and options
|
|
54
|
+
- Integration patterns and APIs available
|
|
55
|
+
- Architecture patterns for similar products
|
|
56
|
+
- Open-source tools and frameworks relevant
|
|
57
|
+
- Use WebSearch for current data
|
|
58
|
+
|
|
59
|
+
## Synthesis
|
|
60
|
+
|
|
61
|
+
Ensure output directory exists:
|
|
62
|
+
\`\`\`bash
|
|
63
|
+
mkdir -p ${o}
|
|
64
|
+
\`\`\`
|
|
65
|
+
|
|
66
|
+
Once all 3 agents complete:
|
|
67
|
+
|
|
68
|
+
1. Fuse research results into a product brief
|
|
69
|
+
2. Use template from \`${a}/templates/product-brief.md\`
|
|
70
|
+
3. Fill all 5 sections: Executive Summary, Core Vision, Target Users, Success Metrics, MVP Scope
|
|
71
|
+
4. Write output to \`${o}/product-brief.md\`
|
|
72
|
+
|
|
73
|
+
## Validation
|
|
74
|
+
|
|
75
|
+
\`\`\`bash
|
|
76
|
+
bash ${a}/aped-a/scripts/validate-brief.sh ${o}/product-brief.md
|
|
77
|
+
\`\`\`
|
|
78
|
+
|
|
79
|
+
If validation fails: fix missing sections and re-validate.
|
|
80
|
+
|
|
81
|
+
## State Update
|
|
82
|
+
|
|
83
|
+
Update \`${a}/state.yaml\`:
|
|
84
|
+
\`\`\`yaml
|
|
85
|
+
pipeline:
|
|
86
|
+
current_phase: "analyze"
|
|
87
|
+
phases:
|
|
88
|
+
analyze:
|
|
89
|
+
status: "done"
|
|
90
|
+
output: "${o}/product-brief.md"
|
|
91
|
+
\`\`\`
|
|
92
|
+
|
|
93
|
+
## Chain
|
|
94
|
+
|
|
95
|
+
Invoke Skill tool with \`skill: "aped-p"\` to proceed to PRD phase.
|
|
96
|
+
`,
|
|
97
|
+
},
|
|
98
|
+
// ── aped-p ──────────────────────────────────────────────
|
|
99
|
+
{
|
|
100
|
+
path: `${a}/aped-p/SKILL.md`,
|
|
101
|
+
content: `---
|
|
102
|
+
name: aped-p
|
|
103
|
+
description: 'Generate PRD autonomously from product brief. Use when user says "create PRD", "generate PRD", "aped prd", or invokes /aped-p.'
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
# APED PRD — Autonomous PRD Generation
|
|
107
|
+
|
|
108
|
+
## Setup
|
|
109
|
+
|
|
110
|
+
1. Read \`${a}/config.yaml\` — extract \`user_name\`, \`communication_language\`, \`document_output_language\`
|
|
111
|
+
2. Read \`${a}/state.yaml\` — check pipeline state
|
|
112
|
+
- If \`pipeline.phases.prd.status\` is \`done\`: ask user — redo PRD or skip?
|
|
113
|
+
- If user skips: invoke Skill tool with \`skill: "aped-e"\` and stop
|
|
114
|
+
|
|
115
|
+
## Load Product Brief
|
|
116
|
+
|
|
117
|
+
- Read brief from path in \`pipeline.phases.analyze.output\`
|
|
118
|
+
- If no analyze phase in state: ask user for product brief path or content
|
|
119
|
+
|
|
120
|
+
## Domain & Project Type Detection
|
|
121
|
+
|
|
122
|
+
1. Read \`${a}/aped-p/references/domain-complexity.csv\`
|
|
123
|
+
- Match brief content against \`signals\` column
|
|
124
|
+
- If match found: note \`complexity\`, \`key_concerns\`, \`special_sections\`
|
|
125
|
+
- High-complexity domains (healthcare, fintech, govtech, etc.) — mandatory Domain Requirements section
|
|
126
|
+
2. Read \`${a}/aped-p/references/project-types.csv\`
|
|
127
|
+
- Match against \`detection_signals\`
|
|
128
|
+
- Note \`required_sections\`, \`skip_sections\`, \`key_questions\`
|
|
129
|
+
|
|
130
|
+
## PRD Generation (4 compressed phases)
|
|
131
|
+
|
|
132
|
+
Generate the PRD autonomously using \`${a}/templates/prd.md\` as structure.
|
|
133
|
+
|
|
134
|
+
### P1: Foundation
|
|
135
|
+
- Executive Summary from brief's Core Vision
|
|
136
|
+
- Product vision and purpose statement
|
|
137
|
+
|
|
138
|
+
### P2: Scope & Journeys
|
|
139
|
+
- Success Criteria: User/Business/Technical/Measurable Outcomes
|
|
140
|
+
- Product Scope: MVP — Growth — Vision phases
|
|
141
|
+
- User Journeys: key end-to-end workflows
|
|
142
|
+
|
|
143
|
+
### P3: Domain Requirements (conditional)
|
|
144
|
+
- Only if domain-complexity detection flagged medium/high
|
|
145
|
+
- Include mandatory compliance, regulations, certifications from \`key_concerns\`
|
|
146
|
+
- Skip this section entirely for low-complexity/general domains
|
|
147
|
+
|
|
148
|
+
### P4: Requirements
|
|
149
|
+
- Functional Requirements (target 10-80 FRs)
|
|
150
|
+
- Format: \`FR#: [Actor] can [capability] [context/constraint]\`
|
|
151
|
+
- Group by capability area
|
|
152
|
+
- Read \`${a}/aped-p/references/fr-rules.md\` — validate quality
|
|
153
|
+
- Non-Functional Requirements (relevant categories only)
|
|
154
|
+
- Format: \`The system shall [metric] [condition] [measurement method]\`
|
|
155
|
+
|
|
156
|
+
## Validation
|
|
157
|
+
|
|
158
|
+
\`\`\`bash
|
|
159
|
+
bash ${a}/aped-p/scripts/validate-prd.sh ${o}/prd.md
|
|
160
|
+
\`\`\`
|
|
161
|
+
|
|
162
|
+
## Output & State
|
|
163
|
+
|
|
164
|
+
1. Write PRD to \`${o}/prd.md\`
|
|
165
|
+
2. Update \`${a}/state.yaml\`:
|
|
166
|
+
\`\`\`yaml
|
|
167
|
+
pipeline:
|
|
168
|
+
current_phase: "prd"
|
|
169
|
+
phases:
|
|
170
|
+
prd:
|
|
171
|
+
status: "done"
|
|
172
|
+
output: "${o}/prd.md"
|
|
173
|
+
\`\`\`
|
|
174
|
+
|
|
175
|
+
## Chain
|
|
176
|
+
|
|
177
|
+
Invoke Skill tool with \`skill: "aped-e"\` to proceed to Epics phase.
|
|
178
|
+
`,
|
|
179
|
+
},
|
|
180
|
+
// ── aped-e ──────────────────────────────────────────────
|
|
181
|
+
{
|
|
182
|
+
path: `${a}/aped-e/SKILL.md`,
|
|
183
|
+
content: `---
|
|
184
|
+
name: aped-e
|
|
185
|
+
description: 'Create epics and stories from PRD with full FR coverage. Use when user says "create epics", "break into stories", "aped epics", or invokes /aped-e.'
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
# APED Epics & Stories — Requirements Decomposition
|
|
189
|
+
|
|
190
|
+
## Setup
|
|
191
|
+
|
|
192
|
+
1. Read \`${a}/config.yaml\` — extract config
|
|
193
|
+
2. Read \`${a}/state.yaml\` — check pipeline state
|
|
194
|
+
- If \`pipeline.phases.epics.status\` is \`done\`: ask user — redo or skip?
|
|
195
|
+
- If user skips: invoke Skill tool with \`skill: "aped-d"\` and stop
|
|
196
|
+
|
|
197
|
+
## Load PRD
|
|
198
|
+
|
|
199
|
+
- Read PRD from path in \`pipeline.phases.prd.output\`
|
|
200
|
+
- If no prd phase in state: ask user for PRD path
|
|
201
|
+
- Extract ALL FRs and NFRs by number
|
|
202
|
+
|
|
203
|
+
## Epic Design
|
|
204
|
+
|
|
205
|
+
Read \`${a}/aped-e/references/epic-rules.md\` for design principles.
|
|
206
|
+
|
|
207
|
+
### Core Rules
|
|
208
|
+
|
|
209
|
+
1. **User value first** — each epic delivers COMPLETE functionality for its domain
|
|
210
|
+
2. **Independent epics** — each stands alone, no forward dependencies
|
|
211
|
+
3. **User-outcome naming** — epic names describe what users can do
|
|
212
|
+
4. **Starter template rule** — if project needs scaffolding, Epic 1 Story 1 = project setup
|
|
213
|
+
|
|
214
|
+
### Story Slug Convention
|
|
215
|
+
|
|
216
|
+
Story keys: \`{epic#}-{story#}-{slug}\` — slug from title, lowercase, hyphens, max 30 chars.
|
|
217
|
+
Story files: \`${o}/stories/{story-key}.md\`
|
|
218
|
+
|
|
219
|
+
### Story Design
|
|
220
|
+
|
|
221
|
+
- Format: **As a** [role], **I want** [capability], **so that** [benefit]
|
|
222
|
+
- Each story completable in 1 dev session
|
|
223
|
+
- No forward dependencies within an epic
|
|
224
|
+
- DB tables created ONLY when the story needs them
|
|
225
|
+
- ACs in **Given/When/Then** format
|
|
226
|
+
- Tasks as checkboxes: \`- [ ] task [AC: AC#]\`
|
|
227
|
+
|
|
228
|
+
## FR Coverage Map
|
|
229
|
+
|
|
230
|
+
Every FR from PRD mapped to exactly one epic. No orphans, no phantoms.
|
|
231
|
+
|
|
232
|
+
## Validation
|
|
233
|
+
|
|
234
|
+
\`\`\`bash
|
|
235
|
+
bash ${a}/aped-e/scripts/validate-coverage.sh ${o}/epics.md ${o}/prd.md
|
|
236
|
+
\`\`\`
|
|
237
|
+
|
|
238
|
+
## Output
|
|
239
|
+
|
|
240
|
+
\`\`\`bash
|
|
241
|
+
mkdir -p ${o}/stories
|
|
242
|
+
\`\`\`
|
|
243
|
+
|
|
244
|
+
1. Write epics to \`${o}/epics.md\`
|
|
245
|
+
2. Create story files in \`${o}/stories/\` using \`${a}/templates/story.md\`
|
|
246
|
+
3. Update \`${a}/state.yaml\` with sprint section and pipeline phase
|
|
247
|
+
|
|
248
|
+
## Chain
|
|
249
|
+
|
|
250
|
+
Invoke Skill tool with \`skill: "aped-d"\` to proceed to Dev Sprint.
|
|
251
|
+
`,
|
|
252
|
+
},
|
|
253
|
+
// ── aped-d ──────────────────────────────────────────────
|
|
254
|
+
{
|
|
255
|
+
path: `${a}/aped-d/SKILL.md`,
|
|
256
|
+
content: `---
|
|
257
|
+
name: aped-d
|
|
258
|
+
description: 'Dev sprint - implement next story with TDD red-green-refactor. Use when user says "start dev", "implement story", "aped dev", or invokes /aped-d.'
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
# APED Dev Sprint — TDD Story Implementation
|
|
262
|
+
|
|
263
|
+
## Setup
|
|
264
|
+
|
|
265
|
+
1. Read \`${a}/config.yaml\` — extract config
|
|
266
|
+
2. Read \`${a}/state.yaml\` — find next story
|
|
267
|
+
|
|
268
|
+
## Story Selection
|
|
269
|
+
|
|
270
|
+
Scan \`sprint.stories\` top-to-bottom for first \`ready-for-dev\` story.
|
|
271
|
+
- If none found: report "All stories implemented or in review" and stop
|
|
272
|
+
- Read story file from \`${o}/stories/{story-key}.md\`
|
|
273
|
+
- Story key format: \`{epic#}-{story#}-{slug}\`
|
|
274
|
+
|
|
275
|
+
## Review Continuation Check
|
|
276
|
+
|
|
277
|
+
If story has \`[AI-Review]\` items: address them BEFORE regular tasks.
|
|
278
|
+
|
|
279
|
+
## State Update (start)
|
|
280
|
+
|
|
281
|
+
Update \`${a}/state.yaml\`: story — \`in-progress\`, epic — \`in-progress\` if first story.
|
|
282
|
+
|
|
283
|
+
## Context Gathering
|
|
284
|
+
|
|
285
|
+
- Read story Dev Notes for architecture, file paths, dependencies
|
|
286
|
+
- Use MCP context7 for library docs mentioned in Dev Notes
|
|
287
|
+
- Read existing code files mentioned in story
|
|
288
|
+
|
|
289
|
+
## TDD Implementation
|
|
290
|
+
|
|
291
|
+
Read \`${a}/aped-d/references/tdd-engine.md\` for detailed rules.
|
|
292
|
+
|
|
293
|
+
For each task:
|
|
294
|
+
|
|
295
|
+
### RED
|
|
296
|
+
Write failing tests first. Run: \`bash ${a}/aped-d/scripts/run-tests.sh\`
|
|
297
|
+
|
|
298
|
+
### GREEN
|
|
299
|
+
Write minimal code to pass. Run: \`bash ${a}/aped-d/scripts/run-tests.sh\`
|
|
300
|
+
|
|
301
|
+
### REFACTOR
|
|
302
|
+
Improve structure while green. Run tests again.
|
|
303
|
+
|
|
304
|
+
### GATE
|
|
305
|
+
Mark \`[x]\` ONLY when: tests exist, pass 100%, implementation matches, ACs satisfied, no regressions.
|
|
306
|
+
|
|
307
|
+
## HALT Conditions
|
|
308
|
+
|
|
309
|
+
**STOP and ask user if:** new dependency, 3 consecutive failures, missing config, ambiguity.
|
|
310
|
+
|
|
311
|
+
## Completion
|
|
312
|
+
|
|
313
|
+
1. Update story: mark tasks \`[x]\`, fill Dev Agent Record
|
|
314
|
+
2. Update \`${a}/state.yaml\`: story — \`review\`
|
|
315
|
+
3. Chain to \`/aped-r\`
|
|
316
|
+
`,
|
|
317
|
+
},
|
|
318
|
+
// ── aped-r ──────────────────────────────────────────────
|
|
319
|
+
{
|
|
320
|
+
path: `${a}/aped-r/SKILL.md`,
|
|
321
|
+
content: `---
|
|
322
|
+
name: aped-r
|
|
323
|
+
description: 'Adversarial code review for completed stories. Use when user says "review code", "run review", "aped review", or invokes /aped-r.'
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
# APED Review — Adversarial Code Review
|
|
327
|
+
|
|
328
|
+
## Setup
|
|
329
|
+
|
|
330
|
+
1. Read \`${a}/config.yaml\` — extract config
|
|
331
|
+
2. Read \`${a}/state.yaml\` — find first story with status \`review\`
|
|
332
|
+
- If none: report "No stories pending review" and stop
|
|
333
|
+
|
|
334
|
+
## Load Story
|
|
335
|
+
|
|
336
|
+
Read story from \`${o}/stories/{story-key}.md\`
|
|
337
|
+
|
|
338
|
+
## Git Audit
|
|
339
|
+
|
|
340
|
+
\`\`\`bash
|
|
341
|
+
bash ${a}/aped-r/scripts/git-audit.sh ${o}/stories/{story-key}.md
|
|
342
|
+
\`\`\`
|
|
343
|
+
|
|
344
|
+
## Adversarial Review
|
|
345
|
+
|
|
346
|
+
Read \`${a}/aped-r/references/review-criteria.md\` for detailed criteria.
|
|
347
|
+
|
|
348
|
+
### 1. AC Validation
|
|
349
|
+
For each AC: search code for evidence (file:line). Rate: IMPLEMENTED / PARTIAL / MISSING.
|
|
350
|
+
|
|
351
|
+
### 2. Task Audit
|
|
352
|
+
For each \`[x]\` task: find proof in code. No evidence = **CRITICAL**.
|
|
353
|
+
|
|
354
|
+
### 3. Code Quality
|
|
355
|
+
Security, Performance, Reliability, Test Quality.
|
|
356
|
+
|
|
357
|
+
### 4. Minimum 3 findings enforced.
|
|
358
|
+
|
|
359
|
+
## Report
|
|
360
|
+
|
|
361
|
+
Severity: CRITICAL > HIGH > MEDIUM > LOW. Format: \`[Severity] Description [file:line]\`
|
|
362
|
+
|
|
363
|
+
## Decision
|
|
364
|
+
|
|
365
|
+
- MEDIUM/LOW only: fix automatically, story — \`done\`
|
|
366
|
+
- HIGH+: fix or add \`[AI-Review]\` items, story — \`in-progress\`
|
|
367
|
+
|
|
368
|
+
## State Update
|
|
369
|
+
|
|
370
|
+
Update \`${a}/state.yaml\`. If more stories — chain to \`/aped-d\`. If all done — report completion.
|
|
371
|
+
`,
|
|
372
|
+
},
|
|
373
|
+
// ── aped-all ─────────────────────────────────────────────
|
|
374
|
+
{
|
|
375
|
+
path: `${a}/aped-all/SKILL.md`,
|
|
376
|
+
content: `---
|
|
377
|
+
name: aped-all
|
|
378
|
+
description: 'Run full APED pipeline from Analyze through Review. Use when user says "run full pipeline", "aped all", "start from scratch", or invokes /aped-all.'
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
# APED Pipeline — Full Orchestrator
|
|
382
|
+
|
|
383
|
+
## Resume Logic
|
|
384
|
+
|
|
385
|
+
1. Read \`${a}/state.yaml\`
|
|
386
|
+
2. Determine resume point:
|
|
387
|
+
|
|
388
|
+
| State | Action |
|
|
389
|
+
|-------|--------|
|
|
390
|
+
| No state / \`current_phase: "none"\` | Start from \`/aped-a\` |
|
|
391
|
+
| Any phase \`in-progress\` | Re-invoke that phase (ask user: resume or restart?) |
|
|
392
|
+
| analyze \`done\`, prd missing | Invoke \`/aped-p\` |
|
|
393
|
+
| prd \`done\`, epics missing | Invoke \`/aped-e\` |
|
|
394
|
+
| epics \`done\` | Loop: \`/aped-d\` — \`/aped-r\` until all stories \`done\` |
|
|
395
|
+
| All stories \`done\` | Report pipeline complete |
|
|
396
|
+
|
|
397
|
+
## Execution
|
|
398
|
+
|
|
399
|
+
Use the Skill tool to invoke each phase: aped-a, aped-p, aped-e, aped-d, aped-r.
|
|
400
|
+
Each phase updates \`${a}/state.yaml\` and chains automatically.
|
|
401
|
+
|
|
402
|
+
## Interruption Handling
|
|
403
|
+
|
|
404
|
+
State persists in \`${a}/state.yaml\`. Next \`/aped-all\` resumes from last incomplete phase.
|
|
405
|
+
|
|
406
|
+
## Completion Report
|
|
407
|
+
|
|
408
|
+
Total phases, epics, stories, review iterations. Pipeline status: COMPLETE.
|
|
409
|
+
`,
|
|
410
|
+
},
|
|
411
|
+
];
|
|
412
|
+
}
|