Initial commit: Clean DSS implementation

Migrated from design-system-swarm with fresh git history.
Old project history preserved in /home/overbits/apps/design-system-swarm

Core components:
- MCP Server (Python FastAPI with mcp 1.23.1)
- Claude Plugin (agents, commands, skills, strategies, hooks, core)
- DSS Backend (dss-mvp1 - token translation, Figma sync)
- Admin UI (Node.js/React)
- Server (Node.js/Express)
- Storybook integration (dss-mvp1/.storybook)

Self-contained configuration:
- All paths relative or use DSS_BASE_PATH=/home/overbits/dss
- PYTHONPATH configured for dss-mvp1 and dss-claude-plugin
- .env file with all configuration
- Claude plugin uses ${CLAUDE_PLUGIN_ROOT} for portability

Migration completed: $(date)
🤖 Clean migration with full functionality preserved
This commit is contained in:
Digital Production Factory
2025-12-09 18:45:48 -03:00
commit 276ed71f31
884 changed files with 373737 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
{
"version": "0.1.0",
"createdAt": "2025-12-03T21:44:57.704Z",
"data": {
"projects": [],
"teams": [],
"activities": []
}
}

View File

@@ -0,0 +1,85 @@
{
"$schema": "dss-knowledge-v1",
"type": "architecture",
"version": "0.8.0",
"last_updated": "2025-12-07",
"modules": [
{
"name": "messaging",
"path": "admin-ui/js/core/messaging.js",
"purpose": "Centralized notification system with structured error taxonomy and correlation IDs",
"features": [
"Event bus using CustomEvent API",
"Structured message format with correlation IDs",
"Error taxonomy (E1xxx-E5xxx for errors, S1xxx for success)",
"Message persistence via localStorage",
"Helper functions: notifySuccess, notifyError, notifyWarning, notifyInfo",
"Message history and debugging capabilities"
],
"error_codes": {
"E1xxx": "User errors (invalid input, forbidden actions)",
"E2xxx": "Validation errors (missing fields, invalid formats)",
"E3xxx": "API errors (request failed, timeout, unauthorized)",
"E4xxx": "System errors (unexpected, network, storage)",
"E5xxx": "Integration errors (Figma connection, API errors)",
"S1xxx": "Success codes (operation complete, created, updated, deleted)"
}
},
{
"name": "router",
"path": "admin-ui/js/core/router.js",
"purpose": "Centralized hash-based routing with guards and lifecycle hooks",
"features": [
"Centralized route registry",
"Route guards (beforeEnter, afterEnter, onLeave)",
"History management",
"Programmatic navigation",
"Route metadata support",
"Common guards (requireAuth, requireProject)"
],
"routes": [
"dashboard",
"projects",
"tokens",
"components",
"figma",
"docs",
"teams",
"audit",
"settings",
"services",
"quick-wins",
"chat"
]
},
{
"name": "workflows",
"path": "admin-ui/js/core/workflows.js",
"purpose": "Orchestrate multi-step user workflows with state machines",
"features": [
"Base StateMachine class",
"CreateProjectWorkflow (Create → Configure → Extract → Success)",
"TokenExtractionWorkflow (Connect → Select → Extract → Sync)",
"Progress tracking",
"State transition guards",
"Side effects via actions",
"Event emission for UI updates"
]
}
],
"design_patterns": [
"Separation of Concerns",
"Single Responsibility Principle",
"Dependency Injection",
"Observer Pattern",
"State Machine Pattern",
"Command Pattern",
"Strategy Pattern"
],
"performance": {
"bundle_size_increase": "+15KB (minified)",
"initialization_time_increase": "+50ms",
"memory_usage": "+~1MB (50 messages in localStorage)",
"network_impact": "No additional requests"
}
}

View File

