-
AI Suggestion Rationale
-
{aiRationale}
-
Fields pre-filled — review before submitting.
+
+
AI Suggestion Rationale
+
{aiRationale}
+
Fields pre-filled — review before submitting.
)}
@@ -171,14 +171,14 @@ export function TriageForm({ incidentId, currentSeverity }: Props) {
type="button"
onClick={getAiSuggestion}
disabled={aiLoading || saving}
- className="flex-1 bg-purple-50 text-purple-700 border border-purple-300 py-2 text-sm font-semibold disabled:opacity-50 hover:bg-purple-100"
+ className="flex-1 bg-accent-100 text-accent-700 border border-accent-300 py-2 text-sm font-semibold disabled:opacity-50 hover:bg-accent-200"
>
{aiLoading ? 'Getting suggestion…' : 'Get AI Suggestion'}
diff --git a/components/language-switcher.tsx b/components/language-switcher.tsx
index 6f87cb5..f9d266a 100644
--- a/components/language-switcher.tsx
+++ b/components/language-switcher.tsx
@@ -33,7 +33,7 @@ export function LanguageSwitcher() {
value={current}
onChange={e => handleChange(e.target.value)}
aria-label="Select language"
- className="text-xs border border-divider px-2 py-1 bg-surface text-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-500"
+ className="text-xs border border-divider px-2 py-1 bg-surface text-gray-700 focus:outline-none focus:ring-1 focus:ring-accent"
>
{Object.entries(LOCALES).map(([code, label]) => (
diff --git a/components/settings/api-key-form.tsx b/components/settings/api-key-form.tsx
index 1cf5616..9af0c8c 100644
--- a/components/settings/api-key-form.tsx
+++ b/components/settings/api-key-form.tsx
@@ -47,11 +47,11 @@ export function ApiKeyForm({ settings }: Props) {
-
+
{status?.set ? 'Configured' : 'Not set'}
@@ -66,18 +66,18 @@ export function ApiKeyForm({ settings }: Props) {
value={values[key]}
onChange={e => setValues(v => ({ ...v, [key]: e.target.value }))}
placeholder={status?.set ? 'Enter new key to replace…' : 'Enter API key…'}
- className="flex-1 border border-divider px-3 py-2 text-sm text-gray-900 placeholder-gray-500 focus:ring-2 focus:ring-blue-500 focus:border-transparent font-mono"
+ className="flex-1 border border-divider px-3 py-2 text-sm text-gray-900 placeholder-gray-500 focus:ring-2 focus:ring-accent focus:border-transparent font-mono"
/>
{results[key] === 'ok' && (
-
Saved. Reload the page to confirm.
+
Saved. Reload the page to confirm.
)}
{results[key] === 'error' && (
Save failed. Check your permissions.
diff --git a/docs/superpowers/plans/2026-09-30-modernist-design-system-restyle.md b/docs/superpowers/plans/2026-09-30-modernist-design-system-restyle.md
index 0bdedcf..419ab5e 100644
--- a/docs/superpowers/plans/2026-09-30-modernist-design-system-restyle.md
+++ b/docs/superpowers/plans/2026-09-30-modernist-design-system-restyle.md
@@ -451,7 +451,6 @@ function transformClassAttr(attr) {
out = out.replace(/(? q + body.trim().replace(/ {2,}/g, ' ') + q)
out = out.replace(/^(className=\{`)\s+/, '$1').replace(/\s+(`\})$/, '$1')
- out = out.replace(/ {2,}/g, ' ')
return out
}
diff --git a/package.json b/package.json
index 7b2605c..b7290b8 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,8 @@
"lint": "eslint",
"test": "vitest run",
"test:watch": "vitest",
- "generate-qr": "tsx scripts/generate-qr.ts"
+ "generate-qr": "tsx scripts/generate-qr.ts",
+ "check:design": "node scripts/check-design-gates.mjs"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.111.0",
diff --git a/scripts/check-design-gates.mjs b/scripts/check-design-gates.mjs
new file mode 100644
index 0000000..89dbf00
--- /dev/null
+++ b/scripts/check-design-gates.mjs
@@ -0,0 +1,61 @@
+import { readdirSync, readFileSync, statSync } from 'node:fs'
+import path from 'node:path'
+import { fileURLToPath } from 'node:url'
+
+// Files where a circular element is legitimate (avatar). Add others only with a reason.
+export const ROUND_ALLOWED = ['components/layout/sidebar.tsx']
+
+const RULES = [
+ {
+ rule: 'no-rounded',
+ re: /(?<=[\s"'`:{])(?:[\w-]+:)*rounded(?:-(?!full(?![\w-]))[\w]+)*(?=[\s"'`}])/,
+ },
+ { rule: 'no-bg-white', re: /(?]*className=[^>]*(? {
+ const line = i + 1
+ for (const { rule, re } of RULES) {
+ if (re.test(text)) out.push({ file, line, rule, text: text.trim() })
+ }
+ if (!roundAllowed && /(?<=[\s"'`:{])(?:[\w-]+:)*rounded-full(?=[\s"'`}])/.test(text)) {
+ out.push({ file, line, rule: 'no-rounded-full', text: text.trim() })
+ }
+ })
+ return out
+}
+
+function walk(dir, files = []) {
+ for (const name of readdirSync(dir)) {
+ const full = path.join(dir, name)
+ if (statSync(full).isDirectory()) walk(full, files)
+ else if (full.endsWith('.tsx')) files.push(full)
+ }
+ return files
+}
+
+function main() {
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
+ const all = []
+ for (const dir of ['app', 'components']) {
+ for (const abs of walk(path.join(root, dir))) {
+ const rel = path.relative(root, abs).split(path.sep).join('/')
+ all.push(...findViolations(readFileSync(abs, 'utf8'), rel))
+ }
+ }
+ for (const v of all) console.log(`${v.file}:${v.line} [${v.rule}] ${v.text}`)
+ console.log(all.length === 0 ? 'design gates: clean' : `design gates: ${all.length} violation(s)`)
+ process.exit(all.length === 0 ? 0 : 1)
+}
+
+if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) main()
diff --git a/scripts/modernist-codemod.mjs b/scripts/modernist-codemod.mjs
index 9351852..0f37b32 100644
--- a/scripts/modernist-codemod.mjs
+++ b/scripts/modernist-codemod.mjs
@@ -17,7 +17,6 @@ function transformClassAttr(attr) {
out = out.replace(/(? q + body.trim().replace(/ {2,}/g, ' ') + q)
out = out.replace(/^(className=\{`)\s+/, '$1').replace(/\s+(`\})$/, '$1')
- out = out.replace(/ {2,}/g, ' ')
return out
}
diff --git a/tests/design/tokens.test.ts b/tests/design/tokens.test.ts
index c719d36..e6c067b 100644
--- a/tests/design/tokens.test.ts
+++ b/tests/design/tokens.test.ts
@@ -39,6 +39,11 @@ describe('Modernist tokens in globals.css', () => {
expect(css).toMatch(/--color-blue-700:\s*var\(--color-accent-700\)/)
})
+ it('remaps the red ramp onto the accent ramp, with body-size steps on accent-700', () => {
+ expect(css).toMatch(/--color-red-600:\s*var\(--color-accent-700\)/)
+ expect(css).toMatch(/--color-red-50:\s*var\(--color-accent-100\)/)
+ })
+
it('maps shadows onto the Modernist elevation tokens', () => {
expect(css).toMatch(/--shadow-2xl:\s*var\(--shadow-lg\)/)
})
diff --git a/tests/scripts/check-design-gates.test.ts b/tests/scripts/check-design-gates.test.ts
new file mode 100644
index 0000000..f9ce555
--- /dev/null
+++ b/tests/scripts/check-design-gates.test.ts
@@ -0,0 +1,45 @@
+import { describe, it, expect } from 'vitest'
+import { findViolations, ROUND_ALLOWED } from '../../scripts/check-design-gates.mjs'
+
+const rules = (src: string, file = 'components/x.tsx'): string[] =>
+ (findViolations(src, file) as Array<{ rule: string }>).map(v => v.rule)
+
+describe('design gates', () => {
+ it('flags rounded corner classes', () => {
+ expect(rules('
')).toContain('no-rounded')
+ expect(rules('
')).toContain('no-rounded')
+ })
+
+ it('flags rounded-full outside the allowlist and accepts it inside', () => {
+ expect(rules('
')).toContain('no-rounded-full')
+ expect(rules('
', ROUND_ALLOWED[0])).not.toContain('no-rounded-full')
+ })
+
+ it('flags off-palette colors but accepts remapped gray, blue and red', () => {
+ expect(rules('
')).toContain('off-palette')
+ expect(rules('
')).toContain('off-palette')
+ expect(rules('
')).toEqual([])
+ })
+
+ it('flags hard-coded hex colors', () => {
+ expect(rules('
')).toContain('no-hex')
+ expect(rules('
'quoted'
')).not.toContain('no-hex')
+ })
+
+ it('flags centered button labels', () => {
+ expect(rules('
')).toContain('no-centered-button')
+ })
+
+ it('flags leftovers the codemod should have replaced', () => {
+ expect(rules('
')).toEqual(expect.arrayContaining(['no-bg-white', 'no-heavy-shadow']))
+ })
+
+ it('reports file and 1-based line numbers', () => {
+ const v = findViolations('a\n
', 'components/y.tsx')
+ expect(v[0]).toMatchObject({ file: 'components/y.tsx', line: 2, rule: 'no-rounded' })
+ })
+
+ it('accepts clean on-system markup', () => {
+ expect(rules('
')).toEqual([])
+ })
+})