dsforge-harness 0.1.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.
Potentially problematic release.
This version of dsforge-harness might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.md +123 -0
- package/bin/dsforge.js +70 -0
- package/package.json +12 -0
- package/plugins/dsforge/.claude-plugin/plugin.json +9 -0
- package/plugins/dsforge/skills/dsforge/SKILL.md +184 -0
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/DatasetManagement.tsx +48 -0
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/ModelCreateEdit.tsx +93 -0
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/components/DataTable.tsx +64 -0
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/components/controls.tsx +97 -0
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/components/forms.tsx +41 -0
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/components/shell.tsx +81 -0
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/ezp.css +115 -0
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/tokens.css +106 -0
- package/plugins/dsforge/skills/dsforge/assets/code-scaffold-reference-ezp/tokens.ts +94 -0
- package/plugins/dsforge/skills/dsforge/references/00-portable-kit-and-runbook.md +59 -0
- package/plugins/dsforge/skills/dsforge/references/01-harness-design-and-validation-plan.md +106 -0
- package/plugins/dsforge/skills/dsforge/references/02-verification-automation-spec.md +45 -0
- package/plugins/dsforge/skills/dsforge/references/03-verifier-generalization-spec.md +43 -0
- package/plugins/dsforge/skills/dsforge/references/examples/code-stage-instruction-dataset-management.md +36 -0
- package/plugins/dsforge/skills/dsforge/references/examples/ezp-states-elevation-augmentation-spec.md +35 -0
- package/plugins/dsforge/skills/dsforge/references/examples/run1-dataset-management-list-spec.md +58 -0
- package/plugins/dsforge/skills/dsforge/references/examples/run2-model-create-edit-spec.md +38 -0
- package/plugins/dsforge/skills/dsforge/references/examples/smoke-fixture/README.md +32 -0
- package/plugins/dsforge/skills/dsforge/references/examples/smoke-fixture/app/app.tsx +20 -0
- package/plugins/dsforge/skills/dsforge/references/examples/smoke-fixture/app/tokens.css +8 -0
- package/plugins/dsforge/skills/dsforge/references/examples/smoke-fixture/validators/out/check1.json +6 -0
- package/plugins/dsforge/skills/dsforge/references/examples/smoke-fixture/validators/out/check2-main.json +8 -0
- package/plugins/dsforge/skills/dsforge/references/examples/smoke-fixture/validators/out/smoke-tokens.json +14 -0
- package/plugins/dsforge/skills/dsforge/references/examples/smoke-fixture/validators/projects/smoke.json +27 -0
- package/plugins/dsforge/skills/dsforge/validators/check-layout.js +74 -0
- package/plugins/dsforge/skills/dsforge/validators/check1.js +53 -0
- package/plugins/dsforge/skills/dsforge/validators/check2.js +48 -0
- package/plugins/dsforge/skills/dsforge/validators/check3.js +64 -0
- package/plugins/dsforge/skills/dsforge/validators/extract-tokens.js +24 -0
- package/plugins/dsforge/skills/dsforge/validators/out/ezp-tokens.json +7 -0
- package/plugins/dsforge/skills/dsforge/validators/projects/_TEMPLATE.json +50 -0
- package/plugins/dsforge/skills/dsforge/validators/projects/ezp.json +63 -0
- package/plugins/dsforge/skills/dsforge/validators/verify.js +81 -0
- package/templates/CLAUDE.md +74 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Check 1 — DS audit (generic, run via Figma MCP use_figma on the DS file).
|
|
3
|
+
* use_figma({ fileKey: <descriptor.ds.fileKey>, skillNames: "figma-use", code: <this body> })
|
|
4
|
+
* CFG (top) = descriptor.check1 — fill from the project config. Logic below is generic.
|
|
5
|
+
* PRESERVED: full subtree findAll incl. instance interiors + node-id dedup; bound-vs-raw
|
|
6
|
+
* with raw split by region (def / instance-interior). Interactive sets DETECTED from the
|
|
7
|
+
* DS (variant axis matching CFG.interactiveDetect); pass-state coverage from CFG.requiredStatesForPass.
|
|
8
|
+
*/
|
|
9
|
+
const CFG = {
|
|
10
|
+
interactiveDetect: 'btn|button|form-control|form-select|form-check|form-switch|input|tab|menu|nav|toggle|switch|link|chip|radio|checkbox',
|
|
11
|
+
requiredStatesForPass: ['focus', 'disable'],
|
|
12
|
+
};
|
|
13
|
+
figma.skipInvisibleInstanceChildren = false;
|
|
14
|
+
const isMixed = (v) => v === figma.mixed;
|
|
15
|
+
const styled = (sid) => sid && !isMixed(sid) && sid !== '';
|
|
16
|
+
const vars = await figma.variables.getLocalVariablesAsync();
|
|
17
|
+
const tokens = {
|
|
18
|
+
color: vars.filter((v) => v.resolvedType === 'COLOR').length,
|
|
19
|
+
float: vars.filter((v) => v.resolvedType === 'FLOAT').length,
|
|
20
|
+
text: (await figma.getLocalTextStylesAsync()).length,
|
|
21
|
+
effect: (await figma.getLocalEffectStylesAsync()).length,
|
|
22
|
+
};
|
|
23
|
+
// binding scan — full traversal incl. instance interiors, dedup by id
|
|
24
|
+
const comps = [];
|
|
25
|
+
for (const p of figma.root.children) { try { for (const n of p.findAllWithCriteria({ types: ['COMPONENT', 'COMPONENT_SET'] })) comps.push(n); } catch (e) {} }
|
|
26
|
+
const seen = new Set(); let bound = 0, raw = 0, rawDef = 0, rawInstance = 0, instInt = 0;
|
|
27
|
+
for (const root of comps) {
|
|
28
|
+
let sub; try { sub = [root, ...root.findAll(() => true)]; } catch (e) { sub = [root]; }
|
|
29
|
+
for (const n of sub) {
|
|
30
|
+
if (seen.has(n.id)) continue; seen.add(n.id); if (n.id.includes(';')) instInt++;
|
|
31
|
+
for (const role of ['fills', 'strokes']) {
|
|
32
|
+
if (!(role in n)) continue; const ps = n[role]; if (!Array.isArray(ps) || !ps.length) continue;
|
|
33
|
+
const sid = role === 'fills' ? n.fillStyleId : n.strokeStyleId; const sb = styled(sid) || isMixed(sid);
|
|
34
|
+
for (const p of ps) { if (!p || p.visible === false || p.type !== 'SOLID') continue; if (sb || (p.boundVariables && p.boundVariables.color)) bound++; else { raw++; n.id.includes(';') ? rawInstance++ : rawDef++; } }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// interactive sets detected from DS; required-state coverage
|
|
39
|
+
const re = new RegExp(CFG.interactiveDetect, 'i');
|
|
40
|
+
const sets = []; for (const p of figma.root.children) { try { for (const n of p.findAllWithCriteria({ types: ['COMPONENT_SET'] })) sets.push(n); } catch (e) {} }
|
|
41
|
+
let interactiveSets = 0, withRequiredStates = 0; const stillMissing = [];
|
|
42
|
+
for (const s of sets) {
|
|
43
|
+
if (!re.test(s.name)) continue; interactiveSets++;
|
|
44
|
+
let v = []; try { const d = s.componentPropertyDefinitions || {}; for (const k of Object.keys(d)) if (d[k].type === 'VARIANT') v.push(...(d[k].variantOptions || [])); } catch (e) {}
|
|
45
|
+
const low = v.map((x) => String(x).toLowerCase());
|
|
46
|
+
const missing = CFG.requiredStatesForPass.filter((st) => !low.some((x) => x.includes(st)));
|
|
47
|
+
if (missing.length === 0) withRequiredStates++; else stillMissing.push({ name: s.name, missing });
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
tokens,
|
|
51
|
+
binding: { bound, raw, rawDef, rawInstance, instanceInteriorNodes: instInt, uniqueNodes: seen.size },
|
|
52
|
+
variants: { interactiveSets, withRequiredStates, stillMissing },
|
|
53
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Check 2 — design audit (generic, run via Figma MCP use_figma on the mockup file).
|
|
3
|
+
* use_figma({ fileKey: <screen.mockup.fileKey>, skillNames: "figma-use", code: <this body> })
|
|
4
|
+
* CFG (top) = { screenFrameId, anchors(groups), menuNodePrefix?, shellComponentNames, viewport }
|
|
5
|
+
* filled from descriptor (shell + screen). Logic below is generic.
|
|
6
|
+
* PRESERVED: instance-interior traversal; raw split bound vs (ds-internal / authored) —
|
|
7
|
+
* only authored raw is a screen violation. Fabrication via enumerable menu (if menuNodePrefix).
|
|
8
|
+
*/
|
|
9
|
+
const CFG = {
|
|
10
|
+
screenFrameId: '315:170',
|
|
11
|
+
anchors: {
|
|
12
|
+
breadcrumb: ['Data Hub', 'Dataset Service', 'Management'], title: ['Management'], caption: ['제안'],
|
|
13
|
+
toolbar: ['데이터셋 검색', '상태', '태그', '생성'], columns: ['이름', '버전', '상태', '태그', '수정일', '액션'],
|
|
14
|
+
menu: ['Information 수정', 'Tagging', 'Deprecate', '버전 생성', '버전관리 옵션 변경', '포맷 변환 (Export 요청)', 'Embedding 요청', 'Inference 요청', 'Action History 조회'],
|
|
15
|
+
pagination: ['Page Size'],
|
|
16
|
+
},
|
|
17
|
+
menuNodePrefix: 'row-action-menu', menuAnchorGroup: 'menu',
|
|
18
|
+
shellComponentNames: ['side-nav', 'gnb'], viewport: { w: 1920, h: 1080 },
|
|
19
|
+
};
|
|
20
|
+
figma.skipInvisibleInstanceChildren = true;
|
|
21
|
+
const isMixed = (v) => v === figma.mixed;
|
|
22
|
+
const screen = await figma.getNodeByIdAsync(CFG.screenFrameId);
|
|
23
|
+
const all = screen.findAll(() => true);
|
|
24
|
+
const blob = all.filter((n) => n.type === 'TEXT' && typeof n.characters === 'string').map((n) => n.characters).join('');
|
|
25
|
+
const present = (s) => blob.indexOf(s) !== -1;
|
|
26
|
+
const cov = {}; let totalExp = 0, totalHit = 0; const missing = [];
|
|
27
|
+
for (const [g, list] of Object.entries(CFG.anchors)) { let hit = 0; for (const s of list) { if (present(s)) hit++; else missing.push(g + ':' + s); } cov[g] = hit + '/' + list.length; totalExp += list.length; totalHit += hit; }
|
|
28
|
+
// fabrication: enumerable menu (if configured)
|
|
29
|
+
let fabrication = { extra: [] };
|
|
30
|
+
if (CFG.menuNodePrefix) {
|
|
31
|
+
let menuNode = null; for (const n of all) { if (n.type !== 'TEXT' && n.name && n.name.indexOf(CFG.menuNodePrefix) === 0) { menuNode = n; break; } }
|
|
32
|
+
if (menuNode) { const items = menuNode.findAll((x) => x.type === 'TEXT').map((t) => t.characters.trim()); const exp = CFG.anchors[CFG.menuAnchorGroup] || []; fabrication = { found: items.length, expected: exp.length, extra: items.filter((t) => !exp.includes(t)) }; }
|
|
33
|
+
}
|
|
34
|
+
// binding: authored (not in instance) vs ds-internal (in instance)
|
|
35
|
+
let bound = 0, authoredRaw = 0, internalRaw = 0; const authoredOffenders = [];
|
|
36
|
+
const styled = (sid) => sid && !isMixed(sid) && sid !== '';
|
|
37
|
+
function scan(node, inInst) { const here = inInst || node.type === 'INSTANCE'; for (const role of ['fills', 'strokes']) { const ps = node[role]; if (!Array.isArray(ps) || !ps.length) continue; const sid = role === 'fills' ? node.fillStyleId : node.strokeStyleId; const sb = styled(sid) || isMixed(sid); for (const p of ps) { if (!p || p.visible === false || p.type !== 'SOLID') continue; if (sb || (p.boundVariables && p.boundVariables.color)) bound++; else if (here) internalRaw++; else { authoredRaw++; if (authoredOffenders.length < 20) authoredOffenders.push({ node: node.name, id: node.id, role }); } } } if ('children' in node) for (const c of node.children) scan(c, here); }
|
|
38
|
+
scan(screen, false);
|
|
39
|
+
// shell + viewport
|
|
40
|
+
const shell = {}; for (const nm of CFG.shellComponentNames) shell[nm] = false;
|
|
41
|
+
for (const n of all) { if (n.type === 'INSTANCE') { let mc = null; try { mc = await n.getMainComponentAsync(); } catch (e) {} const setName = mc && mc.parent && mc.parent.type === 'COMPONENT_SET' ? mc.parent.name : ''; const nm = (mc ? mc.name : '') + ' ' + setName; for (const want of CFG.shellComponentNames) if (new RegExp(want, 'i').test(nm)) shell[want] = true; } }
|
|
42
|
+
return {
|
|
43
|
+
coverage: { perGroup: cov, total: totalHit + '/' + totalExp, pct: +((totalHit / totalExp) * 100).toFixed(1), missing },
|
|
44
|
+
fabrication,
|
|
45
|
+
binding: { bound, authoredRaw, dsInternalRaw: internalRaw, ratioPct: +((bound / (bound + authoredRaw + internalRaw)) * 100).toFixed(1), authoredOffenders },
|
|
46
|
+
viewport: { w: Math.round(screen.width), h: Math.round(screen.height), ok: Math.round(screen.width) === CFG.viewport.w && Math.round(screen.height) === CFG.viewport.h },
|
|
47
|
+
shell,
|
|
48
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Check 3 — code audit (generic, config-driven). Node.
|
|
3
|
+
* node validators/check3.js <project> <screen> (cwd = Poc/) e.g. ezp run1
|
|
4
|
+
* Reads validators/projects/<project>.json (DS descriptor). No project constants here.
|
|
5
|
+
* - Token compare: code token CSS vs generated tokenRef (color/float/text) via naming map
|
|
6
|
+
* - Hardcode scan: screen code files for hex / px not via token
|
|
7
|
+
* allowed px = float-token-derived values + descriptor.structuralPxAllow
|
|
8
|
+
* - Content: ordered array verbatim (if given) and/or anchor presence
|
|
9
|
+
*/
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const ROOT = process.cwd();
|
|
13
|
+
const [project, screenKey] = process.argv.slice(2);
|
|
14
|
+
if (!project || !screenKey) { console.error('usage: node validators/check3.js <project> <screen>'); process.exit(1); }
|
|
15
|
+
const cfg = JSON.parse(fs.readFileSync(path.join(ROOT, 'validators/projects', project + '.json'), 'utf8'));
|
|
16
|
+
const screen = cfg.screens[screenKey];
|
|
17
|
+
const ds = JSON.parse(fs.readFileSync(path.join(ROOT, cfg.tokenRef), 'utf8'));
|
|
18
|
+
const read = (p) => fs.readFileSync(p, 'utf8');
|
|
19
|
+
const codeDir = path.dirname(path.join(ROOT, cfg.codeTokensCss));
|
|
20
|
+
const N = cfg.tokenCssNaming;
|
|
21
|
+
|
|
22
|
+
// ---- token compare ----
|
|
23
|
+
const css = read(path.join(ROOT, cfg.codeTokensCss));
|
|
24
|
+
const cssVars = {}; for (const m of css.matchAll(/(--[a-z0-9-]+)\s*:\s*([^;]+);/gi)) cssVars[m[1]] = m[2].trim();
|
|
25
|
+
const textClasses = {}; for (const m of css.matchAll(/\.([a-z0-9-]*text[a-z0-9-]*)\s*\{([^}]*)\}/gi)) { const b = m[2]; textClasses[m[1]] = { weight: +(b.match(/font-weight:\s*(\d+)/) || [])[1] || 0, size: +(b.match(/font-size:\s*([\d.]+)px/) || [])[1] || 0 }; }
|
|
26
|
+
const toVar = (k) => k.startsWith(N.spaceFrom) ? N.spaceTo + k.slice(N.spaceFrom.length) : k.startsWith(N.sizeFrom) ? N.sizeTo + k.slice(N.sizeFrom.length) : k.startsWith(N.radiusFrom) ? N.radiusTo + k.slice(N.radiusFrom.length) : N.colorPrefix + k.replace(/\//g, '-');
|
|
27
|
+
const tok = { match: 0, total: 0, mismatch: [], missing: [] };
|
|
28
|
+
for (const [k, hex] of Object.entries(ds.color)) { tok.total++; const got = (cssVars[toVar(k)] || '').toUpperCase(); if (!got) tok.missing.push(k); else if (got === hex.toUpperCase()) tok.match++; else tok.mismatch.push(`${k}: ${hex} vs ${got}`); }
|
|
29
|
+
for (const [k, num] of Object.entries(ds.float)) { tok.total++; const got = cssVars[toVar(k)] || ''; if (!got) tok.missing.push(k); else if (got === num + 'px') tok.match++; else tok.mismatch.push(`${k}: ${num}px vs ${got}`); }
|
|
30
|
+
for (const [k, def] of Object.entries(ds.text)) { tok.total++; const cls = N.textClass[k]; const got = textClasses[cls]; const ew = N.weightMap[def.style]; if (!got) tok.missing.push(k); else if (got.weight === ew && got.size === def.size) tok.match++; else tok.mismatch.push(`${k}: ${def.style}/${def.size} vs w${got.weight}/${got.size}`); }
|
|
31
|
+
|
|
32
|
+
// ---- hardcode scan ----
|
|
33
|
+
const allowedPx = new Set([...Object.values(ds.float).map((v) => v + 'px'), ...Object.keys(cfg.structuralPxAllow)]);
|
|
34
|
+
const hexHits = [], pxViolations = [], colorLiterals = [];
|
|
35
|
+
for (const rel of screen.code.files) {
|
|
36
|
+
const src = read(path.join(codeDir, rel));
|
|
37
|
+
src.split('\n').forEach((line, i) => {
|
|
38
|
+
for (const m of line.matchAll(/#[0-9a-fA-F]{3,8}\b/g)) hexHits.push(`${rel}:${i + 1} ${m[0]}`);
|
|
39
|
+
for (const m of line.matchAll(/\brgba?\([^)]*\)/g)) colorLiterals.push(`${rel}:${i + 1} ${m[0]}`);
|
|
40
|
+
for (const m of line.matchAll(/\b\d+(?:\.\d+)?px\b/g)) { if (!allowedPx.has(m[0])) pxViolations.push(`${rel}:${i + 1} ${m[0]}`); }
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ---- content ----
|
|
45
|
+
const content = { fabrication: 0 };
|
|
46
|
+
if (screen.code.orderedArray) {
|
|
47
|
+
const oa = screen.code.orderedArray;
|
|
48
|
+
const src = read(path.join(codeDir, oa.file));
|
|
49
|
+
const arrM = src.match(new RegExp(oa.const + '\\s*=\\s*\\[([\\s\\S]*?)\\]'));
|
|
50
|
+
const found = arrM ? [...arrM[1].matchAll(/'([^']*)'/g)].map((m) => m[1]) : [];
|
|
51
|
+
content.array = { found: found.length, expected: oa.items.length, verbatimAndOrdered: JSON.stringify(found) === JSON.stringify(oa.items), missing: oa.items.filter((a) => !found.includes(a)), extra: found.filter((a) => !oa.items.includes(a)) };
|
|
52
|
+
}
|
|
53
|
+
if (screen.code.anchors) {
|
|
54
|
+
const blob = screen.code.files.map((f) => read(path.join(codeDir, f))).join('\n');
|
|
55
|
+
const missing = screen.code.anchors.filter((a) => blob.indexOf(a) === -1);
|
|
56
|
+
content.anchors = { total: screen.code.anchors.length, present: screen.code.anchors.length - missing.length, missing, verbatim: missing.length === 0 };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
console.log(JSON.stringify({
|
|
60
|
+
project, screen: screenKey,
|
|
61
|
+
tokenCompare: { match: tok.match, total: tok.total, pct: +((tok.match / tok.total) * 100).toFixed(1), mismatch: tok.mismatch, missing: tok.missing },
|
|
62
|
+
hardcode: { hexCount: hexHits.length, hexLiterals: hexHits, pxViolationCount: pxViolations.length, pxViolations, declaredColorLiterals: colorLiterals },
|
|
63
|
+
content,
|
|
64
|
+
}, null, 2));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Token extractor (generic, run via Figma MCP use_figma on the DS file).
|
|
3
|
+
* use_figma({ fileKey: <dsFileKey>, skillNames: "figma-use", code: <this body> })
|
|
4
|
+
* Reads local Variables(COLOR/FLOAT) + Text Styles + Effect Styles → tokenRef JSON.
|
|
5
|
+
* No project constants — works on any Figma DS. Save the return value to the path
|
|
6
|
+
* named by the project descriptor's `tokenRef`. (Replaces hardcoded ezp-tokens.json.)
|
|
7
|
+
*/
|
|
8
|
+
const H = (x) => Math.round(Math.max(0, Math.min(1, x)) * 255).toString(16).padStart(2, '0');
|
|
9
|
+
const vars = await figma.variables.getLocalVariablesAsync();
|
|
10
|
+
const color = {}, float = {};
|
|
11
|
+
for (const v of vars) {
|
|
12
|
+
const m = Object.keys(v.valuesByMode)[0]; const val = v.valuesByMode[m];
|
|
13
|
+
if (v.resolvedType === 'COLOR' && val && val.type !== 'VARIABLE_ALIAS') color[v.name] = ('#' + H(val.r) + H(val.g) + H(val.b)).toUpperCase();
|
|
14
|
+
else if (v.resolvedType === 'FLOAT') float[v.name] = val;
|
|
15
|
+
}
|
|
16
|
+
const text = {};
|
|
17
|
+
for (const s of await figma.getLocalTextStylesAsync()) text[s.name] = { family: s.fontName.family, style: s.fontName.style, size: s.fontSize };
|
|
18
|
+
const effect = {};
|
|
19
|
+
for (const s of await figma.getLocalEffectStylesAsync()) effect[s.name] = s.effects.map(e => ({ type: e.type, radius: e.radius, offsetX: e.offset && e.offset.x, offsetY: e.offset && e.offset.y, spread: e.spread, colorA: e.color && +e.color.a.toFixed(2) }));
|
|
20
|
+
const cols = await figma.variables.getLocalVariableCollectionsAsync();
|
|
21
|
+
return {
|
|
22
|
+
_meta: { source: figma.fileKey, collections: cols.map(c => ({ name: c.name, modes: c.modes.map(m => m.name), vars: c.variableIds.length })), counts: { color: Object.keys(color).length, float: Object.keys(float).length, text: Object.keys(text).length, effect: Object.keys(effect).length } },
|
|
23
|
+
color, float, text, effect,
|
|
24
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_meta": { "source": "EZP 8aASUh5TjMnkoGo6qutYwN — generated by validators/extract-tokens.js (use_figma) 2026-06-15", "collections": [ { "name": "Colors", "modes": ["Light"], "vars": 44 }, { "name": "Spacing", "modes": ["Default"], "vars": 21 } ], "counts": { "color": 44, "float": 21, "text": 7, "effect": 1 } },
|
|
3
|
+
"color": { "white": "#FFFFFF", "black": "#141413", "logo/blue": "#6C91F5", "logo/blue-dark": "#5D7ED7", "logo/blue-50": "#B5C7FA", "logo/blue-20": "#E1E9FD", "logo/green": "#13BFC0", "logo/green-dark": "#10ADAD", "logo/green-50": "#89DFDF", "logo/green-20": "#CFF2F2", "logo/red": "#F15E8D", "logo/red-dark": "#D8547F", "logo/red-50": "#F8AEC6", "logo/red-20": "#FCDEE7", "logo/yellow": "#D1A112", "logo/yellow-dark": "#BC9010", "logo/yellow-50": "#E8D088", "logo/yellow-20": "#F5ECCF", "logo/gray": "#5F5968", "logo/gray-50": "#5F5968", "light/50": "#EEEFF2", "light/100": "#E2E4E9", "light/200": "#CBCFD8", "light/300": "#B3BAC6", "light/400": "#9CA4B4", "light/500": "#858EA3", "light/600": "#6E7991", "light/700": "#5C667A", "light/800": "#4B5363", "light/900": "#393F4C", "light/1000": "#272C34", "light/1100": "#16191D", "dark/50": "#0D0F11", "dark/100": "#16191D", "dark/200": "#272C34", "dark/300": "#393F4C", "dark/400": "#4B5363", "dark/500": "#5C667A", "dark/600": "#6E7991", "dark/700": "#858EA3", "dark/800": "#9CA4B4", "dark/900": "#B3BAC6", "dark/1000": "#CBCFD8", "dark/1100": "#E2E4E9" },
|
|
4
|
+
"float": { "spacing/2xs": 3, "spacing/xs": 6, "spacing/sm": 9, "spacing/md": 12, "spacing/lg": 15, "spacing/xl": 18, "spacing/2xl": 24, "spacing/3xl": 36, "spacing/4xl": 48, "radius/none": 0, "radius/sm": 3, "radius/md": 6, "radius/lg": 9, "radius/pill": 16, "size/sidebar-width": 210, "size/sidebar-collapsed": 48, "size/topbar-height": 40, "size/action-bar-height": 40, "size/input-height": 30, "size/button-height": 32, "size/table-row-height": 30 },
|
|
5
|
+
"text": { "heading/page-title": { "family": "Pretendard", "style": "Bold", "size": 18 }, "heading/section-title": { "family": "Pretendard", "style": "Bold", "size": 15 }, "heading/card-title": { "family": "Pretendard", "style": "SemiBold", "size": 12 }, "body/default": { "family": "Pretendard", "style": "Regular", "size": 12 }, "body/small": { "family": "Pretendard", "style": "Regular", "size": 10.5 }, "caption": { "family": "Pretendard", "style": "Regular", "size": 11 }, "body/small-bold": { "family": "Pretendard", "style": "SemiBold", "size": 11 } },
|
|
6
|
+
"effect": { "elevation/sm": [ { "type": "DROP_SHADOW", "radius": 6, "offsetX": 0, "offsetY": 0, "spread": 0, "colorA": 0.1 } ] }
|
|
7
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_README": "Copy this to validators/projects/<project>.json and fill in. <...> are placeholders. ezp.json is a fully-filled real example.",
|
|
3
|
+
"project": "<PROJECT_NAME>",
|
|
4
|
+
"ds": { "fileKey": "<TARGET_DS_FIGMA_FILE_KEY>", "name": "<DS display name>" },
|
|
5
|
+
"tokenRef": "validators/out/<project>-tokens.json",
|
|
6
|
+
"_tokenRef_note": "Generated by extract-tokens.js run on ds.fileKey. Do NOT hand-author.",
|
|
7
|
+
"codeTokensCss": "<path/to/your/app>/src/<ds>/tokens.css",
|
|
8
|
+
"tokenCssNaming": {
|
|
9
|
+
"_note": "How DS variable names map to your code's CSS custom property names.",
|
|
10
|
+
"colorPrefix": "--<ds>-",
|
|
11
|
+
"spaceFrom": "spacing/", "spaceTo": "--<ds>-space-",
|
|
12
|
+
"sizeFrom": "size/", "sizeTo": "--<ds>-size-",
|
|
13
|
+
"radiusFrom": "radius/", "radiusTo": "--<ds>-radius-",
|
|
14
|
+
"textClass": { "<ds-text-style-name>": "<code-css-class>" },
|
|
15
|
+
"weightMap": { "Bold": 700, "SemiBold": 600, "Medium": 500, "Regular": 400 }
|
|
16
|
+
},
|
|
17
|
+
"shell": {
|
|
18
|
+
"_note": "Full-viewport convention + the DS shell component node names used in mockups.",
|
|
19
|
+
"viewport": { "w": 1920, "h": 1080 },
|
|
20
|
+
"componentNames": ["<side-nav-component>", "<top-bar-component>"]
|
|
21
|
+
},
|
|
22
|
+
"check1": {
|
|
23
|
+
"_note": "Detect interactive component sets by name pattern; which states must exist to pass.",
|
|
24
|
+
"interactiveDetect": "btn|button|input|select|check|switch|tab|menu|nav|toggle|link|radio|checkbox|chip",
|
|
25
|
+
"requiredStatesForPass": ["focus", "disabled"],
|
|
26
|
+
"stateSynonyms": { "active": ["active", "pressed", "selected"], "default": ["default", "normal", "rest", "enabled"] }
|
|
27
|
+
},
|
|
28
|
+
"structuralPxAllow": {
|
|
29
|
+
"_note": "Raw px with no DS token (legit exceptions). Size-token px are auto-allowed from tokenRef.",
|
|
30
|
+
"1px": "hairline border-width",
|
|
31
|
+
"2px": "focus ring width/offset",
|
|
32
|
+
"<NNpx>": "<reason, e.g. control glyph / min-height / viewport>"
|
|
33
|
+
},
|
|
34
|
+
"selfVerify": { "tokensTotal": "<total token count expected>", "dsRaw": 0 },
|
|
35
|
+
"screens": {
|
|
36
|
+
"<screenKey>": {
|
|
37
|
+
"label": "<human label>",
|
|
38
|
+
"mockup": { "fileKey": "<working figma file key>", "frameId": "<frame node id>" },
|
|
39
|
+
"designAnchors": {
|
|
40
|
+
"_note": "Verbatim spec content that MUST appear in the mockup. Grouped freely.",
|
|
41
|
+
"breadcrumb": ["..."], "title": ["..."]
|
|
42
|
+
},
|
|
43
|
+
"code": {
|
|
44
|
+
"files": ["<screen + component files used>"],
|
|
45
|
+
"anchors": ["<verbatim strings that must appear in code>"],
|
|
46
|
+
"orderedArray": { "file": "<file>", "const": "<CONST_NAME>", "items": ["<exact ordered items>"] }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_note": "Filled real example from the ORIGINAL validation project (EZP). It documents what a complete descriptor looks like, but its paths (codeTokensCss app/src/ezp/tokens.css, tokenRef validators/out/ezp-tokens.json, the per-screen code files, the Figma file keys) point at that project's tree, which is NOT shipped in this package — so `npx dsforge check3 ezp <screen>` / `verify ezp` will not run here as-is. For a self-contained, runnable fixture see references/examples/smoke-fixture/ (run from that folder: `npx dsforge check3 smoke main` and `npx dsforge verify smoke`).",
|
|
3
|
+
"project": "EZP",
|
|
4
|
+
"ds": { "fileKey": "8aASUh5TjMnkoGo6qutYwN", "name": "EZP Design System" },
|
|
5
|
+
"tokenRef": "validators/out/ezp-tokens.json",
|
|
6
|
+
"codeTokensCss": "app/src/ezp/tokens.css",
|
|
7
|
+
"tokenCssNaming": {
|
|
8
|
+
"colorPrefix": "--ezp-",
|
|
9
|
+
"spaceFrom": "spacing/", "spaceTo": "--ezp-space-",
|
|
10
|
+
"sizeFrom": "size/", "sizeTo": "--ezp-size-",
|
|
11
|
+
"radiusFrom": "radius/", "radiusTo": "--ezp-radius-",
|
|
12
|
+
"textClass": { "heading/page-title": "ezp-text-page-title", "heading/section-title": "ezp-text-section-title", "heading/card-title": "ezp-text-card-title", "body/default": "ezp-text-body", "body/small": "ezp-text-body-small", "caption": "ezp-text-caption", "body/small-bold": "ezp-text-body-small-bold" },
|
|
13
|
+
"weightMap": { "Bold": 700, "SemiBold": 600, "Medium": 500, "Regular": 400 }
|
|
14
|
+
},
|
|
15
|
+
"shell": { "viewport": { "w": 1920, "h": 1080 }, "componentNames": ["side-nav", "gnb"] },
|
|
16
|
+
"check1": {
|
|
17
|
+
"interactiveDetect": "btn|button|form-control|form-select|form-check|form-switch|input|tab|menu|nav|toggle|switch|link|chip|radio|checkbox",
|
|
18
|
+
"requiredStatesForPass": ["focus", "disabled"],
|
|
19
|
+
"stateSynonyms": { "active": ["active", "pressed", "selected"], "default": ["default", "normal", "rest", "enabled", "primary", "blue", "secondary", "gray", "off"] }
|
|
20
|
+
},
|
|
21
|
+
"structuralPxAllow": {
|
|
22
|
+
"1px": "hairline border-width", "2px": "focus ring width/offset", "4px": "shadow offset (legacy)",
|
|
23
|
+
"8px": "radio dot", "14px": "radio mark / shadow blur", "20px": "element size", "26px": "element size",
|
|
24
|
+
"72px": "textarea min-height", "220px": "input min-width", "232px": "menu min-width",
|
|
25
|
+
"1920px": "viewport width", "1080px": "viewport height"
|
|
26
|
+
},
|
|
27
|
+
"selfVerify": { "tokensTotal": 72, "dsRaw": 0 },
|
|
28
|
+
"screens": {
|
|
29
|
+
"run1": {
|
|
30
|
+
"label": "Dataset Management (list)",
|
|
31
|
+
"mockup": { "fileKey": "7TeyUkxEnHqnJpn6DZiPoo", "frameId": "315:170" },
|
|
32
|
+
"designAnchors": {
|
|
33
|
+
"breadcrumb": ["Data Hub", "Dataset Service", "Management"],
|
|
34
|
+
"title": ["Management"], "caption": ["제안"],
|
|
35
|
+
"toolbar": ["데이터셋 검색", "상태", "태그", "생성"],
|
|
36
|
+
"columns": ["이름", "버전", "상태", "태그", "수정일", "액션"],
|
|
37
|
+
"menu": ["Information 수정", "Tagging", "Deprecate", "버전 생성", "버전관리 옵션 변경", "포맷 변환 (Export 요청)", "Embedding 요청", "Inference 요청", "Action History 조회"],
|
|
38
|
+
"pagination": ["Page Size"]
|
|
39
|
+
},
|
|
40
|
+
"menuNodePrefix": "row-action-menu",
|
|
41
|
+
"code": {
|
|
42
|
+
"files": ["components/controls.tsx", "components/shell.tsx", "components/DataTable.tsx", "DatasetManagement.tsx", "ezp.css"],
|
|
43
|
+
"orderedArray": { "file": "components/DataTable.tsx", "const": "ROW_ACTIONS", "items": ["Information 수정", "Tagging", "Deprecate", "버전 생성", "버전관리 옵션 변경", "포맷 변환 (Export 요청)", "Embedding 요청", "Inference 요청", "Action History 조회"] }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"run2": {
|
|
47
|
+
"label": "Model create/edit",
|
|
48
|
+
"mockup": { "fileKey": "7TeyUkxEnHqnJpn6DZiPoo", "frameId": "330:260" },
|
|
49
|
+
"designAnchors": {
|
|
50
|
+
"breadcrumb": ["AI Orchestration", "Management", "Model"],
|
|
51
|
+
"modelType": ["Default Model", "Custom Model"],
|
|
52
|
+
"uploadMethod": ["Source Code Repository", "File"],
|
|
53
|
+
"saveActions": ["Create Model info", "Modify Model info"],
|
|
54
|
+
"cancel": ["취소"], "proposalNote": ["제안"]
|
|
55
|
+
},
|
|
56
|
+
"code": {
|
|
57
|
+
"files": ["components/shell.tsx", "components/forms.tsx", "ModelCreateEdit.tsx", "ezp.css"],
|
|
58
|
+
"anchors": ["Default Model", "Custom Model", "Source Code Repository", "File", "Create Model info", "Modify Model info", "취소"],
|
|
59
|
+
"extraPresent": ["AI Orchestration", "Management", "Model", "제안"]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* verify.js — generic harness aggregator (config-driven). Node.
|
|
3
|
+
* node validators/verify.js <project> (cwd = Poc/) e.g. ezp
|
|
4
|
+
* Reads validators/projects/<project>.json. Orchestrates: Check 1 (DS) + Check 2 (per screen,
|
|
5
|
+
* from out/check2-<screen>.json produced by the use_figma run) + Check 3 (per screen, run here),
|
|
6
|
+
* then self-verifies the result reproduces the project's confirmed baseline.
|
|
7
|
+
* The Figma-side checks (1,2) run via use_figma (no fs there); their results are staged in out/.
|
|
8
|
+
* PRESERVED self-verification: tokens-match · screen-authored hardcode 0 · anchors verbatim ·
|
|
9
|
+
* fabrication 0 · dsRawMatchesIndependent (raw==baseline AND instance-interior>0). Baseline = descriptor.
|
|
10
|
+
*/
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const cp = require('child_process');
|
|
14
|
+
const ROOT = process.cwd();
|
|
15
|
+
const project = process.argv[2] || 'ezp';
|
|
16
|
+
const cfg = JSON.parse(fs.readFileSync(path.join(ROOT, 'validators/projects', project + '.json'), 'utf8'));
|
|
17
|
+
const load = (f) => JSON.parse(fs.readFileSync(path.join(ROOT, 'validators/out', f), 'utf8'));
|
|
18
|
+
const loadOpt = (f) => { try { return load(f); } catch (e) { return null; } };
|
|
19
|
+
const c1 = load('check1.json');
|
|
20
|
+
const yn = (b) => (b ? 'PASS' : 'FAIL');
|
|
21
|
+
|
|
22
|
+
// ---- Check 1 (DS) ----
|
|
23
|
+
const c1pass = c1.tokens.color > 0 && c1.tokens.effect > 0 && c1.binding.raw === 0 && c1.variants.withRequiredStates === c1.variants.interactiveSets;
|
|
24
|
+
|
|
25
|
+
// ---- per-screen Check 2 + Check 3 ----
|
|
26
|
+
const screens = {};
|
|
27
|
+
for (const sk of Object.keys(cfg.screens)) {
|
|
28
|
+
const c2 = load('check2-' + sk + '.json');
|
|
29
|
+
// Resolve check3.js next to this file (works whether run from the package, an npm
|
|
30
|
+
// install, or a copied skill dir); keep cwd = ROOT so its descriptor/out/code paths
|
|
31
|
+
// still resolve against the user's project, not this script's location.
|
|
32
|
+
const c3script = path.join(__dirname, 'check3.js');
|
|
33
|
+
const c3 = JSON.parse(cp.execSync(`node "${c3script}" ${project} ${sk}`, { cwd: ROOT }).toString());
|
|
34
|
+
const shellOk = Object.values(c2.shell).every(Boolean);
|
|
35
|
+
const c2pass = c2.coverage.pct === 100 && c2.fabrication.extra.length === 0 && c2.binding.authoredRaw === 0 && c2.viewport.ok && shellOk;
|
|
36
|
+
const contentOk = c3.content.array ? c3.content.array.verbatimAndOrdered : (c3.content.anchors ? c3.content.anchors.verbatim : true);
|
|
37
|
+
const c3pass = c3.tokenCompare.match === c3.tokenCompare.total && c3.hardcode.hexCount === 0 && c3.hardcode.pxViolationCount === 0 && contentOk;
|
|
38
|
+
// Layout floor (objective breakage) — staged in out/check-layout-<screen>.json by the use_figma run.
|
|
39
|
+
// Optional: absent for projects that haven't run it, but hardFails 0 is the precondition to the visual gate.
|
|
40
|
+
const cl = loadOpt('check-layout-' + sk + '.json');
|
|
41
|
+
const layoutPass = cl ? cl.hardFails.length === 0 : null;
|
|
42
|
+
screens[sk] = { c2, c3, c2pass, c3pass, shellOk, contentOk, cl, layoutPass };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ---- self-verification: reproduce confirmed baseline ----
|
|
46
|
+
const sv = cfg.selfVerify;
|
|
47
|
+
const repro = {
|
|
48
|
+
dsRawMatchesIndependent: c1.binding.raw === sv.dsRaw && c1.binding.instanceInteriorNodes > 0,
|
|
49
|
+
ds_states_elevation: c1.variants.withRequiredStates === c1.variants.interactiveSets && c1.tokens.effect > 0,
|
|
50
|
+
};
|
|
51
|
+
for (const [sk, r] of Object.entries(screens)) {
|
|
52
|
+
repro['tokens72_' + sk] = r.c3.tokenCompare.match === sv.tokensTotal && r.c3.tokenCompare.total === sv.tokensTotal;
|
|
53
|
+
repro['authoredHardcode0_' + sk] = r.c2.binding.authoredRaw === 0 && r.c3.hardcode.hexCount === 0 && r.c3.hardcode.pxViolationCount === 0;
|
|
54
|
+
repro['anchorsVerbatim_' + sk] = r.contentOk;
|
|
55
|
+
repro['fabrication0_' + sk] = r.c2.fabrication.extra.length === 0 && (!r.c3.content.array || r.c3.content.array.extra.length === 0);
|
|
56
|
+
if (r.cl) repro['layoutClean_' + sk] = r.layoutPass === true; // only enforced when the layout floor was run
|
|
57
|
+
}
|
|
58
|
+
const reproduced = Object.values(repro).every(Boolean);
|
|
59
|
+
|
|
60
|
+
const report = {
|
|
61
|
+
project: cfg.project, generated: 'verify.js (config-driven; numbers only)',
|
|
62
|
+
check1_DS: { pass: c1pass, tokens: c1.tokens, raw: c1.binding.raw, instanceInteriorNodes: c1.binding.instanceInteriorNodes, states: c1.variants.withRequiredStates + '/' + c1.variants.interactiveSets },
|
|
63
|
+
screens: Object.fromEntries(Object.entries(screens).map(([sk, r]) => [sk, {
|
|
64
|
+
check2: { pass: r.c2pass, coverage: r.c2.coverage.total, fabricationExtra: r.c2.fabrication.extra.length, authoredRaw: r.c2.binding.authoredRaw, dsInternalRaw: r.c2.binding.dsInternalRaw, viewport: r.c2.viewport.ok, shell: r.shellOk },
|
|
65
|
+
check3: { pass: r.c3pass, tokens: r.c3.tokenCompare.match + '/' + r.c3.tokenCompare.total, hex: r.c3.hardcode.hexCount, pxViol: r.c3.hardcode.pxViolationCount, content: r.contentOk },
|
|
66
|
+
layout: r.cl ? { pass: r.layoutPass, hardFails: r.cl.hardFails.length, advisories: r.cl.advisories.length } : 'not run',
|
|
67
|
+
}])),
|
|
68
|
+
selfVerification: { baseline: sv, checks: repro, reproduced },
|
|
69
|
+
};
|
|
70
|
+
fs.mkdirSync(path.join(ROOT, 'reports'), { recursive: true });
|
|
71
|
+
fs.writeFileSync(path.join(ROOT, 'reports/22-verification-report.json'), JSON.stringify(report, null, 2));
|
|
72
|
+
|
|
73
|
+
console.log('=== Harness verification (generic, config-driven) — project: ' + cfg.project + ' ===');
|
|
74
|
+
console.log('Check 1 (DS): ' + yn(c1pass) + ' tokens c' + c1.tokens.color + '/f' + c1.tokens.float + '/t' + c1.tokens.text + '/e' + c1.tokens.effect + ' raw ' + c1.binding.raw + ' instInterior ' + c1.binding.instanceInteriorNodes + ' states ' + c1.variants.withRequiredStates + '/' + c1.variants.interactiveSets);
|
|
75
|
+
for (const [sk, r] of Object.entries(screens)) {
|
|
76
|
+
console.log('Screen ' + sk + ': Check2 ' + yn(r.c2pass) + ' (cov ' + r.c2.coverage.total + ' fab+' + r.c2.fabrication.extra.length + ' authRaw ' + r.c2.binding.authoredRaw + ' vp ' + r.c2.viewport.ok + ' shell ' + r.shellOk + ') | Check3 ' + yn(r.c3pass) + ' (tok ' + r.c3.tokenCompare.match + '/' + r.c3.tokenCompare.total + ' hex ' + r.c3.hardcode.hexCount + ' px ' + r.c3.hardcode.pxViolationCount + ' content ' + r.contentOk + ')' + ' | Layout ' + (r.cl ? yn(r.layoutPass) + ' (hard ' + r.cl.hardFails.length + ' adv ' + r.cl.advisories.length + ')' : 'n/a'));
|
|
77
|
+
}
|
|
78
|
+
console.log('--- self-verification: reproduce confirmed baseline ---');
|
|
79
|
+
for (const [k, v] of Object.entries(repro)) console.log(' ' + (v ? 'OK ' : 'XX ') + k);
|
|
80
|
+
console.log(reproduced ? 'GENERALIZATION REPRODUCES confirmed numbers -> not broken' : 'DIFFERS -> generalization bug');
|
|
81
|
+
console.log('Report: reports/22-verification-report.json');
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# CLAUDE.md — 디자인→코드 하네스 (시작 지점)
|
|
2
|
+
|
|
3
|
+
너(Claude Code)는 방금 **디자인→코드 하네스 키트**가 풀린 프로젝트에 있다. 이 파일이 진입점이다. 아래대로 시작하라.
|
|
4
|
+
|
|
5
|
+
## 이게 뭔가
|
|
6
|
+
기능명세 → 시안 → 디자인시스템(DS) → 코드를, 자동 검사 게이트 + 사람 게이트 2곳으로 굴리는 파이프라인. 엔진은 너(+검증하는 리뷰어). 검사기(`validators/`)는 *검사*만 자동화한다 — 시안·코드 빌드와 판단은 네가 한다.
|
|
7
|
+
|
|
8
|
+
## 먼저 할 일
|
|
9
|
+
1. **`docs/00-portable-kit-and-runbook.md`를 끝까지 읽어라.** (전체 그림·런북·한계.) 이어서 필요시 `docs/02`(검사기), `docs/03`(일반화), `docs/examples/`(실제 화면 스펙 Run1/Run2).
|
|
10
|
+
2. **전제 확인:** Figma MCP가 *대상 프로젝트 Figma*에 연결돼 있나 · Node.js 있나 · 2개 사람 게이트(시안 확정·최종 확인)를 볼 리뷰어(사람 또는 다른 Claude)가 있나.
|
|
11
|
+
3. **사용자에게 받을 것:** ① 대상 DS의 Figma 파일 키(없으면 "DS 없음") · ② 기능명세 · ③ 시안 빌드할 작업 Figma 파일 키.
|
|
12
|
+
4. **분기 확정 + 질문 2개**(게이트 아님 — 사람 게이트는 그대로 **2개**): ⓐ 진짜 DS 파일이 이미 있나? → **분기 A**(있음) / **분기 B**(없음). ⓑ 화면당 시안 **옵션 몇 개**? (**기본 2–3**.)
|
|
13
|
+
|
|
14
|
+
## 단계
|
|
15
|
+
4단계에서 고른 분기로 진행한다. **두 분기 모두 사람 게이트는 정확히 2개**(시안 확정 GATE 1 · 최종 확인 GATE 2). 추가된 건 게이트가 아니라 4단계의 질문 2개와, 분기 A의 DS 보완 질문뿐이다. 어떤 시안이든 만들기 전에 명세 **앵커**(verbatim으로 나와야 할 기능·라벨)부터 뽑는다.
|
|
16
|
+
|
|
17
|
+
### 분기 A — 진짜 DS가 이미 있음
|
|
18
|
+
1. **DS 검증.** `validators/check1.js`를 대상 DS에 돌려(`use_figma`로 본문 실행) "진짜/완성 DS인지" 판정(로컬 변수·바인딩%·raw 분류[인스턴스 내부 traverse]·상태 variant[focus/disabled]·elevation).
|
|
19
|
+
- 부족분(Status variant·focus·disabled·elevation 누락)이 나오면 **자동 보강하지 말고 사용자에게 질문:** ⓐ DS를 **보완**한 뒤 그 위에서 시안, 또는 ⓑ DS는 **그대로** 두고 부족분은 시안에 "(제안)"으로 표기. (보완 참고: `docs/examples/ezp-states-elevation-augmentation-spec.md`; check1이 PASS로 flip하면 완료.)
|
|
20
|
+
2. **토큰 추출.** `validators/extract-tokens.js`를 `use_figma`로 대상 DS에 실행 → 반환 JSON을 `validators/out/<proj>-tokens.json`(= tokenRef)에 저장. 이걸로 코드 토큰(`tokens.css`/`tokens.ts`) 생성 — 패턴은 `code-scaffold-reference-ezp/tokens.css`를 *네 DS 이름으로* 갈아끼운다.
|
|
21
|
+
3. **디스크립터 작성.** `validators/projects/_TEMPLATE.json` 복사 → `<proj>.json`: DS 파일키·tokenRef·네이밍맵·shell·structuralPxAllow·화면별 앵커. (`projects/ezp.json`이 채워진 예시.)
|
|
22
|
+
4. **화면마다:**
|
|
23
|
+
a. **시안 옵션 2–3개** 빌드(`use_figma`) — 각각 **전체 뷰포트 + 앱 셸**, DS 인스턴스로. 명세에 없는 건 "(제안)"(날조 금지).
|
|
24
|
+
b. `validators/check2.js`(Figma MCP) → 앵커 커버리지·날조·화면작성 raw·뷰포트+셸.
|
|
25
|
+
c. **[사람 게이트 1] 시안 확정 — 리뷰어가 옵션 하나를 고른다.** ⓐ를 골랐으면 확정 시안 마무리와 함께 DS 보완(check1 재실행 → PASS).
|
|
26
|
+
d. 확정 시안의 코드 빌드(React + CSS 변수, 토큰 1:1, 시안과 동일 내용).
|
|
27
|
+
e. `node validators/check3.js <proj> <screen>` (cwd = 앱 루트) → 토큰 일치·hex/px 하드코드·앵커 verbatim·날조.
|
|
28
|
+
f. **[사람 게이트 2] 최종 화면 확인.**
|
|
29
|
+
|
|
30
|
+
### 분기 B — DS 없음 (순서 역전: 시안 → DS → 코드)
|
|
31
|
+
1. **감사 생략.** DS가 없으니 명세에서 곧장 시각 제안으로 간다.
|
|
32
|
+
2. **화면마다 시안 옵션 2–3개** 빌드 — 각각 **전체 뷰포트 + 앱 셸**. DS가 없어 raw 값은 불가피하지만, 모든 옵션이 명세 앵커를 verbatim으로 담아야 하고, 명세에 없는 내용은 "(제안)"(날조 금지).
|
|
33
|
+
3. **[사람 게이트 1] 시안 확정 — 화면별로 리뷰어가 옵션 하나를 고른다.**
|
|
34
|
+
4. **새 DS 저작** — 확정 시안에서 **새 Figma 파일**에: 색·spacing·size·radius·타이포(weight 포함) **Variables** + interactive **variant 세트**(focus/disabled, 필요시 default/active) + **elevation**(그림자). 모든 fill·stroke·effect를 변수에 **바인딩(raw 0)**. `validators/check1.js`를 돌려 **PASS**까지 반복(토큰 존재·raw 0·세트마다 focus/disabled·인스턴스 내부 traverse>0·elevation 존재).
|
|
35
|
+
5. **토큰 추출.** `extract-tokens.js`를 새 DS에 → tokenRef 저장 → 코드 토큰 생성.
|
|
36
|
+
6. **디스크립터 작성.** `tokenRef`·`tokenCssNaming`·`structuralPxAllow`·`selfVerify`를 **이 새 DS의 실제 측정값**으로(다른 프로젝트에서 복사 금지).
|
|
37
|
+
7. **화면마다:** 확정 시안을 새 DS 인스턴스로 재구성(전체 뷰포트+셸) → `check2.js`(앵커 100%·날조 0·뷰포트+셸); 코드 빌드(토큰 1:1) → `check3.js`.
|
|
38
|
+
8. **[사람 게이트 2] 최종 화면 확인.**
|
|
39
|
+
|
|
40
|
+
### Craft & 시각 루프 (기계 검사 *앞* 필수 — 두 분기 공통)
|
|
41
|
+
기계 검사(check2/check3)는 토큰·내용·구조만 본다 — **시각 품질은 안 본다**. 통과해도 라벨 잘림·과대 배지·허공 메뉴·2행 빈 캔버스면 사용 불가다. 그래서 화면마다 GATE 1·기계검사 *전에* 시각 루프를 돈다:
|
|
42
|
+
**기계 바닥 → 사람 천장 순으로 돈다:**
|
|
43
|
+
1. **빌드 → `validators/check-layout.js`(Figma MCP) 실행 → `hardFails` 0 될 때까지 수정 → 재실행.** 아래 체크리스트의 객관적 깨짐(라벨 잘림·겹침·프레임 밖·auto-layout 누락·찌꺼기 프레임)을 자동 검출. **hardFails 0이 시각 게이트 진입 전제** — 0 되기 전엔 사인오프용 렌더 금지. advisories도 검토.
|
|
44
|
+
2. **그 다음 렌더 → 미감 자가비평 → 수정 → 반복.**
|
|
45
|
+
체크리스트(1=check-layout가 바닥으로 강제, 나머지는 사람 판정):
|
|
46
|
+
- 라벨 잘림 0 — 모든 컴포넌트 **auto-layout**, 버튼/메뉴/인풋/배지는 콘텐츠에 맞춰 hug/fill(고정폭 크롭 금지).
|
|
47
|
+
- 상태 배지/칩은 텍스트에 맞는 적정 pill(원 뭉침 금지). variant(default/focus/disabled) 시각적으로 구분.
|
|
48
|
+
- 플로팅/디태치 0 — 셸·테이블·폼을 auto-layout으로 정렬·뷰포트 채움. 행 액션 메뉴는 해당 행에 앵커되거나 그 행 위 오버레이(허공 금지).
|
|
49
|
+
- 현실적 데이터 밀도(2행 빈 화면 금지)·균형·정렬.
|
|
50
|
+
**[사람 게이트 1]이 이 시각 판정 지점**: 먼저 `check-layout` hardFails 0(기계 바닥) → 전 화면 렌더를 리뷰어(가능하면 사람)에게 제출 → "사용 가능(다시 시작 아님, 다듬기)" 판정까지 반복 → 그 다음에야 check2/check3. 순서: **check-layout(0) → 사람 시각 승인 → check2/check3.** 기계 통과는 **바닥선이지 합격선 아님**.
|
|
51
|
+
|
|
52
|
+
### 파일 구조 (두 분기 공통)
|
|
53
|
+
**DS는 전용 페이지(`Design System`: 변수·스타일·컴포넌트)**, **시안은 별도 페이지(`Screens`)**. 한 페이지 혼합 금지.
|
|
54
|
+
|
|
55
|
+
### 공통
|
|
56
|
+
- 첫 실행 시 **검사기 자가검증**을 손검증과 한 번 대조(`npx dsforge verify <proj>`)하고 신뢰. 여기서 `reproduced=true`는 "다른 프로젝트와 같다"가 아니라 **이 런이 자기 디스크립터 기준으로 재현 가능**하다는 뜻. (각 스크립트 머리말에 실행법.)
|
|
57
|
+
|
|
58
|
+
## 실행 방법 요약
|
|
59
|
+
- `check3.js` / `verify.js` → **Node**: `node validators/check3.js <proj> <screen>`.
|
|
60
|
+
- `check1.js` / `check2.js` / `extract-tokens.js` → **Figma MCP `use_figma`**로 스크립트 본문 실행(디스크립터를 CFG로 넘김). 각 파일 상단 주석 참고.
|
|
61
|
+
|
|
62
|
+
## 규율 (타협 없음)
|
|
63
|
+
- **토큰만.** 직접 박은 hex/px 금지(단 `structuralPxAllow`에 선언한 구조 치수·1px 보더·포커스 링 두께 등만 예외).
|
|
64
|
+
- **날조 0.** 명세에 없는 내용은 "(제안)"으로 표기, placeholder 값.
|
|
65
|
+
- **측정 > 추정.** 자가보고 믿지 말고 노드/코드를 직접 읽어 검증. 인스턴스 **내부까지** traverse.
|
|
66
|
+
- **검사 전에 craft.** 모든 컴포넌트 auto-layout(hug/fill·라벨 잘림 0·플로팅 0·배지 적정), **DS/Screens 페이지 분리**, 기계 검사 *전에* 시각 루프(렌더→자가비평→수정) 통과. 녹색 check는 바닥선이지 합격선 아님.
|
|
67
|
+
- **사람 게이트 2곳 유지** — 시안 확정(시각 판정 지점)·최종 화면 확인.
|
|
68
|
+
|
|
69
|
+
## 역할
|
|
70
|
+
너(Claude Code) = 실행(Figma 빌드·코드·스크립트 실행). 리뷰어(사람 또는 다른 Claude) = 숫자를 독립 검증. 둘을 섞지 마라.
|
|
71
|
+
|
|
72
|
+
## 한계 (넘겨짚지 말 것)
|
|
73
|
+
- 증명된 범위 = **DS 조합형 화면**(리스트·폼·상세). **캔버스/그래프 에디터형은 미검증** — 명세가 채워지고 빌드 모델을 확장해야 가능. "다 된다"고 하지 마라.
|
|
74
|
+
- 검사기는 토큰·내용·구조의 기계적 일치만 본다. 시각적 적절성·IA·디자인 의도는 사람이 본다.
|