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,155 @@
1
+ # Performance
2
+
3
+ ## Purpose
4
+
5
+ Define performance targets, optimization guidelines, and monitoring strategies.
6
+
7
+ ## Scope
8
+
9
+ **In**: Performance requirements, optimization techniques, profiling.
10
+ **Out**: Infrastructure scaling (see deployment-protocol.md if applicable).
11
+
12
+ ## Do
13
+
14
+ - Set measurable performance targets
15
+ - Profile before optimizing
16
+ - Monitor performance metrics
17
+ - Optimize critical paths first
18
+
19
+ ## Do Not
20
+
21
+ - Optimize prematurely
22
+ - Sacrifice readability for micro-optimizations
23
+ - Skip performance testing
24
+
25
+ ## Performance Targets
26
+
27
+ Define your performance targets:
28
+
29
+ | Metric | Target | Critical Threshold |
30
+ |--------|--------|-------------------|
31
+ | API Response Time (p95) | [e.g., < 200ms] | [e.g., < 500ms] |
32
+ | Page Load Time | [e.g., < 2s] | [e.g., < 5s] |
33
+ | Time to Interactive | [e.g., < 3s] | [e.g., < 7s] |
34
+ | Database Query Time | [e.g., < 50ms] | [e.g., < 200ms] |
35
+ | Bundle Size | [e.g., < 200KB] | [e.g., < 500KB] |
36
+
37
+ ## Frontend Performance
38
+
39
+ ### Loading Performance
40
+
41
+ - Code splitting
42
+ - Lazy loading
43
+ - Asset optimization
44
+ - Caching strategies
45
+ - CDN usage
46
+
47
+ ### Runtime Performance
48
+
49
+ - Virtual scrolling for long lists
50
+ - Debouncing/throttling
51
+ - Memoization
52
+ - Efficient re-renders
53
+ - Web Workers for heavy computation
54
+
55
+ ### Bundle Optimization
56
+
57
+ - Tree shaking
58
+ - Minification
59
+ - Compression (gzip/brotli)
60
+ - Remove unused dependencies
61
+ - Analyze bundle composition
62
+
63
+ ## Backend Performance
64
+
65
+ ### Query Optimization
66
+
67
+ - Use indexes effectively
68
+ - Avoid N+1 queries
69
+ - Implement query caching
70
+ - Use connection pooling
71
+ - Optimize complex joins
72
+
73
+ ### API Optimization
74
+
75
+ - Response compression
76
+ - Pagination for large datasets
77
+ - Rate limiting
78
+ - Request/response caching
79
+ - Background job processing
80
+
81
+ ### Caching Strategy
82
+
83
+ - [Cache layers - e.g., Redis, CDN, browser]
84
+ - [Cache invalidation rules]
85
+ - [Cache TTL policies]
86
+ - [Cache warming strategies]
87
+
88
+ ## Database Performance
89
+
90
+ ### Indexing Strategy
91
+
92
+ - Index frequently queried fields
93
+ - Composite indexes for multi-field queries
94
+ - Monitor index usage
95
+ - Remove unused indexes
96
+
97
+ ### Query Patterns
98
+
99
+ - Use database connection pooling
100
+ - Implement read replicas if needed
101
+ - Batch operations when possible
102
+ - Avoid SELECT *
103
+ - Use appropriate data types
104
+
105
+ ## Monitoring
106
+
107
+ ### Key Metrics
108
+
109
+ - Response times (p50, p95, p99)
110
+ - Error rates
111
+ - Throughput (requests per second)
112
+ - Resource utilization (CPU, memory, disk)
113
+ - Database query performance
114
+
115
+ ### Tools
116
+
117
+ - [APM tool - e.g., New Relic, Datadog]
118
+ - [Logging - e.g., ELK, CloudWatch]
119
+ - [Profiling tools]
120
+ - [Load testing tools]
121
+
122
+ ## Profiling
123
+
124
+ ### When to Profile
125
+
126
+ - Before major optimizations
127
+ - After performance regressions
128
+ - During load testing
129
+ - For bottleneck identification
130
+
131
+ ### Profiling Tools
132
+
133
+ - [Browser DevTools for frontend]
134
+ - [Language-specific profilers for backend]
135
+ - [Database query analyzers]
136
+
137
+ ## Load Testing
138
+
139
+ - Define realistic load scenarios
140
+ - Test at expected peak load
141
+ - Test beyond capacity (stress testing)
142
+ - Monitor resource usage during tests
143
+ - Document findings and thresholds
144
+
145
+ ## Optimization Checklist
146
+
147
+ - [ ] Performance targets defined
148
+ - [ ] Critical paths identified
149
+ - [ ] Monitoring implemented
150
+ - [ ] Caching strategy in place
151
+ - [ ] Database indexed appropriately
152
+ - [ ] Frontend bundle optimized
153
+ - [ ] API responses optimized
154
+ - [ ] Load testing performed
155
+ - [ ] Profiling results documented
@@ -0,0 +1,145 @@
1
+ <!-- contamination-scan: skip
2
+ This file legitimately uses the literal paths `docs/design-system/`,
3
+ `docs/references/`, `docs/decisions/`, etc. inside autodetection probe
4
+ descriptions (§ 6). Those are NOT hardcoded references — they are
5
+ literal strings describing what to look for on disk. Autofixing them
6
+ would make the probe nonsensical. -->
7
+ # Project Context Protocol
8
+
9
+ **Status**: MANDATORY pre-read for any BALDART skill or agent invocation that touches project-specific paths, brand identity, or technology stack choices.
10
+
11
+ This module defines how skills resolve project-specific facts (paths, identity, stack, feature toggles) instead of hard-coding them. It exists so that the same skill can run unchanged across a fidelity-app repo, an internal admin tool, or a marketing site.
12
+
13
+ ## 1) The three layers
14
+
15
+ BALDART skills resolve project context through three layers, in this order:
16
+
17
+ 1. **`baldart.config.yml`** (repo root) — variables: paths, identity, stack, feature flags. Authoritative source of structural facts.
18
+ 2. **Skill base content** (`.claude/skills/<name>/`) — generic instructions written against config keys, not hard-coded paths.
19
+ 3. **`.baldart/overlays/<skill-name>.md`** (consumer-authored, optional) — project-specific extensions: brand voice, custom workflows, project-specific BLOCKING rules.
20
+
21
+ Skills MUST consult all three layers in this order on every invocation.
22
+
23
+ ## 2) Reading `baldart.config.yml`
24
+
25
+ Before executing any step that depends on project-specific facts, the skill MUST:
26
+
27
+ 1. Read `baldart.config.yml` from the repo root.
28
+ 2. Resolve the keys it declares in its **Project Context** header.
29
+ 3. Apply the **Missing-key protocol** below if any required key is empty / absent / unanswered.
30
+
31
+ The schema is documented in [`framework/docs/PROJECT-CONFIGURATION.md`](../docs/PROJECT-CONFIGURATION.md). Top-level keys:
32
+
33
+ | Key | Purpose |
34
+ |---|---|
35
+ | `version` | Schema version. Skills MAY refuse to run on a higher major than they understand. |
36
+ | `paths.*` | Canonical document and source paths. Empty string = concept absent in this project. |
37
+ | `identity.*` | Brand name, design philosophy, language, audience segments. |
38
+ | `stack.*` | Charting / animation / testing technology choices (canonical + forbidden). |
39
+ | `features.*` | Explicit booleans gating BLOCKING reads (e.g. `has_design_system`). |
40
+
41
+ ## 3) Missing-key protocol (option A — always ask)
42
+
43
+ When a key the skill declares as required is missing, empty, or a `features.*` flag is absent:
44
+
45
+ 1. **Do not assume.** Never default to `false`. Never invent a path.
46
+ 2. **Ask the user** with a concrete question naming the missing key:
47
+ > "`baldart.config.yml` does not declare `paths.design_system`. Does this project have a design system, and if so where is its entry point?"
48
+ 3. **Persist the answer.** Suggest running `npx baldart configure` so the answer is written to `baldart.config.yml` and not asked again next time. If the user declines, proceed with the value but note it as ASSUMED.
49
+ 4. **Do not silently degrade.** If a BLOCKING read is gated by an unanswered `features.*` flag, the skill MUST ask before deciding whether to skip — it MUST NOT default to skipping.
50
+
51
+ ## 4) Skill header convention (3-5 lines)
52
+
53
+ Every skill that depends on project context MUST include a **Project Context** block immediately after its frontmatter. The block is short and dense — the full protocol (this file) is loaded once, not duplicated per skill.
54
+
55
+ Template ([`framework/templates/skill-project-context.snippet.md`](../templates/skill-project-context.snippet.md)):
56
+
57
+ ```markdown
58
+ ## Project Context
59
+
60
+ **Reads from `baldart.config.yml`:** `paths.X`, `paths.Y`, `identity.Z`, `stack.W`.
61
+ **Gated by features:** `features.has_FOO` (BLOCKING when true), `features.has_BAR` (skip step N when false).
62
+ **Overlay:** loads `.baldart/overlays/<this-skill>.md` if present (see `framework/agents/project-context.md` § 5).
63
+ **On missing/empty keys:** ask the user; do not assume defaults.
64
+ ```
65
+
66
+ Skills MUST NOT re-explain the protocol. They MUST cite `framework/agents/project-context.md` for the rules.
67
+
68
+ ## 5) Overlay loading rule
69
+
70
+ Path: `.baldart/overlays/<skill-name>.md` (matches the skill directory name, e.g. `.baldart/overlays/ui-design.md`).
71
+
72
+ ### Frontmatter (mandatory)
73
+
74
+ ```yaml
75
+ ---
76
+ base_skill: ui-design
77
+ base_skill_version: 3.0.0 # version of the framework when this overlay was authored
78
+ mode: extend # extend | override
79
+ ---
80
+ ```
81
+
82
+ - `base_skill_version` — captures the framework version the overlay was written against. `baldart status` and `baldart update` use this to warn when the base skill has evolved (silent-conflict prevention).
83
+ - `mode: extend` (default) — overlay rules are ADDED to base skill rules. The skill runs both.
84
+ - `mode: override` — overlay rules REPLACE conflicting base-skill rules. Use sparingly.
85
+
86
+ ### Precedence rules
87
+
88
+ 1. **Default**: overlays *extend* base skills. If overlay and base both apply, both run.
89
+ 2. **Explicit override**: inside an overlay (regardless of `mode`), a section marked `## [OVERRIDE] <topic>` replaces the same `<topic>` from the base skill.
90
+ 3. **Stack/identity conflicts**: when an overlay's stack/identity rule contradicts `baldart.config.yml`, the overlay wins (the user wrote it deliberately) — but the skill MUST log a one-line "overlay overrides config" notice in its output.
91
+
92
+ ### Version drift handling
93
+
94
+ If `base_skill_version` in the overlay is older than the installed framework version:
95
+ - The skill loads the overlay normally.
96
+ - The skill emits a single-line WARNING at the start of its output: `overlay <name> targets v<X>, installed v<Y> — review for drift`.
97
+ - `npx baldart status` lists drifted overlays and suggests `npx baldart update --review-overlays`.
98
+
99
+ This is non-blocking by design — silent overrides are worse than noisy ones.
100
+
101
+ ## 6) Autodetection (used by `baldart configure`)
102
+
103
+ `npx baldart configure` populates `baldart.config.yml` by probing the filesystem. The complete probe table (source of truth: `src/commands/configure.js` `detect()`):
104
+
105
+ | Probe | Filesystem check | Config keys set |
106
+ |---|---|---|
107
+ | Design system | `docs/design-system/INDEX.md` exists | `paths.design_system: docs/design-system`, `features.has_design_system: true` |
108
+ | UI guidelines | first match of `docs/references/ui-guidelines.md`, `docs/ui-guidelines.md`, `docs/references/brand-guidelines.md` | `paths.ui_guidelines: <found>` |
109
+ | API index | first match of `docs/references/api/index.md`, `docs/api/index.md` | `paths.api_index: <found>` |
110
+ | API schemas | first match of `docs/references/api/schemas.md`, `docs/api/schemas.md` | `paths.api_schemas: <found>`, `features.has_api_docs: true` |
111
+ | API errors | first match of `docs/references/errors.md`, `docs/errors.md` | `paths.api_errors: <found>` |
112
+ | Components — primitives | first match of `src/components/ui`, `app/components/ui`, `components/ui` | `paths.components_primitives: <found>` |
113
+ | Components — root | first match of `src/components`, `app/components`, `components` | `paths.components_root: <found>` |
114
+ | Global styles | first match of `src/app/globals.css`, `app/globals.css`, `src/styles/globals.css`, `styles/globals.css` | `paths.global_styles: <found>` |
115
+ | Backlog | `backlog/*.yml` count > 0 | `paths.backlog_dir: backlog`, `features.has_backlog: true` |
116
+ | ADR | `docs/decisions/ADR-*.md` count > 0 | `paths.adrs_dir: docs/decisions`, `features.has_adrs: true` |
117
+ | PRD | `docs/prd/` exists | `paths.prd_dir: docs/prd`, `features.has_prd_workflow: true` |
118
+ | References dir | `docs/references/` exists | `paths.references_dir: docs/references` |
119
+ | LLM wiki | `docs/wiki/` exists | `paths.wiki_dir: docs/wiki`, `features.has_wiki_overlay: true` |
120
+ | E2E tests | first match of `tests/e2e`, `e2e`, `tests/playwright`, `tests/cypress` | `paths.e2e_tests_dir: <found>` |
121
+ | Brand name | `package.json#name` | `identity.brand_name: <name>` |
122
+ | Charting canonical | `package.json` lists any of `recharts`, `@nivo/heatmap`, `@nivo/bar`, `@nivo/line` | `stack.charting.canonical: [<found>]` |
123
+ | Charting wrappers | first match of `src/components/charts`, `app/components/charts` | `stack.charting.wrappers_root: <found>` |
124
+ | Animation canonical | `package.json` lists any of `framer-motion`, `lottie-react`, `gsap`, `motion` | `stack.animation.canonical: [<found>]` |
125
+ | E2E framework | `playwright.config.{ts,js}` → `playwright`; `cypress.config.{ts,js}` → `cypress` | `stack.testing.e2e: <name>` |
126
+
127
+ Autodetection PROPOSES values; the user always confirms. The point is to make first-run feel like one prompt-confirmation cycle, not 20 hand-typed YAML keys.
128
+
129
+ The `multi_tenant_theming` feature is not auto-detectable (no filesystem signal). `configure` always prompts for it explicitly; non-interactive mode omits the key from the written YAML so the always-ask contract kicks in on first skill invocation.
130
+
131
+ ## 7) Why this design
132
+
133
+ - **Symlinks survive updates.** The skill base content is symlinked from `.framework/`. Without indirection, every `npx baldart update` would overwrite consumer customizations. With indirection, customizations live in `baldart.config.yml` (copy, never overwritten) and `.baldart/overlays/` (consumer-owned).
134
+ - **Generic + opinionated coexist.** Generic skill content is the framework's IP. The opinionated parts (Neo-Brutalism, merchant/customer split, Recharts-only) live in the consumer's overlay. The same `ui-design` skill can be reused with a different overlay in every project.
135
+ - **Always-ask beats silent-default.** The cost of one extra question per missing key is trivial. The cost of a skill silently using `docs/design-system/INDEX.md` in a project that has no design system is silent failure, hallucinated paths, broken output.
136
+
137
+ ## 8) Author checklist (when adding/modifying a skill)
138
+
139
+ - [ ] Skill declares its config dependencies in a **Project Context** header (3-5 lines).
140
+ - [ ] No hard-coded paths in skill body — every path references a `baldart.config.yml` key.
141
+ - [ ] No hard-coded identity claims — brand voice / design philosophy / language come from `identity.*`.
142
+ - [ ] No hard-coded stack imposition — canonical/forbidden libraries come from `stack.*`.
143
+ - [ ] BLOCKING reads are gated by `features.*` flags, not assumed-always-present.
144
+ - [ ] Skill explicitly invokes overlay loading: "load `.baldart/overlays/<name>.md` if present".
145
+ - [ ] If the skill ships an opinionated default that was previously hard-coded, the opinion is moved to `framework/templates/overlays/<name>.<flavour>-example.md` and the skill body stays neutral.
@@ -0,0 +1,208 @@
1
+ # Runbook
2
+
3
+ ## Purpose
4
+
5
+ Document operational procedures, environment setup, and common tasks.
6
+
7
+ ## Scope
8
+
9
+ **In**: Environment setup, deployment procedures, common operations.
10
+ **Out**: Development workflow (see agents/workflows.md).
11
+
12
+ ## Do
13
+
14
+ - Document all manual procedures
15
+ - Keep runbook updated
16
+ - Test procedures periodically
17
+
18
+ ## Do Not
19
+
20
+ - Skip documenting new procedures
21
+ - Assume knowledge is common
22
+
23
+ ## Environment Setup
24
+
25
+ ### Prerequisites
26
+
27
+ - [Tool 1 - e.g., Node.js 18+]
28
+ - [Tool 2 - e.g., Docker]
29
+ - [Tool 3 - e.g., Database client]
30
+ - [Access requirements]
31
+
32
+ ### Installation Steps
33
+
34
+ 1. Clone repository: `git clone [repo-url]`
35
+ 2. Install dependencies: `[install-command]`
36
+ 3. Copy environment file: `cp .env.example .env`
37
+ 4. Configure environment variables
38
+ 5. Run database migrations (if applicable)
39
+ 6. Start development server: `[dev-command]`
40
+
41
+ ### Environment Variables
42
+
43
+ | Variable | Required | Description | Example |
44
+ |----------|----------|-------------|---------|
45
+ | `VAR_1` | Yes | [Description] | `value` |
46
+ | `VAR_2` | No | [Description] | `value` |
47
+
48
+ ## Common Operations
49
+
50
+ ### Starting Services
51
+
52
+ ```bash
53
+ # Development
54
+ [command to start dev server]
55
+
56
+ # Production
57
+ [command to start prod server]
58
+ ```
59
+
60
+ ### Running Tests
61
+
62
+ ```bash
63
+ # All tests
64
+ [test command]
65
+
66
+ # Specific test
67
+ [test command for specific file/suite]
68
+
69
+ # With coverage
70
+ [coverage command]
71
+ ```
72
+
73
+ ### Database Operations
74
+
75
+ ```bash
76
+ # Run migrations
77
+ [migration command]
78
+
79
+ # Rollback migration
80
+ [rollback command]
81
+
82
+ # Seed database
83
+ [seed command]
84
+
85
+ # Backup database
86
+ [backup command]
87
+
88
+ # Restore database
89
+ [restore command]
90
+ ```
91
+
92
+ ### Build and Deploy
93
+
94
+ ```bash
95
+ # Build for production
96
+ [build command]
97
+
98
+ # Run linter
99
+ [lint command]
100
+
101
+ # Run type check
102
+ [type-check command]
103
+
104
+ # Deploy
105
+ [deploy command]
106
+ ```
107
+
108
+ ## Troubleshooting
109
+
110
+ ### Issue: [Common Issue 1]
111
+
112
+ **Symptoms**: [Describe symptoms]
113
+
114
+ **Cause**: [Root cause]
115
+
116
+ **Solution**:
117
+
118
+ ```bash
119
+ [Commands to fix]
120
+ ```
121
+
122
+ ### Issue: [Common Issue 2]
123
+
124
+ **Symptoms**: [Describe symptoms]
125
+
126
+ **Cause**: [Root cause]
127
+
128
+ **Solution**:
129
+
130
+ ```bash
131
+ [Commands to fix]
132
+ ```
133
+
134
+ ## Maintenance Tasks
135
+
136
+ ### Daily
137
+
138
+ - [Task 1 - e.g., Check error logs]
139
+ - [Task 2 - e.g., Monitor resource usage]
140
+
141
+ ### Weekly
142
+
143
+ - [Task 1 - e.g., Review performance metrics]
144
+ - [Task 2 - e.g., Update dependencies]
145
+
146
+ ### Monthly
147
+
148
+ - [Task 1 - e.g., Database optimization]
149
+ - [Task 2 - e.g., Security audit]
150
+
151
+ ## Backup Procedures
152
+
153
+ ### Database Backup
154
+
155
+ ```bash
156
+ [Backup command with examples]
157
+ ```
158
+
159
+ ### File Backup
160
+
161
+ ```bash
162
+ [Backup command with examples]
163
+ ```
164
+
165
+ ### Restore Procedures
166
+
167
+ ```bash
168
+ [Restore command with examples]
169
+ ```
170
+
171
+ ## Monitoring
172
+
173
+ - [Health check endpoint]
174
+ - [Metrics endpoint]
175
+ - [Logs location]
176
+ - [Dashboard URL]
177
+
178
+ ## Emergency Contacts
179
+
180
+ - **On-call**: [Contact info]
181
+ - **Database Admin**: [Contact info]
182
+ - **DevOps**: [Contact info]
183
+ - **Security**: [Contact info]
184
+
185
+ ## Useful Commands
186
+
187
+ ```bash
188
+ # Check service status
189
+ [command]
190
+
191
+ # View logs
192
+ [command]
193
+
194
+ # Clear cache
195
+ [command]
196
+
197
+ # Restart service
198
+ [command]
199
+ ```
200
+
201
+ ## Environment Differences
202
+
203
+ | Aspect | Development | Staging | Production |
204
+ |--------|-------------|---------|------------|
205
+ | URL | [dev-url] | [staging-url] | [prod-url] |
206
+ | Database | [db info] | [db info] | [db info] |
207
+ | Logging | Debug | Info | Warn/Error |
208
+ | Cache | Disabled | Enabled | Enabled |
@@ -0,0 +1,168 @@
1
+ # Security
2
+
3
+ ## Purpose
4
+
5
+ Document security requirements, threats, and mitigation strategies.
6
+
7
+ ## Scope
8
+
9
+ **In**: Authentication, authorization, data protection, common vulnerabilities.
10
+ **Out**: Compliance requirements (create separate docs/compliance/ if needed).
11
+
12
+ ## Do
13
+
14
+ - Validate all user inputs
15
+ - Use parameterized queries
16
+ - Implement rate limiting
17
+ - Log security events
18
+ - Keep dependencies updated
19
+
20
+ ## Do Not
21
+
22
+ - Store secrets in code
23
+ - Trust client-side validation alone
24
+ - Skip authentication checks
25
+ - Log sensitive data
26
+
27
+ ## Authentication
28
+
29
+ - [Authentication method]
30
+ - [Session management]
31
+ - [Token handling]
32
+ - [Password requirements]
33
+ - [Multi-factor authentication if applicable]
34
+
35
+ ## Authorization
36
+
37
+ - [Permission model]
38
+ - [Role-based access control]
39
+ - [Resource-level permissions]
40
+ - [API authorization checks]
41
+
42
+ ## Input Validation
43
+
44
+ - Validate all user inputs server-side
45
+ - Sanitize data before database operations
46
+ - Use allowlists over denylists
47
+ - Validate file uploads (type, size, content)
48
+ - Check for injection attacks (SQL, NoSQL, command, XSS)
49
+
50
+ ## Data Protection
51
+
52
+ - [Encryption at rest]
53
+ - [Encryption in transit]
54
+ - [PII handling]
55
+ - [Sensitive data masking in logs]
56
+ - [Secrets management]
57
+
58
+ ## Common Vulnerabilities (OWASP Top 10)
59
+
60
+ ### Injection Attacks
61
+
62
+ - Use parameterized queries
63
+ - Validate and sanitize inputs
64
+ - Implement least privilege database access
65
+
66
+ ### Broken Authentication
67
+
68
+ - Implement secure session management
69
+ - Use strong password policies
70
+ - Implement account lockout
71
+ - Protect against brute force
72
+
73
+ ### Sensitive Data Exposure
74
+
75
+ - Encrypt sensitive data
76
+ - Use HTTPS everywhere
77
+ - Don't log sensitive information
78
+ - Implement secure key management
79
+
80
+ ### XML External Entities (XXE)
81
+
82
+ - Disable XML external entity processing
83
+ - Use safe XML parsers
84
+ - Validate XML inputs
85
+
86
+ ### Broken Access Control
87
+
88
+ - Implement proper authorization
89
+ - Validate permissions on every request
90
+ - Use principle of least privilege
91
+
92
+ ### Security Misconfiguration
93
+
94
+ - Harden default configurations
95
+ - Keep software updated
96
+ - Remove unnecessary features
97
+ - Implement security headers
98
+
99
+ ### Cross-Site Scripting (XSS)
100
+
101
+ - Escape output
102
+ - Use Content Security Policy
103
+ - Validate and sanitize inputs
104
+ - Use framework protections
105
+
106
+ ### Insecure Deserialization
107
+
108
+ - Validate serialized data
109
+ - Use safe deserialization libraries
110
+ - Implement integrity checks
111
+
112
+ ### Using Components with Known Vulnerabilities
113
+
114
+ - Keep dependencies updated
115
+ - Monitor security advisories
116
+ - Use dependency scanning tools
117
+
118
+ ### Insufficient Logging & Monitoring
119
+
120
+ - Log security events
121
+ - Monitor for suspicious activity
122
+ - Implement alerting
123
+ - Protect log integrity
124
+
125
+ ## Rate Limiting
126
+
127
+ - [API rate limits]
128
+ - [Authentication attempt limits]
129
+ - [Resource access limits]
130
+
131
+ ## Security Headers
132
+
133
+ Implement these HTTP security headers:
134
+
135
+ - `Content-Security-Policy`
136
+ - `X-Content-Type-Options: nosniff`
137
+ - `X-Frame-Options: DENY`
138
+ - `X-XSS-Protection: 1; mode=block`
139
+ - `Strict-Transport-Security`
140
+
141
+ ## Secrets Management
142
+
143
+ - Never commit secrets to version control
144
+ - Use environment variables
145
+ - Use secrets management service if available
146
+ - Rotate secrets regularly
147
+ - Implement least privilege access
148
+
149
+ ## Incident Response
150
+
151
+ 1. Detect and identify incident
152
+ 2. Contain the threat
153
+ 3. Investigate root cause
154
+ 4. Remediate vulnerability
155
+ 5. Document and learn
156
+
157
+ ## Security Checklist
158
+
159
+ - [ ] All inputs validated
160
+ - [ ] Parameterized queries used
161
+ - [ ] Authentication implemented
162
+ - [ ] Authorization checked
163
+ - [ ] Sensitive data encrypted
164
+ - [ ] Security headers set
165
+ - [ ] Rate limiting implemented
166
+ - [ ] Dependencies up to date
167
+ - [ ] Logging implemented
168
+ - [ ] Secrets properly managed