@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,455 @@
1
+ # APS Non-Goals
2
+
3
+ > What Anvil Planning Spec explicitly **does not** do.
4
+
5
+ ## Purpose of This Document
6
+
7
+ APS has a focused scope. This document clarifies what APS deliberately excludes
8
+ to prevent scope creep and maintain simplicity.
9
+
10
+ ---
11
+
12
+ ## 1. Project Management
13
+
14
+ ### What APS Is Not
15
+
16
+ APS is **not** a project management tool like Jira, Linear, or Asana.
17
+
18
+ ### What's Excluded
19
+
20
+ - **Time tracking** — No effort estimates, time logged, or burndown charts
21
+ - **Sprint planning** — No sprint assignments, velocity tracking, or iteration
22
+ management
23
+ - **Assignee workflows** — No task assignment, status transitions, or approval
24
+ flows
25
+ - **Notifications** — No alerts, reminders, or email integrations
26
+ - **Reporting** — No dashboards, metrics, or progress visualisation
27
+
28
+ ### Why
29
+
30
+ Project management tools exist and integrate with code repositories. APS focuses
31
+ on **planning as code**, not replacing PM tools.
32
+
33
+ ### Integration Path
34
+
35
+ If PM integration is needed:
36
+
37
+ - Export APS tasks to your PM tool
38
+ - Sync status bidirectionally via API
39
+ - Keep planning docs as source of truth
40
+
41
+ ---
42
+
43
+ ## 2. Issue Tracking
44
+
45
+ ### What APS Is Not
46
+
47
+ APS is **not** a bug tracker or issue management system.
48
+
49
+ ### What's Excluded
50
+
51
+ - **Bug reports** — No structured bug templates, severity levels, or
52
+ reproduction steps
53
+ - **Feature requests** — No voting, prioritisation, or roadmap planning
54
+ - **Support tickets** — No customer-facing issue tracking
55
+ - **Triage workflows** — No labelling, assignment, or escalation
56
+
57
+ ### Why
58
+
59
+ GitHub Issues, GitLab Issues, and similar tools handle this well. APS focuses on
60
+ **planned work**, not emergent issues.
61
+
62
+ ### When to Use APS vs Issues
63
+
64
+ **Use APS for:**
65
+
66
+ - Planned features with clear scope
67
+ - Refactoring or technical debt with defined tasks
68
+ - System design with module boundaries
69
+
70
+ **Use Issues for:**
71
+
72
+ - Bug reports
73
+ - User-reported problems
74
+ - Feature requests from users
75
+ - Support questions
76
+
77
+ ---
78
+
79
+ ## 3. Execution Tracking
80
+
81
+ ### What APS Is Not
82
+
83
+ APS is **not** a task runner or CI/CD system.
84
+
85
+ ### What's Excluded
86
+
87
+ - **Automated execution** — No background jobs, scheduled tasks, or runners
88
+ - **Progress monitoring** — No real-time logs, output streaming, or telemetry
89
+ - **Retry logic** — No automatic retries, failure handling, or recovery
90
+ - **Parallelisation** — No concurrency control or distributed execution
91
+ - **Resource management** — No CPU/memory limits or quota enforcement
92
+
93
+ ### Why
94
+
95
+ Execution is handled by Anvil's execution layer (powered by LLM agents). APS
96
+ only provides the **planning input** and **state tracking**.
97
+
98
+ ### Where Execution Happens
99
+
100
+ - **Planning:** APS documents define what to do
101
+ - **Locking:** `anvil plan lock` creates an execution plan
102
+ - **Execution:** Anvil agents execute the task
103
+ - **Completion:** `anvil plan status` shows results
104
+
105
+ ---
106
+
107
+ ## 4. Version Control
108
+
109
+ ### What APS Is Not
110
+
111
+ APS is **not** a replacement for Git or version control.
112
+
113
+ ### What's Excluded
114
+
115
+ - **File versioning** — No built-in diff, blame, or history
116
+ - **Branching** — No concept of feature branches for planning docs
117
+ - **Merging** — No conflict resolution or merge strategies
118
+ - **Tagging** — No release tagging or version milestones
119
+
120
+ ### Why
121
+
122
+ Planning docs are **Markdown files committed to Git**. Use Git for version
123
+ control, as you would with any code.
124
+
125
+ ### Best Practices
126
+
127
+ - Commit planning docs to Git
128
+ - Use branches for experimental plans
129
+ - Review planning docs in pull requests
130
+ - Tag releases with Git tags
131
+
132
+ ---
133
+
134
+ ## 5. Knowledge Base / Documentation
135
+
136
+ ### What APS Is Not
137
+
138
+ APS is **not** a documentation system or wiki.
139
+
140
+ ### What's Excluded
141
+
142
+ - **General documentation** — No API docs, user guides, or tutorials
143
+ - **Search functionality** — No full-text search across docs
144
+ - **Cross-referencing** — No automatic backlinks or related pages
145
+ - **Publishing** — No static site generation or doc hosting
146
+
147
+ ### Why
148
+
149
+ APS is for **actionable planning**, not general documentation. Use dedicated
150
+ tools like:
151
+
152
+ - Docusaurus, MkDocs, or Sphinx for documentation
153
+ - Notion or Confluence for wikis
154
+ - README files for project documentation
155
+
156
+ ### When Documentation Is Relevant
157
+
158
+ Planning docs can link to documentation:
159
+
160
+ ```markdown
161
+ ### AUTH-001: Implement OAuth
162
+
163
+ **Intent:** Add OAuth support per
164
+ [Authentication RFC](../../docs/rfcs/auth-rfc.md)
165
+ ```
166
+
167
+ But the RFC itself is not an APS document.
168
+
169
+ ---
170
+
171
+ ## 6. Artifact Storage
172
+
173
+ ### What APS Is Not
174
+
175
+ APS is **not** a file storage system for design assets, diagrams, or artifacts.
176
+
177
+ ### What's Excluded
178
+
179
+ - **File attachments** — No binary file uploads (PDFs, images, videos)
180
+ - **Diagram embedding** — No built-in diagram rendering (Mermaid, PlantUML)
181
+ - **Asset management** — No versioning of design files or mockups
182
+
183
+ ### Why
184
+
185
+ Git is not optimised for binary files. Use appropriate tools:
186
+
187
+ - **Design files:** Figma, Sketch, or design repositories
188
+ - **Diagrams:** Mermaid in README files, or diagram-as-code tools
189
+ - **Documents:** Link to Google Docs or other doc systems
190
+
191
+ ### Linking to Assets
192
+
193
+ Planning docs can link to external assets:
194
+
195
+ ```markdown
196
+ ### UI-001: Build login screen
197
+
198
+ **Intent:** Implement login UI per [Figma mockups](https://figma.com/...)
199
+ ```
200
+
201
+ ---
202
+
203
+ ## 7. Communication / Collaboration
204
+
205
+ ### What APS Is Not
206
+
207
+ APS is **not** a collaboration platform like Slack or Discord.
208
+
209
+ ### What's Excluded
210
+
211
+ - **Comments** — No inline comments or discussion threads
212
+ - **Mentions** — No `@user` notifications
213
+ - **Reactions** — No emoji reactions or voting
214
+ - **Chat** — No real-time messaging
215
+
216
+ ### Why
217
+
218
+ GitHub already provides PR comments, code review, and discussions. APS doesn't
219
+ duplicate this.
220
+
221
+ ### Collaboration Workflow
222
+
223
+ - **Planning discussion:** Use GitHub Issues or Discussions
224
+ - **Review planning docs:** Use pull requests
225
+ - **Inline questions:** Use PR review comments
226
+ - **Decisions:** Document in `## Decisions` section of planning doc
227
+
228
+ ---
229
+
230
+ ## 8. Estimation / Forecasting
231
+
232
+ ### What APS Is Not
233
+
234
+ APS is **not** an estimation or forecasting tool.
235
+
236
+ ### What's Excluded
237
+
238
+ - **Story points** — No complexity estimates
239
+ - **Time estimates** — No hours or days for tasks
240
+ - **Velocity tracking** — No historical throughput analysis
241
+ - **Forecasting** — No projected completion dates
242
+
243
+ ### Why
244
+
245
+ Estimation is subjective and often inaccurate. APS focuses on **clear intent**,
246
+ not predicting duration.
247
+
248
+ ### Where Estimation Fits
249
+
250
+ If estimation is needed:
251
+
252
+ - Add estimates as tags: `**Tags:** estimate-large, estimate-2-days`
253
+ - Track externally in PM tool
254
+ - Use Git commit history for actual time analysis
255
+
256
+ ---
257
+
258
+ ## 9. Access Control / Permissions
259
+
260
+ ### What APS Is Not
261
+
262
+ APS is **not** a permission or access control system.
263
+
264
+ ### What's Excluded
265
+
266
+ - **User roles** — No admin, editor, viewer roles
267
+ - **File-level permissions** — No read/write restrictions
268
+ - **Task ownership enforcement** — No "only assignee can lock"
269
+ - **Audit logs** — No built-in activity tracking
270
+
271
+ ### Why
272
+
273
+ Git and hosting platforms (GitHub, GitLab) handle access control. APS relies on
274
+ repository permissions.
275
+
276
+ ### Security Model
277
+
278
+ - **Read access:** Anyone with repository read access can view planning docs
279
+ - **Write access:** Anyone with write access can modify planning docs
280
+ - **Lock enforcement:** First lock wins, but not enforced by permissions
281
+
282
+ ---
283
+
284
+ ## 10. Complex Workflows
285
+
286
+ ### What APS Is Not
287
+
288
+ APS is **not** a workflow engine or state machine.
289
+
290
+ ### What's Excluded
291
+
292
+ - **Custom states** — Only 4 states: `open`, `locked`, `completed`, `cancelled`
293
+ - **State transitions** — No approval flows or multi-step processes
294
+ - **Conditional logic** — No if/then rules or branching workflows
295
+ - **Triggers** — No automated actions on state changes
296
+
297
+ ### Why
298
+
299
+ Complex workflows add complexity without clear benefit. APS uses simple, linear
300
+ task states.
301
+
302
+ ### If Complex Workflows Are Needed
303
+
304
+ - Use dedicated workflow tools (GitHub Actions, Temporal, etc.)
305
+ - Trigger workflows based on APS state changes
306
+ - Keep APS simple, orchestrate externally
307
+
308
+ ---
309
+
310
+ ## 11. Natural Language Processing
311
+
312
+ ### What APS Is Not
313
+
314
+ APS is **not** an AI-powered planning assistant.
315
+
316
+ ### What's Excluded
317
+
318
+ - **Intent parsing** — No natural language understanding
319
+ - **Task generation** — No automated task breakdown from descriptions
320
+ - **Dependency inference** — No automatic dependency detection
321
+ - **Scope suggestion** — No AI-driven scope recommendations
322
+
323
+ ### Why
324
+
325
+ APS is a **structured format**, not an AI system. Humans (or LLMs via Anvil
326
+ agents) write planning docs explicitly.
327
+
328
+ ### Where AI Fits
329
+
330
+ LLMs can:
331
+
332
+ - Help **write** planning docs (via prompts)
333
+ - Validate planning docs (via `anvil plan validate`)
334
+ - Execute tasks (via `anvil plan lock` + Anvil agents)
335
+
336
+ But APS itself is static structured Markdown.
337
+
338
+ ---
339
+
340
+ ## 12. Dynamic Content
341
+
342
+ ### What APS Is Not
343
+
344
+ APS is **not** a dynamic or database-backed system.
345
+
346
+ ### What's Excluded
347
+
348
+ - **Queries** — No SQL-like queries across tasks
349
+ - **Computed fields** — No calculated values or aggregations
350
+ - **Dynamic lists** — No auto-generated task lists
351
+ - **Live updates** — No real-time synchronisation
352
+
353
+ ### Why
354
+
355
+ Planning docs are **static Markdown files**. Parse them, extract data, but don't
356
+ expect database semantics.
357
+
358
+ ### If Dynamic Queries Are Needed
359
+
360
+ - Parse planning docs into a database (SQLite, PostgreSQL)
361
+ - Query the database
362
+ - Regenerate reports or views
363
+ - Keep planning docs as canonical source
364
+
365
+ ---
366
+
367
+ ## 13. Multi-Tenancy
368
+
369
+ ### What APS Is Not
370
+
371
+ APS is **not** a multi-tenant SaaS platform.
372
+
373
+ ### What's Excluded
374
+
375
+ - **Organisations** — No concept of orgs, teams, or workspaces
376
+ - **Isolation** — No data separation between projects
377
+ - **Billing** — No usage tracking or subscription management
378
+ - **Branding** — No custom themes or white-labelling
379
+
380
+ ### Why
381
+
382
+ APS is a **file format and library**, not a hosted service. Each repository has
383
+ its own planning docs.
384
+
385
+ ### Multi-Project Usage
386
+
387
+ If you have multiple projects:
388
+
389
+ - Each repository has its own `docs/planning/` directory
390
+ - No shared planning docs across repos
391
+ - Use Git submodules or monorepos if sharing is needed
392
+
393
+ ---
394
+
395
+ ## 14. Configuration Management
396
+
397
+ ### What APS Is Not
398
+
399
+ APS is **not** a configuration or infrastructure-as-code tool.
400
+
401
+ ### What's Excluded
402
+
403
+ - **Environment config** — No prod/staging/dev configuration
404
+ - **Secrets management** — No encrypted credentials
405
+ - **Deployment config** — No Kubernetes manifests or Terraform files
406
+ - **Feature flags** — No runtime toggles
407
+
408
+ ### Why
409
+
410
+ Use dedicated tools for configuration:
411
+
412
+ - **Config:** dotenv, config files, environment variables
413
+ - **Secrets:** Vault, AWS Secrets Manager, GitHub Secrets
414
+ - **IaC:** Terraform, Pulumi, CloudFormation
415
+
416
+ ---
417
+
418
+ ## Summary Table
419
+
420
+ | Feature Area | APS Does | APS Does Not |
421
+ | --------------- | ----------------------------- | ----------------------------------- |
422
+ | Planning | ✅ Structured planning docs | ❌ Project management |
423
+ | Task Management | ✅ Task definitions + locking | ❌ Issue tracking |
424
+ | Execution | ✅ Lock tasks for execution | ❌ Run tasks automatically |
425
+ | Version Control | ✅ Uses Git | ❌ Built-in versioning |
426
+ | Documentation | ✅ Links to docs | ❌ General documentation system |
427
+ | Storage | ✅ Markdown files | ❌ Binary file attachments |
428
+ | Collaboration | ✅ PR reviews | ❌ Chat or comments |
429
+ | Estimation | ✅ Confidence levels | ❌ Time estimates or story points |
430
+ | Access Control | ✅ Git permissions | ❌ Custom roles or permissions |
431
+ | Workflows | ✅ Simple states | ❌ Complex state machines |
432
+ | AI | ✅ LLM-friendly format | ❌ AI-powered parsing or generation |
433
+ | Dynamic Content | ✅ Static Markdown | ❌ Queries or computed fields |
434
+ | Multi-Tenancy | ✅ Per-repository | ❌ Multi-tenant SaaS |
435
+ | Configuration | ✅ Links to config | ❌ Config management |
436
+
437
+ ---
438
+
439
+ ## Design Philosophy
440
+
441
+ APS follows these principles:
442
+
443
+ 1. **Do one thing well** — Planning as structured Markdown
444
+ 2. **Leverage existing tools** — Git, GitHub, editors
445
+ 3. **Stay simple** — Markdown + conventions, not a platform
446
+ 4. **Integrate, don't replace** — Works with PM tools, not against them
447
+
448
+ By explicitly excluding these features, APS remains focused, maintainable, and
449
+ easy to adopt.
450
+
451
+ ---
452
+
453
+ ## Version History
454
+
455
+ - **v0.1** (2025-12-17) — Initial non-goals