monomind 2.5.0 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/packages/@monomind/cli/.claude/agents/design/design-monodesign.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/_repeat.md +4 -4
- package/packages/@monomind/cli/.claude/commands/mastermind/approvev1.md +4 -4
- package/packages/@monomind/cli/.claude/commands/mastermind/architect.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/autodev.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/brain.md +2 -2
- package/packages/@monomind/cli/.claude/commands/mastermind/build.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/code-review.md +2 -2
- package/packages/@monomind/cli/.claude/commands/mastermind/content.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/createorg.md +4 -4
- package/packages/@monomind/cli/.claude/commands/mastermind/createtask.md +3 -3
- package/packages/@monomind/cli/.claude/commands/mastermind/debug.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/design.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/do.md +2 -2
- package/packages/@monomind/cli/.claude/commands/mastermind/execute.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/finance.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/finish.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/idea.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/ideate.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/improve.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/marketing.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/master.md +54 -54
- package/packages/@monomind/cli/.claude/commands/mastermind/ops.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/orgs.md +2 -2
- package/packages/@monomind/cli/.claude/commands/mastermind/orgstatus.md +2 -2
- package/packages/@monomind/cli/.claude/commands/mastermind/plan.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/receive-review.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/release.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/research.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/review.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/runorg.md +4 -4
- package/packages/@monomind/cli/.claude/commands/mastermind/runorgv1.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/sales.md +6 -6
- package/packages/@monomind/cli/.claude/commands/mastermind/skill-builder.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/stoporg.md +3 -3
- package/packages/@monomind/cli/.claude/commands/mastermind/taskdev.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/tdd.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/techport.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/verify.md +5 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/worktree.md +5 -5
- package/packages/@monomind/cli/.claude/helpers/control-start.cjs +30 -0
- package/packages/@monomind/cli/.claude/helpers/utils/monograph.cjs +44 -12
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/access.md → mastermind-access/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/activity.md → mastermind-activity/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/adapter-manager.md → mastermind-adapter-manager/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/adapters.md → mastermind-adapters/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/agent-detail.md → mastermind-agent-detail/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/agents.md → mastermind-agents/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/approval-detail.md → mastermind-approval-detail/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/approvev1.md → mastermind-approvev1/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/architect.md → mastermind-architect/SKILL.md} +7 -7
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/autodev.md → mastermind-autodev/SKILL.md} +10 -10
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/backup.md → mastermind-backup/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/bootstrap.md → mastermind-bootstrap/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/budgets.md → mastermind-budgets/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/build.md → mastermind-build/SKILL.md} +5 -5
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/companies.md → mastermind-companies/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/content.md → mastermind-content/SKILL.md} +5 -5
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/costs.md → mastermind-costs/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/createorg.md → mastermind-createorg/SKILL.md} +3 -3
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/debug.md → mastermind-debug/SKILL.md} +4 -4
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/_delegation.md → mastermind-delegation/SKILL.md} +1 -1
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/design.md → mastermind-design/SKILL.md} +9 -9
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/diagnose.md → mastermind-diagnose/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/env.md → mastermind-env/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/environments.md → mastermind-environments/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/execute.md → mastermind-execute/SKILL.md} +10 -10
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/export.md → mastermind-export/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/finance.md → mastermind-finance/SKILL.md} +5 -5
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/goal-detail.md → mastermind-goal-detail/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/goals.md → mastermind-goals/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/heartbeatv1.md → mastermind-heartbeatv1/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/idea.md → mastermind-idea/SKILL.md} +7 -7
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/import.md → mastermind-import/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/inbox.md → mastermind-inbox/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/instance.md → mastermind-instance/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/instance-settings.md → mastermind-instance-settings/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/invite-landing.md → mastermind-invite-landing/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/invites.md → mastermind-invites/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/issue-detail.md → mastermind-issue-detail/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/issues.md → mastermind-issues/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/join-queue.md → mastermind-join-queue/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/liveness.md → mastermind-liveness/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/marketing.md → mastermind-marketing/SKILL.md} +8 -8
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/memory.md → mastermind-memory/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/monitor.md → mastermind-monitor/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/my-issues.md → mastermind-my-issues/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/new-agent.md → mastermind-new-agent/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/ops.md → mastermind-ops/SKILL.md} +5 -5
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/org-chart.md → mastermind-org-chart/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/org-settings.md → mastermind-org-settings/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/orgs.md → mastermind-orgs/SKILL.md} +1 -1
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/orgstatus.md → mastermind-orgstatus/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/plan.md → mastermind-plan/SKILL.md} +7 -7
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/plan-to-tasks.md → mastermind-plan-to-tasks/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/plugin-manager.md → mastermind-plugin-manager/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/plugin-settings.md → mastermind-plugin-settings/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/plugins.md → mastermind-plugins/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/profile.md → mastermind-profile/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/project-detail.md → mastermind-project-detail/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/project-workspace.md → mastermind-project-workspace/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/projects.md → mastermind-projects/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/_protocol.md → mastermind-protocol/SKILL.md} +3 -3
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/release.md → mastermind-release/SKILL.md} +5 -5
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/_repeat.md → mastermind-repeat/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/research.md → mastermind-research/SKILL.md} +5 -5
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/review.md → mastermind-review/SKILL.md} +5 -5
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/routine-detail.md → mastermind-routine-detail/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/routines.md → mastermind-routines/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/runorgv1.md → mastermind-runorgv1/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/sales.md → mastermind-sales/SKILL.md} +5 -5
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/search.md → mastermind-search/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/secrets.md → mastermind-secrets/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/skill-builder.md → mastermind-skill-builder/SKILL.md} +16 -14
- package/packages/@monomind/cli/.claude/skills/mastermind-skills/{skills.md → SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/stoporg.md → mastermind-stoporg/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/taskdev.md → mastermind-taskdev/SKILL.md} +6 -6
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills → mastermind-taskdev}/implementer-prompt.md +1 -1
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/tasks.md → mastermind-tasks/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/tdd.md → mastermind-tdd/SKILL.md} +4 -4
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/techport.md → mastermind-techport/SKILL.md} +5 -5
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/threads.md → mastermind-threads/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/tree-control.md → mastermind-tree-control/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/verify.md → mastermind-verify/SKILL.md} +1 -1
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/wiki.md → mastermind-wiki/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/workspace-detail.md → mastermind-workspace-detail/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/{mastermind-skills/workspaces.md → mastermind-workspaces/SKILL.md} +2 -2
- package/packages/@monomind/cli/.claude/skills/monodesign/SKILL.md +114 -190
- package/packages/@monomind/cli/.claude/skills/monodesign/adapt.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/agents/monodesign-asset-producer.md +4 -4
- package/packages/@monomind/cli/.claude/skills/monodesign/agents/monodesign-manual-edit-applier.md +103 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/audit.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/craft.md +2 -2
- package/packages/@monomind/cli/.claude/skills/monodesign/critique.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/init.md +30 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/layout.md +36 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/live.md +19 -44
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/adapt.md +122 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/adapt.native.md +58 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/android.md +40 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/animate.md +39 -11
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/antipatterns-catalog.md +22 -16
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/audit.md +5 -3
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/audit.native.md +139 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/bolder.md +71 -64
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/brand.md +12 -18
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/clarify.md +114 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/codex.md +4 -6
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/colorize.md +108 -5
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/craft.md +70 -143
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/critique.md +635 -68
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/delight.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/distill.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/document.md +24 -22
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/extract.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/hooks.md +22 -29
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/init.md +221 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/interaction-design.md +0 -6
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/ios.md +45 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/layout.md +57 -13
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/live.md +159 -63
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/overdrive.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/personas.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/polish.md +16 -8
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/pre-delivery-checklist.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/product.md +1 -3
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/quieter.md +1 -1
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/shape.md +27 -13
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/teach.md +6 -152
- package/packages/@monomind/cli/.claude/skills/monodesign/reference/typeset.md +180 -3
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/command-metadata.json +94 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/context-signals.mjs +227 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/context.mjs +1062 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/critique-storage.mjs +243 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detect-csp.mjs +199 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detect.mjs +34 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/browser/injected/index.mjs +1938 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/cli/main.mjs +322 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/design-system.mjs +815 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +5246 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/detect-antipatterns.mjs +51 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/engines/browser/detect-url.mjs +260 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +259 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/engines/regex/detect-text.mjs +574 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/engines/static-html/css-cascade.mjs +1016 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/engines/static-html/detect-html.mjs +235 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/engines/visual/screenshot-contrast.mjs +199 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/findings.mjs +13 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/node/file-system.mjs +199 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/profile/profiler.mjs +167 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/registry/antipatterns.mjs +515 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +2704 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/shared/color.mjs +125 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/shared/constants.mjs +102 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/shared/fonts.mjs +31 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/shared/inline-ignores.mjs +149 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/shared/page.mjs +8 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/hook-admin.mjs +662 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/hook-before-edit.mjs +517 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/hook-lib.mjs +1777 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/hook.mjs +62 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/lib/design-parser.mjs +843 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/lib/is-generated.mjs +70 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/lib/monodesign-config.mjs +641 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/lib/monodesign-paths.mjs +130 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/lib/provider.mjs +5 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/lib/target-args.mjs +43 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/browser-script-parts.mjs +51 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/completion.mjs +20 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/event-validation.mjs +138 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/insert-ui.mjs +459 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/manual-apply.mjs +940 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/manual-edit-routes.mjs +358 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/manual-edits-buffer.mjs +153 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/session-store.mjs +290 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/svelte-component.mjs +827 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +275 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/ui-core.mjs +181 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live/vocabulary.mjs +37 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-accept.mjs +813 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-browser-dom.js +147 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-browser-session.js +124 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-browser.js +11241 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-commit-manual-edits.mjs +1242 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-complete.mjs +76 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-copy-edit-agent.mjs +684 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-discard-manual-edits.mjs +52 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-inject.mjs +584 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-insert.mjs +273 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-manual-edit-evidence.mjs +364 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-poll.mjs +385 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-resume.mjs +95 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-server.mjs +1138 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-status.mjs +62 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-target.mjs +31 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live-wrap.mjs +895 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/live.mjs +298 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/modern-screenshot.umd.js +15 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/palette.mjs +634 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/scripts/pin.mjs +222 -0
- package/packages/@monomind/cli/.claude/skills/monodesign/teach.md +7 -58
- package/packages/@monomind/cli/dist/src/commands/design-detect.d.ts +7 -1
- package/packages/@monomind/cli/dist/src/commands/design-detect.js +70 -38
- package/packages/@monomind/cli/dist/src/commands/design-palette.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/commands/design-palette.js +3 -3
- package/packages/@monomind/cli/dist/src/commands/doc.js +72 -15
- package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.d.ts +4 -0
- package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.js +23 -0
- package/packages/@monomind/cli/dist/src/commands/doctor.js +3 -3
- package/packages/@monomind/cli/dist/src/commands/org.js +109 -9
- package/packages/@monomind/cli/dist/src/init/executor.js +14 -3
- package/packages/@monomind/cli/dist/src/knowledge/document-pipeline.d.ts +2 -0
- package/packages/@monomind/cli/dist/src/knowledge/document-pipeline.js +1 -0
- package/packages/@monomind/cli/dist/src/mcp-tools/knowledge-tools.js +38 -7
- package/packages/@monomind/cli/dist/src/mcp-tools/memory-tools.d.ts +8 -3
- package/packages/@monomind/cli/dist/src/mcp-tools/memory-tools.js +193 -31
- package/packages/@monomind/cli/dist/src/memory/memory-bridge.d.ts +33 -0
- package/packages/@monomind/cli/dist/src/memory/memory-bridge.js +169 -18
- package/packages/@monomind/cli/dist/src/memory/memory-kg.d.ts +185 -0
- package/packages/@monomind/cli/dist/src/memory/memory-kg.js +449 -0
- package/packages/@monomind/cli/dist/src/memory/query-router.d.ts +44 -0
- package/packages/@monomind/cli/dist/src/memory/query-router.js +113 -0
- package/packages/@monomind/cli/dist/src/orgrt/daemon.d.ts +18 -0
- package/packages/@monomind/cli/dist/src/orgrt/daemon.js +249 -12
- package/packages/@monomind/cli/dist/src/orgrt/migrate.js +7 -0
- package/packages/@monomind/cli/dist/src/orgrt/policy.js +7 -0
- package/packages/@monomind/cli/dist/src/orgrt/session.d.ts +24 -1
- package/packages/@monomind/cli/dist/src/orgrt/session.js +18 -3
- package/packages/@monomind/cli/dist/src/orgrt/templates.d.ts +1 -0
- package/packages/@monomind/cli/dist/src/orgrt/templates.js +9 -4
- package/packages/@monomind/cli/dist/src/orgrt/types.d.ts +15 -0
- package/packages/@monomind/cli/dist/src/orgrt/types.js +2 -0
- package/packages/@monomind/cli/dist/src/ui/dashboard.html +154 -6
- package/packages/@monomind/cli/dist/src/ui/orgs.html +24 -0
- package/packages/@monomind/cli/dist/src/ui/server.mjs +211 -13
- package/packages/@monomind/cli/package.json +6 -4
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills/_agent-select.md → mastermind-agent-select/SKILL.md} +0 -0
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills/finish.md → mastermind-finish/SKILL.md} +0 -0
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills/_intake.md → mastermind-intake/SKILL.md} +0 -0
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills → mastermind-marketing}/references/copywriting-frameworks.md +0 -0
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills → mastermind-marketing}/references/persuasion-psychology.md +0 -0
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills/monotask.md → mastermind-monotask/SKILL.md} +0 -0
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills/receive-review.md → mastermind-receive-review/SKILL.md} +0 -0
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills/runorg.md → mastermind-runorg/SKILL.md} +0 -0
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills → mastermind-taskdev}/code-quality-reviewer-prompt.md +0 -0
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills → mastermind-taskdev}/final-reviewer-prompt.md +0 -0
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills → mastermind-taskdev}/spec-reviewer-prompt.md +0 -0
- /package/packages/@monomind/cli/.claude/skills/{mastermind-skills/worktree.md → mastermind-worktree/SKILL.md} +0 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
// Pattern adapted from impeccable (Apache-2.0) — rebranded for monomind
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
import { GENERIC_FONTS, OVERUSED_FONTS } from '../../shared/constants.mjs';
|
|
6
|
+
import {
|
|
7
|
+
checkSourceDesignSystem,
|
|
8
|
+
collectStaticDesignSystemFindings,
|
|
9
|
+
mergeDesignSystemFindings,
|
|
10
|
+
} from '../../design-system.mjs';
|
|
11
|
+
import { isFullPage } from '../../shared/page.mjs';
|
|
12
|
+
import { applyInlineIgnores } from '../../shared/inline-ignores.mjs';
|
|
13
|
+
import { finding } from '../../findings.mjs';
|
|
14
|
+
import { profileFindings, profileStep, profileStepAsync } from '../../profile/profiler.mjs';
|
|
15
|
+
import {
|
|
16
|
+
checkElementBorders,
|
|
17
|
+
checkElementClippedOverflow,
|
|
18
|
+
checkElementColors,
|
|
19
|
+
checkElementGlow,
|
|
20
|
+
checkElementGptBorderShadow,
|
|
21
|
+
checkElementHeroEyebrow,
|
|
22
|
+
checkElementIconTile,
|
|
23
|
+
checkElementItalicSerif,
|
|
24
|
+
checkElementMotion,
|
|
25
|
+
checkElementOversizedH1,
|
|
26
|
+
checkElementQuality,
|
|
27
|
+
checkCreamPalette,
|
|
28
|
+
checkHtmlPatterns,
|
|
29
|
+
checkPageLayout,
|
|
30
|
+
checkPageQualityFromDoc,
|
|
31
|
+
checkRepeatedSectionKickersFromDoc,
|
|
32
|
+
resolveBackground,
|
|
33
|
+
resolveBorderRadiusPx,
|
|
34
|
+
} from '../../rules/checks.mjs';
|
|
35
|
+
import { filterByProviders } from '../../registry/antipatterns.mjs';
|
|
36
|
+
import { detectText, runTextContentAnalyzers } from '../regex/detect-text.mjs';
|
|
37
|
+
import {
|
|
38
|
+
StaticDocument,
|
|
39
|
+
buildStaticStyleMap,
|
|
40
|
+
buildStaticWindow,
|
|
41
|
+
collectStaticCssText,
|
|
42
|
+
} from './css-cascade.mjs';
|
|
43
|
+
|
|
44
|
+
function checkStaticPageTypography(document, window) {
|
|
45
|
+
const findings = [];
|
|
46
|
+
const fonts = new Set();
|
|
47
|
+
const overusedFound = new Set();
|
|
48
|
+
for (const el of document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, td, th, dd, blockquote, figcaption, a, button, label, span, div')) {
|
|
49
|
+
const hasText = el.childNodes.some(n => n.nodeType === 3 && n.textContent.trim().length > 0);
|
|
50
|
+
if (!hasText) continue;
|
|
51
|
+
const ff = window.getComputedStyle(el).fontFamily || '';
|
|
52
|
+
const stack = ff.split(',').map(f => f.trim().replace(/^['"]|['"]$/g, '').toLowerCase());
|
|
53
|
+
const primary = stack.find(f => f && !GENERIC_FONTS.has(f));
|
|
54
|
+
if (!primary) continue;
|
|
55
|
+
fonts.add(primary);
|
|
56
|
+
if (OVERUSED_FONTS.has(primary)) overusedFound.add(primary);
|
|
57
|
+
}
|
|
58
|
+
for (const font of overusedFound) {
|
|
59
|
+
findings.push({ id: 'overused-font', snippet: `Primary font: ${font}` });
|
|
60
|
+
}
|
|
61
|
+
if (fonts.size === 1 && document.querySelectorAll('*').length >= 20) {
|
|
62
|
+
findings.push({ id: 'single-font', snippet: `only font used is ${[...fonts][0]}` });
|
|
63
|
+
}
|
|
64
|
+
const sizes = new Set();
|
|
65
|
+
for (const el of document.querySelectorAll('h1, h2, h3, h4, h5, h6, p, span, a, li, td, th, label, button, div')) {
|
|
66
|
+
const fontSize = parseFloat(window.getComputedStyle(el).fontSize);
|
|
67
|
+
if (fontSize >= 8 && fontSize < 200) sizes.add(Math.round(fontSize * 10) / 10);
|
|
68
|
+
}
|
|
69
|
+
if (sizes.size >= 3) {
|
|
70
|
+
const sorted = [...sizes].sort((a, b) => a - b);
|
|
71
|
+
const ratio = sorted[sorted.length - 1] / sorted[0];
|
|
72
|
+
if (ratio < 2.0) {
|
|
73
|
+
findings.push({ id: 'flat-type-hierarchy', snippet: `Sizes: ${sorted.map(s => s + 'px').join(', ')} (ratio ${ratio.toFixed(1)}:1)` });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return findings;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function checkElementBrokenImage(el) {
|
|
80
|
+
const src = (el.getAttribute && el.getAttribute('src')) ?? el.attribs?.src;
|
|
81
|
+
// Missing src attribute entirely
|
|
82
|
+
if (src === undefined || src === null) {
|
|
83
|
+
return [{ id: 'broken-image', snippet: '<img> with no src attribute' }];
|
|
84
|
+
}
|
|
85
|
+
const trimmed = String(src).trim();
|
|
86
|
+
// Empty or placeholder-only src values
|
|
87
|
+
if (trimmed === '' || trimmed === '#') {
|
|
88
|
+
return [{ id: 'broken-image', snippet: `<img src="${src}">` }];
|
|
89
|
+
}
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const STATIC_ELEMENT_RULES = [
|
|
94
|
+
{ id: 'border-rules', selector: '*', run: (el, tag, style, window, customPropMap) => checkElementBorders(tag, style, null, resolveBorderRadiusPx(el, style, parseFloat(style.width) || 0, window)) },
|
|
95
|
+
{ id: 'color-rules', selector: '*', run: (el, tag, style, window, customPropMap) => checkElementColors(el, style, tag, window, customPropMap, false) },
|
|
96
|
+
{ id: 'dark-glow', selector: '*', run: (el, tag, style, window, customPropMap) => checkElementGlow(tag, style, resolveBackground(el.parentElement || el, window, customPropMap)) },
|
|
97
|
+
{ id: 'motion-rules', selector: '*', run: (el, tag, style) => checkElementMotion(tag, style) },
|
|
98
|
+
{ id: 'icon-tile-stack', selector: 'h1,h2,h3,h4,h5,h6', run: (el, tag, _style, window) => checkElementIconTile(el, tag, window) },
|
|
99
|
+
{ id: 'italic-serif-display', selector: 'h1,h2', run: (el, tag, style) => checkElementItalicSerif(el, style, tag) },
|
|
100
|
+
{ id: 'hero-eyebrow-chip', selector: 'h1', run: (el, tag, style, window, customPropMap) => checkElementHeroEyebrow(el, style, tag, window, customPropMap) },
|
|
101
|
+
{ id: 'broken-image', selector: 'img', run: (el) => checkElementBrokenImage(el) },
|
|
102
|
+
{ id: 'quality-rules', selector: '*', run: (el, tag, style, window) => checkElementQuality(el, style, tag, window) },
|
|
103
|
+
{ id: 'oversized-h1', selector: 'h1', run: (el, tag, style, window) => checkElementOversizedH1(el, style, tag, window) },
|
|
104
|
+
{ id: 'clipped-overflow-container', selector: '*', run: (el, tag, style, window) => checkElementClippedOverflow(el, style, tag, window) },
|
|
105
|
+
{ id: 'gpt-thin-border-wide-shadow', selector: '*', run: (el, tag, style) => checkElementGptBorderShadow(el, style) },
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
async function detectHtml(filePath, options = {}) {
|
|
109
|
+
const profile = options?.profile;
|
|
110
|
+
const html = profileStep(profile, {
|
|
111
|
+
engine: 'static-html',
|
|
112
|
+
phase: 'setup',
|
|
113
|
+
ruleId: 'read-html',
|
|
114
|
+
target: filePath,
|
|
115
|
+
}, () => fs.readFileSync(filePath, 'utf-8'));
|
|
116
|
+
|
|
117
|
+
let modules;
|
|
118
|
+
try {
|
|
119
|
+
modules = await profileStepAsync(profile, {
|
|
120
|
+
engine: 'static-html',
|
|
121
|
+
phase: 'setup',
|
|
122
|
+
ruleId: 'import-static-parser',
|
|
123
|
+
target: filePath,
|
|
124
|
+
}, async () => {
|
|
125
|
+
const [htmlparser2, cssSelect, csstree, domutils] = await Promise.all([
|
|
126
|
+
import('htmlparser2'),
|
|
127
|
+
import('css-select'),
|
|
128
|
+
import('css-tree'),
|
|
129
|
+
import('domutils'),
|
|
130
|
+
]);
|
|
131
|
+
return {
|
|
132
|
+
parseDocument: htmlparser2.parseDocument,
|
|
133
|
+
selectAll: cssSelect.selectAll,
|
|
134
|
+
selectOne: cssSelect.selectOne,
|
|
135
|
+
is: cssSelect.is,
|
|
136
|
+
csstree,
|
|
137
|
+
domutils,
|
|
138
|
+
};
|
|
139
|
+
});
|
|
140
|
+
} catch {
|
|
141
|
+
return detectText(html, filePath, options);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const resolvedPath = path.resolve(filePath);
|
|
145
|
+
const fileDir = path.dirname(resolvedPath);
|
|
146
|
+
const root = profileStep(profile, {
|
|
147
|
+
engine: 'static-html',
|
|
148
|
+
phase: 'parse-html',
|
|
149
|
+
ruleId: 'parse-document',
|
|
150
|
+
target: filePath,
|
|
151
|
+
}, () => modules.parseDocument(html, { lowerCaseAttributeNames: false, lowerCaseTags: true }));
|
|
152
|
+
|
|
153
|
+
const cssText = collectStaticCssText(root, fileDir, profile, filePath, modules);
|
|
154
|
+
const document = new StaticDocument(root, modules);
|
|
155
|
+
buildStaticStyleMap(root, document, cssText, modules, profile, filePath);
|
|
156
|
+
const window = buildStaticWindow(document);
|
|
157
|
+
|
|
158
|
+
const customPropMap = null;
|
|
159
|
+
|
|
160
|
+
const findings = [];
|
|
161
|
+
const runElementCheck = (ruleId, callback) => profile
|
|
162
|
+
? profileFindings(profile, { engine: 'static-html', phase: 'element', ruleId, target: filePath }, callback)
|
|
163
|
+
: callback();
|
|
164
|
+
|
|
165
|
+
const visitedByRule = new Map();
|
|
166
|
+
for (const rule of STATIC_ELEMENT_RULES) {
|
|
167
|
+
const elements = document.querySelectorAll(rule.selector);
|
|
168
|
+
visitedByRule.set(rule.id, elements.length);
|
|
169
|
+
for (const el of elements) {
|
|
170
|
+
const tag = el.tagName.toLowerCase();
|
|
171
|
+
const style = window.getComputedStyle(el);
|
|
172
|
+
for (const f of runElementCheck(rule.id, () => rule.run(el, tag, style, window, customPropMap))) {
|
|
173
|
+
findings.push(finding(f.id, filePath, f.snippet));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (options?.designSystem) {
|
|
179
|
+
const sourceDesignFindings = profileFindings(profile, {
|
|
180
|
+
engine: 'static-html',
|
|
181
|
+
phase: 'source',
|
|
182
|
+
ruleId: 'design-system',
|
|
183
|
+
target: filePath,
|
|
184
|
+
}, () => checkSourceDesignSystem(html, filePath, { designSystem: options.designSystem }));
|
|
185
|
+
const staticDesignFindings = profileFindings(profile, {
|
|
186
|
+
engine: 'static-html',
|
|
187
|
+
phase: 'page',
|
|
188
|
+
ruleId: 'design-system',
|
|
189
|
+
target: filePath,
|
|
190
|
+
}, () => collectStaticDesignSystemFindings(document, window, filePath, options.designSystem));
|
|
191
|
+
findings.push(...mergeDesignSystemFindings(staticDesignFindings, sourceDesignFindings));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (isFullPage(html)) {
|
|
195
|
+
const runPageCheck = (ruleId, callback) => profile
|
|
196
|
+
? profileFindings(profile, { engine: 'static-html', phase: 'page', ruleId, target: filePath }, callback)
|
|
197
|
+
: callback();
|
|
198
|
+
for (const f of runPageCheck('typography-rules', () => checkStaticPageTypography(document, window))) {
|
|
199
|
+
findings.push(finding(f.id, filePath, f.snippet));
|
|
200
|
+
}
|
|
201
|
+
for (const f of runPageCheck('repeated-section-kickers', () => checkRepeatedSectionKickersFromDoc(document, window))) {
|
|
202
|
+
findings.push(finding(f.id, filePath, f.snippet));
|
|
203
|
+
}
|
|
204
|
+
for (const f of runPageCheck('layout-rules', () => checkPageLayout(document, window))) {
|
|
205
|
+
findings.push(finding(f.id, filePath, f.snippet));
|
|
206
|
+
}
|
|
207
|
+
for (const f of runPageCheck('cream-palette', () => checkCreamPalette(document, window))) {
|
|
208
|
+
findings.push(finding(f.id, filePath, f.snippet));
|
|
209
|
+
}
|
|
210
|
+
for (const f of runPageCheck('skipped-heading', () => checkPageQualityFromDoc(document))) {
|
|
211
|
+
findings.push(finding(f.id, filePath, f.snippet));
|
|
212
|
+
}
|
|
213
|
+
for (const f of runPageCheck('html-patterns', () => checkHtmlPatterns(html).filter(item =>
|
|
214
|
+
item.id !== 'bounce-easing' && item.id !== 'layout-transition'
|
|
215
|
+
))) {
|
|
216
|
+
findings.push(finding(f.id, filePath, f.snippet));
|
|
217
|
+
}
|
|
218
|
+
// Text-content analyzers (em-dash overuse, marketing buzzwords,
|
|
219
|
+
// numbered section markers, aphoristic cadence) live in the regex
|
|
220
|
+
// engine. Call them from here so .html files get the same coverage
|
|
221
|
+
// as .css/.tsx files. These are scoped to text content only and
|
|
222
|
+
// don't overlap with static-html's element/page rules.
|
|
223
|
+
for (const f of runPageCheck('text-content', () => runTextContentAnalyzers(html, filePath, options))) {
|
|
224
|
+
findings.push(finding(f.antipattern, filePath, f.snippet));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const byProvider = filterByProviders(findings, options.providers);
|
|
229
|
+
// Static-HTML findings carry no line number, so only whole-file
|
|
230
|
+
// `monodesign-disable` directives apply here — exactly the standalone-document
|
|
231
|
+
// waiver this primitive targets. Bypassed by `--no-config` / `--no-inline-ignores`.
|
|
232
|
+
return options?.inlineIgnores === false ? byProvider : applyInlineIgnores(byProvider, html);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export { checkStaticPageTypography, STATIC_ELEMENT_RULES, detectHtml };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// Pattern adapted from impeccable (Apache-2.0) — rebranded for monomind
|
|
2
|
+
//
|
|
3
|
+
// Visual-contrast pixel fallback. `page` is the driver page abstraction from
|
|
4
|
+
// ../browser/drivers.mjs (a raw puppeteer Page also satisfies it): it only
|
|
5
|
+
// needs `evaluate(fn, arg)` roundtrips and `screenshot({ encoding: 'base64',
|
|
6
|
+
// clip, captureBeyondViewport })` returning a base64 PNG string. The logic is
|
|
7
|
+
// driver-agnostic: hide the glyphs via CSS, screenshot the clip twice, and
|
|
8
|
+
// diff the pixels in-page on a canvas. Both the monobrowse (CDP
|
|
9
|
+
// Page.captureScreenshot + Runtime.evaluate) and puppeteer drivers support
|
|
10
|
+
// this fully.
|
|
11
|
+
function sanitizeScreenshotClip(clip, viewport) {
|
|
12
|
+
if (!clip) return null;
|
|
13
|
+
const x = Math.max(0, Math.floor(clip.x || 0));
|
|
14
|
+
const y = Math.max(0, Math.floor(clip.y || 0));
|
|
15
|
+
const width = Math.min(
|
|
16
|
+
Math.max(1, Math.ceil(clip.width || 0)),
|
|
17
|
+
Math.max(1, viewport?.width || 1600),
|
|
18
|
+
);
|
|
19
|
+
const height = Math.min(
|
|
20
|
+
Math.max(1, Math.ceil(clip.height || 0)),
|
|
21
|
+
320,
|
|
22
|
+
);
|
|
23
|
+
if (width < 1 || height < 1) return null;
|
|
24
|
+
return { x, y, width, height };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function compareScreenshotContrast(page, beforeBase64, afterBase64, candidate) {
|
|
28
|
+
return page.evaluate(async ({ beforeBase64, afterBase64, candidate }) => {
|
|
29
|
+
const loadImage = (base64) => new Promise((resolve, reject) => {
|
|
30
|
+
const img = new Image();
|
|
31
|
+
img.onload = () => resolve(img);
|
|
32
|
+
img.onerror = () => reject(new Error('Could not decode contrast screenshot'));
|
|
33
|
+
img.src = `data:image/png;base64,${base64}`;
|
|
34
|
+
});
|
|
35
|
+
const [before, after] = await Promise.all([loadImage(beforeBase64), loadImage(afterBase64)]);
|
|
36
|
+
const width = Math.min(before.width, after.width);
|
|
37
|
+
const height = Math.min(before.height, after.height);
|
|
38
|
+
if (width < 1 || height < 1) return null;
|
|
39
|
+
|
|
40
|
+
const canvas = document.createElement('canvas');
|
|
41
|
+
canvas.width = width;
|
|
42
|
+
canvas.height = height;
|
|
43
|
+
const ctx = canvas.getContext('2d', { willReadFrequently: true });
|
|
44
|
+
if (!ctx) return null;
|
|
45
|
+
|
|
46
|
+
ctx.drawImage(before, 0, 0, width, height);
|
|
47
|
+
const beforePixels = ctx.getImageData(0, 0, width, height).data;
|
|
48
|
+
ctx.clearRect(0, 0, width, height);
|
|
49
|
+
ctx.drawImage(after, 0, 0, width, height);
|
|
50
|
+
const afterPixels = ctx.getImageData(0, 0, width, height).data;
|
|
51
|
+
|
|
52
|
+
const luminance = ({ r, g, b }) => {
|
|
53
|
+
const convert = c => {
|
|
54
|
+
const v = c / 255;
|
|
55
|
+
return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
|
|
56
|
+
};
|
|
57
|
+
return 0.2126 * convert(r) + 0.7152 * convert(g) + 0.0722 * convert(b);
|
|
58
|
+
};
|
|
59
|
+
const ratio = (a, b) => {
|
|
60
|
+
const l1 = luminance(a);
|
|
61
|
+
const l2 = luminance(b);
|
|
62
|
+
return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const cssTextColor = candidate.textColor && !candidate.preferRenderedForeground
|
|
66
|
+
? {
|
|
67
|
+
r: candidate.textColor.r,
|
|
68
|
+
g: candidate.textColor.g,
|
|
69
|
+
b: candidate.textColor.b,
|
|
70
|
+
}
|
|
71
|
+
: null;
|
|
72
|
+
const ratios = [];
|
|
73
|
+
let glyphPixels = 0;
|
|
74
|
+
let strongestDelta = 0;
|
|
75
|
+
for (let i = 0; i < beforePixels.length; i += 4) {
|
|
76
|
+
const delta = Math.abs(beforePixels[i] - afterPixels[i])
|
|
77
|
+
+ Math.abs(beforePixels[i + 1] - afterPixels[i + 1])
|
|
78
|
+
+ Math.abs(beforePixels[i + 2] - afterPixels[i + 2])
|
|
79
|
+
+ Math.abs(beforePixels[i + 3] - afterPixels[i + 3]);
|
|
80
|
+
strongestDelta = Math.max(strongestDelta, delta);
|
|
81
|
+
if (delta < 10) continue;
|
|
82
|
+
glyphPixels++;
|
|
83
|
+
const fg = cssTextColor || {
|
|
84
|
+
r: beforePixels[i],
|
|
85
|
+
g: beforePixels[i + 1],
|
|
86
|
+
b: beforePixels[i + 2],
|
|
87
|
+
};
|
|
88
|
+
const bg = {
|
|
89
|
+
r: afterPixels[i],
|
|
90
|
+
g: afterPixels[i + 1],
|
|
91
|
+
b: afterPixels[i + 2],
|
|
92
|
+
};
|
|
93
|
+
ratios.push(ratio(fg, bg));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (ratios.length < 8) {
|
|
97
|
+
return {
|
|
98
|
+
glyphPixels,
|
|
99
|
+
strongestDelta,
|
|
100
|
+
worstRatio: null,
|
|
101
|
+
p10Ratio: null,
|
|
102
|
+
medianRatio: null,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
ratios.sort((a, b) => a - b);
|
|
107
|
+
const pick = pct => ratios[Math.min(ratios.length - 1, Math.max(0, Math.floor((pct / 100) * ratios.length)))];
|
|
108
|
+
return {
|
|
109
|
+
glyphPixels,
|
|
110
|
+
strongestDelta,
|
|
111
|
+
worstRatio: ratios[0],
|
|
112
|
+
p10Ratio: pick(10),
|
|
113
|
+
medianRatio: pick(50),
|
|
114
|
+
};
|
|
115
|
+
}, { beforeBase64, afterBase64, candidate });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async function captureVisualContrastCandidate(page, candidate, viewport) {
|
|
119
|
+
const clip = sanitizeScreenshotClip(candidate.clip, viewport);
|
|
120
|
+
if (!clip) return null;
|
|
121
|
+
|
|
122
|
+
const beforeBase64 = await page.screenshot({
|
|
123
|
+
encoding: 'base64',
|
|
124
|
+
clip,
|
|
125
|
+
captureBeyondViewport: true,
|
|
126
|
+
});
|
|
127
|
+
const token = `monodesign-contrast-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
128
|
+
const applied = await page.evaluate(({ selector, token, backgroundClipText }) => {
|
|
129
|
+
let el;
|
|
130
|
+
try {
|
|
131
|
+
el = document.querySelector(selector);
|
|
132
|
+
} catch {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
if (!el) return false;
|
|
136
|
+
let style = document.getElementById('monodesign-visual-contrast-hide-style');
|
|
137
|
+
if (!style) {
|
|
138
|
+
style = document.createElement('style');
|
|
139
|
+
style.id = 'monodesign-visual-contrast-hide-style';
|
|
140
|
+
style.textContent = [
|
|
141
|
+
'[data-monodesign-visual-contrast-target] {',
|
|
142
|
+
' color: transparent !important;',
|
|
143
|
+
' -webkit-text-fill-color: transparent !important;',
|
|
144
|
+
' text-shadow: none !important;',
|
|
145
|
+
'}',
|
|
146
|
+
'[data-monodesign-visual-contrast-target][data-monodesign-bgclip-text="true"] {',
|
|
147
|
+
' background-image: none !important;',
|
|
148
|
+
'}',
|
|
149
|
+
].join('\n');
|
|
150
|
+
document.head.appendChild(style);
|
|
151
|
+
}
|
|
152
|
+
el.setAttribute('data-monodesign-visual-contrast-target', token);
|
|
153
|
+
if (backgroundClipText) el.setAttribute('data-monodesign-bgclip-text', 'true');
|
|
154
|
+
return true;
|
|
155
|
+
}, {
|
|
156
|
+
selector: candidate.selector,
|
|
157
|
+
token,
|
|
158
|
+
backgroundClipText: candidate.backgroundClipText,
|
|
159
|
+
});
|
|
160
|
+
if (!applied) return null;
|
|
161
|
+
|
|
162
|
+
let afterBase64;
|
|
163
|
+
try {
|
|
164
|
+
afterBase64 = await page.screenshot({
|
|
165
|
+
encoding: 'base64',
|
|
166
|
+
clip,
|
|
167
|
+
captureBeyondViewport: true,
|
|
168
|
+
});
|
|
169
|
+
} finally {
|
|
170
|
+
await page.evaluate(({ selector }) => {
|
|
171
|
+
try {
|
|
172
|
+
const el = document.querySelector(selector);
|
|
173
|
+
if (el) {
|
|
174
|
+
el.removeAttribute('data-monodesign-visual-contrast-target');
|
|
175
|
+
el.removeAttribute('data-monodesign-bgclip-text');
|
|
176
|
+
}
|
|
177
|
+
} catch {
|
|
178
|
+
// Ignore invalid or stale selectors during cleanup.
|
|
179
|
+
}
|
|
180
|
+
}, { selector: candidate.selector }).catch(() => {});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const metrics = await compareScreenshotContrast(page, beforeBase64, afterBase64, candidate);
|
|
184
|
+
if (!metrics || !Number.isFinite(metrics.p10Ratio) || metrics.glyphPixels < 8) return null;
|
|
185
|
+
const measuredRatio = metrics.p10Ratio;
|
|
186
|
+
if (measuredRatio >= candidate.threshold) return null;
|
|
187
|
+
const textLabel = candidate.text ? ` "${candidate.text}"` : '';
|
|
188
|
+
const reasonLabel = (candidate.reasons || []).slice(0, 3).join(', ') || 'visual background';
|
|
189
|
+
return {
|
|
190
|
+
id: 'low-contrast',
|
|
191
|
+
snippet: `pixel contrast ${measuredRatio.toFixed(1)}:1 median ${metrics.medianRatio.toFixed(1)}:1 (need ${candidate.threshold}:1) on ${reasonLabel}${textLabel}`,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export {
|
|
196
|
+
sanitizeScreenshotClip,
|
|
197
|
+
compareScreenshotContrast,
|
|
198
|
+
captureVisualContrastCandidate,
|
|
199
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Pattern adapted from impeccable (Apache-2.0) — rebranded for monomind
|
|
2
|
+
import { getAntipattern } from './registry/antipatterns.mjs';
|
|
3
|
+
|
|
4
|
+
function getAP(id) {
|
|
5
|
+
return getAntipattern(id);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function finding(id, filePath, snippet, line = 0) {
|
|
9
|
+
const ap = getAP(id);
|
|
10
|
+
return { antipattern: id, name: ap.name, description: ap.description, severity: ap.severity || 'warning', file: filePath, line, snippet };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { getAP, finding };
|
package/packages/@monomind/cli/.claude/skills/monodesign/scripts/detector/node/file-system.mjs
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// Pattern adapted from impeccable (Apache-2.0) — rebranded for monomind
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// File walker
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
const SKIP_DIRS = new Set([
|
|
10
|
+
'node_modules', '.git', 'dist', 'build', '.next', '.nuxt', '.output',
|
|
11
|
+
'.svelte-kit', '__pycache__', '.turbo', '.vercel',
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
const SCANNABLE_EXTENSIONS = new Set([
|
|
15
|
+
'.html', '.htm', '.css', '.scss', '.sass', '.less',
|
|
16
|
+
'.jsx', '.tsx', '.js', '.ts',
|
|
17
|
+
'.vue', '.svelte', '.astro',
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
const HTML_EXTENSIONS = new Set(['.html', '.htm']);
|
|
21
|
+
|
|
22
|
+
function walkDir(dir) {
|
|
23
|
+
const files = [];
|
|
24
|
+
let entries;
|
|
25
|
+
try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return files; }
|
|
26
|
+
for (const entry of entries) {
|
|
27
|
+
if (SKIP_DIRS.has(entry.name)) continue;
|
|
28
|
+
const full = path.join(dir, entry.name);
|
|
29
|
+
if (entry.isDirectory()) files.push(...walkDir(full));
|
|
30
|
+
else if (SCANNABLE_EXTENSIONS.has(path.extname(entry.name).toLowerCase())) files.push(full);
|
|
31
|
+
}
|
|
32
|
+
return files;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
// Import graph (multi-file awareness)
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
function resolveImport(specifier, fromDir, fileSet) {
|
|
41
|
+
if (!/^[./]/.test(specifier)) return null; // skip bare specifiers
|
|
42
|
+
const base = path.resolve(fromDir, specifier);
|
|
43
|
+
if (fileSet.has(base)) return base;
|
|
44
|
+
for (const ext of SCANNABLE_EXTENSIONS) {
|
|
45
|
+
const withExt = base + ext;
|
|
46
|
+
if (fileSet.has(withExt)) return withExt;
|
|
47
|
+
}
|
|
48
|
+
// index file convention
|
|
49
|
+
for (const ext of SCANNABLE_EXTENSIONS) {
|
|
50
|
+
const indexFile = path.join(base, 'index' + ext);
|
|
51
|
+
if (fileSet.has(indexFile)) return indexFile;
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function buildImportGraph(files) {
|
|
57
|
+
const fileSet = new Set(files);
|
|
58
|
+
const graph = new Map();
|
|
59
|
+
|
|
60
|
+
for (const file of files) {
|
|
61
|
+
const content = fs.readFileSync(file, 'utf-8');
|
|
62
|
+
const dir = path.dirname(file);
|
|
63
|
+
const imports = new Set();
|
|
64
|
+
|
|
65
|
+
// ES imports: import ... from '...' and import '...'
|
|
66
|
+
const esRe = /import\s+(?:[\s\S]*?from\s+)?['"]([^'"]+)['"]/g;
|
|
67
|
+
let m;
|
|
68
|
+
while ((m = esRe.exec(content)) !== null) {
|
|
69
|
+
const resolved = resolveImport(m[1], dir, fileSet);
|
|
70
|
+
if (resolved) imports.add(resolved);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// CSS @import
|
|
74
|
+
const cssRe = /@import\s+(?:url\(\s*)?['"]?([^'");\s]+)['"]?\s*\)?/g;
|
|
75
|
+
while ((m = cssRe.exec(content)) !== null) {
|
|
76
|
+
const resolved = resolveImport(m[1], dir, fileSet);
|
|
77
|
+
if (resolved) imports.add(resolved);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// SCSS @use / @forward
|
|
81
|
+
const scssRe = /@(?:use|forward)\s+['"]([^'"]+)['"]/g;
|
|
82
|
+
while ((m = scssRe.exec(content)) !== null) {
|
|
83
|
+
const resolved = resolveImport(m[1], dir, fileSet);
|
|
84
|
+
if (resolved) imports.add(resolved);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
graph.set(file, imports);
|
|
88
|
+
}
|
|
89
|
+
return graph;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
// Framework dev server detection
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
|
|
96
|
+
const FRAMEWORK_CONFIGS = [
|
|
97
|
+
{ name: 'Next.js', files: ['next.config.js', 'next.config.mjs', 'next.config.ts'], defaultPort: 3000,
|
|
98
|
+
portRe: /port\s*[:=]\s*(\d+)/,
|
|
99
|
+
fingerprint: { header: 'x-powered-by', value: /next/i } },
|
|
100
|
+
{ name: 'SvelteKit', files: ['svelte.config.js', 'svelte.config.ts'], defaultPort: 5173,
|
|
101
|
+
portRe: /port\s*[:=]\s*(\d+)/,
|
|
102
|
+
fingerprint: { header: 'x-sveltekit-page', value: null } },
|
|
103
|
+
{ name: 'Nuxt', files: ['nuxt.config.js', 'nuxt.config.ts'], defaultPort: 3000,
|
|
104
|
+
portRe: /port\s*[:=]\s*(\d+)/,
|
|
105
|
+
fingerprint: { header: 'x-powered-by', value: /nuxt/i } },
|
|
106
|
+
{ name: 'Vite', files: ['vite.config.js', 'vite.config.ts', 'vite.config.mjs'], defaultPort: 5173,
|
|
107
|
+
portRe: /port\s*[:=]\s*(\d+)/,
|
|
108
|
+
fingerprint: { body: /@vite\/client/ } },
|
|
109
|
+
{ name: 'Astro', files: ['astro.config.js', 'astro.config.ts', 'astro.config.mjs'], defaultPort: 4321,
|
|
110
|
+
portRe: /port\s*[:=]\s*(\d+)/,
|
|
111
|
+
fingerprint: { body: /astro/i } },
|
|
112
|
+
{ name: 'Angular', files: ['angular.json'], defaultPort: 4200,
|
|
113
|
+
portRe: /"port"\s*:\s*(\d+)/,
|
|
114
|
+
fingerprint: { body: /ng-version/i } },
|
|
115
|
+
{ name: 'Remix', files: ['remix.config.js', 'remix.config.ts'], defaultPort: 3000,
|
|
116
|
+
portRe: /port\s*[:=]\s*(\d+)/,
|
|
117
|
+
fingerprint: { header: 'x-powered-by', value: /remix/i } },
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
function detectFrameworkConfig(dir) {
|
|
121
|
+
let entries;
|
|
122
|
+
try { entries = fs.readdirSync(dir); } catch { return null; }
|
|
123
|
+
const entrySet = new Set(entries);
|
|
124
|
+
|
|
125
|
+
for (const cfg of FRAMEWORK_CONFIGS) {
|
|
126
|
+
const match = cfg.files.find(f => entrySet.has(f));
|
|
127
|
+
if (!match) continue;
|
|
128
|
+
|
|
129
|
+
const configPath = path.join(dir, match);
|
|
130
|
+
let port = cfg.defaultPort;
|
|
131
|
+
try {
|
|
132
|
+
const content = fs.readFileSync(configPath, 'utf-8');
|
|
133
|
+
const portMatch = content.match(cfg.portRe);
|
|
134
|
+
if (portMatch) port = parseInt(portMatch[1], 10);
|
|
135
|
+
} catch { /* use default */ }
|
|
136
|
+
|
|
137
|
+
return { name: cfg.name, port, configPath, fingerprint: cfg.fingerprint };
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Check if a port is listening and optionally verify it matches the expected framework.
|
|
144
|
+
* Returns { listening: true, matched: true/false } or { listening: false }.
|
|
145
|
+
*/
|
|
146
|
+
async function isPortListening(port, fingerprint = null) {
|
|
147
|
+
if (!fingerprint) {
|
|
148
|
+
// Simple TCP probe fallback
|
|
149
|
+
const net = await import('node:net');
|
|
150
|
+
return new Promise((resolve) => {
|
|
151
|
+
const sock = net.default.createConnection({ port, host: '127.0.0.1' });
|
|
152
|
+
sock.setTimeout(500);
|
|
153
|
+
sock.on('connect', () => { sock.destroy(); resolve({ listening: true, matched: true }); });
|
|
154
|
+
sock.on('error', () => resolve({ listening: false }));
|
|
155
|
+
sock.on('timeout', () => { sock.destroy(); resolve({ listening: false }); });
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// HTTP probe with fingerprint matching
|
|
160
|
+
try {
|
|
161
|
+
const controller = new AbortController();
|
|
162
|
+
const timeout = setTimeout(() => controller.abort(), 2000);
|
|
163
|
+
const res = await fetch(`http://localhost:${port}/`, { signal: controller.signal, redirect: 'follow' });
|
|
164
|
+
clearTimeout(timeout);
|
|
165
|
+
|
|
166
|
+
// Check header fingerprint
|
|
167
|
+
if (fingerprint.header) {
|
|
168
|
+
const val = res.headers.get(fingerprint.header);
|
|
169
|
+
if (val && (!fingerprint.value || fingerprint.value.test(val))) {
|
|
170
|
+
return { listening: true, matched: true };
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Check body fingerprint
|
|
175
|
+
if (fingerprint.body) {
|
|
176
|
+
const body = await res.text();
|
|
177
|
+
if (fingerprint.body.test(body)) {
|
|
178
|
+
return { listening: true, matched: true };
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Port is listening but doesn't match the expected framework
|
|
183
|
+
return { listening: true, matched: false };
|
|
184
|
+
} catch {
|
|
185
|
+
return { listening: false };
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export {
|
|
190
|
+
SKIP_DIRS,
|
|
191
|
+
SCANNABLE_EXTENSIONS,
|
|
192
|
+
HTML_EXTENSIONS,
|
|
193
|
+
walkDir,
|
|
194
|
+
resolveImport,
|
|
195
|
+
buildImportGraph,
|
|
196
|
+
FRAMEWORK_CONFIGS,
|
|
197
|
+
detectFrameworkConfig,
|
|
198
|
+
isPortListening,
|
|
199
|
+
};
|