@@ -0,0 +1,152 @@
{
"$schema": "dss-knowledge-v1",
"type": "mcp_tools",
"version": "1.0.0",
"last_updated": "2025-12-07",
"architecture": "MCP-first - All work via MCP tools, no REST endpoints",
"tools": [
{
"name": "dss_create_project",
"purpose": "Create a new DSS project with empty Figma manifest",
"inputs": {
"name": "string (required) - Project name",
"root_path": "string (required) - Project root path",
"description": "string (optional) - Project description"
},
"outputs": {
"project_id": "string",
"name": "string",
"root_path": "string",
"manifest_path": "string",
"status": "string"
},
"operations": [
"Insert into projects table",
"Create figma.json manifest in project folder",
"Return project metadata",
"Emit project-created event"
]
},
{
"name": "dss_setup_figma_credentials",
"purpose": "Store Figma API token at user level (encrypted)",
"inputs": {
"api_token": "string (required) - Figma Personal Access Token"
},
"outputs": {
"status": "string",
"figma_user": "string",
"workspace": "string",
"message": "string"
},
"operations": [
"Validate token by testing Figma API",
"Encrypt and store in project_integrations table",
"Update integration_health table"
]
},
{
"name": "dss_get_project_manifest",
"purpose": "Read project's figma.json manifest",
"inputs": {
"project_id": "string (required) - Project ID"
},
"outputs": {
"version": "string",
"files": "array",
"lastUpdated": "string"
}
},
{
"name": "dss_add_figma_file",
"purpose": "Add Figma file reference to project manifest",
"inputs": {
"project_id": "string (required) - Project ID",
"file_key": "string (required) - Figma file key or URL",
"file_name": "string (optional) - Display name for the file"
},
"outputs": {
"project_id": "string",
"file_key": "string",
"file_name": "string",
"status": "string",
"files_count": "number"
},
"operations": [
"Extract file key from URL if needed",
"Check if file already linked",
"Add file to manifest",
"Write manifest back to filesystem"
]
},
{
"name": "dss_discover_figma_files",
"purpose": "Discover available Figma files and suggest linking",
"inputs": {
"project_id": "string (required) - Project ID"
},
"outputs": {
"project_id": "string",
"linked_files": "array",
"available_files": "array",
"total_available": "number",
"message": "string"
},
"operations": [
"Get user's Figma credentials from database",
"Fetch user's teams from Figma API",
"Get projects and files in each team",
"Return available files excluding already linked"
]
},
{
"name": "dss_list_project_figma_files",
"purpose": "List all Figma files currently linked to project",
"inputs": {
"project_id": "string (required) - Project ID"
},
"outputs": {
"project_id": "string",
"files": "array",
"count": "number"
}
}
],
"architecture_benefits": [
"No REST endpoints - All work via MCP tools",
"User-level credentials - Figma tokens stored per-user in database",
"Manifest-driven - figma.json declares project dependencies",
"Versionable - Manifests can be checked into git",
"Discoverable - Claude can list available Figma files",
"Audit trail - All operations logged in mcp_tool_usage",
"Circuit breaker - Protected against cascading API failures",
"Encrypted storage - Credentials encrypted with Fernet"
],
"context_compiler_tools": [
{
"name": "dss_get_resolved_context",
"description": "Get fully resolved design system context for a project. Returns compiled tokens from 3-layer cascade (base → skin → project)",
"parameters": ["manifest_path", "debug", "force_refresh"]
},
{
"name": "dss_resolve_token",
"description": "Resolve a specific design token through the cascade. Use dot-notation (e.g. 'colors.primary')",
"parameters": ["manifest_path", "token_path", "force_refresh"]
},
{
"name": "dss_validate_manifest",
"description": "Validate project manifest (ds.config.json) against schema",
"parameters": ["manifest_path"]
},
{
"name": "dss_list_skins",
"description": "List all available design system skins in the registry",
"parameters": []
},
{
"name": "dss_get_compiler_status",
"description": "Get Context Compiler health and configuration status",
"parameters": []
}
]
}

View File

