agent-design-skills 1.1.0 → 1.1.1
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/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Command as
|
|
2
|
+
import{Command as rt}from"commander";import*as k from"@clack/prompts";import w from"picocolors";import E from"pathe";import q from"fs-extra";import D from"fs-extra";import T from"pathe";import{fileURLToPath as ze}from"url";import N from"fs-extra";import te from"pathe";function $e(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)%7-3}function ae(e,t,r){return t==="dark"?Math.max(r==="primary"?.97:r==="secondary"?.8:.68,e):Math.min(r==="primary"?.15:r==="secondary"?.34:.44,e)}var V={"dark-obsidian-technical":{A:{display:"Geist",sans:"Instrument Sans",mono:"Geist Mono"},B:{display:"Sora",sans:"Public Sans",mono:"Fira Code"},C:{display:"Satoshi",sans:"General Sans",mono:"Space Mono"}},"swiss-typographic-grid":{A:{display:"Cabinet Grotesk",sans:"Space Grotesk",mono:"Space Mono"},B:{display:"Syne",sans:"Public Sans",mono:"Fragment Mono"},C:{display:"Sora",sans:"General Sans",mono:"DM Mono"}},"kinetic-industrial-mono":{A:{display:"JetBrains Mono",sans:"IBM Plex Sans",mono:"JetBrains Mono"},B:{display:"Fira Code",sans:"Fragment Mono",mono:"Fira Code"},C:{display:"Space Mono",sans:"Chivo",mono:"Space Mono"}},"bento-modular-system":{A:{display:"Satoshi",sans:"General Sans",mono:"Geist Mono"},B:{display:"Sora",sans:"Public Sans",mono:"Fira Code"},C:{display:"Outfit",sans:"DM Sans",mono:"JetBrains Mono"}},"spatial-glass-visionos":{A:{display:"Outfit",sans:"DM Sans",mono:"Fragment Mono"},B:{display:"Sora",sans:"Public Sans",mono:"Geist Mono"},C:{display:"Cabinet Grotesk",sans:"Switzer",mono:"Inconsolata"}},"editorial-serif-paper":{A:{display:"Newsreader",sans:"Work Sans",mono:"Fragment Mono"},B:{display:"Fraunces",sans:"Merriweather Sans",mono:"IBM Plex Mono"},C:{display:"Bespoke Serif",sans:"Switzer",mono:"Inconsolata"}},"quiet-luxury-atelier":{A:{display:"Cormorant Garamond",sans:"DM Sans",mono:"Fragment Mono"},B:{display:"Fraunces",sans:"Work Sans",mono:"IBM Plex Mono"},C:{display:"Bespoke Serif",sans:"Switzer",mono:"Space Mono"}},"warm-artisan-craft":{A:{display:"Fraunces",sans:"Cabinet Grotesk",mono:"DM Mono"},B:{display:"Source Serif 4",sans:"Public Sans",mono:"Fragment Mono"},C:{display:"Newsreader",sans:"General Sans",mono:"Space Mono"}},"japanese-minimal-zen":{A:{display:"Noto Serif Display",sans:"Work Sans",mono:"DM Mono"},B:{display:"Newsreader",sans:"Public Sans",mono:"Fragment Mono"},C:{display:"Bespoke Serif",sans:"Sora",mono:"JetBrains Mono"}},"scandinavian-warm-minimal":{A:{display:"Familjen Grotesk",sans:"DM Sans",mono:"Fragment Mono"},B:{display:"Sora",sans:"Public Sans",mono:"IBM Plex Mono"},C:{display:"Switzer",sans:"Work Sans",mono:"Space Mono"}},"neo-brutalism":{A:{display:"Space Grotesk",sans:"Syne",mono:"Space Mono"},B:{display:"Archivo Black",sans:"Archivo",mono:"DM Mono"},C:{display:"Clash Display",sans:"Cabinet Grotesk",mono:"Fragment Mono"}},"retro-tactile-analog":{A:{display:"Space Mono",sans:"Chivo",mono:"Space Mono"},B:{display:"Syne",sans:"Public Sans",mono:"Fira Code"},C:{display:"Archivo",sans:"DM Mono",mono:"DM Mono"}},"y2k-acid-cyber":{A:{display:"Syne",sans:"Chakra Petch",mono:"Space Mono"},B:{display:"Clash Display",sans:"Space Grotesk",mono:"Fira Code"},C:{display:"Cabinet Grotesk",sans:"Public Sans",mono:"JetBrains Mono"}},"playful-clay-consumer":{A:{display:"Bricolage Grotesque",sans:"Fredoka",mono:"Space Mono"},B:{display:"Outfit",sans:"DM Sans",mono:"Fragment Mono"},C:{display:"Cabinet Grotesk",sans:"Switzer",mono:"DM Mono"}},"vaporwave-crt-terminal":{A:{display:"VT323",sans:"Fira Code",mono:"Fira Code"},B:{display:"Chakra Petch",sans:"Space Mono",mono:"Space Mono"},C:{display:"Syne",sans:"DM Mono",mono:"DM Mono"}},"high-trust-fintech-clarity":{A:{display:"Sora",sans:"Public Sans",mono:"Fira Code"},B:{display:"General Sans",sans:"Instrument Sans",mono:"JetBrains Mono"},C:{display:"Cabinet Grotesk",sans:"Switzer",mono:"Space Mono"}},"clinical-biotech-precision":{A:{display:"Instrument Sans",sans:"Public Sans",mono:"IBM Plex Mono"},B:{display:"Sora",sans:"General Sans",mono:"Fragment Mono"},C:{display:"Cabinet Grotesk",sans:"Work Sans",mono:"Fira Code"}},"civic-govtech-accessible":{A:{display:"Atkinson Hyperlegible",sans:"Public Sans",mono:"Fragment Mono"},B:{display:"Sora",sans:"DM Sans",mono:"IBM Plex Mono"},C:{display:"Work Sans",sans:"General Sans",mono:"Fira Code"}}},oe={calm:{ease:"cubic-bezier(0.25, 1, 0.5, 1)",easeSpring:"cubic-bezier(0.25, 1, 0.5, 1)",durationFast:"140ms",durationNormal:"240ms"},"urgent-precise":{ease:"cubic-bezier(0.16, 1, 0.3, 1)",easeSpring:"cubic-bezier(0.16, 1, 0.3, 1)",durationFast:"110ms",durationNormal:"180ms"},"playful-tactile":{ease:"cubic-bezier(0.34, 1.56, 0.64, 1)",easeSpring:"cubic-bezier(0.22, 1.35, 0.36, 1)",durationFast:"120ms",durationNormal:"240ms"},authoritative:{ease:"cubic-bezier(0.2, 0, 0, 1)",easeSpring:"cubic-bezier(0.2, 0, 0, 1)",durationFast:"120ms",durationNormal:"200ms"}},Ie={"instrument sans":"wght@400;500;600;700","space grotesk":"wght@400;500;600;700",sora:"wght@400;600",fraunces:"opsz,wght@9..144,400..700","cormorant garamond":"wght@500;600;700","jetbrains mono":"wght@400;500","fira code":"wght@400;500","ibm plex mono":"wght@400;500","ibm plex sans":"wght@400;500;600","space mono":"wght@400;700","public sans":"wght@400;500;600","dm sans":"wght@400;500;600","dm mono":"wght@400;500","work sans":"wght@400;500;600","atkinson hyperlegible":"wght@400;700","bricolage grotesque":"wght@400;600;700",syne:"wght@600;700","syne mono":"wght@400",vt323:"wght@400",newsreader:"ital,opsz,wght@0,6..72,400..700;1,6..72,400","noto serif display":"wght@400;600","familjen grotesk":"wght@400;600",geist:"wght@400;500;600;700","geist mono":"wght@400;500","chakra petch":"wght@400;600",fredoka:"wght@400;600","archivo black":"wght@400",archivo:"wght@400;600",chivo:"wght@400;600",inconsolata:"wght@400;600","merriweather sans":"wght@400;600","source serif 4":"opsz,wght@8..60,400..700"},ie={"cabinet grotesk":"cabinet-grotesk@500,700,800","general sans":"general-sans@400,500,600",satoshi:"satoshi@400,500,700",switzer:"switzer@400,500,600","bespoke serif":"bespoke-serif@400,600","clash display":"clash-display@500,600,700"};function P(e){if(!e)return"";let t=e.match(/["']([^"']+)["']/);return t?t[1]:e.split(",")[0].trim()}async function Z(e){let t=te.resolve(e,"tokens.css"),r=te.resolve(e,"tokens.json"),a=te.resolve(e,"package.json"),g,f,y,o;if(await N.pathExists(t)){let n=await N.readFile(t,"utf-8"),l=n.match(/--font-display:\s*([^;]+);/),c=n.match(/--font-sans:\s*([^;]+);/),m=n.match(/--font-mono:\s*([^;]+);/),p=n.match(/@import\s+url\(['"]?([^'")]+)['"]?\);/);if(l&&(g=l[1].trim()),c&&(f=c[1].trim()),m&&(y=m[1].trim()),p&&(o=p[1].trim()),g||f||y)return{display:g,sans:f,mono:y,importUrl:o,source:"preserved"}}if(await N.pathExists(r))try{let l=(await N.readJSON(r)).variables||{};if(l["--font-display"]||l["--font-sans"]||l["--font-mono"])return{display:l["--font-display"],sans:l["--font-sans"],mono:l["--font-mono"],source:"preserved"}}catch{}if(await N.pathExists(a))try{let n=await N.readJSON(a),l={...n.dependencies||{},...n.devDependencies||{}},c=Object.keys(l).filter(m=>m.startsWith("@fontsource/"));if(c.length>0){let m=c.map(p=>p.replace("@fontsource/","").split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "));return{display:m[0],sans:m[1]||m[0],mono:m.find(p=>p.toLowerCase().includes("mono")||p.toLowerCase().includes("code"))||"monospace",source:"package.json"}}}catch{}return null}function De(e){if(!e)return null;let t=["Geist Mono","Geist","Instrument Sans","Space Grotesk","Space Mono","Cabinet Grotesk","General Sans","Satoshi","Switzer","Bespoke Serif","Fraunces","Cormorant Garamond","Newsreader","Noto Serif Display","Source Serif 4","Familjen Grotesk","Sora","Public Sans","Work Sans","Atkinson Hyperlegible","Bricolage Grotesque","Syne Mono","Syne","JetBrains Mono","Fira Code","IBM Plex Mono","IBM Plex Sans","DM Sans","DM Mono","Outfit","VT323","Archivo"],r=e.toLowerCase();for(let a of t)if(new RegExp(`\\b(?:use|with|in|font:?)\\s+${a.toLowerCase()}\\b|\\b${a.toLowerCase()}\\s+(?:font|typography)\\b`,"i").test(e)||r.includes(`use ${a.toLowerCase()}`)){let f=/mono|code|vt323/i.test(a),y=/serif|garamond|fraunces|newsreader|cinzel/i.test(a);return f?{mono:a,source:"custom"}:y?{display:a,source:"custom"}:{sans:a,display:a,source:"custom"}}return null}function re(e,t){if(!e)return"";if(e.includes(",")&&(e.includes("serif")||e.includes("sans-serif")||e.includes("monospace")))return e;let r=e.replace(/['"]/g,"").trim(),a=r.toLowerCase(),g=t==="mono"||/mono|code|vt323|inconsolata/i.test(a),f=t==="display"&&/serif|garamond|fraunces|newsreader|cinzel/i.test(a);return g?`'${r}', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`:f?`'${r}', Georgia, "Times New Roman", serif`:`'${r}', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`}function Be(e,t,r,a){let g=[P(e),P(t),P(r)].filter(Boolean),f=Array.from(new Set(g)),y=[],o=[];for(let l of f){let c=l.toLowerCase();if(ie[c])y.push(`@import url('https://api.fontshare.com/v2/css?f[]=${ie[c]}&display=swap');`);else{if(c==="monospace"||c==="serif"||c==="sans-serif"||c==="customuserfont")continue;{let m=l.replace(/\s+/g,"+"),p=Ie[c]||"wght@400;500;600;700";o.push(`family=${m}:${p}`)}}}let n=[];return a&&!n.includes(`@import url('${a}');`)&&n.push(`@import url('${a}');`),n.push(...y),o.length>0&&n.push(`@import url('https://fonts.googleapis.com/css2?${o.join("&")}&display=swap');`),n.length>0?n.join(`
|
|
3
3
|
`)+`
|
|
4
4
|
|
|
5
|
-
`:""}function le(e){let{archetype:t,feeling:r,radius:a,blur:g,projectName:f}=e,y=$e(f),o="dark",n=250,l=.12,c=.18,
|
|
5
|
+
`:""}function le(e){let{archetype:t,feeling:r,radius:a,blur:g,projectName:f}=e,y=$e(f),o="dark",n=250,l=.12,c=.18,m=.09,p=.28,s="oklch(0.65 0.20 250)",i="oklch(0.65 0.20 250 / 0.15)",d="oklch(0.70 0.22 250)",u=.96,v=.68,b=.52,S='"Geist", "Instrument Sans", sans-serif',C='"Geist", "Instrument Sans", sans-serif',A='"Geist Mono", "SF Mono", monospace',$=1.25;t==="editorial-serif-paper"?(o="light",n=75,l=.97,c=.99,m=.92,p=.85,s="oklch(0.48 0.18 25)",i="oklch(0.48 0.18 25 / 0.12)",d="oklch(0.42 0.20 25)",u=.2,v=.48,b=.62,S='"Newsreader", Georgia, serif',C='"Work Sans", sans-serif',A='"Fragment Mono", monospace'):t==="neo-brutalism"?(o="light",n=90,l=.97,c=1,m=.9,p=.12,s="oklch(0.85 0.28 130)",i="oklch(0.85 0.28 130 / 0.25)",d="oklch(0.88 0.30 130)",u=.12,v=.38,b=.5,S='"Space Grotesk", sans-serif',C='"Syne", sans-serif',A='"Space Mono", monospace',$=1.333):t==="swiss-typographic-grid"?(o="light",n=260,l=.98,c=1,m=.92,p=.12,s="oklch(0.55 0.22 25)",i="oklch(0.55 0.22 25 / 0.12)",d="oklch(0.50 0.24 25)",u=.12,v=.42,b=.55,S='"Cabinet Grotesk", sans-serif',C='"Space Grotesk", sans-serif',A='"Space Mono", monospace'):t==="kinetic-industrial-mono"?(o="dark",n=240,l=.1,c=.15,m=.07,p=.26,s="oklch(0.76 0.18 70)",i="oklch(0.76 0.18 70 / 0.15)",d="oklch(0.80 0.20 70)",u=.95,v=.68,b=.48,S='"JetBrains Mono", monospace',C='"IBM Plex Sans", sans-serif',A='"JetBrains Mono", monospace',$=1.2):t==="bento-modular-system"?(o="dark",n=255,l=.12,c=.17,m=.09,p=.28,s="oklch(0.64 0.22 255)",i="oklch(0.64 0.22 255 / 0.15)",d="oklch(0.68 0.24 255)",u=.96,v=.68,b=.5,S='"Satoshi", sans-serif',C='"General Sans", sans-serif',A='"Geist Mono", monospace'):t==="spatial-glass-visionos"?(o="dark",n=260,l=.1,c=.18,m=.08,p=.35,s="oklch(0.72 0.18 200)",i="oklch(0.72 0.18 200 / 0.18)",d="oklch(0.76 0.20 200)",u=.98,v=.72,b=.54,S='"Outfit", sans-serif',C='"DM Sans", sans-serif',A='"Fragment Mono", monospace'):t==="quiet-luxury-atelier"?(o="light",n=70,l=.97,c=.99,m=.92,p=.86,s="oklch(0.50 0.04 60)",i="oklch(0.50 0.04 60 / 0.12)",d="oklch(0.45 0.05 60)",u=.18,v=.46,b=.6,S='"Cormorant Garamond", serif',C='"DM Sans", sans-serif',A='"Fragment Mono", monospace'):t==="warm-artisan-craft"?(o="light",n=80,l=.96,c=.98,m=.9,p=.85,s="oklch(0.58 0.16 40)",i="oklch(0.58 0.16 40 / 0.14)",d="oklch(0.52 0.18 40)",u=.24,v=.5,b=.62,S='"Fraunces", serif',C='"Cabinet Grotesk", sans-serif',A='"DM Mono", monospace'):t==="japanese-minimal-zen"?(o="light",n=90,l=.97,c=.99,m=.91,p=.88,s="oklch(0.22 0.01 250)",i="oklch(0.22 0.01 250 / 0.10)",d="oklch(0.16 0.01 250)",u=.2,v=.48,b=.62,S='"Noto Serif Display", serif',C='"Work Sans", sans-serif',A='"DM Mono", monospace'):t==="scandinavian-warm-minimal"?(o="light",n=85,l=.97,c=.99,m=.91,p=.86,s="oklch(0.54 0.14 235)",i="oklch(0.54 0.14 235 / 0.14)",d="oklch(0.48 0.16 235)",u=.2,v=.48,b=.6,S='"Familjen Grotesk", sans-serif',C='"DM Sans", sans-serif',A='"Fragment Mono", monospace'):t==="retro-tactile-analog"?(o="dark",n=240,l=.2,c=.27,m=.14,p=.36,s="oklch(0.68 0.24 45)",i="oklch(0.68 0.24 45 / 0.18)",d="oklch(0.72 0.26 45)",u=.96,v=.72,b=.55,S='"Space Mono", monospace',C='"Chivo", sans-serif',A='"Space Mono", monospace',$=1.2):t==="y2k-acid-cyber"?(o="dark",n=290,l=.08,c=.14,m=.05,p=.3,s="oklch(0.88 0.28 135)",i="oklch(0.88 0.28 135 / 0.20)",d="oklch(0.92 0.30 135)",u=.98,v=.74,b=.55,S='"Syne", sans-serif',C='"Chakra Petch", sans-serif',A='"Space Mono", monospace',$=1.333):t==="playful-clay-consumer"?(o="light",n=280,l=.97,c=.99,m=.92,p=.88,s="oklch(0.66 0.22 295)",i="oklch(0.66 0.22 295 / 0.15)",d="oklch(0.70 0.24 295)",u=.2,v=.48,b=.6,S='"Bricolage Grotesque", sans-serif',C='"Fredoka", sans-serif',A='"Space Mono", monospace'):t==="vaporwave-crt-terminal"?(o="dark",n=290,l=.09,c=.14,m=.06,p=.28,s="oklch(0.78 0.18 200)",i="oklch(0.78 0.18 200 / 0.15)",d="oklch(0.82 0.20 200)",u=.96,v=.7,b=.5,S='"VT323", monospace',C='"Fira Code", monospace',A='"Fira Code", monospace',$=1.2):t==="high-trust-fintech-clarity"?(o="light",n=245,l=.98,c=1,m=.93,p=.86,s="oklch(0.56 0.18 245)",i="oklch(0.56 0.18 245 / 0.12)",d="oklch(0.50 0.20 245)",u=.14,v=.44,b=.58,S='"Sora", sans-serif',C='"Public Sans", sans-serif',A='"Fira Code", monospace'):t==="clinical-biotech-precision"?(o="light",n=220,l=.98,c=1,m=.92,p=.85,s="oklch(0.68 0.16 215)",i="oklch(0.68 0.16 215 / 0.12)",d="oklch(0.62 0.18 215)",u=.14,v=.42,b=.56,S='"Instrument Sans", sans-serif',C='"Public Sans", sans-serif',A='"IBM Plex Mono", monospace'):t==="civic-govtech-accessible"&&(o="light",n=260,l=.99,c=1,m=.92,p=.3,s="oklch(0.42 0.16 245)",i="oklch(0.42 0.16 245 / 0.12)",d="oklch(0.36 0.18 245)",u=.12,v=.38,b=.5,S='"Atkinson Hyperlegible", sans-serif',C='"Public Sans", sans-serif',A='"Fragment Mono", monospace');let x=((n+y)%360+360)%360,Ce=ae(u,o,"primary"),Ae=ae(o==="dark"?.8:.34,o,"secondary"),Me=ae(v,o,"muted"),U="6px",j="4px",H="4px";a==="sharp"?(U="0px",j="0px",H="0px"):a==="medium"?(U="10px",j="6px",H="6px"):a==="high"?(U="16px",j="10px",H="8px"):a==="pill"&&(U="9999px",j="9999px",H="9999px");let X="8px";g==="flat"?X="0px":g==="deep-glass"&&(X="20px");let J=oe[r]||oe["urgent-precise"],Fe=J.ease,Ee=J.easeSpring,Pe=J.durationFast,Te=J.durationNormal,Q="0 1px 2px 0 oklch(0 0 0 / 0.45), 0 0 0 1px var(--border-hairline)",ee="0 4px 12px 0 oklch(0 0 0 / 0.50), 0 0 0 1px var(--border-hairline)";o==="light"&&t!=="neo-brutalism"?(Q="0 1px 3px 0 oklch(0.20 0.012 50 / 0.06), 0 0 0 1px var(--border-hairline)",ee="0 6px 16px -2px oklch(0.20 0.012 50 / 0.08), 0 0 0 1px var(--border-hairline)"):t==="neo-brutalism"&&(Q="3px 3px 0px 0px oklch(0.12 0.005 260)",ee="6px 6px 0px 0px oklch(0.12 0.005 260)");let I=V[t]||V["dark-obsidian-technical"],O=I.A.display,R=I.A.sans,G=I.A.mono;e.fontOverride?.source==="preserved"&&(e.fontMode==="keep"||!e.fontMode)?(e.fontOverride.display&&(O=P(e.fontOverride.display)),e.fontOverride.sans&&(R=P(e.fontOverride.sans)),e.fontOverride.mono&&(G=P(e.fontOverride.mono))):e.fontMode==="B"?(O=I.B.display,R=I.B.sans,G=I.B.mono):e.fontMode==="C"?(O=I.C.display,R=I.C.sans,G=I.C.mono):e.fontOverride&&(e.fontOverride.display&&(O=P(e.fontOverride.display)),e.fontOverride.sans&&(R=P(e.fontOverride.sans)),e.fontOverride.mono&&(G=P(e.fontOverride.mono)));let L=De(e.customDirection);L&&e.fontMode!=="keep"&&(L.display&&(O=L.display),L.sans&&(R=L.sans),L.mono&&(G=L.mono)),S=re(O,"display"),C=re(R,"sans"),A=re(G,"mono");let h={"--bg-canvas":`oklch(${l} 0.015 ${x})`,"--bg-elevated":`oklch(${c} 0.015 ${x})`,"--bg-surface-active":`oklch(${c+(o==="dark"?.04:-.04)} 0.018 ${x})`,"--bg-glass":`oklch(${c} 0.015 ${x} / 0.72)`,"--bg-sunken":`oklch(${m} 0.012 ${x})`,"--text-primary":`oklch(${Ce} 0.005 ${x})`,"--text-secondary":`oklch(${Ae} 0.010 ${x})`,"--text-muted":`oklch(${Me} 0.015 ${x})`,"--text-subtle":`oklch(${b} 0.018 ${x})`,"--text-inverse":o==="dark"?`oklch(0.12 0.015 ${x})`:`oklch(0.98 0.005 ${x})`,"--accent-primary":s,"--accent-subtle":i,"--accent-hover":d,"--border-hairline":o==="dark"?"oklch(1 0 0 / 0.07)":"oklch(0 0 0 / 0.07)","--border-subtle":o==="dark"?"oklch(1 0 0 / 0.04)":"oklch(0 0 0 / 0.04)","--border-focus":`oklch(0.65 0.20 ${x} / 0.75)`,"--highlight-specular":o==="dark"?"oklch(1 0 0 / 0.18)":"oklch(1 0 0 / 0.60)","--status-success":"oklch(0.72 0.16 145)","--status-warning":"oklch(0.78 0.14 75)","--status-danger":"oklch(0.65 0.22 25)","--status-info":"oklch(0.70 0.15 230)","--radius-outer":U,"--radius-inner":j,"--radius-badge":H,"--surface-blur":X,"--shadow-surface":Q,"--shadow-elevated":ee,"--section-py-tight":"clamp(2.5rem, 4vw, 4rem)","--section-py-normal":"clamp(4.5rem, 7vw, 6.5rem)","--section-py-breathing":"clamp(7rem, 12vw, 11rem)","--container-max":"1280px","--font-display":S,"--font-sans":C,"--font-mono":A,"--text-xs":"0.8125rem","--text-sm":"0.9375rem","--text-base":"1.0625rem","--text-lg":"1.25rem","--text-xl":`${(1.25*$).toFixed(3)}rem`,"--text-2xl":`${(1.25*Math.pow($,2)).toFixed(3)}rem`,"--text-3xl":`${(1.25*Math.pow($,3)).toFixed(3)}rem`,"--text-4xl":`${(1.25*Math.pow($,4)).toFixed(3)}rem`,"--weight-heading":"600","--weight-body":"400","--weight-mono":"500","--ease-primary":Fe,"--ease-spring":Ee,"--duration-fast":Pe,"--duration-normal":Te};return{css:`${Be(O,R,G,e.fontOverride?.importUrl)}/* =============================================================================
|
|
6
6
|
AGENT DESIGN SKILLS \u2014 TOKEN CONTRACT (v1.1)
|
|
7
7
|
Archetype: ${t}
|
|
8
8
|
Polarity: ${o}
|
|
@@ -20,6 +20,7 @@ import{Command as et}from"commander";import*as k from"@clack/prompts";import w f
|
|
|
20
20
|
|
|
21
21
|
/* Text & Foregrounds */
|
|
22
22
|
--text-primary: ${h["--text-primary"]};
|
|
23
|
+
--text-secondary: ${h["--text-secondary"]};
|
|
23
24
|
--text-muted: ${h["--text-muted"]};
|
|
24
25
|
--text-subtle: ${h["--text-subtle"]};
|
|
25
26
|
--text-inverse: ${h["--text-inverse"]};
|
|
@@ -81,15 +82,16 @@ import{Command as et}from"commander";import*as k from"@clack/prompts";import w f
|
|
|
81
82
|
============================================================================= */
|
|
82
83
|
|
|
83
84
|
[data-theme="light"], .light {
|
|
84
|
-
--bg-canvas: oklch(0.97 0.015 ${
|
|
85
|
-
--bg-elevated: oklch(0.99 0.015 ${
|
|
86
|
-
--bg-surface-active: oklch(0.95 0.018 ${
|
|
87
|
-
--bg-glass: oklch(0.99 0.015 ${
|
|
88
|
-
--bg-sunken: oklch(0.92 0.012 ${
|
|
89
|
-
--text-primary: oklch(0.
|
|
90
|
-
--text-
|
|
91
|
-
--text-
|
|
92
|
-
--text-
|
|
85
|
+
--bg-canvas: oklch(0.97 0.015 ${x});
|
|
86
|
+
--bg-elevated: oklch(0.99 0.015 ${x});
|
|
87
|
+
--bg-surface-active: oklch(0.95 0.018 ${x});
|
|
88
|
+
--bg-glass: oklch(0.99 0.015 ${x} / 0.72);
|
|
89
|
+
--bg-sunken: oklch(0.92 0.012 ${x});
|
|
90
|
+
--text-primary: oklch(0.15 0.015 ${x});
|
|
91
|
+
--text-secondary: oklch(0.34 0.015 ${x});
|
|
92
|
+
--text-muted: oklch(0.44 0.015 ${x});
|
|
93
|
+
--text-subtle: oklch(0.55 0.018 ${x});
|
|
94
|
+
--text-inverse: oklch(0.98 0.005 ${x});
|
|
93
95
|
--border-hairline: oklch(0 0 0 / 0.07);
|
|
94
96
|
--border-subtle: oklch(0 0 0 / 0.04);
|
|
95
97
|
--highlight-specular: oklch(1 0 0 / 0.60);
|
|
@@ -98,15 +100,16 @@ import{Command as et}from"commander";import*as k from"@clack/prompts";import w f
|
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
[data-theme="dark"], .dark {
|
|
101
|
-
--bg-canvas: oklch(0.12 0.015 ${
|
|
102
|
-
--bg-elevated: oklch(0.18 0.015 ${
|
|
103
|
-
--bg-surface-active: oklch(0.22 0.018 ${
|
|
104
|
-
--bg-glass: oklch(0.18 0.015 ${
|
|
105
|
-
--bg-sunken: oklch(0.09 0.012 ${
|
|
106
|
-
--text-primary: oklch(0.
|
|
107
|
-
--text-
|
|
108
|
-
--text-
|
|
109
|
-
--text-
|
|
103
|
+
--bg-canvas: oklch(0.12 0.015 ${x});
|
|
104
|
+
--bg-elevated: oklch(0.18 0.015 ${x});
|
|
105
|
+
--bg-surface-active: oklch(0.22 0.018 ${x});
|
|
106
|
+
--bg-glass: oklch(0.18 0.015 ${x} / 0.72);
|
|
107
|
+
--bg-sunken: oklch(0.09 0.012 ${x});
|
|
108
|
+
--text-primary: oklch(0.97 0.005 ${x});
|
|
109
|
+
--text-secondary: oklch(0.80 0.010 ${x});
|
|
110
|
+
--text-muted: oklch(0.68 0.015 ${x});
|
|
111
|
+
--text-subtle: oklch(0.52 0.018 ${x});
|
|
112
|
+
--text-inverse: oklch(0.12 0.015 ${x});
|
|
110
113
|
--border-hairline: oklch(1 0 0 / 0.07);
|
|
111
114
|
--border-subtle: oklch(1 0 0 / 0.04);
|
|
112
115
|
--highlight-specular: oklch(1 0 0 / 0.18);
|
|
@@ -147,6 +150,17 @@ h1, h2, h3, h4 {
|
|
|
147
150
|
font-feature-settings: "tnum" 1, "lnum" 1, "zero" 0;
|
|
148
151
|
}
|
|
149
152
|
|
|
153
|
+
/* Prevent Tailwind text-xs/text-sm from shrinking text into unreadable micro-print */
|
|
154
|
+
.text-xs {
|
|
155
|
+
font-size: 0.8125rem !important; /* 13px absolute minimum floor */
|
|
156
|
+
line-height: 1.35 !important;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.text-sm {
|
|
160
|
+
font-size: 0.9375rem !important; /* 15px comfortable sub-label */
|
|
161
|
+
line-height: 1.45 !important;
|
|
162
|
+
}
|
|
163
|
+
|
|
150
164
|
/* Motion & Physics Classes */
|
|
151
165
|
.view-transition {
|
|
152
166
|
animation: ads-view-enter var(--duration-normal) var(--ease-primary) both;
|
|
@@ -171,12 +185,26 @@ h1, h2, h3, h4 {
|
|
|
171
185
|
transform: scale(0.96);
|
|
172
186
|
}
|
|
173
187
|
|
|
188
|
+
/* Tactile Card Hover & Tap Physics */
|
|
189
|
+
.glass-panel, .surface-card, [data-interactive-card="true"] {
|
|
190
|
+
transition: transform var(--duration-fast) var(--ease-spring, var(--ease-primary)), border-color var(--duration-fast) var(--ease-primary), box-shadow var(--duration-fast) var(--ease-primary);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.glass-panel:hover, .surface-card:hover, [data-interactive-card="true"]:hover {
|
|
194
|
+
transform: translateY(-2px) scale(1.008);
|
|
195
|
+
border-color: var(--highlight-specular);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.glass-panel:active, .surface-card:active, [data-interactive-card="true"]:active {
|
|
199
|
+
transform: scale(0.99);
|
|
200
|
+
}
|
|
201
|
+
|
|
174
202
|
/* Focus visibility reset adhering to technical hairline styling */
|
|
175
203
|
:focus-visible {
|
|
176
204
|
outline: 2px solid var(--border-focus);
|
|
177
205
|
outline-offset: 1px;
|
|
178
206
|
}
|
|
179
|
-
`,json:{version:"1.1.0",archetype:t,polarity:o,feeling:r,folderJitter:y,variables:h},variables:h}}function
|
|
207
|
+
`,json:{version:"1.1.0",archetype:t,polarity:o,feeling:r,folderJitter:y,variables:h},variables:h}}function Oe(e){let r=e.indexOf("## 5. Component Inventory");return r!==-1?e.slice(r).trim():null}function ce(e,t){let{projectName:r,archetype:a,customDirection:g="Needs to feel like a high-precision developer settlement console, crisp 1px hairlines, zero marketing fluff",productBrief:f="High-precision operational workspace and data reconciliation platform"}=e,y="Dark";new Set(["editorial-serif-paper","neo-brutalism","swiss-typographic-grid","quiet-luxury-atelier","warm-artisan-craft","japanese-minimal-zen","scandinavian-warm-minimal","playful-clay-consumer","high-trust-fintech-clarity","clinical-biotech-precision","civic-govtech-accessible"]).has(a)&&(y="Light");let n="Desktop-First",l="Direct, Forensic, Unhurried",c="Row 4,812: $412.50 FX discrepancy between Stripe payout and nodal settlement.",m="Oops! Something went wrong with your reconciliation. Try again!",p="Precision single-sweep scanline pulse over the batch header upon reconciliation commitment (180ms ease, zero overshoot).";a==="editorial-serif-paper"||a==="quiet-luxury-atelier"?(l="Literary, Dispassionate, Deeply-Researched",c="Vault allocation audited against physical treasury bills with verified CUSIP numbers.",m="Supercharge your treasury with our smart AI dashboard! \u{1F680}",p="Gentle 240ms ink-soak underline expansion upon section entry."):a==="neo-brutalism"&&(y="Light",l="Stark, Punchy, Tactile",c="Pipeline output committed. Hash: 0x8F2D. 0 warnings.",m="Enjoy our smooth and seamless creative workflow experience.",p="Hard tactile button depress translating 3px and collapsing shadow.");let s=`# Design Specification & Token Contract
|
|
180
208
|
|
|
181
209
|
**STATUS:** ACTIVE
|
|
182
210
|
**BRIEF STATUS:** LOCKED
|
|
@@ -226,7 +254,7 @@ ${f} for ${r}.
|
|
|
226
254
|
|
|
227
255
|
| Sounds Like | Never Sounds Like |
|
|
228
256
|
|---|---|
|
|
229
|
-
| "${c}" | "${
|
|
257
|
+
| "${c}" | "${m}" |
|
|
230
258
|
| "12 batches pending verification. Run reconciliation sequence." | "Say goodbye to financial headaches with our smart AI dashboard!" |
|
|
231
259
|
| "Batch \`0x8F2D\`: Merkle root verified against append-only log." | "One-click simplicity for all your enterprise needs." |
|
|
232
260
|
|
|
@@ -256,11 +284,11 @@ All components MUST consume these semantic tokens directly. Never duplicate raw
|
|
|
256
284
|
- **Zero Unrequested Badges Law:** NEVER place pill badges, status chips, or uppercase tag boxes inside app headers, navbars, hero sections, or card headers (e.g., ban \`PRO v2.4\`, \`STABLE\`, \`SUB-10MS\`, \`60 FPS\`). Cards must use plain text headings or no header at all. Tags/badges are ONLY permitted inside repeating data table cells or list rows to indicate item-level record status (e.g., \`Settled\`, \`Discrepancy\`, \`Active\`), strictly capped at max 1 badge per row.
|
|
257
285
|
- **Numeric & Tabular Typography Law:** NEVER use coding monospace fonts (\`--font-mono\`) or \`slashed-zero\` on hero numbers, counters, or KPI figures. Always use \`var(--font-display)\` or \`var(--font-sans)\` with \`font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1, "zero" 0;\` so digits have clean, open-oval zeros (\`0\`) with zero horizontal jitter. Reserve \`var(--font-mono)\` strictly for code snippets, file paths, or git hashes.
|
|
258
286
|
- **Badge & Indicator Discipline:** Eyebrows must stand alone as plain monospace text. Colored status dots are forbidden unless tied to a live connection status.
|
|
259
|
-
- **Signature Moment:** ${
|
|
260
|
-
`;if(t){let
|
|
287
|
+
- **Signature Moment:** ${p}
|
|
288
|
+
`;if(t){let d=Oe(t);if(d)return`${s}
|
|
261
289
|
---
|
|
262
290
|
|
|
263
|
-
${
|
|
291
|
+
${d}
|
|
264
292
|
`}return`${s}
|
|
265
293
|
---
|
|
266
294
|
|
|
@@ -304,13 +332,13 @@ ${p}
|
|
|
304
332
|
|
|
305
333
|
- [ ] **Tabular Alignment Check:** Ensure all numeric columns right-align with zero jitter.
|
|
306
334
|
- [ ] **Keyboard Navigation:** Bind keyboard shortcut navigation for data grid rows.
|
|
307
|
-
`}import M from"fs-extra";import F from"pathe";import{fileURLToPath as
|
|
335
|
+
`}import M from"fs-extra";import F from"pathe";import{fileURLToPath as Re}from"url";async function Ge(){let e=Re(import.meta.url),t=F.dirname(e),r=[F.resolve(t,"../registry"),F.resolve(t,"../../registry"),F.resolve(t,"../../../registry"),F.resolve(process.cwd(),"registry")];for(let a of r)if(await M.pathExists(a))return a;return F.resolve(process.cwd(),"registry")}function de(e,t){return e.replace(/\{\{ARCHETYPE_NAME\}\}/g,t.archetype).replace(/\{\{TOKENS_PATH\}\}/g,"./tokens.css").replace(/\{\{DESIGN_DOC_PATH\}\}/g,"./DESIGN.md").replace(/\{\{PRODUCT_NAME\}\}/g,t.projectName).replace(/\{\{PRODUCT_BRIEF\}\}/g,t.productBrief||"High-precision operational workspace and data reconciliation platform")}async function pe(e,t,r){let a=[],f=await M.pathExists(F.resolve(e,".agents"))?".agents":".agent",y=F.resolve(e,f,"rules");await M.ensureDir(y);let o=F.resolve(y,"design-core.md"),n=`---
|
|
308
336
|
trigger: always_on
|
|
309
337
|
description: "Always-On Core Design Governance Rule (v1.0)"
|
|
310
338
|
---
|
|
311
339
|
|
|
312
340
|
${r}
|
|
313
|
-
`;await M.writeFile(o,n,"utf-8"),a.push(o);let l=F.resolve(e,f,"skills/design-system");await M.ensureDir(l);let c=F.resolve(l,"SKILL.md"),
|
|
341
|
+
`;await M.writeFile(o,n,"utf-8"),a.push(o);let l=F.resolve(e,f,"skills/design-system");await M.ensureDir(l);let c=F.resolve(l,"SKILL.md"),m=await Ge(),p=F.resolve(m,"core"),s=F.resolve(m,"archetypes",`${t.archetype}.md`),i=["00-workflow-and-scope.md","01-override-protocol.md","02-anti-slop-firewall.md","03-cross-page-unity.md","04-ux-and-ergonomics.md","05-voice-and-copy.md","06-iteration-discipline.md"];if(t.mode==="single"){let d=`---
|
|
314
342
|
name: design-system
|
|
315
343
|
description: "Complete design system tokens, UX ergonomics, and archetype specifications"
|
|
316
344
|
---
|
|
@@ -324,15 +352,15 @@ Design Specification: \`./DESIGN.md\`
|
|
|
324
352
|
${r}
|
|
325
353
|
|
|
326
354
|
---
|
|
327
|
-
`;for(let
|
|
355
|
+
`;for(let u of i){let v=F.resolve(p,u);if(await M.pathExists(v)){let b=await M.readFile(v,"utf-8");d+=`
|
|
328
356
|
---
|
|
329
357
|
|
|
330
358
|
${de(b,t)}
|
|
331
|
-
`}}if(await M.pathExists(s)){let
|
|
359
|
+
`}}if(await M.pathExists(s)){let u=await M.readFile(s,"utf-8");d+=`
|
|
332
360
|
---
|
|
333
361
|
|
|
334
|
-
${
|
|
335
|
-
`}await M.writeFile(c,
|
|
362
|
+
${u}
|
|
363
|
+
`}await M.writeFile(c,d,"utf-8"),a.push(c)}else{let d=F.resolve(l,"references");await M.ensureDir(d);for(let v of i){let b=F.resolve(p,v),S=F.resolve(d,v);if(await M.pathExists(b)){let C=await M.readFile(b,"utf-8");await M.writeFile(S,de(C,t),"utf-8"),a.push(S)}}if(await M.pathExists(s)){let v=F.resolve(d,"archetype.md"),b=await M.readFile(s,"utf-8");await M.writeFile(v,b,"utf-8"),a.push(v)}let u=`---
|
|
336
364
|
name: design-system
|
|
337
365
|
description: "Complete design system tokens, UX ergonomics, and archetype specifications"
|
|
338
366
|
---
|
|
@@ -356,7 +384,7 @@ Consult the following modular references in \`./references/\` during design task
|
|
|
356
384
|
- **05 Voice & Copy:** \`./references/05-voice-and-copy.md\` \u2014 Brochure test, swap test, sentence casing, and punctuation discipline.
|
|
357
385
|
- **06 Iteration Discipline:** \`./references/06-iteration-discipline.md\` \u2014 Fix-forward principle and 2-pass budget.
|
|
358
386
|
- **Archetype Guide:** \`./references/archetype.md\` \u2014 Archetype specifications, font pairings, and OKLCH palettes.
|
|
359
|
-
`;await M.writeFile(c,
|
|
387
|
+
`;await M.writeFile(c,u,"utf-8"),a.push(c)}return a}import W from"fs-extra";import _ from"pathe";async function ue(e,t,r){let a=_.resolve(e,".cursor/rules");await W.ensureDir(a);let g=[],f=_.resolve(a,"00-design-core.mdc"),y=`---
|
|
360
388
|
description: "Always-On Core Design Governance Rule for Cursor (v1.0)"
|
|
361
389
|
alwaysApply: true
|
|
362
390
|
---
|
|
@@ -399,7 +427,7 @@ alwaysApply: false
|
|
|
399
427
|
- **Sentence Case:** Strict sentence case on headings, table columns, tooltips, and buttons.
|
|
400
428
|
- **Cure "UPPERCASE MICRO-LABEL Disease":** Max 1 uppercase eyebrow per view. Ban self-evident labels (redundant status descriptions, section format labels, or narrating obvious controls). Uppercase permitted only on short functional technical tags (<= 3 words in \`var(--font-mono)\`, e.g., STATUS: ACTIVE, REF: 0x4B2).
|
|
401
429
|
- **Punctuation:** Zero em-dashes in headings; maximum 1 em-dash per page in body copy.
|
|
402
|
-
`,"utf-8"),g.push(l);let
|
|
430
|
+
`,"utf-8"),g.push(l);let m=_.resolve(a,"03-archetype-recipe.mdc"),p=`---
|
|
403
431
|
description: "Archetype Recipe & Geometric Token Contract for ${t.archetype} (v1.0)"
|
|
404
432
|
globs: "**/*.css, **/*.scss, **/*.less, **/*.html, **/*.jsx, **/*.tsx"
|
|
405
433
|
alwaysApply: false
|
|
@@ -426,14 +454,14 @@ Child radii must never protrude past or clash with parent borders.
|
|
|
426
454
|
- 1px hairline borders: \`var(--border-hairline)\`
|
|
427
455
|
- Top specular highlight: \`var(--highlight-specular)\`
|
|
428
456
|
- Zero purple AI gradients or ungrounded card drop shadows.
|
|
429
|
-
`;await W.writeFile(
|
|
457
|
+
`;await W.writeFile(m,p,"utf-8"),g.push(m)}return g}import me from"fs-extra";import he from"pathe";async function ge(e,t,r){let a=he.resolve(e,"CLAUDE.md"),g=he.resolve(e,"AGENTS.md"),f=`# Design Governance & Token Contract (v4.2)
|
|
430
458
|
|
|
431
459
|
${r}
|
|
432
|
-
`;return await me.writeFile(a,f,"utf-8"),await me.writeFile(g,f,"utf-8"),[a,g]}import
|
|
460
|
+
`;return await me.writeFile(a,f,"utf-8"),await me.writeFile(g,f,"utf-8"),[a,g]}import Le from"fs-extra";import Ne from"pathe";async function fe(e,t,r){let a=Ne.resolve(e,"DESIGN-PROMPT.md"),g=`# Frontend Design System Guidelines (v4.2)
|
|
433
461
|
Target Environments: v0, Lovable, Bolt, Replit
|
|
434
462
|
|
|
435
463
|
${r}
|
|
436
|
-
`;return await
|
|
464
|
+
`;return await Le.writeFile(a,g,"utf-8"),a}async function Ue(){let e=ze(import.meta.url),t=T.dirname(e),r=[T.resolve(t,"../registry"),T.resolve(t,"../../registry"),T.resolve(t,"../../../registry"),T.resolve(process.cwd(),"registry")];for(let a of r)if(await D.pathExists(a))return a;return T.resolve(process.cwd(),"registry")}function je(e){let{archetype:t}=e;return`# Always-On Design Governance Rule (v1.1)
|
|
437
465
|
|
|
438
466
|
You are the design governance engine for this codebase. Every UI decision must preserve geometric unity, copy honesty, and visual calm across every turn.
|
|
439
467
|
|
|
@@ -516,6 +544,11 @@ You are the design governance engine for this codebase. Every UI decision must p
|
|
|
516
544
|
|
|
517
545
|
### 8. Typography, Numeric Hygiene & Anti-Slop Firewall
|
|
518
546
|
- **Casing:** Headings, button labels, and navigation items must use **sentence case** ("Reconcile batch", not "Reconcile Batch").
|
|
547
|
+
- **Human Eyesight & Readability Floor (No Micro-Print):**
|
|
548
|
+
- **Never use font sizes below \`13px\` (\`0.8125rem\`).** Ban Tailwind micro-classes (\`text-[9px]\`, \`text-[10px]\`, \`text-[11px]\`).
|
|
549
|
+
- **Comfortable Secondary Text (\`14px\u201315px\`):** Sub-labels (metadata beneath headings, secondary descriptions beneath primary titles), navigation tabs, and buttons MUST be \`0.875rem\u20130.9375rem\` (\`14px\u201315px\`) in high-contrast \`var(--text-secondary)\`\u2014never \`11px\` dim gray.
|
|
550
|
+
- **Prominent Card Titles (\`18px\u201320px\`):** Primary item titles inside rows or cards (e.g., entity names, item titles) must be \`1.125rem\u20131.25rem\` (\`18px\u201320px\`, \`font-weight: 600\`) so they anchor the row clearly.
|
|
551
|
+
- **Never Combine Small Size + Low Opacity:** If text is \`13px\u201314px\`, it MUST use \`var(--text-secondary)\` (high contrast) and \`font-weight: 500\`, never low-opacity \`opacity-40\` / \`opacity-50\` or \`text-zinc-500\`.
|
|
519
552
|
- **Banned Numbered Eyebrows:** Never put numbered labels (\`01 / ...\`, \`02 / ...\`) or redundant category eyebrows above \`<h1>\` page titles. Eyebrows are prohibited if they merely paraphrase the heading or add decorative numbering.
|
|
520
553
|
- **Workspace vs. Marketing Font Routing:** Never override a user's existing project fonts in \`tokens.css\`. When \`--font-display\` is an editorial/high-contrast serif, reserve \`var(--font-display)\` strictly for marketing heroes and editorial reading views; inside functional application workspaces, data tables, and settings consoles, style \`h1\u2013h4\` headings with \`var(--font-sans)\` so dense UI remains crisp.
|
|
521
554
|
- **Typesetting:**
|
|
@@ -570,10 +603,10 @@ You are the design governance engine for this codebase. Every UI decision must p
|
|
|
570
603
|
### 11. Fix-Forward & 2-Pass Revision Budget
|
|
571
604
|
- **Fix-Forward:** Resolve visual or ergonomic issues by updating \`./tokens.css\` or removing clutter\u2014**never** by adding wrapper elements, extra containers, or ad-hoc overrides.
|
|
572
605
|
- **Revision Budget:** Maximum **2 iterative revision passes** per feature. Track each pass in \`DESIGN.md\` Section 6.
|
|
573
|
-
- Log non-blocking enhancements into \`DESIGN.md\` Section 8 (**Polish Backlog**) rather than burning turns on infinite micro-tweaks.`}async function
|
|
574
|
-
`),n=!1,l=0,c=0,u="";for(let d=0;d<o.length;d++){let s=o[d],i=d+1,p=s.trim();/<(?:header|nav)\b/i.test(s)&&(n=!0),/<\/(?:header|nav)>/i.test(s)&&(n=!1);let m=s.includes("/* @design-exception")||s.includes("/* @design-signature")||s.includes("// @design-exception")||s.includes("// @design-signature");if(!g&&!m){_e.test(s)&&r.push({file:a,rule:"tokens/no-hardcoded-color-radius",line:i,snippet:p,message:"Hardcoded color function (rgb, hsl, oklch) found outside tokens.css without @design-exception",severity:"error"});let b=s.match(We);if(b)for(let x of b){let C=s.indexOf(x);C>0&&/[a-zA-Z0-9_-]/.test(s[C-1])||r.push({file:a,rule:"tokens/no-hardcoded-color-radius",line:i,snippet:p,message:`Hardcoded hex color '${x}' found outside tokens.css without @design-exception`,severity:"error"})}}s.includes("animate-ping")&&r.push({file:a,rule:"slop/no-animate-ping",line:i,snippet:p,message:'Banned attention-seeking animation "animate-ping" detected',severity:"error"}),Ke.test(s)&&!m&&r.push({file:a,rule:"slop/no-ai-gradient",line:i,snippet:p,message:"Banned AI clich\xE9 gradient (purple/pink mesh) detected",severity:"error"});let v=s.toLowerCase();for(let b of He)if(v.includes(b)&&!s.includes("rule")&&!s.includes("banned")){r.push({file:a,rule:"copy/banned-phrases-and-leakage",line:i,snippet:p,message:`Self-referential or marketing copy clich\xE9 detected: "${b}"`,severity:"error"});break}!s.includes("regex")&&!s.includes("banned")&&!s.includes("Banned")&&!s.includes("Rule")&&(/^\s*0[1-9]\s*\/\s*[A-Z]/.test(p)||/>?\s*0[1-9]\s*\/\s*[A-Z]/.test(s))&&r.push({file:a,rule:"copy/banned-phrases-and-leakage",line:i,snippet:p,message:'Numbered slash eyebrow (e.g. "01 / ...") detected above headings or in UI markup',severity:"error"}),n&&Ye.test(s)&&!m&&!f&&r.push({file:a,rule:"slop/no-decorative-badges",line:i,snippet:p,message:"Banned decorative badge/pill/chip detected inside <header> or <nav>",severity:"error"}),!m&&!f&&!s.includes("rule")&&!s.includes("banned")&&(qe.test(s)?r.push({file:a,rule:"slop/no-fake-telemetry-cosplay",line:i,snippet:p,message:"Fake product tier/version badge (e.g. [PRO v2.4], [BETA]) detected",severity:"error"}):Je.test(s)&&r.push({file:a,rule:"slop/no-fake-telemetry-cosplay",line:i,snippet:p,message:"Fake hardware telemetry or sci-fi cosplay copy detected",severity:"error"})),Ze.test(s)&&!m&&!s.includes('"zero" 0')&&!g&&!f&&r.push({file:a,rule:"slop/no-slashed-zero",line:i,snippet:p,message:'Banned slashed-zero numeric styling detected. Use open-oval zeros with "zero" 0',severity:"error"}),Ve.test(s)&&!m&&!s.includes("no \u{1F680}")&&!s.includes("Banned")&&r.push({file:a,rule:"slop/no-emoji-icons",line:i,snippet:p,message:"Emoji character used as UI icon detected",severity:"error"}),Xe.test(s)&&!m&&!f&&(l++,c||(c=i,u=p))}l>3&&r.push({file:a,rule:"slop/excessive-uppercase-labels",line:c,snippet:u,message:`Excessive uppercase micro-labels detected (${l} occurrences, maximum allowed is 3). Cure UPPERCASE MICRO-LABEL disease by using normal sentence case.`,severity:"warning"})}import{fileURLToPath as at}from"url";var z=new et;z.name("agent-design-skills").description("v1.1 CLI and design-governance registry eliminating AI UI slop and enforcing cross-page unity").version("1.1.0");async function xe(e){let t=[];return(await q.pathExists(E.resolve(e,".agent"))||await q.pathExists(E.resolve(e,".agents")))&&t.push("antigravity"),await q.pathExists(E.resolve(e,".cursor"))&&t.push("cursor"),(await q.pathExists(E.resolve(e,"CLAUDE.md"))||await q.pathExists(E.resolve(e,"AGENTS.md")))&&t.push("claude-codex"),t.length>0?t:["antigravity"]}var tt=[{value:"dark-obsidian-technical",label:"Dark Obsidian Technical",hint:"1px hairlines, carbon hue 250, forensic developer/settlement console"},{value:"swiss-typographic-grid",label:"Swiss Typographic Grid",hint:"Light, exposed 1px grid lines, Cabinet Grotesk / Space Grotesk"},{value:"kinetic-industrial-mono",label:"Kinetic Industrial Mono",hint:"Dark, tabular telemetry, JetBrains Mono, amber accents"},{value:"bento-modular-system",label:"Bento Modular System",hint:"Adaptive 12-col bento cells, Satoshi / General Sans"},{value:"spatial-glass-visionos",label:"Spatial Glass VisionOS",hint:"Translucent optical blur, Outfit / DM Sans, specular highlights"},{value:"editorial-serif-paper",label:"Editorial Serif Paper",hint:"Warm bone paper, broadsheet typography, high-craft publication"},{value:"quiet-luxury-atelier",label:"Quiet Luxury Atelier",hint:"Whisper-quiet prestige, Cormorant Garamond / DM Sans, warm ivory"},{value:"warm-artisan-craft",label:"Warm Artisan Craft",hint:"Earthy linen, Fraunces / Cabinet Grotesk, terracotta accents"},{value:"japanese-minimal-zen",label:"Japanese Minimal Zen",hint:"Ma negative space, Noto Serif Display / Work Sans, washi mist"},{value:"scandinavian-warm-minimal",label:"Scandinavian Warm Minimal",hint:"Oat/birch canvas, Familjen Grotesk / DM Sans, spruce accents"},{value:"neo-brutalism",label:"Neo-Brutalist Studio",hint:"Hard 2px borders, stark offset shadows, raw tactile accents"},{value:"retro-tactile-analog",label:"Retro Tactile Analog",hint:"Physical bevels, Space Mono / DM Sans, Teenage Engineering vibe"},{value:"y2k-acid-cyber",label:"Y2K Acid Cyber",hint:"Electric chartreuse on pitch black, VT323 / Syne Mono"},{value:"playful-clay-consumer",label:"Playful Clay Consumer",hint:"Tactile dual-layer shadows, Bricolage Grotesque / Plus Sans"},{value:"vaporwave-crt-terminal",label:"Vaporwave CRT Terminal",hint:"Phosphorescent cyan & magenta on indigo void, scanlines"},{value:"high-trust-fintech-clarity",label:"High-Trust Fintech Clarity",hint:"Enterprise navy, Sora / Public Sans, tabular numbers"},{value:"clinical-biotech-precision",label:"Clinical Biotech Precision",hint:"Sterile lab white, Geist / Space Mono, cold cyan"},{value:"civic-govtech-accessible",label:"Civic Govtech Accessible",hint:"WCAG AAA contrast, Atkinson Hyperlegible / DM Sans"}];z.command("init",{isDefault:!0}).description("Scaffold a design token contract, starter kit, and agent governance rules").option("-a, --agents <agents>",'Target agents (comma-separated or "all": antigravity, cursor, claude-codex, web-builders)').option("-f, --fast","Fast mode with sensible defaults (dark-obsidian-technical, antigravity)").option("-t, --archetype <archetype>","Canonical archetype ID").option("-s, --starter-kit <kit>","Pre-baked starter kit: dashboard, landing-waitlist, mobile-app, data-tool").option("-m, --mode <mode>","Installation mode: modular or single","modular").option("-F, --fonts <mode>",'Font selection mode: A, B, C, keep, or comma-separated "Display,Sans,Mono"').option("-d, --dir <dir>","Target directory",".").option("-y, --yes","Accept defaults without interactive prompts").action(async e=>{let t=E.resolve(process.cwd(),e.dir||"."),r=E.basename(t)||"my-project",a,g;if(e.fonts){let i=e.fonts.trim(),p=i.toUpperCase();if(p==="A"||p==="B"||p==="C")a=p;else if(i.toLowerCase()==="keep")a="keep";else if(i.includes(",")){let m=i.split(",").map(v=>v.trim());a="custom",g={display:m[0]||void 0,sans:m[1]||void 0,mono:m[2]||void 0,source:"user"}}else a="custom",g={display:i,sans:i,source:"user"}}let f=null;if(e.agents&&(e.agents.toLowerCase()==="all"?f=["antigravity","cursor","claude-codex","web-builders"]:f=e.agents.split(",").map(i=>i.trim())),e.fast||e.yes){k.intro(`${w.bgWhite(w.black(" \u26A1 agent-design-skills "))} ${w.dim("v1.1.0 [EXPRESS MODE]")}`);let i=k.spinner();i.start(`Compiling design system in ${t}...`);let p=e.starterKit||"dashboard",m=f||await xe(t),v={projectName:r,targetDir:t,agents:m,archetype:e.archetype||"dark-obsidian-technical",feeling:"urgent-precise",radius:"subtle",blur:"subtle-frost",mode:e.mode||"modular",starterKit:p,fontMode:a,fontOverride:g,customDirection:"Needs to feel like a high-precision developer settlement console, crisp 1px hairlines, zero marketing fluff",productBrief:"High-precision operational workspace and data reconciliation platform",fast:!0},b=await re(v);i.stop(`Scaffolded ${b.createdFiles.length} files successfully.`);for(let x of b.createdFiles)console.log(` ${w.green("\u2714")} ${w.dim(E.relative(t,x))}`);k.outro(w.green(`\u2728 Initialization complete for ${v.agents.join(", ")}. Token contract & starter preview active.`));return}console.clear(),k.intro(`${w.bgWhite(w.black(" \u26A1 agent-design-skills "))} ${w.dim("v1.1.0")}`);let y=await xe(t),o=await Z(t),n=await k.group({agents:()=>f?Promise.resolve(f):k.multiselect({message:"Which AI coding agent(s) are you using?",options:[{value:"antigravity",label:"Antigravity",hint:".agent/rules/ & .agent/skills/"},{value:"cursor",label:"Cursor",hint:".cursor/rules/"},{value:"claude-codex",label:"Codex / Claude Code",hint:"CLAUDE.md / AGENTS.md"},{value:"web-builders",label:"Web Builders (v0 / Bolt / Lovable)",hint:"DESIGN-PROMPT.md"}],initialValues:y,required:!0}),archetype:()=>e.archetype?Promise.resolve(e.archetype):k.select({message:"Choose a human-crafted design archetype:",options:tt}),typography:async({results:i})=>{if(a||g)return a||"custom";let p=i.archetype||e.archetype||"dark-obsidian-technical",m=V[p]||V["dark-obsidian-technical"],v=[];if(o&&(o.display||o.sans||o.mono)){let b=[o.display,o.sans,o.mono].filter(Boolean).map(P).join(" / ");v.push({value:"keep",label:"Keep existing project fonts",hint:b})}return v.push({value:"A",label:`Pairing A (Default): ${m.A.display} + ${m.A.sans} + ${m.A.mono}`,hint:"Archetype primary pairing"},{value:"B",label:`Pairing B: ${m.B.display} + ${m.B.sans} + ${m.B.mono}`,hint:"Alternative character"},{value:"C",label:`Pairing C: ${m.C.display} + ${m.C.sans} + ${m.C.mono}`,hint:"Alternative character"},{value:"custom",label:"Custom font families (specify Display, Sans, Mono)",hint:"Type custom Google Fonts or Fontshare families"}),k.select({message:"Select typography & font pairing:",options:v,initialValue:o&&(o.display||o.sans||o.mono)?"keep":"A"})},starterKit:()=>k.select({message:"Choose a token-wired starter kit preview:",options:[{value:"dashboard",label:"High-Density Workspace Dashboard",hint:"Workspace shell, summary strip, data table, drawer"},{value:"landing-waitlist",label:"Editorial Landing & Waitlist",hint:"Narrative hero, live preview artifact, waitlist form"},{value:"mobile-app",label:"Mobile-First Application",hint:"375px\u2013430px frame, thumb nav, bottom sheet"},{value:"data-tool",label:"Split-Pane Query Explorer & Tool",hint:"Split query/inspector, \u2318K command bar, tabular nums"},{value:"none",label:"None (Blank Token Contract)",hint:"Pure tokens and governance rules only"}]}),mode:()=>k.select({message:"Installation mode for skills & rules:",options:[{value:"modular",label:"Modular Skills (Recommended)",hint:"Core rules + task-scoped reference guides"},{value:"single",label:"Single Master File",hint:"Combined master reference file"}]}),feeling:()=>k.select({message:"Select sensory motion & timing vector:",options:[{value:"urgent-precise",label:"Urgent & Precise (110ms / 180ms)",hint:"Forensic, snappy, zero bounce"},{value:"calm",label:"Calm & Measured (140ms / 240ms)",hint:"Literary ease, smooth"},{value:"playful-tactile",label:"Playful & Tactile (80ms / 150ms)",hint:"Punchy press states"},{value:"authoritative",label:"Authoritative (120ms / 200ms)",hint:"Institutional stability"}]}),radius:()=>k.select({message:"Select geometric corner radius scale:",options:[{value:"subtle",label:"Subtle (6px outer / 4px inner)",hint:"Standard technical scale"},{value:"sharp",label:"Sharp (0px outer / 0px inner)",hint:"Zero radius / architectural"},{value:"medium",label:"Medium (10px outer / 6px inner)",hint:"Soft modern SaaS"},{value:"high",label:"High (16px outer / 10px inner)",hint:"Friendly consumer scale"},{value:"pill",label:"Pill (9999px)",hint:"Capsule components"}]}),blur:()=>k.select({message:"Select surface blur depth:",options:[{value:"subtle-frost",label:"Subtle Frost (8px)",hint:"Hairline glass backdrops"},{value:"flat",label:"Flat (0px)",hint:"Zero blur, pure solid fills"},{value:"deep-glass",label:"Deep Glass (20px)",hint:"Heavy frosted glass"}]}),customDirection:()=>k.text({message:"Custom Creative Direction & Anti-Drift Mandate (Section 0):",placeholder:"Needs to feel like a high-precision developer settlement console, crisp 1px hairlines, zero marketing fluff",initialValue:"Needs to feel like a high-precision developer settlement console, crisp 1px hairlines, zero marketing fluff"})},{onCancel:()=>{k.cancel("Setup cancelled."),process.exit(0)}}),l=a||n.typography||"A",c=g;if(n.typography==="keep"&&!c&&o)c=o;else if(n.typography==="custom"&&!c){let i=await k.text({message:'Enter --font-display family (e.g. "Cabinet Grotesk" or "Cormorant Garamond"):',placeholder:"Sora",validate:v=>v?.trim()?void 0:"Display font family is required"});k.isCancel(i)&&(k.cancel("Setup cancelled."),process.exit(0));let p=await k.text({message:'Enter --font-sans family (e.g. "Instrument Sans" or "Public Sans"):',placeholder:"Instrument Sans",validate:v=>v?.trim()?void 0:"Sans font family is required"});k.isCancel(p)&&(k.cancel("Setup cancelled."),process.exit(0));let m=await k.text({message:'Enter --font-mono family (e.g. "Geist Mono" or "JetBrains Mono"):',placeholder:"JetBrains Mono",validate:v=>v?.trim()?void 0:"Mono font family is required"});k.isCancel(m)&&(k.cancel("Setup cancelled."),process.exit(0)),c={display:i.trim(),sans:p.trim(),mono:m.trim(),source:"user"}}let u=k.spinner();u.start("Compiling tokens and governance contract...");let d={projectName:r,targetDir:t,agents:n.agents||f||y,archetype:n.archetype,feeling:n.feeling,radius:n.radius,blur:n.blur,fontMode:l,fontOverride:c,mode:n.mode,starterKit:n.starterKit!=="none"?n.starterKit:void 0,customDirection:n.customDirection},s=await re(d);u.stop(`Compiled ${s.createdFiles.length} files successfully.`);for(let i of s.createdFiles)console.log(` ${w.green("\u2714")} ${w.dim(E.relative(t,i))}`);k.outro(`${w.green("\u2714")} Initialized ${w.bold(d.archetype)} for ${w.cyan(d.agents.join(", "))}`)});z.command("lint [dir]").description("Lint directory for hardcoded colors, AI slop, banned copy, and hash freeze integrity").action(async e=>{let t=E.resolve(process.cwd(),e||".");console.log(`${w.bgBlue(w.black(" LINT "))} Scanning ${w.bold(t)}...
|
|
575
|
-
`);let r=await
|
|
606
|
+
- Log non-blocking enhancements into \`DESIGN.md\` Section 8 (**Polish Backlog**) rather than burning turns on infinite micro-tweaks.`}async function se(e){let{targetDir:t,agents:r}=e;if(await D.ensureDir(t),!e.fontOverride){let p=await Z(t);p&&(!e.fontMode||e.fontMode==="keep")&&(e={...e,fontMode:"keep",fontOverride:p})}let a=[],{css:g,json:f}=le(e),y=T.resolve(t,"tokens.css"),o=T.resolve(t,"tokens.json");await D.writeFile(y,g,"utf-8"),a.push(y),await D.writeJSON(o,f,{spaces:2}),a.push(o);let n=T.resolve(t,"DESIGN.md"),l;await D.pathExists(n)&&(l=await D.readFile(n,"utf-8"));let c=ce(e,l);if(await D.writeFile(n,c,"utf-8"),a.push(n),e.starterKit){let p=await Ue(),s=T.resolve(p,"starter-kits",e.starterKit,"template.html");if(await D.pathExists(s)){let i=T.resolve(t,"starter-preview.html");await D.copy(s,i),a.push(i)}}let m=je(e);for(let p of r)if(p==="antigravity"){let s=await pe(t,e,m);a.push(...s)}else if(p==="cursor"){let s=await ue(t,e,m);a.push(...s)}else if(p==="claude-codex"){let s=await ge(t,e,m);a.push(...s)}else if(p==="web-builders"){let s=await fe(t,e,m);a.push(s)}return{createdFiles:a}}import we from"fs-extra";import Y from"pathe";import B from"fs-extra";import K from"pathe";import He from"crypto";var ne=".design-skills.lock";async function ye(e){let t=await B.readFile(e,"utf-8");return He.createHash("sha256").update(t).digest("hex")}async function ve(e){let t=["tokens.css","tokens.json","DESIGN.md","DESIGN-PROMPT.md",".agent/rules/design-core.md",".agents/rules/design-core.md",".agent/skills/design-system/SKILL.md",".agents/skills/design-system/SKILL.md",".cursor/rules/00-design-core.mdc",".cursor/rules/design-core.mdc","CLAUDE.md","AGENTS.md"],r={};for(let f of t){let y=K.resolve(e,f);await B.pathExists(y)&&(r[f]=await ye(y))}let a={version:"1.1.0",generatedAt:new Date().toISOString(),hashes:r},g=K.resolve(e,ne);return await B.writeJSON(g,a,{spaces:2}),a}async function be(e){let t=K.resolve(e,ne);return await B.pathExists(t)?(await B.remove(t),!0):!1}async function ke(e){let t=K.resolve(e,ne);if(!await B.pathExists(t))return{locked:!1,valid:!0,modifiedFiles:[]};let r=await B.readJSON(t),a=[];for(let[g,f]of Object.entries(r.hashes)){let y=K.resolve(e,g);if(!await B.pathExists(y)){a.push(`${g} (deleted)`);continue}await ye(y)!==f&&a.push(g)}return{locked:!0,valid:a.length===0,modifiedFiles:a}}var Ve=["hover to reveal","click here","smooth animations","built with react","powered by react","ai-powered","supercharge","one-click","magical","say goodbye to"],We=/[\u{1F300}-\u{1F5FF}\u{1F600}-\u{1F64F}\u{1F680}-\u{1F6FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{1F900}-\u{1F9FF}\u{1FA70}-\u{1FAFF}]/u,_e=/#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})(?=[;,\s)'"`}\]]|$)/g,Ke=/\b(?:rgba?|hsla?|oklch)\s*\(/i,qe=/(?:from-purple|to-pink|from-indigo.*to-purple|from-cyan.*to-purple|radial-gradient\([^)]*(?:purple|#7[0-9a-f]{5}|oklch\([^)]*290\)))/i,Je=/\[(PRO|BETA|v\d+\.\d+)\]/i,Ze=/\b(SUB-\d+MS|TEMPORAL ENGINE|MASTER CHRONOMETER|CHRONO SYNC|LOCAL REFERENCE|\d+\s*FPS|EPOCH)\b/i,Ye=/slashed-zero|font-feature-settings:[^;]*["']zero["']\s*1/i,Xe=/class(?:Name)?=["'][^"']*\b(badge|pill|chip|tag-chip|status-badge|header-badge)\b[^"']*["']/i,Qe=/(?:class(?:Name)?=["'][^"']*\buppercase\b[^"']*\btracking-[^"']*["']|class(?:Name)?=["'][^"']*\btracking-[^"']*\buppercase\b[^"']*["']|\btext-transform:\s*uppercase\b[^;]*letter-spacing)/i,et=/(?:\btext-\[(?:8|9|10|11)px\]|\bfont-size:\s*(?:8|9|10|11)px\b)/i,tt=/\b(text-zinc-500|text-slate-500|text-gray-500|opacity-30|opacity-40)\b/i;async function xe(e){let t=[],r=0,a=await ke(e);if(a.locked&&!a.valid)for(let y of a.modifiedFiles)t.push({file:y,rule:"freeze/hash-integrity",line:1,snippet:y,message:`File was modified without running unfreeze: ${y}`,severity:"error"});let g=[".html",".css",".js",".ts",".jsx",".tsx",".vue",".svelte"];async function f(y){let o=await we.readdir(y,{withFileTypes:!0});for(let n of o){let l=Y.resolve(y,n.name);if(n.isDirectory()){if(["node_modules",".git","dist",".gemini",".turbo"].includes(n.name))continue;await f(l)}else if(n.isFile()){let c=Y.extname(n.name).toLowerCase();g.includes(c)&&(await at(l,e,t),r++)}}}return await f(e),{targetDir:e,violations:t,filesScanned:r,passed:t.filter(y=>y.severity==="error").length===0}}async function at(e,t,r){let a=Y.relative(t,e),g=Y.basename(e)==="tokens.css",f=e.includes(".agent")||e.includes(".cursor")||e.includes("DESIGN.md")||e.includes("README.md")||e.includes("core"),o=(await we.readFile(e,"utf-8")).split(`
|
|
607
|
+
`),n=!1,l=0,c=0,m="";for(let p=0;p<o.length;p++){let s=o[p],i=p+1,d=s.trim();/<(?:header|nav)\b/i.test(s)&&(n=!0),/<\/(?:header|nav)>/i.test(s)&&(n=!1);let u=s.includes("/* @design-exception")||s.includes("/* @design-signature")||s.includes("// @design-exception")||s.includes("// @design-signature");if(!g&&!u){Ke.test(s)&&r.push({file:a,rule:"tokens/no-hardcoded-color-radius",line:i,snippet:d,message:"Hardcoded color function (rgb, hsl, oklch) found outside tokens.css without @design-exception",severity:"error"});let b=s.match(_e);if(b)for(let S of b){let C=s.indexOf(S);C>0&&/[a-zA-Z0-9_-]/.test(s[C-1])||r.push({file:a,rule:"tokens/no-hardcoded-color-radius",line:i,snippet:d,message:`Hardcoded hex color '${S}' found outside tokens.css without @design-exception`,severity:"error"})}}s.includes("animate-ping")&&r.push({file:a,rule:"slop/no-animate-ping",line:i,snippet:d,message:'Banned attention-seeking animation "animate-ping" detected',severity:"error"}),qe.test(s)&&!u&&r.push({file:a,rule:"slop/no-ai-gradient",line:i,snippet:d,message:"Banned AI clich\xE9 gradient (purple/pink mesh) detected",severity:"error"});let v=s.toLowerCase();for(let b of Ve)if(v.includes(b)&&!s.includes("rule")&&!s.includes("banned")){r.push({file:a,rule:"copy/banned-phrases-and-leakage",line:i,snippet:d,message:`Self-referential or marketing copy clich\xE9 detected: "${b}"`,severity:"error"});break}!s.includes("regex")&&!s.includes("banned")&&!s.includes("Banned")&&!s.includes("Rule")&&(/^\s*0[1-9]\s*\/\s*[A-Z]/.test(d)||/>?\s*0[1-9]\s*\/\s*[A-Z]/.test(s))&&r.push({file:a,rule:"copy/banned-phrases-and-leakage",line:i,snippet:d,message:'Numbered slash eyebrow (e.g. "01 / ...") detected above headings or in UI markup',severity:"error"}),n&&Xe.test(s)&&!u&&!f&&r.push({file:a,rule:"slop/no-decorative-badges",line:i,snippet:d,message:"Banned decorative badge/pill/chip detected inside <header> or <nav>",severity:"error"}),!u&&!f&&!s.includes("rule")&&!s.includes("banned")&&(Je.test(s)?r.push({file:a,rule:"slop/no-fake-telemetry-cosplay",line:i,snippet:d,message:"Fake product tier/version badge (e.g. [PRO v2.4], [BETA]) detected",severity:"error"}):Ze.test(s)&&r.push({file:a,rule:"slop/no-fake-telemetry-cosplay",line:i,snippet:d,message:"Fake hardware telemetry or sci-fi cosplay copy detected",severity:"error"})),Ye.test(s)&&!u&&!s.includes('"zero" 0')&&!g&&!f&&r.push({file:a,rule:"slop/no-slashed-zero",line:i,snippet:d,message:'Banned slashed-zero numeric styling detected. Use open-oval zeros with "zero" 0',severity:"error"}),!g&&!f&&!u&&(et.test(s)&&r.push({file:a,rule:"a11y/no-micro-text",line:i,snippet:d,message:"Unreadable micro-text detected (< 13px). Maintain minimum 13px (0.8125rem) floor for human readability.",severity:"error"}),tt.test(s)&&r.push({file:a,rule:"a11y/no-micro-text",line:i,snippet:d,message:"Low-contrast dim text class detected. Use high-contrast var(--text-secondary) or var(--text-muted) instead of raw gray or low opacity.",severity:"error"})),We.test(s)&&!u&&!s.includes("no \u{1F680}")&&!s.includes("Banned")&&r.push({file:a,rule:"slop/no-emoji-icons",line:i,snippet:d,message:"Emoji character used as UI icon detected",severity:"error"}),Qe.test(s)&&!u&&!f&&(l++,c||(c=i,m=d))}l>3&&r.push({file:a,rule:"slop/excessive-uppercase-labels",line:c,snippet:m,message:`Excessive uppercase micro-labels detected (${l} occurrences, maximum allowed is 3). Cure UPPERCASE MICRO-LABEL disease by using normal sentence case.`,severity:"warning"})}import{fileURLToPath as nt}from"url";var z=new rt;z.name("agent-design-skills").description("v1.1 CLI and design-governance registry eliminating AI UI slop and enforcing cross-page unity").version("1.1.1");async function Se(e){let t=[];return(await q.pathExists(E.resolve(e,".agent"))||await q.pathExists(E.resolve(e,".agents")))&&t.push("antigravity"),await q.pathExists(E.resolve(e,".cursor"))&&t.push("cursor"),(await q.pathExists(E.resolve(e,"CLAUDE.md"))||await q.pathExists(E.resolve(e,"AGENTS.md")))&&t.push("claude-codex"),t.length>0?t:["antigravity"]}var st=[{value:"dark-obsidian-technical",label:"Dark Obsidian Technical",hint:"1px hairlines, carbon hue 250, forensic developer/settlement console"},{value:"swiss-typographic-grid",label:"Swiss Typographic Grid",hint:"Light, exposed 1px grid lines, Cabinet Grotesk / Space Grotesk"},{value:"kinetic-industrial-mono",label:"Kinetic Industrial Mono",hint:"Dark, tabular telemetry, JetBrains Mono, amber accents"},{value:"bento-modular-system",label:"Bento Modular System",hint:"Adaptive 12-col bento cells, Satoshi / General Sans"},{value:"spatial-glass-visionos",label:"Spatial Glass VisionOS",hint:"Translucent optical blur, Outfit / DM Sans, specular highlights"},{value:"editorial-serif-paper",label:"Editorial Serif Paper",hint:"Warm bone paper, broadsheet typography, high-craft publication"},{value:"quiet-luxury-atelier",label:"Quiet Luxury Atelier",hint:"Whisper-quiet prestige, Cormorant Garamond / DM Sans, warm ivory"},{value:"warm-artisan-craft",label:"Warm Artisan Craft",hint:"Earthy linen, Fraunces / Cabinet Grotesk, terracotta accents"},{value:"japanese-minimal-zen",label:"Japanese Minimal Zen",hint:"Ma negative space, Noto Serif Display / Work Sans, washi mist"},{value:"scandinavian-warm-minimal",label:"Scandinavian Warm Minimal",hint:"Oat/birch canvas, Familjen Grotesk / DM Sans, spruce accents"},{value:"neo-brutalism",label:"Neo-Brutalist Studio",hint:"Hard 2px borders, stark offset shadows, raw tactile accents"},{value:"retro-tactile-analog",label:"Retro Tactile Analog",hint:"Physical bevels, Space Mono / DM Sans, Teenage Engineering vibe"},{value:"y2k-acid-cyber",label:"Y2K Acid Cyber",hint:"Electric chartreuse on pitch black, VT323 / Syne Mono"},{value:"playful-clay-consumer",label:"Playful Clay Consumer",hint:"Tactile dual-layer shadows, Bricolage Grotesque / Plus Sans"},{value:"vaporwave-crt-terminal",label:"Vaporwave CRT Terminal",hint:"Phosphorescent cyan & magenta on indigo void, scanlines"},{value:"high-trust-fintech-clarity",label:"High-Trust Fintech Clarity",hint:"Enterprise navy, Sora / Public Sans, tabular numbers"},{value:"clinical-biotech-precision",label:"Clinical Biotech Precision",hint:"Sterile lab white, Geist / Space Mono, cold cyan"},{value:"civic-govtech-accessible",label:"Civic Govtech Accessible",hint:"WCAG AAA contrast, Atkinson Hyperlegible / DM Sans"}];z.command("init",{isDefault:!0}).description("Scaffold a design token contract, starter kit, and agent governance rules").option("-a, --agents <agents>",'Target agents (comma-separated or "all": antigravity, cursor, claude-codex, web-builders)').option("-f, --fast","Fast mode with sensible defaults (dark-obsidian-technical, antigravity)").option("-t, --archetype <archetype>","Canonical archetype ID").option("-s, --starter-kit <kit>","Pre-baked starter kit: dashboard, landing-waitlist, mobile-app, data-tool").option("-m, --mode <mode>","Installation mode: modular or single","modular").option("-F, --fonts <mode>",'Font selection mode: A, B, C, keep, or comma-separated "Display,Sans,Mono"').option("-d, --dir <dir>","Target directory",".").option("-y, --yes","Accept defaults without interactive prompts").action(async e=>{let t=E.resolve(process.cwd(),e.dir||"."),r=E.basename(t)||"my-project",a,g;if(e.fonts){let i=e.fonts.trim(),d=i.toUpperCase();if(d==="A"||d==="B"||d==="C")a=d;else if(i.toLowerCase()==="keep")a="keep";else if(i.includes(",")){let u=i.split(",").map(v=>v.trim());a="custom",g={display:u[0]||void 0,sans:u[1]||void 0,mono:u[2]||void 0,source:"user"}}else a="custom",g={display:i,sans:i,source:"user"}}let f=null;if(e.agents&&(e.agents.toLowerCase()==="all"?f=["antigravity","cursor","claude-codex","web-builders"]:f=e.agents.split(",").map(i=>i.trim())),e.fast||e.yes){k.intro(`${w.bgWhite(w.black(" \u26A1 agent-design-skills "))} ${w.dim("v1.1.0 [EXPRESS MODE]")}`);let i=k.spinner();i.start(`Compiling design system in ${t}...`);let d=e.starterKit||"dashboard",u=f||await Se(t),v={projectName:r,targetDir:t,agents:u,archetype:e.archetype||"dark-obsidian-technical",feeling:"urgent-precise",radius:"subtle",blur:"subtle-frost",mode:e.mode||"modular",starterKit:d,fontMode:a,fontOverride:g,customDirection:"Needs to feel like a high-precision developer settlement console, crisp 1px hairlines, zero marketing fluff",productBrief:"High-precision operational workspace and data reconciliation platform",fast:!0},b=await se(v);i.stop(`Scaffolded ${b.createdFiles.length} files successfully.`);for(let S of b.createdFiles)console.log(` ${w.green("\u2714")} ${w.dim(E.relative(t,S))}`);k.outro(w.green(`\u2728 Initialization complete for ${v.agents.join(", ")}. Token contract & starter preview active.`));return}console.clear(),k.intro(`${w.bgWhite(w.black(" \u26A1 agent-design-skills "))} ${w.dim("v1.1.0")}`);let y=await Se(t),o=await Z(t),n=await k.group({agents:()=>f?Promise.resolve(f):k.multiselect({message:"Which AI coding agent(s) are you using?",options:[{value:"antigravity",label:"Antigravity",hint:".agent/rules/ & .agent/skills/"},{value:"cursor",label:"Cursor",hint:".cursor/rules/"},{value:"claude-codex",label:"Codex / Claude Code",hint:"CLAUDE.md / AGENTS.md"},{value:"web-builders",label:"Web Builders (v0 / Bolt / Lovable)",hint:"DESIGN-PROMPT.md"}],initialValues:y,required:!0}),archetype:()=>e.archetype?Promise.resolve(e.archetype):k.select({message:"Choose a human-crafted design archetype:",options:st}),typography:async({results:i})=>{if(a||g)return a||"custom";let d=i.archetype||e.archetype||"dark-obsidian-technical",u=V[d]||V["dark-obsidian-technical"],v=[];if(o&&(o.display||o.sans||o.mono)){let b=[o.display,o.sans,o.mono].filter(Boolean).map(P).join(" / ");v.push({value:"keep",label:"Keep existing project fonts",hint:b})}return v.push({value:"A",label:`Pairing A (Default): ${u.A.display} + ${u.A.sans} + ${u.A.mono}`,hint:"Archetype primary pairing"},{value:"B",label:`Pairing B: ${u.B.display} + ${u.B.sans} + ${u.B.mono}`,hint:"Alternative character"},{value:"C",label:`Pairing C: ${u.C.display} + ${u.C.sans} + ${u.C.mono}`,hint:"Alternative character"},{value:"custom",label:"Custom font families (specify Display, Sans, Mono)",hint:"Type custom Google Fonts or Fontshare families"}),k.select({message:"Select typography & font pairing:",options:v,initialValue:o&&(o.display||o.sans||o.mono)?"keep":"A"})},starterKit:()=>k.select({message:"Choose a token-wired starter kit preview:",options:[{value:"dashboard",label:"High-Density Workspace Dashboard",hint:"Workspace shell, summary strip, data table, drawer"},{value:"landing-waitlist",label:"Editorial Landing & Waitlist",hint:"Narrative hero, live preview artifact, waitlist form"},{value:"mobile-app",label:"Mobile-First Application",hint:"375px\u2013430px frame, thumb nav, bottom sheet"},{value:"data-tool",label:"Split-Pane Query Explorer & Tool",hint:"Split query/inspector, \u2318K command bar, tabular nums"},{value:"none",label:"None (Blank Token Contract)",hint:"Pure tokens and governance rules only"}]}),mode:()=>k.select({message:"Installation mode for skills & rules:",options:[{value:"modular",label:"Modular Skills (Recommended)",hint:"Core rules + task-scoped reference guides"},{value:"single",label:"Single Master File",hint:"Combined master reference file"}]}),feeling:()=>k.select({message:"Select sensory motion & timing vector:",options:[{value:"urgent-precise",label:"Urgent & Precise (110ms / 180ms)",hint:"Forensic, snappy, zero bounce"},{value:"calm",label:"Calm & Measured (140ms / 240ms)",hint:"Literary ease, smooth"},{value:"playful-tactile",label:"Playful & Tactile (80ms / 150ms)",hint:"Punchy press states"},{value:"authoritative",label:"Authoritative (120ms / 200ms)",hint:"Institutional stability"}]}),radius:()=>k.select({message:"Select geometric corner radius scale:",options:[{value:"subtle",label:"Subtle (6px outer / 4px inner)",hint:"Standard technical scale"},{value:"sharp",label:"Sharp (0px outer / 0px inner)",hint:"Zero radius / architectural"},{value:"medium",label:"Medium (10px outer / 6px inner)",hint:"Soft modern SaaS"},{value:"high",label:"High (16px outer / 10px inner)",hint:"Friendly consumer scale"},{value:"pill",label:"Pill (9999px)",hint:"Capsule components"}]}),blur:()=>k.select({message:"Select surface blur depth:",options:[{value:"subtle-frost",label:"Subtle Frost (8px)",hint:"Hairline glass backdrops"},{value:"flat",label:"Flat (0px)",hint:"Zero blur, pure solid fills"},{value:"deep-glass",label:"Deep Glass (20px)",hint:"Heavy frosted glass"}]}),customDirection:()=>k.text({message:"Custom Creative Direction & Anti-Drift Mandate (Section 0):",placeholder:"Needs to feel like a high-precision developer settlement console, crisp 1px hairlines, zero marketing fluff",initialValue:"Needs to feel like a high-precision developer settlement console, crisp 1px hairlines, zero marketing fluff"})},{onCancel:()=>{k.cancel("Setup cancelled."),process.exit(0)}}),l=a||n.typography||"A",c=g;if(n.typography==="keep"&&!c&&o)c=o;else if(n.typography==="custom"&&!c){let i=await k.text({message:'Enter --font-display family (e.g. "Cabinet Grotesk" or "Cormorant Garamond"):',placeholder:"Sora",validate:v=>v?.trim()?void 0:"Display font family is required"});k.isCancel(i)&&(k.cancel("Setup cancelled."),process.exit(0));let d=await k.text({message:'Enter --font-sans family (e.g. "Instrument Sans" or "Public Sans"):',placeholder:"Instrument Sans",validate:v=>v?.trim()?void 0:"Sans font family is required"});k.isCancel(d)&&(k.cancel("Setup cancelled."),process.exit(0));let u=await k.text({message:'Enter --font-mono family (e.g. "Geist Mono" or "JetBrains Mono"):',placeholder:"JetBrains Mono",validate:v=>v?.trim()?void 0:"Mono font family is required"});k.isCancel(u)&&(k.cancel("Setup cancelled."),process.exit(0)),c={display:i.trim(),sans:d.trim(),mono:u.trim(),source:"user"}}let m=k.spinner();m.start("Compiling tokens and governance contract...");let p={projectName:r,targetDir:t,agents:n.agents||f||y,archetype:n.archetype,feeling:n.feeling,radius:n.radius,blur:n.blur,fontMode:l,fontOverride:c,mode:n.mode,starterKit:n.starterKit!=="none"?n.starterKit:void 0,customDirection:n.customDirection},s=await se(p);m.stop(`Compiled ${s.createdFiles.length} files successfully.`);for(let i of s.createdFiles)console.log(` ${w.green("\u2714")} ${w.dim(E.relative(t,i))}`);k.outro(`${w.green("\u2714")} Initialized ${w.bold(p.archetype)} for ${w.cyan(p.agents.join(", "))}`)});z.command("lint [dir]").description("Lint directory for hardcoded colors, AI slop, banned copy, and hash freeze integrity").action(async e=>{let t=E.resolve(process.cwd(),e||".");console.log(`${w.bgBlue(w.black(" LINT "))} Scanning ${w.bold(t)}...
|
|
608
|
+
`);let r=await xe(t);if(r.violations.length===0)console.log(`${w.green("\u2714 Pass:")} Scanned ${r.filesScanned} files. Zero design slop or token contract violations found!
|
|
576
609
|
`),process.exit(0);else{console.log(`${w.red("\u2716 Violations detected:")} (${r.violations.length} total)
|
|
577
610
|
`);for(let a of r.violations){let g=a.severity==="error"?w.bgRed(w.black(" ERR ")):w.bgYellow(w.black(" WARN "));console.log(`${g} ${w.bold(a.file)}:${a.line} [${w.cyan(a.rule)}]`),console.log(` ${w.dim(a.message)}`),a.snippet&&console.log(` ${w.dim(">")} ${a.snippet.slice(0,80)}`),console.log("")}console.log(`${w.red("Lint failed.")} Please resolve all errors or annotate with /* @design-exception: [reason] */.
|
|
578
611
|
`),process.exit(1)}});z.command("freeze [dir]").description("Calculate SHA-256 hashes of design tokens and rules, creating .design-skills.lock").action(async e=>{let t=E.resolve(process.cwd(),e||"."),r=k.spinner();r.start(`Freezing design contract in ${t}...`);let a=await ve(t);r.stop(`Freeze complete. Locked ${Object.keys(a.hashes).length} files.`);for(let[g,f]of Object.entries(a.hashes))console.log(` ${w.green("\u{1F512}")} ${g} ${w.dim(`(${f.slice(0,12)}...)`)}`);console.log(`
|
|
579
|
-
Created ${w.bold(".design-skills.lock")}. Modifications will fail lint until unfreeze is run.`)});z.command("unfreeze [dir]").description("Remove .design-skills.lock to allow modifying design tokens and rules").action(async e=>{let t=E.resolve(process.cwd(),e||"."),r=await be(t);console.log(r?`${w.green("\u2714")} Removed ${w.bold(".design-skills.lock")}. Design files are now unlocked for editing.`:`${w.yellow("\u2139")} No active .design-skills.lock found in ${t}.`)});var
|
|
612
|
+
Created ${w.bold(".design-skills.lock")}. Modifications will fail lint until unfreeze is run.`)});z.command("unfreeze [dir]").description("Remove .design-skills.lock to allow modifying design tokens and rules").action(async e=>{let t=E.resolve(process.cwd(),e||"."),r=await be(t);console.log(r?`${w.green("\u2714")} Removed ${w.bold(".design-skills.lock")}. Design files are now unlocked for editing.`:`${w.yellow("\u2139")} No active .design-skills.lock found in ${t}.`)});var ot=!!(process.argv[1]&&process.argv[1]!=="[eval]"&&(E.resolve(process.argv[1])===E.resolve(nt(import.meta.url))||process.argv[1].endsWith("index.js")||process.argv[1].endsWith("agent-design-skills")||process.argv[1].endsWith("design-skills")));ot&&z.parse();export{se as compileDesignSystem,ve as freezeProject,xe as lintDirectory,be as unfreezeProject};
|
package/package.json
CHANGED
|
@@ -105,6 +105,11 @@ Every generated screen must respect these strict viewport budgets:
|
|
|
105
105
|
- **Metric Strip Architecture:** Strictly ban 3 equal-width stat boxes in a row. Workspaces must use an inline horizontal metric strip with 1px vertical hairlines (`var(--border-hairline)`) or an asymmetric 2-pane split.
|
|
106
106
|
- **Context Boundary (Operational vs. Marketing):** Active app consoles must render live operational data (batch volume, unreconciled variance, pending row count). Never embed static marketing or compliance statements (e.g. SOC2 certifications or throughput capacity claims) inside workspace views.
|
|
107
107
|
- **Badge & Indicator Discipline (Zero Unrequested Badges Law):** NEVER place pill badges, status chips, or uppercase tag boxes inside app headers, navbars, hero sections, or card headers (e.g., ban `PRO v2.4`, `STABLE`, `SUB-10MS`, `60 FPS`). Cards must use plain text headings or no header at all. Tags/badges are ONLY permitted inside repeating data table cells or list rows to indicate item-level record status (e.g., `Settled`, `Discrepancy`, `Active`), strictly capped at max 1 badge per row.
|
|
108
|
+
- **Human Eyesight & Readability Floor (No Micro-Print):**
|
|
109
|
+
1. **Never use font sizes below `13px` (`0.8125rem`).** Ban Tailwind micro-classes (`text-[9px]`, `text-[10px]`, `text-[11px]`).
|
|
110
|
+
2. **Comfortable Secondary Text (`14px–15px`):** Sub-labels (metadata beneath headings, secondary descriptions beneath primary titles), navigation tabs, and buttons MUST be `0.875rem–0.9375rem` (`14px–15px`) in high-contrast `var(--text-secondary)`—never `11px` dim gray.
|
|
111
|
+
3. **Prominent Card Titles (`18px–20px`):** Primary item titles inside rows or cards (e.g., entity names, item titles) must be `1.125rem–1.25rem` (`18px–20px`, `font-weight: 600`) so they anchor the row clearly.
|
|
112
|
+
4. **Never Combine Small Size + Low Opacity:** If text is `13px–14px`, it MUST use `var(--text-secondary)` (high contrast) and `font-weight: 500`, never low-opacity `opacity-40` / `opacity-50` or `text-zinc-500`.
|
|
108
113
|
- **Numeric & Tabular Typography Law:** NEVER use coding monospace fonts (`--font-mono`) or `slashed-zero` on hero numbers, counters, or KPI figures. Always use `var(--font-display)` or `var(--font-sans)` with `font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1, "zero" 0;` so digits have clean, open-oval zeros (`0`) with zero horizontal jitter. Reserve `var(--font-mono)` strictly for code snippets, file paths, or git hashes.
|
|
109
114
|
- **Banned Numbered Eyebrows:** Never put numbered labels (`01 / ...`, `02 / ...`) or redundant category eyebrows above `<h1>` page titles. Eyebrows are prohibited if they merely paraphrase the heading or add decorative numbering.
|
|
110
115
|
- **Typography Heading Law:** In functional application workspaces, tables, and settings consoles, use `--font-sans` for `<h1>–<h4>` headings when `--font-display` is a decorative/editorial serif; reserve serif `--font-display` for marketing heroes and editorial articles.
|
|
@@ -54,6 +54,12 @@ All numbers, financial quantities, telemetry counters, metrics, and timestamps m
|
|
|
54
54
|
- NEVER use coding monospace fonts (`--font-mono`) or `slashed-zero` on hero numbers, counters, or KPI figures. Always use `var(--font-display)` or `var(--font-sans)` with `font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1, "zero" 0;` so digits have clean, open-oval zeros (`0`) with zero horizontal jitter.
|
|
55
55
|
- Reserve `var(--font-mono)` strictly for code snippets, file paths, or git hashes.
|
|
56
56
|
|
|
57
|
+
### Human Eyesight & Readability Floor (No Micro-Print)
|
|
58
|
+
1. **Never use font sizes below `13px` (`0.8125rem`).** Ban Tailwind micro-classes (`text-[9px]`, `text-[10px]`, `text-[11px]`).
|
|
59
|
+
2. **Comfortable Secondary Text (`14px–15px`):** Sub-labels (metadata beneath headings, secondary descriptions beneath primary titles), navigation tabs, and buttons MUST be `0.875rem–0.9375rem` (`14px–15px`) in high-contrast `var(--text-secondary)`—never `11px` dim gray.
|
|
60
|
+
3. **Prominent Card Titles (`18px–20px`):** Primary item titles inside rows or cards (e.g., entity names, item titles) must be `1.125rem–1.25rem` (`18px–20px`, `font-weight: 600`) so they anchor the row clearly.
|
|
61
|
+
4. **Never Combine Small Size + Low Opacity:** If text is `13px–14px`, it MUST use `var(--text-secondary)` (high contrast) and `font-weight: 500`, never low-opacity `opacity-40` / `opacity-50` or `text-zinc-500`.
|
|
62
|
+
|
|
57
63
|
---
|
|
58
64
|
|
|
59
65
|
## 4. Keyboard Navigation & Accessibility
|
|
@@ -608,7 +608,7 @@
|
|
|
608
608
|
</div>
|
|
609
609
|
<div style="font-size: var(--text-sm); color: var(--text-muted);">
|
|
610
610
|
<p><strong>Partition Root:</strong> 0x8F2D...c41a</p>
|
|
611
|
-
<p><strong>Verification Latency:</strong> 42ms (
|
|
611
|
+
<p><strong>Verification Latency:</strong> 42ms (Nodal consensus verified)</p>
|
|
612
612
|
</div>
|
|
613
613
|
<div class="payload-well">
|
|
614
614
|
<code>{
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
<div class="proof-item">
|
|
304
304
|
<div class="proof-label">CONSENSUS LATENCY</div>
|
|
305
305
|
<div class="proof-value font-tabular">< 48 ms</div>
|
|
306
|
-
<div class="proof-note">
|
|
306
|
+
<div class="proof-note">Instant audit verification</div>
|
|
307
307
|
</div>
|
|
308
308
|
<div class="proof-item">
|
|
309
309
|
<div class="proof-label">TELEMETRY ISOLATION</div>
|