Workflows
End-to-end playbooks for extending the design system with AI.
Playbooks
New component
add-component-workflow.mdc — scaffold → wire exports → demo → UI builder → document slots.
New CDK entry
add-cdk-workflow.mdc — headless primitive → flat export → /cdk demo.
Foundation docs
add-docs-workflow.mdc — core/types or styles tokens → /docs page.
Tools & agents
add-tools-workflow.mdc — MCP, VS Code, skills, rules, UI builder, theme builder, form builder.
Testing
Vitest + @xngui/testing harnesses — specs next to components; validators first, then form wave.
Add a component
- Rule: .cursor/rules/design-system/add-component-workflow.mdc
- Skill: xngui-add-component + xngui-add-showcase-demo
- Enable @xngui/mcp · run list_components to avoid duplicate entries
- Pick mental category (actions, forms, navigation, …)
- Scaffold libs/components/<category>/<name>/ trio + ng-package.json
- Wire package.json export, tsconfig.base.json path, public index.ts
- Add X_DEMO_ENTRIES row, lazy route, demo page under apps/showcase
- UI builder: wire ui-builder-node/ + ui-builder-code.ts, or add to UI_BUILDER_UNSUPPORTED_COMPONENT_IDS
- Document slots, a11y, and keyboard in the demo description
Add a CDK entry
- Rule: .cursor/rules/design-system/add-cdk-workflow.mdc
- Skill: xngui-add-cdk + xngui-add-showcase-demo
- Read libs/cdk/README.md status board before scaffolding
- Source + ng-package.json under libs/cdk/<category>/<entry>/
- Flat export in libs/cdk/package.json + tsconfig path
- catalog.ts row with group: cdk · route /cdk/<entry>
- Showcase page under pages/cdk/<category>/<entry>/
Foundation docs
- Rule: .cursor/rules/design-system/add-docs-workflow.mdc
- Skill: xngui-add-docs
- Core types → libs/core/types/<category>.ts · export from index.ts
- Styles tokens → libs/styles primitives/semantic · light + dark
- catalog.ts row with group: foundation · route /docs/<slug>
- Doc page with XShowcaseDocPageHeader + accordion sections
- Update MCP design-tokens.ts when global token catalog changes
Tools & agents
- Rule: .cursor/rules/design-system/add-tools-workflow.mdc
- Skill: xngui-add-tools
- Theme tools → catalog.ts (group: tools) · pages/tools/
- Developer tools → vscode-catalog.ts · tools/vscode-extension/
- AI tools → ai-catalog.ts · tools/mcp-server/ · .cursor/skills · .cursor/rules
- pnpm --filter @xngui/vscode generate:catalog after component ship
Testing
- Rule: .cursor/rules/general/component-shipping-gate.mdc (README + harness + spec — same change)
- Rule: .cursor/rules/general/component-testing.mdc (specs + co-located harnesses)
- Rule: .cursor/rules/general/component-readme.mdc (README gate on add/change)
- Runner: Vitest + @analogjs/vitest-angular — libs/components/vitest.config.ts
- Helpers: configureXComponent + XHarnessBase from @xngui/testing
- Harnesses: <name>.harness.ts next to the component — extends XHarnessBase
- Specs: <name>.spec.ts — one it per input, output, and non-trivial logic
- Reference: libs/components/actions/ (full) · libs/components/forms/ (partial — see catalog README)
- CI: nx affected -t test (see .github/workflows/ci.yml)
Agent tips
Invoke skills xngui-add-component, xngui-add-cdk, xngui-add-docs, xngui-add-tools, and xngui-add-showcase-demo for step-by-step checklists. Pair rules with MCP so the agent reads real READMEs before editing APIs.