chore(design): convert gstack's own DESIGN.md to the open spec

`gstack-design-md convert --write` on the repo's DESIGN.md: tokens in YAML
front matter (typography.display/body/label/mono, colors with their light/dark
qualifiers, spacing scale, rounded scale), Overview from Product Context and
Aesthetic Direction, Colors / Typography / Layout as canonical sections, Motion,
Grain Texture, and Decisions Log preserved as extras, format marker on line 2.
Hand-checked; `check` reports spec with no token-reference errors. A Decisions
Log row records the conversion and that DM Sans stays the body face: it is on
the overused-as-display list, and body/UI use on an Operate surface is the
allowed exception under the role-scoped rule.

The pre-conversion file lives on as test/fixtures/design-md-legacy.md, which
test/design-md.test.ts now uses for its legacy cases; the converted root file
is asserted to be spec.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-09-08 16:28:40 +00:00
co-authored by Claude Fable 5.1
parent 4308e487aa
commit 59cfa1547f
3 changed files with 172 additions and 28 deletions
+8 -3
View File
@@ -21,7 +21,8 @@ import { updateDesignMd, readDesignConstraints } from '../design/src/memory';
const ROOT = path.join(import.meta.dir, '..');
const BIN = path.join(ROOT, 'bin', 'gstack-design-md.ts');
const LEGACY = fs.readFileSync(path.join(ROOT, 'DESIGN.md'), 'utf-8');
// gstack's own DESIGN.md is now in the open format; its pre-conversion form is the legacy fixture.
const LEGACY = fs.readFileSync(path.join(ROOT, 'test', 'fixtures', 'design-md-legacy.md'), 'utf-8');
const SPEC = `---
# gstack: design-md-format=spec
@@ -80,10 +81,14 @@ describe('parse + detect', () => {
expect(detectFormat(doc)).toEqual({ format: 'spec' });
});
test("gstack's own DESIGN.md is legacy; a fresh file is unknown; nothing is missing", () => {
test("the legacy fixture is legacy, gstack's own DESIGN.md is spec; a fresh file is unknown; nothing is missing", () => {
const doc = parseDesignMd(LEGACY);
expect(isLegacyGstackFormat(doc)).toBe(true);
expect(detectFormat(doc)).toEqual({ format: 'legacy' });
const own = parseDesignMd(fs.readFileSync(path.join(ROOT, 'DESIGN.md'), 'utf-8'));
expect(detectFormat(own)).toEqual({ format: 'spec' });
expect(own.marker).toBe('spec');
expect(tokensFlat(own.frontmatter).errors).toEqual([]);
expect(detectFormat(parseDesignMd('# Hello\n\nJust prose.\n')).format).toBe('unknown');
expect(detectFormat(null)).toEqual({ format: 'missing' });
});
@@ -191,7 +196,7 @@ describe('tokens', () => {
});
});
describe("convertLegacy on gstack's own DESIGN.md", () => {
describe('convertLegacy on the legacy fixture (gstack\'s pre-conversion DESIGN.md)', () => {
const converted = convertLegacy(parseDesignMd(LEGACY));
const out = renderDesignMd(converted, { emitFrontmatter: true });