@@ -0,0 +1,500 @@
{
"$schema": "dss-knowledge-v1",
"type": "mcp_tools",
"version": "1.0.0",
"last_updated": null,
"architecture": "MCP-first - All work via MCP tools, no REST endpoints",
"tools": [
{
"name": "dss_analyze_project",
"description": "Analyze a project for design system patterns, component usage, and tokenization opportunities. Returns comprehensive analysis including style patterns, React components, and dependency graph.",
"category": "project_management",
"parameters": [
"path",
"type",
"description"
]
},
{
"name": "dss_extract_tokens",
"description": "Extract design tokens from CSS, SCSS, Tailwind, or JSON sources. Returns a unified TokenCollection with all discovered tokens.",
"category": "token_ingestion",
"parameters": [
"path",
"type",
"description"
],
"handler_line": 714
},
{
"name": "dss_generate_theme",
"description": "Generate theme files from design tokens using style-dictionary. Supports CSS, SCSS, JSON, and JS output formats.",
"category": "utilities",
"parameters": [
"tokens",
"type",
"description"
],
"handler_line": 719
},
{
"name": "dss_list_themes",
"description": "List all available themes in the DSS system",
"category": "utilities",
"parameters": [
"format",
"type",
"enum",
"description"
],
"handler_line": 725
},
{
"name": "dss_get_status",
"description": "Get DSS system status including health checks, dependencies, configuration, metrics, and recommendations.",
"category": "utilities",
"parameters": [
"format",
"type",
"enum",
"description"
],
"handler_line": 727
},
{
"name": "dss_audit_components",
"description": "Audit React components for design system adoption. Identifies hardcoded values, missing tokens, and refactoring opportunities.",
"category": "analysis",
"parameters": [
"path",
"type",
"description"
],
"handler_line": 729
},
{
"name": "dss_setup_storybook",
"description": "Set up or configure Storybook for the project. Generates stories and theme configuration.",
"category": "storybook",
"parameters": [
"path",
"type",
"description"
],
"handler_line": 731
},
{
"name": "dss_sync_figma",
"description": "Sync design tokens from a Figma file. Requires FIGMA_TOKEN environment variable.",
"category": "figma_integration",
"parameters": [
"file_key",
"type",
"description"
],
"handler_line": 736
},
{
"name": "dss_find_quick_wins",
"description": "Find quick win opportunities for design system adoption. Identifies low-effort, high-impact improvements.",
"category": "utilities",
"parameters": [
"path",
"type",
"description"
],
"handler_line": 738
},
{
"name": "dss_transform_tokens",
"description": "Transform tokens between formats using style-dictionary",
"category": "token_ingestion",
"parameters": [
"tokens",
"type",
"description"
],
"handler_line": 740
},
{
"name": "devtools_launch",
"description": "Launch a new headless Chromium browser. Use this on remote/headless servers where no Chrome is running.",
"category": "browser_tools",
"parameters": [
"url",
"type",
"description"
],
"handler_line": 747
},
{
"name": "devtools_connect",
"description": "Connect to a running Chrome browser with remote debugging enabled. Start Chrome with: --remote-debugging-port=9222",
"category": "browser_tools",
"parameters": [
"port",
"type",
"description"
],
"handler_line": 752
},
{
"name": "devtools_disconnect",
"description": "Disconnect from Chrome DevTools and clean up resources.",
"category": "browser_tools",
"parameters": [
"page_id",
"type",
"description"
],
"handler_line": 757
},
{
"name": "devtools_list_pages",
"description": "List all available pages (tabs) in the connected browser with their URLs and titles.",
"category": "browser_tools",
"parameters": [
"page_id",
"type",
"description"
],
"handler_line": 759
},
{
"name": "devtools_select_page",
"description": "Set the active page for subsequent DevTools operations. Console and network logging will be enabled for the selected page.",
"category": "browser_tools",
"parameters": [
"page_id",
"type",
"description"
],
"handler_line": 761
},
{
"name": "devtools_console_logs",
"description": "Retrieve captured console log messages (log, warn, error, info, debug) from the active page.",
"category": "browser_tools",
"parameters": [
"level",
"type",
"enum",
"description"
],
"handler_line": 763
},
{
"name": "devtools_network_requests",
"description": "Retrieve captured network requests from the active page. Includes URL, method, headers, and resource type.",
"category": "browser_tools",
"parameters": [
"filter_url",
"type",
"description"
],
"handler_line": 769
},
{
"name": "devtools_evaluate",
"description": "Execute a JavaScript expression in the context of the active page and return the result.",
"category": "browser_tools",
"parameters": [
"expression",
"type",
"description"
],
"handler_line": 774
},
{
"name": "devtools_query_dom",
"description": "Query DOM elements on the active page using a CSS selector. Returns tag, text content, and outer HTML for each match.",
"category": "browser_tools",
"parameters": [
"selector",
"type",
"description"
],
"handler_line": 776
},
{
"name": "devtools_goto",
"description": "Navigate the active page to a URL.",
"category": "browser_tools",
"parameters": [
"url",
"type",
"description"
],
"handler_line": 778
},
{
"name": "devtools_screenshot",
"description": "Capture a screenshot of the active page or a specific element. Returns base64 encoded PNG.",
"category": "browser_tools",
"parameters": [
"selector",
"type",
"description"
],
"handler_line": 783
},
{
"name": "devtools_performance",
"description": "Get performance metrics for the active page including page load time, DNS lookup, TCP connect, and response times.",
"category": "browser_tools",
"parameters": [
"mode",
"type",
"enum",
"description"
],
"handler_line": 788
},
{
"name": "browser_init",
"description": "Initialize browser automation. Mode ",
"category": "browser_tools",
"parameters": [
"mode",
"type",
"enum",
"description"
],
"handler_line": 791
},
{
"name": "browser_get_logs",
"description": "Get console logs from the browser. Works in both LOCAL and REMOTE modes.",
"category": "browser_tools",
"parameters": [
"level",
"type",
"enum",
"description"
],
"handler_line": 798
},
{
"name": "browser_screenshot",
"description": "Capture a screenshot from the browser. Requires LOCAL mode.",
"category": "browser_tools",
"parameters": [
"selector",
"type",
"description"
],
"handler_line": 803
},
{
"name": "browser_dom_snapshot",
"description": "Get current DOM state as HTML. Works in both LOCAL and REMOTE modes.",
"category": "browser_tools",
"parameters": [
"limit",
"type",
"description"
],
"handler_line": 808
},
{
"name": "browser_get_errors",
"description": "Get captured errors (uncaught exceptions, unhandled rejections). Works in both modes.",
"category": "browser_tools",
"parameters": [
"limit",
"type",
"description"
],
"handler_line": 810
},
{
"name": "browser_accessibility_audit",
"description": "Run accessibility audit using axe-core. Returns WCAG violations and passes.",
"category": "analysis",
"parameters": [
"selector",
"type",
"description"
],
"handler_line": 814
},
{
"name": "browser_performance",
"description": "Get Core Web Vitals and performance metrics (TTFB, FCP, LCP, CLS).",
"category": "browser_tools",
"parameters": [
"manifest_path",
"type",
"description"
],
"handler_line": 818
},
{
"name": "browser_close",
"description": "Close the browser automation session and clean up resources.",
"category": "browser_tools",
"parameters": [
"manifest_path",
"type",
"description"
],
"handler_line": 820
},
{
"name": "dss_get_resolved_context",
"description": "Get fully resolved design system context for a project. Returns compiled tokens from 3-layer cascade (base \u2192 skin \u2192 project).",
"category": "context_compiler",
"parameters": [
"manifest_path",
"type",
"description"
],
"handler_line": 823
},
{
"name": "dss_resolve_token",
"description": "Resolve a specific design token through the cascade. Use dot-notation (e.g. ",
"category": "token_ingestion",
"parameters": [
"manifest_path",
"type",
"description"
],
"handler_line": 840
},
{
"name": "dss_validate_manifest",
"description": "Validate project manifest (ds.config.json) against schema.",
"category": "utilities",
"parameters": [
"manifest_path",
"type",
"description"
],
"handler_line": 857
},
{
"name": "dss_list_skins",
"description": "List all available design system skins in the registry.",
"category": "utilities",
"parameters": [],
"handler_line": 870
},
{
"name": "dss_get_compiler_status",
"description": "Get Context Compiler health and configuration status.",
"category": "context_compiler",
"parameters": [],
"handler_line": 883
}
],
"architecture_benefits": [
"No REST endpoints - All work via MCP tools",
"User-level credentials - Figma tokens stored per-user in database",
"Manifest-driven - figma.json declares project dependencies",
"Versionable - Manifests can be checked into git",
"Discoverable - Claude can list available Figma files",
"Audit trail - All operations logged in mcp_tool_usage",
"Circuit breaker - Protected against cascading API failures",
"Encrypted storage - Credentials encrypted with Fernet"
],
"context_compiler_tools": [
{
"name": "dss_get_resolved_context",
"description": "Get fully resolved design system context for a project. Returns compiled tokens from 3-layer cascade (base \u2192 skin \u2192 project)",
"parameters": [
"manifest_path",
"debug",
"force_refresh"
]
},
{
"name": "dss_resolve_token",
"description": "Resolve a specific design token through the cascade. Use dot-notation (e.g. 'colors.primary')",
"parameters": [
"manifest_path",
"token_path",
"force_refresh"
]
},
{
"name": "dss_validate_manifest",
"description": "Validate project manifest (ds.config.json) against schema",
"parameters": [
"manifest_path"
]
},
{
"name": "dss_list_skins",
"description": "List all available design system skins in the registry",
"parameters": []
},
{
"name": "dss_get_compiler_status",
"description": "Get Context Compiler health and configuration status",
"parameters": []
}
],
"total_tools": 35,
"categories": {
"project_management": [
"dss_analyze_project"
],
"token_ingestion": [
"dss_extract_tokens",
"dss_transform_tokens",
"dss_resolve_token"
],
"utilities": [
"dss_generate_theme",
"dss_list_themes",
"dss_get_status",
"dss_find_quick_wins",
"dss_validate_manifest",
"dss_list_skins"
],
"analysis": [
"dss_audit_components",
"browser_accessibility_audit"
],
"storybook": [
"dss_setup_storybook"
],
"figma_integration": [
"dss_sync_figma"
],
"browser_tools": [
"devtools_launch",
"devtools_connect",
"devtools_disconnect",
"devtools_list_pages",
"devtools_select_page",
"devtools_console_logs",
"devtools_network_requests",
"devtools_evaluate",
"devtools_query_dom",
"devtools_goto",
"devtools_screenshot",
"devtools_performance",
"browser_init",
"browser_get_logs",
"browser_screenshot",
"browser_dom_snapshot",
"browser_get_errors",
"browser_performance",
"browser_close"
],
"context_compiler": [
"dss_get_resolved_context",
"dss_get_compiler_status"
]
},
"_metadata": {
"generator": "MCPExtractor",
"generated_at": "2025-12-07T18:27:12.154204",
"source_files": [
"/home/overbits/dss/dss-claude-plugin/servers/dss-mcp-server.py"
],
"version": "1.0.0"
}
}