@eddacraft/anvil-aps 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.
Files changed (121) hide show
  1. package/AGENTS.md +155 -0
  2. package/LICENSE +14 -0
  3. package/README.md +57 -0
  4. package/TODO.md +40 -0
  5. package/dist/filter/context-bundle.d.ts +81 -0
  6. package/dist/filter/context-bundle.d.ts.map +1 -0
  7. package/dist/filter/context-bundle.js +230 -0
  8. package/dist/filter/index.d.ts +85 -0
  9. package/dist/filter/index.d.ts.map +1 -0
  10. package/dist/filter/index.js +169 -0
  11. package/dist/index.d.ts +16 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +15 -0
  14. package/dist/loader/index.d.ts +80 -0
  15. package/dist/loader/index.d.ts.map +1 -0
  16. package/dist/loader/index.js +253 -0
  17. package/dist/parser/index.d.ts +24 -0
  18. package/dist/parser/index.d.ts.map +1 -0
  19. package/dist/parser/index.js +22 -0
  20. package/dist/parser/parse-document.d.ts +17 -0
  21. package/dist/parser/parse-document.d.ts.map +1 -0
  22. package/dist/parser/parse-document.js +219 -0
  23. package/dist/parser/parse-index.d.ts +31 -0
  24. package/dist/parser/parse-index.d.ts.map +1 -0
  25. package/dist/parser/parse-index.js +251 -0
  26. package/dist/parser/parse-task.d.ts +30 -0
  27. package/dist/parser/parse-task.d.ts.map +1 -0
  28. package/dist/parser/parse-task.js +261 -0
  29. package/dist/state/index.d.ts +307 -0
  30. package/dist/state/index.d.ts.map +1 -0
  31. package/dist/state/index.js +689 -0
  32. package/dist/templates/generator.d.ts +71 -0
  33. package/dist/templates/generator.d.ts.map +1 -0
  34. package/dist/templates/generator.js +723 -0
  35. package/dist/templates/index.d.ts +5 -0
  36. package/dist/templates/index.d.ts.map +1 -0
  37. package/dist/templates/index.js +4 -0
  38. package/dist/types/index.d.ts +131 -0
  39. package/dist/types/index.d.ts.map +1 -0
  40. package/dist/types/index.js +107 -0
  41. package/dist/validator/index.d.ts +83 -0
  42. package/dist/validator/index.d.ts.map +1 -0
  43. package/dist/validator/index.js +611 -0
  44. package/docs/APS-Anvil-Integration.md +750 -0
  45. package/docs/APS-Conventions.md +635 -0
  46. package/docs/APS-NonGoals.md +455 -0
  47. package/docs/APS-Planning-Spec-v0.1.md +362 -0
  48. package/examples/README.md +170 -0
  49. package/examples/feature-auth.aps.md +87 -0
  50. package/examples/refactor-error-handling.aps.md +119 -0
  51. package/examples/system-ecommerce/APS.md +57 -0
  52. package/examples/system-ecommerce/modules/auth.aps.md +38 -0
  53. package/examples/system-ecommerce/modules/cart.aps.md +53 -0
  54. package/examples/system-ecommerce/modules/payments.aps.md +68 -0
  55. package/examples/system-ecommerce/modules/products.aps.md +53 -0
  56. package/package.json +34 -0
  57. package/project.json +37 -0
  58. package/scripts/generate-templates.js +33 -0
  59. package/src/filter/context-bundle.ts +312 -0
  60. package/src/filter/filter.test.ts +317 -0
  61. package/src/filter/index.ts +249 -0
  62. package/src/index.ts +16 -0
  63. package/src/loader/index.ts +364 -0
  64. package/src/loader/loader.test.ts +224 -0
  65. package/src/parser/__fixtures__/invalid-task-id-not-padded.aps.md +7 -0
  66. package/src/parser/__fixtures__/invalid-task-id.aps.md +8 -0
  67. package/src/parser/__fixtures__/minimal-task.aps.md +7 -0
  68. package/src/parser/__fixtures__/non-scope-hyphenated.aps.md +10 -0
  69. package/src/parser/__fixtures__/simple-index.aps.md +35 -0
  70. package/src/parser/__fixtures__/simple-plan.aps.md +19 -0
  71. package/src/parser/index.ts +30 -0
  72. package/src/parser/parse-document.test.ts +603 -0
  73. package/src/parser/parse-document.ts +262 -0
  74. package/src/parser/parse-index.test.ts +316 -0
  75. package/src/parser/parse-index.ts +298 -0
  76. package/src/parser/parse-task.test.ts +476 -0
  77. package/src/parser/parse-task.ts +325 -0
  78. package/src/state/__fixtures__/invalid-plan.aps.md +9 -0
  79. package/src/state/__fixtures__/test-plan.aps.md +20 -0
  80. package/src/state/index.ts +879 -0
  81. package/src/state/state.test.ts +645 -0
  82. package/src/templates/generator.test.ts +378 -0
  83. package/src/templates/generator.ts +776 -0
  84. package/src/templates/index.ts +5 -0
  85. package/src/types/index.ts +168 -0
  86. package/src/validator/__fixtures__/broken-links.aps.md +10 -0
  87. package/src/validator/__fixtures__/circular-deps-index.aps.md +26 -0
  88. package/src/validator/__fixtures__/circular-modules/module-a.aps.md +9 -0
  89. package/src/validator/__fixtures__/circular-modules/module-b.aps.md +9 -0
  90. package/src/validator/__fixtures__/circular-modules/module-c.aps.md +9 -0
  91. package/src/validator/__fixtures__/dup-modules/module-a.aps.md +9 -0
  92. package/src/validator/__fixtures__/dup-modules/module-b.aps.md +9 -0
  93. package/src/validator/__fixtures__/duplicate-ids-index.aps.md +15 -0
  94. package/src/validator/__fixtures__/invalid-task-id.aps.md +17 -0
  95. package/src/validator/__fixtures__/missing-confidence.aps.md +9 -0
  96. package/src/validator/__fixtures__/missing-h1.aps.md +5 -0
  97. package/src/validator/__fixtures__/missing-intent.aps.md +9 -0
  98. package/src/validator/__fixtures__/missing-modules-section.aps.md +7 -0
  99. package/src/validator/__fixtures__/missing-tasks-section.aps.md +7 -0
  100. package/src/validator/__fixtures__/modules/auth.aps.md +17 -0
  101. package/src/validator/__fixtures__/modules/payments.aps.md +13 -0
  102. package/src/validator/__fixtures__/scope-mismatch.aps.md +14 -0
  103. package/src/validator/__fixtures__/valid-index.aps.md +24 -0
  104. package/src/validator/__fixtures__/valid-leaf.aps.md +22 -0
  105. package/src/validator/index.ts +776 -0
  106. package/src/validator/validator.test.ts +269 -0
  107. package/templates/index-full.md +94 -0
  108. package/templates/index-minimal.md +16 -0
  109. package/templates/index-template.md +63 -0
  110. package/templates/leaf-full.md +76 -0
  111. package/templates/leaf-minimal.md +14 -0
  112. package/templates/leaf-template.md +55 -0
  113. package/templates/simple-full.md +56 -0
  114. package/templates/simple-minimal.md +14 -0
  115. package/templates/simple-template.md +30 -0
  116. package/tsconfig.json +19 -0
  117. package/tsconfig.lib.json +14 -0
  118. package/tsconfig.lib.tsbuildinfo +1 -0
  119. package/tsconfig.spec.json +9 -0
  120. package/tsconfig.tsbuildinfo +1 -0
  121. package/vitest.config.ts +15 -0
