design-review: capture code tokens before universal principles

/design-review read only DESIGN.md and otherwise fell back to universal
principles, so a project whose system lives in CSS custom properties,
tailwind.config or a theme file got audited and mocked up against an
invented aesthetic. The skill now reads code tokens before falling back,
and the target-mockup brief reuses the captured colors, fonts, radii and
spacing, changing layout only.

The contributor's optional microcopy checks (domain vocabulary, human
register) are not adopted here.

Co-authored-by: Tom Lam <tomlam0811@berkeley.edu>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
committed 2026-10-08 14:55:18 +00:00
1 parent 7707f5383c
commit e32cbe5fca
4 files changed
+19 -9

No files matched your search

@@ -8,7 +8,7 @@ import {generatePreambleBash} from '../scripts/resolvers/preamble/generate-pream
import {generatePlanModeInfo} from '../scripts/resolvers/preamble/generate-completion-status';
import {generateDesignHardRules} from '../scripts/resolvers/design';
import {E2E_TOUCHFILES, LLM_JUDGE_TOUCHFILES, selectTests} from './helpers/touchfiles';
import { expectMentions } from './helpers/prompt-structure';
import { between, compact, expectMentions, expectTokens } from './helpers/prompt-structure';
const root = path.resolve(import.meta.dir, '..');
const announcement = 'Scope gate: plan mode — auto-selected B (reviewing <target>).';
@@ -105,3 +105,13 @@ test('new regression and changed preamble sources select all Design and Eng owne
}
}
});
test('design-review captures code tokens before universal principles and reuses them in target mockups', () => {
const skill = fs.readFileSync(path.join(root, 'design-review/SKILL.md'), 'utf8');
const capture = between(skill, '**Capture the project\'s design system:**', '## Phase 1');
expectTokens(capture, ['`tailwind.config.*`', '`:root`'], 'design-system capture');
expectMentions(compact(capture), [['universal', 'only', 'neither', 'code tokens']], 'design-system capture');
const mockup = compact(between(skill, '### 8a.5. Target Mockup', '### 8b.'));
expectMentions(mockup, [['brief', 'reuses', 'captured', 'colors', 'fonts']], 'target mockup');
expectMentions(mockup, [['never', 'new palette', 'already has one']], 'target mockup');
});