@monoes/monomindcli 2.5.1 → 2.5.3

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 (371) hide show
  1. package/.claude/agents/design/design-monodesign.md +6 -6
  2. package/.claude/agents/github/repo-architect.md +3 -3
  3. package/.claude/agents/github/sync-coordinator.md +2 -2
  4. package/.claude/agents/specialists/integration-architect.md +4 -4
  5. package/.claude/commands/github/repo-architect.md +4 -4
  6. package/.claude/commands/github/sync-coordinator.md +2 -2
  7. package/.claude/commands/mastermind/_repeat.md +4 -4
  8. package/.claude/commands/mastermind/approvev1.md +4 -4
  9. package/.claude/commands/mastermind/architect.md +6 -6
  10. package/.claude/commands/mastermind/autodev.md +5 -5
  11. package/.claude/commands/mastermind/brain.md +2 -2
  12. package/.claude/commands/mastermind/build.md +6 -6
  13. package/.claude/commands/mastermind/code-review.md +2 -2
  14. package/.claude/commands/mastermind/content.md +6 -6
  15. package/.claude/commands/mastermind/createorg.md +4 -4
  16. package/.claude/commands/mastermind/createtask.md +3 -3
  17. package/.claude/commands/mastermind/debug.md +5 -5
  18. package/.claude/commands/mastermind/design.md +5 -5
  19. package/.claude/commands/mastermind/do.md +2 -2
  20. package/.claude/commands/mastermind/execute.md +5 -5
  21. package/.claude/commands/mastermind/finance.md +6 -6
  22. package/.claude/commands/mastermind/finish.md +5 -5
  23. package/.claude/commands/mastermind/idea.md +6 -6
  24. package/.claude/commands/mastermind/ideate.md +5 -5
  25. package/.claude/commands/mastermind/improve.md +6 -6
  26. package/.claude/commands/mastermind/marketing.md +6 -6
  27. package/.claude/commands/mastermind/master.md +54 -54
  28. package/.claude/commands/mastermind/ops.md +6 -6
  29. package/.claude/commands/mastermind/orgs.md +2 -2
  30. package/.claude/commands/mastermind/orgstatus.md +2 -2
  31. package/.claude/commands/mastermind/plan.md +5 -5
  32. package/.claude/commands/mastermind/receive-review.md +5 -5
  33. package/.claude/commands/mastermind/release.md +6 -6
  34. package/.claude/commands/mastermind/research.md +6 -6
  35. package/.claude/commands/mastermind/review.md +6 -6
  36. package/.claude/commands/mastermind/runorg.md +4 -4
  37. package/.claude/commands/mastermind/runorgv1.md +5 -5
  38. package/.claude/commands/mastermind/sales.md +6 -6
  39. package/.claude/commands/mastermind/skill-builder.md +5 -5
  40. package/.claude/commands/mastermind/stoporg.md +3 -3
  41. package/.claude/commands/mastermind/taskdev.md +5 -5
  42. package/.claude/commands/mastermind/tdd.md +5 -5
  43. package/.claude/commands/mastermind/techport.md +5 -5
  44. package/.claude/commands/mastermind/verify.md +5 -5
  45. package/.claude/commands/mastermind/worktree.md +5 -5
  46. package/.claude/helpers/control-start.cjs +30 -0
  47. package/.claude/helpers/event-logger.cjs +2 -2
  48. package/.claude/helpers/extras-registry.json +1 -1
  49. package/.claude/helpers/handlers/agent-start-handler.cjs +2 -2
  50. package/.claude/helpers/handlers/edit-handler.cjs +2 -2
  51. package/.claude/helpers/handlers/gates-handler.cjs +1 -1
  52. package/.claude/helpers/handlers/route-handler.cjs +1 -1
  53. package/.claude/helpers/handlers/session-handler.cjs +1 -1
  54. package/.claude/helpers/handlers/session-restore-handler.cjs +11 -11
  55. package/.claude/helpers/handlers/task-handler.cjs +2 -2
  56. package/.claude/helpers/hook-handler.cjs +8 -8
  57. package/.claude/helpers/utils/monograph.cjs +44 -12
  58. package/.claude/skills/{mastermind-skills/access.md → mastermind-access/SKILL.md} +2 -2
  59. package/.claude/skills/{mastermind-skills/activity.md → mastermind-activity/SKILL.md} +2 -2
  60. package/.claude/skills/{mastermind-skills/adapter-manager.md → mastermind-adapter-manager/SKILL.md} +2 -2
  61. package/.claude/skills/{mastermind-skills/adapters.md → mastermind-adapters/SKILL.md} +2 -2
  62. package/.claude/skills/{mastermind-skills/agent-detail.md → mastermind-agent-detail/SKILL.md} +2 -2
  63. package/.claude/skills/{mastermind-skills/agents.md → mastermind-agents/SKILL.md} +2 -2
  64. package/.claude/skills/{mastermind-skills/approval-detail.md → mastermind-approval-detail/SKILL.md} +2 -2
  65. package/.claude/skills/{mastermind-skills/approvev1.md → mastermind-approvev1/SKILL.md} +2 -2
  66. package/.claude/skills/{mastermind-skills/architect.md → mastermind-architect/SKILL.md} +7 -7
  67. package/.claude/skills/{mastermind-skills/autodev.md → mastermind-autodev/SKILL.md} +10 -10
  68. package/.claude/skills/{mastermind-skills/backup.md → mastermind-backup/SKILL.md} +2 -2
  69. package/.claude/skills/{mastermind-skills/bootstrap.md → mastermind-bootstrap/SKILL.md} +2 -2
  70. package/.claude/skills/{mastermind-skills/budgets.md → mastermind-budgets/SKILL.md} +2 -2
  71. package/.claude/skills/{mastermind-skills/build.md → mastermind-build/SKILL.md} +5 -5
  72. package/.claude/skills/{mastermind-skills/companies.md → mastermind-companies/SKILL.md} +2 -2
  73. package/.claude/skills/{mastermind-skills/content.md → mastermind-content/SKILL.md} +5 -5
  74. package/.claude/skills/{mastermind-skills/costs.md → mastermind-costs/SKILL.md} +2 -2
  75. package/.claude/skills/{mastermind-skills/createorg.md → mastermind-createorg/SKILL.md} +3 -3
  76. package/.claude/skills/{mastermind-skills/debug.md → mastermind-debug/SKILL.md} +4 -4
  77. package/.claude/skills/{mastermind-skills/_delegation.md → mastermind-delegation/SKILL.md} +1 -1
  78. package/.claude/skills/{mastermind-skills/design.md → mastermind-design/SKILL.md} +9 -9
  79. package/.claude/skills/{mastermind-skills/diagnose.md → mastermind-diagnose/SKILL.md} +2 -2
  80. package/.claude/skills/{mastermind-skills/env.md → mastermind-env/SKILL.md} +2 -2
  81. package/.claude/skills/{mastermind-skills/environments.md → mastermind-environments/SKILL.md} +2 -2
  82. package/.claude/skills/{mastermind-skills/execute.md → mastermind-execute/SKILL.md} +10 -10
  83. package/.claude/skills/{mastermind-skills/export.md → mastermind-export/SKILL.md} +2 -2
  84. package/.claude/skills/{mastermind-skills/finance.md → mastermind-finance/SKILL.md} +5 -5
  85. package/.claude/skills/{mastermind-skills/goal-detail.md → mastermind-goal-detail/SKILL.md} +2 -2
  86. package/.claude/skills/{mastermind-skills/goals.md → mastermind-goals/SKILL.md} +2 -2
  87. package/.claude/skills/{mastermind-skills/heartbeatv1.md → mastermind-heartbeatv1/SKILL.md} +2 -2
  88. package/.claude/skills/{mastermind-skills/idea.md → mastermind-idea/SKILL.md} +7 -7
  89. package/.claude/skills/{mastermind-skills/import.md → mastermind-import/SKILL.md} +2 -2
  90. package/.claude/skills/{mastermind-skills/inbox.md → mastermind-inbox/SKILL.md} +2 -2
  91. package/.claude/skills/{mastermind-skills/instance.md → mastermind-instance/SKILL.md} +2 -2
  92. package/.claude/skills/{mastermind-skills/instance-settings.md → mastermind-instance-settings/SKILL.md} +2 -2
  93. package/.claude/skills/{mastermind-skills/invite-landing.md → mastermind-invite-landing/SKILL.md} +2 -2
  94. package/.claude/skills/{mastermind-skills/invites.md → mastermind-invites/SKILL.md} +2 -2
  95. package/.claude/skills/{mastermind-skills/issue-detail.md → mastermind-issue-detail/SKILL.md} +2 -2
  96. package/.claude/skills/{mastermind-skills/issues.md → mastermind-issues/SKILL.md} +2 -2
  97. package/.claude/skills/{mastermind-skills/join-queue.md → mastermind-join-queue/SKILL.md} +2 -2
  98. package/.claude/skills/{mastermind-skills/liveness.md → mastermind-liveness/SKILL.md} +2 -2
  99. package/.claude/skills/{mastermind-skills/marketing.md → mastermind-marketing/SKILL.md} +8 -8
  100. package/.claude/skills/{mastermind-skills/memory.md → mastermind-memory/SKILL.md} +2 -2
  101. package/.claude/skills/{mastermind-skills/monitor.md → mastermind-monitor/SKILL.md} +2 -2
  102. package/.claude/skills/{mastermind-skills/my-issues.md → mastermind-my-issues/SKILL.md} +2 -2
  103. package/.claude/skills/{mastermind-skills/new-agent.md → mastermind-new-agent/SKILL.md} +2 -2
  104. package/.claude/skills/{mastermind-skills/ops.md → mastermind-ops/SKILL.md} +5 -5
  105. package/.claude/skills/{mastermind-skills/org-chart.md → mastermind-org-chart/SKILL.md} +2 -2
  106. package/.claude/skills/{mastermind-skills/org-settings.md → mastermind-org-settings/SKILL.md} +2 -2
  107. package/.claude/skills/{mastermind-skills/orgs.md → mastermind-orgs/SKILL.md} +1 -1
  108. package/.claude/skills/{mastermind-skills/orgstatus.md → mastermind-orgstatus/SKILL.md} +2 -2
  109. package/.claude/skills/{mastermind-skills/plan.md → mastermind-plan/SKILL.md} +7 -7
  110. package/.claude/skills/{mastermind-skills/plan-to-tasks.md → mastermind-plan-to-tasks/SKILL.md} +2 -2
  111. package/.claude/skills/{mastermind-skills/plugin-manager.md → mastermind-plugin-manager/SKILL.md} +2 -2
  112. package/.claude/skills/{mastermind-skills/plugin-settings.md → mastermind-plugin-settings/SKILL.md} +2 -2
  113. package/.claude/skills/{mastermind-skills/plugins.md → mastermind-plugins/SKILL.md} +2 -2
  114. package/.claude/skills/{mastermind-skills/profile.md → mastermind-profile/SKILL.md} +2 -2
  115. package/.claude/skills/{mastermind-skills/project-detail.md → mastermind-project-detail/SKILL.md} +2 -2
  116. package/.claude/skills/{mastermind-skills/project-workspace.md → mastermind-project-workspace/SKILL.md} +2 -2
  117. package/.claude/skills/{mastermind-skills/projects.md → mastermind-projects/SKILL.md} +2 -2
  118. package/.claude/skills/{mastermind-skills/_protocol.md → mastermind-protocol/SKILL.md} +3 -3
  119. package/.claude/skills/{mastermind-skills/release.md → mastermind-release/SKILL.md} +5 -5
  120. package/.claude/skills/{mastermind-skills/_repeat.md → mastermind-repeat/SKILL.md} +2 -2
  121. package/.claude/skills/{mastermind-skills/research.md → mastermind-research/SKILL.md} +5 -5
  122. package/.claude/skills/{mastermind-skills/review.md → mastermind-review/SKILL.md} +5 -5
  123. package/.claude/skills/{mastermind-skills/routine-detail.md → mastermind-routine-detail/SKILL.md} +2 -2
  124. package/.claude/skills/{mastermind-skills/routines.md → mastermind-routines/SKILL.md} +2 -2
  125. package/.claude/skills/{mastermind-skills/runorgv1.md → mastermind-runorgv1/SKILL.md} +2 -2
  126. package/.claude/skills/{mastermind-skills/sales.md → mastermind-sales/SKILL.md} +5 -5
  127. package/.claude/skills/{mastermind-skills/search.md → mastermind-search/SKILL.md} +2 -2
  128. package/.claude/skills/{mastermind-skills/secrets.md → mastermind-secrets/SKILL.md} +2 -2
  129. package/.claude/skills/{mastermind-skills/skill-builder.md → mastermind-skill-builder/SKILL.md} +16 -14
  130. package/.claude/skills/mastermind-skills/{skills.md → SKILL.md} +2 -2
  131. package/.claude/skills/{mastermind-skills/stoporg.md → mastermind-stoporg/SKILL.md} +2 -2
  132. package/.claude/skills/{mastermind-skills/taskdev.md → mastermind-taskdev/SKILL.md} +6 -6
  133. package/.claude/skills/{mastermind-skills → mastermind-taskdev}/implementer-prompt.md +1 -1
  134. package/.claude/skills/{mastermind-skills/tasks.md → mastermind-tasks/SKILL.md} +2 -2
  135. package/.claude/skills/{mastermind-skills/tdd.md → mastermind-tdd/SKILL.md} +4 -4
  136. package/.claude/skills/{mastermind-skills/techport.md → mastermind-techport/SKILL.md} +6 -6
  137. package/.claude/skills/{mastermind-skills/threads.md → mastermind-threads/SKILL.md} +2 -2
  138. package/.claude/skills/{mastermind-skills/tree-control.md → mastermind-tree-control/SKILL.md} +2 -2
  139. package/.claude/skills/{mastermind-skills/verify.md → mastermind-verify/SKILL.md} +1 -1
  140. package/.claude/skills/{mastermind-skills/wiki.md → mastermind-wiki/SKILL.md} +2 -2
  141. package/.claude/skills/{mastermind-skills/workspace-detail.md → mastermind-workspace-detail/SKILL.md} +2 -2
  142. package/.claude/skills/{mastermind-skills/workspaces.md → mastermind-workspaces/SKILL.md} +2 -2
  143. package/.claude/skills/monodesign/SKILL.md +114 -190
  144. package/.claude/skills/monodesign/adapt.md +1 -1
  145. package/.claude/skills/monodesign/agents/monodesign-asset-producer.md +4 -4
  146. package/.claude/skills/monodesign/agents/monodesign-manual-edit-applier.md +103 -0
  147. package/.claude/skills/monodesign/audit.md +1 -1
  148. package/.claude/skills/monodesign/craft.md +2 -2
  149. package/.claude/skills/monodesign/critique.md +1 -1
  150. package/.claude/skills/monodesign/init.md +30 -0
  151. package/.claude/skills/monodesign/layout.md +36 -0
  152. package/.claude/skills/monodesign/live.md +19 -44
  153. package/.claude/skills/monodesign/reference/adapt.md +122 -0
  154. package/.claude/skills/monodesign/reference/adapt.native.md +58 -0
  155. package/.claude/skills/monodesign/reference/android.md +40 -0
  156. package/.claude/skills/monodesign/reference/animate.md +39 -11
  157. package/.claude/skills/monodesign/reference/antipatterns-catalog.md +67 -16
  158. package/.claude/skills/monodesign/reference/audit.md +5 -3
  159. package/.claude/skills/monodesign/reference/audit.native.md +139 -0
  160. package/.claude/skills/monodesign/reference/bolder.md +71 -64
  161. package/.claude/skills/monodesign/reference/brand.md +12 -18
  162. package/.claude/skills/monodesign/reference/clarify.md +114 -0
  163. package/.claude/skills/monodesign/reference/codex.md +4 -6
  164. package/.claude/skills/monodesign/reference/colorize.md +108 -5
  165. package/.claude/skills/monodesign/reference/craft.md +70 -143
  166. package/.claude/skills/monodesign/reference/critique.md +635 -68
  167. package/.claude/skills/monodesign/reference/delight.md +1 -1
  168. package/.claude/skills/monodesign/reference/distill.md +1 -1
  169. package/.claude/skills/monodesign/reference/document.md +24 -22
  170. package/.claude/skills/monodesign/reference/extract.md +1 -1
  171. package/.claude/skills/monodesign/reference/hooks.md +22 -29
  172. package/.claude/skills/monodesign/reference/init.md +221 -0
  173. package/.claude/skills/monodesign/reference/interaction-design.md +0 -6
  174. package/.claude/skills/monodesign/reference/ios.md +45 -0
  175. package/.claude/skills/monodesign/reference/layout.md +57 -13
  176. package/.claude/skills/monodesign/reference/live.md +159 -71
  177. package/.claude/skills/monodesign/reference/overdrive.md +1 -1
  178. package/.claude/skills/monodesign/reference/personas.md +1 -1
  179. package/.claude/skills/monodesign/reference/polish.md +16 -8
  180. package/.claude/skills/monodesign/reference/pre-delivery-checklist.md +1 -1
  181. package/.claude/skills/monodesign/reference/product.md +1 -3
  182. package/.claude/skills/monodesign/reference/quieter.md +1 -1
  183. package/.claude/skills/monodesign/reference/shape.md +27 -13
  184. package/.claude/skills/monodesign/reference/teach.md +6 -152
  185. package/.claude/skills/monodesign/reference/typeset.md +180 -3
  186. package/.claude/skills/monodesign/scripts/command-metadata.json +94 -0
  187. package/.claude/skills/monodesign/scripts/context-signals.mjs +260 -0
  188. package/.claude/skills/monodesign/scripts/context.mjs +1061 -0
  189. package/.claude/skills/monodesign/scripts/critique-storage.mjs +416 -0
  190. package/.claude/skills/monodesign/scripts/detect-csp.mjs +198 -0
  191. package/.claude/skills/monodesign/scripts/detect.mjs +33 -0
  192. package/.claude/skills/monodesign/scripts/detector/browser/injected/index.mjs +1962 -0
  193. package/.claude/skills/monodesign/scripts/detector/cli/main.mjs +321 -0
  194. package/.claude/skills/monodesign/scripts/detector/design-system.mjs +814 -0
  195. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +5601 -0
  196. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns.mjs +50 -0
  197. package/.claude/skills/monodesign/scripts/detector/engines/browser/detect-url.mjs +259 -0
  198. package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +258 -0
  199. package/.claude/skills/monodesign/scripts/detector/engines/regex/detect-text.mjs +636 -0
  200. package/.claude/skills/monodesign/scripts/detector/engines/static-html/css-cascade.mjs +1015 -0
  201. package/.claude/skills/monodesign/scripts/detector/engines/static-html/detect-html.mjs +253 -0
  202. package/.claude/skills/monodesign/scripts/detector/engines/visual/screenshot-contrast.mjs +198 -0
  203. package/.claude/skills/monodesign/scripts/detector/findings.mjs +12 -0
  204. package/.claude/skills/monodesign/scripts/detector/fix/css-regions.mjs +181 -0
  205. package/.claude/skills/monodesign/scripts/detector/fix/fixers.mjs +373 -0
  206. package/.claude/skills/monodesign/scripts/detector/fix/index.mjs +426 -0
  207. package/.claude/skills/monodesign/scripts/detector/node/file-system.mjs +198 -0
  208. package/.claude/skills/monodesign/scripts/detector/profile/profiler.mjs +166 -0
  209. package/.claude/skills/monodesign/scripts/detector/registry/antipatterns.mjs +563 -0
  210. package/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +2995 -0
  211. package/.claude/skills/monodesign/scripts/detector/shared/color.mjs +124 -0
  212. package/.claude/skills/monodesign/scripts/detector/shared/constants.mjs +101 -0
  213. package/.claude/skills/monodesign/scripts/detector/shared/fonts.mjs +30 -0
  214. package/.claude/skills/monodesign/scripts/detector/shared/inline-ignores.mjs +148 -0
  215. package/.claude/skills/monodesign/scripts/detector/shared/page.mjs +7 -0
  216. package/.claude/skills/monodesign/scripts/hook-admin.mjs +661 -0
  217. package/.claude/skills/monodesign/scripts/hook-before-edit.mjs +516 -0
  218. package/.claude/skills/monodesign/scripts/hook-lib.mjs +1776 -0
  219. package/.claude/skills/monodesign/scripts/hook.mjs +61 -0
  220. package/.claude/skills/monodesign/scripts/lib/design-parser.mjs +842 -0
  221. package/.claude/skills/monodesign/scripts/lib/is-generated.mjs +69 -0
  222. package/.claude/skills/monodesign/scripts/lib/monodesign-config.mjs +640 -0
  223. package/.claude/skills/monodesign/scripts/lib/monodesign-paths.mjs +129 -0
  224. package/.claude/skills/monodesign/scripts/lib/provider.mjs +4 -0
  225. package/.claude/skills/monodesign/scripts/lib/target-args.mjs +42 -0
  226. package/.claude/skills/monodesign/scripts/live/browser-script-parts.mjs +50 -0
  227. package/.claude/skills/monodesign/scripts/live/completion.mjs +19 -0
  228. package/.claude/skills/monodesign/scripts/live/event-validation.mjs +137 -0
  229. package/.claude/skills/monodesign/scripts/live/insert-ui.mjs +458 -0
  230. package/.claude/skills/monodesign/scripts/live/manual-apply.mjs +939 -0
  231. package/.claude/skills/monodesign/scripts/live/manual-edit-routes.mjs +357 -0
  232. package/.claude/skills/monodesign/scripts/live/manual-edits-buffer.mjs +152 -0
  233. package/.claude/skills/monodesign/scripts/live/session-store.mjs +293 -0
  234. package/.claude/skills/monodesign/scripts/live/svelte-component.mjs +826 -0
  235. package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +274 -0
  236. package/.claude/skills/monodesign/scripts/live/ui-core.mjs +180 -0
  237. package/.claude/skills/monodesign/scripts/live/vocabulary.mjs +36 -0
  238. package/.claude/skills/monodesign/scripts/live-accept.mjs +812 -0
  239. package/.claude/skills/monodesign/scripts/live-browser-dom.js +146 -0
  240. package/.claude/skills/monodesign/scripts/live-browser-session.js +123 -0
  241. package/.claude/skills/monodesign/scripts/live-browser.js +11240 -0
  242. package/.claude/skills/monodesign/scripts/live-commit-manual-edits.mjs +1241 -0
  243. package/.claude/skills/monodesign/scripts/live-complete.mjs +75 -0
  244. package/.claude/skills/monodesign/scripts/live-copy-edit-agent.mjs +683 -0
  245. package/.claude/skills/monodesign/scripts/live-discard-manual-edits.mjs +51 -0
  246. package/.claude/skills/monodesign/scripts/live-inject.mjs +583 -0
  247. package/.claude/skills/monodesign/scripts/live-insert.mjs +272 -0
  248. package/.claude/skills/monodesign/scripts/live-manual-edit-evidence.mjs +363 -0
  249. package/.claude/skills/monodesign/scripts/live-poll.mjs +384 -0
  250. package/.claude/skills/monodesign/scripts/live-resume.mjs +94 -0
  251. package/.claude/skills/monodesign/scripts/live-server.mjs +1137 -0
  252. package/.claude/skills/monodesign/scripts/live-status.mjs +61 -0
  253. package/.claude/skills/monodesign/scripts/live-target.mjs +30 -0
  254. package/.claude/skills/monodesign/scripts/live-wrap.mjs +894 -0
  255. package/.claude/skills/monodesign/scripts/live.mjs +297 -0
  256. package/.claude/skills/monodesign/scripts/modern-screenshot.umd.js +14 -0
  257. package/.claude/skills/monodesign/scripts/palette.mjs +633 -0
  258. package/.claude/skills/monodesign/scripts/pin.mjs +221 -0
  259. package/.claude/skills/monodesign/teach.md +7 -58
  260. package/README.md +1 -1
  261. package/dist/src/commands/design-detect.d.ts +7 -1
  262. package/dist/src/commands/design-detect.d.ts.map +1 -1
  263. package/dist/src/commands/design-detect.js +131 -38
  264. package/dist/src/commands/design-detect.js.map +1 -1
  265. package/dist/src/commands/design-palette.d.ts +0 -1
  266. package/dist/src/commands/design-palette.d.ts.map +1 -1
  267. package/dist/src/commands/design-palette.js +2 -3
  268. package/dist/src/commands/design-palette.js.map +1 -1
  269. package/dist/src/commands/doc.d.ts.map +1 -1
  270. package/dist/src/commands/doc.js +72 -15
  271. package/dist/src/commands/doc.js.map +1 -1
  272. package/dist/src/commands/doctor-project-checks.d.ts +5 -1
  273. package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
  274. package/dist/src/commands/doctor-project-checks.js +24 -1
  275. package/dist/src/commands/doctor-project-checks.js.map +1 -1
  276. package/dist/src/commands/doctor.js +3 -3
  277. package/dist/src/commands/doctor.js.map +1 -1
  278. package/dist/src/commands/hooks-workers.d.ts +1 -1
  279. package/dist/src/commands/hooks-workers.js +8 -8
  280. package/dist/src/commands/hooks-workers.js.map +1 -1
  281. package/dist/src/commands/init.js +2 -2
  282. package/dist/src/commands/init.js.map +1 -1
  283. package/dist/src/commands/org.d.ts.map +1 -1
  284. package/dist/src/commands/org.js +109 -9
  285. package/dist/src/commands/org.js.map +1 -1
  286. package/dist/src/index.d.ts +1 -1
  287. package/dist/src/index.js +3 -3
  288. package/dist/src/index.js.map +1 -1
  289. package/dist/src/init/claudemd-generator.js +5 -5
  290. package/dist/src/init/claudemd-generator.js.map +1 -1
  291. package/dist/src/init/executor.d.ts.map +1 -1
  292. package/dist/src/init/executor.js +17 -6
  293. package/dist/src/init/executor.js.map +1 -1
  294. package/dist/src/knowledge/document-pipeline.d.ts +2 -0
  295. package/dist/src/knowledge/document-pipeline.d.ts.map +1 -1
  296. package/dist/src/knowledge/document-pipeline.js +4 -1
  297. package/dist/src/knowledge/document-pipeline.js.map +1 -1
  298. package/dist/src/mcp-server.js +2 -2
  299. package/dist/src/mcp-server.js.map +1 -1
  300. package/dist/src/mcp-tools/hooks-intelligence.d.ts +1 -1
  301. package/dist/src/mcp-tools/hooks-intelligence.js +1 -1
  302. package/dist/src/mcp-tools/hooks-routing.js +2 -2
  303. package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
  304. package/dist/src/mcp-tools/hooks-tools.js +1 -1
  305. package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
  306. package/dist/src/mcp-tools/knowledge-tools.d.ts.map +1 -1
  307. package/dist/src/mcp-tools/knowledge-tools.js +38 -7
  308. package/dist/src/mcp-tools/knowledge-tools.js.map +1 -1
  309. package/dist/src/mcp-tools/memory-tools.d.ts +8 -3
  310. package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
  311. package/dist/src/mcp-tools/memory-tools.js +193 -31
  312. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  313. package/dist/src/memory/memory-bridge.d.ts +33 -0
  314. package/dist/src/memory/memory-bridge.d.ts.map +1 -1
  315. package/dist/src/memory/memory-bridge.js +166 -17
  316. package/dist/src/memory/memory-bridge.js.map +1 -1
  317. package/dist/src/memory/memory-kg.d.ts +186 -0
  318. package/dist/src/memory/memory-kg.d.ts.map +1 -0
  319. package/dist/src/memory/memory-kg.js +450 -0
  320. package/dist/src/memory/memory-kg.js.map +1 -0
  321. package/dist/src/memory/query-router.d.ts +44 -0
  322. package/dist/src/memory/query-router.d.ts.map +1 -0
  323. package/dist/src/memory/query-router.js +113 -0
  324. package/dist/src/memory/query-router.js.map +1 -0
  325. package/dist/src/orgrt/daemon.d.ts +18 -0
  326. package/dist/src/orgrt/daemon.d.ts.map +1 -1
  327. package/dist/src/orgrt/daemon.js +249 -12
  328. package/dist/src/orgrt/daemon.js.map +1 -1
  329. package/dist/src/orgrt/migrate.d.ts.map +1 -1
  330. package/dist/src/orgrt/migrate.js +7 -0
  331. package/dist/src/orgrt/migrate.js.map +1 -1
  332. package/dist/src/orgrt/policy.d.ts.map +1 -1
  333. package/dist/src/orgrt/policy.js +7 -0
  334. package/dist/src/orgrt/policy.js.map +1 -1
  335. package/dist/src/orgrt/session.d.ts +24 -1
  336. package/dist/src/orgrt/session.d.ts.map +1 -1
  337. package/dist/src/orgrt/session.js +18 -3
  338. package/dist/src/orgrt/session.js.map +1 -1
  339. package/dist/src/orgrt/templates.d.ts +1 -0
  340. package/dist/src/orgrt/templates.d.ts.map +1 -1
  341. package/dist/src/orgrt/templates.js +9 -4
  342. package/dist/src/orgrt/templates.js.map +1 -1
  343. package/dist/src/orgrt/types.d.ts +15 -0
  344. package/dist/src/orgrt/types.d.ts.map +1 -1
  345. package/dist/src/orgrt/types.js +2 -0
  346. package/dist/src/orgrt/types.js.map +1 -1
  347. package/dist/src/routing/embed-worker.js +1 -1
  348. package/dist/src/routing/embed-worker.js.map +1 -1
  349. package/dist/src/routing/llm-caller.js +1 -1
  350. package/dist/src/routing/route-layer-factory.js +1 -1
  351. package/dist/src/routing/route-layer-factory.js.map +1 -1
  352. package/dist/src/ui/dashboard.html +176 -26
  353. package/dist/src/ui/data/sessions/final-sess-001.jsonl +180 -180
  354. package/dist/src/ui/orgs.html +24 -0
  355. package/dist/src/ui/server.mjs +162 -12
  356. package/dist/src/update/checker.js +3 -3
  357. package/dist/src/update/checker.js.map +1 -1
  358. package/dist/tsconfig.tsbuildinfo +1 -1
  359. package/package.json +8 -6
  360. /package/.claude/skills/{mastermind-skills/_agent-select.md → mastermind-agent-select/SKILL.md} +0 -0
  361. /package/.claude/skills/{mastermind-skills/finish.md → mastermind-finish/SKILL.md} +0 -0
  362. /package/.claude/skills/{mastermind-skills/_intake.md → mastermind-intake/SKILL.md} +0 -0
  363. /package/.claude/skills/{mastermind-skills → mastermind-marketing}/references/copywriting-frameworks.md +0 -0
  364. /package/.claude/skills/{mastermind-skills → mastermind-marketing}/references/persuasion-psychology.md +0 -0
  365. /package/.claude/skills/{mastermind-skills/monotask.md → mastermind-monotask/SKILL.md} +0 -0
  366. /package/.claude/skills/{mastermind-skills/receive-review.md → mastermind-receive-review/SKILL.md} +0 -0
  367. /package/.claude/skills/{mastermind-skills/runorg.md → mastermind-runorg/SKILL.md} +0 -0
  368. /package/.claude/skills/{mastermind-skills → mastermind-taskdev}/code-quality-reviewer-prompt.md +0 -0
  369. /package/.claude/skills/{mastermind-skills → mastermind-taskdev}/final-reviewer-prompt.md +0 -0
  370. /package/.claude/skills/{mastermind-skills → mastermind-taskdev}/spec-reviewer-prompt.md +0 -0
  371. /package/.claude/skills/{mastermind-skills/worktree.md → mastermind-worktree/SKILL.md} +0 -0