@@ -0,0 +1,723 @@
1
+ /**
2
+ * Template generator for APS planning documents
3
+ *
4
+ * Generates Markdown templates for index files and leaf specs
5
+ * based on the APS Planning Spec v0.1.
6
+ *
7
+ * Templates come in three variants:
8
+ * - **minimal**: Quick start, bare essentials
9
+ * - **standard**: Recommended for most projects (default)
10
+ * - **full**: Comprehensive, for complex enterprise plans
11
+ */
12
+ // ============================================================================
13
+ // Index Templates
14
+ // ============================================================================
15
+ /**
16
+ * Minimal index template - navigation only
17
+ */
18
+ function generateMinimalIndexTemplate() {
19
+ return `# [Plan Title]
20
+
21
+ ## Modules
22
+
23
+ ### [module-id]
24
+
25
+ - **Path:** [./modules/[module-name].aps.md](./modules/[module-name].aps.md)
26
+ - **Scope:** [SCOPE]
27
+ - **Owner:** @[username]
28
+
29
+ ### [another-module-id]
30
+
31
+ - **Path:** [./modules/[another-module].aps.md](./modules/[another-module].aps.md)
32
+ - **Scope:** [SCOPE2]
33
+ - **Owner:** @[username]
34
+ `;
35
+ }
36
+ /**
37
+ * Standard index template - recommended for most projects
38
+ * The index is a map, not the territory.
39
+ */
40
+ function generateStandardIndexTemplate() {
41
+ return `# [Plan Title]
42
+
43
+ ## Problem & Success Criteria
44
+
45
+ **Problem:** [What problem are we solving? Why does this work matter?]
46
+
47
+ **Success Criteria:**
48
+ - [ ] [Measurable outcome 1]
49
+ - [ ] [Measurable outcome 2]
50
+ - [ ] [How we know we're done]
51
+
52
+ ## System Map
53
+
54
+ [High-level view of modules and their relationships]
55
+
56
+ - **[module-a]** → depends on → **[module-b]**
57
+ - **[module-c]** — standalone
58
+
59
+ ## Milestones
60
+
61
+ ### M1: [Milestone Name]
62
+ - [What's included]
63
+ - Target: [date or modules/features]
64
+
65
+ ### M2: [Milestone Name]
66
+ - [What's included]
67
+ - Target: [date or modules/features]
68
+
69
+ ## Modules
70
+
71
+ ### [module-id]
72
+
73
+ - **Path:** [./modules/[module-name].aps.md](./modules/[module-name].aps.md)
74
+ - **Scope:** [SCOPE]
75
+ - **Owner:** @[username]
76
+ - **Status:** Draft
77
+ - **Priority:** [low|medium|high]
78
+ - **Tags:** [tag1, tag2]
79
+ - **Dependencies:** [other-module-id]
80
+
81
+ ### [another-module-id]
82
+
83
+ - **Path:** [./modules/[another-module].aps.md](./modules/[another-module].aps.md)
84
+ - **Scope:** [SCOPE2]
85
+ - **Owner:** @[username]
86
+ - **Status:** Draft
87
+ - **Priority:** [low|medium|high]
88
+ - **Tags:** [tag1, tag2]
89
+ - **Dependencies:** (none)
90
+
91
+ ## Decisions
92
+
93
+ - **D-001:** [Short decision] — [rationale] ([ADR-001](./decisions/ADR-001.md))
94
+ - **D-002:** [Another decision] — [rationale]
95
+
96
+ ## Open Questions
97
+
98
+ - [Unresolved question 1]
99
+ - [Unresolved question 2]
100
+ `;
101
+ }
102
+ /**
103
+ * Full index template - comprehensive for enterprise plans
104
+ */
105
+ function generateFullIndexTemplate() {
106
+ return `# APS Index — [Project Name]
107
+
108
+ ## Problem & Success Criteria
109
+
110
+ **Problem:** [What problem are we solving? Why does this work matter?]
111
+
112
+ **Success Criteria:**
113
+ - [ ] [Measurable outcome 1]
114
+ - [ ] [Measurable outcome 2]
115
+ - [ ] [How we know we're done]
116
+
117
+ ## Scope
118
+
119
+ **In Scope:**
120
+ - [What this plan covers]
121
+ - [Boundaries of work]
122
+
123
+ **Out of Scope:**
124
+ - [What this plan explicitly excludes]
125
+ - [Things deferred to future work]
126
+
127
+ ## System Map
128
+
129
+ [High-level view of modules and their relationships]
130
+
131
+ \`\`\`
132
+ [Module A] ──→ [Module B] ──→ [Module C]
133
+ ↑ ↓
134
+ [External Service] [Database]
135
+ \`\`\`
136
+
137
+ ## Milestones
138
+
139
+ ### M1: [Milestone Name]
140
+ - [What's included]
141
+ - Modules: [module-a, module-b]
142
+ - Target: [date]
143
+
144
+ ### M2: [Milestone Name]
145
+ - [What's included]
146
+ - Modules: [module-c]
147
+ - Target: [date]
148
+
149
+ ## Modules
150
+
151
+ ### [module-id]
152
+
153
+ - **Path:** [./modules/[module-name].aps.md](./modules/[module-name].aps.md)
154
+ - **Scope:** [SCOPE]
155
+ - **Owner:** @[username]
156
+ - **Status:** Draft
157
+ - **Priority:** [low|medium|high]
158
+ - **Tags:** [tag1, tag2]
159
+ - **Dependencies:** [other-module-id]
160
+
161
+ ### [another-module-id]
162
+
163
+ - **Path:** [./modules/[another-module].aps.md](./modules/[another-module].aps.md)
164
+ - **Scope:** [SCOPE2]
165
+ - **Owner:** @[username]
166
+ - **Status:** Draft
167
+ - **Priority:** [low|medium|high]
168
+ - **Tags:** [tag1, tag2]
169
+ - **Dependencies:** (none)
170
+
171
+ ## Epics
172
+
173
+ ### [epic-id]
174
+
175
+ - **Path:** [./epics/[epic-name].aps.md](./epics/[epic-name].aps.md)
176
+ - **Owner:** @[username]
177
+ - **Modules:** [module-id-1, module-id-2]
178
+ - **Milestone:** M1
179
+
180
+ ## Decisions
181
+
182
+ - **D-001:** [Short decision] — [rationale] ([ADR-001](./decisions/ADR-001.md))
183
+ - **D-002:** [Another decision] — [rationale]
184
+
185
+ ## Risks
186
+
187
+ - **R-001:** [Risk description] — Mitigation: [approach]
188
+ - **R-002:** [Risk description] — Mitigation: [approach]
189
+
190
+ ## Open Questions
191
+
192
+ - [Unresolved question 1]
193
+ - [Unresolved question 2]
194
+ `;
195
+ }
196
+ // ============================================================================
197
+ // Leaf Templates
198
+ // ============================================================================
199
+ /**
200
+ * Minimal leaf template - tasks only
201
+ */
202
+ function generateMinimalLeafTemplate() {
203
+ return `# [Module Title]
204
+
205
+ **Scope:** [SCOPE] **Owner:** @[username]
206
+
207
+ ## Tasks
208
+
209
+ ### [SCOPE]-001: [Task title]
210
+
211
+ **Intent:** [What this task aims to achieve]
212
+ **Confidence:** [low|medium|high]
213
+
214
+ ### [SCOPE]-002: [Another task]
215
+
216
+ **Intent:** [What this task does]
217
+ **Confidence:** [low|medium|high]
218
+ **Dependencies:** [SCOPE]-001
219
+ `;
220
+ }
221
+ /**
222
+ * Standard leaf template - recommended for most modules
223
+ */
224
+ function generateStandardLeafTemplate() {
225
+ return `# [Module Title]
226
+
227
+ **Scope:** [SCOPE] **Owner:** @[username] **Priority:** [low|medium|high]
228
+
229
+ ## Purpose
230
+
231
+ [Why this module exists and what problem it solves]
232
+
233
+ ## In Scope / Out of Scope
234
+
235
+ **In Scope:**
236
+ - [What this module WILL do]
237
+ - [Boundaries of responsibility]
238
+
239
+ **Out of Scope:**
240
+ - [What this module will NOT do]
241
+ - [Things that belong elsewhere]
242
+
243
+ ## Interfaces
244
+
245
+ **Depends on:**
246
+ - [Service/Module name] — [what we need from it]
247
+
248
+ **Exposes:**
249
+ - [Endpoint/API] — [what others can use]
250
+
251
+ ## Tasks
252
+
253
+ ### [SCOPE]-001: [Task title]
254
+
255
+ **Intent:** [Clear statement of what this task aims to achieve]
256
+ **Expected Outcome:** [What success looks like]
257
+ **Confidence:** [low|medium|high]
258
+ **Link:** [PROJ-123](https://jira.example.com/browse/PROJ-123)
259
+ **Scopes:** [SCOPE1, SCOPE2]
260
+ **Tags:** [tag1, tag2, tag3]
261
+ **Dependencies:** [SCOPE-XXX, OTHER-YYY]
262
+ **Inputs:**
263
+ - [Required input 1]
264
+ - [Required input 2]
265
+
266
+ ### [SCOPE]-002: [Another task]
267
+
268
+ **Intent:** [What this task does]
269
+ **Confidence:** [low|medium|high]
270
+ **Scopes:** [SCOPE]
271
+ **Dependencies:** [SCOPE]-001
272
+
273
+ ## Decisions
274
+
275
+ - **D-001:** [Short decision] — [rationale]
276
+
277
+ ## Notes
278
+
279
+ - [Additional context or considerations]
280
+ `;
281
+ }
282
+ /**
283
+ * Full leaf template - comprehensive for complex modules
284
+ */
285
+ function generateFullLeafTemplate() {
286
+ return `# Module APS — [Module Name]
287
+
288
+ **Scope:** [SCOPE] **Owner:** @[username] **Priority:** [low|medium|high]
289
+
290
+ ## Purpose
291
+
292
+ [Why this module exists and what problem it solves. The "why" behind this work.]
293
+
294
+ ## In Scope / Out of Scope
295
+
296
+ **In Scope:**
297
+ - [What this module WILL do]
298
+ - [Boundaries of responsibility]
299
+ - [Features included]
300
+
301
+ **Out of Scope:**
302
+ - [What this module will NOT do]
303
+ - [Things that belong elsewhere]
304
+ - [Explicit exclusions]
305
+
306
+ ## Assumptions
307
+
308
+ - [Assumption 1] — Confidence: [low|medium|high]
309
+ - [Assumption 2] — Confidence: [low|medium|high]
310
+
311
+ ## Interfaces
312
+
313
+ **Depends on:**
314
+ - [Service/Module name] — [what we need from it]
315
+ - [External API] — [what we consume]
316
+
317
+ **Exposes:**
318
+ - [Endpoint/API] — [what others can use]
319
+ - [Event/Hook] — [what we publish]
320
+
321
+ ## Tasks
322
+
323
+ ### [SCOPE]-001: [Task title]
324
+
325
+ **Intent:** [Clear statement of what this task aims to achieve]
326
+ **Expected Outcome:** [What success looks like]
327
+ **Confidence:** [low|medium|high]
328
+ **Link:** [PROJ-123](https://jira.example.com/browse/PROJ-123)
329
+ **Scopes:** [SCOPE1, SCOPE2]
330
+ **Tags:** [tag1, tag2, tag3]
331
+ **Dependencies:** [SCOPE-XXX, OTHER-YYY]
332
+ **Inputs:**
333
+ - [Required input 1]
334
+ - [Required input 2]
335
+
336
+ ### [SCOPE]-002: [Another task]
337
+
338
+ **Intent:** [What this task does]
339
+ **Expected Outcome:** [Success criteria]
340
+ **Confidence:** [low|medium|high]
341
+ **Link:** [PROJ-124](https://jira.example.com/browse/PROJ-124)
342
+ **Scopes:** [SCOPE]
343
+ **Dependencies:** [SCOPE]-001
344
+
345
+ ## Decisions
346
+
347
+ - **D-001:** [Short decision] — [rationale] ([ADR-001](../decisions/ADR-001.md))
348
+ - **D-002:** [Another decision] — [rationale]
349
+
350
+ ## Risks
351
+
352
+ - **R-001:** [Risk description] — Mitigation: [approach]
353
+
354
+ ## Open Questions
355
+
356
+ - [Unresolved question about this module]
357
+
358
+ ## Notes
359
+
360
+ - [Additional context or considerations]
361
+ - [Links to relevant resources]
362
+ `;
363
+ }
364
+ // ============================================================================
365
+ // Simple (Single-File) Templates
366
+ // ============================================================================
367
+ /**
368
+ * Minimal simple template - quick feature plan
369
+ */
370
+ function generateMinimalSimpleTemplate() {
371
+ return `# [Feature Name]
372
+
373
+ **Scope:** [SCOPE] **Owner:** @[username]
374
+
375
+ ## Tasks
376
+
377
+ ### [SCOPE]-001: [First task]
378
+
379
+ **Intent:** [What this task achieves]
380
+ **Confidence:** [low|medium|high]
381
+
382
+ ### [SCOPE]-002: [Second task]
383
+
384
+ **Intent:** [What this task achieves]
385
+ **Confidence:** [low|medium|high]
386
+ **Dependencies:** [SCOPE]-001
387
+ `;
388
+ }
389
+ /**
390
+ * Standard simple template - recommended for single-file plans
391
+ */
392
+ function generateStandardSimpleTemplate() {
393
+ return `# Feature: [Feature Name]
394
+
395
+ **Scope:** [SCOPE] **Owner:** @[username] **Priority:** [low|medium|high]
396
+
397
+ ## Purpose
398
+
399
+ [Why we're building this feature and what problem it solves]
400
+
401
+ ## Success Criteria
402
+
403
+ - [ ] [Measurable outcome 1]
404
+ - [ ] [Measurable outcome 2]
405
+
406
+ ## Tasks
407
+
408
+ ### [SCOPE]-001: [First task]
409
+
410
+ **Intent:** [What this task achieves]
411
+ **Expected Outcome:** [Success criteria]
412
+ **Confidence:** [low|medium|high]
413
+ **Link:** [PROJ-123](https://jira.example.com/browse/PROJ-123)
414
+ **Scopes:** [SCOPE]
415
+ **Tags:** [tag1, tag2]
416
+
417
+ ### [SCOPE]-002: [Second task]
418
+
419
+ **Intent:** [What this task achieves]
420
+ **Confidence:** [low|medium|high]
421
+ **Scopes:** [SCOPE]
422
+ **Dependencies:** [SCOPE]-001
423
+
424
+ ## Notes
425
+
426
+ - [Additional notes or considerations]
427
+ `;
428
+ }
429
+ /**
430
+ * Full simple template - comprehensive single-file plan
431
+ */
432
+ function generateFullSimpleTemplate() {
433
+ return `# Feature: [Feature Name]
434
+
435
+ **Scope:** [SCOPE] **Owner:** @[username] **Priority:** [low|medium|high]
436
+
437
+ ## Purpose
438
+
439
+ [Why we're building this feature and what problem it solves]
440
+
441
+ ## Success Criteria
442
+
443
+ - [ ] [Measurable outcome 1]
444
+ - [ ] [Measurable outcome 2]
445
+ - [ ] [How we know we're done]
446
+
447
+ ## In Scope / Out of Scope
448
+
449
+ **In Scope:**
450
+ - [What this feature WILL do]
451
+
452
+ **Out of Scope:**
453
+ - [What this feature will NOT do]
454
+
455
+ ## Assumptions
456
+
457
+ - [Assumption 1] — Confidence: [low|medium|high]
458
+
459
+ ## Tasks
460
+
461
+ ### [SCOPE]-001: [First task]
462
+
463
+ **Intent:** [What this task achieves]
464
+ **Expected Outcome:** [Success criteria]
465
+ **Confidence:** [low|medium|high]
466
+ **Link:** [PROJ-123](https://jira.example.com/browse/PROJ-123)
467
+ **Scopes:** [SCOPE]
468
+ **Tags:** [tag1, tag2]
469
+ **Inputs:**
470
+ - [Required input 1]
471
+
472
+ ### [SCOPE]-002: [Second task]
473
+
474
+ **Intent:** [What this task achieves]
475
+ **Expected Outcome:** [Success criteria]
476
+ **Confidence:** [low|medium|high]
477
+ **Scopes:** [SCOPE]
478
+ **Dependencies:** [SCOPE]-001
479
+
480
+ ## Decisions
481
+
482
+ - **D-001:** [Decision] — [rationale]
483
+
484
+ ## Open Questions
485
+
486
+ - [Unresolved question]
487
+
488
+ ## Notes
489
+
490
+ - [Additional notes or considerations]
491
+ `;
492
+ }
493
+ // ============================================================================
494
+ // Action Plan Templates
495
+ // ============================================================================
496
+ /**
497
+ * Minimal action plan template - checkpoints only
498
+ */
499
+ function generateMinimalActionsTemplate() {
500
+ return `# Actions: [SCOPE-NNN]
501
+
502
+ | Source | Work Item | Created by | Status |
503
+ |--------|-----------|------------|--------|
504
+ | [module.aps.md](./module.aps.md) | [SCOPE-NNN]: [Title] | @[username] | In Progress |
505
+
506
+ ## Actions
507
+
508
+ ### 1. [Action verb] [target]
509
+
510
+ - **Checkpoint:** [Observable state — max 12 words]
511
+ - **Validate:** \`[command]\`
512
+
513
+ ### 2. [Next action]
514
+
515
+ - **Checkpoint:** [Observable state]
516
+ - **Validate:** \`[command]\`
517
+
518
+ ## Completion
519
+
520
+ - [ ] All checkpoints validated
521
+ - [ ] Work item marked complete
522
+ `;
523
+ }
524
+ /**
525
+ * Standard action plan template - recommended for most tasks
526
+ */
527
+ function generateStandardActionsTemplate() {
528
+ return `# Actions: [SCOPE-NNN]
529
+
530
+ | Source | Work Item | Created by | Status |
531
+ |--------|-----------|------------|--------|
532
+ | [module.aps.md](./module.aps.md) | [SCOPE-NNN]: [Title] | @[username] | In Progress |
533
+
534
+ ## Prerequisites
535
+
536
+ - [ ] Dependencies completed: [list any prerequisite work items]
537
+ - [ ] Decisions made: [list any decisions needed]
538
+ - [ ] Context available: [list any required inputs]
539
+
540
+ ## Actions
541
+
542
+ ### 1. [Action verb] [target]
543
+
544
+ - **Purpose:** [Why this action is needed]
545
+ - **Produces:** [What this action creates or changes]
546
+ - **Checkpoint:** [Observable state — max 12 words]
547
+ - **Validate:** \`[command]\`
548
+
549
+ ### 2. [Next action]
550
+
551
+ - **Purpose:** [Why this action is needed]
552
+ - **Produces:** [What this action creates or changes]
553
+ - **Checkpoint:** [Observable state — max 12 words]
554
+ - **Validate:** \`[command]\`
555
+
556
+ ### 3. [Final action]
557
+
558
+ - **Purpose:** [Why this action is needed]
559
+ - **Produces:** [What this action creates or changes]
560
+ - **Checkpoint:** [Observable state — max 12 words]
561
+ - **Validate:** \`[command]\`
562
+
563
+ ## Completion
564
+
565
+ - [ ] All checkpoints validated
566
+ - [ ] Work item marked complete
567
+ - [ ] Completed by: @[username]
568
+ - [ ] Completed at: [timestamp]
569
+ `;
570
+ }
571
+ /**
572
+ * Full action plan template - comprehensive for complex tasks
573
+ */
574
+ function generateFullActionsTemplate() {
575
+ return `# Actions: [SCOPE-NNN]
576
+
577
+ | Source | Work Item | Created by | Status |
578
+ |--------|-----------|------------|--------|
579
+ | [module.aps.md](./module.aps.md) | [SCOPE-NNN]: [Title] | @[username] | In Progress |
580
+
581
+ ## Overview
582
+
583
+ **Intent:** [Copy from work item — what this achieves]
584
+ **Expected Outcome:** [Copy from work item — success criteria]
585
+
586
+ ## Prerequisites
587
+
588
+ - [ ] Dependencies completed: [list any prerequisite work items]
589
+ - [ ] Decisions made: [list any decisions needed]
590
+ - [ ] Context available: [list any required inputs]
591
+ - [ ] Environment ready: [list any setup requirements]
592
+
593
+ ## Actions
594
+
595
+ ### 1. [Action verb] [target]
596
+
597
+ - **Purpose:** [Why this action is needed]
598
+ - **Produces:** [What this action creates or changes]
599
+ - **Checkpoint:** [Observable state — max 12 words]
600
+ - **Validate:** \`[command]\`
601
+ - **Status:** [Blocked/Deferred — only if applicable]
602
+
603
+ ### 2. [Next action]
604
+
605
+ - **Purpose:** [Why this action is needed]
606
+ - **Produces:** [What this action creates or changes]
607
+ - **Checkpoint:** [Observable state — max 12 words]
608
+ - **Validate:** \`[command]\`
609
+
610
+ ### 3. [Verification action]
611
+
612
+ - **Purpose:** [Why this action is needed]
613
+ - **Produces:** [What this action creates or changes]
614
+ - **Checkpoint:** [Observable state — max 12 words]
615
+ - **Validate:** \`[command]\`
616
+
617
+ ## Blocked/Deferred
618
+
619
+ [Document any actions that are blocked or deferred, with reasons]
620
+
621
+ ## Notes
622
+
623
+ - [Additional context or considerations]
624
+ - [Links to relevant resources]
625
+
626
+ ## Completion
627
+
628
+ - [ ] All checkpoints validated
629
+ - [ ] Tests pass: \`[test command]\`
630
+ - [ ] Work item marked complete
631
+ - [ ] Completed by: @[username]
632
+ - [ ] Completed at: [timestamp]
633
+ `;
634
+ }
635
+ // ============================================================================
636
+ // Public API
637
+ // ============================================================================
638
+ /**
639
+ * Generate an index file template
640
+ *
641
+ * @param options - Template options
642
+ * @returns Index template markdown
643
+ */
644
+ export function generateIndexTemplate(options = {}) {
645
+ const variant = options.variant ?? 'standard';
646
+ switch (variant) {
647
+ case 'minimal':
648
+ return generateMinimalIndexTemplate();
649
+ case 'full':
650
+ return generateFullIndexTemplate();
651
+ case 'standard':
652
+ default:
653
+ return generateStandardIndexTemplate();
654
+ }
655
+ }
656
+ /**
657
+ * Generate a leaf spec template
658
+ *
659
+ * @param options - Template options
660
+ * @returns Leaf spec template markdown
661
+ */
662
+ export function generateLeafTemplate(options = {}) {
663
+ const variant = options.variant ?? 'standard';
664
+ switch (variant) {
665
+ case 'minimal':
666
+ return generateMinimalLeafTemplate();
667
+ case 'full':
668
+ return generateFullLeafTemplate();
669
+ case 'standard':
670
+ default:
671
+ return generateStandardLeafTemplate();
672
+ }
673
+ }
674
+ /**
675
+ * Generate a simple single-file plan template
676
+ *
677
+ * @param options - Template options
678
+ * @returns Simple plan template markdown
679
+ */
680
+ export function generateSimplePlanTemplate(options = {}) {
681
+ const variant = options.variant ?? 'standard';
682
+ switch (variant) {
683
+ case 'minimal':
684
+ return generateMinimalSimpleTemplate();
685
+ case 'full':
686
+ return generateFullSimpleTemplate();
687
+ case 'standard':
688
+ default:
689
+ return generateStandardSimpleTemplate();
690
+ }
691
+ }
692
+ /**
693
+ * Generate an action plan template for execution breakdowns
694
+ *
695
+ * @param options - Template options
696
+ * @returns Action plan template markdown
697
+ */
698
+ export function generateActionsTemplate(options = {}) {
699
+ const variant = options.variant ?? 'standard';
700
+ switch (variant) {
701
+ case 'minimal':
702
+ return generateMinimalActionsTemplate();
703
+ case 'full':
704
+ return generateFullActionsTemplate();
705
+ case 'standard':
706
+ default:
707
+ return generateStandardActionsTemplate();
708
+ }
709
+ }
710
+ /**
711
+ * Generate all templates and return as a typed bundle
712
+ *
713
+ * @param options - Template options
714
+ * @returns Bundle of all templates
715
+ */
716
+ export function generateAllTemplates(options = {}) {
717
+ return {
718
+ index: generateIndexTemplate(options),
719
+ leaf: generateLeafTemplate(options),
720
+ simple: generateSimplePlanTemplate(options),
721
+ actions: generateActionsTemplate(options),
722
+ };
723
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Template generation for APS planning documents
3
+ */
4
+ export * from './generator.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC"}