@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,244 @@
1
+ # Apartment Floor Plan: 3 BHK to 4 BHK Conversion
2
+
3
+ An architectural floor plan showing a 1,500 sq ft apartment with proposed modifications to convert from 3 BHK to 4 BHK. Demonstrates architectural drawing conventions, room layouts, proposed changes with dotted lines, and area comparison tables.
4
+
5
+ ## Key Patterns Used
6
+
7
+ - **Architectural floor plan**: Top-down view with walls, doors, windows
8
+ - **Proposed modifications**: Dotted red lines for new walls
9
+ - **Room color coding**: Light fills to distinguish room types
10
+ - **Circulation paths**: Arrows showing new access routes
11
+ - **Data table**: Before/after area comparison with highlighting
12
+ - **Architectural symbols**: North arrow, scale bar, door swings
13
+
14
+ ## Diagram Type
15
+
16
+ This is an **architectural floor plan** with:
17
+ - **Plan view**: Top-down orthographic projection
18
+ - **Overlay technique**: Existing structure + proposed changes
19
+ - **Quantitative data**: Area measurements and comparison table
20
+
21
+ ## Architectural Drawing Elements
22
+
23
+ ### Wall Styles
24
+
25
+ ```xml
26
+ <!-- Outer walls (thick) -->
27
+ <line class="wall" x1="0" y1="0" x2="560" y2="0"/>
28
+
29
+ <!-- Internal walls (thinner) -->
30
+ <line class="wall-thin" x1="180" y1="0" x2="180" y2="140"/>
31
+
32
+ <!-- Proposed new walls (dotted red) -->
33
+ <line class="proposed-wall" x1="125" y1="170" x2="125" y2="330"/>
34
+ ```
35
+
36
+ ```css
37
+ .wall { stroke: var(--text-primary); stroke-width: 6; fill: none; stroke-linecap: square; }
38
+ .wall-thin { stroke: var(--text-primary); stroke-width: 3; fill: none; }
39
+ .proposed-wall { stroke: #A32D2D; stroke-width: 4; fill: none; stroke-dasharray: 8 4; }
40
+ ```
41
+
42
+ ### Door Symbols
43
+
44
+ ```xml
45
+ <!-- Door opening with swing arc -->
46
+ <rect x="150" y="137" width="25" height="6" fill="var(--bg-primary)"/>
47
+ <path class="door" d="M150,140 L150,165"/>
48
+ <path class="door-swing" d="M150,140 A25,25 0 0,0 175,140"/>
49
+
50
+ <!-- Sliding door (balcony) -->
51
+ <rect x="60" y="327" width="60" height="6" fill="var(--bg-primary)" stroke="var(--text-secondary)" stroke-width="1"/>
52
+ <line x1="60" y1="330" x2="90" y2="330" stroke="var(--text-secondary)" stroke-width="2"/>
53
+ <line x1="90" y1="330" x2="120" y2="330" stroke="var(--text-secondary)" stroke-width="2" stroke-dasharray="3 3"/>
54
+
55
+ <!-- Proposed door (dotted) -->
56
+ <rect x="143" y="292" width="22" height="6" fill="var(--bg-primary)" stroke="#A32D2D" stroke-width="1" stroke-dasharray="3 2"/>
57
+ <path d="M165,295 A22,22 0 0,0 165,273" stroke="#A32D2D" stroke-width="1" stroke-dasharray="3 2" fill="none"/>
58
+ ```
59
+
60
+ ```css
61
+ .door { stroke: var(--text-secondary); stroke-width: 1.5; fill: none; }
62
+ .door-swing { stroke: var(--text-tertiary); stroke-width: 1; fill: none; stroke-dasharray: 3 2; }
63
+ ```
64
+
65
+ ### Window Symbols
66
+
67
+ ```xml
68
+ <!-- Window with glass indication -->
69
+ <rect class="window" x="-3" y="30" width="6" height="50"/>
70
+ <line class="window-glass" x1="0" y1="35" x2="0" y2="75"/>
71
+
72
+ <!-- Horizontal window (top wall) -->
73
+ <rect class="window" x="220" y="-3" width="60" height="6"/>
74
+ <line class="window-glass" x1="225" y1="0" x2="275" y2="0"/>
75
+ ```
76
+
77
+ ```css
78
+ .window { stroke: var(--text-primary); stroke-width: 1; fill: var(--bg-primary); }
79
+ .window-glass { stroke: #378ADD; stroke-width: 2; fill: none; }
80
+ ```
81
+
82
+ ### Room Fills
83
+
84
+ ```xml
85
+ <!-- Different colors for room types -->
86
+ <rect class="room-master" x="3" y="3" width="174" height="134" rx="2"/>
87
+ <rect class="room-bed2" x="183" y="3" width="134" height="104" rx="2"/>
88
+ <rect class="room-living" x="3" y="173" width="554" height="154" rx="2"/>
89
+ <rect class="room-kitchen" x="443" y="3" width="114" height="104" rx="2"/>
90
+ <rect class="room-bath" x="183" y="113" width="54" height="54" rx="2"/>
91
+
92
+ <!-- Proposed new room (highlighted) -->
93
+ <rect class="room-new" x="3" y="223" width="120" height="104"/>
94
+ ```
95
+
96
+ ```css
97
+ .room-master { fill: rgba(206, 203, 246, 0.3); } /* purple tint */
98
+ .room-bed2 { fill: rgba(159, 225, 203, 0.3); } /* teal tint */
99
+ .room-bed3 { fill: rgba(250, 199, 117, 0.3); } /* amber tint */
100
+ .room-living { fill: rgba(245, 196, 179, 0.3); } /* coral tint */
101
+ .room-kitchen { fill: rgba(237, 147, 177, 0.3); } /* pink tint */
102
+ .room-bath { fill: rgba(133, 183, 235, 0.3); } /* blue tint */
103
+ .room-new { fill: rgba(163, 45, 45, 0.15); } /* red tint for proposed */
104
+ ```
105
+
106
+ ### Support Fixtures
107
+
108
+ ```xml
109
+ <!-- Kitchen counter hint -->
110
+ <rect x="450" y="15" width="50" height="25" fill="none" stroke="var(--text-tertiary)" stroke-width="0.5" rx="2"/>
111
+ <text class="tx" x="475" y="30" text-anchor="middle">Counter</text>
112
+
113
+ <!-- Balcony (dashed outline) -->
114
+ <rect class="balcony-fill" x="3" y="333" width="200" height="50"/>
115
+ ```
116
+
117
+ ```css
118
+ .balcony { fill: none; stroke: var(--text-secondary); stroke-width: 2; stroke-dasharray: 6 3; }
119
+ .balcony-fill { fill: rgba(93, 202, 165, 0.1); }
120
+ ```
121
+
122
+ ### Room Labels
123
+
124
+ ```xml
125
+ <!-- Room name and area -->
126
+ <text class="room-label" x="90" y="65" text-anchor="middle">MASTER</text>
127
+ <text class="room-label" x="90" y="78" text-anchor="middle">BEDROOM</text>
128
+ <text class="area-label" x="90" y="95" text-anchor="middle">195 sq ft</text>
129
+
130
+ <!-- Proposed room (in red) -->
131
+ <text class="room-label" x="63" y="268" text-anchor="middle" fill="#A32D2D">BEDROOM 4</text>
132
+ <text class="tx" x="63" y="282" text-anchor="middle" fill="#A32D2D">(NEW)</text>
133
+ ```
134
+
135
+ ```css
136
+ .room-label { font-family: system-ui; font-size: 11px; fill: var(--text-primary); font-weight: 500; }
137
+ .area-label { font-family: system-ui; font-size: 9px; fill: var(--text-tertiary); }
138
+ ```
139
+
140
+ ### Circulation Arrow
141
+
142
+ ```xml
143
+ <defs>
144
+ <marker id="circ-arrow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto">
145
+ <path d="M0,0 L10,5 L0,10 Z" class="circulation-fill"/>
146
+ </marker>
147
+ </defs>
148
+
149
+ <path class="circulation" d="M300,250 L200,250 L145,250 L145,280" marker-end="url(#circ-arrow)"/>
150
+ <text class="tx" x="250" y="242" fill="#3B6D11" font-weight="500">New corridor access</text>
151
+ ```
152
+
153
+ ```css
154
+ .circulation { stroke: #3B6D11; stroke-width: 2; fill: none; }
155
+ .circulation-fill { fill: #3B6D11; }
156
+ ```
157
+
158
+ ### North Arrow and Scale Bar
159
+
160
+ ```xml
161
+ <!-- North arrow -->
162
+ <g transform="translate(520, 260)">
163
+ <circle cx="0" cy="0" r="20" fill="none" stroke="var(--text-tertiary)" stroke-width="0.5"/>
164
+ <polygon points="0,-18 -5,5 0,0 5,5" fill="var(--text-primary)"/>
165
+ <text class="tx" x="0" y="-22" text-anchor="middle">N</text>
166
+ </g>
167
+
168
+ <!-- Scale bar -->
169
+ <g transform="translate(420, 300)">
170
+ <line x1="0" y1="0" x2="100" y2="0" stroke="var(--text-primary)" stroke-width="2"/>
171
+ <line x1="0" y1="-5" x2="0" y2="5" stroke="var(--text-primary)" stroke-width="1"/>
172
+ <line x1="50" y1="-3" x2="50" y2="3" stroke="var(--text-primary)" stroke-width="1"/>
173
+ <line x1="100" y1="-5" x2="100" y2="5" stroke="var(--text-primary)" stroke-width="1"/>
174
+ <text class="tx" x="0" y="15" text-anchor="middle">0</text>
175
+ <text class="tx" x="50" y="15" text-anchor="middle">5'</text>
176
+ <text class="tx" x="100" y="15" text-anchor="middle">10'</text>
177
+ </g>
178
+ ```
179
+
180
+ ## Area Comparison Table
181
+
182
+ ### Table Structure
183
+
184
+ ```xml
185
+ <!-- Header row -->
186
+ <rect class="table-header" x="0" y="0" width="180" height="28" rx="4 4 0 0"/>
187
+ <text class="ts" x="90" y="18" text-anchor="middle" font-weight="500">Room</text>
188
+
189
+ <!-- Normal row -->
190
+ <rect class="table-row" x="0" y="28" width="180" height="24"/>
191
+ <text class="tx" x="10" y="44">Master Bedroom</text>
192
+ <text class="tx" x="230" y="44" text-anchor="middle">195</text>
193
+
194
+ <!-- Alternating row -->
195
+ <rect class="table-row-alt" x="0" y="52" width="180" height="24"/>
196
+
197
+ <!-- Highlighted row (for changes) -->
198
+ <rect class="table-highlight" x="0" y="100" width="180" height="24"/>
199
+ <text class="tx" x="10" y="116" fill="#A32D2D" font-weight="500">Bedroom 4 (NEW)</text>
200
+ <text class="tx" x="430" y="116" text-anchor="middle" fill="#3B6D11">+100</text>
201
+
202
+ <!-- Total row -->
203
+ <rect x="0" y="268" width="180" height="28" fill="var(--bg-secondary)" stroke="var(--border)" stroke-width="1"/>
204
+ <text class="ts" x="10" y="286" font-weight="500">TOTAL CARPET AREA</text>
205
+ ```
206
+
207
+ ```css
208
+ .table-header { fill: var(--bg-secondary); }
209
+ .table-row { fill: var(--bg-primary); stroke: var(--border); stroke-width: 0.5; }
210
+ .table-row-alt { fill: var(--bg-tertiary); stroke: var(--border); stroke-width: 0.5; }
211
+ .table-highlight { fill: rgba(163, 45, 45, 0.1); stroke: #A32D2D; stroke-width: 0.5; }
212
+ ```
213
+
214
+ ## Layout Notes
215
+
216
+ - **ViewBox**: 800×780 (portrait for floor plan + table)
217
+ - **Scale**: 10px = 1 foot (apartment ~50ft × 33ft)
218
+ - **Floor plan origin**: Offset at (50, 60) for margins
219
+ - **Wall thickness**: 6px outer, 3px inner (represents ~6" walls)
220
+ - **Room labels**: Centered in each room with area below
221
+ - **Table placement**: Below floor plan with full width
222
+
223
+ ## Color Coding
224
+
225
+ | Element | Color | Usage |
226
+ |---------|-------|-------|
227
+ | Proposed walls | Red (#A32D2D) dotted | New construction |
228
+ | New room fill | Red 15% opacity | Bedroom 4 area |
229
+ | Circulation | Green (#3B6D11) | New access path |
230
+ | Window glass | Blue (#378ADD) | Glass indication |
231
+ | Bedrooms | Purple/Teal/Amber tints | Room differentiation |
232
+ | Wet areas | Blue tint | Bathrooms |
233
+ | Living | Coral tint | Common areas |
234
+
235
+ ## When to Use This Pattern
236
+
237
+ Use this diagram style for:
238
+ - Apartment/house floor plans
239
+ - Office layout planning
240
+ - Renovation proposals showing before/after
241
+ - Space planning with area calculations
242
+ - Real estate marketing materials
243
+ - Interior design presentations
244
+ - Building permit documentation
@@ -0,0 +1,276 @@
1
+ # Automated Password Reset Flow
2
+
3
+ A two-section flowchart tracing the full user journey for a web application password reset: the initial request phase (forgot password → email check → token generation) and the reset-form phase (link click → new password entry → token/password validation). Demonstrates multi-exit decision diamonds, a three-column branching layout, a loop-back path, and a cross-section separator arrow.
4
+
5
+ ## Key Patterns Used
6
+
7
+ - **Three-column layout**: Left column (error/terminal branches at cx=115), center column (main happy path at cx=340), right column (expired-token branch at cx=552) — allows side branches to live at the same y-level as center nodes without overlap
8
+ - **Decision diamonds with `<polygon>`**: Each decision uses a `<g class="decision">` wrapper containing a `<polygon>` and centered `<text>`; the diamond points are computed as `cx±hw, cy±hh` (hw=100, hh=28)
9
+ - **Pill-shaped terminals**: Start and end nodes use `rx=22` on their `<rect>` to signal entry/exit points; all mid-flow process nodes use `rx=8`
10
+ - **Three-branch decision paths**: Each diamond has a "Yes" branch (down, short `<line>`) and a "No" branch (`<path>` going horizontal then vertical to a side column)
11
+ - **Loop-back path**: Mismatch error node loops back to the password-entry node via a routing corridor at x=215 — a 5-px gap between the left column (right edge x=210) and center column (left edge x=220); the path exits the bottom of the error node, drops below it, travels right to x=215, then goes up to the target node's center y, then right 5 px into the node's left edge
12
+ - **Section separator**: A dashed horizontal `<line>` at y=452 splits the two phases; the connecting arrow crosses it with a faded label ("user receives email") to preserve flow continuity
13
+ - **Italic annotation**: The exact UX copy for the generic message ("If that email exists…") is shown as a faded italic `ts` text block below the left-branch terminal node
14
+ - **Legend row**: Five inline swatches (gray, purple, teal, red, amber diamond) at the bottom explain the color-to-role mapping
15
+
16
+ ## Diagram
17
+
18
+ ```xml
19
+ <svg width="100%" viewBox="0 0 680 960" xmlns="http://www.w3.org/2000/svg">
20
+ <defs>
21
+ <marker id="arrow" viewBox="0 0 10 10" refX="8" refY="5"
22
+ markerWidth="6" markerHeight="6" orient="auto-start-reverse">
23
+ <path d="M2 1L8 5L2 9" fill="none" stroke="context-stroke"
24
+ stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
25
+ </marker>
26
+ </defs>
27
+
28
+ <!--
29
+ Column layout (680px viewBox, safe area x=40–640):
30
+ Left col : x=20, w=190, cx=115 (error / terminal branches)
31
+ Center col: x=220, w=240, cx=340 (main happy path)
32
+ Right col: x=465, w=175, cx=552 (expired-token branch)
33
+ Loop corridor at x=215 (5-px gap between left and center cols)
34
+ -->
35
+
36
+ <!-- ═══ SECTION 1 — Forgot password request ═══ -->
37
+ <text class="ts" x="40" y="38" opacity=".45">Section 1 — Forgot password request</text>
38
+
39
+ <!-- START terminal (pill rx=22 signals start/end) -->
40
+ <g class="c-gray">
41
+ <rect x="220" y="46" width="240" height="44" rx="22"/>
42
+ <text class="th" x="340" y="68" text-anchor="middle" dominant-baseline="central">User: &quot;Forgot password&quot;</text>
43
+ </g>
44
+
45
+ <line x1="340" y1="90" x2="340" y2="108" class="arr" marker-end="url(#arrow)"/>
46
+
47
+ <!-- N2 · Enter email -->
48
+ <g class="c-gray">
49
+ <rect x="220" y="108" width="240" height="44" rx="8"/>
50
+ <text class="th" x="340" y="130" text-anchor="middle" dominant-baseline="central">Enter email address</text>
51
+ </g>
52
+
53
+ <line x1="340" y1="152" x2="340" y2="172" class="arr" marker-end="url(#arrow)"/>
54
+
55
+ <!-- D1 · Email in system? diamond: center=(340,200) hw=100 hh=28 -->
56
+ <g class="decision">
57
+ <polygon points="340,172 440,200 340,228 240,200"/>
58
+ <text class="th" x="340" y="200" text-anchor="middle" dominant-baseline="central">Email in system?</text>
59
+ </g>
60
+
61
+ <!-- D1 "No" → left column -->
62
+ <path d="M 240,200 L 115,200 L 115,248" class="arr" marker-end="url(#arrow)"/>
63
+ <text class="ts" x="178" y="193" text-anchor="middle" opacity=".75">No</text>
64
+
65
+ <!-- D1 "Yes" → continue down -->
66
+ <line x1="340" y1="228" x2="340" y2="248" class="arr" marker-end="url(#arrow)"/>
67
+ <text class="ts" x="348" y="242" text-anchor="start" opacity=".75">Yes</text>
68
+
69
+ <!-- ── Left branch (D1 = No): generic security message → end ── -->
70
+
71
+ <!-- L1 · Generic message (security: never confirm email existence) -->
72
+ <g class="c-gray">
73
+ <rect x="20" y="248" width="190" height="56" rx="8"/>
74
+ <text class="th" x="115" y="269" text-anchor="middle" dominant-baseline="central">Generic message shown</text>
75
+ <text class="ts" x="115" y="287" text-anchor="middle" dominant-baseline="central">Email sent if found</text>
76
+ </g>
77
+
78
+ <line x1="115" y1="304" x2="115" y2="324" class="arr" marker-end="url(#arrow)"/>
79
+
80
+ <!-- L2 · End terminal (left) -->
81
+ <g class="c-gray">
82
+ <rect x="20" y="324" width="190" height="44" rx="22"/>
83
+ <text class="th" x="115" y="346" text-anchor="middle" dominant-baseline="central">Request handled</text>
84
+ </g>
85
+
86
+ <!-- Italic annotation: actual UX copy shown below the end node -->
87
+ <text class="ts" x="20" y="384" opacity=".45" font-style="italic">&quot;If that email exists, a reset</text>
88
+ <text class="ts" x="20" y="398" opacity=".45" font-style="italic">link has been sent.&quot;</text>
89
+
90
+ <!-- ── Center Yes branch: system generates & sends token ── -->
91
+
92
+ <!-- N3 · Generate unique token -->
93
+ <g class="c-purple">
94
+ <rect x="220" y="248" width="240" height="56" rx="8"/>
95
+ <text class="th" x="340" y="269" text-anchor="middle" dominant-baseline="central">Generate unique token</text>
96
+ <text class="ts" x="340" y="287" text-anchor="middle" dominant-baseline="central">Time-limited, cryptographic</text>
97
+ </g>
98
+
99
+ <line x1="340" y1="304" x2="340" y2="324" class="arr" marker-end="url(#arrow)"/>
100
+
101
+ <!-- N4 · Store token + user ID -->
102
+ <g class="c-purple">
103
+ <rect x="220" y="324" width="240" height="44" rx="8"/>
104
+ <text class="th" x="340" y="346" text-anchor="middle" dominant-baseline="central">Store token + user ID</text>
105
+ </g>
106
+
107
+ <line x1="340" y1="368" x2="340" y2="388" class="arr" marker-end="url(#arrow)"/>
108
+
109
+ <!-- N5 · Send reset email -->
110
+ <g class="c-teal">
111
+ <rect x="220" y="388" width="240" height="44" rx="8"/>
112
+ <text class="th" x="340" y="410" text-anchor="middle" dominant-baseline="central">Send reset link via email</text>
113
+ </g>
114
+
115
+ <!-- ═══ Section separator ═══ -->
116
+ <line x1="40" y1="452" x2="640" y2="452"
117
+ stroke="var(--border)" stroke-width="1" stroke-dasharray="8 5"/>
118
+
119
+ <!-- Arrow crossing separator (with inline label) -->
120
+ <line x1="340" y1="432" x2="340" y2="472" class="arr" marker-end="url(#arrow)"/>
121
+ <text class="ts" x="348" y="448" text-anchor="start" opacity=".55">user receives email</text>
122
+
123
+ <text class="ts" x="40" y="464" opacity=".45">Section 2 — Password reset form</text>
124
+
125
+ <!-- ═══ SECTION 2 — Password reset form ═══ -->
126
+
127
+ <!-- N6 · User clicks reset link -->
128
+ <g class="c-gray">
129
+ <rect x="220" y="480" width="240" height="44" rx="8"/>
130
+ <text class="th" x="340" y="502" text-anchor="middle" dominant-baseline="central">User clicks reset link</text>
131
+ </g>
132
+
133
+ <line x1="340" y1="524" x2="340" y2="544" class="arr" marker-end="url(#arrow)"/>
134
+
135
+ <!-- N7 · Enter new password ×2 -->
136
+ <g class="c-gray">
137
+ <rect x="220" y="544" width="240" height="56" rx="8"/>
138
+ <text class="th" x="340" y="565" text-anchor="middle" dominant-baseline="central">Enter new password ×2</text>
139
+ <text class="ts" x="340" y="583" text-anchor="middle" dominant-baseline="central">Confirm both passwords match</text>
140
+ </g>
141
+
142
+ <line x1="340" y1="600" x2="340" y2="620" class="arr" marker-end="url(#arrow)"/>
143
+
144
+ <!-- D2 · Token expired? diamond: center=(340,648) hw=100 hh=28 -->
145
+ <g class="decision">
146
+ <polygon points="340,620 440,648 340,676 240,648"/>
147
+ <text class="th" x="340" y="648" text-anchor="middle" dominant-baseline="central">Token expired?</text>
148
+ </g>
149
+
150
+ <!-- D2 "Yes" → right column (expired-token branch) -->
151
+ <path d="M 440,648 L 552,648 L 552,692" class="arr" marker-end="url(#arrow)"/>
152
+ <text class="ts" x="496" y="641" text-anchor="middle" opacity=".75">Yes</text>
153
+
154
+ <!-- D2 "No" → down to password-match check -->
155
+ <line x1="340" y1="676" x2="340" y2="714" class="arr" marker-end="url(#arrow)"/>
156
+ <text class="ts" x="348" y="698" text-anchor="start" opacity=".75">No</text>
157
+
158
+ <!-- ── Right branch (D2 = Yes): token expired → dead end ── -->
159
+
160
+ <!-- R1 · Token expired error -->
161
+ <g class="c-red">
162
+ <rect x="465" y="692" width="175" height="56" rx="8"/>
163
+ <text class="th" x="552" y="713" text-anchor="middle" dominant-baseline="central">Token expired</text>
164
+ <text class="ts" x="552" y="731" text-anchor="middle" dominant-baseline="central">Show expiry error</text>
165
+ </g>
166
+
167
+ <line x1="552" y1="748" x2="552" y2="768" class="arr" marker-end="url(#arrow)"/>
168
+
169
+ <!-- R2 · End terminal (right) -->
170
+ <g class="c-gray">
171
+ <rect x="465" y="768" width="175" height="44" rx="22"/>
172
+ <text class="th" x="552" y="790" text-anchor="middle" dominant-baseline="central">End — request again</text>
173
+ </g>
174
+
175
+ <!-- D3 · Passwords match? diamond: center=(340,742) hw=100 hh=28 -->
176
+ <g class="decision">
177
+ <polygon points="340,714 440,742 340,770 240,742"/>
178
+ <text class="th" x="340" y="742" text-anchor="middle" dominant-baseline="central">Passwords match?</text>
179
+ </g>
180
+
181
+ <!-- D3 "No" → left column (mismatch branch) -->
182
+ <path d="M 240,742 L 115,742 L 115,786" class="arr" marker-end="url(#arrow)"/>
183
+ <text class="ts" x="178" y="735" text-anchor="middle" opacity=".75">No</text>
184
+
185
+ <!-- D3 "Yes" → down to reset -->
186
+ <line x1="340" y1="770" x2="340" y2="790" class="arr" marker-end="url(#arrow)"/>
187
+ <text class="ts" x="348" y="783" text-anchor="start" opacity=".75">Yes</text>
188
+
189
+ <!-- ── Left branch (D3 = No): passwords don't match → loop back ── -->
190
+
191
+ <!-- L3 · Password mismatch error -->
192
+ <g class="c-red">
193
+ <rect x="20" y="786" width="190" height="56" rx="8"/>
194
+ <text class="th" x="115" y="807" text-anchor="middle" dominant-baseline="central">Password mismatch</text>
195
+ <text class="ts" x="115" y="825" text-anchor="middle" dominant-baseline="central">Passwords do not match</text>
196
+ </g>
197
+
198
+ <!-- Loop-back arrow: exits L3 bottom → drops to y=862 →
199
+ travels right to corridor x=215 → climbs to N7 center y=572 →
200
+ enters N7 left edge at (220, 572) pointing right -->
201
+ <path d="M 115,842 L 115,862 L 215,862 L 215,572 L 220,572"
202
+ class="arr" marker-end="url(#arrow)"/>
203
+ <text class="ts" x="224" y="538" text-anchor="start" opacity=".6">retry</text>
204
+
205
+ <!-- ── Center Yes branch (D3 = Yes): reset password & invalidate token ── -->
206
+
207
+ <!-- N8 · Reset password -->
208
+ <g class="c-teal">
209
+ <rect x="220" y="790" width="240" height="56" rx="8"/>
210
+ <text class="th" x="340" y="811" text-anchor="middle" dominant-baseline="central">Reset password</text>
211
+ <text class="ts" x="340" y="829" text-anchor="middle" dominant-baseline="central">Invalidate used token</text>
212
+ </g>
213
+
214
+ <line x1="340" y1="846" x2="340" y2="866" class="arr" marker-end="url(#arrow)"/>
215
+
216
+ <!-- N9 · Success terminal -->
217
+ <g class="c-green">
218
+ <rect x="220" y="866" width="240" height="44" rx="22"/>
219
+ <text class="th" x="340" y="888" text-anchor="middle" dominant-baseline="central">Password reset complete</text>
220
+ </g>
221
+
222
+ <!-- ═══ Legend ═══ -->
223
+ <text class="ts" x="40" y="930" opacity=".4">Legend —</text>
224
+ <rect x="108" y="920" width="13" height="13" rx="2" fill="#F1EFE8" stroke="#5F5E5A" stroke-width="0.5"/>
225
+ <text class="ts" x="126" y="930" opacity=".7">User action</text>
226
+ <rect x="210" y="920" width="13" height="13" rx="2" fill="#EEEDFE" stroke="#534AB7" stroke-width="0.5"/>
227
+ <text class="ts" x="228" y="930" opacity=".7">System process</text>
228
+ <rect x="334" y="920" width="13" height="13" rx="2" fill="#E1F5EE" stroke="#0F6E56" stroke-width="0.5"/>
229
+ <text class="ts" x="352" y="930" opacity=".7">Email / success</text>
230
+ <rect x="455" y="920" width="13" height="13" rx="2" fill="#FCEBEB" stroke="#A32D2D" stroke-width="0.5"/>
231
+ <text class="ts" x="473" y="930" opacity=".7">Error state</text>
232
+ <polygon points="556,926 566,932 556,938 546,932" fill="#FAEEDA" stroke="#854F0B" stroke-width="0.5"/>
233
+ <text class="ts" x="572" y="932" opacity=".7">Decision</text>
234
+
235
+ </svg>
236
+ ```
237
+
238
+ ## Custom CSS
239
+
240
+ Add these classes to the hosting page `<style>` block (in addition to the standard skill CSS):
241
+
242
+ ```css
243
+ /* Decision diamond — amber fill, same palette as c-amber */
244
+ .decision > polygon { fill: #FAEEDA; stroke: #854F0B; stroke-width: 0.5; }
245
+ .decision > .th { fill: #633806; }
246
+
247
+ @media (prefers-color-scheme: dark) {
248
+ .decision > polygon { fill: #633806; stroke: #EF9F27; }
249
+ .decision > .th { fill: #FAC775; }
250
+ }
251
+ ```
252
+
253
+ ## Color Assignments
254
+
255
+ | Element | Color | Reason |
256
+ |---------|-------|--------|
257
+ | Start / end terminals | `c-gray` | Neutral entry and exit points |
258
+ | User actions (enter email, click link, enter password) | `c-gray` | User-facing steps with no system processing |
259
+ | Generic message + request-handled terminal | `c-gray` | Intentionally neutral — the security message must not reveal data |
260
+ | Generate & store token | `c-purple` | Backend system operations |
261
+ | Send reset email | `c-teal` | Positive external action (outbound communication) |
262
+ | Token expired error | `c-red` | Failure / blocking error state |
263
+ | Password mismatch error | `c-red` | Validation failure |
264
+ | Reset password + success | `c-teal` / `c-green` | Positive outcome: teal for the action, green pill for the terminal |
265
+ | Decision diamonds | `c-amber` (custom `.decision`) | Warning / branch point — matches amber semantic meaning |
266
+
267
+ ## Layout Notes
268
+
269
+ - **ViewBox**: 680×960 — tall flowchart with two phases
270
+ - **Three-column structure**: Left (cx=115), center (cx=340), right (cx=552) — each branch stays within its column; only `<path>` arrows cross column boundaries
271
+ - **Diamond formula**: `<polygon points="cx,cy-hh cx+hw,cy cx,cy+hh cx-hw,cy"/>` with hw=100, hh=28 gives a 200×56px diamond that sits flush with the center column (x=220–460)
272
+ - **Branch routing pattern**: "No" paths use `<path d="M left_point,cy L side_cx,cy L side_cx,node_top">` — one horizontal segment + one vertical segment, no curves needed
273
+ - **Loop corridor**: The 5-px gap at x=210–220 between left and center columns provides a clean vertical channel for the loop-back path without any node overlap; the path exits node bottom, drops 20px, goes right to x=215, climbs to target y, enters from left
274
+ - **Section separator**: A dashed `<line>` at y=452 with `stroke-dasharray="8 5"` provides a visual phase break; the single connecting arrow crosses it at center, with a faded label on the arrow
275
+ - **Pill terminals**: `rx=22` (half the 44px node height) produces a perfect capsule/pill shape — use this consistently for all start/end terminals
276
+ - **Error annotation**: The exact UX copy is rendered as faded (`opacity=".45"`) italic `ts` text below the relevant node, keeping it informative without cluttering the flow