baldart 3.6.2

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 (230) hide show
  1. package/CHANGELOG.md +599 -0
  2. package/README.md +566 -0
  3. package/VERSION +1 -0
  4. package/bin/baldart.js +143 -0
  5. package/framework/.claude/agents/REGISTRY.md +169 -0
  6. package/framework/.claude/agents/api-perf-cost-auditor.md +291 -0
  7. package/framework/.claude/agents/code-reviewer.md +350 -0
  8. package/framework/.claude/agents/codebase-architect.md +391 -0
  9. package/framework/.claude/agents/coder.md +291 -0
  10. package/framework/.claude/agents/deep-human-insight.md +198 -0
  11. package/framework/.claude/agents/doc-reviewer.md +440 -0
  12. package/framework/.claude/agents/email-deliverability-architect.md +193 -0
  13. package/framework/.claude/agents/hybrid-ml-architect.md +285 -0
  14. package/framework/.claude/agents/hyper-gamification-designer.md +149 -0
  15. package/framework/.claude/agents/legal-counsel-gdpr.md +179 -0
  16. package/framework/.claude/agents/marketing-conversion-strategist.md +162 -0
  17. package/framework/.claude/agents/motion-expert.md +108 -0
  18. package/framework/.claude/agents/onboarding-architect-lead.md +230 -0
  19. package/framework/.claude/agents/plan-auditor.md +546 -0
  20. package/framework/.claude/agents/prd-card-writer.md +372 -0
  21. package/framework/.claude/agents/prd.md +744 -0
  22. package/framework/.claude/agents/qa-sentinel.md +305 -0
  23. package/framework/.claude/agents/remotion-animator-orchestrator.md +218 -0
  24. package/framework/.claude/agents/security-reviewer.md +276 -0
  25. package/framework/.claude/agents/senior-researcher.md +175 -0
  26. package/framework/.claude/agents/seo-analytics-strategist.md +156 -0
  27. package/framework/.claude/agents/skill-improver.md +61 -0
  28. package/framework/.claude/agents/ui-expert.md +191 -0
  29. package/framework/.claude/agents/visual-designer.md +190 -0
  30. package/framework/.claude/agents/website-orchestrator.md +118 -0
  31. package/framework/.claude/agents/wiki-curator.md +145 -0
  32. package/framework/.claude/commands/baldart-push.md +15 -0
  33. package/framework/.claude/commands/check.md +237 -0
  34. package/framework/.claude/commands/codexreview.md +203 -0
  35. package/framework/.claude/commands/design-review.md +11 -0
  36. package/framework/.claude/commands/issue-review.md +34 -0
  37. package/framework/.claude/commands/new.md +331 -0
  38. package/framework/.claude/commands/qa.md +257 -0
  39. package/framework/.claude/hooks/framework-edit-gate.js +208 -0
  40. package/framework/.claude/hooks/lint-before-commit.sh.template +66 -0
  41. package/framework/.claude/settings.local.json.example +32 -0
  42. package/framework/.claude/skills/api-design-principles/SKILL.md +567 -0
  43. package/framework/.claude/skills/api-design-principles/assets/api-design-checklist.md +155 -0
  44. package/framework/.claude/skills/api-design-principles/assets/rest-api-template.py +182 -0
  45. package/framework/.claude/skills/api-design-principles/references/graphql-schema-design.md +583 -0
  46. package/framework/.claude/skills/api-design-principles/references/rest-best-practices.md +408 -0
  47. package/framework/.claude/skills/baldart-push/SKILL.md +222 -0
  48. package/framework/.claude/skills/bug/SKILL.md +200 -0
  49. package/framework/.claude/skills/bug/references/logging-patterns.md +174 -0
  50. package/framework/.claude/skills/capture/SKILL.md +125 -0
  51. package/framework/.claude/skills/capture/references/synthesis-template.md +42 -0
  52. package/framework/.claude/skills/context-primer/SKILL.md +189 -0
  53. package/framework/.claude/skills/copywriting/SKILL.md +273 -0
  54. package/framework/.claude/skills/copywriting/references/copy-frameworks.md +338 -0
  55. package/framework/.claude/skills/copywriting/references/natural-transitions.md +252 -0
  56. package/framework/.claude/skills/doc-writing-for-rag/SKILL.md +119 -0
  57. package/framework/.claude/skills/doc-writing-for-rag/references/before-after-examples.md +291 -0
  58. package/framework/.claude/skills/doc-writing-for-rag/references/compact-templates.md +183 -0
  59. package/framework/.claude/skills/doc-writing-for-rag/references/frontmatter-minimal.md +112 -0
  60. package/framework/.claude/skills/doc-writing-for-rag/references/line-count-targets.md +110 -0
  61. package/framework/.claude/skills/doc-writing-for-rag/references/schemas-and-errors.md +129 -0
  62. package/framework/.claude/skills/find-skills/SKILL.md +133 -0
  63. package/framework/.claude/skills/frontend-design/LICENSE.txt +177 -0
  64. package/framework/.claude/skills/frontend-design/SKILL.md +84 -0
  65. package/framework/.claude/skills/gamification-design/SKILL.md +130 -0
  66. package/framework/.claude/skills/issue-review/SKILL.md +45 -0
  67. package/framework/.claude/skills/kie-ai/SKILL.md +262 -0
  68. package/framework/.claude/skills/kie-ai/references/models-catalog.md +272 -0
  69. package/framework/.claude/skills/kie-ai/scripts/kie_api.sh +209 -0
  70. package/framework/.claude/skills/kie-ai/scripts/remove_greenscreen.py +69 -0
  71. package/framework/.claude/skills/kie-ai/scripts/setup_api_key.sh +77 -0
  72. package/framework/.claude/skills/motion-design/LICENSE +21 -0
  73. package/framework/.claude/skills/motion-design/README.md +82 -0
  74. package/framework/.claude/skills/motion-design/SKILL.md +336 -0
  75. package/framework/.claude/skills/motion-design/director/choreography.md +93 -0
  76. package/framework/.claude/skills/motion-design/director/context-adaptation.md +83 -0
  77. package/framework/.claude/skills/motion-design/director/core-philosophy.md +53 -0
  78. package/framework/.claude/skills/motion-design/director/decision-framework.md +91 -0
  79. package/framework/.claude/skills/motion-design/director/disney-principles.md +102 -0
  80. package/framework/.claude/skills/motion-design/director/emotion-mapping.md +71 -0
  81. package/framework/.claude/skills/motion-design/director/motion-personality.md +89 -0
  82. package/framework/.claude/skills/motion-design/director/narrative-structure.md +62 -0
  83. package/framework/.claude/skills/motion-design/patterns/ambient-continuous.md +81 -0
  84. package/framework/.claude/skills/motion-design/patterns/entrance-exit.md +82 -0
  85. package/framework/.claude/skills/motion-design/patterns/multi-element.md +69 -0
  86. package/framework/.claude/skills/motion-design/patterns/state-feedback.md +96 -0
  87. package/framework/.claude/skills/motion-design/reference/property-selection.md +95 -0
  88. package/framework/.claude/skills/motion-design/reference/quality-checklist.md +67 -0
  89. package/framework/.claude/skills/motion-design/reference/timing-easing-tables.md +106 -0
  90. package/framework/.claude/skills/motion-design/reference/troubleshooting.md +73 -0
  91. package/framework/.claude/skills/new/SKILL.md +1687 -0
  92. package/framework/.claude/skills/playwright-skill/API_REFERENCE.md +652 -0
  93. package/framework/.claude/skills/playwright-skill/SKILL.md +157 -0
  94. package/framework/.claude/skills/playwright-skill/package.json +26 -0
  95. package/framework/.claude/skills/prd/SKILL.md +228 -0
  96. package/framework/.claude/skills/prd/assets/card-template.yml +232 -0
  97. package/framework/.claude/skills/prd/assets/epic-template.yml +190 -0
  98. package/framework/.claude/skills/prd/assets/prd-template.md +230 -0
  99. package/framework/.claude/skills/prd/assets/state-template.md +78 -0
  100. package/framework/.claude/skills/prd/references/api-perf-gate.md +152 -0
  101. package/framework/.claude/skills/prd/references/audit-phase.md +478 -0
  102. package/framework/.claude/skills/prd/references/backlog-phase.md +145 -0
  103. package/framework/.claude/skills/prd/references/discovery-phase.md +359 -0
  104. package/framework/.claude/skills/prd/references/impact-analysis.md +233 -0
  105. package/framework/.claude/skills/prd/references/prd-add-phase.md +214 -0
  106. package/framework/.claude/skills/prd/references/prd-writing-phase.md +145 -0
  107. package/framework/.claude/skills/prd/references/research-phase.md +216 -0
  108. package/framework/.claude/skills/prd/references/ui-design-phase.md +61 -0
  109. package/framework/.claude/skills/prd/references/validation-phase.md +72 -0
  110. package/framework/.claude/skills/prd-add/SKILL.md +222 -0
  111. package/framework/.claude/skills/prd-add/references/impact-analysis.md +233 -0
  112. package/framework/.claude/skills/remotion-best-practices/SKILL.md +48 -0
  113. package/framework/.claude/skills/remotion-best-practices/rules/3d.md +86 -0
  114. package/framework/.claude/skills/remotion-best-practices/rules/animations.md +29 -0
  115. package/framework/.claude/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
  116. package/framework/.claude/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
  117. package/framework/.claude/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
  118. package/framework/.claude/skills/remotion-best-practices/rules/assets.md +78 -0
  119. package/framework/.claude/skills/remotion-best-practices/rules/audio.md +169 -0
  120. package/framework/.claude/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
  121. package/framework/.claude/skills/remotion-best-practices/rules/can-decode.md +75 -0
  122. package/framework/.claude/skills/remotion-best-practices/rules/charts.md +58 -0
  123. package/framework/.claude/skills/remotion-best-practices/rules/compositions.md +141 -0
  124. package/framework/.claude/skills/remotion-best-practices/rules/display-captions.md +184 -0
  125. package/framework/.claude/skills/remotion-best-practices/rules/extract-frames.md +229 -0
  126. package/framework/.claude/skills/remotion-best-practices/rules/fonts.md +152 -0
  127. package/framework/.claude/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
  128. package/framework/.claude/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
  129. package/framework/.claude/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
  130. package/framework/.claude/skills/remotion-best-practices/rules/gifs.md +141 -0
  131. package/framework/.claude/skills/remotion-best-practices/rules/images.md +130 -0
  132. package/framework/.claude/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
  133. package/framework/.claude/skills/remotion-best-practices/rules/light-leaks.md +73 -0
  134. package/framework/.claude/skills/remotion-best-practices/rules/lottie.md +67 -0
  135. package/framework/.claude/skills/remotion-best-practices/rules/maps.md +401 -0
  136. package/framework/.claude/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
  137. package/framework/.claude/skills/remotion-best-practices/rules/measuring-text.md +143 -0
  138. package/framework/.claude/skills/remotion-best-practices/rules/parameters.md +98 -0
  139. package/framework/.claude/skills/remotion-best-practices/rules/sequencing.md +118 -0
  140. package/framework/.claude/skills/remotion-best-practices/rules/subtitles.md +36 -0
  141. package/framework/.claude/skills/remotion-best-practices/rules/tailwind.md +11 -0
  142. package/framework/.claude/skills/remotion-best-practices/rules/text-animations.md +20 -0
  143. package/framework/.claude/skills/remotion-best-practices/rules/timing.md +179 -0
  144. package/framework/.claude/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
  145. package/framework/.claude/skills/remotion-best-practices/rules/transitions.md +197 -0
  146. package/framework/.claude/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
  147. package/framework/.claude/skills/remotion-best-practices/rules/trimming.md +52 -0
  148. package/framework/.claude/skills/remotion-best-practices/rules/videos.md +171 -0
  149. package/framework/.claude/skills/seo-audit/SKILL.md +394 -0
  150. package/framework/.claude/skills/seo-audit/references/aeo-geo-patterns.md +279 -0
  151. package/framework/.claude/skills/seo-audit/references/ai-writing-detection.md +190 -0
  152. package/framework/.claude/skills/simplify/SKILL.md +137 -0
  153. package/framework/.claude/skills/skill-creator/LICENSE.txt +202 -0
  154. package/framework/.claude/skills/skill-creator/SKILL.md +356 -0
  155. package/framework/.claude/skills/skill-creator/references/output-patterns.md +82 -0
  156. package/framework/.claude/skills/skill-creator/references/workflows.md +28 -0
  157. package/framework/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
  158. package/framework/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
  159. package/framework/.claude/skills/skill-creator/scripts/quick_validate.py +95 -0
  160. package/framework/.claude/skills/ui-design/SKILL.md +199 -0
  161. package/framework/.claude/skills/ui-design/references/component-discovery.md +54 -0
  162. package/framework/.claude/skills/ui-design/references/evaluation.md +171 -0
  163. package/framework/.claude/skills/ui-design/references/generation.md +109 -0
  164. package/framework/.claude/skills/ui-design/references/inventory.md +59 -0
  165. package/framework/.claude/skills/webapp-testing/LICENSE.txt +202 -0
  166. package/framework/.claude/skills/webapp-testing/SKILL.md +123 -0
  167. package/framework/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
  168. package/framework/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
  169. package/framework/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
  170. package/framework/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
  171. package/framework/.claude/skills/worktree-manager/SKILL.md +680 -0
  172. package/framework/AGENTS.md +240 -0
  173. package/framework/agents/api-contracts.md +137 -0
  174. package/framework/agents/architecture.md +145 -0
  175. package/framework/agents/coding-standards.md +148 -0
  176. package/framework/agents/data-model.md +110 -0
  177. package/framework/agents/deployment-protocol.md +232 -0
  178. package/framework/agents/design-review.md +172 -0
  179. package/framework/agents/env-reference.md +171 -0
  180. package/framework/agents/github-issue-subagent.md +252 -0
  181. package/framework/agents/index.md +261 -0
  182. package/framework/agents/llm-wiki-methodology.md +216 -0
  183. package/framework/agents/maintenance-protocol.md +305 -0
  184. package/framework/agents/observability.md +162 -0
  185. package/framework/agents/performance.md +155 -0
  186. package/framework/agents/project-context.md +145 -0
  187. package/framework/agents/runbook.md +208 -0
  188. package/framework/agents/security.md +168 -0
  189. package/framework/agents/skills-mapping.md +286 -0
  190. package/framework/agents/testing.md +111 -0
  191. package/framework/agents/workflows.md +215 -0
  192. package/framework/docs/PROJECT-CONFIGURATION.md +336 -0
  193. package/framework/docs/references/brand-guidelines.md +170 -0
  194. package/framework/docs/references/ui-guidelines.template.md +182 -0
  195. package/framework/routines/code-review.routine.yml +46 -0
  196. package/framework/routines/doc-review.routine.yml +45 -0
  197. package/framework/routines/ds-drift.routine.yml +52 -0
  198. package/framework/routines/full-sweep.routine.yml +51 -0
  199. package/framework/routines/index.yml +70 -0
  200. package/framework/routines/skill-improve.routine.yml +50 -0
  201. package/framework/routines/wiki-review.routine.yml +45 -0
  202. package/framework/templates/baldart.config.template.yml +113 -0
  203. package/framework/templates/breaking-change-checklist.md +484 -0
  204. package/framework/templates/feature-card.template.yml +125 -0
  205. package/framework/templates/overlays/README.md +44 -0
  206. package/framework/templates/overlays/copywriting.fidelity-example.md +62 -0
  207. package/framework/templates/overlays/ui-design.fidelity-example.md +75 -0
  208. package/framework/templates/skill-project-context.snippet.md +19 -0
  209. package/framework/templates/spec.template.md +208 -0
  210. package/package.json +51 -0
  211. package/src/commands/add.js +229 -0
  212. package/src/commands/configure.js +385 -0
  213. package/src/commands/doctor.js +486 -0
  214. package/src/commands/migrate.js +185 -0
  215. package/src/commands/push.js +0 -0
  216. package/src/commands/routines.js +269 -0
  217. package/src/commands/status.js +130 -0
  218. package/src/commands/update.js +419 -0
  219. package/src/commands/version.js +88 -0
  220. package/src/utils/contamination.js +400 -0
  221. package/src/utils/git.js +181 -0
  222. package/src/utils/hooks.js +152 -0
  223. package/src/utils/routine-adapters/claude-code-cloud.js +78 -0
  224. package/src/utils/routine-adapters/cron.js +138 -0
  225. package/src/utils/routine-adapters/github-actions.js +141 -0
  226. package/src/utils/routine-adapters/index.js +21 -0
  227. package/src/utils/routines.js +166 -0
  228. package/src/utils/state.js +143 -0
  229. package/src/utils/symlinks.js +425 -0
  230. package/src/utils/ui.js +133 -0
