@kinqs/brainrouter-mcp-server 0.3.4

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 (337) hide show
  1. package/.env.example +144 -0
  2. package/README.md +56 -0
  3. package/agents/README.md +120 -0
  4. package/agents/code-reviewer.md +97 -0
  5. package/agents/security-auditor.md +101 -0
  6. package/agents/test-engineer.md +95 -0
  7. package/dist/__tests__/agent_mode.test.d.ts +1 -0
  8. package/dist/__tests__/api-routes.test.d.ts +1 -0
  9. package/dist/__tests__/api-routes.test.js +170 -0
  10. package/dist/__tests__/crypto.test.d.ts +1 -0
  11. package/dist/__tests__/crypto.test.js +28 -0
  12. package/dist/__tests__/host-integrations.test.d.ts +1 -0
  13. package/dist/__tests__/host-integrations.test.js +82 -0
  14. package/dist/__tests__/integration.test.d.ts +1 -0
  15. package/dist/__tests__/integration.test.js +50 -0
  16. package/dist/__tests__/loader.test.d.ts +1 -0
  17. package/dist/__tests__/loader.test.js +89 -0
  18. package/dist/__tests__/neural-spark.test.d.ts +1 -0
  19. package/dist/__tests__/neural-spark.test.js +112 -0
  20. package/dist/__tests__/pagination.test.d.ts +1 -0
  21. package/dist/__tests__/pagination.test.js +23 -0
  22. package/dist/__tests__/redaction.test.d.ts +1 -0
  23. package/dist/__tests__/redaction.test.js +17 -0
  24. package/dist/__tests__/registry.test.d.ts +1 -0
  25. package/dist/__tests__/registry.test.js +56 -0
  26. package/dist/__tests__/retry.test.d.ts +1 -0
  27. package/dist/__tests__/retry.test.js +30 -0
  28. package/dist/__tests__/skill-activation.test.d.ts +1 -0
  29. package/dist/__tests__/skill-activation.test.js +112 -0
  30. package/dist/__tests__/working-memory.test.d.ts +1 -0
  31. package/dist/__tests__/working-memory.test.js +200 -0
  32. package/dist/__tests__/workspace-paths.test.d.ts +1 -0
  33. package/dist/__tests__/workspace-paths.test.js +56 -0
  34. package/dist/__tests__/writer.test.d.ts +1 -0
  35. package/dist/__tests__/writer.test.js +94 -0
  36. package/dist/api/auth/crypto.d.ts +4 -0
  37. package/dist/api/auth/crypto.js +54 -0
  38. package/dist/api/middleware/auth.d.ts +12 -0
  39. package/dist/api/middleware/auth.js +90 -0
  40. package/dist/api/pagination.d.ts +18 -0
  41. package/dist/api/pagination.js +32 -0
  42. package/dist/api/routes/auth.d.ts +1 -0
  43. package/dist/api/routes/auth.js +130 -0
  44. package/dist/api/routes/chat-completions.d.ts +7 -0
  45. package/dist/api/routes/chat-completions.js +474 -0
  46. package/dist/api/routes/contradictions.d.ts +1 -0
  47. package/dist/api/routes/contradictions.js +28 -0
  48. package/dist/api/routes/evidence.d.ts +1 -0
  49. package/dist/api/routes/evidence.js +59 -0
  50. package/dist/api/routes/governance.d.ts +1 -0
  51. package/dist/api/routes/governance.js +95 -0
  52. package/dist/api/routes/graph.d.ts +1 -0
  53. package/dist/api/routes/graph.js +25 -0
  54. package/dist/api/routes/hooks.d.ts +1 -0
  55. package/dist/api/routes/hooks.js +88 -0
  56. package/dist/api/routes/memories.d.ts +1 -0
  57. package/dist/api/routes/memories.js +92 -0
  58. package/dist/api/routes/persona.d.ts +1 -0
  59. package/dist/api/routes/persona.js +9 -0
  60. package/dist/api/routes/scenes.d.ts +1 -0
  61. package/dist/api/routes/scenes.js +35 -0
  62. package/dist/api/routes/skills.d.ts +1 -0
  63. package/dist/api/routes/skills.js +14 -0
  64. package/dist/api/routes/stats.d.ts +1 -0
  65. package/dist/api/routes/stats.js +8 -0
  66. package/dist/api/routes/users.d.ts +1 -0
  67. package/dist/api/routes/users.js +82 -0
  68. package/dist/api/routes/working.d.ts +1 -0
  69. package/dist/api/routes/working.js +88 -0
  70. package/dist/index.d.ts +2 -0
  71. package/dist/index.js +492 -0
  72. package/dist/integrations/claude-code.d.ts +12 -0
  73. package/dist/integrations/claude-code.js +35 -0
  74. package/dist/integrations/codex.d.ts +12 -0
  75. package/dist/integrations/codex.js +34 -0
  76. package/dist/integrations/generic-mcp.d.ts +52 -0
  77. package/dist/integrations/generic-mcp.js +118 -0
  78. package/dist/loader.d.ts +29 -0
  79. package/dist/loader.js +200 -0
  80. package/dist/memory/capture.d.ts +35 -0
  81. package/dist/memory/capture.js +230 -0
  82. package/dist/memory/config.d.ts +2 -0
  83. package/dist/memory/config.js +3 -0
  84. package/dist/memory/engine.d.ts +203 -0
  85. package/dist/memory/engine.js +626 -0
  86. package/dist/memory/llm-semaphore.d.ts +41 -0
  87. package/dist/memory/llm-semaphore.js +81 -0
  88. package/dist/memory/memory-type-config.d.ts +11 -0
  89. package/dist/memory/memory-type-config.js +65 -0
  90. package/dist/memory/pipeline/cognitive-contradiction.d.ts +7 -0
  91. package/dist/memory/pipeline/cognitive-contradiction.js +59 -0
  92. package/dist/memory/pipeline/cognitive-dedup.d.ts +23 -0
  93. package/dist/memory/pipeline/cognitive-dedup.js +38 -0
  94. package/dist/memory/pipeline/cognitive-extractor.d.ts +21 -0
  95. package/dist/memory/pipeline/cognitive-extractor.js +183 -0
  96. package/dist/memory/pipeline/contextual-focus-builder.d.ts +13 -0
  97. package/dist/memory/pipeline/contextual-focus-builder.js +135 -0
  98. package/dist/memory/pipeline/focus-direction-shift.d.ts +10 -0
  99. package/dist/memory/pipeline/focus-direction-shift.js +27 -0
  100. package/dist/memory/pipeline/graph-builder.d.ts +11 -0
  101. package/dist/memory/pipeline/graph-builder.js +88 -0
  102. package/dist/memory/pipeline/graph-recall.d.ts +13 -0
  103. package/dist/memory/pipeline/graph-recall.js +55 -0
  104. package/dist/memory/pipeline/identity-distiller.d.ts +15 -0
  105. package/dist/memory/pipeline/identity-distiller.js +40 -0
  106. package/dist/memory/pipeline/l1-contradiction.d.ts +7 -0
  107. package/dist/memory/pipeline/l1-contradiction.js +66 -0
  108. package/dist/memory/pipeline/l1-dedup.d.ts +23 -0
  109. package/dist/memory/pipeline/l1-dedup.js +39 -0
  110. package/dist/memory/pipeline/l1-extractor.d.ts +21 -0
  111. package/dist/memory/pipeline/l1-extractor.js +180 -0
  112. package/dist/memory/pipeline/l2-direction-shift.d.ts +10 -0
  113. package/dist/memory/pipeline/l2-direction-shift.js +27 -0
  114. package/dist/memory/pipeline/l2-scene.d.ts +15 -0
  115. package/dist/memory/pipeline/l2-scene.js +140 -0
  116. package/dist/memory/pipeline/l3-distiller.d.ts +15 -0
  117. package/dist/memory/pipeline/l3-distiller.js +40 -0
  118. package/dist/memory/pipeline/neural-spark.d.ts +27 -0
  119. package/dist/memory/pipeline/neural-spark.js +78 -0
  120. package/dist/memory/pipeline/skill-prewarm.d.ts +63 -0
  121. package/dist/memory/pipeline/skill-prewarm.js +127 -0
  122. package/dist/memory/pipeline/task-queue.d.ts +54 -0
  123. package/dist/memory/pipeline/task-queue.js +117 -0
  124. package/dist/memory/prompts/cognitive-contradiction.d.ts +1 -0
  125. package/dist/memory/prompts/cognitive-contradiction.js +25 -0
  126. package/dist/memory/prompts/cognitive-extraction.d.ts +10 -0
  127. package/dist/memory/prompts/cognitive-extraction.js +114 -0
  128. package/dist/memory/prompts/core-identity.d.ts +6 -0
  129. package/dist/memory/prompts/core-identity.js +60 -0
  130. package/dist/memory/prompts/focus-direction-shift.d.ts +5 -0
  131. package/dist/memory/prompts/focus-direction-shift.js +32 -0
  132. package/dist/memory/prompts/focus-scene-cluster.d.ts +2 -0
  133. package/dist/memory/prompts/focus-scene-cluster.js +33 -0
  134. package/dist/memory/prompts/focus-scene.d.ts +7 -0
  135. package/dist/memory/prompts/focus-scene.js +40 -0
  136. package/dist/memory/prompts/graph-extraction-batch.d.ts +14 -0
  137. package/dist/memory/prompts/graph-extraction-batch.js +54 -0
  138. package/dist/memory/prompts/graph-extraction.d.ts +2 -0
  139. package/dist/memory/prompts/graph-extraction.js +53 -0
  140. package/dist/memory/prompts/l1-contradiction-batch.d.ts +16 -0
  141. package/dist/memory/prompts/l1-contradiction-batch.js +47 -0
  142. package/dist/memory/prompts/l1-contradiction.d.ts +1 -0
  143. package/dist/memory/prompts/l1-contradiction.js +25 -0
  144. package/dist/memory/prompts/l1-extraction.d.ts +10 -0
  145. package/dist/memory/prompts/l1-extraction.js +114 -0
  146. package/dist/memory/prompts/l2-direction-shift.d.ts +5 -0
  147. package/dist/memory/prompts/l2-direction-shift.js +32 -0
  148. package/dist/memory/prompts/l2-scene-cluster.d.ts +2 -0
  149. package/dist/memory/prompts/l2-scene-cluster.js +33 -0
  150. package/dist/memory/prompts/l2-scene.d.ts +7 -0
  151. package/dist/memory/prompts/l2-scene.js +40 -0
  152. package/dist/memory/prompts/l3-persona.d.ts +6 -0
  153. package/dist/memory/prompts/l3-persona.js +60 -0
  154. package/dist/memory/recall.d.ts +47 -0
  155. package/dist/memory/recall.js +427 -0
  156. package/dist/memory/redaction.d.ts +1 -0
  157. package/dist/memory/redaction.js +24 -0
  158. package/dist/memory/retry.d.ts +13 -0
  159. package/dist/memory/retry.js +53 -0
  160. package/dist/memory/scheduler.d.ts +9 -0
  161. package/dist/memory/scheduler.js +16 -0
  162. package/dist/memory/skill-hints-loader.d.ts +30 -0
  163. package/dist/memory/skill-hints-loader.js +100 -0
  164. package/dist/memory/store/embedding.d.ts +16 -0
  165. package/dist/memory/store/embedding.js +68 -0
  166. package/dist/memory/store/reranker.d.ts +24 -0
  167. package/dist/memory/store/reranker.js +83 -0
  168. package/dist/memory/store/sqlite.d.ts +167 -0
  169. package/dist/memory/store/sqlite.js +1816 -0
  170. package/dist/memory/store/types.d.ts +101 -0
  171. package/dist/memory/store/types.js +1 -0
  172. package/dist/memory/types.d.ts +207 -0
  173. package/dist/memory/types.js +7 -0
  174. package/dist/memory/validation.d.ts +441 -0
  175. package/dist/memory/validation.js +129 -0
  176. package/dist/memory/working/canvas.d.ts +5 -0
  177. package/dist/memory/working/canvas.js +43 -0
  178. package/dist/memory/working/offload.d.ts +71 -0
  179. package/dist/memory/working/offload.js +211 -0
  180. package/dist/memory/working/step-log.d.ts +16 -0
  181. package/dist/memory/working/step-log.js +35 -0
  182. package/dist/registry.d.ts +34 -0
  183. package/dist/registry.js +305 -0
  184. package/dist/resolver.d.ts +17 -0
  185. package/dist/resolver.js +126 -0
  186. package/dist/scripts/validate-foreign-workspace-path.d.ts +1 -0
  187. package/dist/scripts/validate-foreign-workspace-path.js +39 -0
  188. package/dist/tools/agent_memory_tools.d.ts +485 -0
  189. package/dist/tools/agent_memory_tools.js +793 -0
  190. package/dist/tools/create_skill.d.ts +46 -0
  191. package/dist/tools/create_skill.js +46 -0
  192. package/dist/tools/get_doc.d.ts +21 -0
  193. package/dist/tools/get_doc.js +24 -0
  194. package/dist/tools/get_persona.d.ts +15 -0
  195. package/dist/tools/get_persona.js +20 -0
  196. package/dist/tools/get_reference.d.ts +15 -0
  197. package/dist/tools/get_reference.js +20 -0
  198. package/dist/tools/get_skill.d.ts +34 -0
  199. package/dist/tools/get_skill.js +65 -0
  200. package/dist/tools/get_template_doc.d.ts +21 -0
  201. package/dist/tools/get_template_doc.js +24 -0
  202. package/dist/tools/list_docs.d.ts +15 -0
  203. package/dist/tools/list_docs.js +16 -0
  204. package/dist/tools/list_skills.d.ts +18 -0
  205. package/dist/tools/list_skills.js +17 -0
  206. package/dist/tools/list_template_docs.d.ts +15 -0
  207. package/dist/tools/list_template_docs.js +16 -0
  208. package/dist/tools/memory-engineering.d.ts +225 -0
  209. package/dist/tools/memory-engineering.js +284 -0
  210. package/dist/tools/memory-explain.d.ts +34 -0
  211. package/dist/tools/memory-explain.js +109 -0
  212. package/dist/tools/memory-governance.d.ts +171 -0
  213. package/dist/tools/memory-governance.js +224 -0
  214. package/dist/tools/memory-hooks.d.ts +67 -0
  215. package/dist/tools/memory-hooks.js +102 -0
  216. package/dist/tools/memory-working.d.ts +98 -0
  217. package/dist/tools/memory-working.js +101 -0
  218. package/dist/tools/memory_capture_turn.d.ts +66 -0
  219. package/dist/tools/memory_capture_turn.js +85 -0
  220. package/dist/tools/memory_consolidate.d.ts +55 -0
  221. package/dist/tools/memory_consolidate.js +176 -0
  222. package/dist/tools/memory_contradictions.d.ts +53 -0
  223. package/dist/tools/memory_contradictions.js +52 -0
  224. package/dist/tools/memory_graph_query.d.ts +51 -0
  225. package/dist/tools/memory_graph_query.js +35 -0
  226. package/dist/tools/memory_mark_cited.d.ts +43 -0
  227. package/dist/tools/memory_mark_cited.js +63 -0
  228. package/dist/tools/memory_recall.d.ts +77 -0
  229. package/dist/tools/memory_recall.js +81 -0
  230. package/dist/tools/memory_register_skill_hints.d.ts +49 -0
  231. package/dist/tools/memory_register_skill_hints.js +55 -0
  232. package/dist/tools/memory_resolve_session.d.ts +24 -0
  233. package/dist/tools/memory_resolve_session.js +133 -0
  234. package/dist/tools/memory_search.d.ts +146 -0
  235. package/dist/tools/memory_search.js +84 -0
  236. package/dist/tools/search_skills.d.ts +18 -0
  237. package/dist/tools/search_skills.js +17 -0
  238. package/dist/tools/update_doc.d.ts +24 -0
  239. package/dist/tools/update_doc.js +35 -0
  240. package/dist/tools/update_skill.d.ts +30 -0
  241. package/dist/tools/update_skill.js +80 -0
  242. package/dist/types.d.ts +81 -0
  243. package/dist/types.js +4 -0
  244. package/dist/writer.d.ts +30 -0
  245. package/dist/writer.js +220 -0
  246. package/docs/TEMPLATE ONLY +1 -0
  247. package/docs/api/API.md +64 -0
  248. package/docs/api/security/SECURITY.md +58 -0
  249. package/docs/deployment/DockerDeployment.md +30 -0
  250. package/docs/design/Design.md +59 -0
  251. package/docs/design/themes/apple.md +101 -0
  252. package/docs/design/themes/dieter-grid.md +100 -0
  253. package/docs/design/themes/gallery-white.md +100 -0
  254. package/docs/design/themes/pinterest.md +101 -0
  255. package/docs/design/themes/realty-open-house.md +101 -0
  256. package/docs/design/themes/vodafone.md +101 -0
  257. package/docs/hooks/Hooks.md +30 -0
  258. package/docs/schema/Schema.md +35 -0
  259. package/docs/strategy/ScalingStrategy.md +19 -0
  260. package/package.json +88 -0
  261. package/references/accessibility-checklist.md +160 -0
  262. package/references/orchestration-patterns.md +370 -0
  263. package/references/performance-checklist.md +153 -0
  264. package/references/security-checklist.md +134 -0
  265. package/references/testing-patterns.md +236 -0
  266. package/skills/agent/adr-skill/SKILL.md +299 -0
  267. package/skills/agent/agentic-engineering-workflow/SKILL.md +95 -0
  268. package/skills/agent/bootstrap-skill/SKILL.md +103 -0
  269. package/skills/agent/context-engineering/SKILL.md +307 -0
  270. package/skills/agent/debugging-and-error-recovery/SKILL.md +308 -0
  271. package/skills/agent/developer-growth-analysis/SKILL.md +328 -0
  272. package/skills/agent/doubt-driven-skill/SKILL.md +249 -0
  273. package/skills/agent/handover-skill/SKILL.md +112 -0
  274. package/skills/agent/idea-refine-skill/SKILL.md +185 -0
  275. package/skills/agent/idea-refine-skill/examples.md +238 -0
  276. package/skills/agent/idea-refine-skill/frameworks.md +99 -0
  277. package/skills/agent/idea-refine-skill/refinement-criteria.md +113 -0
  278. package/skills/agent/interview-skill/SKILL.md +226 -0
  279. package/skills/agent/planning-skill/SKILL.md +270 -0
  280. package/skills/agent/skill-authoring/SKILL.md +189 -0
  281. package/skills/agent/source-driven-skill/SKILL.md +197 -0
  282. package/skills/agent/spec-driven-skill/SKILL.md +221 -0
  283. package/skills/agent/sync-skill/SKILL.md +92 -0
  284. package/skills/agent/using-agent-skills/SKILL.md +189 -0
  285. package/skills/api/a11y-skill/SKILL.md +88 -0
  286. package/skills/api/api-skill/SKILL.md +123 -0
  287. package/skills/api/auth-skill/SKILL.md +80 -0
  288. package/skills/api/debug-skill/SKILL.md +535 -0
  289. package/skills/api/performance-skill/SKILL.md +100 -0
  290. package/skills/api/testing-skill/SKILL.md +100 -0
  291. package/skills/codebase/code-review-and-quality/SKILL.md +228 -0
  292. package/skills/codebase/code-simplification/SKILL.md +352 -0
  293. package/skills/codebase/code-structure-cleanup/SKILL.md +142 -0
  294. package/skills/codebase/concerns-skill/SKILL.md +89 -0
  295. package/skills/codebase/conventions-skill/SKILL.md +95 -0
  296. package/skills/codebase/doc-management-skill/SKILL.md +47 -0
  297. package/skills/codebase/git-workflow-skill/SKILL.md +312 -0
  298. package/skills/communication/1-3-1-rule/SKILL.md +120 -0
  299. package/skills/design/brutalist-skill/SKILL.md +131 -0
  300. package/skills/design/concept-diagrams/SKILL.md +387 -0
  301. package/skills/design/concept-diagrams/examples/apartment-floor-plan-conversion.md +244 -0
  302. package/skills/design/concept-diagrams/examples/automated-password-reset-flow.md +276 -0
  303. package/skills/design/concept-diagrams/examples/autonomous-llm-research-agent-flow.md +240 -0
  304. package/skills/design/concept-diagrams/examples/banana-journey-tree-to-smoothie.md +161 -0
  305. package/skills/design/concept-diagrams/examples/commercial-aircraft-structure.md +209 -0
  306. package/skills/design/concept-diagrams/examples/cpu-ooo-microarchitecture.md +236 -0
  307. package/skills/design/concept-diagrams/examples/electricity-grid-flow.md +182 -0
  308. package/skills/design/concept-diagrams/examples/feature-film-production-pipeline.md +172 -0
  309. package/skills/design/concept-diagrams/examples/hospital-emergency-department-flow.md +165 -0
  310. package/skills/design/concept-diagrams/examples/ml-benchmark-grouped-bar-chart.md +114 -0
  311. package/skills/design/concept-diagrams/examples/place-order-uml-sequence.md +325 -0
  312. package/skills/design/concept-diagrams/examples/smart-city-infrastructure.md +173 -0
  313. package/skills/design/concept-diagrams/examples/smartphone-layer-anatomy.md +154 -0
  314. package/skills/design/concept-diagrams/examples/sn2-reaction-mechanism.md +247 -0
  315. package/skills/design/concept-diagrams/examples/wind-turbine-structure.md +338 -0
  316. package/skills/design/concept-diagrams/references/dashboard-patterns.md +43 -0
  317. package/skills/design/concept-diagrams/references/infrastructure-patterns.md +144 -0
  318. package/skills/design/concept-diagrams/references/physical-shape-cookbook.md +42 -0
  319. package/skills/design/concept-diagrams/templates/template.html +174 -0
  320. package/skills/design/gpt-tasteskill/SKILL.md +114 -0
  321. package/skills/design/minimalist-skill/SKILL.md +116 -0
  322. package/skills/design/output-skill/SKILL.md +87 -0
  323. package/skills/design/redesign-skill/SKILL.md +213 -0
  324. package/skills/design/soft-skill/SKILL.md +132 -0
  325. package/skills/design/stitch-skill/EXAMPLE.md +121 -0
  326. package/skills/design/stitch-skill/SKILL.md +222 -0
  327. package/skills/design/taste-skill/SKILL.md +269 -0
  328. package/skills/devops/ci-cd-skill/SKILL.md +402 -0
  329. package/skills/devops/docker-skill/SKILL.md +297 -0
  330. package/skills/devops/domain-skill/SKILL.md +234 -0
  331. package/skills/lifecycle/changelog-generator/SKILL.md +135 -0
  332. package/skills/lifecycle/incremental-skill/SKILL.md +257 -0
  333. package/skills/lifecycle/migration-skill/SKILL.md +218 -0
  334. package/skills/lifecycle/shipping-skill/SKILL.md +321 -0
  335. package/skills/memory/agent-memory/SKILL.md +122 -0
  336. package/skills/qa/browser-testing-skill/SKILL.md +314 -0
  337. package/skills/ux/adversarial-ux-skill/SKILL.md +168 -0
