medesign 0.0.0-stage → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -2
  3. package/bin/medesign.js +200 -0
  4. package/integrations/claude-code/SKILL.md +20 -0
  5. package/integrations/cursor/medesign.mdc +26 -0
  6. package/medesign.config.js +46 -0
  7. package/package.json +62 -4
  8. package/presets/apple/design-tokens.css +115 -0
  9. package/presets/apple/guidelines.md +19 -0
  10. package/presets/apple/preset.json +53 -0
  11. package/presets/metha/design-tokens.css +127 -0
  12. package/presets/metha/guidelines.md +23 -0
  13. package/presets/metha/preset.json +53 -0
  14. package/presets/schema.json +102 -0
  15. package/presets/tesla/design-tokens.css +112 -0
  16. package/presets/tesla/guidelines.md +17 -0
  17. package/presets/tesla/preset.json +53 -0
  18. package/references/ai-tells.md +127 -0
  19. package/references/appendices.md +220 -0
  20. package/references/architecture.md +39 -0
  21. package/references/argon-design-archetypes.md +317 -0
  22. package/references/banner-sizes-and-styles.md +118 -0
  23. package/references/block-library.md +61 -0
  24. package/references/brand-design-tokens.md +42 -0
  25. package/references/catalog.json +108 -0
  26. package/references/cip-deliverable-guide.md +95 -0
  27. package/references/cip-design.md +121 -0
  28. package/references/cip-prompt-engineering.md +84 -0
  29. package/references/cip-style-guide.md +68 -0
  30. package/references/cli-architecture.md +146 -0
  31. package/references/components.md +240 -0
  32. package/references/dark-mode.md +23 -0
  33. package/references/design-core.md +42 -0
  34. package/references/design-md-protocol.md +75 -0
  35. package/references/design-routing.md +207 -0
  36. package/references/eng-imagery-content.md +71 -0
  37. package/references/eng-layout.md +28 -0
  38. package/references/eng-other.md +26 -0
  39. package/references/eng-states-theme.md +22 -0
  40. package/references/eng-type-color.md +44 -0
  41. package/references/icon-design.md +122 -0
  42. package/references/image-mockup-direction.md +53 -0
  43. package/references/image-to-code.md +46 -0
  44. package/references/impeccable-polish.md +85 -0
  45. package/references/intake.md +90 -0
  46. package/references/logo-color-psychology.md +101 -0
  47. package/references/logo-design.md +110 -0
  48. package/references/logo-prompt-engineering.md +158 -0
  49. package/references/logo-style-guide.md +109 -0
  50. package/references/mesurv-dna.md +104 -0
  51. package/references/micro-interactions-and-auto-animate.md +71 -0
  52. package/references/modern-craft-invariants.md +332 -0
  53. package/references/motion-tokens.md +99 -0
  54. package/references/preflight.md +110 -0
  55. package/references/proactive-motion.md +167 -0
  56. package/references/quality-gate.md +147 -0
  57. package/references/redesign-audit.md +38 -0
  58. package/references/redesign.md +52 -0
  59. package/references/slides-copywriting-formulas.md +84 -0
  60. package/references/slides-create.md +4 -0
  61. package/references/slides-html-template.md +295 -0
  62. package/references/slides-layout-patterns.md +137 -0
  63. package/references/slides-strategies.md +94 -0
  64. package/references/slides.md +42 -0
  65. package/references/social-photos-design.md +329 -0
  66. package/references/spatial-canvas-engine.md +160 -0
  67. package/references/stitch-system.md +184 -0
  68. package/references/style-extraction.md +17 -0
  69. package/references/styles/brutalist.md +88 -0
  70. package/references/styles/minimalist.md +81 -0
  71. package/references/styles/soft.md +94 -0
  72. package/references/threeui-spatial-engine.md +224 -0
  73. package/references/ui-styling-shadcn.md +336 -0
  74. package/references/ui-ux-vocabulary-vault.json +1223 -0
  75. package/references/ui-ux-vocabulary-vault.md +438 -0
  76. package/references/vocab-protocol.md +52 -0
  77. package/references/vocabulary.md +78 -0
  78. package/scripts/export-tokens.js +403 -0
  79. package/tests/browser-audit.js +442 -0
  80. package/tests/linter.js +412 -0
  81. package/tests/schemas/sarif-2.1.0.schema.json +2915 -0
  82. package/tests/visual-testbed.html +681 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Metha Tripraphankit (Survey Engineering & Geoinformatics, Kasetsart University)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,129 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # ME-DESIGN vNext