@@ -0,0 +1,190 @@
1
+ # =============================================================================
2
+ # {{FEAT-EPIC-ID}} — Epic: {{Feature Name}}
3
+ # =============================================================================
4
+ #
5
+ # Template for PRD epic cards. Every PRD that produces backlog work creates
6
+ # exactly 1 epic (this file) + N children (using card-template.yml).
7
+ #
8
+ # Filename: backlog/{{FEAT-XXXX-00}}-{{slug}}-epic.yml
9
+ # (suffix `-epic` is mandatory; suffix `-00` is mandatory)
10
+ #
11
+ # The epic is a TRACKER, not implementation work:
12
+ # - NO files_likely_touched pointing to code (only docs allowed)
13
+ # - NO validation_commands, existing_patterns, anti_patterns
14
+ # - NO data_fields, firestore_indexes
15
+ # - NO test_plan with scenarios (test scenarios live on children)
16
+ # - data_sources: [] (always empty)
17
+ #
18
+ # What the epic OWNS:
19
+ # - AC-EPIC roll-up of PRD acceptance criteria
20
+ # - execution_strategy with parallel_groups and file_conflicts
21
+ # - documentation_impact map with owner_card per doc
22
+ # - Strategic business_rationale (full context, not just 2-3 lines)
23
+ # =============================================================================
24
+
25
+ id: {{FEAT-XXXX-00}}
26
+ title: "Epic: {{Feature Name}} — {{short tagline}}"
27
+ status: TODO
28
+ priority: {{HIGH|MEDIUM|LOW}}
29
+ owner_agent: claude
30
+ execution_mode: cloud
31
+
32
+ # Epic's group.parent is the PRD slug (string), NOT a FEAT-ID.
33
+ # This is the only card where parent is a string slug.
34
+ group:
35
+ parent: {{prd-slug}}
36
+ sequence: 0
37
+
38
+ git_strategy:
39
+ branch: "feat/{{FEAT-XXXX-00}}-{{slug}}-epic"
40
+ base: "develop"
41
+ target: "develop"
42
+
43
+ context: |
44
+ Epic tracker per la feature "{{Feature Name}}".
45
+
46
+ {{2-4 paragrafi che descrivono:
47
+ - cosa fa la feature (1 paragrafo)
48
+ - quale stack riusa / cosa introduce di nuovo (1 paragrafo)
49
+ - come è strutturato lo storage / data model ad alto livello (1 paragrafo)
50
+ }}
51
+
52
+ PRD: docs/prd/{{slug}}/PRD.md
53
+ Design: docs/prd/{{slug}}/design.html
54
+ Cards: {{FEAT-XXXX-01}} .. {{FEAT-XXXX-NN}} ({{N}} sub-card, {{K}} livelli di esecuzione)
55
+
56
+ business_rationale: |
57
+ {{Full strategic rationale, 4-6 paragrafi:
58
+ - perché adesso (urgenza/timing)
59
+ - segnale cliente/mercato (con citazioni o dati)
60
+ - impatto atteso (qualitativo + quantitativo dove possibile)
61
+ - allineamento strategico (come si inserisce in roadmap/macro initiative)
62
+ }}
63
+
64
+ scope:
65
+ summary: |
66
+ Coordinamento delle {{N}} sub-card che implementano l'epic:
67
+ {{breve descrizione di ogni sub-card in 1 riga ciascuna}}
68
+ users: [{{CUSTOMER|MERCHANT|SUPER_ADMIN}}]
69
+ value: "{{one-line business value}}"
70
+
71
+ scope_boundaries:
72
+ in_scope:
73
+ - "{{capability 1 — high level, l'epic delega i dettagli ai child}}"
74
+ - "{{capability 2}}"
75
+ out_of_scope:
76
+ - "{{esplicito out-of-scope v1 (deferito a v2 o non in roadmap)}}"
77
+ - "{{altro out-of-scope}}"
78
+
79
+ requirements:
80
+ - >
81
+ Tutte le {{N}} sub-card chiuse con AC verificati e merge in develop.
82
+ - >
83
+ Documentation Impact tutte aggiornate (vedi documentation_impact[] sotto).
84
+ - >
85
+ Test scenarios del PRD §13 eseguiti con esito atteso (ownership: card E2E).
86
+ - >
87
+ {{Altri requirements end-to-end}}
88
+
89
+ # AC-EPIC = roll-up del PRD, NON duplicazione delle AC dei child.
90
+ # Pattern: tracking outcome end-to-end, non singoli step implementativi.
91
+ acceptance_criteria:
92
+ - "[ ] [AC-EPIC-1] Tutte le {{N}} sub-card in stato DONE."
93
+ - "[ ] [AC-EPIC-2] AC-1 .. AC-{{N}} del PRD verificati end-to-end."
94
+ - "[ ] [AC-EPIC-3] {{outcome capability principale verificato — es. 'Auto-translate funzionante: customer ?lang=en vede output tradotto'}}"
95
+ - "[ ] [AC-EPIC-4] {{outcome di sicurezza/perf — es. 'HTML pericoloso strippato server-side'}}"
96
+ - "[ ] [AC-EPIC-5] Entry '{{Feature Name}}' in ${paths.references_dir}/ssot-registry.md."
97
+
98
+ definition_of_done:
99
+ - "Tutte le sub-card DONE e mergiate in develop"
100
+ - "PRD §13 test scenarios eseguiti con esito atteso"
101
+ - "Documentation Impact eseguita (vedi documentation_impact[] sotto)"
102
+ - "{{Altri DoD epic-level}}"
103
+
104
+ # Epic has no dependencies (it's the root) and blocks nothing
105
+ # (children block via their own depends_on).
106
+ depends_on: []
107
+ blocks: []
108
+
109
+ estimated_complexity: {{LOW|MEDIUM|HIGH}}
110
+
111
+ parallel_group: 0
112
+
113
+ # =============================================================================
114
+ # Execution Strategy (auto-computed by prd-card-writer)
115
+ # Consumed by /new orchestrator for parallel runs.
116
+ # =============================================================================
117
+
118
+ execution_strategy:
119
+ total_cards: {{N}}
120
+ recommended_mode: {{team|sequential}}
121
+ groups:
122
+ - level: 0
123
+ cards: [{{FEAT-XXXX-01}}]
124
+ rationale: "{{foundation / first dependency layer}}"
125
+ - level: 1
126
+ cards: [{{FEAT-XXXX-02}}, {{FEAT-XXXX-03}}]
127
+ rationale: "{{parallel after L0}}"
128
+ # ... add levels as needed
129
+ file_conflicts:
130
+ - "{{FEAT-XXXX-N}} e {{FEAT-XXXX-M}} entrambi modificano {{file}} — forzato sequenziale"
131
+ # omit if no conflicts
132
+
133
+ # =============================================================================
134
+ # Canonical Docs (epic-level — children inherit subset)
135
+ # =============================================================================
136
+
137
+ canonical_docs:
138
+ prd_ref: docs/prd/{{slug}}/PRD.md
139
+ design_ref: docs/prd/{{slug}}/design.html
140
+ traceability_ref: docs/prd/{{slug}}/traceability.md
141
+ ssot_registry_entry: "{{Feature Name as registered/to-register in ssot-registry.md}}"
142
+ data_model_refs:
143
+ - ${paths.references_dir}/collections/{{collection}}.md
144
+ - ${paths.references_dir}/data-model.md
145
+ api_refs:
146
+ - ${paths.references_dir}/api/{{module}}.md
147
+ ui_refs:
148
+ - ${paths.design_system}/INDEX.md
149
+ - ${paths.design_system}/components/{{Component}}.md
150
+
151
+ # =============================================================================
152
+ # Documentation Impact (PRD § Documentation Impact)
153
+ # Each entry has an owner_card — the child card responsible for the update.
154
+ # This makes ownership explicit and verifiable post-merge.
155
+ # =============================================================================
156
+
157
+ documentation_impact:
158
+ - file: ${paths.references_dir}/data-model.md
159
+ action: "{{what to add/update}}"
160
+ owner_card: {{FEAT-XXXX-NN}}
161
+ - file: ${paths.references_dir}/collections/{{collection}}.md
162
+ action: "{{schema additions}}"
163
+ owner_card: {{FEAT-XXXX-NN}}
164
+ - file: ${paths.references_dir}/api/{{module}}.md
165
+ action: "{{endpoint extensions}}"
166
+ owner_card: {{FEAT-XXXX-NN}}
167
+ - file: ${paths.design_system}/INDEX.md
168
+ action: "{{component registration}}"
169
+ owner_card: {{FEAT-XXXX-NN}}
170
+ - file: ${paths.references_dir}/ssot-registry.md
171
+ action: "Aggiungi riga '{{Feature Name}}' → docs/prd/{{slug}}/PRD.md"
172
+ owner_card: {{FEAT-XXXX-NN-last}} # tipicamente l'ultima card (E2E o docs-sync)
173
+
174
+ # =============================================================================
175
+ # Epic-only fields below — keep at defaults
176
+ # =============================================================================
177
+
178
+ # No code is touched by the epic itself — only docs (via owner_card chain).
179
+ files_likely_touched: []
180
+
181
+ # Tracker has no implementation, so these are explicit empty.
182
+ data_sources: []
183
+ test_plan:
184
+ e2e_required: false
185
+ e2e_rationale: "Epic tracker — test scenarios live on child cards."
186
+
187
+ assumptions: []
188
+ unknowns: []
189
+ notes:
190
+ - "Epic created via /prd skill. Children: {{FEAT-XXXX-01}} .. {{FEAT-XXXX-NN}}."
@@ -0,0 +1,230 @@
1
+ ---
2
+ doc_type: prd
3
+ domain: {{stable domain label from document-metadata-contract-v1.md}}
4
+ canonicality: canonical
5
+ owner: prd
6
+ status: draft
7
+ freshness_status: fresh
8
+ ---
9
+
10
+ # {{Feature Name}} PRD
11
+
12
+ **Version**: 1.0
13
+ **Owner**: Antonio Baldassarre
14
+ **Date**: {{YYYY-MM-DD}}
15
+ **Status**: Draft
16
+ **Feature ID**: {{FEAT-ID}}
17
+
18
+ ---
19
+
20
+ ## Canonical Sources
21
+
22
+ | Source | Document |
23
+ |--------|----------|
24
+ | Macro feature | {{macro feature name}} |
25
+ | Requirements owner | This PRD |
26
+ | Obsidian spec | {{[[Note Name]] — remove row if no Obsidian note was provided}} |
27
+ | Data model | {{link to ${paths.references_dir}/collections/...}} |
28
+ | API reference | {{link to ${paths.references_dir}/api/...}} |
29
+ | SSOT registry | {{link to ${paths.references_dir}/ssot-registry.md}} |
30
+
31
+ ## Implementation References
32
+
33
+ | Reference | Path | Relevance |
34
+ |-----------|------|-----------|
35
+ | {{name}} | `{{file path}}` | {{why relevant}} |
36
+
37
+ ## Backlog Links
38
+
39
+ Backlog cards to be created after PRD approval.
40
+
41
+ ## Documentation Impact
42
+
43
+ | Document | Action |
44
+ |----------|--------|
45
+ | {{doc path}} | {{what to update}} |
46
+
47
+ ---
48
+
49
+ ## 1. Problem Statement
50
+
51
+ {{Problem description with business impact.}}
52
+
53
+ ### Ratio Strategica
54
+
55
+ #### Perché adesso, perché questo
56
+ {{Quale evento di business, segnale di mercato o priorità strategica rende questa feature necessaria in questo momento.}}
57
+
58
+ #### Segnale cliente / mercato
59
+ {{Feedback specifici dei clienti, dati d'uso, pressione competitiva o trend di mercato che hanno innescato questa iniziativa. Includere dati dove disponibili.}}
60
+
61
+ #### Impatto di business atteso
62
+ {{Risultati misurabili attesi: ricavi, retention, efficienza operativa, riduzione rischio. Quantificare dove possibile.}}
63
+
64
+ #### Allineamento strategico
65
+ {{Come questa feature si inserisce nella visione del prodotto e nelle priorità della roadmap attuale.}}
66
+
67
+ #### Alternative considerate
68
+ | Alternativa | Perché scartata |
69
+ |-------------|-----------------|
70
+ | {{opzione}} | {{motivo}} |
71
+
72
+ ---
73
+
74
+ ## 2. Goals and Non-Goals
75
+
76
+ ### Goals
77
+
78
+ - **G1**: {{goal}}
79
+
80
+ ### Non-Goals
81
+
82
+ - **NG1**: {{non-goal}}
83
+
84
+ ---
85
+
86
+ ## 3. Personas
87
+
88
+ ### {{Persona 1}}
89
+
90
+ {{Description and context.}}
91
+
92
+ ---
93
+
94
+ ## 4. User Stories
95
+
96
+ - **US-1**: As a {{persona}}, I want to {{action}} so that {{benefit}}.
97
+
98
+ ---
99
+
100
+ ## 5. Data Model
101
+
102
+ {{TypeScript interfaces, Firestore schema changes, validation rules.}}
103
+
104
+ ### Firestore Composite Indexes
105
+
106
+ Every query that combines `where()` on one field with `orderBy()` on a different field,
107
+ or multiple `where()` on different fields, REQUIRES a composite index. Missing indexes
108
+ cause runtime `FAILED_PRECONDITION` errors (500s in production).
109
+
110
+ | # | Collection | Fields | Order | Query Location | Status |
111
+ |---|-----------|--------|-------|----------------|--------|
112
+ | IDX-1 | `{{collection}}` | `{{field1}}` ASC, `{{field2}}` DESC | {{ASC/DESC}} | `{{file:function}}` | NEW / EXISTS |
113
+
114
+ **Rules:**
115
+ - Every API endpoint or server action that reads from Firestore with compound queries MUST have its indexes listed here.
116
+ - The `firestore.indexes.json` file MUST be updated in the same commit as the query code.
117
+ - If no compound queries are needed: state "Nessun indice composito richiesto — tutte le query usano un singolo campo."
118
+
119
+ ---
120
+
121
+ ## 6. API Contract Changes
122
+
123
+ {{Endpoints, request/response formats, validation.}}
124
+
125
+ ---
126
+
127
+ ## 7. UI Specifications
128
+
129
+ {{Layout, components, styling, responsive behavior, a11y.}}
130
+
131
+ ---
132
+
133
+ ## 8. i18n Specification
134
+
135
+ {{Dictionary keys, locale files, provider patterns.}}
136
+
137
+ ---
138
+
139
+ ## 9. Acceptance Criteria
140
+
141
+ ### {{Area}}
142
+
143
+ - **AC-1**: {{testable criterion}}
144
+
145
+ ---
146
+
147
+ ## 10. Edge Cases and Failure Modes
148
+
149
+ | Scenario | Expected Behavior |
150
+ |----------|-------------------|
151
+ | {{scenario}} | {{behavior}} |
152
+
153
+ ---
154
+
155
+ ## 11. Out of Scope
156
+
157
+ 1. {{excluded item}}
158
+
159
+ ---
160
+
161
+ ## 12. Dependencies
162
+
163
+ | Dependency | Type | Status |
164
+ |------------|------|--------|
165
+ | {{dependency}} | {{type}} | {{status}} |
166
+
167
+ ---
168
+
169
+ ## 13. Test Plan
170
+
171
+ ### E2E Evaluation
172
+
173
+ | Criterion | Result |
174
+ |-----------|--------|
175
+ | Has UI impact? | {{yes/no}} |
176
+ | Multi-step flow? | {{yes/no}} |
177
+ | Critical path? (auth/payment/booking) | {{yes/no}} |
178
+ | UI acceptance criteria count | {{N}} |
179
+ | **Verdict** | **{{NOT NEEDED / RECOMMENDED / REQUIRED}}** |
180
+ | Rationale | {{reason}} |
181
+
182
+ ### Test Scenarios
183
+
184
+ {{If E2E NOT NEEDED: "Nessun test E2E pianificato — [rationale]"}}
185
+
186
+ {{If E2E REQUIRED or RECOMMENDED:}}
187
+
188
+ | # | Scenario | User Story | Acceptance Criteria | Priority |
189
+ |---|----------|------------|---------------------|----------|
190
+ | TS-1 | {{scenario description}} | US-{{N}} | AC-{{N}} | {{HIGH/MEDIUM}} |
191
+
192
+ ### Test Credentials
193
+
194
+ | Persona | Auth Method | Credentials | Notes |
195
+ |---------|------------|-------------|-------|
196
+ | {{Consumer}} | OTP | phone: 3486417303 | OTP inserito manualmente dall'utente durante il test |
197
+ | {{Merchant}} | password | {{username}} / {{password}} | Store: {{store name}} |
198
+
199
+ ### Test Data Prerequisites
200
+
201
+ {{Any data that must exist in Firestore before tests can run (e.g., active promos, store config, existing reservations).}}
202
+
203
+ ---
204
+
205
+ ## 14. Pipeline Touchpoints (Implementation Summary)
206
+
207
+ | Step | File | Change |
208
+ |------|------|--------|
209
+ | 1 | `{{file}}` | {{change}} |
210
+
211
+ ---
212
+
213
+ ## 15. Integration Surface Map (ISA)
214
+
215
+ Existing code that must reference, link to, or interact with this feature.
216
+ Every ISA entry MUST be covered by at least one backlog card.
217
+
218
+ | # | Category | Existing File | Action Required | Risk if Omitted | Card |
219
+ |---|----------|--------------|-----------------|-----------------|------|
220
+ | ISA-1 | {{NAVIGATION / PERMISSIONS / SETTINGS / SEARCH / NOTIFICATIONS / DASHBOARD / API_CONSUMERS / SHARED_STATE}} | `{{file path}}` | {{what to do}} | {{consequence}} | {{FEAT-ID or TBD}} |
221
+
222
+ **Risk summary:** HIGH: {{N}} | MEDIUM: {{N}} | LOW: {{N}}
223
+
224
+ ### ISA Traceability Matrix
225
+
226
+ | ISA # | Touchpoint | Card(s) | Status |
227
+ |-------|-----------|---------|--------|
228
+ | ISA-1 | {{touchpoint}} | {{FEAT-ID}} | Covered / Missing |
229
+
230
+ **Every ISA entry MUST map to at least one card. Missing entries = incomplete plan.**
@@ -0,0 +1,78 @@
1
+ # PRD Session: {{slug}}
2
+ Created: {{YYYY-MM-DD HH:MM}}
3
+ Status: discovery
4
+
5
+ ## Feature Description
6
+ {{user's description verbatim}}
7
+
8
+ ## Business Rationale
9
+
10
+ ### Perché adesso, perché questo
11
+ (pending)
12
+
13
+ ### Segnale cliente / mercato
14
+ (pending)
15
+
16
+ ### Impatto di business atteso
17
+ (pending)
18
+
19
+ ### Allineamento strategico
20
+ (pending)
21
+
22
+ ### Alternative considerate
23
+ (pending)
24
+
25
+ ## Comprehension Checklist
26
+ | Dimension | Status | Source | Detail |
27
+ |---|---|---|---|
28
+ | Business rationale | - | | |
29
+ | Target users | - | | |
30
+ | User journey | - | | |
31
+ | Data model impact | - | | |
32
+ | API impact | - | | |
33
+ | UI impact | - | | |
34
+ | Permissions/roles | - | | |
35
+ | Edge cases | - | | |
36
+ | Rollout/migration | - | | |
37
+ | Integration surface | - | | |
38
+ | Test strategy | - | | |
39
+
40
+ Comprehension: 0% (0/11)
41
+
42
+ ## Discovery Log
43
+
44
+ ## Research
45
+
46
+ Confidence: pending
47
+ Signals: pending
48
+ Status: pending
49
+ Topics: pending
50
+
51
+ ## Research Findings
52
+
53
+ ## Research-Driven Discovery
54
+
55
+ ## Integration Surface Map
56
+
57
+ | # | Category | Existing File | Action Required | Risk | Card |
58
+ |---|----------|--------------|-----------------|------|------|
59
+
60
+ ## Test Plan
61
+
62
+ E2E evaluation: pending
63
+ E2E needed: pending
64
+ Persona: pending
65
+ Credentials: pending
66
+ Scenarios: pending
67
+
68
+ ## UI Design
69
+
70
+ ## Confirmed Specs
71
+
72
+ ## Backlog Cards
73
+
74
+ ## Change Requests
75
+
76
+ <!-- Populated by /prd-add when scope expansion is detected -->
77
+
78
+ ## Validation
@@ -0,0 +1,152 @@
1
+ # API Performance Gate (Step 4.5)
2
+
3
+ **Precondition:** PRD written (Step 4 complete), not yet presented to user.
4
+
5
+ This gate audits the PRD for performance bottlenecks and cost inefficiencies
6
+ **before** the user sees it, so findings are integrated into the spec — not
7
+ flagged after implementation.
8
+
9
+ ---
10
+
11
+ ## When to Run
12
+
13
+ **Gate 5 (Text Scan) runs ALWAYS** on every PRD. It is a fast keyword match.
14
+
15
+ **Gates 1-4 run ONLY** when Gate 5 finds matches OR the PRD contains any of:
16
+ - `## API contract changes` section with endpoints
17
+ - `## Data model` section with new Firestore collections/fields
18
+ - Server Actions with Firestore writes
19
+ - Background jobs, cron, batch operations
20
+
21
+ If none of the above: log `API Performance Gate: N/A — no API/data surface` in
22
+ state file and skip to "Present and Confirm".
23
+
24
+ ---
25
+
26
+ ## The 5-Gate Protocol
27
+
28
+ ### Gate 5 — Text Scan (ALWAYS RUNS FIRST)
29
+
30
+ Scan the PRD text for these keywords. Each match = a finding.
31
+
32
+ | Keyword Pattern | Problem | Severity |
33
+ |-----------------|---------|----------|
34
+ | "show all" / "list all" / "fetch all" / "mostra tutti" | Unbounded read — no pagination | CRITICAL |
35
+ | "for each X" + "get/read Y" / "per ogni X" + "leggi Y" | N+1 query pattern | CRITICAL |
36
+ | "notify all" / "update all" / "notifica tutti" | Fan-out write | HIGH |
37
+ | "live" / "real-time" / "tempo reale" / "auto-update" | Listener cost (1 read/doc at attach + 1/change) | HIGH |
38
+ | "global counter" / "total X" / "increment count" / "contatore" | Transaction hotspot (serializes writers) | HIGH |
39
+ | "no limit" / "unlimited" / "senza limiti" / "illimitato" | Unbounded data growth | HIGH |
40
+ | "save all in document" / "embed list" / "array nel documento" | Unbounded array in doc (max 1MB, degrades at 40K) | HIGH |
41
+ | "upload file/image via API" / "carica file" | 4.5MB payload limit on Vercel Functions | HIGH |
42
+ | "auto-increment ID" / "sequential ID" / "ID sequenziale" | Firestore hotspot | HIGH |
43
+ | "search by name" / "full-text search" / "cerca per nome" | Firestore cannot do full-text search | HIGH |
44
+ | "page N" / "skip" / "offset" / "pagina N" | Offset pagination (charges for ALL skipped docs) | MEDIUM |
45
+ | "send email/SMS" in request path / "invia email/SMS" | Blocking I/O in request path (use waitUntil) | MEDIUM |
46
+ | "filter by A and B and C" / "filtra per A e B e C" | Composite index explosion | MEDIUM |
47
+ | "import CSV" / "bulk insert" / "importa CSV" | Batch 500-doc limit per write | MEDIUM |
48
+
49
+ **If 0 matches AND no API/data sections**: skip Gates 1-4, proceed to present.
50
+ **If any match**: continue to Gates 1-4.
51
+
52
+ ### Gate 1 — Data Model Review
53
+
54
+ Check the PRD `## Data model` section for:
55
+
56
+ - [ ] **Unbounded arrays**: any array field that can grow without limit → CRITICAL
57
+ - [ ] **Document size**: will any document exceed ~100KB regularly? → HIGH
58
+ - [ ] **Sequential/predictable IDs**: custom IDs based on timestamp or counter → HIGH (Firestore hotspot, use auto-ID)
59
+ - [ ] **Fan-out writes**: one user action writing to N documents where N scales with users/data → HIGH
60
+ - [ ] **Global counters**: fields incremented by many concurrent writers → HIGH (transaction serialization)
61
+ - [ ] **Real-time listeners**: justified? Can polling or ISR replace them? → HIGH (1 read/matched doc at attach)
62
+ - [ ] **Denormalization strategy**: read-heavy paths should denormalize; write-heavy should normalize → MEDIUM
63
+ - [ ] **Index exemptions**: large text/description fields should exempt from indexing → MEDIUM (N+1 index writes per doc write)
64
+
65
+ ### Gate 2 — Query & Index Review
66
+
67
+ Check the PRD `## API contract changes` and data access patterns for:
68
+
69
+ - [ ] **Pagination on all list endpoints**: every endpoint returning multiple docs MUST specify cursor-based pagination (startAfter), never offset → CRITICAL
70
+ - [ ] **N+1 queries**: "get parent, then for each child get details" pattern → CRITICAL (use collectionGroup or denormalize)
71
+ - [ ] **Composite index specification**: every query combining `where()` + `orderBy()` on different fields, or multiple `where()` on different fields, MUST have an explicit entry in the PRD's `### Firestore Composite Indexes` table (Section 5). Missing index = runtime FAILED_PRECONDITION (500 in production) → **CRITICAL**
72
+ - [ ] **Composite index count**: >3 inequality filters on different fields = index explosion → MEDIUM
73
+ - [ ] **orderBy + inequality on different fields**: requires composite index, max 1 inequality per query. Verify the PRD index table includes the correct field order (the inequality field MUST be last in the index definition) → **HIGH**
74
+ - [ ] **Full-text search**: Firestore doesn't support it natively; require Algolia/Typesense or array-contains workaround → HIGH
75
+ - [ ] **Index table completeness**: if the PRD has API endpoints that read from Firestore but Section 5 has no `### Firestore Composite Indexes` table (or says "nessun indice"), verify this is actually correct by checking each query pattern. Missing the table when compound queries exist → **CRITICAL**
76
+
77
+ ### Gate 3 — Serverless Architecture Review
78
+
79
+ Check endpoint design and background processing for:
80
+
81
+ - [ ] **Payload size**: any endpoint accepting/returning >4.5MB → CRITICAL (use signed URL pattern for uploads)
82
+ - [ ] **Sync vs async**: long operations (email, PDF, image processing) in request path → HIGH (use waitUntil or background job)
83
+ - [ ] **Function duration**: operations that may exceed 300s → HIGH (split into steps or use queue)
84
+ - [ ] **CPU-intensive ops**: image resize, PDF gen, heavy computation in serverless → MEDIUM (consider dedicated worker)
85
+ - [ ] **GET Route Handler caching**: new GET endpoints MUST specify `revalidate` or `use cache` — dynamic by default since Next.js 15 → HIGH
86
+
87
+ ### Gate 4 — Caching Strategy Review
88
+
89
+ Check data display and freshness requirements for:
90
+
91
+ - [ ] **Freshness requirement defined**: every read endpoint should specify acceptable staleness → HIGH
92
+ - [ ] **Per-user vs shared data**: shared data (menu, store info) should use ISR/cache; per-user data (orders, profile) stays dynamic → MEDIUM
93
+ - [ ] **Cache invalidation plan**: if using cache, how is it invalidated on writes? revalidateTag? revalidatePath? → MEDIUM
94
+ - [ ] **Redundant reads**: same data fetched in multiple components without dedup → MEDIUM (use React.cache for single-request dedup)
95
+
96
+ ---
97
+
98
+ ## Severity Actions
99
+
100
+ | Severity | Action |
101
+ |----------|--------|
102
+ | CRITICAL | MUST fix in PRD before presenting to user. Add/modify NFR, add edge case, change API design. |
103
+ | HIGH | MUST add as NFR or documented design decision in PRD. User sees it in the spec. |
104
+ | MEDIUM | Add to `Edge cases and failure modes` table in PRD as advisory. |
105
+ | LOW | Log in state file only. No PRD change. |
106
+
107
+ ---
108
+
109
+ ## Execution Procedure
110
+
111
+ 1. Run Gate 5 on the full PRD text.
112
+ 2. If matches found OR API/data sections present → run Gates 1-4.
113
+ 3. For each finding:
114
+ - CRITICAL/HIGH: edit the PRD directly (add NFR, modify API contract, add edge case).
115
+ - MEDIUM: add to edge cases table.
116
+ - LOW: note in state file.
117
+ 4. Update state file: `## API Performance Gate` section with findings count and actions taken.
118
+ 5. If any CRITICAL findings were resolved, add a `### Performance-Informed Decisions` subsection
119
+ to the PRD listing what was changed and why.
120
+ 6. Proceed to "Present and Confirm" — the user sees an already-optimized PRD.
121
+
122
+ ---
123
+
124
+ ## Reference Data
125
+
126
+ ### Firestore Pricing (Blaze Plan)
127
+ - Reads: $0.06 / 100K
128
+ - Writes: $0.18 / 100K
129
+ - Deletes: $0.02 / 100K
130
+ - Offset pagination charges for ALL skipped docs
131
+ - Index writes: N+1 per document (1 doc + N indexed fields)
132
+ - Listener: 1 read/matched doc at attach + 1 per change
133
+
134
+ ### Vercel Fluid Compute
135
+ - Payload limit: 4.5 MB request/response
136
+ - Active CPU pricing: pauses during I/O
137
+ - Max duration: 300s (Hobby) / 800s (Pro)
138
+ - File descriptor limit: 1,024 shared
139
+ - Cold start: archived after 2 weeks (prod) / 48h (preview)
140
+
141
+ ### Next.js App Router
142
+ - GET Route Handlers: DYNAMIC by default since v15 (must opt-in to caching)
143
+ - `use cache` in serverless: in-memory LRU, not persisted across cold starts
144
+ - `React.cache()`: single-request dedup only
145
+ - Sequential `await` = waterfall; use `Promise.all()` for independent fetches
146
+
147
+ ### When to Skip
148
+
149
+ - Hotfix cards (single-line bug fixes): Gate 5 only
150
+ - Purely frontend cards (no API/Firestore): skip entirely
151
+ - Documentation-only: skip entirely
152
+ - Prototype/spike (throw-away): skip entirely