How hsskey/tokenloom works
tokenloom is a local, deterministic Figma-snapshot processor: it retrieves component context or emits design tokens, while a coding agent uses that information to build application code. The graph also preserves the documented exporter, REST sync, MCP access, and separate development evaluation and verification capabilities. Edges are limited to relationships shown in excerpts, SOURCE INDEX references, or the README; unsampled internals are represented at their supported directory paths.
Main entry points: main.ts CLI dispatcher · index.ts Token transformation · cmd-context.ts Context command · cmd-tokens.ts Token build command
Components 22
CLI and access
- CLI dispatcher
apps/cli/src/main.ts - Argument parsing
apps/cli/src/args.ts - MCP server tools
packages/mcp/src/tools.ts
Snapshot and context
- Snapshot loading
apps/cli/src/load.ts - Context command
apps/cli/src/cmd-context.ts - Component discovery and context
packages/parser/src/index.ts - Snapshot and design schemas
packages/schema/src/snapshot.ts
Token outputs
- Token build command
apps/cli/src/cmd-tokens.ts - Token transformation
packages/tokens/src/index.ts - DTCG conversion
packages/tokens/src/dtcg.ts - CSS output
packages/tokens/src/css.ts - Swift and Kotlin output
packages/tokens/src/swift.ts
Figma integrations
- Figma exporter
packages/adapters/plugin/src/export.ts - Figma REST sync
packages/adapters/rest/src/client.ts
Evaluation and verification
- Evaluation commands
apps/cli/src/cmd-eval.ts - Agent evaluation harness
packages/eval/src/agent-session-port.ts - Variant coverage scoring
packages/eval/src/coverage.ts - Repository verification
packages/verify/src/index.ts - Verification gates
packages/verify/src/gates/tests.ts
Other components
- Developer
- Coding agent
- Figma page
Connections 21
- Developer → CLI dispatcher: runs commands
README.md - CLI dispatcher → Argument parsing: parses arguments
apps/cli/src/main.ts - CLI dispatcher → Context command: dispatches context
apps/cli/src/main.ts - CLI dispatcher → Token build command: dispatches tokens
apps/cli/src/main.ts - CLI dispatcher → Evaluation commands: dispatches evaluation
apps/cli/src/main.ts - Context command → Snapshot loading: loads snapshot
apps/cli/src/cmd-context.ts - Context command → Component discovery and context: builds context
apps/cli/src/cmd-context.ts - Component discovery and context → Snapshot and design schemas: uses snapshot types
packages/parser/src/index.ts - Coding agent → MCP server tools: requests context
README.md - Figma exporter → Snapshot loading: exports snapshot
README.md - Figma page → Figma exporter: provides page
README.md - Developer → Figma REST sync: syncs design
README.md - Token build command → Snapshot loading: loads snapshot
- Token build command → Token transformation: builds tokens
- Token transformation → DTCG conversion: converts to DTCG
packages/tokens/src/index.ts - Token transformation → CSS output: emits CSS
packages/tokens/src/index.ts - Token transformation → Swift and Kotlin output: emits native code
packages/tokens/src/index.ts - Developer → Coding agent: uses design context
README.md - Evaluation commands → Agent evaluation harness: runs harness
apps/cli/src/cmd-eval.ts - Agent evaluation harness → Variant coverage scoring: scores coverage
packages/eval/src/agent-session-port.ts - Repository verification → Verification gates: runs gates
packages/verify/src/index.ts