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,72 @@
1
+ # Validation & Commit Phase (Steps 6-7)
2
+
3
+ ## Step 6 — Quality Audit
4
+
5
+ **Precondition:** Backlog cards approved.
6
+
7
+ Mark task 5 as `in_progress`.
8
+
9
+ 1. **Field Name Audit (runs BEFORE audit agents)** — for each generated card:
10
+
11
+ a. Verify every `data_fields` entry has `ts_verified: true` OR `status: new` with `schema_ref`.
12
+ b. For cards with `estimated_complexity: HIGH` or `MEDIUM`:
13
+ - For each `status: existing` field: run `grep -n "fieldName" src/types/<domain>.ts`
14
+ and verify ≥1 match. 0 matches = **BLOCKER** — correct or mark as `🆕 new`.
15
+ - For each `status: new` field: PRD `## Schema Verification` must have complete
16
+ definition (type, nullable, default, indexing notes).
17
+ c. For cards with `estimated_complexity: LOW`:
18
+ - Verify only that `data_fields` has `ts_verified: true` or `status: new`. No grep needed.
19
+ d. If card has `firestore_indexes` but NO `data_fields`: log warning —
20
+ "card touches Firestore (firestore_indexes present) but missing data_fields block."
21
+
22
+ **Gate**: no field with `status: existing | modified` and `ts_verified: false` can proceed.
23
+
24
+ 2. Read the audit phase reference: [audit-phase.md](audit-phase.md)
25
+ Then execute the audit protocol described within, using the card IDs from Step 5.
26
+ The protocol auto-detects which agents to include (security and performance
27
+ are signal-triggered, no manual profile selection needed).
28
+ 3. Wait for audit report and card edits.
29
+
30
+ **Gate:** all HIGH/MEDIUM findings resolved, no open `[MANUAL]` items.
31
+
32
+ ## Step 7 — Resolution and Commit
33
+
34
+ **Precondition:** Step 6 complete.
35
+
36
+ ### Resolve remaining items
37
+
38
+ 1. If `[MANUAL]` items remain: resolve each one.
39
+ 2. If resolution required card re-edits: re-run the audit protocol (audit-phase.md) on affected cards.
40
+
41
+ ### Update knowledge base
42
+
43
+ 3. Add/update entry in `${paths.references_dir}/ssot-registry.md` pointing to the new PRD
44
+ as canonical source for this macro feature.
45
+ 4. Update `${paths.references_dir}/project-status.md` Active Code Context with PRD completion.
46
+
47
+ ### Commit
48
+
49
+ 5. Stage ONLY PRD session artifacts (explicit file names, never `git add .`):
50
+ - `${paths.prd_dir}/sessions/YYYY-MM-DD-<slug>-state.md`
51
+ - `docs/prd/<slug>/PRD.md`
52
+ - `docs/prd/<slug>/design.html` (if exists)
53
+ - `backlog/FEAT-XXXX-*.yml` (all cards created in Step 5)
54
+ - `${paths.references_dir}/ssot-registry.md` (if updated)
55
+ - `${paths.references_dir}/project-status.md` (if updated)
56
+ 6. Update state file: status -> `completed`, add commit hash to `## Validation`.
57
+ 7. Commit with format: `[PRD] <slug>: <brief description>`
58
+
59
+ **Gate:** commit successful, state file shows `completed`.
60
+
61
+ Mark task 5 as `completed`.
62
+
63
+ ### Final output
64
+
65
+ Print final summary:
66
+
67
+ - PRD path
68
+ - Design path (if applicable)
69
+ - Card IDs created
70
+ - Commit hash
71
+
72
+ Display completed Progress Bar.
@@ -0,0 +1,222 @@
1
+ ---
2
+ name: prd-add
3
+ description: "Change Request skill for active PRD sessions. Use when the user says /prd-add, 'aggiungi requisito', 'serve anche', 'manca un endpoint', or describes a new requirement that impacts an existing PRD. Also auto-triggered by /prd during discovery when the user's answer reveals a new sub-feature not covered by the original scope. Runs ICIAS impact analysis (semantic scan + structural propagation + scoring) to determine which PRD phases need SKIP/PATCH/REDO, then executes only affected phases."
4
+ ---
5
+
6
+ # /prd-add — Change Request per PRD attivi
7
+
8
+ Add a new requirement to an existing PRD session. Uses the ICIAS protocol
9
+ (Impact-Confidence-Artifact Stakes) to determine which phases and artifacts
10
+ need revision, then executes only the affected ones.
11
+
12
+ ## Project Context
13
+
14
+ **Reads from `baldart.config.yml`:** `paths.prd_dir`, `paths.design_system`.
15
+ **Gated by features:** `features.has_prd_workflow` (REFUSES to run when `false`), `features.has_design_system` (Rule 9 BLOCKING when `true`).
16
+ **Overlay:** loads `.baldart/overlays/prd-add.md` if present — and inherits the prd overlay's terminology + design-system reads (since prd-add operates on /prd's artifacts).
17
+ **On missing/empty keys:** ask the user; do not assume defaults. See `framework/agents/project-context.md` § 3.
18
+
19
+ ---
20
+
21
+ ## TRIGGER MODES
22
+
23
+ ### 1. Manual invocation
24
+ User types `/prd-add <description>` or `/prd-add` (then describes the change).
25
+
26
+ ### 2. Auto-trigger from /prd discovery
27
+ During `/prd` Step 2 (Discovery Question Loop), if the user's answer reveals
28
+ a new sub-feature or structural requirement NOT covered by the original feature
29
+ description, the `/prd` skill invokes `/prd-add` automatically.
30
+
31
+ Detection signal: the user's answer introduces NEW entities (endpoints, collections,
32
+ pages, roles, flows) that were not part of the original feature scope.
33
+
34
+ ---
35
+
36
+ ## EXECUTION MODEL
37
+
38
+ Sequential, single-turn analysis + selective multi-turn re-execution.
39
+
40
+ | Step | Phase | Description |
41
+ |------|-------|-------------|
42
+ | 0 | Session Locate | Find active PRD state file |
43
+ | 1 | Intake | Capture and classify change request |
44
+ | 2 | Impact Analysis | ICIAS protocol (3 phases) |
45
+ | 3 | Verdict | Present impact matrix, ask confirmation |
46
+ | 4 | Selective Execution | Re-run only PATCH/REDO phases |
47
+ | 5 | Delta Commit | Commit changes with `[PRD-ADD]` prefix |
48
+
49
+ ---
50
+
51
+ ## HARD RULES
52
+
53
+ 1. NEVER start from scratch. Always build on the existing PRD session.
54
+ 2. Read the state file and PRD before any analysis.
55
+ 3. Follow ICIAS protocol exactly — read [impact-analysis.md](references/impact-analysis.md).
56
+ 4. Present verdict BEFORE executing changes. Wait for user confirmation.
57
+ 5. When re-running phases, follow the SAME reference files as `/prd` (discovery-phase.md, etc.).
58
+ 6. Update the state file with a `## Change Requests` section tracking all CR history.
59
+ 7. Commit with format: `[PRD-ADD] <slug>: <brief CR description>`
60
+ 8. **Every message MUST end with the CR Progress Bar.**
61
+ 9. **Design System SSOT re-validation (UI-touching CRs).** When `features.has_design_system: true` AND the change request introduces, modifies, or removes any UI surface (new page, component, layout, flow, or visual state), you MUST re-validate against `${paths.design_system}/INDEX.md` (component index + authority matrix + Quick rules MUST). The ICIAS impact analysis MUST include design-system scope as a dimension: check whether affected UI maps to existing components in `${paths.design_system}/components/<Name>.md` (PATCH = reuse existing) or introduces a new pattern (REDO = propose new component doc and route through DS ownership). When `features.multi_tenant_theming: true`, themed surfaces MUST be re-checked against the project's theming pattern doc; motion changes MUST reference the project's motion pattern doc (both listed in `.baldart/overlays/prd.md`). Cite consulted DS docs in the updated PRD's Canonical Sources section.
62
+
63
+ ---
64
+
65
+ ## Step 0 — Session Locate
66
+
67
+ 1. List `${paths.prd_dir}/sessions/` for state files.
68
+ 2. If exactly ONE active session (status != `completed`): use it.
69
+ 3. If multiple active sessions: ask user which one.
70
+ 4. If zero sessions: inform user, suggest `/prd` instead.
71
+ 5. Read the state file AND the PRD document (if exists).
72
+
73
+ ---
74
+
75
+ ## Step 1 — Intake
76
+
77
+ 1. If change description provided as argument: use it.
78
+ 2. If not: ask the user to describe the change.
79
+
80
+ **Classify the change type** (from CIA literature):
81
+ - **Addition**: new entity (endpoint, collection, page, role, flow)
82
+ - **Modification**: change to existing entity (new field, changed behavior)
83
+ - **Deletion**: removal of planned entity
84
+
85
+ Record in state file under `## Change Requests`:
86
+
87
+ ```markdown
88
+ ### CR-N: <title>
89
+ - Type: Addition | Modification | Deletion
90
+ - Description: <user's description verbatim>
91
+ - Date: YYYY-MM-DD
92
+ - Status: analyzing
93
+ ```
94
+
95
+ **Immediately proceed to Step 2.**
96
+
97
+ ---
98
+
99
+ ## Step 2 — Impact Analysis (ICIAS Protocol)
100
+
101
+ **Read [references/impact-analysis.md](references/impact-analysis.md) for the full protocol.**
102
+
103
+ Quick summary — 3 phases executed in sequence:
104
+
105
+ ### Phase 1: Semantic Scan
106
+ Evaluate each of the 10 dimensions against the change request.
107
+ For each dimension, assign an initial impact assessment (0=none, 1-3=depth).
108
+
109
+ ### Phase 2: Structural Propagation
110
+ Apply the coupling matrix to find transitive impacts.
111
+ Max 2 hops, confidence degrades per hop.
112
+
113
+ ### Phase 3: ICIAS Scoring
114
+ For each impacted dimension: `Score = I x C x A`
115
+ - I = Impact depth (1=cosmetic, 2=logic, 3=structural)
116
+ - C = Confidence (1=inferred, 2=probable, 3=certain)
117
+ - A = Artifact Stakes (pre-assigned per dimension)
118
+
119
+ Classify: **SKIP** (score <= 3), **PATCH** (4-9), **REDO** (>= 10)
120
+
121
+ ---
122
+
123
+ ## Step 3 — Verdict
124
+
125
+ Present the impact matrix to the user:
126
+
127
+ ```
128
+ ### Impact Analysis — CR-N: <title>
129
+
130
+ | # | Dimension | Direct | Cascade | I | C | A | Score | Verdict |
131
+ |---|-----------|--------|---------|---|---|---|-------|---------|
132
+ | D1 | Target users | - | - | 0 | - | 1 | 0 | SKIP |
133
+ | D2 | User journey | yes | - | 2 | 3 | 2 | 12 | REDO |
134
+ | D3 | Data model | - | D4->D3 | 1 | 2 | 3 | 6 | PATCH |
135
+ | ... | ... | ... | ... | ... | ... | ... | ... | ... |
136
+
137
+ **Fasi da rieseguire:**
138
+ - Discovery: PATCH (D2, D4 da aggiornare)
139
+ - UI Design: REDO (nuovo flow)
140
+ - PRD: PATCH (sezioni 4, 6, 9)
141
+ - Backlog Cards: PATCH (nuove cards + update esistenti)
142
+
143
+ Vuoi procedere con questa analisi?
144
+ ```
145
+
146
+ **STOP.** Wait for user confirmation.
147
+
148
+ If user disagrees with any verdict, adjust manually and re-present.
149
+
150
+ ---
151
+
152
+ ## Step 4 — Selective Execution
153
+
154
+ Execute ONLY phases with PATCH or REDO verdict, in original phase order.
155
+
156
+ ### For Discovery dimensions (PATCH/REDO)
157
+
158
+ - **PATCH**: Run `codebase-architect` on affected dimensions only.
159
+ Update state file checklist entries. No user questions unless ambiguous.
160
+ - **REDO**: Full re-discovery for that dimension (same as /prd Step 2 loop
161
+ but scoped to affected dimensions only). May require user questions.
162
+
163
+ ### For UI Design (PATCH/REDO)
164
+
165
+ - **PATCH**: Describe changes needed to existing design.html. Ask user
166
+ if they want a full design refresh or text-only update to PRD.
167
+ - **REDO**: Re-run full UI Design phase (Steps 3a-3d from /prd).
168
+
169
+ ### For PRD (PATCH/REDO)
170
+
171
+ - **PATCH**: Edit specific PRD sections. Add/modify user stories, API
172
+ contracts, data model, acceptance criteria as needed. Preserve
173
+ unchanged sections verbatim.
174
+ - **REDO**: Rewrite major PRD sections (rare — only when change
175
+ fundamentally alters the feature).
176
+
177
+ ### For Backlog Cards (PATCH/REDO)
178
+
179
+ - **PATCH**: Create new cards for new work. Update `depends_on` in
180
+ existing cards if dependencies changed. Do NOT rewrite existing cards
181
+ unless acceptance criteria changed.
182
+ - **REDO**: Regenerate affected cards via `prd-card-writer` agent.
183
+ Preserve cards that are unaffected.
184
+
185
+ ### For ISA (always re-scan if any PATCH/REDO exists)
186
+
187
+ Run a delta ISA scan focused on the new requirement. Merge new
188
+ touchpoints into existing ISA table. Assign new ISA-N IDs.
189
+
190
+ ---
191
+
192
+ ## Step 5 — Delta Commit
193
+
194
+ 1. Update state file:
195
+ - CR status: `applied`
196
+ - Update comprehension checklist with changes
197
+ - Update `## Change Requests` with summary of what was done
198
+ 2. Re-run API Performance Gate (Step 4.5) if API/data model changed.
199
+ 3. Stage ONLY modified files (explicit names).
200
+ 4. Commit: `[PRD-ADD] <slug>: <CR description>`
201
+
202
+ ---
203
+
204
+ ## CR PROGRESS BAR — MANDATORY ON EVERY MESSAGE
205
+
206
+ ```
207
+ ---
208
+ 🔄 **Change Request: <slug> — CR-N**
209
+
210
+ | # | Fase | Verdict | Stato |
211
+ |---|------|---------|-------|
212
+ | 1 | Intake | - | ⬜/✅ |
213
+ | 2 | Impact Analysis | - | ⬜/🔄/✅ |
214
+ | 3 | Verdict & conferma | - | ⬜/🔄/✅ |
215
+ | 4a | Discovery (delta) | SKIP/PATCH/REDO | ⬜/🔄/✅/⏭️ |
216
+ | 4b | UI Design (delta) | SKIP/PATCH/REDO | ⬜/🔄/✅/⏭️ |
217
+ | 4c | PRD (delta) | SKIP/PATCH/REDO | ⬜/🔄/✅/⏭️ |
218
+ | 4d | Backlog Cards (delta) | SKIP/PATCH/REDO | ⬜/🔄/✅/⏭️ |
219
+ | 5 | Delta Commit | - | ⬜/✅ |
220
+
221
+ Prossimo passo: <what happens next>
222
+ ```
@@ -0,0 +1,233 @@
1
+ # ICIAS Impact Analysis Protocol
2
+
3
+ Full protocol for Change Impact Analysis on PRD sessions.
4
+ Based on ProReFiCIA (Etezadi et al. 2025), CodePlan (Bairi et al. 2023),
5
+ and FMEA-adapted scoring.
6
+
7
+ ---
8
+
9
+ ## Phase 1 — Semantic Scan
10
+
11
+ Evaluate each dimension against the change request description.
12
+
13
+ ### Procedure
14
+
15
+ For each of the 10 dimensions, determine:
16
+ - **Is there a direct impact?** (yes/no)
17
+ - **Impact depth** (I):
18
+ - 0 = no impact
19
+ - 1 = cosmetic (labels, copy, minor display)
20
+ - 2 = logic (new conditions, validation, flow branches)
21
+ - 3 = structural (new entities, schemas, endpoints, pages)
22
+
23
+ ### Refinement pass (mandatory)
24
+
25
+ After initial scan, re-read the change request and check dimensions 4-7
26
+ again (the "middle" of the list — LLMs tend to under-evaluate items in
27
+ the middle of lists, per "lost-in-the-middle" research). Adjust any
28
+ dimension that was initially scored 0 but deserves >= 1 on second look.
29
+
30
+ ---
31
+
32
+ ## Phase 2 — Structural Propagation (Coupling Matrix)
33
+
34
+ Apply the coupling matrix to find transitive (cascade) impacts.
35
+
36
+ ### Rules
37
+
38
+ 1. Start from all dimensions with direct impact (I > 0 from Phase 1).
39
+ 2. For each directly impacted dimension, check outgoing edges in the matrix.
40
+ 3. If edge strength >= 2 AND target dimension has I = 0: mark as cascade impact.
41
+ - Cascade I = max(1, source_I - 1) (degrades by hop)
42
+ - Cascade C = source_C - 1 (min 1) (confidence degrades)
43
+ 4. Max hop depth = 2. Do NOT propagate beyond 2 hops.
44
+ 5. If a dimension is reached by both direct and cascade: use direct (higher confidence).
45
+
46
+ ### Coupling Matrix (10x10)
47
+
48
+ Rows = source dimension, Columns = target dimension.
49
+ Values: 0 = independent, 1 = weak, 2 = moderate, 3 = strong (almost always co-impacted).
50
+
51
+ ```
52
+ D1 D2 D3 D4 D5 D6 D7 D8 D9 D10
53
+ D1 U - 1 0 0 1 1 0 0 0 0
54
+ D2 J 0 - 1 1 3 0 2 0 1 1
55
+ D3 DM 0 0 - 3 0 0 1 3 1 2
56
+ D4 API 0 1 3 - 1 1 1 0 3 3
57
+ D5 UI 0 2 0 0 - 0 1 0 1 2
58
+ D6 P 0 0 0 1 1 - 1 0 1 3
59
+ D7 EC 0 0 0 0 0 0 - 0 0 1
60
+ D8 RM 0 0 1 0 0 0 1 - 0 1
61
+ D9 IS 0 0 0 1 0 0 0 0 - 1
62
+ D10 TS 0 0 0 0 0 0 0 0 0 -
63
+ ```
64
+
65
+ **Key:**
66
+ - D1=Users, D2=Journey, D3=Data Model, D4=API, D5=UI
67
+ - D6=Permissions, D7=Edge Cases, D8=Rollout/Migration
68
+ - D9=Integration Surface, D10=Test Strategy
69
+
70
+ ### High-coupling pairs (strength=3, rationale)
71
+
72
+ | Source → Target | Why |
73
+ |-----------------|-----|
74
+ | D2 Journey → D5 UI | New flow = new interface almost always |
75
+ | D3 Data → D4 API | Schema change = API contract change |
76
+ | D3 Data → D8 Rollout | Schema change = migration needed |
77
+ | D4 API → D3 Data | New endpoint often needs new/modified schema |
78
+ | D4 API → D9 Integration | New endpoint = new touchpoints in existing code |
79
+ | D4 API → D10 Tests | New endpoint = new test scenarios |
80
+ | D6 Perms → D10 Tests | Permission change = critical test update |
81
+
82
+ ---
83
+
84
+ ## Phase 3 — ICIAS Scoring
85
+
86
+ For each dimension with I > 0 (direct or cascade):
87
+
88
+ ### Score = I x C x A
89
+
90
+ **I = Impact Depth** (from Phase 1/2):
91
+ | Value | Meaning | Examples |
92
+ |-------|---------|----------|
93
+ | 1 | Cosmetic | Label, copy, minor display change |
94
+ | 2 | Logic | New condition, validation, flow branch, field |
95
+ | 3 | Structural | New entity, endpoint, page, collection, role |
96
+
97
+ **C = Confidence** (how certain the impact is):
98
+ | Value | Meaning | When to use |
99
+ |-------|---------|-------------|
100
+ | 1 | Inferred | Cascade-only, no direct evidence |
101
+ | 2 | Probable | Logical deduction, codebase pattern suggests it |
102
+ | 3 | Certain | Explicitly stated in CR, or direct code dependency |
103
+
104
+ **A = Artifact Stakes** (pre-assigned, fixed per dimension):
105
+ | A=3 (High stakes) | A=2 (Medium stakes) | A=1 (Low stakes) |
106
+ |-------------------|---------------------|-------------------|
107
+ | D3 Data Model | D2 User Journey | D1 Target Users |
108
+ | D4 API | D5 UI | D7 Edge Cases |
109
+ | D9 Integration Surface | D6 Permissions | D8 Rollout/Migration |
110
+ | | D10 Test Strategy | |
111
+
112
+ ### Verdict thresholds
113
+
114
+ | Score Range | Verdict | Meaning |
115
+ |-------------|---------|---------|
116
+ | 0 | SKIP | No impact detected |
117
+ | 1–3 | SKIP | Negligible impact, no revision needed |
118
+ | 4–9 | PATCH | Moderate impact, surgical update to affected sections |
119
+ | 10–27 | REDO | Major impact, phase must be substantially re-executed |
120
+
121
+ ### Bias rule
122
+
123
+ **False negatives are worse than false positives.** When uncertain:
124
+ - Round C up, not down
125
+ - Prefer PATCH over SKIP when on the boundary (score = 3)
126
+ - Prefer REDO over PATCH only when I = 3 (structural)
127
+
128
+ ---
129
+
130
+ ## Phase Mapping
131
+
132
+ After scoring all dimensions, map to PRD phases:
133
+
134
+ ### Discovery phase impact
135
+ - ANY dimension with PATCH/REDO → Discovery needs delta update
136
+ - PATCH: update state file checklist, run codebase-architect on affected dims
137
+ - REDO: re-run discovery question loop for affected dims
138
+
139
+ ### UI Design phase impact
140
+ - D2 Journey REDO OR D5 UI REDO → UI Design REDO
141
+ - D5 UI PATCH → UI Design PATCH (update existing design)
142
+ - Otherwise → UI Design SKIP
143
+
144
+ ### PRD document impact
145
+ - ANY dimension with PATCH/REDO → PRD needs update
146
+ - Map dimensions to PRD sections:
147
+
148
+ | Dimension | PRD Sections Affected |
149
+ |-----------|----------------------|
150
+ | D1 Users | 3 (Personas) |
151
+ | D2 Journey | 4 (User Stories), 7 (UI Specs) |
152
+ | D3 Data | 5 (Data Model), 12 (Dependencies) |
153
+ | D4 API | 6 (API Contract), 14 (Pipeline) |
154
+ | D5 UI | 7 (UI Specs), 8 (i18n) |
155
+ | D6 Perms | 9 (Acceptance Criteria) |
156
+ | D7 Edge Cases | 10 (Edge Cases) |
157
+ | D8 Rollout | 12 (Dependencies) |
158
+ | D9 Integration | 15 (ISA) |
159
+ | D10 Tests | 13 (Test Plan) |
160
+
161
+ ### Backlog Cards impact
162
+ - New structural entities (I=3) → new cards needed
163
+ - Changed acceptance criteria → update existing cards
164
+ - Changed dependencies → update `depends_on` fields
165
+
166
+ ---
167
+
168
+ ## Worked Example
169
+
170
+ **CR: "Add POST /api/v1/merchant/reservations/bulk-confirm for batch confirmation"**
171
+
172
+ Change type: Addition (new endpoint)
173
+
174
+ ### Phase 1 — Semantic Scan
175
+
176
+ | Dim | Direct? | I | Rationale |
177
+ |-----|---------|---|-----------|
178
+ | D1 Users | no | 0 | Same users (merchant staff) |
179
+ | D2 Journey | yes | 2 | New batch flow alongside single confirm |
180
+ | D3 Data | no | 0 | Same reservation schema |
181
+ | D4 API | yes | 3 | New endpoint, new payload, new validation |
182
+ | D5 UI | yes | 2 | Need selection mode + bulk button |
183
+ | D6 Perms | no | 0 | Same permission (manage_reservations) |
184
+ | D7 Edge | yes | 2 | Partial failure in batch, max batch size |
185
+ | D8 Rollout | no | 0 | No migration needed |
186
+ | D9 Integration | no | 0 | (check in Phase 2) |
187
+ | D10 Tests | no | 0 | (check in Phase 2) |
188
+
189
+ ### Phase 2 — Structural Propagation
190
+
191
+ From D4 (API, I=3):
192
+ - D4→D3 (strength=3): cascade. D3 I=max(1, 3-1)=2, C=2 → but wait,
193
+ CR says "same schema" → override to I=0. No cascade (semantic override).
194
+ - D4→D9 (strength=3): cascade. D9 I=2, C=2
195
+ - D4→D10 (strength=3): cascade. D10 I=2, C=2
196
+
197
+ ### Phase 3 — ICIAS Score
198
+
199
+ | Dim | I | C | A | Score | Verdict |
200
+ |-----|---|---|---|-------|---------|
201
+ | D1 | 0 | - | 1 | 0 | SKIP |
202
+ | D2 | 2 | 3 | 2 | 12 | REDO |
203
+ | D3 | 0 | - | 3 | 0 | SKIP |
204
+ | D4 | 3 | 3 | 3 | 27 | REDO |
205
+ | D5 | 2 | 3 | 2 | 12 | REDO |
206
+ | D6 | 0 | - | 2 | 0 | SKIP |
207
+ | D7 | 2 | 3 | 1 | 6 | PATCH |
208
+ | D8 | 0 | - | 1 | 0 | SKIP |
209
+ | D9 | 2 | 2 | 3 | 12 | REDO |
210
+ | D10 | 2 | 2 | 2 | 8 | PATCH |
211
+
212
+ ### Phase mapping result
213
+
214
+ | Phase | Verdict | Scope |
215
+ |-------|---------|-------|
216
+ | Discovery | PATCH | Update D2, D4, D5, D7, D9, D10 in checklist |
217
+ | UI Design | REDO | New batch selection flow |
218
+ | PRD | REDO | Sections 4, 6, 7, 10, 13, 15 |
219
+ | Backlog Cards | PATCH | New cards for bulk endpoint + UI; update deps |
220
+
221
+ ---
222
+
223
+ ## Calibration Notes
224
+
225
+ These thresholds are FMEA-adapted heuristics, not empirically validated
226
+ for PRD CIA. After 10-15 real change requests, review:
227
+
228
+ 1. Were any SKIPs that should have been PATCHes? → Lower threshold.
229
+ 2. Were any REDOs that could have been PATCHes? → Raise threshold.
230
+ 3. Did the coupling matrix miss any real cascades? → Add/strengthen edges.
231
+ 4. Did the coupling matrix produce false cascades? → Weaken/remove edges.
232
+
233
+ Track calibration data in state file `## Change Requests` section.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: remotion-best-practices
3
+ description: Best practices for Remotion - Video creation in React
4
+ metadata:
5
+ tags: remotion, video, react, animation, composition
6
+ ---
7
+
8
+ ## When to use
9
+
10
+ Use this skills whenever you are dealing with Remotion code to obtain the domain-specific knowledge.
11
+
12
+ ## Captions
13
+
14
+ When dealing with captions or subtitles, load the [./rules/subtitles.md](./rules/subtitles.md) file for more information.
15
+
16
+ ## How to use
17
+
18
+ Read individual rule files for detailed explanations and code examples:
19
+
20
+ - [rules/3d.md](rules/3d.md) - 3D content in Remotion using Three.js and React Three Fiber
21
+ - [rules/animations.md](rules/animations.md) - Fundamental animation skills for Remotion
22
+ - [rules/assets.md](rules/assets.md) - Importing images, videos, audio, and fonts into Remotion
23
+ - [rules/audio.md](rules/audio.md) - Using audio and sound in Remotion - importing, trimming, volume, speed, pitch
24
+ - [rules/calculate-metadata.md](rules/calculate-metadata.md) - Dynamically set composition duration, dimensions, and props
25
+ - [rules/can-decode.md](rules/can-decode.md) - Check if a video can be decoded by the browser using Mediabunny
26
+ - [rules/charts.md](rules/charts.md) - Chart and data visualization patterns for Remotion
27
+ - [rules/compositions.md](rules/compositions.md) - Defining compositions, stills, folders, default props and dynamic metadata
28
+ - [rules/extract-frames.md](rules/extract-frames.md) - Extract frames from videos at specific timestamps using Mediabunny
29
+ - [rules/fonts.md](rules/fonts.md) - Loading Google Fonts and local fonts in Remotion
30
+ - [rules/get-audio-duration.md](rules/get-audio-duration.md) - Getting the duration of an audio file in seconds with Mediabunny
31
+ - [rules/get-video-dimensions.md](rules/get-video-dimensions.md) - Getting the width and height of a video file with Mediabunny
32
+ - [rules/get-video-duration.md](rules/get-video-duration.md) - Getting the duration of a video file in seconds with Mediabunny
33
+ - [rules/gifs.md](rules/gifs.md) - Displaying GIFs synchronized with Remotion's timeline
34
+ - [rules/images.md](rules/images.md) - Embedding images in Remotion using the Img component
35
+ - [rules/light-leaks.md](rules/light-leaks.md) - Light leak overlay effects using @remotion/light-leaks
36
+ - [rules/lottie.md](rules/lottie.md) - Embedding Lottie animations in Remotion
37
+ - [rules/measuring-dom-nodes.md](rules/measuring-dom-nodes.md) - Measuring DOM element dimensions in Remotion
38
+ - [rules/measuring-text.md](rules/measuring-text.md) - Measuring text dimensions, fitting text to containers, and checking overflow
39
+ - [rules/sequencing.md](rules/sequencing.md) - Sequencing patterns for Remotion - delay, trim, limit duration of items
40
+ - [rules/tailwind.md](rules/tailwind.md) - Using TailwindCSS in Remotion
41
+ - [rules/text-animations.md](rules/text-animations.md) - Typography and text animation patterns for Remotion
42
+ - [rules/timing.md](rules/timing.md) - Interpolation curves in Remotion - linear, easing, spring animations
43
+ - [rules/transitions.md](rules/transitions.md) - Scene transition patterns for Remotion
44
+ - [rules/transparent-videos.md](rules/transparent-videos.md) - Rendering out a video with transparency
45
+ - [rules/trimming.md](rules/trimming.md) - Trimming patterns for Remotion - cut the beginning or end of animations
46
+ - [rules/videos.md](rules/videos.md) - Embedding videos in Remotion - trimming, volume, speed, looping, pitch
47
+ - [rules/parameters.md](rules/parameters.md) - Make a video parametrizable by adding a Zod schema
48
+ - [rules/maps.md](rules/maps.md) - Add a map using Mapbox and animate it
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: 3d
3
+ description: 3D content in Remotion using Three.js and React Three Fiber.
4
+ metadata:
5
+ tags: 3d, three, threejs
6
+ ---
7
+
8
+ # Using Three.js and React Three Fiber in Remotion
9
+
10
+ Follow React Three Fiber and Three.js best practices.
11
+ Only the following Remotion-specific rules need to be followed:
12
+
13
+ ## Prerequisites
14
+
15
+ First, the `@remotion/three` package needs to be installed.
16
+ If it is not, use the following command:
17
+
18
+ ```bash
19
+ npx remotion add @remotion/three # If project uses npm
20
+ bunx remotion add @remotion/three # If project uses bun
21
+ yarn remotion add @remotion/three # If project uses yarn
22
+ pnpm exec remotion add @remotion/three # If project uses pnpm
23
+ ```
24
+
25
+ ## Using ThreeCanvas
26
+
27
+ You MUST wrap 3D content in `<ThreeCanvas>` and include proper lighting.
28
+ `<ThreeCanvas>` MUST have a `width` and `height` prop.
29
+
30
+ ```tsx
31
+ import { ThreeCanvas } from "@remotion/three";
32
+ import { useVideoConfig } from "remotion";
33
+
34
+ const { width, height } = useVideoConfig();
35
+
36
+ <ThreeCanvas width={width} height={height}>
37
+ <ambientLight intensity={0.4} />
38
+ <directionalLight position={[5, 5, 5]} intensity={0.8} />
39
+ <mesh>
40
+ <sphereGeometry args={[1, 32, 32]} />
41
+ <meshStandardMaterial color="red" />
42
+ </mesh>
43
+ </ThreeCanvas>
44
+ ```
45
+
46
+ ## No animations not driven by `useCurrentFrame()`
47
+
48
+ Shaders, models etc MUST NOT animate by themselves.
49
+ No animations are allowed unless they are driven by `useCurrentFrame()`.
50
+ Otherwise, it will cause flickering during rendering.
51
+
52
+ Using `useFrame()` from `@react-three/fiber` is forbidden.
53
+
54
+ ## Animate using `useCurrentFrame()`
55
+
56
+ Use `useCurrentFrame()` to perform animations.
57
+
58
+ ```tsx
59
+ const frame = useCurrentFrame();
60
+ const rotationY = frame * 0.02;
61
+
62
+ <mesh rotation={[0, rotationY, 0]}>
63
+ <boxGeometry args={[2, 2, 2]} />
64
+ <meshStandardMaterial color="#4a9eff" />
65
+ </mesh>
66
+ ```
67
+
68
+ ## Using `<Sequence>` inside `<ThreeCanvas>`
69
+
70
+ The `layout` prop of any `<Sequence>` inside a `<ThreeCanvas>` must be set to `none`.
71
+
72
+ ```tsx
73
+ import { Sequence } from "remotion";
74
+ import { ThreeCanvas } from "@remotion/three";
75
+
76
+ const { width, height } = useVideoConfig();
77
+
78
+ <ThreeCanvas width={width} height={height}>
79
+ <Sequence layout="none">
80
+ <mesh>
81
+ <boxGeometry args={[2, 2, 2]} />
82
+ <meshStandardMaterial color="#4a9eff" />
83
+ </mesh>
84
+ </Sequence>
85
+ </ThreeCanvas>
86
+ ```
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: animations
3
+ description: Fundamental animation skills for Remotion
4
+ metadata:
5
+ tags: animations, transitions, frames, useCurrentFrame
6
+ ---
7
+
8
+ All animations MUST be driven by the `useCurrentFrame()` hook.
9
+ Write animations in seconds and multiply them by the `fps` value from `useVideoConfig()`.
10
+
11
+ ```tsx
12
+ import { useCurrentFrame } from "remotion";
13
+
14
+ export const FadeIn = () => {
15
+ const frame = useCurrentFrame();
16
+ const { fps } = useVideoConfig();
17
+
18
+ const opacity = interpolate(frame, [0, 2 * fps], [0, 1], {
19
+ extrapolateRight: 'clamp',
20
+ });
21
+
22
+ return (
23
+ <div style={{ opacity }}>Hello World!</div>
24
+ );
25
+ };
26
+ ```
27
+
28
+ CSS transitions or animations are FORBIDDEN - they will not render correctly.
29
+ Tailwind animation class names are FORBIDDEN - they will not render correctly.