4
+
5
+ **The Autonomous Design Engineering System & Quality Linter for AI Coding Assistants**
6
+
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
8
+ [![CI Matrix](https://github.com/methastrategy/medesign/actions/workflows/ci.yml/badge.svg)](https://github.com/methastrategy/medesign/actions/workflows/ci.yml)
9
+ [![npm version](https://img.shields.io/npm/v/medesign.svg?color=emerald)](https://www.npmjs.com/package/medesign)
10
+ [![Node Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)
11
+ [![Status](https://img.shields.io/badge/status-production--ready-emerald.svg)]()
12
+ [![Archetypes](https://img.shields.io/badge/archetypes-38%20models-indigo.svg)]()
13
+
14
+ *Eliminate AI Slop and bring optical mathematics, perceptual color science, and mission-critical engineering rigor to automated UI/UX generation.*
15
+
16
+ ---
17
+
18
+ </div>
19
+
20
+ ## 🌟 Why ME-DESIGN?
21
+
22
+ Most AI-generated user interfaces suffer from **Decisionless Uniformity**: generic 3-card grids, oversaturated neon glows, clipping Thai/Latin font metrics, broken keyboard accessibility, and non-proportional press deformations.
23
+
24
+ **ME-DESIGN** changes the paradigm from subjective aesthetic prompting to an **executable 5-Engine Design Architecture** coupled with a **Dual-Tier Quality Linter**.
25
+
26
+ ---
27
+
28
+ ## 🏛️ The 5-Engine Core Architecture
29
+
30
+ ```
31
+ ME-DESIGN Core Engine
32
+ ├── 01. Optical Geometry Engine -> Safe Concentric Radii, Area-Proportional Scaling, Hit Target Isolation
33
+ ├── 02. Perceptual Color Engine -> OKLCH / OKLab Gamut, Dynamic color-mix(), Dark Mode Functional Tokens
34
+ ├── 03. Motion & Interaction Engine -> 4 Behavioral Profiles (precision, soft-settle, spring-settle, instant)
35
+ ├── 04. Typography & Script Engine -> Dual-Context Line-Height, Thai Diacritic Clearance, @font-face Calibration
36
+ └── 05. Quality & Saliency Auditor -> 4-Tier Governance, Task-Driven Attention Models, Zero-Compromise Gate
37
+ ```
38
+
39
+ ---
40
+
41
+ ## 📐 38 Production Archetypes (5-Axis Decoupled Matrix)
42
+
43
+ ME-DESIGN decouples UI synthesis across 5 independent axes:
44
+ **Operational Archetype × Visual Language × Spatial Model × Motion Profile × Governance Tier**
45
+
46
+ - **Group A: Luxury & Editorial (01-05):** Quiet Luxury, Swiss International Editorial, Dark Haute Couture...
47
+ - **Group B: SaaS, DevTools & High-Density (06-12):** Linear Minimal, Vercel Clean Monochrome, Bloomberg Pro Density, Raycast Spatial HUD...
48
+ - **Group C: Fintech, Crypto & Glassmorphism (13-18):** Stripe Clean Gradient, Cyberpunk Matrix, Cosmos Acrylic Glass...
49
+ - **Group D: Modern Consumer, E-Commerce & Brand (19-24):** Apple Pro Spatial, Airbnb Warm Domestic...
50
+ - **Group E: Creative Agency & Experimental (25-30):** Neo-Brutalism, Kinetic Marquee, Biophilic Wellness...
51
+ - **Group F: Mission-Critical Engineering & HMI (31-38):**
52
+ - **31. Mission Control HMI (ISA-101 Standard):** Tri-state alarms, greyscale base, operator decision priority.
53
+ - **32. Geospatial Situation Awareness (GIS & Cadastre):** Map-centric 16:10 / 100dvh, linked selection tables, EPSG coordinates.
54
+ - **33. CAD Precision Workbench:** Maximized canvas, floating command bar, geometric snap indicators.
55
+ - **34. Telemetry & Signal Forensics:** Time-series scrubbing, stale sensor detection, gap indicators.
56
+ - **35. Anomaly Triage & Incident Response:** Priority queue, severity vs confidence matrix.
57
+ - **36. Field Survey & Offline Operations:** 52px touch targets, RTK fix status, offline sync queue.
58
+ - **37. Spatiotemporal Change Detection:** Synchronized dual viewports, epoch time slider.
59
+ - **38. Data Provenance & Survey QA/QC:** Observation lineage, error ellipses, legal timestamp seals.
60
+
61
+ ---
62
+
63
+ ## 🚀 Quickstart: Running via `npx` (Zero Installation)
64
+
65
+ Execute ME-DESIGN immediately without manual installation:
66
+
67
+ ```bash
68
+ # Lint an HTML, JSX, or CSS file with static AST & invariant rules
69
+ npx medesign lint path/to/index.html
70
+
71
+ # Lint and export OASIS SARIF v2.1.0 for GitHub Code Scanning
72
+ npx medesign lint path/to/index.html --format sarif
73
+
74
+ # Run headless Chrome DevTools Protocol verification matrix
75
+ # (Computes real contrast ratios, tab focus indicators, and 44px hit-targets)
76
+ npx medesign audit path/to/index.html
77
+
78
+ # Export design tokens to Tailwind CSS v4 @theme, W3C DTCG, or CSS variables
79
+ npx medesign tokens --preset apple --format tailwind --out ./tokens
80
+
81
+ # Verify system health, Node.js version, and headless browser availability
82
+ npx medesign doctor
83
+ ```
84
+
85
+ ### The Terminal Summary Card
86
+
87
+ ```text
88
+ ME-DESIGN vNext
89
+ Design Quality & Governance Audit
90
+ ────────────────────────────────────────
91
+ Target dashboard.tsx
92
+ Archetype Geospatial Situation Awareness (32)
93
+ Analysis Static AST & Semantic Rules
94
+ Ruleset medesign-standard@1.0.0
95
+
96
+ QUALITY SCORE (Q = 0.30H + 0.25I + 0.20G + 0.15R + 0.10V)
97
+ Hierarchy (H) 94.0 / 100
98
+ Information (I) 90.0 / 100
99
+ Geometry (G) 92.0 / 100
100
+ Responsive (R) 88.0 / 100
101
+ Visual Craft (V) 95.0 / 100
102
+
103
+ Q-SCORE 91.8 / 100 [PASS]
104
+
105
+ HARD INVARIANTS CHECKLIST
106
+ PASS Keyboard Focus Ring Visibility (:focus-visible)
107
+ PASS Reduced Motion Compliance (@media prefers-reduced-motion)
108
+ PASS Anti-AI Tells: Zero Em-Dash Invariant
109
+ PASS Predictable DOM Order (No unsemantic dense flow)
110
+
111
+ ────────────────────────────────────────
112
+ RESULT: PASS (Exit Code: 0)
113
+ ```
114
+
115
+ ---
116
+
117
+ ## 🤖 AI Coding Assistant Integrations
118
+
119
+ ME-DESIGN provides shared rule adapters for all major agentic tools:
120
+
121
+ - **Claude Code:** Copy `integrations/claude-code/SKILL.md` to `.claude/skills/medesign/SKILL.md`
122
+ - **Cursor:** Copy `integrations/cursor/medesign.mdc` to `.cursor/rules/medesign.mdc`
123
+ - **Google Antigravity:** Native Skill supported under `skills/medesign/SKILL.md`
124
+
125
+ ---
126
+
127
+ ## 📄 License
128
+
129
+ MIT License © 2026 Metha Triparamkit (Survey Engineering & Geoinformatics, Kasetsart University).
@@ -0,0 +1,200 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * ME-DESIGN CLI — Autonomous Design Engineering Toolkit & Linter
5
+ *
6
+ * Commands:
7
+ * medesign lint <file> [--format text|json|sarif] [--preset <name>] [--config <path>]
8
+ * medesign audit <file> [--json]
9
+ * medesign tokens [--preset <name>] [--format tailwind|dtcg|css|all] [--out <dir>]
10
+ * medesign presets [list | get <name>]
11
+ * medesign test [--browser]
12
+ * medesign doctor
13
+ */
14
+
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+ const { spawnSync } = require('child_process');
18
+
19
+ const rootDir = path.join(__dirname, '..');
20
+ const args = process.argv.slice(2);
21
+ const command = args[0] || 'help';
22
+
23
+ const ANSI_RESET = '\x1b[0m';
24
+ const ANSI_BOLD = '\x1b[1m';
25
+ const ANSI_CYAN = '\x1b[36m';
26
+ const ANSI_GREEN = '\x1b[32m';
27
+ const ANSI_YELLOW = '\x1b[33m';
28
+ const ANSI_RED = '\x1b[31m';
29
+ const ANSI_GRAY = '\x1b[90m';
30
+
31
+ function printHelp() {
32
+ console.log(`
33
+ ${ANSI_BOLD}ME-DESIGN CLI v1.2.0${ANSI_RESET}
34
+ Autonomous Design Engineering Toolkit & Automated Linter for AI Coding Assistants
35
+
36
+ ${ANSI_BOLD}USAGE:${ANSI_RESET}
37
+ medesign <command> [options]
38
+
39
+ ${ANSI_BOLD}COMMANDS:${ANSI_RESET}
40
+ ${ANSI_CYAN}lint${ANSI_RESET} <file> Lint HTML/CSS/JSX file with static AST & semantic rules
41
+ Options: --format <text|json|sarif>
42
+ --preset <apple|tesla|metha>
43
+ --config <path>
44
+
45
+ ${ANSI_CYAN}audit${ANSI_RESET} <file> Run headless Chrome DevTools Protocol verification matrix
46
+ (Checks computed contrast, tab focus outline, 44px hit-targets across viewports)
47
+ Options: --json
48
+
49
+ ${ANSI_CYAN}tokens${ANSI_RESET} [export] Export preset design tokens to Tailwind v4 @theme, W3C DTCG, or CSS
50
+ Options: --preset <apple|tesla|metha|all>
51
+ --format <tailwind|dtcg|css|all>
52
+ --out <directory>
53
+
54
+ ${ANSI_CYAN}presets${ANSI_RESET} [list|get] Inspect available design system presets
55
+ Usage: medesign presets list
56
+ medesign presets get <preset-name>
57
+
58
+ ${ANSI_CYAN}test${ANSI_RESET} [options] Run deterministic test suite across fixtures
59
+ Options: --browser (runs both static AST and headless browser matrix)
60
+
61
+ ${ANSI_CYAN}doctor${ANSI_RESET} Verify local environment, Node.js, and Chrome/CDP availability
62
+
63
+ ${ANSI_CYAN}help${ANSI_RESET} Display this help message
64
+ `);
65
+ }
66
+
67
+ switch (command) {
68
+ case 'lint': {
69
+ const linterScript = path.join(rootDir, 'tests', 'linter.js');
70
+ const child = spawnSync(process.execPath, [linterScript, ...args.slice(1)], {
71
+ stdio: 'inherit',
72
+ cwd: process.cwd()
73
+ });
74
+ process.exit(child.status ?? 0);
75
+ }
76
+
77
+ case 'audit': {
78
+ const auditScript = path.join(rootDir, 'tests', 'browser-audit.js');
79
+ const child = spawnSync(process.execPath, [auditScript, ...args.slice(1)], {
80
+ stdio: 'inherit',
81
+ cwd: process.cwd()
82
+ });
83
+ process.exit(child.status ?? 0);
84
+ }
85
+
86
+ case 'tokens': {
87
+ const exportScript = path.join(rootDir, 'scripts', 'export-tokens.js');
88
+ // Filter out 'export' sub-command word if passed (e.g. medesign tokens export)
89
+ const exportArgs = args.slice(1).filter(a => a !== 'export');
90
+ const child = spawnSync(process.execPath, [exportScript, ...exportArgs], {
91
+ stdio: 'inherit',
92
+ cwd: process.cwd()
93
+ });
94
+ process.exit(child.status ?? 0);
95
+ }
96
+
97
+ case 'presets': {
98
+ const sub = args[1] || 'list';
99
+ const presetsDir = path.join(rootDir, 'presets');
100
+ if (sub === 'list') {
101
+ console.log(`\n${ANSI_BOLD}AVAILABLE ME-DESIGN PRESETS:${ANSI_RESET}\n`);
102
+ const folders = fs.readdirSync(presetsDir, { withFileTypes: true })
103
+ .filter(d => d.isDirectory())
104
+ .map(d => d.name);
105
+ folders.forEach(f => {
106
+ const pJson = path.join(presetsDir, f, 'preset.json');
107
+ if (fs.existsSync(pJson)) {
108
+ const data = JSON.parse(fs.readFileSync(pJson, 'utf8'));
109
+ console.log(` ${ANSI_CYAN}${data.id.padEnd(10)}${ANSI_RESET} ${data.name}`);
110
+ console.log(` ${ANSI_GRAY}${data.archetype}${ANSI_RESET}`);
111
+ }
112
+ });
113
+ console.log('');
114
+ } else if (sub === 'get') {
115
+ const name = args[2];
116
+ if (!name) {
117
+ console.error('Error: Please specify preset name (e.g. medesign presets get apple)');
118
+ process.exit(1);
119
+ }
120
+ const pJson = path.join(presetsDir, name.toLowerCase(), 'preset.json');
121
+ if (!fs.existsSync(pJson)) {
122
+ console.error(`Error: Preset '${name}' not found.`);
123
+ process.exit(1);
124
+ }
125
+ console.log(fs.readFileSync(pJson, 'utf8'));
126
+ }
127
+ break;
128
+ }
129
+
130
+ case 'test': {
131
+ const runnerScript = path.join(rootDir, 'tests', 'runner.js');
132
+ const child = spawnSync(process.execPath, [runnerScript, ...args.slice(1)], {
133
+ stdio: 'inherit',
134
+ cwd: process.cwd()
135
+ });
136
+ process.exit(child.status ?? 0);
137
+ }
138
+
139
+ case 'doctor': {
140
+ console.log(`\n${ANSI_BOLD}ME-DESIGN System Health & Environment Doctor${ANSI_RESET}`);
141
+ console.log(`${ANSI_GRAY}────────────────────────────────────────${ANSI_RESET}\n`);
142
+
143
+ // 1. Node.js Version Check
144
+ const nodeVer = process.version;
145
+ const major = parseInt(nodeVer.slice(1).split('.')[0], 10);
146
+ const nodeOk = major >= 18;
147
+ console.log(`Node.js Runtime: ${nodeOk ? ANSI_GREEN + nodeVer + ' (Supported)' : ANSI_RED + nodeVer + ' (Requires >= 18.0.0)'}${ANSI_RESET}`);
148
+
149
+ const chromeCandidates = [
150
+ process.env.CHROME_PATH,
151
+ process.env.CHROME_BIN,
152
+ 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
153
+ 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
154
+ 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe',
155
+ path.join(process.env.LOCALAPPDATA || '', 'ms-playwright', 'chromium-1248', 'chrome-win64', 'chrome.exe'),
156
+ '/usr/bin/google-chrome',
157
+ '/usr/bin/google-chrome-stable',
158
+ '/usr/bin/chromium',
159
+ '/usr/bin/chromium-browser',
160
+ '/snap/bin/chromium',
161
+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
162
+ '/Applications/Chromium.app/Contents/MacOS/Chromium'
163
+ ].filter(Boolean);
164
+
165
+ let foundChrome = null;
166
+ for (const c of chromeCandidates) {
167
+ if (fs.existsSync(c)) {
168
+ foundChrome = c;
169
+ break;
170
+ }
171
+ }
172
+ console.log(`Headless Browser: ${foundChrome ? ANSI_GREEN + 'Found (' + path.basename(foundChrome) + ')' : ANSI_YELLOW + 'Not found in default paths'}${ANSI_RESET}`);
173
+ if (foundChrome) {
174
+ console.log(` ${ANSI_GRAY}${foundChrome}${ANSI_RESET}`);
175
+ }
176
+
177
+ // 3. Presets Check
178
+ const presetsDir = path.join(rootDir, 'presets');
179
+ const presets = fs.readdirSync(presetsDir, { withFileTypes: true })
180
+ .filter(d => d.isDirectory() && fs.existsSync(path.join(presetsDir, d.name, 'preset.json')));
181
+ console.log(`Installed Presets: ${ANSI_GREEN}${presets.length} valid presets (${presets.map(p => p.name).join(', ')})${ANSI_RESET}`);
182
+
183
+ // 4. Test Suite Fixtures
184
+ const fixturesDir = path.join(rootDir, 'tests', 'fixtures');
185
+ const validCount = fs.existsSync(path.join(fixturesDir, 'valid')) ? fs.readdirSync(path.join(fixturesDir, 'valid')).length : 0;
186
+ const invalidCount = fs.existsSync(path.join(fixturesDir, 'invalid')) ? fs.readdirSync(path.join(fixturesDir, 'invalid')).length : 0;
187
+ console.log(`Test Fixtures: ${ANSI_GREEN}${validCount} valid, ${invalidCount} invalid test fixtures${ANSI_RESET}\n`);
188
+
189
+ console.log(`${ANSI_GRAY}────────────────────────────────────────${ANSI_RESET}`);
190
+ console.log(`${ANSI_GREEN}${ANSI_BOLD}STATUS: ALL SYSTEMS OPERATIONAL${ANSI_RESET}\n`);
191
+ break;
192
+ }
193
+
194
+ case 'help':
195
+ case '--help':
196
+ case '-h':
197
+ default:
198
+ printHelp();
199
+ break;
200
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: medesign
3
+ description: Curated UI/UX & High-Signal Engineering Design Engine with 5-Engine Architecture and 4-Tier Quality Governance.
4
+ ---
5
+
6
+ # ME-DESIGN for Claude Code
7
+
8
+ When designing, auditing, or writing frontend code:
9
+
10
+ 1. **Routing:** Follow the 38 Archetypes (30 Visual + 8 Engineering ISA-101 / GIS).
11
+ 2. **Hard Invariants:**
12
+ - WCAG AA/AAA contrast on both Light and Dark themes.
13
+ - Visible `:focus-visible` ring on all interactive elements.
14
+ - Touch target $\ge 44\text{px}$ (HIG compliant).
15
+ - Reduced-motion gate: respect `@media (prefers-reduced-motion: reduce)`.
16
+ - Zero em-dash (`—`) or en-dash (`–`) in visible UI copy.
17
+ 3. **5-Axis Decoupling:**
18
+ - Operational Archetype × Visual Language × Spatial Model × Motion Profile × Governance Tier.
19
+ 4. **Verification:**
20
+ - Verify code against `tests/linter.js` before completing tasks.
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Enforce ME-DESIGN vNext Optical Craft, 5-Engine Architecture, and 4-Tier Quality Governance.
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # ME-DESIGN vNext Quality Guidelines (Cursor Rules)
7
+
8
+ When generating or refactoring UI components, web pages, or engineering dashboards:
9
+
10
+ 1. **Optical Geometry:**
11
+ - Use Safe Concentric Radius formula: `border-radius: max(0px, calc(var(--r-outer) - var(--border-w, 0px) - var(--pad)))`.
12
+ - Area-Proportional scaling on press: preserve 44px hit-target container, transform only inner `.visual-surface`.
13
+ 2. **Perceptual Color Science:**
14
+ - Use `in oklch shorter hue` for vibrant gradient paths, and `in oklab` for neutral/white/black blends.
15
+ - Use `color-mix(in oklch, ...)` for token derivations instead of raw static hex codes.
16
+ - Respect Dark Mode functional tokens (`--surface-canvas`, `--surface-raised`, `--surface-inset`, `--border-subtle`, `--border-focus`).
17
+ 3. **Motion Profiles:**
18
+ - Choose from 4 profiles: `precision` (0-100ms no overshoot), `soft-settle` (240-280ms), `spring-settle` (linear/spring), `instant` (0ms).
19
+ - Mandatory `@media (prefers-reduced-motion: reduce)` bypass.
20
+ 4. **Typography & Script:**
21
+ - Enforce dual-context line-height: UI Chrome `1.25` (EN) / `1.38` (TH), Prose `1.60` (EN) / `1.70-1.75` (TH).
22
+ - Provide 2-4px optical headroom for Thai tone marks and top vowels.
23
+ 5. **Anti-AI Tells:**
24
+ - Zero em-dash (`—`) or en-dash (`–`) in visible UI text.
25
+ - Zero decisionless 3-card uniformity.
26
+ - All interactive controls must satisfy `:focus-visible` outline.
@@ -0,0 +1,46 @@
1
+ /**
2
+ * ME-DESIGN Configuration File
3
+ * Customize rule severities, score weights, and browser verification thresholds.
4
+ */
5
+
6
+ module.exports = {
7
+ // Quality Score Component Weights (sum = 1.0)
8
+ weights: {
9
+ H: 0.30, // Visual Hierarchy & Dominance
10
+ I: 0.25, // Information Density & Accessibility
11
+ G: 0.20, // Optical Geometry & Spatial Rhythm
12
+ R: 0.15, // Responsive Fluidity & Device Stability
13
+ V: 0.10 // Visual Polish & Perceptual Color
14
+ },
15
+
16
+ // Minimum passing Q-Score threshold (0-100)
17
+ minQScore: 75.0,
18
+
19
+ // Rule severity overrides ('error', 'warning', 'info', 'off')
20
+ // Note: MD001-MD005 are Hard Invariants and are required for production gating.
21
+ rules: {
22
+ MD001: 'error', // Focus Visibility (:focus-visible)
23
+ MD002: 'error', // Reduced Motion Compliance (@media prefers-reduced-motion)
24
+ MD003: 'error', // Isolated Hit-Target Area (No raw scale-95 crushing)
25
+ MD004: 'error', // Interactive State Contract (No dead buttons)
26
+ MD005: 'error', // High Contrast Focus Ring (forced-colors: active)
27
+ MD101: 'warning', // Dense Grid Tab Sequence
28
+ MD102: 'warning', // Perceptual Color Interpolation (oklch/oklab)
29
+ MD103: 'info', // Concentric Radius Math
30
+ MD104: 'warning', // Mobile Viewport Dynamic Units (100dvh)
31
+ MD105: 'warning', // Visual/DOM Sequence Scrambling
32
+ MD201: 'info' // Editorial Punctuation (hyphen vs em-dash)
33
+ },
34
+
35
+ // Headless Browser Verification Settings
36
+ browser: {
37
+ minTouchTargetPx: 44,
38
+ minContrastRatio: 4.5,
39
+ viewports: [
40
+ { name: 'Mobile', width: 390, height: 844, isMobile: true },
41
+ { name: 'Tablet', width: 820, height: 1180, isMobile: true },
42
+ { name: 'Desktop', width: 1440, height: 900, isMobile: false }
43
+ ],
44
+ colorModes: ['dark', 'light']
45
+ }
46
+ };
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "medesign",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.2.0",
4
+ "description": "Autonomous Design Engineering Toolkit & Automated Linter for AI Coding Assistants",
5
+ "main": "bin/medesign.js",
6
+ "bin": {
7
+ "medesign": "bin/medesign.js"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "presets",
12
+ "references",
13
+ "integrations",
14
+ "scripts/export-tokens.js",
15
+ "tests/linter.js",
16
+ "tests/browser-audit.js",
17
+ "tests/schemas",
18
+ "tests/visual-testbed.html",
19
+ "medesign.config.js"
20
+ ],
21
+ "scripts": {
22
+ "test": "node tests/runner.js && node tests/validate-sarif.js && node tests/test-tokens.js",
23
+ "test:unit": "node tests/runner.js",
24
+ "test:sarif": "node tests/validate-sarif.js",
25
+ "test:tokens": "node tests/test-tokens.js",
26
+ "test:browser": "node tests/runner.js --browser",
27
+ "lint": "node bin/medesign.js lint",
28
+ "audit": "node bin/medesign.js audit",
29
+ "tokens": "node bin/medesign.js tokens",
30
+ "doctor": "node bin/medesign.js doctor",
31
+ "prepublishOnly": "npm test"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/methastrategy/medesign.git"
36
+ },
37
+ "homepage": "https://github.com/methastrategy/medesign#readme",
38
+ "bugs": {
39
+ "url": "https://github.com/methastrategy/medesign/issues"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "keywords": [
45
+ "design-tokens",
46
+ "linter",
47
+ "accessibility",
48
+ "design-systems",
49
+ "oklch",
50
+ "tailwind",
51
+ "dtcg",
52
+ "sarif",
53
+ "ai-coding-assistant",
54
+ "antigravity",
55
+ "claude-code"
56
+ ],
57
+ "author": "Metha Tripraphankit (Survey Engineering & Geoinformatics, Kasetsart University)",
58
+ "license": "MIT",
59
+ "engines": {
60
+ "node": ">=18.0.0"
61
+ },
62
+ "dependencies": {},
63
+ "devDependencies": {}
64
+ }
@@ -0,0 +1,115 @@
1
+ /**
2
+ * ME-DESIGN Preset: Apple Human Interface & Product Showcase
3
+ * Version: 1.0.0
4
+ * Architecture: 3-Layer Design Tokens (Global -> Semantic -> Component)
5
+ */
6
+
7
+ :root {
8
+ /* 01. Typography */
9
+ --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
10
+ --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
11
+ --font-mono: "SF Mono", "Menlo", "Fira Code", monospace;
12
+ --tracking-heading: -0.022em;
13
+ --leading-ui: 1.28;
14
+ --leading-prose: 1.65;
15
+ --thai-headroom: 3px;
16
+
17
+ /* 02. Color Tokens (OKLCH / P3 Ready) */
18
+ --color-canvas: #000000;
19
+ --color-surface-raised: #1c1c1e;
20
+ --color-surface-inset: #161618;
21
+ --color-surface-glass: rgba(28, 28, 30, 0.72);
22
+ --color-text-primary: #f5f5f7;
23
+ --color-text-secondary: #86868b;
24
+ --color-text-tertiary: #6e6e73;
25
+ --color-border-subtle: rgba(255, 255, 255, 0.12);
26
+ --color-border-strong: rgba(255, 255, 255, 0.24);
27
+ --color-border-focus: oklch(0.62 0.22 255);
28
+
29
+ --color-accent: oklch(0.58 0.22 255);
30
+ --color-accent-hover: oklch(0.64 0.22 255);
31
+ --color-accent-fg: #ffffff;
32
+
33
+ --color-status-info: oklch(0.65 0.18 245);
34
+ --color-status-success: oklch(0.70 0.19 145);
35
+ --color-status-warning: oklch(0.78 0.18 70);
36
+ --color-status-critical: oklch(0.62 0.22 25);
37
+
38
+ /* 03. Optical Geometry */
39
+ --radius-outer: 24px;
40
+ --radius-inner: calc(var(--radius-outer) - 8px);
41
+ --radius-pill: 9999px;
42
+ --hit-target-min: 44px;
43
+
44
+ /* 04. Motion Tokens */
45
+ --duration-entry: 240ms;
46
+ --duration-exit: 160ms;
47
+ --ease-entry: cubic-bezier(0.16, 1, 0.3, 1);
48
+ --ease-exit: cubic-bezier(0.4, 0, 0.7, 0.2);
49
+
50
+ /* 05. Blur & Vibrancy */
51
+ --backdrop-blur: blur(20px) saturate(180%);
52
+ }
53
+
54
+ /* Light Mode Overrides */
55
+ @media (prefers-color-scheme: light) {
56
+ :root {
57
+ --color-canvas: #ffffff;
58
+ --color-surface-raised: #f5f5f7;
59
+ --color-surface-inset: #e8e8ed;
60
+ --color-surface-glass: rgba(255, 255, 255, 0.72);
61
+ --color-text-primary: #1d1d1f;
62
+ --color-text-secondary: #6e6e73;
63
+ --color-text-tertiary: #86868b;
64
+ --color-border-subtle: rgba(0, 0, 0, 0.08);
65
+ --color-border-strong: rgba(0, 0, 0, 0.18);
66
+ --color-accent: oklch(0.55 0.22 255);
67
+ }
68
+ }
69
+
70
+ /* Core Component Utilities */
71
+ .apple-card {
72
+ background: var(--color-surface-raised);
73
+ border: 1px solid var(--color-border-subtle);
74
+ border-radius: var(--radius-outer);
75
+ padding: 24px;
76
+ backdrop-filter: var(--backdrop-blur);
77
+ transition: transform var(--duration-entry) var(--ease-entry),
78
+ border-color var(--duration-entry) var(--ease-entry);
79
+ }
80
+
81
+ .apple-btn {
82
+ display: inline-flex;
83
+ align-items: center;
84
+ justify-content: center;
85
+ min-height: var(--hit-target-min);
86
+ padding: 0 20px;
87
+ border-radius: var(--radius-pill);
88
+ font-family: var(--font-sans);
89
+ font-size: 14px;
90
+ font-weight: 500;
91
+ text-decoration: none;
92
+ background: var(--color-accent);
93
+ color: var(--color-accent-fg);
94
+ border: none;
95
+ cursor: pointer;
96
+ outline-offset: 3px;
97
+ transition: transform var(--duration-entry) var(--ease-entry),
98
+ background var(--duration-entry) var(--ease-entry);
99
+ }
100
+
101
+ .apple-btn:focus-visible {
102
+ outline: 2px solid var(--color-border-focus);
103
+ }
104
+
105
+ .apple-btn:active .visual-surface {
106
+ transform: scale(0.97);
107
+ }
108
+
109
+ @media (prefers-reduced-motion: reduce) {
110
+ *, *::before, *::after {
111
+ animation-duration: 0.01ms !important;
112
+ animation-iteration-count: 1 !important;
113
+ transition-duration: 0.01ms !important;
114
+ }
115
+ }
@@ -0,0 +1,19 @@
1
+ # Apple Preset Guidelines (`/medesign apple`)
2
+
3
+ ## Archetype Mapping
4
+ - **Primary Archetype:** Archetype 02 (High-End Hardware Showcase)
5
+ - **Secondary Archetype:** Archetype 01 (Minimalist Editorial)
6
+
7
+ ## Invariants & Design Principles
8
+ 1. **Concentric Geometry:**
9
+ Outer card radius `24px`, inner nested radius calculated via `r_outer - padding - border = 24 - 8 - 1 = 15px`.
10
+ 2. **Pill Action Surfaces:**
11
+ Action buttons use `border-radius: 9999px` with minimum 44px hit-target padding.
12
+ 3. **Motion Profile:**
13
+ `soft-settle` (240ms entry cubic-bezier(0.16, 1, 0.3, 1), 160ms exit). Never use linear or bouncy springs.
14
+ 4. **Typography Hierarchy:**
15
+ - Display/Headlines: SF Pro Display / Inter with `-0.022em` letter-spacing.
16
+ - Body/UI Chrome: SF Pro Text / Inter with `1.28` line-height for buttons, `1.65` for editorial copy.
17
+ - Diacritic headroom: minimum 3px padding-top for Thai vowel marks (`่ ้ ๊ ๋ ์`).
18
+ 5. **Color & Vibrancy:**
19
+ OLED Pure Black `#000000` canvas in dark mode, frosted blur `backdrop-filter: blur(20px) saturate(180%)`, Cupertino Blue accent `oklch(0.58 0.22 255)`.