@istmx/skills 2.1.1 → 3.0.0

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 (744) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/CODE_OF_CONDUCT.md +47 -47
  3. package/LICENSE +30 -30
  4. package/README.md +80 -164
  5. package/bin/cli.js +143 -210
  6. package/istm-workflow/istm-audit/SKILL.md +108 -108
  7. package/istm-workflow/istm-audit/agent-prompt.md +393 -393
  8. package/istm-workflow/istm-audit/agents/openai.yaml +7 -7
  9. package/istm-workflow/istm-audit/modes/area.md +19 -19
  10. package/istm-workflow/istm-audit/modes/gapfill.md +12 -12
  11. package/istm-workflow/istm-audit/modes/greenfield.md +24 -24
  12. package/istm-workflow/istm-audit/modes/tool-skills.md +39 -39
  13. package/istm-workflow/istm-audit/modes/whole-repo.md +5 -5
  14. package/istm-workflow/istm-audit/patterns/clean-architecture.md +15 -15
  15. package/istm-workflow/istm-audit/patterns/domain-driven.md +16 -16
  16. package/istm-workflow/istm-audit/patterns/functional.md +16 -16
  17. package/istm-workflow/istm-audit/patterns/solid-oop.md +17 -17
  18. package/istm-workflow/istm-autoplan/SKILL.md +1905 -1905
  19. package/istm-workflow/istm-autoplan/SKILL.md.tmpl +923 -923
  20. package/istm-workflow/istm-check/SKILL.md +52 -52
  21. package/istm-workflow/istm-check/agents/openai.yaml +7 -7
  22. package/istm-workflow/istm-check/modes/review.md +156 -156
  23. package/istm-workflow/istm-check/modes/verify.md +197 -197
  24. package/istm-workflow/istm-check/review-agent-prompt.md +57 -57
  25. package/istm-workflow/istm-check/review-guide.md +133 -133
  26. package/istm-workflow/istm-craft/SKILL.md +52 -52
  27. package/istm-workflow/istm-craft/agent-modes/architecture.md +73 -73
  28. package/istm-workflow/istm-craft/agent-modes/cross-cutting.md +65 -65
  29. package/istm-workflow/istm-craft/agent-modes/enhancement.md +45 -45
  30. package/istm-workflow/istm-craft/agent-modes/feature.md +85 -85
  31. package/istm-workflow/istm-craft/agent-prompt.md +249 -249
  32. package/istm-workflow/istm-craft/agents/openai.yaml +7 -7
  33. package/istm-workflow/istm-craft/internal/after-subagent.md +90 -90
  34. package/istm-workflow/istm-craft/internal/design-conversation.md +140 -140
  35. package/istm-workflow/istm-craft/internal/tool-discovery.md +58 -58
  36. package/istm-workflow/istm-craft/spec-template.md +278 -278
  37. package/istm-workflow/istm-cso/ACKNOWLEDGEMENTS.md +14 -14
  38. package/istm-workflow/istm-cso/SKILL.md +1313 -1313
  39. package/istm-workflow/istm-cso/SKILL.md.tmpl +407 -407
  40. package/istm-workflow/istm-cso/sections/audit-phases.md +253 -253
  41. package/istm-workflow/istm-cso/sections/audit-phases.md.tmpl +251 -251
  42. package/istm-workflow/istm-cso/sections/manifest.json +14 -14
  43. package/istm-workflow/istm-debt/SKILL.md +44 -44
  44. package/istm-workflow/istm-debug/SKILL.md +111 -111
  45. package/istm-workflow/istm-debug/agents/openai.yaml +7 -7
  46. package/istm-workflow/istm-design-review/SKILL.md +2053 -2053
  47. package/istm-workflow/istm-design-review/SKILL.md.tmpl +312 -312
  48. package/istm-workflow/istm-develop/SKILL.md +165 -165
  49. package/istm-workflow/istm-develop/agents/openai.yaml +7 -7
  50. package/istm-workflow/istm-develop/checklist.md +95 -95
  51. package/istm-workflow/istm-develop/flow/build.md +133 -133
  52. package/istm-workflow/istm-develop/flow/git.md +34 -34
  53. package/istm-workflow/istm-develop/logical-guide.md +99 -99
  54. package/istm-workflow/istm-develop/ui/existing.md +23 -23
  55. package/istm-workflow/istm-develop/ui/generate.md +131 -131
  56. package/istm-workflow/istm-develop/ui/image.md +41 -41
  57. package/istm-workflow/istm-develop/ui/implementation.md +281 -281
  58. package/istm-workflow/istm-develop/ui/mcp.md +11 -11
  59. package/istm-workflow/istm-develop/ui-guide.md +164 -164
  60. package/istm-workflow/istm-document/SKILL.md +123 -123
  61. package/istm-workflow/istm-document/agent-prompt.md +57 -57
  62. package/istm-workflow/istm-document/agents/openai.yaml +7 -7
  63. package/istm-workflow/istm-document/templates/changelog.md +54 -54
  64. package/istm-workflow/istm-document/templates/postmortem.md +58 -58
  65. package/istm-workflow/istm-document/templates/pr.md +43 -43
  66. package/istm-workflow/istm-document/templates/release-note.md +41 -41
  67. package/istm-workflow/istm-eng-review/SKILL.md +1112 -1112
  68. package/istm-workflow/istm-eng-review/SKILL.md.tmpl +163 -163
  69. package/istm-workflow/istm-eng-review/sections/manifest.json +14 -14
  70. package/istm-workflow/istm-eng-review/sections/review-sections.md +942 -942
  71. package/istm-workflow/istm-eng-review/sections/review-sections.md.tmpl +225 -225
  72. package/istm-workflow/istm-gain/SKILL.md +50 -50
  73. package/istm-workflow/istm-health/SKILL.md +1104 -1104
  74. package/istm-workflow/istm-health/SKILL.md.tmpl +320 -320
  75. package/istm-workflow/istm-qa/BROWSER.md +1468 -1468
  76. package/istm-workflow/istm-qa/SKILL.md +1743 -1743
  77. package/istm-workflow/istm-qa/SKILL.md.tmpl +354 -354
  78. package/istm-workflow/istm-qa/references/issue-taxonomy.md +85 -85
  79. package/istm-workflow/istm-qa/templates/qa-report-template.md +126 -126
  80. package/istm-workflow/istm-release/SKILL.md +989 -989
  81. package/istm-workflow/istm-release/SKILL.md.tmpl +160 -160
  82. package/istm-workflow/istm-release/sections/manifest.json +14 -14
  83. package/istm-workflow/istm-release/sections/release-body.md +547 -547
  84. package/istm-workflow/istm-release/sections/release-body.md.tmpl +420 -420
  85. package/istm-workflow/istm-review/SKILL.md +57 -57
  86. package/istm-workflow/istm-scope/SKILL.md +100 -100
  87. package/istm-workflow/istm-scope/agents/openai.yaml +7 -7
  88. package/istm-workflow/istm-scope/approaches/facade.md +33 -33
  89. package/istm-workflow/istm-scope/approaches/journey.md +31 -31
  90. package/istm-workflow/istm-scope/approaches/skateboard.md +33 -33
  91. package/istm-workflow/istm-scope/approaches/tracer-bullet.md +34 -34
  92. package/istm-workflow/istm-scope/modes/add.md +14 -14
  93. package/istm-workflow/istm-scope/modes/plan-brownfield.md +11 -11
  94. package/istm-workflow/istm-scope/modes/plan-greenfield.md +20 -20
  95. package/istm-workflow/istm-scope/modes/plan-monorepo.md +8 -8
  96. package/istm-workflow/istm-scope/modes/plan.md +120 -120
  97. package/istm-workflow/istm-scope/modes/replan.md +13 -13
  98. package/istm-workflow/istm-scope/scope-template.md +148 -148
  99. package/istm-workflow/istm-ship/SKILL.md +1504 -1504
  100. package/istm-workflow/istm-ship/SKILL.md.tmpl +582 -582
  101. package/istm-workflow/istm-ship/sections/adversarial.md +218 -218
  102. package/istm-workflow/istm-ship/sections/adversarial.md.tmpl +19 -19
  103. package/istm-workflow/istm-ship/sections/apple-release.md +58 -58
  104. package/istm-workflow/istm-ship/sections/apple-release.md.tmpl +56 -56
  105. package/istm-workflow/istm-ship/sections/changelog.md +45 -45
  106. package/istm-workflow/istm-ship/sections/changelog.md.tmpl +3 -3
  107. package/istm-workflow/istm-ship/sections/greptile.md +51 -51
  108. package/istm-workflow/istm-ship/sections/greptile.md.tmpl +49 -49
  109. package/istm-workflow/istm-ship/sections/manifest.json +62 -62
  110. package/istm-workflow/istm-ship/sections/plan-completion.md +329 -329
  111. package/istm-workflow/istm-ship/sections/plan-completion.md.tmpl +31 -31
  112. package/istm-workflow/istm-ship/sections/pr-body.md +209 -209
  113. package/istm-workflow/istm-ship/sections/pr-body.md.tmpl +207 -207
  114. package/istm-workflow/istm-ship/sections/review-army.md +406 -406
  115. package/istm-workflow/istm-ship/sections/review-army.md.tmpl +56 -56
  116. package/istm-workflow/istm-ship/sections/test-coverage.md +264 -264
  117. package/istm-workflow/istm-ship/sections/test-coverage.md.tmpl +23 -23
  118. package/istm-workflow/istm-ship/sections/tests.md +403 -403
  119. package/istm-workflow/istm-ship/sections/tests.md.tmpl +116 -116
  120. package/istm-workflow/istm-sync/SKILL.md +178 -178
  121. package/istm-workflow/istm-sync/agent-prompt.md +229 -229
  122. package/istm-workflow/istm-sync/agents/openai.yaml +7 -7
  123. package/istm-workflow/istm-test/SKILL.md +233 -233
  124. package/istm-workflow/istm-test/agent-prompt.md +62 -62
  125. package/istm-workflow/istm-test/agents/openai.yaml +7 -7
  126. package/istm-workflow/istm-test/modes/setup.md +97 -97
  127. package/istm-workflow/istm-test/writing-guide.md +196 -196
  128. package/istmx-architecture/SKILL.md +124 -0
  129. package/istmx-architecture/references/boundary-audits.md +33 -0
  130. package/istmx-architecture/references/clean-architecture-full.md +394 -0
  131. package/istmx-architecture/references/comments-as-design.md +387 -0
  132. package/istmx-architecture/references/complexity-symptoms.md +209 -0
  133. package/istmx-architecture/references/deep-modules.md +347 -0
  134. package/istmx-architecture/references/general-vs-special.md +342 -0
  135. package/istmx-architecture/references/information-hiding.md +336 -0
  136. package/istmx-architecture/references/reverse-engineering.md +25 -0
  137. package/istmx-architecture/references/software-design-philosophy.md +199 -0
  138. package/istmx-architecture/references/strategic-programming.md +269 -0
  139. package/{istm-architecture/templates/agents.md → istmx-architecture/templates/AGENTS.md} +247 -248
  140. package/{istm-architecture → istmx-architecture}/templates/architecture.md +110 -110
  141. package/istmx-architecture/templates/progress.md +29 -0
  142. package/{istm-architecture → istmx-architecture}/templates/project-overview.md +215 -215
  143. package/istmx-backend-patterns/SKILL.md +143 -0
  144. package/istmx-backend-patterns/references/api-and-database-patterns.md +22 -0
  145. package/istmx-backend-patterns/references/api-patterns.md +275 -0
  146. package/istmx-backend-patterns/references/code-examples.md +97 -0
  147. package/istmx-backend-patterns/references/database-patterns.md +269 -0
  148. package/istmx-backend-patterns/references/distributed-patterns.md +327 -0
  149. package/istmx-backend-patterns/references/distributed-resilience.md +21 -0
  150. package/istmx-backend-patterns/references/failure-analysis.md +150 -0
  151. package/istmx-backend-patterns/references/infrastructure.md +74 -0
  152. package/istmx-backend-patterns/references/scaling-patterns.md +362 -0
  153. package/istmx-backend-patterns/scripts/analyze_schema.py +304 -0
  154. package/istmx-backend-patterns/scripts/capacity_calculator.py +238 -0
  155. package/istmx-backend-patterns/scripts/check_api_health.sh +135 -0
  156. package/istmx-backend-patterns/templates/adr.md +19 -0
  157. package/istmx-brainstorming/SKILL.md +325 -0
  158. package/istmx-brainstorming/builder-check-prompt.md +23 -0
  159. package/istmx-clean-code/SKILL.md +248 -0
  160. package/istmx-clean-code/references/code-smells-and-refactorings.md +42 -0
  161. package/istmx-clean-code/references/code-smells.md +494 -0
  162. package/istmx-clean-code/references/comments-formatting.md +405 -0
  163. package/istmx-clean-code/references/deep-modules-and-boundaries.md +29 -0
  164. package/istmx-clean-code/references/error-handling.md +357 -0
  165. package/istmx-clean-code/references/functions-and-methods.md +373 -0
  166. package/istmx-clean-code/references/kent-beck-simple-design.md +687 -0
  167. package/istmx-clean-code/references/naming-conventions.md +280 -0
  168. package/istmx-clean-code/references/testing-principles.md +353 -0
  169. package/istmx-clean-code/references/typescript-and-backend-examples.md +82 -0
  170. package/istmx-code-review/SKILL.md +201 -0
  171. package/istmx-code-review/code-reviewer.md +198 -0
  172. package/istmx-code-review/references/architecture-decisions.md +321 -0
  173. package/istmx-code-review/references/code-examples.md +95 -0
  174. package/istmx-code-review/references/code-review.md +173 -0
  175. package/istmx-code-review/references/debugging-strategies.md +485 -0
  176. package/istmx-code-review/references/design-docs.md +161 -0
  177. package/istmx-code-review/references/performance-profiling.md +484 -0
  178. package/istmx-code-review/references/production-patterns.md +317 -0
  179. package/istmx-code-review/references/receiving-code-review.md +205 -0
  180. package/istmx-code-review/references/requesting-code-review.md +95 -0
  181. package/istmx-code-review/references/team-patterns.md +374 -0
  182. package/istmx-code-review/scripts/review_checklist.py +312 -0
  183. package/istmx-ddd/SKILL.md +208 -0
  184. package/istmx-ddd/references/bounded-contexts.md +203 -0
  185. package/istmx-ddd/references/building-blocks.md +234 -0
  186. package/istmx-ddd/references/domain-events.md +264 -0
  187. package/istmx-ddd/references/repositories-factories.md +353 -0
  188. package/istmx-ddd/references/strategic-design.md +251 -0
  189. package/istmx-ddd/references/ubiquitous-language.md +202 -0
  190. package/istmx-ddia-systems/SKILL.md +252 -0
  191. package/istmx-ddia-systems/references/anti-patterns.md +279 -0
  192. package/istmx-ddia-systems/references/batch-stream.md +342 -0
  193. package/istmx-ddia-systems/references/capacity-planning.md +285 -0
  194. package/istmx-ddia-systems/references/chaos-engineering.md +0 -0
  195. package/istmx-ddia-systems/references/data-models.md +0 -0
  196. package/istmx-ddia-systems/references/deployment-strategies.md +0 -0
  197. package/istmx-ddia-systems/references/fault-tolerance.md +0 -0
  198. package/istmx-ddia-systems/references/observability.md +313 -0
  199. package/istmx-ddia-systems/references/partitioning.md +0 -0
  200. package/istmx-ddia-systems/references/replication.md +0 -0
  201. package/istmx-ddia-systems/references/stability-patterns.md +369 -0
  202. package/istmx-ddia-systems/references/storage-engines.md +289 -0
  203. package/istmx-ddia-systems/references/transactions.md +267 -0
  204. package/istmx-devops/SKILL.md +204 -0
  205. package/istmx-devops/references/cicd-pipeline.md +74 -0
  206. package/istmx-devops/references/deployment-rollbacks.md +29 -0
  207. package/istmx-devops/references/docker.md +199 -0
  208. package/istmx-devops/references/incident-triage.md +30 -0
  209. package/istmx-devops/references/infrastructure.md +129 -0
  210. package/istmx-devops/references/kubernetes.md +346 -0
  211. package/istmx-devops/references/observability.md +331 -0
  212. package/istmx-devops/scripts/analyze_deployment_risk.py +74 -0
  213. package/istmx-devops/scripts/check_services.sh +172 -0
  214. package/istmx-devops/scripts/validate_dockerfile.sh +213 -0
  215. package/istmx-diagnose-agent/SKILL.md +147 -0
  216. package/istmx-diagnose-agent/prompts/analyst-common.md +38 -0
  217. package/istmx-diagnose-agent/prompts/cost-and-time.md +28 -0
  218. package/istmx-diagnose-agent/prompts/plan-adherence.md +29 -0
  219. package/istmx-diagnose-agent/prompts/quality-evidence.md +26 -0
  220. package/istmx-diagnose-agent/prompts/repeated-work.md +30 -0
  221. package/istmx-diagnose-agent/prompts/request-conflicts.md +20 -0
  222. package/istmx-diagnose-agent/prompts/scrub-audit.md +33 -0
  223. package/istmx-diagnose-agent/prompts/scrub.md +29 -0
  224. package/istmx-diagnose-agent/prompts/similar-session.md +38 -0
  225. package/istmx-diagnose-agent/prompts/skill-timeline.md +30 -0
  226. package/istmx-diagnose-agent/prompts/stumbles.md +28 -0
  227. package/istmx-diagnose-agent/references/context-safety.md +22 -0
  228. package/istmx-diagnose-agent/references/github-issues.md +47 -0
  229. package/istmx-diagnose-agent/references/redaction-policy.md +34 -0
  230. package/istmx-diagnose-agent/references/session-discovery.md +31 -0
  231. package/istmx-diagnose-agent/templates/bundle-README.md +77 -0
  232. package/istmx-diagnose-agent/templates/case.md +64 -0
  233. package/istmx-diagnose-agent/templates/issue.md +70 -0
  234. package/istmx-diagnose-agent/templates/report.md +82 -0
  235. package/istmx-harness-audit/SKILL.md +193 -0
  236. package/istmx-harness-audit/references/harness-checklist.md +18 -0
  237. package/istmx-harness-audit/references/remediation-workflow.md +242 -0
  238. package/istmx-harness-audit/references/stations-and-checks.md +131 -0
  239. package/istmx-legacy-code/SKILL.md +219 -0
  240. package/istmx-legacy-code/references/case-studies.md +238 -0
  241. package/istmx-legacy-code/references/change-algorithm.md +178 -0
  242. package/istmx-legacy-code/references/characterization-tests.md +210 -0
  243. package/istmx-legacy-code/references/dependency-breaking.md +306 -0
  244. package/istmx-legacy-code/references/seams.md +176 -0
  245. package/istmx-ml-engineering/SKILL.md +167 -0
  246. package/istmx-ml-engineering/references/classical-ml.md +645 -0
  247. package/istmx-ml-engineering/references/dataset-triage.md +23 -0
  248. package/istmx-ml-engineering/references/deployment.md +504 -0
  249. package/istmx-ml-engineering/references/evaluation-playbook.md +23 -0
  250. package/istmx-ml-engineering/references/fine-tuning.md +510 -0
  251. package/istmx-ml-engineering/references/rag-patterns.md +499 -0
  252. package/istmx-ml-engineering/references/transformers-patterns.md +570 -0
  253. package/istmx-ml-engineering/scripts/analyze_dataset.py +380 -0
  254. package/istmx-ml-engineering/scripts/estimate_gpu_memory.py +308 -0
  255. package/istmx-ml-engineering/scripts/summarize_eval.py +71 -0
  256. package/istmx-multi-agent/SKILL.md +383 -0
  257. package/istmx-multi-agent/references/batching.md +11 -0
  258. package/istmx-multi-agent/references/cannot-verify.md +10 -0
  259. package/istmx-multi-agent/references/dispatching-parallel-agents.md +167 -0
  260. package/istmx-multi-agent/references/final-review.md +49 -0
  261. package/istmx-multi-agent/references/finishing-a-development-branch.md +225 -0
  262. package/istmx-multi-agent/references/fix-loop.md +77 -0
  263. package/istmx-multi-agent/references/handling-reports.md +15 -0
  264. package/istmx-multi-agent/references/orchestration-and-handoffs.md +17 -0
  265. package/istmx-multi-agent/references/preflight.md +26 -0
  266. package/istmx-multi-agent/references/resuming.md +12 -0
  267. package/istmx-multi-agent/references/using-git-worktrees.md +167 -0
  268. package/istmx-multi-agent/scripts/review-package +64 -0
  269. package/istmx-multi-agent/scripts/sdd-repo +54 -0
  270. package/istmx-multi-agent/scripts/sdd-workspace +110 -0
  271. package/istmx-multi-agent/scripts/task-brief +108 -0
  272. package/istmx-multi-agent/templates/implementer-prompt.md +154 -0
  273. package/istmx-multi-agent/templates/progress-ledger.md +13 -0
  274. package/istmx-multi-agent/templates/re-review-prompt.md +116 -0
  275. package/istmx-multi-agent/templates/review-verdict.md +18 -0
  276. package/istmx-multi-agent/templates/task-reviewer-prompt.md +209 -0
  277. package/istmx-multi-agent/templates/worker-brief.md +27 -0
  278. package/istmx-planning/SKILL.md +222 -0
  279. package/istmx-planning/references/executing-plans.md +323 -0
  280. package/istmx-planning/scripts/task-done +55 -0
  281. package/istmx-planning/scripts/task-start +32 -0
  282. package/istmx-postgres-design/SKILL.md +138 -0
  283. package/istmx-postgres-design/references/sql-optimization-patterns.md +214 -0
  284. package/istmx-pragmatic-eng/SKILL.md +237 -0
  285. package/istmx-pragmatic-eng/references/broken-windows.md +257 -0
  286. package/istmx-pragmatic-eng/references/contracts-assertions.md +387 -0
  287. package/istmx-pragmatic-eng/references/dry-orthogonality.md +264 -0
  288. package/istmx-pragmatic-eng/references/estimation-portfolio.md +326 -0
  289. package/istmx-pragmatic-eng/references/reversibility.md +343 -0
  290. package/istmx-pragmatic-eng/references/tracer-bullets.md +280 -0
  291. package/istmx-refactoring/SKILL.md +226 -0
  292. package/istmx-refactoring/references/composing-methods.md +399 -0
  293. package/istmx-refactoring/references/moving-features.md +389 -0
  294. package/istmx-refactoring/references/organizing-data.md +433 -0
  295. package/istmx-refactoring/references/refactoring-workflow.md +373 -0
  296. package/istmx-refactoring/references/simplifying-conditionals.md +385 -0
  297. package/istmx-refactoring/references/smell-catalog.md +347 -0
  298. package/istmx-security-audit/SKILL.md +263 -0
  299. package/istmx-security-audit/references/auth-and-api-hardening.md +20 -0
  300. package/istmx-security-audit/references/auth-patterns.md +15 -0
  301. package/istmx-security-audit/references/compliance-checklists.md +10 -0
  302. package/istmx-security-audit/references/incident-response.md +11 -0
  303. package/istmx-security-audit/references/security-headers.md +12 -0
  304. package/istmx-security-audit/references/stride-and-threat-modeling.md +17 -0
  305. package/istmx-security-audit/references/vulnerability-patterns.md +14 -0
  306. package/istmx-security-audit/scripts/audit_auth_surface.py +69 -0
  307. package/istmx-security-audit/scripts/check_security_headers.sh +130 -0
  308. package/istmx-security-audit/scripts/scan_secrets.sh +182 -0
  309. package/istmx-system-design/SKILL.md +223 -0
  310. package/istmx-system-design/references/building-blocks.md +272 -0
  311. package/istmx-system-design/references/code-examples.md +95 -0
  312. package/istmx-system-design/references/common-designs.md +257 -0
  313. package/istmx-system-design/references/database-scaling.md +295 -0
  314. package/istmx-system-design/references/estimation-numbers.md +250 -0
  315. package/istmx-system-design/references/four-step-process.md +286 -0
  316. package/istmx-system-design/references/reliability-operations.md +373 -0
  317. package/istmx-system-design/references/worked-examples.md +174 -0
  318. package/istmx-tdd-verify/SKILL.md +364 -0
  319. package/istmx-tdd-verify/references/anti-tautological-tests.md +21 -0
  320. package/istmx-tdd-verify/references/characterization-and-seams.md +21 -0
  321. package/istmx-tdd-verify/references/condition-based-waiting.md +115 -0
  322. package/istmx-tdd-verify/references/defense-in-depth.md +122 -0
  323. package/istmx-tdd-verify/references/root-cause-and-defense-in-depth.md +26 -0
  324. package/istmx-tdd-verify/references/root-cause-tracing.md +169 -0
  325. package/istmx-tdd-verify/references/systematic-debugging.md +283 -0
  326. package/istmx-tdd-verify/references/verification-before-completion.md +120 -0
  327. package/istmx-tdd-verify/references/working-with-legacy-code.md +206 -0
  328. package/istmx-tdd-verify/references/writing-good-tests.md +198 -0
  329. package/istmx-tdd-verify/scripts/find-polluter.sh +72 -0
  330. package/istmx-team-topologies/SKILL.md +217 -0
  331. package/istmx-team-topologies/references/case-studies.md +158 -0
  332. package/istmx-team-topologies/references/cognitive-load.md +148 -0
  333. package/istmx-team-topologies/references/fracture-planes.md +97 -0
  334. package/istmx-team-topologies/references/interaction-modes.md +137 -0
  335. package/istmx-team-topologies/references/team-types.md +145 -0
  336. package/istmx-tech-docs/SKILL.md +246 -0
  337. package/istmx-tech-docs/references/api-reference.md +431 -0
  338. package/istmx-tech-docs/references/audit-checklist.md +287 -0
  339. package/istmx-tech-docs/references/document-types.md +212 -0
  340. package/istmx-tech-docs/references/procedures-and-code.md +249 -0
  341. package/istmx-tech-docs/references/release-notes.md +424 -0
  342. package/istmx-tech-docs/references/structure-and-formatting.md +330 -0
  343. package/istmx-tech-docs/references/voice-and-words.md +296 -0
  344. package/package.json +127 -127
  345. package/RELEASE_v2.1.0.md +0 -68
  346. package/context/conversation_transcript.md +0 -786
  347. package/context/progress.md +0 -129
  348. package/istm/SKILL.md +0 -74
  349. package/istm-animate/SKILL.md +0 -65
  350. package/istm-animate/animations/animation_utils.md +0 -280
  351. package/istm-animate/animations/animations.md +0 -220
  352. package/istm-animate/animations/core_motion.md +0 -250
  353. package/istm-animate/animations/examples/README.md +0 -29
  354. package/istm-animate/animations/examples/nuxt/app/app.vue +0 -3
  355. package/istm-animate/animations/examples/nuxt/app/composables/useGSAP.ts +0 -91
  356. package/istm-animate/animations/examples/nuxt/app/pages/index.vue +0 -55
  357. package/istm-animate/animations/examples/nuxt/nuxt.config.ts +0 -4
  358. package/istm-animate/animations/examples/nuxt/package.json +0 -18
  359. package/istm-animate/animations/examples/react/App.jsx +0 -46
  360. package/istm-animate/animations/examples/react/index.html +0 -12
  361. package/istm-animate/animations/examples/react/main.jsx +0 -9
  362. package/istm-animate/animations/examples/react/package.json +0 -21
  363. package/istm-animate/animations/examples/react/vite.config.js +0 -7
  364. package/istm-animate/animations/examples/vanilla/index.html +0 -33
  365. package/istm-animate/animations/examples/vanilla/main.js +0 -36
  366. package/istm-animate/animations/examples/vue/app.vue +0 -47
  367. package/istm-animate/animations/examples/vue/index.html +0 -15
  368. package/istm-animate/animations/examples/vue/main.js +0 -9
  369. package/istm-animate/animations/examples/vue/package.json +0 -19
  370. package/istm-animate/animations/examples/vue/vite.config.js +0 -7
  371. package/istm-animate/animations/framework_motion.md +0 -262
  372. package/istm-animate/animations/motion.csv +0 -17
  373. package/istm-animate/animations/motion.md +0 -11
  374. package/istm-animate/animations/motion_catalog.json +0 -226
  375. package/istm-animate/animations/motion_performance.md +0 -75
  376. package/istm-animate/animations/motion_plugins.md +0 -429
  377. package/istm-animate/animations/react_animations.md +0 -132
  378. package/istm-animate/animations/scroll_trigger_effects.md +0 -291
  379. package/istm-animate/animations/timeline_sequencing.md +0 -103
  380. package/istm-animate/core/motion-principles/SKILL.md +0 -284
  381. package/istm-animate/core/motion-principles/references/designers.md +0 -127
  382. package/istm-animate/core/motion-principles/references/easing-guide.md +0 -231
  383. package/istm-animate/core/motion-principles/references/enter-exit-recipes.md +0 -466
  384. package/istm-animate/frameworks/canvas-generative/SKILL.md +0 -325
  385. package/istm-animate/frameworks/canvas-generative/references/algorithms.md +0 -925
  386. package/istm-animate/frameworks/css-native/SKILL.md +0 -319
  387. package/istm-animate/frameworks/css-native/references/modern-css.md +0 -465
  388. package/istm-animate/frameworks/framer-motion/SKILL.md +0 -187
  389. package/istm-animate/frameworks/framer-motion/references/api.md +0 -312
  390. package/istm-animate/frameworks/gsap/SKILL.md +0 -188
  391. package/istm-animate/frameworks/gsap/references/core.md +0 -218
  392. package/istm-animate/frameworks/gsap/references/plugins.md +0 -371
  393. package/istm-animate/frameworks/gsap/references/scrolltrigger.md +0 -325
  394. package/istm-animate/frameworks/gsap/references/timeline.md +0 -218
  395. package/istm-animate/frameworks/threejs-r3f/SKILL.md +0 -243
  396. package/istm-animate/frameworks/threejs-r3f/references/scene-setup.md +0 -392
  397. package/istm-animate/frameworks/threejs-r3f/references/shaders.md +0 -446
  398. package/istm-animate/mobile/android/compose-graphics/SKILL.md +0 -503
  399. package/istm-animate/mobile/android/compose-graphics/references/agsl-recipes.md +0 -356
  400. package/istm-animate/mobile/android/compose-graphics/references/canvas-generative.md +0 -282
  401. package/istm-animate/mobile/android/compose-graphics/references/m3-expressive-deep.md +0 -303
  402. package/istm-animate/mobile/android/compose-motion/SKILL.md +0 -359
  403. package/istm-animate/mobile/android/compose-motion/references/gestures-compose.md +0 -273
  404. package/istm-animate/mobile/android/compose-motion/references/recomposition-and-anim.md +0 -196
  405. package/istm-animate/mobile/android/compose-motion/references/shared-transitions.md +0 -281
  406. package/istm-animate/mobile/android/compose-multiplatform/SKILL.md +0 -311
  407. package/istm-animate/mobile/android/compose-multiplatform/references/cmp-interop.md +0 -288
  408. package/istm-animate/mobile/android/compose-multiplatform/references/cmp-platform-quirks.md +0 -156
  409. package/istm-animate/mobile/apple/swiftui-graphics/SKILL.md +0 -408
  410. package/istm-animate/mobile/apple/swiftui-graphics/references/canvas-swiftui.md +0 -239
  411. package/istm-animate/mobile/apple/swiftui-graphics/references/liquid-glass-deep.md +0 -252
  412. package/istm-animate/mobile/apple/swiftui-graphics/references/metal-recipes.md +0 -382
  413. package/istm-animate/mobile/apple/swiftui-motion/SKILL.md +0 -379
  414. package/istm-animate/mobile/apple/swiftui-motion/references/gestures-swiftui.md +0 -336
  415. package/istm-animate/mobile/apple/swiftui-motion/references/phase-keyframe-deep.md +0 -231
  416. package/istm-animate/mobile/apple/swiftui-motion/references/springs-cheatsheet.md +0 -129
  417. package/istm-animate/references/animate.md +0 -199
  418. package/istm-animate/references/audit.md +0 -115
  419. package/istm-animate/references/design-engineering.md +0 -674
  420. package/istm-animate/references/improve.md +0 -101
  421. package/istm-animate/references/opportunities.md +0 -132
  422. package/istm-animate/references/plan-template.md +0 -73
  423. package/istm-animate/references/recipes.md +0 -324
  424. package/istm-animate/references/review.md +0 -112
  425. package/istm-animate/references/standards.md +0 -187
  426. package/istm-animate/references/vocabulary.md +0 -173
  427. package/istm-architecture/SKILL.md +0 -174
  428. package/istm-architecture/frameworks/angular.csv +0 -51
  429. package/istm-architecture/frameworks/astro.csv +0 -54
  430. package/istm-architecture/frameworks/avalonia.csv +0 -57
  431. package/istm-architecture/frameworks/flutter.csv +0 -53
  432. package/istm-architecture/frameworks/javafx.csv +0 -76
  433. package/istm-architecture/frameworks/jetpack-compose.csv +0 -53
  434. package/istm-architecture/frameworks/laravel.csv +0 -51
  435. package/istm-architecture/frameworks/nextjs.csv +0 -53
  436. package/istm-architecture/frameworks/nuxtjs.csv +0 -59
  437. package/istm-architecture/frameworks/react-native.csv +0 -52
  438. package/istm-architecture/frameworks/react.csv +0 -54
  439. package/istm-architecture/frameworks/svelte.csv +0 -54
  440. package/istm-architecture/frameworks/swiftui.csv +0 -51
  441. package/istm-architecture/frameworks/uwp.csv +0 -56
  442. package/istm-architecture/frameworks/vue.csv +0 -50
  443. package/istm-architecture/frameworks/winui.csv +0 -60
  444. package/istm-architecture/frameworks/wpf.csv +0 -57
  445. package/istm-architecture/templates/design.md +0 -138
  446. package/istm-awwward-designer/SKILL.md +0 -75
  447. package/istm-awwward-designer/libraries/threejs.csv +0 -54
  448. package/istm-awwward-designer/references/accessibility.md +0 -774
  449. package/istm-awwward-designer/references/anim-anti-patterns.md +0 -576
  450. package/istm-awwward-designer/references/animation-map.md +0 -166
  451. package/istm-awwward-designer/references/animation-standards.md +0 -86
  452. package/istm-awwward-designer/references/anti-patterns.md +0 -191
  453. package/istm-awwward-designer/references/color-systems.md +0 -604
  454. package/istm-awwward-designer/references/css-performance.md +0 -477
  455. package/istm-awwward-designer/references/descender-safety.md +0 -490
  456. package/istm-awwward-designer/references/design-audit.md +0 -93
  457. package/istm-awwward-designer/references/font-loading.md +0 -378
  458. package/istm-awwward-designer/references/image-optimization.md +0 -440
  459. package/istm-awwward-designer/references/invention-gate.md +0 -356
  460. package/istm-awwward-designer/references/micro-interactions.md +0 -825
  461. package/istm-awwward-designer/references/page-transitions.md +0 -365
  462. package/istm-awwward-designer/references/performance-standards.md +0 -79
  463. package/istm-awwward-designer/references/quality-gate.md +0 -103
  464. package/istm-awwward-designer/references/responsive-design.md +0 -778
  465. package/istm-awwward-designer/references/scoring-guide.md +0 -201
  466. package/istm-awwward-designer/references/scroll-patterns.md +0 -668
  467. package/istm-awwward-designer/references/stitch-brief.md +0 -124
  468. package/istm-awwward-designer/references/tech-stack.md +0 -204
  469. package/istm-awwward-designer/references/technical-audit.md +0 -133
  470. package/istm-awwward-designer/references/technique-families.md +0 -293
  471. package/istm-awwward-designer/references/testing.md +0 -535
  472. package/istm-awwward-designer/references/text-animation.md +0 -585
  473. package/istm-awwward-designer/references/typography.md +0 -504
  474. package/istm-awwward-designer/references/usability-audit.md +0 -108
  475. package/istm-awwward-designer/references/visual-standards.md +0 -97
  476. package/istm-design/SKILL.md +0 -85
  477. package/istm-design/anti-laziness/architectural-patterns.md +0 -55
  478. package/istm-design/anti-laziness/parameter-tuning.md +0 -44
  479. package/istm-design/anti-laziness/prompt-engineering.md +0 -52
  480. package/istm-design/anti-laziness/reference-prompts.md +0 -79
  481. package/istm-design/archetypes/brandkit/SKILL.md +0 -798
  482. package/istm-design/archetypes/brutalist/SKILL.md +0 -92
  483. package/istm-design/archetypes/minimalist/SKILL.md +0 -85
  484. package/istm-design/archetypes/soft/SKILL.md +0 -98
  485. package/istm-design/colors/color_theory.md +0 -293
  486. package/istm-design/colors/colors.csv +0 -193
  487. package/istm-design/colors/colors_catalog.json +0 -4034
  488. package/istm-design/colors/palette.json +0 -21
  489. package/istm-design/core/design-audit/SKILL.md +0 -248
  490. package/istm-design/core/desktop-principles/SKILL.md +0 -363
  491. package/istm-design/core/desktop-principles/references/keyboard-patterns.md +0 -137
  492. package/istm-design/core/desktop-principles/references/multi-window.md +0 -105
  493. package/istm-design/core/mobile-principles/SKILL.md +0 -289
  494. package/istm-design/core/mobile-principles/references/accessibility-mobile.md +0 -175
  495. package/istm-design/core/mobile-principles/references/gestures-deep.md +0 -220
  496. package/istm-design/core/ui-ux-pro-max/SKILL.md +0 -392
  497. package/istm-design/core/ui-ux-pro-max/UPSTREAM.md +0 -23
  498. package/istm-design/core/ui-ux-pro-max/data/app-interface.csv +0 -31
  499. package/istm-design/core/ui-ux-pro-max/data/charts.csv +0 -26
  500. package/istm-design/core/ui-ux-pro-max/data/colors.csv +0 -193
  501. package/istm-design/core/ui-ux-pro-max/data/google-fonts.csv +0 -1924
  502. package/istm-design/core/ui-ux-pro-max/data/icons.csv +0 -106
  503. package/istm-design/core/ui-ux-pro-max/data/landing.csv +0 -35
  504. package/istm-design/core/ui-ux-pro-max/data/motion.csv +0 -17
  505. package/istm-design/core/ui-ux-pro-max/data/products.csv +0 -193
  506. package/istm-design/core/ui-ux-pro-max/data/react-performance.csv +0 -45
  507. package/istm-design/core/ui-ux-pro-max/data/stacks/angular.csv +0 -51
  508. package/istm-design/core/ui-ux-pro-max/data/stacks/astro.csv +0 -54
  509. package/istm-design/core/ui-ux-pro-max/data/stacks/avalonia.csv +0 -57
  510. package/istm-design/core/ui-ux-pro-max/data/stacks/flutter.csv +0 -53
  511. package/istm-design/core/ui-ux-pro-max/data/stacks/html-tailwind.csv +0 -56
  512. package/istm-design/core/ui-ux-pro-max/data/stacks/javafx.csv +0 -76
  513. package/istm-design/core/ui-ux-pro-max/data/stacks/jetpack-compose.csv +0 -53
  514. package/istm-design/core/ui-ux-pro-max/data/stacks/laravel.csv +0 -51
  515. package/istm-design/core/ui-ux-pro-max/data/stacks/nextjs.csv +0 -53
  516. package/istm-design/core/ui-ux-pro-max/data/stacks/nuxt-ui.csv +0 -71
  517. package/istm-design/core/ui-ux-pro-max/data/stacks/nuxtjs.csv +0 -59
  518. package/istm-design/core/ui-ux-pro-max/data/stacks/react-native.csv +0 -52
  519. package/istm-design/core/ui-ux-pro-max/data/stacks/react.csv +0 -54
  520. package/istm-design/core/ui-ux-pro-max/data/stacks/shadcn.csv +0 -61
  521. package/istm-design/core/ui-ux-pro-max/data/stacks/svelte.csv +0 -54
  522. package/istm-design/core/ui-ux-pro-max/data/stacks/swiftui.csv +0 -51
  523. package/istm-design/core/ui-ux-pro-max/data/stacks/threejs.csv +0 -54
  524. package/istm-design/core/ui-ux-pro-max/data/stacks/uno.csv +0 -60
  525. package/istm-design/core/ui-ux-pro-max/data/stacks/uwp.csv +0 -56
  526. package/istm-design/core/ui-ux-pro-max/data/stacks/vue.csv +0 -50
  527. package/istm-design/core/ui-ux-pro-max/data/stacks/winui.csv +0 -60
  528. package/istm-design/core/ui-ux-pro-max/data/stacks/wpf.csv +0 -57
  529. package/istm-design/core/ui-ux-pro-max/data/styles.csv +0 -85
  530. package/istm-design/core/ui-ux-pro-max/data/typography.csv +0 -75
  531. package/istm-design/core/ui-ux-pro-max/data/ui-reasoning.csv +0 -162
  532. package/istm-design/core/ui-ux-pro-max/data/ux-guidelines.csv +0 -100
  533. package/istm-design/core/ui-ux-pro-max/references/pro-rules.md +0 -109
  534. package/istm-design/core/ui-ux-pro-max/references/quick-reference.md +0 -240
  535. package/istm-design/core/ui-ux-pro-max/scripts/core.py +0 -464
  536. package/istm-design/core/ui-ux-pro-max/scripts/design_system.py +0 -1371
  537. package/istm-design/core/ui-ux-pro-max/scripts/search.py +0 -162
  538. package/istm-design/core/ui-ux-pro-max/scripts/tests/test_core.py +0 -134
  539. package/istm-design/core/ui-ux-pro-max/scripts/validate_data.py +0 -114
  540. package/istm-design/image-to-code/SKILL.md +0 -1228
  541. package/istm-design/imagegen/SKILL.md +0 -987
  542. package/istm-design/presets/airbnb/DESIGN.md +0 -545
  543. package/istm-design/presets/airbnb/README.md +0 -5
  544. package/istm-design/presets/airtable/DESIGN.md +0 -554
  545. package/istm-design/presets/airtable/README.md +0 -5
  546. package/istm-design/presets/apple/DESIGN.md +0 -562
  547. package/istm-design/presets/apple/README.md +0 -5
  548. package/istm-design/presets/binance/DESIGN.md +0 -634
  549. package/istm-design/presets/binance/README.md +0 -5
  550. package/istm-design/presets/bmw/DESIGN.md +0 -544
  551. package/istm-design/presets/bmw/README.md +0 -5
  552. package/istm-design/presets/bmw-m/DESIGN.md +0 -503
  553. package/istm-design/presets/bmw-m/README.md +0 -5
  554. package/istm-design/presets/bugatti/DESIGN.md +0 -454
  555. package/istm-design/presets/bugatti/README.md +0 -5
  556. package/istm-design/presets/cal/DESIGN.md +0 -542
  557. package/istm-design/presets/cal/README.md +0 -5
  558. package/istm-design/presets/catalog.md +0 -127
  559. package/istm-design/presets/claude/DESIGN.md +0 -589
  560. package/istm-design/presets/claude/README.md +0 -5
  561. package/istm-design/presets/clay/DESIGN.md +0 -541
  562. package/istm-design/presets/clay/README.md +0 -5
  563. package/istm-design/presets/clickhouse/DESIGN.md +0 -544
  564. package/istm-design/presets/clickhouse/README.md +0 -5
  565. package/istm-design/presets/cohere/DESIGN.md +0 -451
  566. package/istm-design/presets/cohere/README.md +0 -5
  567. package/istm-design/presets/coinbase/DESIGN.md +0 -570
  568. package/istm-design/presets/coinbase/README.md +0 -5
  569. package/istm-design/presets/composio/DESIGN.md +0 -506
  570. package/istm-design/presets/composio/README.md +0 -5
  571. package/istm-design/presets/cursor/DESIGN.md +0 -537
  572. package/istm-design/presets/cursor/README.md +0 -5
  573. package/istm-design/presets/dell-1996/DESIGN.md +0 -632
  574. package/istm-design/presets/dell-1996/README.md +0 -5
  575. package/istm-design/presets/elevenlabs/DESIGN.md +0 -504
  576. package/istm-design/presets/elevenlabs/README.md +0 -5
  577. package/istm-design/presets/expo/DESIGN.md +0 -526
  578. package/istm-design/presets/expo/README.md +0 -5
  579. package/istm-design/presets/ferrari/DESIGN.md +0 -531
  580. package/istm-design/presets/ferrari/README.md +0 -5
  581. package/istm-design/presets/figma/DESIGN.md +0 -578
  582. package/istm-design/presets/figma/README.md +0 -5
  583. package/istm-design/presets/framer/DESIGN.md +0 -544
  584. package/istm-design/presets/framer/README.md +0 -5
  585. package/istm-design/presets/hashicorp/DESIGN.md +0 -575
  586. package/istm-design/presets/hashicorp/README.md +0 -5
  587. package/istm-design/presets/hp/DESIGN.md +0 -670
  588. package/istm-design/presets/hp/README.md +0 -5
  589. package/istm-design/presets/ibm/DESIGN.md +0 -550
  590. package/istm-design/presets/ibm/README.md +0 -5
  591. package/istm-design/presets/intercom/DESIGN.md +0 -546
  592. package/istm-design/presets/intercom/README.md +0 -5
  593. package/istm-design/presets/kraken/DESIGN.md +0 -125
  594. package/istm-design/presets/kraken/README.md +0 -5
  595. package/istm-design/presets/lamborghini/DESIGN.md +0 -288
  596. package/istm-design/presets/lamborghini/README.md +0 -5
  597. package/istm-design/presets/linear/DESIGN.md +0 -548
  598. package/istm-design/presets/linear/README.md +0 -5
  599. package/istm-design/presets/lovable/DESIGN.md +0 -298
  600. package/istm-design/presets/lovable/README.md +0 -5
  601. package/istm-design/presets/mastercard/DESIGN.md +0 -365
  602. package/istm-design/presets/mastercard/README.md +0 -5
  603. package/istm-design/presets/meta/DESIGN.md +0 -683
  604. package/istm-design/presets/meta/README.md +0 -5
  605. package/istm-design/presets/minimax/DESIGN.md +0 -746
  606. package/istm-design/presets/minimax/README.md +0 -5
  607. package/istm-design/presets/mintlify/DESIGN.md +0 -852
  608. package/istm-design/presets/mintlify/README.md +0 -5
  609. package/istm-design/presets/miro/DESIGN.md +0 -825
  610. package/istm-design/presets/miro/README.md +0 -5
  611. package/istm-design/presets/mistral/DESIGN.md +0 -773
  612. package/istm-design/presets/mistral/README.md +0 -5
  613. package/istm-design/presets/mongodb/DESIGN.md +0 -767
  614. package/istm-design/presets/mongodb/README.md +0 -5
  615. package/istm-design/presets/nike/DESIGN.md +0 -575
  616. package/istm-design/presets/nike/README.md +0 -5
  617. package/istm-design/presets/nintendo-2001/DESIGN.md +0 -649
  618. package/istm-design/presets/nintendo-2001/README.md +0 -5
  619. package/istm-design/presets/notion/DESIGN.md +0 -821
  620. package/istm-design/presets/notion/README.md +0 -5
  621. package/istm-design/presets/nvidia/DESIGN.md +0 -640
  622. package/istm-design/presets/nvidia/README.md +0 -5
  623. package/istm-design/presets/ollama/DESIGN.md +0 -539
  624. package/istm-design/presets/ollama/README.md +0 -5
  625. package/istm-design/presets/opencode/DESIGN.md +0 -521
  626. package/istm-design/presets/opencode/README.md +0 -5
  627. package/istm-design/presets/pinterest/DESIGN.md +0 -597
  628. package/istm-design/presets/pinterest/README.md +0 -5
  629. package/istm-design/presets/playstation/DESIGN.md +0 -661
  630. package/istm-design/presets/playstation/README.md +0 -5
  631. package/istm-design/presets/posthog/DESIGN.md +0 -690
  632. package/istm-design/presets/posthog/README.md +0 -5
  633. package/istm-design/presets/raycast/DESIGN.md +0 -669
  634. package/istm-design/presets/raycast/README.md +0 -5
  635. package/istm-design/presets/renault/DESIGN.md +0 -589
  636. package/istm-design/presets/renault/README.md +0 -5
  637. package/istm-design/presets/replicate/DESIGN.md +0 -616
  638. package/istm-design/presets/replicate/README.md +0 -5
  639. package/istm-design/presets/resend/DESIGN.md +0 -585
  640. package/istm-design/presets/resend/README.md +0 -5
  641. package/istm-design/presets/revolut/DESIGN.md +0 -636
  642. package/istm-design/presets/revolut/README.md +0 -5
  643. package/istm-design/presets/runwayml/DESIGN.md +0 -244
  644. package/istm-design/presets/runwayml/README.md +0 -5
  645. package/istm-design/presets/sanity/DESIGN.md +0 -357
  646. package/istm-design/presets/sanity/README.md +0 -5
  647. package/istm-design/presets/sentry/DESIGN.md +0 -551
  648. package/istm-design/presets/sentry/README.md +0 -5
  649. package/istm-design/presets/shopify/DESIGN.md +0 -516
  650. package/istm-design/presets/shopify/README.md +0 -5
  651. package/istm-design/presets/slack/DESIGN.md +0 -482
  652. package/istm-design/presets/spacex/DESIGN.md +0 -363
  653. package/istm-design/presets/spacex/README.md +0 -5
  654. package/istm-design/presets/spotify/DESIGN.md +0 -246
  655. package/istm-design/presets/spotify/README.md +0 -5
  656. package/istm-design/presets/starbucks/DESIGN.md +0 -580
  657. package/istm-design/presets/starbucks/README.md +0 -5
  658. package/istm-design/presets/stripe/DESIGN.md +0 -487
  659. package/istm-design/presets/stripe/README.md +0 -5
  660. package/istm-design/presets/supabase/DESIGN.md +0 -462
  661. package/istm-design/presets/supabase/README.md +0 -5
  662. package/istm-design/presets/superhuman/DESIGN.md +0 -448
  663. package/istm-design/presets/superhuman/README.md +0 -5
  664. package/istm-design/presets/tesla/DESIGN.md +0 -286
  665. package/istm-design/presets/tesla/README.md +0 -5
  666. package/istm-design/presets/theverge/DESIGN.md +0 -339
  667. package/istm-design/presets/theverge/README.md +0 -5
  668. package/istm-design/presets/together/DESIGN.md +0 -633
  669. package/istm-design/presets/together/README.md +0 -5
  670. package/istm-design/presets/uber/DESIGN.md +0 -636
  671. package/istm-design/presets/uber/README.md +0 -5
  672. package/istm-design/presets/vercel/DESIGN.md +0 -736
  673. package/istm-design/presets/vercel/README.md +0 -5
  674. package/istm-design/presets/vodafone/DESIGN.md +0 -538
  675. package/istm-design/presets/vodafone/README.md +0 -5
  676. package/istm-design/presets/voltagent/DESIGN.md +0 -521
  677. package/istm-design/presets/voltagent/README.md +0 -5
  678. package/istm-design/presets/warp/DESIGN.md +0 -526
  679. package/istm-design/presets/warp/README.md +0 -5
  680. package/istm-design/presets/webflow/DESIGN.md +0 -588
  681. package/istm-design/presets/webflow/README.md +0 -5
  682. package/istm-design/presets/wired/DESIGN.md +0 -497
  683. package/istm-design/presets/wired/README.md +0 -5
  684. package/istm-design/presets/wise/DESIGN.md +0 -544
  685. package/istm-design/presets/wise/README.md +0 -5
  686. package/istm-design/presets/xai/DESIGN.md +0 -465
  687. package/istm-design/presets/xai/README.md +0 -5
  688. package/istm-design/presets/zapier/DESIGN.md +0 -537
  689. package/istm-design/presets/zapier/README.md +0 -5
  690. package/istm-design/references/apple-design.md +0 -282
  691. package/istm-design/references/generation-guide.md +0 -209
  692. package/istm-design/references/pick-ui-library.md +0 -77
  693. package/istm-design/references/picker.md +0 -197
  694. package/istm-design/references/prototype.md +0 -90
  695. package/istm-design/references/schema.md +0 -366
  696. package/istm-design/semantic-design/DESIGN.md +0 -121
  697. package/istm-design/semantic-design/SKILL.md +0 -184
  698. package/istm-design/styles/design_system.md +0 -288
  699. package/istm-design/styles/html-tailwind.csv +0 -56
  700. package/istm-design/styles/nuxt-ui.csv +0 -71
  701. package/istm-design/styles/product_design.md +0 -55
  702. package/istm-design/styles/shadcn.csv +0 -61
  703. package/istm-design/styles/style.md +0 -12
  704. package/istm-design/styles/styles.csv +0 -85
  705. package/istm-design/styles/styles_catalog.json +0 -2018
  706. package/istm-design/styles/ui-reasoning.csv +0 -162
  707. package/istm-design/styles/uno.csv +0 -60
  708. package/istm-design/typography/font_and_font.md +0 -10
  709. package/istm-design/typography/google-fonts.csv +0 -1924
  710. package/istm-design/typography/sans_serif_fonts.md +0 -112
  711. package/istm-design/typography/typography.csv +0 -75
  712. package/istm-design/typography/typography_catalog.json +0 -964
  713. package/istm-design/ux/app-interface.csv +0 -31
  714. package/istm-design/ux/charts.csv +0 -26
  715. package/istm-design/ux/icons.csv +0 -106
  716. package/istm-design/ux/landing.csv +0 -35
  717. package/istm-design/ux/products.csv +0 -193
  718. package/istm-design/ux/react-performance.csv +0 -45
  719. package/istm-design/ux/responsive_rules.md +0 -62
  720. package/istm-design/ux/storytelling.md +0 -47
  721. package/istm-design/ux/ux-guidelines.csv +0 -100
  722. package/istm-design/ux/ux_guidelines.json +0 -1190
  723. package/istm-system-design/SKILL.md +0 -95
  724. package/istm-system-design/principles/01-architecture-patterns.md +0 -24
  725. package/istm-system-design/principles/02-database-selection.md +0 -32
  726. package/istm-system-design/principles/03-api-design.md +0 -25
  727. package/istm-system-design/principles/04-authentication-security.md +0 -23
  728. package/istm-system-design/principles/05-caching-performance.md +0 -21
  729. package/istm-system-design/principles/06-asynchronous-processing.md +0 -17
  730. package/istm-system-design/principles/07-infrastructure-deployment.md +0 -22
  731. package/istm-system-design/principles/08-low-level-design.md +0 -35
  732. package/istm-system-design/principles/09-state-management.md +0 -14
  733. package/istm-system-design/principles/10-error-handling-and-logging.md +0 -26
  734. package/istm-system-design/principles/11-testing-strategy.md +0 -18
  735. package/istm-system-design/principles/12-seo-and-web-vitals.md +0 -18
  736. package/istm-system-design/stacks/SETUP.md +0 -82
  737. package/istm-system-design/stacks/STACK.md +0 -67
  738. package/istm-system-design/stacks/WORKFLOW.md +0 -84
  739. package/istm-system-design/templates/api-route.ts.template +0 -32
  740. package/istm-system-design/templates/migrations.md.template +0 -30
  741. package/istm-system-design/templates/schema.drizzle.ts.template +0 -17
  742. package/istm-system-design/templates/schema.prisma.template +0 -28
  743. package/istm-system-design/templates/trpc-router.ts.template +0 -22
  744. package/istm-system-design/templates/zod-validators.ts.template +0 -14
