How southleft/ds-contracts-poc works
Design System Contracts connects React component libraries and Figma libraries through a shared, framework-neutral contract. The intended journeys are React observation → contract → editable Figma output, Figma import → contract → reusable React output, and comparison → policy-governed repair → independent verification. The README says these complete journeys are still being integrated; current local tools expose parts of them. The graph preserves those documented capabilities while limiting implementation-level links to relationships visible in the excerpts or SOURCE INDEX.
Main entry points: contract-schema.ts Shared Contract · channel-diff.ts Change Comparison · service.ts React Observation · map.ts Figma Import
Components 16
Library Intake
- React Observation
source-reference/service.ts - Figma Import
extract/figma/rest/map.ts - Source Extraction
core/extract-react-tsx.ts
Contract Engine
- Shared Contract
packages/schema/src/contract-schema.ts - Native Observation
core/native-source-observation.ts - Token Minting
core/mint-tokens.ts - Token Sets
core/token-set.ts
Generation
- React Generation
core/mint-code.ts - Figma Generation
core/emit-figma-script.ts
Compare And Repair
- Change Comparison
core/channel-diff.ts - Authorized Repair
source-reference/native-operation-jobs.ts - Independent Verification
core/apply-preview.ts
Local Tools
- Local Playground
playground/src/App.tsx - Guided Flow Engine
playground/src/engine/flow-engine.ts
Other components
- React Library
- Figma Library
Connections 18
- React Library → React Observation: observe
README.md - React Observation → Source Extraction: derive facts
- Source Extraction → Shared Contract: describe
README.md - Figma Library → Figma Import: read library
README.md - Figma Import → Shared Contract: derive
README.md - React Observation → Native Observation: observe native
source-reference/service.ts - Native Observation → Shared Contract: record facts
- Shared Contract → Token Minting: mint tokens
- Shared Contract → Token Sets: compile tokens
- Shared Contract → React Generation: generate React
README.md - Shared Contract → Figma Generation: generate Figma
README.md - React Library → Change Comparison: compare changes
README.md - Figma Library → Change Comparison: compare changes
README.md - Shared Contract → Change Comparison: compare baseline
README.md - Change Comparison → Authorized Repair: authorize repair
README.md - Authorized Repair → Independent Verification: verify repair
README.md - Local Playground → Guided Flow Engine: runs
playground/src/App.tsx - Guided Flow Engine → Figma Generation: calls engine
playground/src/engine/flow-engine.ts