An open source design system that's fully customizable and agent ready
TypeScript
feat(cli): add theme nudge to generated agent docs (#1456)
Cindy Zhang722fe11949d4
diff --git a/packages/cli/src/commands/agent-docs.mjs b/packages/cli/src/commands/agent-docs.mjsindex 7d2a58bed9..ef840dd612 100644--- a/packages/cli/src/commands/agent-docs.mjs+++ b/packages/cli/src/commands/agent-docs.mjs@@ -126,6 +126,7 @@ export function generateCompressedIndex(version, {coreDir, zh = false, lang, runlines.push('No style={{}} — use the xstyle prop on XDS components for custom styling.');lines.push('If a component prop does what you need, use it — never replicate with CSS/stylex.');lines.push(`No magic values — run \`${run} docs tokens\` for spacing/color/radius.`);+ lines.push(`To change accent/brand colors: \`${run} theme\` — never override --xds-color-* in :root.`);lines.push('');// CLI quick referencediff --git a/packages/cli/src/commands/agent-docs.test.mjs b/packages/cli/src/commands/agent-docs.test.mjsindex a5b49c131f..e98c415223 100644--- a/packages/cli/src/commands/agent-docs.test.mjs+++ b/packages/cli/src/commands/agent-docs.test.mjs@@ -34,9 +34,10 @@ describe('generateCompressedIndex', () => {expect(result).toContain('<!-- XDS:END -->');});- it('does not include theme command references', () => {+ it('includes theme nudge rule', () => {const result = generateCompressedIndex('1.0.0');- expect(result).not.toMatch(/\bxds theme\b/);+ expect(result).toMatch(/xds theme/);+ expect(result).toMatch(/never override --xds-color/);});it('includes upgrade command and migration rule', () => {