@@ -1,1371 +0,0 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
- """
4
- Design System Generator - Aggregates search results and applies reasoning
5
- to generate comprehensive design system recommendations.
6
-
7
- Usage:
8
- from design_system import generate_design_system
9
- result = generate_design_system("SaaS dashboard", "My Project")
10
- print(result["text"])
11
-
12
- # With persistence (Master + Overrides pattern)
13
- result = generate_design_system("SaaS dashboard", "My Project", persist=True, output_dir="/path/to/project")
14
- result["persistence"] # {"status": "success"|"skipped_exists", "created_files": [...], ...}
15
- result = generate_design_system("SaaS dashboard", "My Project", persist=True, page="dashboard", output_dir="/path/to/project")
16
- """
17
-
18
- import csv
19
- import json
20
- import os
21
- import re
22
- import sys
23
- import io
24
- from datetime import datetime
25
- from pathlib import Path
26
- from core import search, DATA_DIR
27
-
28
- # Force UTF-8 for stdout/stderr to handle emojis/box-drawing chars on Windows (cp1252 default)
29
- if sys.stdout.encoding and sys.stdout.encoding.lower() != 'utf-8':
30
- sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
31
- if sys.stderr.encoding and sys.stderr.encoding.lower() != 'utf-8':
32
- sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
33
-
34
-
35
- # ============ CONFIGURATION ============
36
- REASONING_FILE = "ui-reasoning.csv"
37
-
38
- SEARCH_CONFIG = {
39
- "product": {"max_results": 1},
40
- "style": {"max_results": 3},
41
- "color": {"max_results": 2},
42
- "landing": {"max_results": 2},
43
- "typography": {"max_results": 2}
44
- }
45
-
46
- # ============ DESIGN DIALS (1-10) ============
47
- # Native @istmx DESIGN_VARIANCE / MOTION_INTENSITY / VISUAL_DENSITY dials
48
- # knobs: three optional 1-10 sliders that bias the existing query-based search
49
- # instead of replacing it. Each dial buckets into a low/mid/high tier.
50
- DIAL_TIERS = {
51
- "variance": [
52
- (1, 3, {"label": "Centered / Minimal", "style_keywords": ["Minimalism", "Exaggerated Minimalism", "centered", "symmetric", "grid-based"]}),
53
- (4, 7, {"label": "Balanced / Modern", "style_keywords": ["modern", "structured", "balanced"]}),
54
- (8, 10, {"label": "Bold / Asymmetric", "style_keywords": ["Brutalism", "Bento Grids", "asymmetric", "experimental"]}),
55
- ],
56
- "motion": [
57
- (1, 3, {"label": "Subtle", "tier": "Subtle"}),
58
- (4, 7, {"label": "Standard", "tier": "Standard"}),
59
- (8, 10, {"label": "Complex", "tier": "Complex"}),
60
- ],
61
- "density": [
62
- (1, 3, {"label": "Spacious", "spacing": {"xs": "4px", "sm": "8px", "md": "24px", "lg": "32px", "xl": "48px", "2xl": "64px", "3xl": "96px"}}),
63
- (4, 7, {"label": "Standard", "spacing": {"xs": "4px", "sm": "8px", "md": "16px", "lg": "24px", "xl": "32px", "2xl": "48px", "3xl": "64px"}}),
64
- (8, 10, {"label": "Dense / Dashboard", "spacing": {"xs": "2px", "sm": "4px", "md": "8px", "lg": "12px", "xl": "16px", "2xl": "24px", "3xl": "32px"}}),
65
- ],
66
- }
67
-
68
-
69
- def _resolve_dial(dial_name: str, value) -> dict:
70
- """Bucket a 1-10 dial value into its tier config. Returns None if value is None."""
71
- if value is None:
72
- return None
73
- value = max(1, min(10, int(value)))
74
- for lo, hi, info in DIAL_TIERS[dial_name]:
75
- if lo <= value <= hi:
76
- return {**info, "value": value}
77
- return None
78
-
79
-
80
- # ============ DESIGN SYSTEM GENERATOR ============
81
- class DesignSystemGenerator:
82
- """Generates design system recommendations from aggregated searches."""
83
-
84
- def __init__(self):
85
- self.reasoning_data = self._load_reasoning()
86
-
87
- def _load_reasoning(self) -> list:
88
- """Load reasoning rules from CSV."""
89
- filepath = DATA_DIR / REASONING_FILE
90
- if not filepath.exists():
91
- return []
92
- with open(filepath, 'r', encoding='utf-8') as f:
93
- return list(csv.DictReader(f))
94
-
95
- def _multi_domain_search(self, query: str, style_priority: list = None) -> dict:
96
- """Execute searches across multiple domains."""
97
- results = {}
98
- for domain, config in SEARCH_CONFIG.items():
99
- if domain == "style" and style_priority:
100
- # For style, also search with priority keywords
101
- priority_query = " ".join(style_priority[:2]) if style_priority else query
102
- combined_query = f"{query} {priority_query}"
103
- results[domain] = search(combined_query, domain, config["max_results"])
104
- else:
105
- results[domain] = search(query, domain, config["max_results"])
106
- return results
107
-
108
- def _find_reasoning_rule(self, category: str) -> dict:
109
- """Find matching reasoning rule for a category."""
110
- category_lower = category.lower()
111
-
112
- # Try exact match first
113
- for rule in self.reasoning_data:
114
- if rule.get("UI_Category", "").lower() == category_lower:
115
- return rule
116
-
117
- # Try partial match
118
- for rule in self.reasoning_data:
119
- ui_cat = rule.get("UI_Category", "").lower()
120
- if ui_cat in category_lower or category_lower in ui_cat:
121
- return rule
122
-
123
- # Try keyword match
124
- for rule in self.reasoning_data:
125
- ui_cat = rule.get("UI_Category", "").lower()
126
- keywords = ui_cat.replace("/", " ").replace("-", " ").split()
127
- if any(kw in category_lower for kw in keywords):
128
- return rule
129
-
130
- return {}
131
-
132
- def _apply_reasoning(self, category: str, search_results: dict) -> dict:
133
- """Apply reasoning rules to search results."""
134
- rule = self._find_reasoning_rule(category)
135
-
136
- if not rule:
137
- return {
138
- "pattern": "Hero + Features + CTA",
139
- "style_priority": ["Minimalism", "Flat Design"],
140
- "color_mood": "Professional",
141
- "typography_mood": "Clean",
142
- "key_effects": "Subtle hover transitions",
143
- "anti_patterns": "",
144
- "decision_rules": {},
145
- "severity": "MEDIUM"
146
- }
147
-
148
- # Parse decision rules JSON
149
- decision_rules = {}
150
- try:
151
- decision_rules = json.loads(rule.get("Decision_Rules", "{}"))
152
- except json.JSONDecodeError:
153
- pass
154
-
155
- return {
156
- "pattern": rule.get("Recommended_Pattern", ""),
157
- "style_priority": [s.strip() for s in rule.get("Style_Priority", "").split("+")],
158
- "color_mood": rule.get("Color_Mood", ""),
159
- "typography_mood": rule.get("Typography_Mood", ""),
160
- "key_effects": rule.get("Key_Effects", ""),
161
- "anti_patterns": rule.get("Anti_Patterns", ""),
162
- "decision_rules": decision_rules,
163
- "severity": rule.get("Severity", "MEDIUM")
164
- }
165
-
166
- def _select_best_match(self, results: list, priority_keywords: list) -> dict:
167
- """Select best matching result based on priority keywords."""
168
- if not results:
169
- return {}
170
-
171
- if not priority_keywords:
172
- return results[0]
173
-
174
- # First: try exact style name match
175
- for priority in priority_keywords:
176
- priority_lower = priority.lower().strip()
177
- for result in results:
178
- style_name = result.get("Style Category", "").lower()
179
- if priority_lower in style_name or style_name in priority_lower:
180
- return result
181
-
182
- # Second: score by keyword match in all fields
183
- scored = []
184
- for result in results:
185
- result_str = str(result).lower()
186
- score = 0
187
- for kw in priority_keywords:
188
- kw_lower = kw.lower().strip()
189
- # Higher score for style name match
190
- if kw_lower in result.get("Style Category", "").lower():
191
- score += 10
192
- # Lower score for keyword field match
193
- elif kw_lower in result.get("Keywords", "").lower():
194
- score += 3
195
- # Even lower for other field matches
196
- elif kw_lower in result_str:
197
- score += 1
198
- scored.append((score, result))
199
-
200
- scored.sort(key=lambda x: x[0], reverse=True)
201
- return scored[0][1] if scored and scored[0][0] > 0 else results[0]
202
-
203
- def _extract_results(self, search_result: dict) -> list:
204
- """Extract results list from search result dict."""
205
- return search_result.get("results", [])
206
-
207
- def generate(self, query: str, project_name: str = None,
208
- variance: int = None, motion: int = None, density: int = None) -> dict:
209
- """Generate complete design system recommendation.
210
-
211
- variance/motion/density are optional 1-10 dials (see DIAL_TIERS) that bias
212
- style selection, pull in a matching motion.csv snippet, and override the
213
- spacing scale, without changing behavior when left unset.
214
- """
215
- variance_info = _resolve_dial("variance", variance)
216
- motion_info = _resolve_dial("motion", motion)
217
- density_info = _resolve_dial("density", density)
218
-
219
- # Step 1: First search product to get category
220
- product_result = search(query, "product", 1)
221
- product_results = product_result.get("results", [])
222
- category = "General"
223
- if product_results:
224
- category = product_results[0].get("Product Type", "General")
225
-
226
- # Step 2: Get reasoning rules for this category
227
- reasoning = self._apply_reasoning(category, {})
228
- style_priority = reasoning.get("style_priority", [])
229
-
230
- # DESIGN_VARIANCE dial: bias style retrieval/selection toward
231
- # centered-minimal (low) or bold-asymmetric (high) keywords.
232
- effective_style_priority = style_priority
233
- if variance_info:
234
- effective_style_priority = variance_info["style_keywords"] + style_priority
235
-
236
- # Step 3: Multi-domain search with style priority hints
237
- search_results = self._multi_domain_search(query, effective_style_priority)
238
- search_results["product"] = product_result # Reuse product search
239
-
240
- # Step 4: Select best matches from each domain using priority
241
- style_results = self._extract_results(search_results.get("style", {}))
242
- color_results = self._extract_results(search_results.get("color", {}))
243
- typography_results = self._extract_results(search_results.get("typography", {}))
244
- landing_results = self._extract_results(search_results.get("landing", {}))
245
-
246
- best_style = self._select_best_match(style_results, effective_style_priority)
247
- best_color = color_results[0] if color_results else {}
248
- best_typography = typography_results[0] if typography_results else {}
249
- best_landing = landing_results[0] if landing_results else {}
250
-
251
- # MOTION_INTENSITY dial: pull a matching GSAP skeleton from motion.csv
252
- # (domain key is "gsap", not "motion" - PR #296 already owns the "motion"
253
- # domain for Emil Kowalski's motion-design principles, motion-principles.csv).
254
- motion_snippet = {}
255
- if motion_info:
256
- motion_result = search(f"{query} {motion_info['tier']}", "gsap", 5)
257
- motion_matches = motion_result.get("results", [])
258
- tiered = [m for m in motion_matches if m.get("Intensity Tier") == motion_info["tier"]]
259
- if tiered:
260
- motion_snippet = tiered[0]
261
- elif motion_matches:
262
- motion_snippet = motion_matches[0]
263
-
264
- # Step 5: Build final recommendation
265
- # Combine effects from both reasoning and style search
266
- style_effects = best_style.get("Effects & Animation", "")
267
- reasoning_effects = reasoning.get("key_effects", "")
268
- combined_effects = style_effects if style_effects else reasoning_effects
269
-
270
- return {
271
- "project_name": project_name or query.upper(),
272
- "category": category,
273
- "pattern": {
274
- "name": best_landing.get("Pattern Name", reasoning.get("pattern", "Hero + Features + CTA")),
275
- "sections": best_landing.get("Section Order", "Hero > Features > CTA"),
276
- "cta_placement": best_landing.get("Primary CTA Placement", "Above fold"),
277
- "color_strategy": best_landing.get("Color Strategy", ""),
278
- "conversion": best_landing.get("Conversion Optimization", "")
279
- },
280
- "style": {
281
- "name": best_style.get("Style Category", "Minimalism"),
282
- "type": best_style.get("Type", "General"),
283
- "effects": style_effects,
284
- "keywords": best_style.get("Keywords", ""),
285
- "best_for": best_style.get("Best For", ""),
286
- "performance": best_style.get("Performance", ""),
287
- "accessibility": best_style.get("Accessibility", ""),
288
- "light_mode": best_style.get("Light Mode ✓", ""),
289
- "dark_mode": best_style.get("Dark Mode ✓", ""),
290
- },
291
- "colors": {
292
- "primary": best_color.get("Primary", "#2563EB"),
293
- "on_primary": best_color.get("On Primary", ""),
294
- "secondary": best_color.get("Secondary", "#3B82F6"),
295
- "accent": best_color.get("Accent", "#F97316"),
296
- "background": best_color.get("Background", "#F8FAFC"),
297
- "foreground": best_color.get("Foreground", "#1E293B"),
298
- "muted": best_color.get("Muted", ""),
299
- "border": best_color.get("Border", ""),
300
- "destructive": best_color.get("Destructive", ""),
301
- "ring": best_color.get("Ring", ""),
302
- "notes": best_color.get("Notes", ""),
303
- # Keep legacy keys for backward compat in MASTER.md
304
- "cta": best_color.get("Accent", "#F97316"),
305
- "text": best_color.get("Foreground", "#1E293B"),
306
- },
307
- "typography": {
308
- "heading": best_typography.get("Heading Font", "Inter"),
309
- "body": best_typography.get("Body Font", "Inter"),
310
- "mood": best_typography.get("Mood/Style Keywords", reasoning.get("typography_mood", "")),
311
- "best_for": best_typography.get("Best For", ""),
312
- "google_fonts_url": best_typography.get("Google Fonts URL", ""),
313
- "css_import": best_typography.get("CSS Import", "")
314
- },
315
- "key_effects": combined_effects,
316
- "anti_patterns": reasoning.get("anti_patterns", ""),
317
- "decision_rules": reasoning.get("decision_rules", {}),
318
- "severity": reasoning.get("severity", "MEDIUM"),
319
- "dials": {
320
- "variance": variance_info["value"] if variance_info else None,
321
- "variance_label": variance_info["label"] if variance_info else None,
322
- "motion": motion_info["value"] if motion_info else None,
323
- "motion_label": motion_info["label"] if motion_info else None,
324
- "density": density_info["value"] if density_info else None,
325
- "density_label": density_info["label"] if density_info else None,
326
- },
327
- "motion_snippet": motion_snippet,
328
- "spacing_scale": density_info["spacing"] if density_info else None,
329
- }
330
-
331
-
332
- # ============ OUTPUT FORMATTERS ============
333
- BOX_WIDTH = 90 # Wider box for more content
334
-
335
-
336
- def hex_to_ansi(hex_color: str) -> str:
337
- """Convert hex color to ANSI True Color swatch (██) with fallback."""
338
- if not hex_color or not hex_color.startswith('#'):
339
- return ""
340
- colorterm = os.environ.get('COLORTERM', '')
341
- if colorterm not in ('truecolor', '24bit'):
342
- return ""
343
- hex_color = hex_color.lstrip('#')
344
- if len(hex_color) != 6:
345
- return ""
346
- r, g, b = int(hex_color[0:2], 16), int(hex_color[2:4], 16), int(hex_color[4:6], 16)
347
- return f"\033[38;2;{r};{g};{b}m██\033[0m "
348
-
349
-
350
- def ansi_ljust(s: str, width: int) -> str:
351
- """Like str.ljust but accounts for zero-width ANSI escape sequences."""
352
- import re
353
- visible_len = len(re.sub(r'\033\[[0-9;]*m', '', s))
354
- pad = width - visible_len
355
- return s + (" " * max(0, pad))
356
-
357
-
358
- def section_header(name: str, width: int) -> str:
359
- """Create a Unicode section separator: ├─── NAME ───...┤"""
360
- label = f"─── {name} "
361
- fill = "─" * (width - len(label) - 1)
362
- return f"├{label}{fill}┤"
363
-
364
-
365
- def format_ascii_box(design_system: dict) -> str:
366
- """Format design system as Unicode box with ANSI color swatches."""
367
- project = design_system.get("project_name", "PROJECT")
368
- pattern = design_system.get("pattern", {})
369
- style = design_system.get("style", {})
370
- colors = design_system.get("colors", {})
371
- typography = design_system.get("typography", {})
372
- effects = design_system.get("key_effects", "")
373
- anti_patterns = design_system.get("anti_patterns", "")
374
- dials = design_system.get("dials", {})
375
- motion_snippet = design_system.get("motion_snippet", {})
376
-
377
- def wrap_text(text: str, prefix: str, width: int) -> list:
378
- """Wrap long text into multiple lines."""
379
- if not text:
380
- return []
381
- words = text.split()
382
- lines = []
383
- current_line = prefix
384
- for word in words:
385
- if len(current_line) + len(word) + 1 <= width - 2:
386
- current_line += (" " if current_line != prefix else "") + word
387
- else:
388
- if current_line != prefix:
389
- lines.append(current_line)
390
- current_line = prefix + word
391
- if current_line != prefix:
392
- lines.append(current_line)
393
- return lines
394
-
395
- # Build sections from pattern
396
- sections = pattern.get("sections", "").split(">")
397
- sections = [s.strip() for s in sections if s.strip()]
398
-
399
- # Build output lines
400
- lines = []
401
- w = BOX_WIDTH - 1
402
-
403
- # Header with double-line box
404
- lines.append("╔" + "═" * w + "╗")
405
- lines.append(ansi_ljust(f"║ TARGET: {project} - RECOMMENDED DESIGN SYSTEM", BOX_WIDTH) + "║")
406
- lines.append("╚" + "═" * w + "╝")
407
- lines.append("┌" + "─" * w + "┐")
408
-
409
- # Design Dials section (only if at least one dial was set)
410
- if any(dials.get(k) is not None for k in ("variance", "motion", "density")):
411
- lines.append(section_header("DESIGN DIALS", BOX_WIDTH + 1))
412
- if dials.get("variance") is not None:
413
- lines.append(f"│ Variance: {dials['variance']}/10 — {dials['variance_label']}".ljust(BOX_WIDTH) + "│")
414
- if dials.get("motion") is not None:
415
- lines.append(f"│ Motion: {dials['motion']}/10 — {dials['motion_label']}".ljust(BOX_WIDTH) + "│")
416
- if dials.get("density") is not None:
417
- lines.append(f"│ Density: {dials['density']}/10 — {dials['density_label']}".ljust(BOX_WIDTH) + "│")
418
-
419
- # Pattern section
420
- lines.append(section_header("PATTERN", BOX_WIDTH + 1))
421
- lines.append(f"│ Name: {pattern.get('name', '')}".ljust(BOX_WIDTH) + "│")
422
- if pattern.get('conversion'):
423
- lines.append(f"│ Conversion: {pattern.get('conversion', '')}".ljust(BOX_WIDTH) + "│")
424
- if pattern.get('cta_placement'):
425
- lines.append(f"│ CTA: {pattern.get('cta_placement', '')}".ljust(BOX_WIDTH) + "│")
426
- lines.append("│ Sections:".ljust(BOX_WIDTH) + "│")
427
- for i, section in enumerate(sections, 1):
428
- lines.append(f"│ {i}. {section}".ljust(BOX_WIDTH) + "│")
429
-
430
- # Style section
431
- lines.append(section_header("STYLE", BOX_WIDTH + 1))
432
- lines.append(f"│ Name: {style.get('name', '')}".ljust(BOX_WIDTH) + "│")
433
- light = style.get("light_mode", "")
434
- dark = style.get("dark_mode", "")
435
- if light or dark:
436
- lines.append(f"│ Mode Support: Light {light} Dark {dark}".ljust(BOX_WIDTH) + "│")
437
- if style.get("keywords"):
438
- for line in wrap_text(f"Keywords: {style.get('keywords', '')}", "│ ", BOX_WIDTH):
439
- lines.append(line.ljust(BOX_WIDTH) + "│")
440
- if style.get("best_for"):
441
- for line in wrap_text(f"Best For: {style.get('best_for', '')}", "│ ", BOX_WIDTH):
442
- lines.append(line.ljust(BOX_WIDTH) + "│")
443
- if style.get("performance") or style.get("accessibility"):
444
- perf_a11y = f"Performance: {style.get('performance', '')} | Accessibility: {style.get('accessibility', '')}"
445
- lines.append(f"│ {perf_a11y}".ljust(BOX_WIDTH) + "│")
446
-
447
- # Colors section (extended palette with ANSI swatches)
448
- lines.append(section_header("COLORS", BOX_WIDTH + 1))
449
- color_entries = [
450
- ("Primary", "primary", "--color-primary"),
451
- ("On Primary", "on_primary", "--color-on-primary"),
452
- ("Secondary", "secondary", "--color-secondary"),
453
- ("Accent/CTA", "accent", "--color-accent"),
454
- ("Background", "background", "--color-background"),
455
- ("Foreground", "foreground", "--color-foreground"),
456
- ("Muted", "muted", "--color-muted"),
457
- ("Border", "border", "--color-border"),
458
- ("Destructive", "destructive", "--color-destructive"),
459
- ("Ring", "ring", "--color-ring"),
460
- ]
461
- for label, key, css_var in color_entries:
462
- hex_val = colors.get(key, "")
463
- if not hex_val:
464
- continue
465
- swatch = hex_to_ansi(hex_val)
466
- content = f"│ {swatch}{label + ':':14s} {hex_val:10s} ({css_var})"
467
- lines.append(ansi_ljust(content, BOX_WIDTH) + "│")
468
- if colors.get("notes"):
469
- for line in wrap_text(f"Notes: {colors.get('notes', '')}", "│ ", BOX_WIDTH):
470
- lines.append(line.ljust(BOX_WIDTH) + "│")
471
-
472
- # Typography section
473
- lines.append(section_header("TYPOGRAPHY", BOX_WIDTH + 1))
474
- lines.append(f"│ {typography.get('heading', '')} / {typography.get('body', '')}".ljust(BOX_WIDTH) + "│")
475
- if typography.get("mood"):
476
- for line in wrap_text(f"Mood: {typography.get('mood', '')}", "│ ", BOX_WIDTH):
477
- lines.append(line.ljust(BOX_WIDTH) + "│")
478
- if typography.get("best_for"):
479
- for line in wrap_text(f"Best For: {typography.get('best_for', '')}", "│ ", BOX_WIDTH):
480
- lines.append(line.ljust(BOX_WIDTH) + "│")
481
- if typography.get("google_fonts_url"):
482
- lines.append(f"│ Google Fonts: {typography.get('google_fonts_url', '')}".ljust(BOX_WIDTH) + "│")
483
- if typography.get("css_import"):
484
- lines.append(f"│ CSS Import: {typography.get('css_import', '')[:70]}...".ljust(BOX_WIDTH) + "│")
485
-
486
- # Key Effects section
487
- if effects:
488
- lines.append(section_header("KEY EFFECTS", BOX_WIDTH + 1))
489
- for line in wrap_text(effects, "│ ", BOX_WIDTH):
490
- lines.append(line.ljust(BOX_WIDTH) + "│")
491
-
492
- # Motion section (GSAP skeleton, only if --motion dial was set)
493
- if motion_snippet:
494
- lines.append(section_header("MOTION", BOX_WIDTH + 1))
495
- lines.append(f"│ {motion_snippet.get('Category', '')} ({motion_snippet.get('Intensity Tier', '')})".ljust(BOX_WIDTH) + "│")
496
- lines.append(f"│ Trigger: {motion_snippet.get('Trigger', '')} | Duration: {motion_snippet.get('Duration', '')} | Easing: {motion_snippet.get('Easing', '')}".ljust(BOX_WIDTH) + "│")
497
- for line in wrap_text(f"GSAP: {motion_snippet.get('GSAP Snippet', '')}", "│ ", BOX_WIDTH):
498
- lines.append(line.ljust(BOX_WIDTH) + "│")
499
- if motion_snippet.get("Framework Notes"):
500
- for line in wrap_text(f"Framework: {motion_snippet.get('Framework Notes', '')}", "│ ", BOX_WIDTH):
501
- lines.append(line.ljust(BOX_WIDTH) + "│")
502
-
503
- # Anti-patterns section
504
- if anti_patterns:
505
- lines.append(section_header("AVOID", BOX_WIDTH + 1))
506
- for line in wrap_text(anti_patterns, "│ ", BOX_WIDTH):
507
- lines.append(line.ljust(BOX_WIDTH) + "│")
508
-
509
- # Pre-Delivery Checklist section
510
- lines.append(section_header("PRE-DELIVERY CHECKLIST", BOX_WIDTH + 1))
511
- checklist_items = [
512
- "[ ] No emojis as icons (use SVG: Heroicons/Lucide)",
513
- "[ ] cursor-pointer on all clickable elements",
514
- "[ ] Hover states with smooth transitions (150-300ms)",
515
- "[ ] Light mode: text contrast 4.5:1 minimum",
516
- "[ ] Focus states visible for keyboard nav",
517
- "[ ] prefers-reduced-motion respected",
518
- "[ ] Responsive: 375px, 768px, 1024px, 1440px"
519
- ]
520
- for item in checklist_items:
521
- lines.append(f"│ {item}".ljust(BOX_WIDTH) + "│")
522
-
523
- lines.append("└" + "─" * w + "┘")
524
-
525
- return "\n".join(lines)
526
-
527
-
528
- def format_markdown(design_system: dict) -> str:
529
- """Format design system as markdown."""
530
- project = design_system.get("project_name", "PROJECT")
531
- pattern = design_system.get("pattern", {})
532
- style = design_system.get("style", {})
533
- colors = design_system.get("colors", {})
534
- typography = design_system.get("typography", {})
535
- effects = design_system.get("key_effects", "")
536
- anti_patterns = design_system.get("anti_patterns", "")
537
- dials = design_system.get("dials", {})
538
- motion_snippet = design_system.get("motion_snippet", {})
539
-
540
- lines = []
541
- lines.append(f"## Design System: {project}")
542
- lines.append("")
543
-
544
- # Design Dials section (only if at least one dial was set)
545
- if any(dials.get(k) is not None for k in ("variance", "motion", "density")):
546
- lines.append("### Design Dials")
547
- if dials.get("variance") is not None:
548
- lines.append(f"- **Variance:** {dials['variance']}/10 — {dials['variance_label']}")
549
- if dials.get("motion") is not None:
550
- lines.append(f"- **Motion:** {dials['motion']}/10 — {dials['motion_label']}")
551
- if dials.get("density") is not None:
552
- lines.append(f"- **Density:** {dials['density']}/10 — {dials['density_label']}")
553
- lines.append("")
554
-
555
- # Pattern section
556
- lines.append("### Pattern")
557
- lines.append(f"- **Name:** {pattern.get('name', '')}")
558
- if pattern.get('conversion'):
559
- lines.append(f"- **Conversion Focus:** {pattern.get('conversion', '')}")
560
- if pattern.get('cta_placement'):
561
- lines.append(f"- **CTA Placement:** {pattern.get('cta_placement', '')}")
562
- if pattern.get('color_strategy'):
563
- lines.append(f"- **Color Strategy:** {pattern.get('color_strategy', '')}")
564
- lines.append(f"- **Sections:** {pattern.get('sections', '')}")
565
- lines.append("")
566
-
567
- # Style section
568
- lines.append("### Style")
569
- lines.append(f"- **Name:** {style.get('name', '')}")
570
- light = style.get("light_mode", "")
571
- dark = style.get("dark_mode", "")
572
- if light or dark:
573
- lines.append(f"- **Mode Support:** Light {light} | Dark {dark}")
574
- if style.get('keywords'):
575
- lines.append(f"- **Keywords:** {style.get('keywords', '')}")
576
- if style.get('best_for'):
577
- lines.append(f"- **Best For:** {style.get('best_for', '')}")
578
- if style.get('performance') or style.get('accessibility'):
579
- lines.append(f"- **Performance:** {style.get('performance', '')} | **Accessibility:** {style.get('accessibility', '')}")
580
- lines.append("")
581
-
582
- # Colors section (extended palette)
583
- lines.append("### Colors")
584
- lines.append("| Role | Hex | CSS Variable |")
585
- lines.append("|------|-----|--------------|")
586
- md_color_entries = [
587
- ("Primary", "primary", "--color-primary"),
588
- ("On Primary", "on_primary", "--color-on-primary"),
589
- ("Secondary", "secondary", "--color-secondary"),
590
- ("Accent/CTA", "accent", "--color-accent"),
591
- ("Background", "background", "--color-background"),
592
- ("Foreground", "foreground", "--color-foreground"),
593
- ("Muted", "muted", "--color-muted"),
594
- ("Border", "border", "--color-border"),
595
- ("Destructive", "destructive", "--color-destructive"),
596
- ("Ring", "ring", "--color-ring"),
597
- ]
598
- for label, key, css_var in md_color_entries:
599
- hex_val = colors.get(key, "")
600
- if hex_val:
601
- lines.append(f"| {label} | `{hex_val}` | `{css_var}` |")
602
- if colors.get("notes"):
603
- lines.append(f"\n*Notes: {colors.get('notes', '')}*")
604
- lines.append("")
605
-
606
- # Typography section
607
- lines.append("### Typography")
608
- lines.append(f"- **Heading:** {typography.get('heading', '')}")
609
- lines.append(f"- **Body:** {typography.get('body', '')}")
610
- if typography.get("mood"):
611
- lines.append(f"- **Mood:** {typography.get('mood', '')}")
612
- if typography.get("best_for"):
613
- lines.append(f"- **Best For:** {typography.get('best_for', '')}")
614
- if typography.get("google_fonts_url"):
615
- lines.append(f"- **Google Fonts:** {typography.get('google_fonts_url', '')}")
616
- if typography.get("css_import"):
617
- lines.append(f"- **CSS Import:**")
618
- lines.append(f"```css")
619
- lines.append(f"{typography.get('css_import', '')}")
620
- lines.append(f"```")
621
- lines.append("")
622
-
623
- # Key Effects section
624
- if effects:
625
- lines.append("### Key Effects")
626
- lines.append(f"{effects}")
627
- lines.append("")
628
-
629
- # Motion section (GSAP skeleton, only if --motion dial was set)
630
- if motion_snippet:
631
- lines.append("### Motion")
632
- lines.append(f"**{motion_snippet.get('Category', '')}** ({motion_snippet.get('Intensity Tier', '')}) — Trigger: {motion_snippet.get('Trigger', '')} | Duration: {motion_snippet.get('Duration', '')} | Easing: `{motion_snippet.get('Easing', '')}`")
633
- lines.append("```js")
634
- lines.append(motion_snippet.get("GSAP Snippet", ""))
635
- lines.append("```")
636
- if motion_snippet.get("Framework Notes"):
637
- lines.append(f"*Framework notes: {motion_snippet.get('Framework Notes', '')}*")
638
- motion_do = motion_snippet.get("Do", "")
639
- motion_dont = motion_snippet.get("Don't", "")
640
- if motion_do:
641
- lines.append(f"- ✅ {motion_do}")
642
- if motion_dont:
643
- lines.append(f"- ❌ {motion_dont}")
644
- lines.append("")
645
-
646
- # Anti-patterns section
647
- if anti_patterns:
648
- lines.append("### Avoid (Anti-patterns)")
649
- newline_bullet = '\n- '
650
- lines.append(f"- {anti_patterns.replace(' + ', newline_bullet)}")
651
- lines.append("")
652
-
653
- # Pre-Delivery Checklist section
654
- lines.append("### Pre-Delivery Checklist")
655
- lines.append("- [ ] No emojis as icons (use SVG: Heroicons/Lucide)")
656
- lines.append("- [ ] cursor-pointer on all clickable elements")
657
- lines.append("- [ ] Hover states with smooth transitions (150-300ms)")
658
- lines.append("- [ ] Light mode: text contrast 4.5:1 minimum")
659
- lines.append("- [ ] Focus states visible for keyboard nav")
660
- lines.append("- [ ] prefers-reduced-motion respected")
661
- lines.append("- [ ] Responsive: 375px, 768px, 1024px, 1440px")
662
- lines.append("")
663
-
664
- return "\n".join(lines)
665
-
666
-
667
- # ============ MAIN ENTRY POINT ============
668
- def generate_design_system(query: str, project_name: str = None, output_format: str = "ascii",
669
- persist: bool = False, page: str = None, output_dir: str = None,
670
- variance: int = None, motion: int = None, density: int = None,
671
- force: bool = False) -> dict:
672
- """
673
- Main entry point for design system generation.
674
-
675
- Args:
676
- query: Search query (e.g., "SaaS dashboard", "e-commerce luxury")
677
- project_name: Optional project name for output header
678
- output_format: "ascii" (default) or "markdown"
679
- persist: If True, save design system to design-system/ folder
680
- page: Optional page name for page-specific override file
681
- output_dir: Optional output directory (defaults to current working directory)
682
- variance: Optional 1-10 DESIGN_VARIANCE dial (1=centered/minimal, 10=bold/asymmetric)
683
- motion: Optional 1-10 MOTION_INTENSITY dial, pulls a matching GSAP snippet from motion.csv
684
- density: Optional 1-10 VISUAL_DENSITY dial, overrides the spacing scale (1=spacious, 10=dense)
685
- force: If True, overwrite an existing MASTER.md; otherwise persistence
686
- is skipped (with a status message) when one already exists
687
-
688
- Returns:
689
- dict with keys: "text" (formatted design system string), "design_system"
690
- (raw dict, useful for --json callers), and "persistence" (result of
691
- persist_design_system(), or None if persist=False)
692
- """
693
- generator = DesignSystemGenerator()
694
- design_system = generator.generate(query, project_name, variance=variance, motion=motion, density=density)
695
-
696
- persistence_result = None
697
- if persist:
698
- persistence_result = persist_design_system(design_system, page, output_dir, query, force=force)
699
-
700
- text = format_markdown(design_system) if output_format == "markdown" else format_ascii_box(design_system)
701
-
702
- return {
703
- "text": text,
704
- "design_system": design_system,
705
- "persistence": persistence_result,
706
- }
707
-
708
-
709
- # ============ PERSISTENCE FUNCTIONS ============
710
- def safe_slug(name, fallback: str = "default") -> str:
711
- """Slugify a name into a single safe path segment.
712
-
713
- Only [a-z0-9_-] survives; every other character (including '/', '\\' and
714
- '.') collapses into '-'. This makes path traversal via project/page names
715
- (e.g. "../../etc") impossible — the slug can never leave its parent dir.
716
- """
717
- slug = re.sub(r'[^a-z0-9_-]+', '-', str(name).lower()).strip('-')
718
- return slug or fallback
719
-
720
-
721
- def persist_design_system(design_system: dict, page: str = None, output_dir: str = None,
722
- page_query: str = None, force: bool = False) -> dict:
723
- """
724
- Persist design system to design-system/<project>/ folder using Master + Overrides pattern.
725
-
726
- Args:
727
- design_system: The generated design system dictionary
728
- page: Optional page name for page-specific override file
729
- output_dir: Optional output directory (defaults to current working directory)
730
- page_query: Optional query string for intelligent page override generation
731
- force: If True, overwrite an existing MASTER.md. If False (default) and
732
- MASTER.md already exists, persistence is skipped so prior design
733
- decisions aren't silently discarded.
734
-
735
- Returns:
736
- dict with created file paths and status. status is "skipped_exists" if
737
- MASTER.md already existed and force was not set.
738
- """
739
- base_dir = Path(output_dir) if output_dir else Path.cwd()
740
-
741
- # Use project name for project-specific folder. Coalesce falsy values
742
- # (missing key, explicit None, or "") so the .lower() below can't crash.
743
- project_name = design_system.get("project_name") or "default"
744
- project_slug = safe_slug(project_name)
745
-
746
- design_system_dir = base_dir / "design-system" / project_slug
747
- pages_dir = design_system_dir / "pages"
748
-
749
- master_file = design_system_dir / "MASTER.md"
750
-
751
- if master_file.exists() and not force:
752
- return {
753
- "status": "skipped_exists",
754
- "design_system_dir": str(design_system_dir),
755
- "master_file": str(master_file),
756
- "created_files": [],
757
- "message": (
758
- f"{master_file} already exists and was not modified. "
759
- "Read it first to check for prior design decisions, then "
760
- "re-run with force=True / --force to overwrite."
761
- ),
762
- }
763
-
764
- created_files = []
765
-
766
- # Create directories
767
- design_system_dir.mkdir(parents=True, exist_ok=True)
768
- pages_dir.mkdir(parents=True, exist_ok=True)
769
-
770
- # Generate and write MASTER.md
771
- master_content = format_master_md(design_system)
772
- with open(master_file, 'w', encoding='utf-8') as f:
773
- f.write(master_content)
774
- created_files.append(str(master_file))
775
-
776
- # If page is specified, create page override file with intelligent content
777
- if page:
778
- page_file = pages_dir / f"{safe_slug(page, 'page')}.md"
779
- page_content = format_page_override_md(design_system, page, page_query)
780
- with open(page_file, 'w', encoding='utf-8') as f:
781
- f.write(page_content)
782
- created_files.append(str(page_file))
783
-
784
- return {
785
- "status": "success",
786
- "design_system_dir": str(design_system_dir),
787
- "master_file": str(master_file),
788
- "created_files": created_files
789
- }
790
-
791
-
792
- def format_master_md(design_system: dict) -> str:
793
- """Format design system as MASTER.md with hierarchical override logic."""
794
- project = design_system.get("project_name", "PROJECT")
795
- pattern = design_system.get("pattern", {})
796
- style = design_system.get("style", {})
797
- colors = design_system.get("colors", {})
798
- typography = design_system.get("typography", {})
799
- effects = design_system.get("key_effects", "")
800
- anti_patterns = design_system.get("anti_patterns", "")
801
- dials = design_system.get("dials", {})
802
- motion_snippet = design_system.get("motion_snippet", {})
803
- spacing_scale = design_system.get("spacing_scale")
804
-
805
- timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
806
-
807
- lines = []
808
-
809
- # Logic header
810
- lines.append("# Design System Master File")
811
- lines.append("")
812
- lines.append("> **LOGIC:** When building a specific page, first check `design-system/pages/[page-name].md`.")
813
- lines.append("> If that file exists, its rules **override** this Master file.")
814
- lines.append("> If not, strictly follow the rules below.")
815
- lines.append("")
816
- lines.append("---")
817
- lines.append("")
818
- lines.append(f"**Project:** {project}")
819
- lines.append(f"**Generated:** {timestamp}")
820
- lines.append(f"**Category:** {design_system.get('category', 'General')}")
821
- if any(dials.get(k) is not None for k in ("variance", "motion", "density")):
822
- dial_parts = []
823
- if dials.get("variance") is not None:
824
- dial_parts.append(f"Variance {dials['variance']}/10 ({dials['variance_label']})")
825
- if dials.get("motion") is not None:
826
- dial_parts.append(f"Motion {dials['motion']}/10 ({dials['motion_label']})")
827
- if dials.get("density") is not None:
828
- dial_parts.append(f"Density {dials['density']}/10 ({dials['density_label']})")
829
- lines.append(f"**Design Dials:** {' | '.join(dial_parts)}")
830
- lines.append("")
831
- lines.append("---")
832
- lines.append("")
833
-
834
- # Global Rules section
835
- lines.append("## Global Rules")
836
- lines.append("")
837
-
838
- # Color Palette
839
- lines.append("### Color Palette")
840
- lines.append("")
841
- lines.append("| Role | Hex | CSS Variable |")
842
- lines.append("|------|-----|--------------|")
843
- master_color_entries = [
844
- ("Primary", "primary", "--color-primary"),
845
- ("On Primary", "on_primary", "--color-on-primary"),
846
- ("Secondary", "secondary", "--color-secondary"),
847
- ("Accent/CTA", "accent", "--color-accent"),
848
- ("Background", "background", "--color-background"),
849
- ("Foreground", "foreground", "--color-foreground"),
850
- ("Muted", "muted", "--color-muted"),
851
- ("Border", "border", "--color-border"),
852
- ("Destructive", "destructive", "--color-destructive"),
853
- ("Ring", "ring", "--color-ring"),
854
- ]
855
- for label, key, css_var in master_color_entries:
856
- hex_val = colors.get(key, "")
857
- if hex_val:
858
- lines.append(f"| {label} | `{hex_val}` | `{css_var}` |")
859
- lines.append("")
860
- if colors.get("notes"):
861
- lines.append(f"**Color Notes:** {colors.get('notes', '')}")
862
- lines.append("")
863
-
864
- # Typography
865
- lines.append("### Typography")
866
- lines.append("")
867
- lines.append(f"- **Heading Font:** {typography.get('heading', 'Inter')}")
868
- lines.append(f"- **Body Font:** {typography.get('body', 'Inter')}")
869
- if typography.get("mood"):
870
- lines.append(f"- **Mood:** {typography.get('mood', '')}")
871
- if typography.get("google_fonts_url"):
872
- lines.append(f"- **Google Fonts:** [{typography.get('heading', '')} + {typography.get('body', '')}]({typography.get('google_fonts_url', '')})")
873
- lines.append("")
874
- if typography.get("css_import"):
875
- lines.append("**CSS Import:**")
876
- lines.append("```css")
877
- lines.append(typography.get("css_import", ""))
878
- lines.append("```")
879
- lines.append("")
880
-
881
- # Spacing Variables (overridden by the VISUAL_DENSITY dial when set)
882
- default_spacing = DIAL_TIERS["density"][1][2]["spacing"] # mid-tier = the historical defaults
883
- scale = spacing_scale or default_spacing
884
- spacing_usage = {
885
- "xs": "Tight gaps", "sm": "Icon gaps, inline spacing", "md": "Standard padding",
886
- "lg": "Section padding", "xl": "Large gaps", "2xl": "Section margins", "3xl": "Hero padding",
887
- }
888
- lines.append("### Spacing Variables")
889
- lines.append("")
890
- if spacing_scale:
891
- lines.append(f"*Density: {dials.get('density')}/10 — {dials.get('density_label')}*")
892
- lines.append("")
893
- lines.append("| Token | Value | Usage |")
894
- lines.append("|-------|-------|-------|")
895
- for token in ("xs", "sm", "md", "lg", "xl", "2xl", "3xl"):
896
- px_value = scale[token]
897
- rem_value = f"{int(px_value.rstrip('px')) / 16:g}rem"
898
- lines.append(f"| `--space-{token}` | `{px_value}` / `{rem_value}` | {spacing_usage[token]} |")
899
- lines.append("")
900
-
901
- # Shadow Depths
902
- lines.append("### Shadow Depths")
903
- lines.append("")
904
- lines.append("| Level | Value | Usage |")
905
- lines.append("|-------|-------|-------|")
906
- lines.append("| `--shadow-sm` | `0 1px 2px rgba(0,0,0,0.05)` | Subtle lift |")
907
- lines.append("| `--shadow-md` | `0 4px 6px rgba(0,0,0,0.1)` | Cards, buttons |")
908
- lines.append("| `--shadow-lg` | `0 10px 15px rgba(0,0,0,0.1)` | Modals, dropdowns |")
909
- lines.append("| `--shadow-xl` | `0 20px 25px rgba(0,0,0,0.15)` | Hero images, featured cards |")
910
- lines.append("")
911
-
912
- # Component Specs section
913
- lines.append("---")
914
- lines.append("")
915
- lines.append("## Component Specs")
916
- lines.append("")
917
-
918
- # Buttons
919
- lines.append("### Buttons")
920
- lines.append("")
921
- lines.append("```css")
922
- lines.append("/* Primary Button */")
923
- lines.append(".btn-primary {")
924
- lines.append(f" background: {colors.get('cta', '#F97316')};")
925
- lines.append(" color: white;")
926
- lines.append(" padding: 12px 24px;")
927
- lines.append(" border-radius: 8px;")
928
- lines.append(" font-weight: 600;")
929
- lines.append(" transition: all 200ms ease;")
930
- lines.append(" cursor: pointer;")
931
- lines.append("}")
932
- lines.append("")
933
- lines.append(".btn-primary:hover {")
934
- lines.append(" opacity: 0.9;")
935
- lines.append(" transform: translateY(-1px);")
936
- lines.append("}")
937
- lines.append("")
938
- lines.append("/* Secondary Button */")
939
- lines.append(".btn-secondary {")
940
- lines.append(f" background: transparent;")
941
- lines.append(f" color: {colors.get('primary', '#2563EB')};")
942
- lines.append(f" border: 2px solid {colors.get('primary', '#2563EB')};")
943
- lines.append(" padding: 12px 24px;")
944
- lines.append(" border-radius: 8px;")
945
- lines.append(" font-weight: 600;")
946
- lines.append(" transition: all 200ms ease;")
947
- lines.append(" cursor: pointer;")
948
- lines.append("}")
949
- lines.append("```")
950
- lines.append("")
951
-
952
- # Cards
953
- lines.append("### Cards")
954
- lines.append("")
955
- lines.append("```css")
956
- lines.append(".card {")
957
- lines.append(f" background: {colors.get('background', '#FFFFFF')};")
958
- lines.append(" border-radius: 12px;")
959
- lines.append(" padding: 24px;")
960
- lines.append(" box-shadow: var(--shadow-md);")
961
- lines.append(" transition: all 200ms ease;")
962
- lines.append(" cursor: pointer;")
963
- lines.append("}")
964
- lines.append("")
965
- lines.append(".card:hover {")
966
- lines.append(" box-shadow: var(--shadow-lg);")
967
- lines.append(" transform: translateY(-2px);")
968
- lines.append("}")
969
- lines.append("```")
970
- lines.append("")
971
-
972
- # Inputs
973
- lines.append("### Inputs")
974
- lines.append("")
975
- lines.append("```css")
976
- lines.append(".input {")
977
- lines.append(" padding: 12px 16px;")
978
- lines.append(" border: 1px solid #E2E8F0;")
979
- lines.append(" border-radius: 8px;")
980
- lines.append(" font-size: 16px;")
981
- lines.append(" transition: border-color 200ms ease;")
982
- lines.append("}")
983
- lines.append("")
984
- lines.append(".input:focus {")
985
- lines.append(f" border-color: {colors.get('primary', '#2563EB')};")
986
- lines.append(" outline: none;")
987
- lines.append(f" box-shadow: 0 0 0 3px {colors.get('primary', '#2563EB')}20;")
988
- lines.append("}")
989
- lines.append("```")
990
- lines.append("")
991
-
992
- # Modals
993
- lines.append("### Modals")
994
- lines.append("")
995
- lines.append("```css")
996
- lines.append(".modal-overlay {")
997
- lines.append(" background: rgba(0, 0, 0, 0.5);")
998
- lines.append(" backdrop-filter: blur(4px);")
999
- lines.append("}")
1000
- lines.append("")
1001
- lines.append(".modal {")
1002
- lines.append(" background: white;")
1003
- lines.append(" border-radius: 16px;")
1004
- lines.append(" padding: 32px;")
1005
- lines.append(" box-shadow: var(--shadow-xl);")
1006
- lines.append(" max-width: 500px;")
1007
- lines.append(" width: 90%;")
1008
- lines.append("}")
1009
- lines.append("```")
1010
- lines.append("")
1011
-
1012
- # Style section
1013
- lines.append("---")
1014
- lines.append("")
1015
- lines.append("## Style Guidelines")
1016
- lines.append("")
1017
- lines.append(f"**Style:** {style.get('name', 'Minimalism')}")
1018
- lines.append("")
1019
- if style.get("keywords"):
1020
- lines.append(f"**Keywords:** {style.get('keywords', '')}")
1021
- lines.append("")
1022
- if style.get("best_for"):
1023
- lines.append(f"**Best For:** {style.get('best_for', '')}")
1024
- lines.append("")
1025
- if effects:
1026
- lines.append(f"**Key Effects:** {effects}")
1027
- lines.append("")
1028
-
1029
- # Layout Pattern
1030
- lines.append("### Page Pattern")
1031
- lines.append("")
1032
- lines.append(f"**Pattern Name:** {pattern.get('name', '')}")
1033
- lines.append("")
1034
- if pattern.get('conversion'):
1035
- lines.append(f"- **Conversion Strategy:** {pattern.get('conversion', '')}")
1036
- if pattern.get('cta_placement'):
1037
- lines.append(f"- **CTA Placement:** {pattern.get('cta_placement', '')}")
1038
- lines.append(f"- **Section Order:** {pattern.get('sections', '')}")
1039
- lines.append("")
1040
-
1041
- # Motion section (GSAP skeleton, only if --motion dial was set)
1042
- if motion_snippet:
1043
- lines.append("---")
1044
- lines.append("")
1045
- lines.append("## Motion")
1046
- lines.append("")
1047
- lines.append(f"**{motion_snippet.get('Category', '')}** ({motion_snippet.get('Intensity Tier', '')}) — Trigger: {motion_snippet.get('Trigger', '')} | Duration: {motion_snippet.get('Duration', '')} | Easing: `{motion_snippet.get('Easing', '')}`")
1048
- lines.append("")
1049
- lines.append("```js")
1050
- lines.append(motion_snippet.get("GSAP Snippet", ""))
1051
- lines.append("```")
1052
- lines.append("")
1053
- if motion_snippet.get("Framework Notes"):
1054
- lines.append(f"**Framework notes:** {motion_snippet.get('Framework Notes', '')}")
1055
- lines.append("")
1056
- motion_do = motion_snippet.get("Do", "")
1057
- motion_dont = motion_snippet.get("Don't", "")
1058
- if motion_do:
1059
- lines.append(f"- ✅ {motion_do}")
1060
- if motion_dont:
1061
- lines.append(f"- ❌ {motion_dont}")
1062
- if motion_snippet.get("Performance Notes"):
1063
- lines.append(f"- ⚡ {motion_snippet.get('Performance Notes', '')}")
1064
- lines.append("")
1065
-
1066
- # Anti-Patterns section
1067
- lines.append("---")
1068
- lines.append("")
1069
- lines.append("## Anti-Patterns (Do NOT Use)")
1070
- lines.append("")
1071
- if anti_patterns:
1072
- anti_list = [a.strip() for a in anti_patterns.split("+")]
1073
- for anti in anti_list:
1074
- if anti:
1075
- lines.append(f"- ❌ {anti}")
1076
- lines.append("")
1077
- lines.append("### Additional Forbidden Patterns")
1078
- lines.append("")
1079
- lines.append("- ❌ **Emojis as icons** — Use SVG icons (Heroicons, Lucide, Simple Icons)")
1080
- lines.append("- ❌ **Missing cursor:pointer** — All clickable elements must have cursor:pointer")
1081
- lines.append("- ❌ **Layout-shifting hovers** — Avoid scale transforms that shift layout")
1082
- lines.append("- ❌ **Low contrast text** — Maintain 4.5:1 minimum contrast ratio")
1083
- lines.append("- ❌ **Instant state changes** — Always use transitions (150-300ms)")
1084
- lines.append("- ❌ **Invisible focus states** — Focus states must be visible for a11y")
1085
- lines.append("")
1086
-
1087
- # Pre-Delivery Checklist
1088
- lines.append("---")
1089
- lines.append("")
1090
- lines.append("## Pre-Delivery Checklist")
1091
- lines.append("")
1092
- lines.append("Before delivering any UI code, verify:")
1093
- lines.append("")
1094
- lines.append("- [ ] No emojis used as icons (use SVG instead)")
1095
- lines.append("- [ ] All icons from consistent icon set (Heroicons/Lucide)")
1096
- lines.append("- [ ] `cursor-pointer` on all clickable elements")
1097
- lines.append("- [ ] Hover states with smooth transitions (150-300ms)")
1098
- lines.append("- [ ] Light mode: text contrast 4.5:1 minimum")
1099
- lines.append("- [ ] Focus states visible for keyboard navigation")
1100
- lines.append("- [ ] `prefers-reduced-motion` respected")
1101
- lines.append("- [ ] Responsive: 375px, 768px, 1024px, 1440px")
1102
- lines.append("- [ ] No content hidden behind fixed navbars")
1103
- lines.append("- [ ] No horizontal scroll on mobile")
1104
- lines.append("")
1105
-
1106
- return "\n".join(lines)
1107
-
1108
-
1109
- def format_page_override_md(design_system: dict, page_name: str, page_query: str = None) -> str:
1110
- """Format a page-specific override file with intelligent AI-generated content."""
1111
- project = design_system.get("project_name", "PROJECT")
1112
- timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
1113
- page_title = page_name.replace("-", " ").replace("_", " ").title()
1114
-
1115
- # Detect page type and generate intelligent overrides
1116
- page_overrides = _generate_intelligent_overrides(page_name, page_query, design_system)
1117
-
1118
- lines = []
1119
-
1120
- lines.append(f"# {page_title} Page Overrides")
1121
- lines.append("")
1122
- lines.append(f"> **PROJECT:** {project}")
1123
- lines.append(f"> **Generated:** {timestamp}")
1124
- lines.append(f"> **Page Type:** {page_overrides.get('page_type', 'General')}")
1125
- lines.append("")
1126
- lines.append("> ⚠️ **IMPORTANT:** Rules in this file **override** the Master file (`design-system/MASTER.md`).")
1127
- lines.append("> Only deviations from the Master are documented here. For all other rules, refer to the Master.")
1128
- lines.append("")
1129
- lines.append("---")
1130
- lines.append("")
1131
-
1132
- # Page-specific rules with actual content
1133
- lines.append("## Page-Specific Rules")
1134
- lines.append("")
1135
-
1136
- # Layout Overrides
1137
- lines.append("### Layout Overrides")
1138
- lines.append("")
1139
- layout = page_overrides.get("layout", {})
1140
- if layout:
1141
- for key, value in layout.items():
1142
- lines.append(f"- **{key}:** {value}")
1143
- else:
1144
- lines.append("- No overrides — use Master layout")
1145
- lines.append("")
1146
-
1147
- # Spacing Overrides
1148
- lines.append("### Spacing Overrides")
1149
- lines.append("")
1150
- spacing = page_overrides.get("spacing", {})
1151
- if spacing:
1152
- for key, value in spacing.items():
1153
- lines.append(f"- **{key}:** {value}")
1154
- else:
1155
- lines.append("- No overrides — use Master spacing")
1156
- lines.append("")
1157
-
1158
- # Typography Overrides
1159
- lines.append("### Typography Overrides")
1160
- lines.append("")
1161
- typography = page_overrides.get("typography", {})
1162
- if typography:
1163
- for key, value in typography.items():
1164
- lines.append(f"- **{key}:** {value}")
1165
- else:
1166
- lines.append("- No overrides — use Master typography")
1167
- lines.append("")
1168
-
1169
- # Color Overrides
1170
- lines.append("### Color Overrides")
1171
- lines.append("")
1172
- colors = page_overrides.get("colors", {})
1173
- if colors:
1174
- for key, value in colors.items():
1175
- lines.append(f"- **{key}:** {value}")
1176
- else:
1177
- lines.append("- No overrides — use Master colors")
1178
- lines.append("")
1179
-
1180
- # Component Overrides
1181
- lines.append("### Component Overrides")
1182
- lines.append("")
1183
- components = page_overrides.get("components", [])
1184
- if components:
1185
- for comp in components:
1186
- lines.append(f"- {comp}")
1187
- else:
1188
- lines.append("- No overrides — use Master component specs")
1189
- lines.append("")
1190
-
1191
- # Page-Specific Components
1192
- lines.append("---")
1193
- lines.append("")
1194
- lines.append("## Page-Specific Components")
1195
- lines.append("")
1196
- unique_components = page_overrides.get("unique_components", [])
1197
- if unique_components:
1198
- for comp in unique_components:
1199
- lines.append(f"- {comp}")
1200
- else:
1201
- lines.append("- No unique components for this page")
1202
- lines.append("")
1203
-
1204
- # Recommendations
1205
- lines.append("---")
1206
- lines.append("")
1207
- lines.append("## Recommendations")
1208
- lines.append("")
1209
- recommendations = page_overrides.get("recommendations", [])
1210
- if recommendations:
1211
- for rec in recommendations:
1212
- lines.append(f"- {rec}")
1213
- lines.append("")
1214
-
1215
- return "\n".join(lines)
1216
-
1217
-
1218
- def _generate_intelligent_overrides(page_name: str, page_query: str, design_system: dict) -> dict:
1219
- """
1220
- Generate intelligent overrides based on page type using layered search.
1221
-
1222
- Uses the existing search infrastructure to find relevant style, UX, and layout
1223
- data instead of hardcoded page types.
1224
- """
1225
- from core import search
1226
-
1227
- page_lower = page_name.lower()
1228
- query_lower = (page_query or "").lower()
1229
- combined_context = f"{page_lower} {query_lower}"
1230
-
1231
- # Search across multiple domains for page-specific guidance
1232
- style_search = search(combined_context, "style", max_results=1)
1233
- ux_search = search(combined_context, "ux", max_results=3)
1234
- landing_search = search(combined_context, "landing", max_results=1)
1235
-
1236
- # Extract results from search response
1237
- style_results = style_search.get("results", [])
1238
- ux_results = ux_search.get("results", [])
1239
- landing_results = landing_search.get("results", [])
1240
-
1241
- # Detect page type from search results or context
1242
- page_type = _detect_page_type(combined_context, style_results)
1243
-
1244
- # Build overrides from search results
1245
- layout = {}
1246
- spacing = {}
1247
- typography = {}
1248
- colors = {}
1249
- components = []
1250
- unique_components = []
1251
- recommendations = []
1252
-
1253
- # Extract style-based overrides
1254
- if style_results:
1255
- style = style_results[0]
1256
- style_name = style.get("Style Category", "")
1257
- keywords = style.get("Keywords", "")
1258
- best_for = style.get("Best For", "")
1259
- effects = style.get("Effects & Animation", "")
1260
-
1261
- # Infer layout from style keywords
1262
- if any(kw in keywords.lower() for kw in ["data", "dense", "dashboard", "grid"]):
1263
- layout["Max Width"] = "1400px or full-width"
1264
- layout["Grid"] = "12-column grid for data flexibility"
1265
- spacing["Content Density"] = "High — optimize for information display"
1266
- elif any(kw in keywords.lower() for kw in ["minimal", "simple", "clean", "single"]):
1267
- layout["Max Width"] = "800px (narrow, focused)"
1268
- layout["Layout"] = "Single column, centered"
1269
- spacing["Content Density"] = "Low — focus on clarity"
1270
- else:
1271
- layout["Max Width"] = "1200px (standard)"
1272
- layout["Layout"] = "Full-width sections, centered content"
1273
-
1274
- if effects:
1275
- recommendations.append(f"Effects: {effects}")
1276
-
1277
- # Extract UX guidelines as recommendations
1278
- for ux in ux_results:
1279
- category = ux.get("Category", "")
1280
- do_text = ux.get("Do", "")
1281
- dont_text = ux.get("Don't", "")
1282
- if do_text:
1283
- recommendations.append(f"{category}: {do_text}")
1284
- if dont_text:
1285
- components.append(f"Avoid: {dont_text}")
1286
-
1287
- # Extract landing pattern info for section structure
1288
- if landing_results:
1289
- landing = landing_results[0]
1290
- sections = landing.get("Section Order", "")
1291
- cta_placement = landing.get("Primary CTA Placement", "")
1292
- color_strategy = landing.get("Color Strategy", "")
1293
-
1294
- if sections:
1295
- layout["Sections"] = sections
1296
- if cta_placement:
1297
- recommendations.append(f"CTA Placement: {cta_placement}")
1298
- if color_strategy:
1299
- colors["Strategy"] = color_strategy
1300
-
1301
- # Add page-type specific defaults if no search results
1302
- if not layout:
1303
- layout["Max Width"] = "1200px"
1304
- layout["Layout"] = "Responsive grid"
1305
-
1306
- if not recommendations:
1307
- recommendations = [
1308
- "Refer to MASTER.md for all design rules",
1309
- "Add specific overrides as needed for this page"
1310
- ]
1311
-
1312
- return {
1313
- "page_type": page_type,
1314
- "layout": layout,
1315
- "spacing": spacing,
1316
- "typography": typography,
1317
- "colors": colors,
1318
- "components": components,
1319
- "unique_components": unique_components,
1320
- "recommendations": recommendations
1321
- }
1322
-
1323
-
1324
- def _detect_page_type(context: str, style_results: list) -> str:
1325
- """Detect page type from context and search results."""
1326
- context_lower = context.lower()
1327
-
1328
- # Check for common page type patterns
1329
- page_patterns = [
1330
- (["dashboard", "admin", "analytics", "data", "metrics", "stats", "monitor", "overview"], "Dashboard / Data View"),
1331
- (["checkout", "payment", "cart", "purchase", "order", "billing"], "Checkout / Payment"),
1332
- (["settings", "profile", "account", "preferences", "config"], "Settings / Profile"),
1333
- (["landing", "marketing", "homepage", "hero", "home", "promo"], "Landing / Marketing"),
1334
- (["login", "signin", "signup", "register", "auth", "password"], "Authentication"),
1335
- (["pricing", "plans", "subscription", "tiers", "packages"], "Pricing / Plans"),
1336
- (["blog", "article", "post", "news", "content", "story"], "Blog / Article"),
1337
- (["product", "item", "detail", "pdp", "shop", "store"], "Product Detail"),
1338
- (["search", "results", "browse", "filter", "catalog", "list"], "Search Results"),
1339
- (["empty", "404", "error", "not found", "zero"], "Empty State"),
1340
- ]
1341
-
1342
- for keywords, page_type in page_patterns:
1343
- if any(kw in context_lower for kw in keywords):
1344
- return page_type
1345
-
1346
- # Fallback: try to infer from style results
1347
- if style_results:
1348
- style_name = style_results[0].get("Style Category", "").lower()
1349
- best_for = style_results[0].get("Best For", "").lower()
1350
-
1351
- if "dashboard" in best_for or "data" in best_for:
1352
- return "Dashboard / Data View"
1353
- elif "landing" in best_for or "marketing" in best_for:
1354
- return "Landing / Marketing"
1355
-
1356
- return "General"
1357
-
1358
-
1359
- # ============ CLI SUPPORT ============
1360
- if __name__ == "__main__":
1361
- import argparse
1362
-
1363
- parser = argparse.ArgumentParser(description="Generate Design System")
1364
- parser.add_argument("query", help="Search query (e.g., 'SaaS dashboard')")
1365
- parser.add_argument("--project-name", "-p", type=str, default=None, help="Project name")
1366
- parser.add_argument("--format", "-f", choices=["ascii", "markdown"], default="ascii", help="Output format")
1367
-
1368
- args = parser.parse_args()
1369
-
1370
- result = generate_design_system(args.query, args.project_name, args.format)
1371
- print(result["text"])