@@ -0,0 +1,173 @@
1
+ # Smart City Infrastructure
2
+
3
+ A multi-system integration diagram showing interconnected city infrastructure (power, water, transport) connected through a central IoT platform with a citizen dashboard on top. Demonstrates hub-spoke layout, diverse physical shapes, and UI mockups.
4
+
5
+ ## Key Patterns Used
6
+
7
+ - **Hub-spoke layout**: Central IoT platform with radiating data connections to subsystems
8
+ - **Connection dots**: Visual indicators where data lines attach to the central hub
9
+ - **Dashboard/UI mockup**: Screen with mini-charts, gauges, and status indicators
10
+ - **Multi-system integration**: Three independent systems unified by central platform
11
+ - **Semantic line styles**: Different stroke styles for data (dashed), power, water, roads
12
+ - **Physical infrastructure shapes**: Solar panels, wind turbines, dams, pipes, roads, vehicles
13
+
14
+ ## New Shape Techniques
15
+
16
+ ### Solar Panels (angled polygons with grid lines)
17
+ ```xml
18
+ <polygon class="solar-panel" points="0,25 35,8 38,12 3,29"/>
19
+ <line class="solar-frame" x1="12" y1="22" x2="24" y2="13"/>
20
+ <line x1="19" y1="29" x2="19" y2="40" stroke="#5F5E5A" stroke-width="2"/>
21
+ ```
22
+
23
+ ### Wind Turbine (tower + nacelle + blades)
24
+ ```xml
25
+ <!-- Tapered tower -->
26
+ <polygon class="wind-tower" points="20,70 30,70 28,25 22,25"/>
27
+ <!-- Nacelle -->
28
+ <rect class="wind-hub" x="18" y="20" width="14" height="8" rx="2"/>
29
+ <!-- Hub -->
30
+ <circle class="wind-hub" cx="25" cy="18" r="5"/>
31
+ <!-- Blades (rotated ellipses) -->
32
+ <ellipse class="wind-blade" cx="25" cy="5" rx="3" ry="13"/>
33
+ <ellipse class="wind-blade" cx="14" cy="26" rx="3" ry="13" transform="rotate(-120, 25, 18)"/>
34
+ <ellipse class="wind-blade" cx="36" cy="26" rx="3" ry="13" transform="rotate(120, 25, 18)"/>
35
+ ```
36
+
37
+ ### Battery with Charge Level
38
+ ```xml
39
+ <rect class="battery" x="0" y="0" width="45" height="65" rx="5"/>
40
+ <!-- Terminals -->
41
+ <rect x="10" y="-6" width="10" height="8" rx="2" fill="#27500A"/>
42
+ <rect x="25" y="-6" width="10" height="8" rx="2" fill="#27500A"/>
43
+ <!-- Charge level fill -->
44
+ <rect class="battery-level" x="5" y="12" width="35" height="48" rx="3"/>
45
+ <text x="22" y="42" text-anchor="middle" fill="#173404" style="font-size:10px">85%</text>
46
+ ```
47
+
48
+ ### Dam/Reservoir with Water Waves
49
+ ```xml
50
+ <!-- Dam wall -->
51
+ <polygon class="reservoir-wall" points="0,60 10,0 70,0 80,60"/>
52
+ <!-- Water behind dam -->
53
+ <polygon class="water" points="12,10 68,10 68,55 75,55 75,58 5,58 5,55 12,55"/>
54
+ <!-- Wave effect -->
55
+ <path d="M 15 25 Q 25 22 35 25 Q 45 28 55 25" fill="none" stroke="#378ADD" stroke-width="1" opacity="0.5"/>
56
+ ```
57
+
58
+ ### Pipe Network with Joints and Valves
59
+ ```xml
60
+ <path class="pipe" d="M 80 85 L 110 85"/>
61
+ <circle class="pipe-joint" cx="10" cy="30" r="8"/>
62
+ <circle class="valve" cx="190" cy="85" r="6"/>
63
+ <!-- Distribution branches -->
64
+ <path class="pipe-thin" d="M 18 30 L 50 30"/>
65
+ <path class="pipe-thin" d="M 10 22 L 10 5 L 50 5"/>
66
+ ```
67
+
68
+ ### Road Intersection with Lane Markings
69
+ ```xml
70
+ <!-- Road surface -->
71
+ <line class="road" x1="0" y1="50" x2="170" y2="50"/>
72
+ <line class="road-mark" x1="10" y1="50" x2="160" y2="50"/>
73
+ <!-- Cross road -->
74
+ <line class="road" x1="85" y1="0" x2="85" y2="100"/>
75
+ <line class="road-mark" x1="85" y1="10" x2="85" y2="90"/>
76
+ <!-- Embedded sensors -->
77
+ <circle class="sensor" cx="40" cy="50" r="5"/>
78
+ ```
79
+
80
+ ### Traffic Light with Signal States
81
+ ```xml
82
+ <rect class="traffic-light" x="0" y="0" width="14" height="32" rx="3"/>
83
+ <circle class="light-red" cx="7" cy="8" r="4"/>
84
+ <circle class="light-off" cx="7" cy="16" r="4"/>
85
+ <circle class="light-off" cx="7" cy="24" r="4"/>
86
+ ```
87
+
88
+ ### Bus with Windows and Wheels
89
+ ```xml
90
+ <rect class="bus" x="0" y="0" width="55" height="28" rx="6"/>
91
+ <!-- Windows -->
92
+ <rect class="bus-window" x="5" y="5" width="12" height="12" rx="2"/>
93
+ <rect class="bus-window" x="20" y="5" width="12" height="12" rx="2"/>
94
+ <!-- Wheels with hubcaps -->
95
+ <circle cx="14" cy="30" r="6" fill="#2C2C2A"/>
96
+ <circle cx="14" cy="30" r="3" fill="#5F5E5A"/>
97
+ ```
98
+
99
+ ### Dashboard UI Mockup
100
+ ```xml
101
+ <!-- Monitor frame -->
102
+ <rect class="dashboard" x="0" y="0" width="200" height="120" rx="8"/>
103
+ <!-- Screen -->
104
+ <rect class="screen" x="10" y="10" width="180" height="85" rx="4"/>
105
+ <!-- Mini bar chart -->
106
+ <rect class="screen-content" x="18" y="18" width="50" height="35" rx="2"/>
107
+ <rect class="screen-chart" x="22" y="38" width="8" height="12"/>
108
+ <rect class="screen-chart" x="33" y="32" width="8" height="18"/>
109
+ <!-- Gauge -->
110
+ <circle class="screen-bar" cx="100" cy="35" r="12"/>
111
+ <text x="100" y="39" text-anchor="middle" fill="#E8E6DE" style="font-size:8px">78%</text>
112
+ <!-- Status indicators -->
113
+ <circle cx="35" cy="74" r="6" fill="#97C459"/>
114
+ <circle cx="75" cy="74" r="6" fill="#97C459"/>
115
+ <circle cx="115" cy="74" r="6" fill="#EF9F27"/>
116
+ ```
117
+
118
+ ### Hexagonal IoT Hub with Connection Points
119
+ ```xml
120
+ <!-- Outer hexagon -->
121
+ <polygon class="iot-hex" points="0,-45 39,-22 39,22 0,45 -39,22 -39,-22"/>
122
+ <!-- Inner hexagon -->
123
+ <polygon class="iot-inner" points="0,-20 17,-10 17,10 0,20 -17,10 -17,-10"/>
124
+ <!-- Connection dots on data lines -->
125
+ <circle cx="321" cy="248" r="4" fill="#7F77DD"/>
126
+ ```
127
+
128
+ ## CSS Classes for Infrastructure
129
+
130
+ ```css
131
+ /* Power system */
132
+ .solar-panel { fill: #3C3489; stroke: #534AB7; stroke-width: 0.5; }
133
+ .solar-frame { fill: none; stroke: #EEEDFE; stroke-width: 0.5; }
134
+ .wind-tower { fill: #B4B2A9; stroke: #5F5E5A; stroke-width: 1; }
135
+ .wind-blade { fill: #F1EFE8; stroke: #888780; stroke-width: 0.5; }
136
+ .battery { fill: #27500A; stroke: #3B6D11; stroke-width: 1.5; }
137
+ .battery-level { fill: #97C459; }
138
+ .power-line { stroke: #EF9F27; stroke-width: 2; fill: none; }
139
+
140
+ /* Water system */
141
+ .reservoir-wall { fill: #B4B2A9; stroke: #5F5E5A; stroke-width: 1; }
142
+ .water { fill: #85B7EB; stroke: #378ADD; stroke-width: 0.5; }
143
+ .pipe { fill: none; stroke: #378ADD; stroke-width: 4; stroke-linecap: round; }
144
+ .pipe-joint { fill: #185FA5; stroke: #0C447C; stroke-width: 1; }
145
+ .valve { fill: #0C447C; stroke: #185FA5; stroke-width: 1; }
146
+
147
+ /* Transport */
148
+ .road { stroke: #888780; stroke-width: 8; fill: none; stroke-linecap: round; }
149
+ .road-mark { stroke: #F1EFE8; stroke-width: 1; fill: none; stroke-dasharray: 6 4; }
150
+ .traffic-light { fill: #444441; stroke: #2C2C2A; stroke-width: 0.5; }
151
+ .light-red { fill: #E24B4A; }
152
+ .light-green { fill: #97C459; }
153
+ .light-off { fill: #2C2C2A; }
154
+ .bus { fill: #E1F5EE; stroke: #0F6E56; stroke-width: 1.5; }
155
+
156
+ /* Data/IoT */
157
+ .data-line { stroke: #7F77DD; stroke-width: 2; fill: none; stroke-dasharray: 4 3; }
158
+ .iot-hex { fill: #EEEDFE; stroke: #534AB7; stroke-width: 2; }
159
+
160
+ /* Dashboard */
161
+ .dashboard { fill: #F1EFE8; stroke: #5F5E5A; stroke-width: 1.5; }
162
+ .screen { fill: #1a1a18; }
163
+ .screen-chart { fill: #5DCAA5; }
164
+ ```
165
+
166
+ ## Layout Notes
167
+
168
+ - **ViewBox**: 720×620 (wider for three-column system layout)
169
+ - **Hub position**: Central IoT at (360, 270) - geometric center
170
+ - **Data lines**: Use quadratic curves or L-shaped paths, add connection dots at hub attachment points
171
+ - **System spacing**: ~200px width per system section
172
+ - **Vertical layers**: Dashboard (top) → IoT Hub (middle) → Systems (bottom)
173
+ - **Component grouping**: Use `<g transform="translate(x,y)">` for each major component for easy positioning
@@ -0,0 +1,154 @@
1
+ # Smartphone Layer Anatomy
2
+
3
+ An exploded view diagram showing all internal layers of a smartphone from front glass to back, with alternating left/right labels to avoid overlap. Demonstrates layered product teardown visualization and component detail.
4
+
5
+ ## Key Patterns Used
6
+
7
+ - **Exploded vertical stack**: Layers separated vertically to show internal structure
8
+ - **Alternating labels**: Left/right label placement prevents text overlap
9
+ - **Component detail**: Chips, coils, lenses rendered with realistic shapes
10
+ - **Thickness scale**: Measurement indicator on the side
11
+ - **Progressive depth**: Each layer slightly offset to create 3D stack effect
12
+
13
+ ## New Shape Techniques
14
+
15
+ ### Capacitive Touch Grid
16
+ ```xml
17
+ <rect class="digitizer" x="0" y="0" width="140" height="90" rx="14"/>
18
+ <g transform="translate(8, 8)">
19
+ <!-- Horizontal lines -->
20
+ <line class="digitizer-grid" x1="0" y1="15" x2="124" y2="15"/>
21
+ <line class="digitizer-grid" x1="0" y1="37" x2="124" y2="37"/>
22
+ <!-- Vertical lines -->
23
+ <line class="digitizer-grid" x1="20" y1="0" x2="20" y2="74"/>
24
+ <line class="digitizer-grid" x1="50" y1="0" x2="50" y2="74"/>
25
+ </g>
26
+ <!-- Touch point indicator -->
27
+ <circle cx="70" cy="45" r="12" fill="none" stroke="#7F77DD" stroke-width="2" opacity="0.6"/>
28
+ <circle cx="70" cy="45" r="5" fill="#7F77DD" opacity="0.4"/>
29
+ ```
30
+
31
+ ### OLED RGB Subpixels
32
+ ```xml
33
+ <rect class="oled-panel" x="0" y="0" width="140" height="90" rx="12"/>
34
+ <g transform="translate(10, 10)">
35
+ <!-- RGB pixel group -->
36
+ <rect class="oled-subpixel-r" x="0" y="0" width="2" height="6"/>
37
+ <rect class="oled-subpixel-g" x="3" y="0" width="2" height="6"/>
38
+ <rect class="oled-subpixel-b" x="6" y="0" width="2" height="6"/>
39
+ <!-- Repeat pattern -->
40
+ <rect class="oled-subpixel-r" x="11" y="0" width="2" height="6"/>
41
+ <rect class="oled-subpixel-g" x="14" y="0" width="2" height="6"/>
42
+ <rect class="oled-subpixel-b" x="17" y="0" width="2" height="6"/>
43
+ </g>
44
+ ```
45
+
46
+ ### Logic Board with Chips
47
+ ```xml
48
+ <rect class="pcb" x="0" y="0" width="116" height="106" rx="3"/>
49
+ <!-- PCB traces -->
50
+ <path class="pcb-trace" d="M 8 50 L 30 50 L 30 35"/>
51
+
52
+ <!-- CPU chip -->
53
+ <rect class="chip-cpu" x="30" y="20" width="55" height="35" rx="3"/>
54
+ <text class="chip-label" x="57" y="35" text-anchor="middle">A17 Pro</text>
55
+
56
+ <!-- RAM chip -->
57
+ <rect class="chip-ram" x="30" y="62" width="35" height="18" rx="2"/>
58
+ <text class="chip-label" x="47" y="74" text-anchor="middle">8GB RAM</text>
59
+
60
+ <!-- Storage chip -->
61
+ <rect class="chip-storage" x="30" y="85" width="55" height="16" rx="2"/>
62
+ <text class="chip-label" x="57" y="96" text-anchor="middle">256GB NAND</text>
63
+ ```
64
+
65
+ ### Camera Lens Array
66
+ ```xml
67
+ <!-- Main camera -->
68
+ <circle class="camera-lens" cx="20" cy="20" r="18"/>
69
+ <circle class="camera-lens-inner" cx="20" cy="20" r="13"/>
70
+ <circle class="camera-sensor" cx="20" cy="20" r="8"/>
71
+ <circle cx="20" cy="20" r="3" fill="#1a1a18"/>
72
+
73
+ <!-- Secondary camera (smaller) -->
74
+ <circle class="camera-lens" cx="15" cy="15" r="13"/>
75
+ <circle class="camera-lens-inner" cx="15" cy="15" r="9"/>
76
+ <circle class="camera-sensor" cx="15" cy="15" r="5"/>
77
+ ```
78
+
79
+ ### Wireless Charging Coil with Magnets
80
+ ```xml
81
+ <!-- Concentric coil rings -->
82
+ <circle class="charging-coil-outer" cx="0" cy="0" r="30"/>
83
+ <circle class="charging-coil" cx="0" cy="0" r="23"/>
84
+ <circle class="charging-coil" cx="0" cy="0" r="16"/>
85
+ <circle class="charging-coil" cx="0" cy="0" r="9"/>
86
+
87
+ <!-- MagSafe magnet ring -->
88
+ <circle class="magnet" cx="0" cy="-35" r="3"/>
89
+ <circle class="magnet" cx="25" cy="-25" r="3"/>
90
+ <circle class="magnet" cx="35" cy="0" r="3"/>
91
+ <circle class="magnet" cx="25" cy="25" r="3"/>
92
+ <!-- ... continue around circle -->
93
+ ```
94
+
95
+ ### Battery Cell
96
+ ```xml
97
+ <rect class="battery" x="0" y="0" width="140" height="90" rx="10"/>
98
+ <rect class="battery-cell" x="10" y="12" width="120" height="60" rx="6"/>
99
+
100
+ <text x="70" y="38" text-anchor="middle" fill="#27500A" style="font-size:9px">Li-Ion Polymer</text>
101
+ <text x="70" y="52" text-anchor="middle" fill="#27500A" style="font-size:12px; font-weight:bold">4422 mAh</text>
102
+
103
+ <rect class="battery-connector" x="55" y="75" width="30" height="10" rx="2"/>
104
+ ```
105
+
106
+ ## CSS Classes
107
+
108
+ ```css
109
+ /* Glass */
110
+ .front-glass { fill: #E8E6DE; stroke: #888780; stroke-width: 1; opacity: 0.9; }
111
+ .back-glass { fill: #2C2C2A; stroke: #444441; stroke-width: 1; }
112
+
113
+ /* Touch digitizer */
114
+ .digitizer { fill: #EEEDFE; stroke: #534AB7; stroke-width: 1; }
115
+ .digitizer-grid { stroke: #AFA9EC; stroke-width: 0.3; fill: none; }
116
+
117
+ /* OLED */
118
+ .oled-panel { fill: #1a1a18; stroke: #444441; stroke-width: 1; }
119
+ .oled-subpixel-r { fill: #E24B4A; }
120
+ .oled-subpixel-g { fill: #97C459; }
121
+ .oled-subpixel-b { fill: #378ADD; }
122
+
123
+ /* Midframe */
124
+ .midframe { fill: #B4B2A9; stroke: #5F5E5A; stroke-width: 1.5; }
125
+
126
+ /* Logic board */
127
+ .pcb { fill: #0F6E56; stroke: #085041; stroke-width: 1; }
128
+ .pcb-trace { stroke: #5DCAA5; stroke-width: 0.3; fill: none; }
129
+ .chip-cpu { fill: #3C3489; stroke: #534AB7; stroke-width: 0.5; }
130
+ .chip-ram { fill: #185FA5; stroke: #378ADD; stroke-width: 0.5; }
131
+ .chip-storage { fill: #27500A; stroke: #3B6D11; stroke-width: 0.5; }
132
+
133
+ /* Battery */
134
+ .battery { fill: #EAF3DE; stroke: #3B6D11; stroke-width: 1.5; }
135
+ .battery-cell { fill: #97C459; stroke: #639922; stroke-width: 0.5; }
136
+
137
+ /* Camera */
138
+ .camera-lens { fill: #0C447C; stroke: #185FA5; stroke-width: 0.5; }
139
+ .camera-lens-inner { fill: #1a1a18; stroke: #378ADD; stroke-width: 0.3; }
140
+ .camera-sensor { fill: #3C3489; stroke: #534AB7; stroke-width: 0.3; }
141
+
142
+ /* Wireless charging */
143
+ .charging-coil { fill: none; stroke: #EF9F27; stroke-width: 1.5; }
144
+ .magnet { fill: #5F5E5A; stroke: #444441; stroke-width: 0.5; }
145
+ ```
146
+
147
+ ## Layout Notes
148
+
149
+ - **ViewBox**: 900×780 (tall for vertical stack)
150
+ - **Layer offset**: Each layer offset 10px right and down for depth effect
151
+ - **Label alternation**: Odd layers → RIGHT labels, Even layers → LEFT labels
152
+ - **Thickness scale**: Vertical measurement bar on left side
153
+ - **Front/Back markers**: Text labels at top and bottom
154
+ - **Chip labels**: Use small white text (6px) directly on chip shapes
@@ -0,0 +1,247 @@
1
+ # SN2 Reaction Mechanism
2
+
3
+ A chemistry diagram showing the bimolecular nucleophilic substitution (SN2) mechanism between hydroxide ion and methyl bromide. Demonstrates molecular structure rendering, electron movement arrows, transition state notation, and reaction energy profiles.
4
+
5
+ ## Key Patterns Used
6
+
7
+ - **Molecular structures**: Ball-and-stick style atoms with bonds
8
+ - **Electron movement**: Curved arrows showing nucleophilic attack
9
+ - **Transition state**: Bracketed pentacoordinate intermediate with partial charges
10
+ - **Stereochemistry**: Wedge/dash bonds showing 3D configuration
11
+ - **Energy profile**: Potential energy vs reaction coordinate plot
12
+ - **Annotation boxes**: Key features and mechanistic notes
13
+
14
+ ## Diagram Type
15
+
16
+ This is a **chemistry mechanism diagram** with:
17
+ - **Molecular rendering**: Atoms as colored circles with element symbols
18
+ - **Bond notation**: Solid, wedge, dash, and partial (dashed) bonds
19
+ - **Reaction arrows**: Curved for electron movement, straight for reaction progress
20
+ - **Energy landscape**: Quantitative energy profile below mechanism
21
+
22
+ ## Molecular Structure Elements
23
+
24
+ ### Atom Rendering
25
+
26
+ ```xml
27
+ <!-- Carbon atom (dark) -->
28
+ <circle cx="0" cy="0" r="14" class="carbon"/>
29
+ <text class="chem" x="0" y="5" text-anchor="middle" fill="white" font-weight="500">C</text>
30
+
31
+ <!-- Oxygen atom (red) -->
32
+ <circle cx="0" cy="0" r="14" class="oxygen"/>
33
+ <text class="chem" x="0" y="5" text-anchor="middle" fill="white" font-weight="500">O</text>
34
+
35
+ <!-- Hydrogen atom (light with border) -->
36
+ <circle cx="38" cy="0" r="8" class="hydrogen"/>
37
+ <text class="chem-sm" x="38" y="4" text-anchor="middle">H</text>
38
+
39
+ <!-- Bromine atom (brown) -->
40
+ <circle cx="52" cy="0" r="16" class="bromine"/>
41
+ <text class="chem" x="52" y="5" text-anchor="middle" fill="white" font-weight="500">Br</text>
42
+ ```
43
+
44
+ ```css
45
+ .carbon { fill: #2C2C2A; }
46
+ .hydrogen { fill: #F1EFE8; stroke: #888780; stroke-width: 1; }
47
+ .oxygen { fill: #E24B4A; }
48
+ .bromine { fill: #993C1D; }
49
+ .nitrogen { fill: #378ADD; } /* for other reactions */
50
+ ```
51
+
52
+ ### Bond Types
53
+
54
+ ```xml
55
+ <!-- Single bond (solid) -->
56
+ <line x1="14" y1="0" x2="38" y2="0" class="bond"/>
57
+
58
+ <!-- Wedge bond (coming toward viewer) -->
59
+ <polygon class="bond-wedge" points="0,-14 -6,-35 6,-35"/>
60
+
61
+ <!-- Dash bond (going away from viewer) -->
62
+ <line x1="-10" y1="10" x2="-28" y2="28" class="bond-dash"/>
63
+
64
+ <!-- Partial bond (forming/breaking) -->
65
+ <line x1="-40" y1="0" x2="-14" y2="0" class="bond-partial"/>
66
+ ```
67
+
68
+ ```css
69
+ .bond { stroke: var(--text-primary); stroke-width: 2.5; fill: none; stroke-linecap: round; }
70
+ .bond-thin { stroke: var(--text-primary); stroke-width: 1.5; fill: none; }
71
+ .bond-partial { stroke: var(--text-primary); stroke-width: 2; fill: none; stroke-dasharray: 4 3; }
72
+ .bond-wedge { fill: var(--text-primary); stroke: none; }
73
+ .bond-dash { stroke: var(--text-primary); stroke-width: 2; fill: none; stroke-dasharray: 2 2; }
74
+ ```
75
+
76
+ ### Lone Pairs and Charges
77
+
78
+ ```xml
79
+ <!-- Lone pair electrons (dots) -->
80
+ <circle cx="-8" cy="-18" r="2" fill="var(--text-primary)"/>
81
+ <circle cx="0" cy="-18" r="2" fill="var(--text-primary)"/>
82
+
83
+ <!-- Formal negative charge -->
84
+ <text class="charge" x="12" y="-12" fill="#A32D2D" font-weight="bold">⊖</text>
85
+
86
+ <!-- Partial charges (delta notation) -->
87
+ <text class="partial" x="0" y="-18" text-anchor="middle" fill="#A32D2D">δ⁻</text>
88
+ <text class="partial" x="0" y="-22" text-anchor="middle" fill="#3B6D11">δ⁺</text>
89
+ ```
90
+
91
+ ```css
92
+ .charge { font-family: "Times New Roman", Georgia, serif; font-size: 12px; }
93
+ .partial { font-family: "Times New Roman", Georgia, serif; font-size: 11px; font-style: italic; }
94
+ ```
95
+
96
+ ### Curved Arrow (Electron Movement)
97
+
98
+ ```xml
99
+ <defs>
100
+ <marker id="curved-arrow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto">
101
+ <path d="M0,0 L10,5 L0,10 L3,5 Z" class="arrow-fill"/>
102
+ </marker>
103
+ </defs>
104
+
105
+ <!-- Nucleophilic attack arrow -->
106
+ <path d="M -5,15 Q 30,60 70,25" class="arrow-curved" marker-end="url(#curved-arrow)"/>
107
+ ```
108
+
109
+ ```css
110
+ .arrow-curved { stroke: #534AB7; stroke-width: 2; fill: none; }
111
+ .arrow-fill { fill: #534AB7; }
112
+ ```
113
+
114
+ ### Transition State Brackets
115
+
116
+ ```xml
117
+ <!-- Left bracket -->
118
+ <path d="M -75,-70 L -85,-70 L -85,75 L -75,75" class="ts-bracket"/>
119
+
120
+ <!-- Right bracket -->
121
+ <path d="M 95,-70 L 105,-70 L 105,75 L 95,75" class="ts-bracket"/>
122
+
123
+ <!-- Double dagger symbol -->
124
+ <text class="chem" x="115" y="-60" fill="var(--text-primary)">‡</text>
125
+ ```
126
+
127
+ ```css
128
+ .ts-bracket { stroke: var(--text-primary); stroke-width: 1.5; fill: none; }
129
+ ```
130
+
131
+ ## Energy Profile Diagram
132
+
133
+ ### Axes
134
+
135
+ ```xml
136
+ <!-- Y-axis (Energy) -->
137
+ <line x1="0" y1="280" x2="0" y2="0" class="axis" marker-end="url(#straight-arrow)"/>
138
+ <text class="t" x="-15" y="-10" text-anchor="middle" transform="rotate(-90 -15 140)">Potential Energy</text>
139
+
140
+ <!-- X-axis (Reaction Coordinate) -->
141
+ <line x1="0" y1="280" x2="600" y2="280" class="axis" marker-end="url(#straight-arrow)"/>
142
+ <text class="t" x="580" y="305" text-anchor="middle">Reaction Coordinate</text>
143
+ ```
144
+
145
+ ### Energy Curve
146
+
147
+ ```xml
148
+ <!-- Filled area under curve -->
149
+ <path class="energy-fill" d="
150
+ M 40,200
151
+ Q 150,200 250,50
152
+ Q 350,200 500,220
153
+ L 500,280 L 40,280 Z
154
+ "/>
155
+
156
+ <!-- Curve line -->
157
+ <path class="energy-curve" d="
158
+ M 40,200
159
+ Q 100,200 150,150
160
+ Q 200,80 250,50
161
+ Q 300,80 350,150
162
+ Q 400,210 500,220
163
+ "/>
164
+ ```
165
+
166
+ ```css
167
+ .energy-curve { stroke: #534AB7; stroke-width: 2.5; fill: none; }
168
+ .energy-fill { fill: rgba(83, 74, 183, 0.1); }
169
+ ```
170
+
171
+ ### Energy Levels and Annotations
172
+
173
+ ```xml
174
+ <!-- Reactants level -->
175
+ <line x1="20" y1="200" x2="80" y2="200" stroke="#3B6D11" stroke-width="2"/>
176
+ <text class="ts" x="50" y="218" text-anchor="middle">Reactants</text>
177
+
178
+ <!-- Transition state peak -->
179
+ <circle cx="250" cy="50" r="5" fill="#534AB7"/>
180
+ <line x1="250" y1="50" x2="250" y2="280" class="energy-level"/>
181
+ <text class="ts" x="250" y="30" text-anchor="middle" fill="#534AB7" font-weight="500">Transition State [‡]</text>
182
+
183
+ <!-- Products level (lower = exergonic) -->
184
+ <line x1="470" y1="220" x2="530" y2="220" stroke="#3B6D11" stroke-width="2"/>
185
+
186
+ <!-- Activation energy arrow -->
187
+ <line x1="100" y1="200" x2="100" y2="55" class="delta-arrow" marker-end="url(#delta-arrow)"/>
188
+ <text class="ts" x="85" y="125" text-anchor="end" fill="#3B6D11">E<tspan baseline-shift="sub" font-size="8">a</tspan></text>
189
+ ```
190
+
191
+ ```css
192
+ .energy-level { stroke: var(--text-secondary); stroke-width: 1; stroke-dasharray: 4 2; fill: none; }
193
+ .delta-arrow { stroke: #3B6D11; stroke-width: 1.5; fill: none; }
194
+ .delta-fill { fill: #3B6D11; }
195
+ ```
196
+
197
+ ## Chemistry Text Styles
198
+
199
+ ```css
200
+ /* Chemistry notation (serif font for formulas) */
201
+ .chem { font-family: "Times New Roman", Georgia, serif; font-size: 16px; fill: var(--text-primary); }
202
+ .chem-sm { font-family: "Times New Roman", Georgia, serif; font-size: 12px; fill: var(--text-primary); }
203
+ .chem-lg { font-family: "Times New Roman", Georgia, serif; font-size: 18px; fill: var(--text-primary); }
204
+ ```
205
+
206
+ ## Subscript/Superscript in SVG
207
+
208
+ ```xml
209
+ <!-- Subscript using tspan -->
210
+ <text class="ts">E<tspan baseline-shift="sub" font-size="8">a</tspan></text>
211
+
212
+ <!-- Superscript for charges -->
213
+ <text class="chem-sm">OH⁻</text> <!-- Using Unicode superscript minus -->
214
+ <text class="chem-sm">CH₃Br</text> <!-- Using Unicode subscript 3 -->
215
+ ```
216
+
217
+ ## Color Coding
218
+
219
+ | Element | Color | Hex |
220
+ |---------|-------|-----|
221
+ | Carbon | Dark gray | #2C2C2A |
222
+ | Hydrogen | Light cream | #F1EFE8 |
223
+ | Oxygen | Red | #E24B4A |
224
+ | Bromine | Brown | #993C1D |
225
+ | Nitrogen | Blue | #378ADD |
226
+ | Electron arrows | Purple | #534AB7 |
227
+ | Positive charge | Green | #3B6D11 |
228
+ | Negative charge | Red | #A32D2D |
229
+
230
+ ## Layout Notes
231
+
232
+ - **ViewBox**: 800×680 (landscape for mechanism + energy profile)
233
+ - **Mechanism section**: y=60-300, showing reactants → TS → products
234
+ - **Energy profile**: y=320-630, with axes and curve
235
+ - **Atom sizes**: C/O/Br ~12-16px radius, H ~7-8px radius
236
+ - **Bond lengths**: ~25-40px between atom centers
237
+ - **Spacing**: ~140px between mechanism stages
238
+
239
+ ## When to Use This Pattern
240
+
241
+ Use this diagram style for:
242
+ - Organic reaction mechanisms (SN1, SN2, E1, E2, additions, eliminations)
243
+ - Reaction energy profiles and kinetics
244
+ - Stereochemistry illustrations
245
+ - Enzyme mechanism diagrams
246
+ - Transition state theory visualization
247
+ - Any chemistry concept requiring molecular structures