@@ -0,0 +1,636 @@
1
+ import { GENERIC_FONTS, OVERUSED_FONTS } from '../../shared/constants.mjs';
2
+ import { isNeutralColor } from '../../shared/color.mjs';
3
+ import { extractGoogleFontFamilies } from '../../shared/fonts.mjs';
4
+ import { checkSourceDesignSystem } from '../../design-system.mjs';
5
+ import { isFullPage } from '../../shared/page.mjs';
6
+ import { applyInlineIgnores } from '../../shared/inline-ignores.mjs';
7
+ import { finding } from '../../findings.mjs';
8
+ import { filterByProviders } from '../../registry/antipatterns.mjs';
9
+ import { profileFindings, profileStep } from '../../profile/profiler.mjs';
10
+ import {
11
+ checkFocusVisible,
12
+ checkHoverOnlyAffordance,
13
+ checkDarkSchemeContrast,
14
+ } from '../../rules/checks.mjs';
15
+
16
+ // ---------------------------------------------------------------------------
17
+ // Regex fallback (non-HTML files: CSS, JSX, TSX, etc.)
18
+ // ---------------------------------------------------------------------------
19
+
20
+ const hasRounded = (line) => /\brounded(?:-\w+)?\b/.test(line);
21
+ const hasBorderRadius = (line) => /border-radius/i.test(line);
22
+ const isSafeElement = (line) => /<(?:blockquote|nav[\s>]|pre[\s>]|code[\s>]|a\s|input[\s>]|span[\s>])/i.test(line);
23
+
24
+ /** Strip HTML to plain text — drops script/style/comments/tags so
25
+ * content-text analyzers don't false-positive on code or CSS. */
26
+ function stripHtmlToText(html) {
27
+ return html
28
+ .replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, ' ')
29
+ .replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi, ' ')
30
+ .replace(/<!--[\s\S]*?-->/g, ' ')
31
+ .replace(/<[^>]+>/g, ' ')
32
+ .replace(/\s+/g, ' ');
33
+ }
34
+
35
+ const PAGE_ANALYZER_EXTS = new Set(['.html', '.htm', '.astro', '.vue', '.svelte']);
36
+
37
+ function extFromFilePath(filePath) {
38
+ return filePath ? (filePath.match(/\.\w+$/)?.[0] || '').toLowerCase() : '';
39
+ }
40
+
41
+ function shouldRunPageAnalyzers(content, filePath) {
42
+ if (!isFullPage(content)) return false;
43
+ const ext = extFromFilePath(filePath);
44
+ return !ext || PAGE_ANALYZER_EXTS.has(ext);
45
+ }
46
+
47
+ function firstOverusedGoogleFont(text) {
48
+ return extractGoogleFontFamilies(text).find(f => OVERUSED_FONTS.has(f)) || '';
49
+ }
50
+
51
+ function isNeutralBorderColor(str) {
52
+ const m = str.match(/solid\s+((?:rgba?|hsla?|oklch|oklab|lab|lch|hwb|color)\([^)]*\)|#[0-9a-f]{3,8}\b|[a-z]+)/i);
53
+ if (!m) return false;
54
+ const c = m[1].toLowerCase();
55
+ if (['gray', 'grey', 'silver', 'white', 'black', 'transparent', 'currentcolor'].includes(c)) return true;
56
+ if (/^(?:rgba?|hsla?|oklch|oklab|lab|lch|hwb)\(/i.test(c)) return isNeutralColor(c);
57
+ const hex = c.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/);
58
+ if (hex) {
59
+ const [r, g, b] = [parseInt(hex[1], 16), parseInt(hex[2], 16), parseInt(hex[3], 16)];
60
+ return (Math.max(r, g, b) - Math.min(r, g, b)) < 30;
61
+ }
62
+ const shex = c.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/);
63
+ if (shex) {
64
+ const [r, g, b] = [parseInt(shex[1] + shex[1], 16), parseInt(shex[2] + shex[2], 16), parseInt(shex[3] + shex[3], 16)];
65
+ return (Math.max(r, g, b) - Math.min(r, g, b)) < 30;
66
+ }
67
+ return false;
68
+ }
69
+
70
+ const REGEX_MATCHERS = [
71
+ // --- Side-tab ---
72
+ { id: 'side-tab', regex: /\bborder-[lrse]-(\d+)\b/g,
73
+ test: (m, line) => { const n = +m[1]; return hasRounded(line) ? n >= 2 : n >= 4; },
74
+ fmt: (m) => m[0] },
75
+ { id: 'side-tab', regex: /border-(?:left|right)\s*:\s*(\d+)px\s+solid[^;]*/gi,
76
+ test: (m, line) => { if (isSafeElement(line)) return false; if (isNeutralBorderColor(m[0])) return false; const n = +m[1]; return hasBorderRadius(line) ? n >= 2 : n >= 3; },
77
+ fmt: (m) => m[0].replace(/\s*;?\s*$/, '') },
78
+ { id: 'side-tab', regex: /border-(?:left|right)-width\s*:\s*(\d+)px/gi,
79
+ test: (m, line) => !isSafeElement(line) && +m[1] >= 3,
80
+ fmt: (m) => m[0] },
81
+ { id: 'side-tab', regex: /border-inline-(?:start|end)\s*:\s*(\d+)px\s+solid/gi,
82
+ test: (m, line) => !isSafeElement(line) && +m[1] >= 3,
83
+ fmt: (m) => m[0] },
84
+ { id: 'side-tab', regex: /border-inline-(?:start|end)-width\s*:\s*(\d+)px/gi,
85
+ test: (m, line) => !isSafeElement(line) && +m[1] >= 3,
86
+ fmt: (m) => m[0] },
87
+ { id: 'side-tab', regex: /border(?:Left|Right)\s*[:=]\s*["'`](\d+)px\s+solid/g,
88
+ test: (m) => +m[1] >= 3,
89
+ fmt: (m) => m[0] },
90
+ // --- Border accent on rounded ---
91
+ { id: 'border-accent-on-rounded', regex: /\bborder-[tb]-(\d+)\b/g,
92
+ test: (m, line) => hasRounded(line) && +m[1] >= 1,
93
+ fmt: (m) => m[0] },
94
+ { id: 'border-accent-on-rounded', regex: /border-(?:top|bottom)\s*:\s*(\d+)px\s+solid/gi,
95
+ test: (m, line) => +m[1] >= 3 && hasBorderRadius(line),
96
+ fmt: (m) => m[0] },
97
+ // --- Overused font ---
98
+ { id: 'overused-font', regex: /font-family\s*:\s*['"]?(Inter|Roboto|Open Sans|Lato|Montserrat|Arial|Helvetica|Fraunces|Geist Sans|Geist Mono|Geist|Mona Sans|Plus Jakarta Sans|Space Grotesk|Recoleta|Instrument Sans|Instrument Serif)\b/gi,
99
+ test: () => true,
100
+ fmt: (m) => m[0] },
101
+ { id: 'overused-font', regex: /fonts\.googleapis\.com\/css2?\?[^"'\s)<>]*/gi,
102
+ test: (m) => {
103
+ m.overusedGoogleFont = firstOverusedGoogleFont(m[0]);
104
+ return Boolean(m.overusedGoogleFont);
105
+ },
106
+ fmt: (m) => `Google Fonts: ${m.overusedGoogleFont || firstOverusedGoogleFont(m[0])}` },
107
+ // --- Gradient text ---
108
+ { id: 'gradient-text', regex: /background-clip\s*:\s*text|-webkit-background-clip\s*:\s*text/gi,
109
+ test: (m, line) => /gradient/i.test(line),
110
+ fmt: () => 'background-clip: text + gradient' },
111
+ // --- Gradient text (Tailwind) ---
112
+ { id: 'gradient-text', regex: /\bbg-clip-text\b/g,
113
+ test: (m, line) => /\bbg-gradient-to-/i.test(line),
114
+ fmt: () => 'bg-clip-text + bg-gradient' },
115
+ // --- Tailwind gray on colored bg ---
116
+ { id: 'gray-on-color', regex: /\btext-(?:gray|slate|zinc|neutral|stone)-(\d+)\b/g,
117
+ test: (m, line) => /\bbg-(?:red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-\d+\b/.test(line),
118
+ fmt: (m, line) => { const bg = line.match(/\bbg-(?:red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-\d+\b/); return `${m[0]} on ${bg?.[0] || '?'}`; } },
119
+ // --- Tailwind AI palette ---
120
+ { id: 'ai-color-palette', regex: /\btext-(?:purple|violet|indigo)-(\d+)\b/g,
121
+ test: (m, line) => /\btext-(?:[2-9]xl|[3-9]xl)\b|<h[1-3]/i.test(line),
122
+ fmt: (m) => `${m[0]} on heading` },
123
+ { id: 'ai-color-palette', regex: /\bfrom-(?:purple|violet|indigo)-(\d+)\b/g,
124
+ test: (m, line) => /\bto-(?:purple|violet|indigo|blue|cyan|pink|fuchsia)-\d+\b/.test(line),
125
+ fmt: (m) => `${m[0]} gradient` },
126
+ // --- Bounce/elastic easing ---
127
+ { id: 'bounce-easing', regex: /\banimate-bounce\b/g,
128
+ test: () => true,
129
+ fmt: () => 'animate-bounce (Tailwind)' },
130
+ { id: 'bounce-easing', regex: /animation(?:-name)?\s*:\s*([^;{}]*(?:bounce|elastic|wobble|jiggle|spring)[^;{}]*)/gi,
131
+ test: () => true,
132
+ fmt: (m) => {
133
+ const token = m[1]
134
+ .split(/[,\s]+/)
135
+ .find((part) => /bounce|elastic|wobble|jiggle|spring/i.test(part));
136
+ return `animation: ${token || m[1].trim()}`;
137
+ } },
138
+ { id: 'bounce-easing', regex: /cubic-bezier\(\s*([\d.-]+)\s*,\s*([\d.-]+)\s*,\s*([\d.-]+)\s*,\s*([\d.-]+)\s*\)/g,
139
+ test: (m) => {
140
+ const y1 = parseFloat(m[2]), y2 = parseFloat(m[4]);
141
+ return y1 < -0.1 || y1 > 1.1 || y2 < -0.1 || y2 > 1.1;
142
+ },
143
+ fmt: (m) => `cubic-bezier(${m[1]}, ${m[2]}, ${m[3]}, ${m[4]})` },
144
+ // --- Layout property transition ---
145
+ { id: 'layout-transition', regex: /transition\s*:\s*([^;{}]+)/gi,
146
+ test: (m) => {
147
+ const val = m[1].toLowerCase();
148
+ if (/\ball\b/.test(val)) return false;
149
+ return /\b(?:(?:max|min)-)?(?:width|height)\b|\bpadding\b|\bmargin\b/.test(val);
150
+ },
151
+ fmt: (m) => {
152
+ const found = m[1].match(/\b(?:(?:max|min)-)?(?:width|height)\b|\bpadding(?:-(?:top|right|bottom|left))?\b|\bmargin(?:-(?:top|right|bottom|left))?\b/gi);
153
+ return `transition: ${found ? found.join(', ') : m[1].trim()}`;
154
+ } },
155
+ { id: 'layout-transition', regex: /transition-property\s*:\s*([^;{}]+)/gi,
156
+ test: (m) => {
157
+ const val = m[1].toLowerCase();
158
+ if (/\ball\b/.test(val)) return false;
159
+ return /\b(?:(?:max|min)-)?(?:width|height)\b|\bpadding\b|\bmargin\b/.test(val);
160
+ },
161
+ fmt: (m) => {
162
+ const found = m[1].match(/\b(?:(?:max|min)-)?(?:width|height)\b|\bpadding(?:-(?:top|right|bottom|left))?\b|\bmargin(?:-(?:top|right|bottom|left))?\b/gi);
163
+ return `transition-property: ${found ? found.join(', ') : m[1].trim()}`;
164
+ } },
165
+ // --- Broken image: src="" or src="#" or src=" " ---
166
+ { id: 'broken-image', regex: /<img\b[^>]*?\bsrc\s*=\s*(?:""|''|"\s+"|'\s+'|"#"|'#')/gi,
167
+ test: () => true,
168
+ fmt: (m) => m[0].slice(0, 100) },
169
+ // --- Broken image: <img> with no src attribute at all ---
170
+ { id: 'broken-image', regex: /<img\b(?:(?!\bsrc\s*=)[^>])*>/gi,
171
+ test: (m) => !/\bsrc\s*=/i.test(m[0]),
172
+ fmt: (m) => m[0].slice(0, 100) },
173
+ // --- Image missing dimensions (CLS): <img> without width+height and
174
+ // without a CSS aspect-ratio or explicit height. Covers HTML (width="…")
175
+ // and JSX (width={…}) attribute forms. ---
176
+ { id: 'image-missing-dimensions', regex: /<img\b[^>]*>/gi,
177
+ test: (m) => {
178
+ const tag = m[0];
179
+ const hasHeight = /(?:^|[\s{;"'])height\s*[=:]/i.test(tag);
180
+ const hasAspect = /aspect-?ratio/i.test(tag);
181
+ return !hasHeight && !hasAspect;
182
+ },
183
+ fmt: (m) => m[0].slice(0, 100) },
184
+ ];
185
+
186
+ const REGEX_ANALYZERS = [
187
+ // Single font
188
+ (content, filePath) => {
189
+ const fontFamilyRe = /font-family\s*:\s*([^;}]+)/gi;
190
+ const fonts = new Set();
191
+ let m;
192
+ while ((m = fontFamilyRe.exec(content)) !== null) {
193
+ for (const f of m[1].split(',').map(f => f.trim().replace(/^['"]|['"]$/g, '').toLowerCase())) {
194
+ if (f && !GENERIC_FONTS.has(f)) fonts.add(f);
195
+ }
196
+ }
197
+ for (const f of extractGoogleFontFamilies(content)) fonts.add(f);
198
+ if (fonts.size !== 1 || content.split('\n').length < 20) return [];
199
+ const name = [...fonts][0];
200
+ const lines = content.split('\n');
201
+ let line = 1;
202
+ for (let i = 0; i < lines.length; i++) { if (lines[i].toLowerCase().includes(name)) { line = i + 1; break; } }
203
+ return [finding('single-font', filePath, `only font used is ${name}`, line)];
204
+ },
205
+ // Flat type hierarchy
206
+ (content, filePath) => {
207
+ const sizes = new Set();
208
+ const REM = 16;
209
+ let m;
210
+ const sizeRe = /font-size\s*:\s*([\d.]+)(px|rem|em)\b/gi;
211
+ while ((m = sizeRe.exec(content)) !== null) {
212
+ const px = m[2] === 'px' ? +m[1] : +m[1] * REM;
213
+ if (px > 0 && px < 200) sizes.add(Math.round(px * 10) / 10);
214
+ }
215
+ const clampRe = /font-size\s*:\s*clamp\(\s*([\d.]+)(px|rem|em)\s*,\s*[^,]+,\s*([\d.]+)(px|rem|em)\s*\)/gi;
216
+ while ((m = clampRe.exec(content)) !== null) {
217
+ sizes.add(Math.round((m[2] === 'px' ? +m[1] : +m[1] * REM) * 10) / 10);
218
+ sizes.add(Math.round((m[4] === 'px' ? +m[3] : +m[3] * REM) * 10) / 10);
219
+ }
220
+ const TW = { 'text-xs': 12, 'text-sm': 14, 'text-base': 16, 'text-lg': 18, 'text-xl': 20, 'text-2xl': 24, 'text-3xl': 30, 'text-4xl': 36, 'text-5xl': 48, 'text-6xl': 60, 'text-7xl': 72, 'text-8xl': 96, 'text-9xl': 128 };
221
+ for (const [cls, px] of Object.entries(TW)) { if (new RegExp(`\\b${cls}\\b`).test(content)) sizes.add(px); }
222
+ if (sizes.size < 3) return [];
223
+ const sorted = [...sizes].sort((a, b) => a - b);
224
+ const ratio = sorted[sorted.length - 1] / sorted[0];
225
+ if (ratio >= 2.0) return [];
226
+ const lines = content.split('\n');
227
+ let line = 1;
228
+ for (let i = 0; i < lines.length; i++) { if (/font-size/i.test(lines[i]) || /\btext-(?:xs|sm|base|lg|xl|\d)/i.test(lines[i])) { line = i + 1; break; } }
229
+ return [finding('flat-type-hierarchy', filePath, `Sizes: ${sorted.map(s => s + 'px').join(', ')} (ratio ${ratio.toFixed(1)}:1)`, line)];
230
+ },
231
+ // Monotonous spacing (regex)
232
+ (content, filePath) => {
233
+ const vals = [];
234
+ let m;
235
+ const pxRe = /(?:padding|margin)(?:-(?:top|right|bottom|left))?\s*:\s*(\d+)px/gi;
236
+ while ((m = pxRe.exec(content)) !== null) { const v = +m[1]; if (v > 0 && v < 200) vals.push(v); }
237
+ const remRe = /(?:padding|margin)(?:-(?:top|right|bottom|left))?\s*:\s*([\d.]+)rem/gi;
238
+ while ((m = remRe.exec(content)) !== null) { const v = Math.round(parseFloat(m[1]) * 16); if (v > 0 && v < 200) vals.push(v); }
239
+ const gapRe = /gap\s*:\s*(\d+)px/gi;
240
+ while ((m = gapRe.exec(content)) !== null) vals.push(+m[1]);
241
+ const twRe = /\b(?:p|px|py|pt|pb|pl|pr|m|mx|my|mt|mb|ml|mr|gap)-(\d+)\b/g;
242
+ while ((m = twRe.exec(content)) !== null) vals.push(+m[1] * 4);
243
+ const rounded = vals.map(v => Math.round(v / 4) * 4);
244
+ if (rounded.length < 10) return [];
245
+ const counts = {};
246
+ for (const v of rounded) counts[v] = (counts[v] || 0) + 1;
247
+ const maxCount = Math.max(...Object.values(counts));
248
+ const pct = maxCount / rounded.length;
249
+ const unique = [...new Set(rounded)].filter(v => v > 0);
250
+ if (pct <= 0.6 || unique.length > 3) return [];
251
+ const dominant = Object.entries(counts).sort((a, b) => b[1] - a[1])[0][0];
252
+ return [finding('monotonous-spacing', filePath, `~${dominant}px used ${maxCount}/${rounded.length} times (${Math.round(pct * 100)}%)`)];
253
+ },
254
+ // Em-dash overuse: 5+ em-dashes or "--" in body text content
255
+ // (occasional em-dash use in prose is fine; the pattern fires only
256
+ // when count crosses into AI-cadence territory).
257
+ (content, filePath) => {
258
+ const text = stripHtmlToText(content);
259
+ let count = 0;
260
+ const re = /[—]|--(?=\S)/g;
261
+ while (re.exec(text) !== null) count++;
262
+ if (count < 5) return [];
263
+ return [finding('em-dash-overuse', filePath, `${count} em-dashes in body text`)];
264
+ },
265
+ // Marketing buzzwords: SaaS phrase list
266
+ (content, filePath) => {
267
+ const text = stripHtmlToText(content);
268
+ const lower = text.toLowerCase();
269
+ const BUZZWORDS = [
270
+ 'streamline your', 'empower your', 'supercharge your',
271
+ 'unleash your', 'unleash the power', 'leverage the power',
272
+ 'built for the modern', 'trusted by leading', 'trusted by the world',
273
+ 'best-in-class', 'industry-leading', 'world-class', 'enterprise-grade',
274
+ 'next-generation', 'cutting-edge', 'transform your business',
275
+ 'revolutionize', 'game-changer', 'game changing',
276
+ 'mission-critical', 'best of breed', 'future-proof', 'future proof',
277
+ 'seamless experience', 'seamlessly integrate',
278
+ 'drive engagement', 'drive growth', 'drive results',
279
+ 'harness the power',
280
+ ];
281
+ let count = 0;
282
+ let firstSample = '';
283
+ for (const phrase of BUZZWORDS) {
284
+ let from = 0;
285
+ while (true) {
286
+ const idx = lower.indexOf(phrase, from);
287
+ if (idx === -1) break;
288
+ count++;
289
+ if (!firstSample) {
290
+ firstSample = text.slice(Math.max(0, idx - 12), Math.min(text.length, idx + phrase.length + 12)).trim();
291
+ }
292
+ from = idx + phrase.length;
293
+ }
294
+ }
295
+ if (count === 0) return [];
296
+ return [finding('marketing-buzzword', filePath, `${count} buzzword phrase${count === 1 ? '' : 's'}: "${firstSample}"`)];
297
+ },
298
+ // Numbered section markers (01 / 02 / 03 ...)
299
+ (content, filePath) => {
300
+ const text = stripHtmlToText(content);
301
+ const re = /\b(0[1-9]|1[0-2])\b/g;
302
+ const seen = new Set();
303
+ let m;
304
+ while ((m = re.exec(text)) !== null) seen.add(m[1]);
305
+ if (seen.size < 3) return [];
306
+ const sorted = [...seen].sort();
307
+ let sequential = 0;
308
+ for (let i = 1; i < sorted.length; i++) {
309
+ if (parseInt(sorted[i], 10) === parseInt(sorted[i - 1], 10) + 1) sequential++;
310
+ }
311
+ if (sequential < 2) return [];
312
+ return [finding('numbered-section-markers', filePath, `Sequence: ${sorted.slice(0, 6).join(', ')}`)];
313
+ },
314
+ // Aphoristic cadence: manufactured-contrast + short-rebuttal
315
+ (content, filePath) => {
316
+ const text = stripHtmlToText(content);
317
+ const NOT_A_RE = /\bNot an? [a-z][^.!?]{1,40}[.!]\s+[A-Z][^.!?]{1,60}[.!]/g;
318
+ const SHORT_REBUTTAL_RE = /\b[A-Z][^.!?]{4,80}[.!]\s+(No|Just)\s+[a-z][^.!?]{2,60}[.!]/g;
319
+ let count = 0;
320
+ let firstSample = '';
321
+ let m;
322
+ NOT_A_RE.lastIndex = 0;
323
+ while ((m = NOT_A_RE.exec(text)) !== null) {
324
+ count++;
325
+ if (!firstSample) firstSample = m[0].trim().slice(0, 80);
326
+ }
327
+ SHORT_REBUTTAL_RE.lastIndex = 0;
328
+ while ((m = SHORT_REBUTTAL_RE.exec(text)) !== null) {
329
+ count++;
330
+ if (!firstSample) firstSample = m[0].trim().slice(0, 80);
331
+ }
332
+ if (count < 3) return [];
333
+ return [finding('aphoristic-cadence', filePath, `${count} aphoristic constructions: "${firstSample}"`)];
334
+ },
335
+ // Dark glow (page-level: dark bg + colored box-shadow with blur)
336
+ (content, filePath) => {
337
+ // Check if page has a dark background
338
+ const darkBgRe = /background(?:-color)?\s*:\s*(?:#(?:0[0-9a-f]|1[0-9a-f]|2[0-3])[0-9a-f]{4}\b|#(?:0|1)[0-9a-f]{2}\b|rgb\(\s*(\d{1,2})\s*,\s*(\d{1,2})\s*,\s*(\d{1,2})\s*\))/gi;
339
+ const twDarkBg = /\bbg-(?:gray|slate|zinc|neutral|stone)-(?:9\d{2}|800)\b/;
340
+ const hasDarkBg = darkBgRe.test(content) || twDarkBg.test(content);
341
+ if (!hasDarkBg) return [];
342
+
343
+ // Check for colored box-shadow with blur > 4px
344
+ const shadowRe = /box-shadow\s*:\s*([^;{}]+)/gi;
345
+ let m;
346
+ while ((m = shadowRe.exec(content)) !== null) {
347
+ const val = m[1];
348
+ const colorMatch = val.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
349
+ if (!colorMatch) continue;
350
+ const [r, g, b] = [+colorMatch[1], +colorMatch[2], +colorMatch[3]];
351
+ if ((Math.max(r, g, b) - Math.min(r, g, b)) < 30) continue; // skip gray
352
+ // Check blur: look for pattern like "0 0 20px" (third number > 4)
353
+ const pxVals = [...val.matchAll(/(\d+)px|(?<![.\d])\b(0)\b(?![.\d])/g)].map(p => +(p[1] || p[2]));
354
+ if (pxVals.length >= 3 && pxVals[2] > 4) {
355
+ const lines = content.substring(0, m.index).split('\n');
356
+ return [finding('dark-glow', filePath, `Colored glow (rgb(${r},${g},${b})) on dark page`, lines.length)];
357
+ }
358
+ }
359
+ return [];
360
+ },
361
+ ];
362
+
363
+ // ---------------------------------------------------------------------------
364
+ // Style block extraction (Vue/Svelte <style> blocks)
365
+ // ---------------------------------------------------------------------------
366
+
367
+ function extractStyleBlocks(content, ext) {
368
+ ext = ext.toLowerCase();
369
+ if (ext !== '.vue' && ext !== '.svelte') return [];
370
+ const blocks = [];
371
+ const re = /<style[^>]*>([\s\S]*?)<\/style>/gi;
372
+ let m;
373
+ while ((m = re.exec(content)) !== null) {
374
+ const before = content.substring(0, m.index);
375
+ const startLine = before.split('\n').length + 1;
376
+ blocks.push({ content: m[1], startLine });
377
+ }
378
+ return blocks;
379
+ }
380
+
381
+ // ---------------------------------------------------------------------------
382
+ // CSS-in-JS extraction (styled-components, emotion)
383
+ // ---------------------------------------------------------------------------
384
+
385
+ const CSS_IN_JS_EXTENSIONS = new Set(['.js', '.ts', '.jsx', '.tsx']);
386
+
387
+ function extractCSSinJS(content, ext) {
388
+ ext = ext.toLowerCase();
389
+ if (!CSS_IN_JS_EXTENSIONS.has(ext)) return [];
390
+ const blocks = [];
391
+ const re = /(?:styled(?:\.\w+|\([^)]+\))|css)\s*`([\s\S]*?)`/g;
392
+ let m;
393
+ while ((m = re.exec(content)) !== null) {
394
+ const before = content.substring(0, m.index);
395
+ const startLine = before.split('\n').length;
396
+ blocks.push({ content: m[1], startLine });
397
+ }
398
+ return blocks;
399
+ }
400
+
401
+ function runRegexMatchers(lines, filePath, lineOffset = 0, blockContext = null, options = {}) {
402
+ const { profile, phase = 'regex-matchers' } = options || {};
403
+ const findings = [];
404
+ if (!profile) {
405
+ for (const matcher of REGEX_MATCHERS) {
406
+ for (let i = 0; i < lines.length; i++) {
407
+ const line = lines[i];
408
+ matcher.regex.lastIndex = 0;
409
+ let m;
410
+ while ((m = matcher.regex.exec(line)) !== null) {
411
+ // For extracted blocks, use nearby lines as context for multi-line CSS patterns
412
+ const context = blockContext
413
+ ? lines.slice(Math.max(0, i - 3), Math.min(lines.length, i + 4)).join(' ')
414
+ : line;
415
+ if (matcher.test(m, context)) {
416
+ findings.push(finding(matcher.id, filePath, matcher.fmt(m, context), i + 1 + lineOffset));
417
+ }
418
+ }
419
+ }
420
+ }
421
+ return findings;
422
+ }
423
+
424
+ for (const matcher of REGEX_MATCHERS) {
425
+ const matcherFindings = profileFindings(profile, {
426
+ engine: 'regex',
427
+ phase,
428
+ ruleId: matcher.id,
429
+ target: filePath,
430
+ }, () => {
431
+ const matches = [];
432
+ for (let i = 0; i < lines.length; i++) {
433
+ const line = lines[i];
434
+ matcher.regex.lastIndex = 0;
435
+ let m;
436
+ while ((m = matcher.regex.exec(line)) !== null) {
437
+ // For extracted blocks, use nearby lines as context for multi-line CSS patterns
438
+ const context = blockContext
439
+ ? lines.slice(Math.max(0, i - 3), Math.min(lines.length, i + 4)).join(' ')
440
+ : line;
441
+ if (matcher.test(m, context)) {
442
+ matches.push(finding(matcher.id, filePath, matcher.fmt(m, context), i + 1 + lineOffset));
443
+ }
444
+ }
445
+ }
446
+ return matches;
447
+ });
448
+ findings.push(...matcherFindings);
449
+ }
450
+ return findings;
451
+ }
452
+
453
+ /** Page-level analyzers that scan rendered text content (em-dash use,
454
+ * buzzword phrases, numbered section markers, aphoristic cadence).
455
+ * These are detector-agnostic — they work on any HTML/text source
456
+ * and don't need a parsed DOM. Exported so detectHtml can call them
457
+ * for `.html` files (which otherwise skip the regex engine). */
458
+ const TEXT_CONTENT_ANALYZER_IDS = [
459
+ 'em-dash-overuse',
460
+ 'marketing-buzzword',
461
+ 'numbered-section-markers',
462
+ 'aphoristic-cadence',
463
+ ];
464
+
465
+ function runTextContentAnalyzers(content, filePath, options = {}) {
466
+ const profile = options?.profile;
467
+ if (!shouldRunPageAnalyzers(content, filePath)) return [];
468
+ // The 4 text-content analyzers are at indices 3-6 in REGEX_ANALYZERS.
469
+ const findings = [];
470
+ for (let i = 0; i < TEXT_CONTENT_ANALYZER_IDS.length; i++) {
471
+ const analyzer = REGEX_ANALYZERS[3 + i];
472
+ const ruleId = TEXT_CONTENT_ANALYZER_IDS[i];
473
+ findings.push(...profileFindings(profile, {
474
+ engine: 'regex',
475
+ phase: 'text-content',
476
+ ruleId,
477
+ target: filePath,
478
+ }, () => analyzer(content, filePath)));
479
+ }
480
+ return findings;
481
+ }
482
+
483
+ // Extract raw CSS text from a source file for the stylesheet-level analyzers
484
+ // (focus-visible, hover-only, dark-scheme). CSS-like files are CSS wholesale;
485
+ // everything else contributes only its <style> block contents so tag markup
486
+ // and inline styles don't confuse the flat CSS parser.
487
+ const CSS_LIKE_EXTS = new Set(['.css', '.scss', '.sass', '.less']);
488
+ function extractStylesheetText(content, ext) {
489
+ if (CSS_LIKE_EXTS.has(ext)) return content;
490
+ const blocks = [];
491
+ const re = /<style[^>]*>([\s\S]*?)<\/style>/gi;
492
+ let m;
493
+ while ((m = re.exec(content)) !== null) blocks.push(m[1]);
494
+ return blocks.join('\n');
495
+ }
496
+
497
+ const STYLESHEET_ANALYZERS = [
498
+ { id: 'missing-focus-visible', run: checkFocusVisible },
499
+ { id: 'hover-only-affordance', run: checkHoverOnlyAffordance },
500
+ { id: 'dark-scheme-contrast-blindspot', run: checkDarkSchemeContrast },
501
+ ];
502
+
503
+ // Run the stylesheet-level analyzers over a source file's CSS. Applies to
504
+ // CSS-like sources and to full HTML pages (which carry <style> blocks).
505
+ function runStylesheetAnalyzers(content, filePath, options = {}) {
506
+ const profile = options?.profile;
507
+ const ext = extFromFilePath(filePath);
508
+ const isCssLike = CSS_LIKE_EXTS.has(ext);
509
+ if (!isCssLike && !isFullPage(content)) return [];
510
+ const cssText = extractStylesheetText(content, ext);
511
+ if (!cssText.trim()) return [];
512
+ const findings = [];
513
+ for (const analyzer of STYLESHEET_ANALYZERS) {
514
+ const hits = profileFindings(profile, {
515
+ engine: 'regex',
516
+ phase: 'stylesheet',
517
+ ruleId: analyzer.id,
518
+ target: filePath,
519
+ }, () => analyzer.run(cssText));
520
+ for (const h of hits) findings.push(finding(h.id, filePath, h.snippet));
521
+ }
522
+ return findings;
523
+ }
524
+
525
+ function detectText(content, filePath, options = {}) {
526
+ const profile = options?.profile;
527
+ const findings = [];
528
+ const lines = content.split('\n');
529
+ const ext = extFromFilePath(filePath);
530
+
531
+ // Run regex matchers on the full file content (catches Tailwind classes, inline styles)
532
+ // Enable block context for CSS files where related properties span multiple lines
533
+ const cssLike = new Set(['.css', '.scss', '.sass', '.less']);
534
+ findings.push(...runRegexMatchers(lines, filePath, 0, cssLike.has(ext) || null, {
535
+ profile,
536
+ phase: 'source',
537
+ }));
538
+
539
+ // Extract and scan <style> blocks from Vue/Svelte SFCs
540
+ const styleBlocks = profile
541
+ ? profileStep(profile, {
542
+ engine: 'regex',
543
+ phase: 'extract',
544
+ ruleId: 'style-blocks',
545
+ target: filePath,
546
+ }, () => extractStyleBlocks(content, ext))
547
+ : extractStyleBlocks(content, ext);
548
+ for (const block of styleBlocks) {
549
+ const blockLines = block.content.split('\n');
550
+ findings.push(...runRegexMatchers(blockLines, filePath, block.startLine - 1, true, {
551
+ profile,
552
+ phase: 'style-block',
553
+ }));
554
+ }
555
+
556
+ // Extract and scan CSS-in-JS template literals
557
+ const cssJsBlocks = profile
558
+ ? profileStep(profile, {
559
+ engine: 'regex',
560
+ phase: 'extract',
561
+ ruleId: 'css-in-js',
562
+ target: filePath,
563
+ }, () => extractCSSinJS(content, ext))
564
+ : extractCSSinJS(content, ext);
565
+ for (const block of cssJsBlocks) {
566
+ const blockLines = block.content.split('\n');
567
+ findings.push(...runRegexMatchers(blockLines, filePath, block.startLine - 1, true, {
568
+ profile,
569
+ phase: 'css-in-js',
570
+ }));
571
+ }
572
+
573
+ if (options?.designSystem) {
574
+ findings.push(...profileFindings(profile, {
575
+ engine: 'regex',
576
+ phase: 'source',
577
+ ruleId: 'design-system',
578
+ target: filePath,
579
+ }, () => checkSourceDesignSystem(content, filePath, { designSystem: options.designSystem })));
580
+ }
581
+
582
+ // Deduplicate findings (same antipattern + similar snippet, within 2 lines)
583
+ const deduped = [];
584
+ for (const f of findings) {
585
+ const isDupe = deduped.some(d =>
586
+ d.antipattern === f.antipattern &&
587
+ d.snippet === f.snippet &&
588
+ Math.abs(d.line - f.line) <= 2
589
+ );
590
+ if (!isDupe) deduped.push(f);
591
+ }
592
+
593
+ // Page-level analyzers only run on full pages
594
+ if (shouldRunPageAnalyzers(content, filePath)) {
595
+ const analyzerIds = [
596
+ 'single-font',
597
+ 'flat-type-hierarchy',
598
+ 'monotonous-spacing',
599
+ 'em-dash-overuse',
600
+ 'marketing-buzzword',
601
+ 'numbered-section-markers',
602
+ 'aphoristic-cadence',
603
+ 'dark-glow',
604
+ ];
605
+ for (let i = 0; i < REGEX_ANALYZERS.length; i++) {
606
+ const analyzer = REGEX_ANALYZERS[i];
607
+ deduped.push(...profileFindings(profile, {
608
+ engine: 'regex',
609
+ phase: 'page-analyzer',
610
+ ruleId: analyzerIds[i] || `analyzer-${i + 1}`,
611
+ target: filePath,
612
+ }, () => analyzer(content, filePath)));
613
+ }
614
+ }
615
+
616
+ // Stylesheet-level accessibility analyzers (focus-visible, hover-only,
617
+ // dark-scheme). Run on CSS-like sources and full HTML pages.
618
+ deduped.push(...runStylesheetAnalyzers(content, filePath, options));
619
+
620
+ const byProvider = filterByProviders(deduped, options?.providers);
621
+ // Inline `monodesign-disable*` waivers travel with the file; honor them unless
622
+ // explicitly bypassed (`--no-config` / `--no-inline-ignores`).
623
+ return options?.inlineIgnores === false ? byProvider : applyInlineIgnores(byProvider, content);
624
+ }
625
+
626
+ export {
627
+ REGEX_MATCHERS,
628
+ REGEX_ANALYZERS,
629
+ TEXT_CONTENT_ANALYZER_IDS,
630
+ extractStyleBlocks,
631
+ extractCSSinJS,
632
+ runRegexMatchers,
633
+ runTextContentAnalyzers,
634
+ runStylesheetAnalyzers,
635
+ detectText,
636
+ };