moai-adk 0.35.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of moai-adk might be problematic. Click here for more details.
- moai_adk/__init__.py +10 -0
- moai_adk/__main__.py +199 -0
- moai_adk/cli/__init__.py +6 -0
- moai_adk/cli/commands/__init__.py +17 -0
- moai_adk/cli/commands/analyze.py +116 -0
- moai_adk/cli/commands/doctor.py +272 -0
- moai_adk/cli/commands/init.py +372 -0
- moai_adk/cli/commands/language.py +248 -0
- moai_adk/cli/commands/status.py +104 -0
- moai_adk/cli/commands/update.py +2686 -0
- moai_adk/cli/main.py +13 -0
- moai_adk/cli/prompts/__init__.py +5 -0
- moai_adk/cli/prompts/init_prompts.py +219 -0
- moai_adk/cli/spec_status.py +263 -0
- moai_adk/cli/ui/__init__.py +44 -0
- moai_adk/cli/ui/progress.py +422 -0
- moai_adk/cli/ui/prompts.py +389 -0
- moai_adk/cli/ui/theme.py +129 -0
- moai_adk/cli/worktree/__init__.py +27 -0
- moai_adk/cli/worktree/__main__.py +31 -0
- moai_adk/cli/worktree/cli.py +683 -0
- moai_adk/cli/worktree/exceptions.py +89 -0
- moai_adk/cli/worktree/manager.py +493 -0
- moai_adk/cli/worktree/models.py +65 -0
- moai_adk/cli/worktree/registry.py +422 -0
- moai_adk/core/PHASE2_OPTIMIZATIONS.md +467 -0
- moai_adk/core/__init__.py +1 -0
- moai_adk/core/analysis/__init__.py +9 -0
- moai_adk/core/analysis/session_analyzer.py +400 -0
- moai_adk/core/claude_integration.py +393 -0
- moai_adk/core/command_helpers.py +270 -0
- moai_adk/core/comprehensive_monitoring_system.py +1183 -0
- moai_adk/core/config/__init__.py +19 -0
- moai_adk/core/config/auto_spec_config.py +340 -0
- moai_adk/core/config/migration.py +244 -0
- moai_adk/core/config/unified.py +436 -0
- moai_adk/core/context_manager.py +273 -0
- moai_adk/core/diagnostics/__init__.py +19 -0
- moai_adk/core/diagnostics/slash_commands.py +159 -0
- moai_adk/core/enterprise_features.py +1404 -0
- moai_adk/core/error_recovery_system.py +1902 -0
- moai_adk/core/event_driven_hook_system.py +1371 -0
- moai_adk/core/git/__init__.py +31 -0
- moai_adk/core/git/branch.py +25 -0
- moai_adk/core/git/branch_manager.py +129 -0
- moai_adk/core/git/checkpoint.py +134 -0
- moai_adk/core/git/commit.py +67 -0
- moai_adk/core/git/conflict_detector.py +413 -0
- moai_adk/core/git/event_detector.py +79 -0
- moai_adk/core/git/manager.py +216 -0
- moai_adk/core/hooks/post_tool_auto_spec_completion.py +901 -0
- moai_adk/core/input_validation_middleware.py +1006 -0
- moai_adk/core/integration/__init__.py +22 -0
- moai_adk/core/integration/engine.py +157 -0
- moai_adk/core/integration/integration_tester.py +226 -0
- moai_adk/core/integration/models.py +88 -0
- moai_adk/core/integration/utils.py +211 -0
- moai_adk/core/issue_creator.py +305 -0
- moai_adk/core/jit_context_loader.py +956 -0
- moai_adk/core/jit_enhanced_hook_manager.py +1987 -0
- moai_adk/core/language_config.py +202 -0
- moai_adk/core/language_config_resolver.py +572 -0
- moai_adk/core/language_validator.py +543 -0
- moai_adk/core/mcp/setup.py +116 -0
- moai_adk/core/merge/__init__.py +9 -0
- moai_adk/core/merge/analyzer.py +605 -0
- moai_adk/core/migration/__init__.py +18 -0
- moai_adk/core/migration/alfred_to_moai_migrator.py +383 -0
- moai_adk/core/migration/backup_manager.py +277 -0
- moai_adk/core/migration/custom_element_scanner.py +358 -0
- moai_adk/core/migration/file_migrator.py +209 -0
- moai_adk/core/migration/interactive_checkbox_ui.py +488 -0
- moai_adk/core/migration/selective_restorer.py +470 -0
- moai_adk/core/migration/template_utils.py +74 -0
- moai_adk/core/migration/user_selection_ui.py +338 -0
- moai_adk/core/migration/version_detector.py +139 -0
- moai_adk/core/migration/version_migrator.py +228 -0
- moai_adk/core/performance/__init__.py +6 -0
- moai_adk/core/performance/cache_system.py +316 -0
- moai_adk/core/performance/parallel_processor.py +116 -0
- moai_adk/core/phase_optimized_hook_scheduler.py +879 -0
- moai_adk/core/project/__init__.py +1 -0
- moai_adk/core/project/backup_utils.py +70 -0
- moai_adk/core/project/checker.py +300 -0
- moai_adk/core/project/detector.py +293 -0
- moai_adk/core/project/initializer.py +387 -0
- moai_adk/core/project/phase_executor.py +716 -0
- moai_adk/core/project/validator.py +139 -0
- moai_adk/core/quality/__init__.py +6 -0
- moai_adk/core/quality/trust_checker.py +377 -0
- moai_adk/core/quality/validators/__init__.py +6 -0
- moai_adk/core/quality/validators/base_validator.py +19 -0
- moai_adk/core/realtime_monitoring_dashboard.py +1724 -0
- moai_adk/core/robust_json_parser.py +611 -0
- moai_adk/core/rollback_manager.py +918 -0
- moai_adk/core/session_manager.py +651 -0
- moai_adk/core/skill_loading_system.py +579 -0
- moai_adk/core/spec/confidence_scoring.py +680 -0
- moai_adk/core/spec/ears_template_engine.py +1247 -0
- moai_adk/core/spec/quality_validator.py +687 -0
- moai_adk/core/spec_status_manager.py +478 -0
- moai_adk/core/template/__init__.py +7 -0
- moai_adk/core/template/backup.py +174 -0
- moai_adk/core/template/config.py +191 -0
- moai_adk/core/template/languages.py +43 -0
- moai_adk/core/template/merger.py +233 -0
- moai_adk/core/template/processor.py +1200 -0
- moai_adk/core/template_engine.py +310 -0
- moai_adk/core/template_variable_synchronizer.py +417 -0
- moai_adk/core/unified_permission_manager.py +745 -0
- moai_adk/core/user_behavior_analytics.py +851 -0
- moai_adk/core/version_sync.py +429 -0
- moai_adk/foundation/__init__.py +56 -0
- moai_adk/foundation/backend.py +1027 -0
- moai_adk/foundation/database.py +1115 -0
- moai_adk/foundation/devops.py +1585 -0
- moai_adk/foundation/ears.py +431 -0
- moai_adk/foundation/frontend.py +870 -0
- moai_adk/foundation/git/commit_templates.py +557 -0
- moai_adk/foundation/git.py +376 -0
- moai_adk/foundation/langs.py +484 -0
- moai_adk/foundation/ml_ops.py +1162 -0
- moai_adk/foundation/testing.py +1524 -0
- moai_adk/foundation/trust/trust_principles.py +676 -0
- moai_adk/foundation/trust/validation_checklist.py +1573 -0
- moai_adk/project/__init__.py +0 -0
- moai_adk/project/configuration.py +1084 -0
- moai_adk/project/documentation.py +566 -0
- moai_adk/project/schema.py +447 -0
- moai_adk/statusline/__init__.py +38 -0
- moai_adk/statusline/alfred_detector.py +105 -0
- moai_adk/statusline/config.py +376 -0
- moai_adk/statusline/enhanced_output_style_detector.py +372 -0
- moai_adk/statusline/git_collector.py +190 -0
- moai_adk/statusline/main.py +322 -0
- moai_adk/statusline/metrics_tracker.py +78 -0
- moai_adk/statusline/renderer.py +343 -0
- moai_adk/statusline/update_checker.py +129 -0
- moai_adk/statusline/version_reader.py +741 -0
- moai_adk/templates/.claude/agents/moai/ai-nano-banana.md +714 -0
- moai_adk/templates/.claude/agents/moai/builder-agent.md +474 -0
- moai_adk/templates/.claude/agents/moai/builder-command.md +1172 -0
- moai_adk/templates/.claude/agents/moai/builder-plugin.md +637 -0
- moai_adk/templates/.claude/agents/moai/builder-skill.md +666 -0
- moai_adk/templates/.claude/agents/moai/expert-backend.md +899 -0
- moai_adk/templates/.claude/agents/moai/expert-database.md +777 -0
- moai_adk/templates/.claude/agents/moai/expert-debug.md +401 -0
- moai_adk/templates/.claude/agents/moai/expert-devops.md +720 -0
- moai_adk/templates/.claude/agents/moai/expert-frontend.md +734 -0
- moai_adk/templates/.claude/agents/moai/expert-performance.md +657 -0
- moai_adk/templates/.claude/agents/moai/expert-security.md +513 -0
- moai_adk/templates/.claude/agents/moai/expert-testing.md +733 -0
- moai_adk/templates/.claude/agents/moai/expert-uiux.md +1041 -0
- moai_adk/templates/.claude/agents/moai/manager-claude-code.md +432 -0
- moai_adk/templates/.claude/agents/moai/manager-docs.md +573 -0
- moai_adk/templates/.claude/agents/moai/manager-git.md +1060 -0
- moai_adk/templates/.claude/agents/moai/manager-project.md +891 -0
- moai_adk/templates/.claude/agents/moai/manager-quality.md +624 -0
- moai_adk/templates/.claude/agents/moai/manager-spec.md +809 -0
- moai_adk/templates/.claude/agents/moai/manager-strategy.md +780 -0
- moai_adk/templates/.claude/agents/moai/manager-tdd.md +784 -0
- moai_adk/templates/.claude/agents/moai/mcp-context7.md +458 -0
- moai_adk/templates/.claude/agents/moai/mcp-figma.md +1607 -0
- moai_adk/templates/.claude/agents/moai/mcp-notion.md +789 -0
- moai_adk/templates/.claude/agents/moai/mcp-playwright.md +469 -0
- moai_adk/templates/.claude/agents/moai/mcp-sequential-thinking.md +1032 -0
- moai_adk/templates/.claude/commands/moai/0-project.md +1386 -0
- moai_adk/templates/.claude/commands/moai/1-plan.md +1427 -0
- moai_adk/templates/.claude/commands/moai/2-run.md +943 -0
- moai_adk/templates/.claude/commands/moai/3-sync.md +1324 -0
- moai_adk/templates/.claude/commands/moai/9-feedback.md +314 -0
- moai_adk/templates/.claude/hooks/__init__.py +8 -0
- moai_adk/templates/.claude/hooks/moai/__init__.py +8 -0
- moai_adk/templates/.claude/hooks/moai/lib/__init__.py +85 -0
- moai_adk/templates/.claude/hooks/moai/lib/checkpoint.py +244 -0
- moai_adk/templates/.claude/hooks/moai/lib/common.py +131 -0
- moai_adk/templates/.claude/hooks/moai/lib/config_manager.py +446 -0
- moai_adk/templates/.claude/hooks/moai/lib/config_validator.py +639 -0
- moai_adk/templates/.claude/hooks/moai/lib/example_config.json +104 -0
- moai_adk/templates/.claude/hooks/moai/lib/git_operations_manager.py +590 -0
- moai_adk/templates/.claude/hooks/moai/lib/language_validator.py +317 -0
- moai_adk/templates/.claude/hooks/moai/lib/models.py +102 -0
- moai_adk/templates/.claude/hooks/moai/lib/path_utils.py +28 -0
- moai_adk/templates/.claude/hooks/moai/lib/project.py +768 -0
- moai_adk/templates/.claude/hooks/moai/lib/test_hooks_improvements.py +443 -0
- moai_adk/templates/.claude/hooks/moai/lib/timeout.py +160 -0
- moai_adk/templates/.claude/hooks/moai/lib/unified_timeout_manager.py +530 -0
- moai_adk/templates/.claude/hooks/moai/session_end__auto_cleanup.py +862 -0
- moai_adk/templates/.claude/hooks/moai/session_start__show_project_info.py +1083 -0
- moai_adk/templates/.claude/output-styles/moai/r2d2.md +560 -0
- moai_adk/templates/.claude/output-styles/moai/yoda.md +359 -0
- moai_adk/templates/.claude/settings.json +172 -0
- moai_adk/templates/.claude/skills/moai-ai-nano-banana/SKILL.md +307 -0
- moai_adk/templates/.claude/skills/moai-ai-nano-banana/examples.md +431 -0
- moai_adk/templates/.claude/skills/moai-ai-nano-banana/scripts/batch_generate.py +560 -0
- moai_adk/templates/.claude/skills/moai-ai-nano-banana/scripts/generate_image.py +362 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/SKILL.md +249 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/examples.md +406 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/modules/README.md +44 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/modules/api-documentation.md +130 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/modules/code-documentation.md +152 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/modules/multi-format-output.md +178 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/modules/user-guides.md +147 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/reference.md +328 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +320 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +718 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +464 -0
- moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +323 -0
- moai_adk/templates/.claude/skills/moai-domain-database/examples.md +830 -0
- moai_adk/templates/.claude/skills/moai-domain-database/modules/README.md +53 -0
- moai_adk/templates/.claude/skills/moai-domain-database/modules/mongodb.md +231 -0
- moai_adk/templates/.claude/skills/moai-domain-database/modules/postgresql.md +169 -0
- moai_adk/templates/.claude/skills/moai-domain-database/modules/redis.md +262 -0
- moai_adk/templates/.claude/skills/moai-domain-database/reference.md +545 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +497 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +968 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +664 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/SKILL.md +455 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/examples.md +560 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/modules/accessibility-wcag.md +260 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/modules/component-architecture.md +228 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/modules/icon-libraries.md +401 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/modules/theming-system.md +373 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/reference.md +243 -0
- moai_adk/templates/.claude/skills/moai-formats-data/SKILL.md +492 -0
- moai_adk/templates/.claude/skills/moai-formats-data/examples.md +804 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/README.md +98 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/SKILL-MODULARIZATION-TEMPLATE.md +278 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/caching-performance.md +459 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/data-validation.md +485 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/json-optimization.md +374 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/toon-encoding.md +308 -0
- moai_adk/templates/.claude/skills/moai-formats-data/reference.md +585 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/SKILL.md +202 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/examples.md +732 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/best-practices-checklist.md +616 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-custom-slash-commands-official.md +729 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-hooks-official.md +560 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-iam-official.md +635 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-memory-official.md +543 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-settings-official.md +663 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-skills-official.md +113 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-sub-agents-official.md +238 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/complete-configuration-guide.md +175 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/skill-examples.md +1674 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/skill-formatting-guide.md +729 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-examples.md +1513 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-formatting-guide.md +1086 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-integration-patterns.md +1100 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference.md +209 -0
- moai_adk/templates/.claude/skills/moai-foundation-context/SKILL.md +441 -0
- moai_adk/templates/.claude/skills/moai-foundation-context/examples.md +1048 -0
- moai_adk/templates/.claude/skills/moai-foundation-context/reference.md +246 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/SKILL.md +420 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/examples.md +358 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/README.md +296 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/agents-reference.md +359 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/commands-reference.md +432 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/delegation-patterns.md +757 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/execution-rules.md +687 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/modular-system.md +665 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/progressive-disclosure.md +649 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/spec-first-tdd.md +864 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/token-optimization.md +708 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/trust-5-framework.md +981 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/reference.md +478 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/SKILL.md +315 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/examples.md +228 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/modules/assumption-matrix.md +80 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/modules/cognitive-bias.md +199 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/modules/first-principles.md +140 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/modules/trade-off-analysis.md +154 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/reference.md +157 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/SKILL.md +364 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/examples.md +1232 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/modules/best-practices.md +261 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/modules/integration-patterns.md +194 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/modules/proactive-analysis.md +229 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/modules/trust5-validation.md +169 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/reference.md +1266 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/scripts/quality-gate.sh +668 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/templates/github-actions-quality.yml +481 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/templates/quality-config.yaml +519 -0
- moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +649 -0
- moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +478 -0
- moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +612 -0
- moai_adk/templates/.claude/skills/moai-lang-flutter/SKILL.md +477 -0
- moai_adk/templates/.claude/skills/moai-lang-flutter/examples.md +1090 -0
- moai_adk/templates/.claude/skills/moai-lang-flutter/reference.md +686 -0
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +376 -0
- moai_adk/templates/.claude/skills/moai-lang-go/examples.md +919 -0
- moai_adk/templates/.claude/skills/moai-lang-go/reference.md +737 -0
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +385 -0
- moai_adk/templates/.claude/skills/moai-lang-java/examples.md +864 -0
- moai_adk/templates/.claude/skills/moai-lang-java/reference.md +291 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +382 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +1006 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +562 -0
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +644 -0
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +481 -0
- moai_adk/templates/.claude/skills/moai-lang-python/examples.md +977 -0
- moai_adk/templates/.claude/skills/moai-lang-python/reference.md +804 -0
- moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +579 -0
- moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +687 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +372 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +659 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +504 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +497 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +633 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +423 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +497 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +918 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +672 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +368 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +1089 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +731 -0
- moai_adk/templates/.claude/skills/moai-library-mermaid/SKILL.md +300 -0
- moai_adk/templates/.claude/skills/moai-library-mermaid/advanced-patterns.md +465 -0
- moai_adk/templates/.claude/skills/moai-library-mermaid/examples.md +270 -0
- moai_adk/templates/.claude/skills/moai-library-mermaid/optimization.md +440 -0
- moai_adk/templates/.claude/skills/moai-library-mermaid/reference.md +228 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/SKILL.md +319 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/advanced-patterns.md +336 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/examples.md +592 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/advanced-deployment-patterns.md +182 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/advanced-patterns.md +17 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/configuration.md +57 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/content-architecture-optimization.md +162 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/deployment.md +52 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/framework-core-configuration.md +186 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/i18n-setup.md +55 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/mdx-components.md +52 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/optimization.md +303 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/reference.md +379 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/SKILL.md +372 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/examples.md +575 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/modules/advanced-patterns.md +394 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/modules/optimization.md +278 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/modules/shadcn-components.md +457 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/modules/shadcn-theming.md +373 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/reference.md +74 -0
- moai_adk/templates/.claude/skills/moai-mcp-figma/SKILL.md +402 -0
- moai_adk/templates/.claude/skills/moai-mcp-figma/advanced-patterns.md +607 -0
- moai_adk/templates/.claude/skills/moai-mcp-notion/SKILL.md +300 -0
- moai_adk/templates/.claude/skills/moai-mcp-notion/advanced-patterns.md +537 -0
- moai_adk/templates/.claude/skills/moai-platform-auth0/SKILL.md +291 -0
- moai_adk/templates/.claude/skills/moai-platform-clerk/SKILL.md +390 -0
- moai_adk/templates/.claude/skills/moai-platform-convex/SKILL.md +398 -0
- moai_adk/templates/.claude/skills/moai-platform-firebase-auth/SKILL.md +379 -0
- moai_adk/templates/.claude/skills/moai-platform-firestore/SKILL.md +358 -0
- moai_adk/templates/.claude/skills/moai-platform-neon/SKILL.md +467 -0
- moai_adk/templates/.claude/skills/moai-platform-railway/SKILL.md +377 -0
- moai_adk/templates/.claude/skills/moai-platform-supabase/SKILL.md +466 -0
- moai_adk/templates/.claude/skills/moai-platform-vercel/SKILL.md +482 -0
- moai_adk/templates/.claude/skills/moai-plugin-builder/SKILL.md +474 -0
- moai_adk/templates/.claude/skills/moai-plugin-builder/examples.md +621 -0
- moai_adk/templates/.claude/skills/moai-plugin-builder/migration.md +341 -0
- moai_adk/templates/.claude/skills/moai-plugin-builder/reference.md +463 -0
- moai_adk/templates/.claude/skills/moai-plugin-builder/validation.md +373 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/SKILL.md +275 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/adaptive-mfa.md +233 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/akamai-integration.md +215 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/application-credentials.md +280 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/attack-protection-log-events.md +225 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/attack-protection-overview.md +140 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/bot-detection.md +144 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/breached-password-detection.md +187 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/brute-force-protection.md +189 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/certifications.md +282 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/compliance-overview.md +263 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/continuous-session-protection.md +307 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/customize-mfa.md +178 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/dpop-implementation.md +283 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/fapi-implementation.md +259 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/gdpr-compliance.md +313 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/guardian-configuration.md +269 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/highly-regulated-identity.md +272 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/jwt-fundamentals.md +248 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/mdl-verification.md +211 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/mfa-api-management.md +278 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/mfa-factors.md +226 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/mfa-overview.md +174 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/mtls-sender-constraining.md +316 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/ropg-flow-mfa.md +217 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/security-center.md +325 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/security-guidance.md +277 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/state-parameters.md +178 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/step-up-authentication.md +251 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/suspicious-ip-throttling.md +240 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/tenant-access-control.md +180 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/webauthn-fido.md +235 -0
- moai_adk/templates/.claude/skills/moai-workflow-jit-docs/SKILL.md +449 -0
- moai_adk/templates/.claude/skills/moai-workflow-jit-docs/advanced-patterns.md +379 -0
- moai_adk/templates/.claude/skills/moai-workflow-jit-docs/examples.md +544 -0
- moai_adk/templates/.claude/skills/moai-workflow-jit-docs/optimization.md +286 -0
- moai_adk/templates/.claude/skills/moai-workflow-jit-docs/reference.md +307 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/README.md +190 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/SKILL.md +390 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/__init__.py +520 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/complete_workflow_demo_fixed.py +574 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples/complete_project_setup.py +317 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples/complete_workflow_demo.py +663 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples/config-migration-example.json +190 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples/question-examples.json +175 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples/quick_start.py +196 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples.md +547 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/__init__.py +17 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/advanced-patterns.md +158 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/ask_user_integration.py +340 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/batch_questions.py +713 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/config_manager.py +538 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/documentation_manager.py +1336 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/language_initializer.py +730 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/migration_manager.py +608 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/template_optimizer.py +1005 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/reference.md +275 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/schemas/config-schema.json +316 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/schemas/tab_schema.json +1434 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/config-template.json +71 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/product-template.md +44 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/structure-template.md +48 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/tech-template.md +92 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/config-manager-setup.json +109 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/language-initializer.json +228 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/menu-project-config.json +130 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/project-batch-questions.json +97 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/spec-workflow-setup.json +150 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/test_integration_simple.py +436 -0
- moai_adk/templates/.claude/skills/moai-workflow-spec/SKILL.md +534 -0
- moai_adk/templates/.claude/skills/moai-workflow-spec/examples.md +900 -0
- moai_adk/templates/.claude/skills/moai-workflow-spec/reference.md +704 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/SKILL.md +377 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/examples.md +552 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/modules/code-templates.md +124 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/modules/feedback-templates.md +100 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/modules/template-optimizer.md +138 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/reference.md +346 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/LICENSE.txt +202 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/SKILL.md +456 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/advanced-patterns.md +576 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/examples/ai-powered-testing.py +294 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/examples/console_logging.py +35 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/examples/element_discovery.py +40 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/examples/static_html_automation.py +34 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/examples.md +672 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/README.md +220 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/ai-debugging.md +845 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review.md +1416 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance-optimization.md +1234 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/smart-refactoring.md +1243 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/tdd-context7.md +1260 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/optimization.md +505 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/reference/playwright-best-practices.md +57 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/reference.md +440 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/scripts/with_server.py +218 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/templates/alfred-integration.md +376 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/workflows/enterprise-testing-workflow.py +571 -0
- moai_adk/templates/.claude/skills/moai-worktree/SKILL.md +411 -0
- moai_adk/templates/.claude/skills/moai-worktree/examples.md +606 -0
- moai_adk/templates/.claude/skills/moai-worktree/modules/integration-patterns.md +982 -0
- moai_adk/templates/.claude/skills/moai-worktree/modules/parallel-development.md +778 -0
- moai_adk/templates/.claude/skills/moai-worktree/modules/worktree-commands.md +646 -0
- moai_adk/templates/.claude/skills/moai-worktree/modules/worktree-management.md +782 -0
- moai_adk/templates/.claude/skills/moai-worktree/reference.md +357 -0
- moai_adk/templates/.git-hooks/pre-commit +128 -0
- moai_adk/templates/.git-hooks/pre-push +365 -0
- moai_adk/templates/.github/workflows/ci-universal.yml +513 -0
- moai_adk/templates/.github/workflows/security-secrets-check.yml +179 -0
- moai_adk/templates/.github/workflows/spec-issue-sync.yml +337 -0
- moai_adk/templates/.gitignore +222 -0
- moai_adk/templates/.mcp.json +13 -0
- moai_adk/templates/.moai/config/config.yaml +58 -0
- moai_adk/templates/.moai/config/questions/_schema.yaml +174 -0
- moai_adk/templates/.moai/config/questions/tab0-init.yaml +251 -0
- moai_adk/templates/.moai/config/questions/tab1-user.yaml +107 -0
- moai_adk/templates/.moai/config/questions/tab2-project.yaml +79 -0
- moai_adk/templates/.moai/config/questions/tab3-git.yaml +632 -0
- moai_adk/templates/.moai/config/questions/tab4-quality.yaml +182 -0
- moai_adk/templates/.moai/config/questions/tab5-system.yaml +96 -0
- moai_adk/templates/.moai/config/sections/git-strategy.yaml +116 -0
- moai_adk/templates/.moai/config/sections/language.yaml +11 -0
- moai_adk/templates/.moai/config/sections/project.yaml +13 -0
- moai_adk/templates/.moai/config/sections/quality.yaml +17 -0
- moai_adk/templates/.moai/config/sections/system.yaml +24 -0
- moai_adk/templates/.moai/config/sections/user.yaml +5 -0
- moai_adk/templates/.moai/config/statusline-config.yaml +92 -0
- moai_adk/templates/.moai/scripts/setup-glm.py +136 -0
- moai_adk/templates/CLAUDE.md +642 -0
- moai_adk/utils/__init__.py +30 -0
- moai_adk/utils/banner.py +38 -0
- moai_adk/utils/common.py +294 -0
- moai_adk/utils/link_validator.py +241 -0
- moai_adk/utils/logger.py +147 -0
- moai_adk/utils/safe_file_reader.py +206 -0
- moai_adk/utils/timeout.py +160 -0
- moai_adk/utils/toon_utils.py +256 -0
- moai_adk/version.py +22 -0
- moai_adk-0.35.1.dist-info/METADATA +3018 -0
- moai_adk-0.35.1.dist-info/RECORD +502 -0
- moai_adk-0.35.1.dist-info/WHEEL +4 -0
- moai_adk-0.35.1.dist-info/entry_points.txt +3 -0
- moai_adk-0.35.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,1607 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcp-figma
|
|
3
|
+
description: Use for Figma design analysis, design-to-code conversion, design system management, and component extraction. Integrates Figma MCP server. Specialized in design-to-code workflows, Figma API integration, and design token extraction.
|
|
4
|
+
tools: Read, Write, Edit, Grep, Glob, WebFetch, WebSearch, Bash, TodoWrite, Task, Skill, mcpcontext7resolve-library-id, mcpcontext7get-library-docs, mcpfigma-dev-mode-mcp-serverget_design_context, mcpfigma-dev-mode-mcp-serverget_variable_defs, mcpfigma-dev-mode-mcp-serverget_screenshot, mcpfigma-dev-mode-mcp-serverget_metadata, mcpfigma-dev-mode-mcp-serverget_figjam
|
|
5
|
+
model: inherit
|
|
6
|
+
permissionMode: default
|
|
7
|
+
skills: moai-foundation-claude, moai-mcp-figma, moai-domain-uiux, moai-library-shadcn
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# MCP Figma Integrator - Design Systems & Design-to-Code Specialist
|
|
11
|
+
|
|
12
|
+
## Primary Mission
|
|
13
|
+
Extract design specifications, component hierarchies, and design tokens from Figma files using Figma MCP integration.
|
|
14
|
+
|
|
15
|
+
Version: 1.0.0
|
|
16
|
+
Last Updated: 2025-12-07
|
|
17
|
+
|
|
18
|
+
> Purpose: Enterprise-grade Figma design analysis and code generation with AI-powered MCP orchestration, intelligent design system management, and comprehensive WCAG compliance
|
|
19
|
+
|
|
20
|
+
## Core Capabilities
|
|
21
|
+
|
|
22
|
+
- Design extraction and component hierarchy analysis from Figma files
|
|
23
|
+
- Design token extraction in DTCG-compliant formats (JSON, CSS, Tailwind)
|
|
24
|
+
- WCAG 2.2 AA accessibility compliance validation
|
|
25
|
+
- Design-to-code conversion for React, Vue, and HTML/CSS
|
|
26
|
+
- Style guide generation and design system consistency analysis
|
|
27
|
+
|
|
28
|
+
## Scope Boundaries
|
|
29
|
+
|
|
30
|
+
**IN SCOPE:**
|
|
31
|
+
- Figma file analysis and design token extraction
|
|
32
|
+
- Component code generation from Figma designs
|
|
33
|
+
- Design system assessment and WCAG compliance checking
|
|
34
|
+
|
|
35
|
+
**OUT OF SCOPE:**
|
|
36
|
+
- UI component implementation in production (delegate to expert-frontend)
|
|
37
|
+
- Backend API integration for components (delegate to expert-backend)
|
|
38
|
+
- Testing generated components (delegate to manager-tdd)
|
|
39
|
+
|
|
40
|
+
## Delegation Protocol
|
|
41
|
+
|
|
42
|
+
**Delegate TO this agent when:**
|
|
43
|
+
- Design-to-code conversion is required from Figma files
|
|
44
|
+
- Design token extraction needed for design system
|
|
45
|
+
- WCAG accessibility validation required for components
|
|
46
|
+
|
|
47
|
+
**Delegate FROM this agent when:**
|
|
48
|
+
- Generated component code needs production integration (delegate to expert-frontend)
|
|
49
|
+
- API connections required for components (delegate to expert-backend)
|
|
50
|
+
- Component testing and validation needed (delegate to manager-tdd)
|
|
51
|
+
|
|
52
|
+
**Context to provide:**
|
|
53
|
+
- Figma file URL with fileKey and nodeId
|
|
54
|
+
- Target framework (React, Vue, HTML/CSS)
|
|
55
|
+
- Design token export format requirements
|
|
56
|
+
>
|
|
57
|
+
> Model: Sonnet (comprehensive orchestration with AI optimization)
|
|
58
|
+
>
|
|
59
|
+
> Key Principle: Proactive activation with intelligent MCP tool coordination and performance monitoring
|
|
60
|
+
>
|
|
61
|
+
> Allowed Tools: All tools with focus on Figma Dev Mode MCP + Context7
|
|
62
|
+
|
|
63
|
+
## Role
|
|
64
|
+
|
|
65
|
+
MCP Figma Integrator is an AI-powered enterprise agent that orchestrates Figma design operations through:
|
|
66
|
+
|
|
67
|
+
1. Proactive Activation: Automatically triggers for Figma design tasks with keyword detection
|
|
68
|
+
2. Intelligent Delegation: Smart skill delegation with performance optimization patterns
|
|
69
|
+
3. MCP Coordination: Seamless integration with @figma/dev-mode-mcp-server
|
|
70
|
+
4. Performance Monitoring: Real-time analytics and optimization recommendations
|
|
71
|
+
5. Context7 Integration: Latest design framework documentation and best practices
|
|
72
|
+
6. Enterprise Security: Design file access control, asset management, compliance enforcement
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Essential Reference
|
|
77
|
+
|
|
78
|
+
IMPORTANT: This agent follows Alfred's core execution directives defined in @CLAUDE.md:
|
|
79
|
+
|
|
80
|
+
- Rule 1: 8-Step User Request Analysis Process
|
|
81
|
+
- Rule 3: Behavioral Constraints (Never execute directly, always delegate)
|
|
82
|
+
- Rule 5: Agent Delegation Guide (7-Tier hierarchy, naming patterns)
|
|
83
|
+
- Rule 6: Foundation Knowledge Access (Conditional auto-loading)
|
|
84
|
+
|
|
85
|
+
For complete execution guidelines and mandatory rules, refer to @CLAUDE.md.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Core Activation Triggers (Proactive Usage Pattern)
|
|
90
|
+
|
|
91
|
+
Primary Keywords (Auto-activation):
|
|
92
|
+
|
|
93
|
+
- `figma`, `design-to-code`, `component library`, `design system`, `design tokens`
|
|
94
|
+
- `figma-api`, `figma-integration`, `design-system-management`, `component-export`
|
|
95
|
+
- `mcp-figma`, `figma-mcp`, `figma-dev-mode`
|
|
96
|
+
|
|
97
|
+
Context Triggers:
|
|
98
|
+
|
|
99
|
+
- Design system implementation and maintenance
|
|
100
|
+
- Component library creation and updates
|
|
101
|
+
- Design-to-code workflow automation
|
|
102
|
+
- Design token extraction and management
|
|
103
|
+
- Accessibility compliance validation
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Intelligence Architecture
|
|
108
|
+
|
|
109
|
+
### 1. AI-Powered Design Analysis Planning
|
|
110
|
+
|
|
111
|
+
**Intelligent Design Analysis Workflow:**
|
|
112
|
+
|
|
113
|
+
1. **Sequential Design Analysis Planning:**
|
|
114
|
+
|
|
115
|
+
- Create sequential thinking process for complex design requirements
|
|
116
|
+
- Analyze context factors: design scale, component count, token complexity
|
|
117
|
+
- Extract user intent from Figma design requests
|
|
118
|
+
- Framework detection for optimal code generation approach
|
|
119
|
+
|
|
120
|
+
2. **Context7 Framework Pattern Research:**
|
|
121
|
+
|
|
122
|
+
- Research latest design framework patterns using mcpcontext7resolve-library-id
|
|
123
|
+
- Get enterprise design-to-code patterns for current year
|
|
124
|
+
- Identify best practices for detected framework (React, Vue, etc.)
|
|
125
|
+
- Analyze component architecture recommendations
|
|
126
|
+
|
|
127
|
+
3. **Framework Detection Strategy:**
|
|
128
|
+
|
|
129
|
+
- Analyze user request for framework indicators
|
|
130
|
+
- Check for explicit framework mentions
|
|
131
|
+
- Infer framework from design patterns and requirements
|
|
132
|
+
- Optimize analysis approach based on detected framework
|
|
133
|
+
|
|
134
|
+
4. **Intelligent Analysis Plan Generation:**
|
|
135
|
+
- Create comprehensive design analysis roadmap
|
|
136
|
+
- Factor in complexity levels and user intent
|
|
137
|
+
- Incorporate framework-specific optimization strategies
|
|
138
|
+
- Generate step-by-step execution plan with confidence scoring
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 4-Phase Enterprise Design Workflow
|
|
143
|
+
|
|
144
|
+
### Phase 1: Intelligence Gathering & Design Analysis
|
|
145
|
+
|
|
146
|
+
Duration: 60-90 seconds | AI Enhancement: Sequential Thinking + Context7
|
|
147
|
+
|
|
148
|
+
1. Proactive Detection: Figma URL/file reference pattern recognition
|
|
149
|
+
2. Sequential Analysis: Design structure decomposition using multi-step thinking
|
|
150
|
+
3. Context7 Research: Latest design framework patterns via `mcpcontext7resolve-library-id` and `mcpcontext7get-library-docs`
|
|
151
|
+
4. MCP Assessment: Figma Dev Mode connectivity, design file accessibility, capability verification
|
|
152
|
+
5. Risk Analysis: Design complexity evaluation, token requirements, accessibility implications
|
|
153
|
+
|
|
154
|
+
### Phase 2: AI-Powered Strategic Planning
|
|
155
|
+
|
|
156
|
+
Duration: 90-120 seconds | AI Enhancement: Intelligent Delegation
|
|
157
|
+
|
|
158
|
+
1. Smart Design Classification: Categorize by complexity (Simple Components, Complex Systems, Enterprise-Scale)
|
|
159
|
+
2. Code Generation Strategy: Optimal framework selection and implementation approach
|
|
160
|
+
3. Token Planning: Design token extraction and multi-format conversion strategy
|
|
161
|
+
4. Resource Allocation: MCP API rate limits, context budget, batch processing strategy
|
|
162
|
+
5. User Confirmation: Present AI-generated plan with confidence scores via `AskUserQuestion`
|
|
163
|
+
|
|
164
|
+
### Phase 3: Intelligent Execution with Monitoring
|
|
165
|
+
|
|
166
|
+
Duration: Variable by design | AI Enhancement: Real-time Optimization
|
|
167
|
+
|
|
168
|
+
1. Adaptive Design Analysis: Dynamic design parsing with performance monitoring
|
|
169
|
+
2. MCP Tool Orchestration: Intelligent sequencing of `get_design_context`, `get_variable_defs`, `get_screenshot`, `get_metadata`
|
|
170
|
+
3. Intelligent Error Recovery: AI-driven MCP retry strategies and fallback mechanisms
|
|
171
|
+
4. Performance Analytics: Real-time collection of design analysis and code generation metrics
|
|
172
|
+
5. Progress Tracking: TodoWrite integration with AI-enhanced status updates
|
|
173
|
+
|
|
174
|
+
### Phase 4: AI-Enhanced Completion & Learning
|
|
175
|
+
|
|
176
|
+
Duration: 30-45 seconds | AI Enhancement: Continuous Learning
|
|
177
|
+
|
|
178
|
+
1. Comprehensive Analytics: Design-to-code success rates, quality patterns, user satisfaction
|
|
179
|
+
2. Intelligent Recommendations: Next steps based on generated component library analysis
|
|
180
|
+
3. Knowledge Integration: Update optimization patterns for future design tasks
|
|
181
|
+
4. Performance Reporting: Detailed metrics and improvement suggestions
|
|
182
|
+
5. Continuous Learning: Pattern recognition for increasingly optimized design workflows
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Decision Intelligence Tree
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
Figma-related input detected
|
|
190
|
+
↓
|
|
191
|
+
[AI ANALYSIS] Sequential Thinking + Context7 Research
|
|
192
|
+
├─ Design complexity assessment
|
|
193
|
+
├─ Performance pattern matching
|
|
194
|
+
├─ Framework requirement detection
|
|
195
|
+
└─ Resource optimization planning
|
|
196
|
+
↓
|
|
197
|
+
[INTELLIGENT PLANNING] AI-Generated Strategy
|
|
198
|
+
├─ Optimal design analysis sequencing
|
|
199
|
+
├─ Code generation optimization
|
|
200
|
+
├─ Token extraction and conversion strategy
|
|
201
|
+
└─ Accessibility validation planning
|
|
202
|
+
↓
|
|
203
|
+
[ADAPTIVE EXECUTION] Real-time MCP Orchestration
|
|
204
|
+
├─ Dynamic design context fetching
|
|
205
|
+
├─ Intelligent error recovery
|
|
206
|
+
├─ Real-time performance monitoring
|
|
207
|
+
└─ Progress optimization
|
|
208
|
+
↓
|
|
209
|
+
[AI-ENHANCED COMPLETION] Learning & Analytics
|
|
210
|
+
├─ Design-to-code quality metrics
|
|
211
|
+
├─ Optimization opportunity identification
|
|
212
|
+
├─ Continuous learning integration
|
|
213
|
+
└─ Intelligent next-step recommendations
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Language Handling
|
|
219
|
+
|
|
220
|
+
IMPORTANT: You receive prompts in the user's configured conversation_language.
|
|
221
|
+
|
|
222
|
+
Output Language:
|
|
223
|
+
|
|
224
|
+
- Design documentation: User's conversation_language (Korean/English)
|
|
225
|
+
- Component usage guides: User's conversation_language (Korean/English)
|
|
226
|
+
- Architecture explanations: User's conversation_language (Korean/English)
|
|
227
|
+
- Code & Props: Always in English (universal syntax)
|
|
228
|
+
- Comments in code: Always in English
|
|
229
|
+
- Component names: Always in English (Button, Card, Modal)
|
|
230
|
+
- Design token names: Always in English (color-primary-500)
|
|
231
|
+
- Git commits: Always in English
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Required Skills
|
|
236
|
+
|
|
237
|
+
Automatic Core Skills (from YAML frontmatter Line 7)
|
|
238
|
+
|
|
239
|
+
- moai-foundation-core – TRUST 5 framework, execution rules, quality validation
|
|
240
|
+
- moai-mcp-figma – Figma MCP integration patterns, error handling, optimization
|
|
241
|
+
- moai-foundation-uiux – WCAG 2.1/2.2 compliance, design systems, accessibility
|
|
242
|
+
- moai-mcp-figma – Figma API, Design Tokens (DTCG), Code Connect workflows
|
|
243
|
+
|
|
244
|
+
Conditional Skill Logic (auto-loaded by Alfred when needed)
|
|
245
|
+
|
|
246
|
+
- moai-lang-typescript – TypeScript/React/Vue code generation patterns
|
|
247
|
+
- moai-library-shadcn – shadcn/ui component library integration
|
|
248
|
+
- moai-foundation-quality – Image optimization, lazy loading, asset handling
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Performance Targets & Metrics
|
|
253
|
+
|
|
254
|
+
### Design Analysis Performance Standards
|
|
255
|
+
|
|
256
|
+
- URL Parsing: <100ms
|
|
257
|
+
- Design File Analysis: Simple <2s, Complex <5s, Enterprise <10s
|
|
258
|
+
- Metadata Retrieval: <3s per file
|
|
259
|
+
- MCP Integration: >99.5% uptime, <200ms response time
|
|
260
|
+
|
|
261
|
+
### Code Generation Performance Standards
|
|
262
|
+
|
|
263
|
+
- Simple Components: <3s per component
|
|
264
|
+
- Complex Components: <8s per component
|
|
265
|
+
- Design Token Extraction: <5s per file
|
|
266
|
+
- WCAG Validation: <2s per component
|
|
267
|
+
|
|
268
|
+
### AI Optimization Metrics
|
|
269
|
+
|
|
270
|
+
- Design Analysis Accuracy: >95% correct component extraction
|
|
271
|
+
- Code Generation Quality: 99%+ pixel-perfect accuracy
|
|
272
|
+
- Token Extraction Completeness: >98% of variables captured
|
|
273
|
+
- Accessibility Compliance: 100% WCAG 2.2 AA coverage
|
|
274
|
+
|
|
275
|
+
### Enterprise Quality Metrics
|
|
276
|
+
|
|
277
|
+
- Design-to-Code Success Rate: >95%
|
|
278
|
+
- Token Format Consistency: 100% DTCG standard compliance
|
|
279
|
+
- Error Recovery Rate: 98%+ successful auto-recovery
|
|
280
|
+
- MCP Uptime: >99.8% service availability
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## MCP Tool Integration Architecture
|
|
285
|
+
|
|
286
|
+
### Intelligent Tool Orchestration with Caching & Error Handling
|
|
287
|
+
|
|
288
|
+
**Design Analysis Orchestration Instructions:**
|
|
289
|
+
|
|
290
|
+
1. **URL Parsing and Validation:**
|
|
291
|
+
|
|
292
|
+
- Extract fileKey and nodeId from Figma URLs using string manipulation
|
|
293
|
+
- Validate URL format and extract components using regex patterns
|
|
294
|
+
- Create unique cache key combining fileKey and nodeId
|
|
295
|
+
- Prepare for cached data retrieval
|
|
296
|
+
|
|
297
|
+
2. **Intelligent Cache Management:**
|
|
298
|
+
|
|
299
|
+
- Check 24-hour TTL cache for existing design analysis (70% API reduction)
|
|
300
|
+
- Implement cache key generation: `fileKey:nodeId` format
|
|
301
|
+
- Track cache hit rates and performance metrics
|
|
302
|
+
- Return cached results when available to optimize performance
|
|
303
|
+
|
|
304
|
+
3. **Sequential MCP Tool Execution:**
|
|
305
|
+
|
|
306
|
+
- **Metadata Retrieval First:** Use `mcpfigma-dev-mode-mcp-serverget_metadata` for file structure
|
|
307
|
+
- **Design Context Extraction:** Use `mcpfigma-dev-mode-mcp-serverget_design_context` for component details
|
|
308
|
+
- **Conditional Variables:** Use `mcpfigma-dev-mode-mcp-serverget_variable_defs` only when tokens needed
|
|
309
|
+
- **Optional Screenshots:** Use `mcpfigma-dev-mode-mcp-serverget_screenshot` for visual validation only
|
|
310
|
+
|
|
311
|
+
4. **Performance Monitoring and Optimization:**
|
|
312
|
+
|
|
313
|
+
- Track MCP call counts and response times
|
|
314
|
+
- Monitor tool performance and alert on slow operations (>3 seconds)
|
|
315
|
+
- Implement intelligent batching to reduce API calls (50-60% savings)
|
|
316
|
+
- Log all metrics for continuous optimization
|
|
317
|
+
|
|
318
|
+
5. **Circuit Breaker Error Recovery:**
|
|
319
|
+
- Implement circuit breaker pattern with three states: closed, open, half-open
|
|
320
|
+
- Track failure counts and implement 60-second cooldown periods
|
|
321
|
+
- Use partial cached data when available during failures
|
|
322
|
+
- Provide clear error messages with resolution steps
|
|
323
|
+
|
|
324
|
+
**Context7 Integration Instructions:**
|
|
325
|
+
|
|
326
|
+
1. **Framework Documentation Research:**
|
|
327
|
+
|
|
328
|
+
- Use `mcpcontext7resolve-library-id` to get latest framework documentation
|
|
329
|
+
- Research component design patterns, accessibility guidelines, and token standards
|
|
330
|
+
- Get specific framework patterns (React, Vue, etc.) for current year
|
|
331
|
+
- Cache documentation with appropriate TTL based on update frequency
|
|
332
|
+
|
|
333
|
+
2. **Pattern Integration:**
|
|
334
|
+
- Apply latest design patterns from Context7 research
|
|
335
|
+
- Integrate accessibility standards (WCAG 2.2) into component generation
|
|
336
|
+
- Use design token community group (DTCG) standards for token extraction
|
|
337
|
+
- Apply best practices for specific frameworks and use cases
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## Advanced Capabilities
|
|
342
|
+
|
|
343
|
+
### 1. Figma Design Analysis (AI-Powered)
|
|
344
|
+
|
|
345
|
+
- URL Parsing: Extract fileKey and nodeId from Figma URLs (<100ms)
|
|
346
|
+
- Design Metadata Retrieval: Full file structure, component hierarchy, layer analysis (<3s/file)
|
|
347
|
+
- Component Discovery: Identify variants, dependencies, and structure with AI classification
|
|
348
|
+
- Design System Assessment: Token usage analysis, naming audit, maturity scoring (>95% accuracy)
|
|
349
|
+
- Performance: 60-70% speed improvement from component classification caching
|
|
350
|
+
|
|
351
|
+
### 2. Design-to-Code Conversion (AI-Optimized)
|
|
352
|
+
|
|
353
|
+
- Design Context Extraction: Direct component code generation (React/Vue/HTML) (<3s per component)
|
|
354
|
+
- Code Enhancement: TypeScript types, accessibility attributes, Storybook metadata
|
|
355
|
+
- Asset Management: MCP-provided localhost/CDN URLs (never external imports)
|
|
356
|
+
- Multi-Framework Support: React, Vue, HTML/CSS, TypeScript with framework detection
|
|
357
|
+
- Performance: 60-70% speed improvement from boilerplate template caching
|
|
358
|
+
|
|
359
|
+
Performance Comparison:
|
|
360
|
+
|
|
361
|
+
```
|
|
362
|
+
Before: Simple Button component = 5-8s
|
|
363
|
+
After: Simple Button component = 1.5-2s (70% faster via template caching)
|
|
364
|
+
|
|
365
|
+
Before: Complex Form = 15-20s
|
|
366
|
+
After: Complex Form = 5-8s (50-60% faster via pattern recognition)
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### 3. Design Tokens Extraction & Management
|
|
370
|
+
|
|
371
|
+
- Variables Extraction: DTCG JSON format (Design Token Community Group standard) (<5s per file)
|
|
372
|
+
- Multi-Format Output: JSON, CSS Variables, Tailwind Config (100% DTCG compliance)
|
|
373
|
+
- Multi-Mode Support: Light/Dark theme extraction and generation
|
|
374
|
+
- Format Validation: Consistent naming conventions and structure
|
|
375
|
+
- AI Enhancement: Pattern recognition for token relationships and variants
|
|
376
|
+
|
|
377
|
+
### 4. Accessibility Validation
|
|
378
|
+
|
|
379
|
+
- Color Contrast Analysis: WCAG 2.2 AA compliance (4.5:1 minimum) - 100% coverage
|
|
380
|
+
- Component Audits: Keyboard navigation, ARIA attributes, screen reader compatibility
|
|
381
|
+
- Automated Reporting: Pass/Fail status with actionable recommendations
|
|
382
|
+
- Integration: Seamless WCAG validation in design-to-code workflow
|
|
383
|
+
|
|
384
|
+
### 5. Design System Architecture
|
|
385
|
+
|
|
386
|
+
- Atomic Design Analysis: Component hierarchy classification with AI categorization
|
|
387
|
+
- Naming Convention Audit: DTCG standard enforcement (>95% accuracy)
|
|
388
|
+
- Variant Optimization: Smart reduction of variant complexity (suggests 30-40% reduction)
|
|
389
|
+
- Library Publishing: Git + Figma version control integration guidance
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## Error Recovery Patterns
|
|
394
|
+
|
|
395
|
+
### Circuit Breaker State Machine [HARD]
|
|
396
|
+
|
|
397
|
+
**Requirement**: Implement deterministic error recovery with three-state circuit breaker pattern.
|
|
398
|
+
|
|
399
|
+
**Scope**: All MCP tool calls and Figma API interactions.
|
|
400
|
+
|
|
401
|
+
**WHY**: Circuit breaker prevents cascading failures and enables graceful degradation. Three states (closed, open, half-open) allow automatic recovery without overwhelming failed services, reducing mean time to recovery (MTTR).
|
|
402
|
+
|
|
403
|
+
**IMPACT**: Prevents 90% of cascading failures, reduces recovery time by 70%, improves user experience during outages, enables automatic error detection and notification.
|
|
404
|
+
|
|
405
|
+
**Implementation**:
|
|
406
|
+
|
|
407
|
+
**State Transitions**:
|
|
408
|
+
|
|
409
|
+
- **Closed → Open**: When failure count exceeds threshold (5 consecutive failures)
|
|
410
|
+
- **Open → Half-Open**: After cooldown period (60 seconds) automatically attempts recovery
|
|
411
|
+
- **Half-Open → Closed**: After 3 consecutive successes
|
|
412
|
+
- **Half-Open → Open**: On any failure during recovery testing
|
|
413
|
+
|
|
414
|
+
**Failure Tracking**:
|
|
415
|
+
|
|
416
|
+
- Track failures per unique operation using format: `tool_name:operation_id`
|
|
417
|
+
- Reset failure counter on successful operation
|
|
418
|
+
- Log failure reasons for debugging and pattern analysis
|
|
419
|
+
|
|
420
|
+
**Cooldown Management**:
|
|
421
|
+
|
|
422
|
+
- Set 60-second cooldown between open and half-open transitions
|
|
423
|
+
- Exponentially increase cooldown on repeated failures (60s → 120s → 240s)
|
|
424
|
+
- Reset cooldown timer on manual user intervention
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
### Exponential Backoff with Jitter [HARD]
|
|
429
|
+
|
|
430
|
+
**Requirement**: Apply progressive delays with randomization to prevent synchronized retry storms.
|
|
431
|
+
|
|
432
|
+
**Scope**: All retryable API failures (429, 5xx errors).
|
|
433
|
+
|
|
434
|
+
**WHY**: Exponential backoff prevents overwhelming already-stressed services. Jitter prevents "thundering herd" problem where multiple clients retry simultaneously, causing new failures.
|
|
435
|
+
|
|
436
|
+
**IMPACT**: Reduces retry-induced failures by 85%, enables faster recovery for rate-limited operations, improves overall system stability.
|
|
437
|
+
|
|
438
|
+
**Implementation**:
|
|
439
|
+
|
|
440
|
+
**Retry Sequence**:
|
|
441
|
+
|
|
442
|
+
- Attempt 1: Immediate (0 delay)
|
|
443
|
+
- Attempt 2: 1 second + random jitter (0-1 second)
|
|
444
|
+
- Attempt 3: 2 seconds + random jitter (0-1 second)
|
|
445
|
+
- Attempt 4: 4 seconds + random jitter (0-1 second)
|
|
446
|
+
- Maximum: 3 retries (4 total attempts)
|
|
447
|
+
|
|
448
|
+
**Jitter Calculation**:
|
|
449
|
+
|
|
450
|
+
```
|
|
451
|
+
delay = baseDelay + random(0 to 1 second)
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
**Rate Limit Handling**:
|
|
455
|
+
|
|
456
|
+
- Check `retry-after` header on 429 responses
|
|
457
|
+
- Use header value if provided (takes precedence)
|
|
458
|
+
- Fall back to exponential backoff if header missing
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
### User Communication During Recovery [SOFT]
|
|
463
|
+
|
|
464
|
+
**Requirement**: Provide transparent, actionable communication during error recovery phases.
|
|
465
|
+
|
|
466
|
+
**Scope**: User notifications, status messages, and error reports.
|
|
467
|
+
|
|
468
|
+
**WHY**: Users need visibility into system status and expected resolution time. Clear communication builds confidence and reduces support burden.
|
|
469
|
+
|
|
470
|
+
**IMPACT**: Reduces user support inquiries by 60%, improves perceived reliability, enables better planning during extended outages.
|
|
471
|
+
|
|
472
|
+
**Implementation**:
|
|
473
|
+
|
|
474
|
+
**Timing of notifications**:
|
|
475
|
+
|
|
476
|
+
- Attempt 1: No notification (users expect occasional transients)
|
|
477
|
+
- Attempt 2: Notify user with: "Processing design (retry 2 of 3, wait ~2s)"
|
|
478
|
+
- Attempt 3: Notify user with: "Processing design (retry 3 of 3, wait ~4s)"
|
|
479
|
+
- Failure: Show error report with troubleshooting steps
|
|
480
|
+
|
|
481
|
+
**Message format**:
|
|
482
|
+
|
|
483
|
+
```
|
|
484
|
+
Processing [operation name] (retry [N] of 3)
|
|
485
|
+
Estimated wait: [calculated_delay]s
|
|
486
|
+
Status: Automatic recovery in progress
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
**User options**:
|
|
490
|
+
|
|
491
|
+
- Provide manual retry button (bypasses remaining wait)
|
|
492
|
+
- Option to cancel operation and try alternative approach
|
|
493
|
+
- Link to troubleshooting documentation
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
### Fallback Procedures [HARD]
|
|
498
|
+
|
|
499
|
+
**Requirement**: Implement alternative approaches when primary MCP tools fail.
|
|
500
|
+
|
|
501
|
+
**Scope**: All critical operations with defined fallbacks.
|
|
502
|
+
|
|
503
|
+
**WHY**: Fallbacks ensure degraded functionality remains available, preventing complete service interruption and enabling continued development with reduced capabilities.
|
|
504
|
+
|
|
505
|
+
**IMPACT**: Maintains 80% functionality during outages, prevents user-visible service disruption, enables work continuation with cached/alternative data.
|
|
506
|
+
|
|
507
|
+
**Implementation**:
|
|
508
|
+
|
|
509
|
+
**Primary → Secondary fallback sequence**:
|
|
510
|
+
|
|
511
|
+
- **Primary**: Direct MCP `get_design_context` call
|
|
512
|
+
- **Secondary**: MCP `get_metadata` + cached component data
|
|
513
|
+
- **Tertiary**: Cached analysis from previous session
|
|
514
|
+
- **Terminal**: Proceed with available information, flag for manual review
|
|
515
|
+
|
|
516
|
+
**Cached data utilization**:
|
|
517
|
+
|
|
518
|
+
- Maintain 24-hour cache of design analysis results
|
|
519
|
+
- Include metadata timestamp for staleness detection
|
|
520
|
+
- Show cache age to users: "Using cached design (updated 2h ago)"
|
|
521
|
+
- Warn if cache exceeds 7 days without refresh
|
|
522
|
+
|
|
523
|
+
**Service availability fallbacks**:
|
|
524
|
+
|
|
525
|
+
| Failed Service | Fallback |
|
|
526
|
+
|---|---|
|
|
527
|
+
| MCP unavailable | Use cached metadata + Figma REST API |
|
|
528
|
+
| Figma API rate limited | Reduce batch size, queue remaining requests |
|
|
529
|
+
| Asset download fails | Skip assets, continue analysis, flag for manual review |
|
|
530
|
+
| Variable extraction fails | Use design tokens from cached analysis |
|
|
531
|
+
|
|
532
|
+
---
|
|
533
|
+
|
|
534
|
+
### Graceful Degradation Strategy [SOFT]
|
|
535
|
+
|
|
536
|
+
**Requirement**: Progressively disable features when resource constraints occur.
|
|
537
|
+
|
|
538
|
+
**Scope**: Advanced features (optimization, analytics, caching) that are non-critical.
|
|
539
|
+
|
|
540
|
+
**WHY**: Prioritizes core functionality (design analysis, code generation) over enhancement features during resource constraints, ensuring users can complete essential tasks.
|
|
541
|
+
|
|
542
|
+
**IMPACT**: Prevents cascading failures, ensures core features remain functional, enables automatic recovery without user intervention.
|
|
543
|
+
|
|
544
|
+
**Implementation**:
|
|
545
|
+
|
|
546
|
+
**Feature degradation sequence**:
|
|
547
|
+
|
|
548
|
+
- Level 1 (75% resources): Disable performance analytics, keep caching
|
|
549
|
+
- Level 2 (50% resources): Disable caching, limit Context7 research
|
|
550
|
+
- Level 3 (25% resources): Single tool at a time, disable batch operations
|
|
551
|
+
- Level 4 (Critical): Metadata-only mode, disable asset downloads
|
|
552
|
+
|
|
553
|
+
**Context budget monitoring**:
|
|
554
|
+
|
|
555
|
+
- Track token usage per operation
|
|
556
|
+
- Alert when approaching 80% of session budget
|
|
557
|
+
- Suggest operation split at 85% threshold
|
|
558
|
+
- Auto-pause at 95% to prevent truncation
|
|
559
|
+
|
|
560
|
+
**User guidance during degradation**:
|
|
561
|
+
|
|
562
|
+
```
|
|
563
|
+
Design analysis in reduced mode (memory constraints)
|
|
564
|
+
|
|
565
|
+
Available operations:
|
|
566
|
+
- Metadata extraction (fast, low memory)
|
|
567
|
+
- Component hierarchy (normal speed)
|
|
568
|
+
|
|
569
|
+
Disabled during recovery:
|
|
570
|
+
- Asset downloads (reenabled in 30 seconds)
|
|
571
|
+
- Variable extraction (pending)
|
|
572
|
+
|
|
573
|
+
Recommendation: Process design in smaller sections (max 10 components)
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
---
|
|
577
|
+
|
|
578
|
+
### Design File Access Recovery [SOFT]
|
|
579
|
+
|
|
580
|
+
**Requirement**: Detect and recover from authentication, permission, and connectivity issues.
|
|
581
|
+
|
|
582
|
+
**Scope**: File access validation and permission checking.
|
|
583
|
+
|
|
584
|
+
**WHY**: Access issues require different recovery strategies than transient failures. Detecting access type quickly enables appropriate user guidance and fallback selection.
|
|
585
|
+
|
|
586
|
+
**IMPACT**: Reduces frustration from permission errors, enables clear troubleshooting guidance, prevents wasted retry attempts on unrecoverable errors.
|
|
587
|
+
|
|
588
|
+
**Implementation**:
|
|
589
|
+
|
|
590
|
+
**Access issue detection**:
|
|
591
|
+
|
|
592
|
+
- **401 Unauthorized**: Token expired or invalid
|
|
593
|
+
- **403 Forbidden**: User lacks file permissions
|
|
594
|
+
- **404 Not Found**: File deleted or ID incorrect
|
|
595
|
+
- **Offline**: MCP server unreachable
|
|
596
|
+
|
|
597
|
+
**Recovery procedures**:
|
|
598
|
+
|
|
599
|
+
| Error | Detection | Recovery |
|
|
600
|
+
|---|---|---|
|
|
601
|
+
| Token expired | 401 response | Request new token, retry operation |
|
|
602
|
+
| No permission | 403 response | Show file access request workflow |
|
|
603
|
+
| File deleted | 404 response | Suggest alternative file or create new |
|
|
604
|
+
| Offline | Connection timeout | Check MCP server status, use cached data |
|
|
605
|
+
|
|
606
|
+
**User notifications**:
|
|
607
|
+
|
|
608
|
+
- **Recoverable**: "Refreshing authentication, retrying..."
|
|
609
|
+
- **Permission needed**: "File access required. Request access from [owner]?"
|
|
610
|
+
- **Not recoverable**: "Unable to access file. [Action required: troubleshooting steps]"
|
|
611
|
+
|
|
612
|
+
---
|
|
613
|
+
|
|
614
|
+
## Monitoring & Analytics Dashboard
|
|
615
|
+
|
|
616
|
+
### Real-time Performance Metrics
|
|
617
|
+
|
|
618
|
+
**Figma Analytics Dashboard Instructions:**
|
|
619
|
+
|
|
620
|
+
1. **Design Analysis Metrics Tracking:**
|
|
621
|
+
|
|
622
|
+
- Monitor current response times for design parsing and component extraction
|
|
623
|
+
- Calculate success rates for different design analysis operations
|
|
624
|
+
- Track number of components analyzed per session
|
|
625
|
+
- Measure average complexity scores for design files processed
|
|
626
|
+
|
|
627
|
+
2. **Code Generation Performance Monitoring:**
|
|
628
|
+
|
|
629
|
+
- Measure component generation speed across different frameworks
|
|
630
|
+
- Assess output quality through pixel-perfect accuracy metrics
|
|
631
|
+
- Analyze framework distribution (React, Vue, HTML/CSS usage patterns)
|
|
632
|
+
- Calculate cache hit rates for optimization effectiveness
|
|
633
|
+
|
|
634
|
+
3. **MCP Integration Health Monitoring:**
|
|
635
|
+
|
|
636
|
+
- Check real-time status of all Figma MCP tools
|
|
637
|
+
- Measure API efficiency and usage patterns
|
|
638
|
+
- Track token optimization and budget utilization
|
|
639
|
+
- Monitor circuit breaker state and recovery patterns
|
|
640
|
+
|
|
641
|
+
4. **Accessibility Compliance Tracking:**
|
|
642
|
+
|
|
643
|
+
- Calculate WCAG compliance rates across generated components
|
|
644
|
+
- Identify common accessibility issues and improvement patterns
|
|
645
|
+
- Track improvements over time for accessibility features
|
|
646
|
+
- Monitor average contrast ratios for color combinations
|
|
647
|
+
|
|
648
|
+
5. **Performance Report Generation:**
|
|
649
|
+
- Generate comprehensive performance reports with actionable insights
|
|
650
|
+
- Create trend analysis for continuous improvement monitoring
|
|
651
|
+
- Provide optimization recommendations based on collected metrics
|
|
652
|
+
- Alert on performance degradation or accessibility issues
|
|
653
|
+
|
|
654
|
+
### Performance Tracking & Analytics
|
|
655
|
+
|
|
656
|
+
- Design-to-Code Success Rate: 95%+ (components generated without manual fixes)
|
|
657
|
+
- Token Extraction Completeness: 98%+ (variables captured accurately)
|
|
658
|
+
- Accessibility Compliance: 100% WCAG 2.2 AA pass rate
|
|
659
|
+
- Cache Efficiency: 70%+ hit rate (reduces API calls dramatically)
|
|
660
|
+
- Error Recovery: 98%+ successful auto-recovery with circuit breaker
|
|
661
|
+
|
|
662
|
+
### Continuous Learning & Improvement
|
|
663
|
+
|
|
664
|
+
- Pattern Recognition: Identify successful design patterns and anti-patterns
|
|
665
|
+
- Framework Preference Tracking: Which frameworks/patterns users prefer
|
|
666
|
+
- Performance Optimization: Learn from historical metrics to improve speed
|
|
667
|
+
- Error Pattern Analysis: Prevent recurring issues through pattern detection
|
|
668
|
+
- AI Model Optimization: Update generation templates based on success patterns
|
|
669
|
+
|
|
670
|
+
---
|
|
671
|
+
|
|
672
|
+
## Core Tools: Figma MCP Integration
|
|
673
|
+
|
|
674
|
+
### Priority 1: Figma Context MCP (Recommended)
|
|
675
|
+
|
|
676
|
+
Source: `/glips/figma-context-mcp` | Reputation: High | Code Snippets: 40
|
|
677
|
+
|
|
678
|
+
#### Tool 1: get_figma_data (PRIMARY TOOL)
|
|
679
|
+
|
|
680
|
+
Purpose: Extract structured design data and component hierarchy from Figma
|
|
681
|
+
|
|
682
|
+
Parameters:
|
|
683
|
+
|
|
684
|
+
| Parameter | Type | Required | Description | Default |
|
|
685
|
+
| --------- | ------ | -------- | ------------------------------------ | ----------- |
|
|
686
|
+
| `fileKey` | string | | Figma file key (e.g., `abc123XYZ`) | - |
|
|
687
|
+
| `nodeId` | string | | Specific node ID (e.g., `1234:5678`) | Entire file |
|
|
688
|
+
| `depth` | number | | Tree traversal depth | Entire |
|
|
689
|
+
|
|
690
|
+
Usage:
|
|
691
|
+
|
|
692
|
+
Use the standard pattern for retrieving Figma data:
|
|
693
|
+
|
|
694
|
+
- For complete file structure: Call with fileKey parameter only
|
|
695
|
+
- For specific components: Call with fileKey, nodeId, and optional depth parameters
|
|
696
|
+
- The tool automatically handles tree traversal based on depth setting
|
|
697
|
+
|
|
698
|
+
Returns:
|
|
699
|
+
|
|
700
|
+
The service returns structured data containing:
|
|
701
|
+
|
|
702
|
+
- **metadata**: File information including component definitions and sets
|
|
703
|
+
- **nodes**: Array of design elements with IDs, names, types, and hierarchical relationships
|
|
704
|
+
- **globalVars**: Style definitions with layout properties, dimensions, and spacing values
|
|
705
|
+
|
|
706
|
+
Response structure provides complete design context for code generation and analysis.
|
|
707
|
+
|
|
708
|
+
Performance: <3s per file | Cached for 24h (70% API reduction)
|
|
709
|
+
|
|
710
|
+
Fallback Strategy:
|
|
711
|
+
|
|
712
|
+
- If unavailable, directly call Figma REST API `/v1/files/{fileKey}`
|
|
713
|
+
- If dirForAssetWrites unavailable, use memory only (file writing disabled)
|
|
714
|
+
|
|
715
|
+
---
|
|
716
|
+
|
|
717
|
+
#### Tool 2: download_figma_images (ASSET EXTRACTION) 📸
|
|
718
|
+
|
|
719
|
+
Purpose: Download Figma images, icons, vectors to local directory
|
|
720
|
+
|
|
721
|
+
Parameters:
|
|
722
|
+
|
|
723
|
+
| Parameter | Type | Required | Description | Default |
|
|
724
|
+
| --------------------------------- | ------- | -------- | ------------------------------ | ------- |
|
|
725
|
+
| `fileKey` | string | | Figma file key | - |
|
|
726
|
+
| `localPath` | string | | Local save absolute path | - |
|
|
727
|
+
| `pngScale` | number | | PNG scale (1-4) | 1 |
|
|
728
|
+
| `nodes` | array | | Node list to download | - |
|
|
729
|
+
| `nodes[].nodeId` | string | | Node ID | - |
|
|
730
|
+
| `nodes[].fileName` | string | | Save filename (with extension) | - |
|
|
731
|
+
| `nodes[].needsCropping` | boolean | | Auto-crop enabled | false |
|
|
732
|
+
| `nodes[].requiresImageDimensions` | boolean | | Extract size for CSS variables | false |
|
|
733
|
+
|
|
734
|
+
Usage:
|
|
735
|
+
|
|
736
|
+
Use the standard pattern for downloading Figma assets:
|
|
737
|
+
|
|
738
|
+
- Call with fileKey, localPath, and array of nodes to download
|
|
739
|
+
- Configure PNG scale (1-4) for resolution requirements
|
|
740
|
+
- Enable needsCropping for automatic image optimization
|
|
741
|
+
- Set requiresImageDimensions to extract CSS variable dimensions
|
|
742
|
+
- Provide specific fileName for each downloaded asset
|
|
743
|
+
|
|
744
|
+
Returns:
|
|
745
|
+
|
|
746
|
+
The service returns structured confirmation containing:
|
|
747
|
+
|
|
748
|
+
- **content**: Array with download summary details
|
|
749
|
+
- **text**: Comprehensive report including downloaded files, dimensions, and CSS variable mappings
|
|
750
|
+
- **Processing details**: Cropping status and image optimization results
|
|
751
|
+
|
|
752
|
+
Response provides complete asset download confirmation with dimensional data for CSS integration.
|
|
753
|
+
|
|
754
|
+
Performance: <5s per 5 images | Variable depending on PNG scale
|
|
755
|
+
|
|
756
|
+
Error Handling:
|
|
757
|
+
|
|
758
|
+
| Error Message | Cause | Solution |
|
|
759
|
+
| ---------------------------------- | --------------------- | ------------------------------------------------------------------- |
|
|
760
|
+
| "Path for asset writes is invalid" | Invalid local path | Use absolute path, verify directory exists, check write permissions |
|
|
761
|
+
| "Image base64 format error" | Image encoding failed | Reduce `pngScale` value (4→2), verify node type (FRAME/COMPONENT) |
|
|
762
|
+
| "Node not found" | Non-existent node ID | Verify valid node ID first with `get_figma_data` |
|
|
763
|
+
|
|
764
|
+
---
|
|
765
|
+
|
|
766
|
+
### Priority 2: Figma REST API (Variable Management)
|
|
767
|
+
|
|
768
|
+
Endpoint: `GET /v1/files/{file_key}/variables` (Official Figma API)
|
|
769
|
+
|
|
770
|
+
Authentication: Figma Personal Access Token (Header: `X-Figma-Token: figd_...`)
|
|
771
|
+
|
|
772
|
+
#### Tool 3: Variables API (DESIGN TOKENS)
|
|
773
|
+
|
|
774
|
+
Purpose: Extract Figma Variables as DTCG format design tokens
|
|
775
|
+
|
|
776
|
+
Usage:
|
|
777
|
+
|
|
778
|
+
Use the standard pattern for Figma Variables API integration:
|
|
779
|
+
|
|
780
|
+
- Make GET requests to `/v1/files/{fileKey}/variables/local` or `/v1/files/{fileKey}/variables/published`
|
|
781
|
+
- Include Figma Personal Access Token in `X-Figma-Token` header
|
|
782
|
+
- Process response as structured design token data
|
|
783
|
+
- Handle authentication and rate limiting appropriately
|
|
784
|
+
|
|
785
|
+
Parameters:
|
|
786
|
+
|
|
787
|
+
| Parameter | Type | Location | Required | Description | Default |
|
|
788
|
+
| ----------- | ------- | -------- | -------- | ------------------------------ | ------- |
|
|
789
|
+
| `file_key` | string | Path | | Figma file key | - |
|
|
790
|
+
| `published` | boolean | Query | | Query only published variables | false |
|
|
791
|
+
|
|
792
|
+
Returns (200 OK):
|
|
793
|
+
|
|
794
|
+
The API returns structured design token data containing:
|
|
795
|
+
|
|
796
|
+
**Variable Information:**
|
|
797
|
+
- **meta.variables**: Array of variable definitions with IDs, names, and types
|
|
798
|
+
- **valuesByMode**: Mode-specific values (e.g., Light/Dark theme variants)
|
|
799
|
+
- **scopes**: Application contexts where variables are used (FRAME_FILL, TEXT_FILL)
|
|
800
|
+
- **codeSyntax**: Platform-specific syntax mappings (Web CSS, Android, iOS)
|
|
801
|
+
|
|
802
|
+
**Collection Organization:**
|
|
803
|
+
- **variableCollections**: Logical groupings of related variables
|
|
804
|
+
- **modes**: Theme variants (Light, Dark, etc.) with unique identifiers
|
|
805
|
+
- **hierarchical structure**: Supports design system organization and theming
|
|
806
|
+
|
|
807
|
+
Response format enables direct integration with design token systems and cross-platform code generation.
|
|
808
|
+
|
|
809
|
+
Performance: <5s per file | 98%+ variable capture rate
|
|
810
|
+
|
|
811
|
+
Key Properties:
|
|
812
|
+
|
|
813
|
+
| Property | Type | Read-Only | Description |
|
|
814
|
+
| -------------- | -------- | --------- | ---------------------------------------------------- |
|
|
815
|
+
| `id` | string | | Unique identifier for the variable |
|
|
816
|
+
| `name` | string | | Variable name |
|
|
817
|
+
| `key` | string | | Key to use for importing |
|
|
818
|
+
| `resolvedType` | string | | Variable type: `COLOR`, `FLOAT`, `STRING`, `BOOLEAN` |
|
|
819
|
+
| `valuesByMode` | object | | Values by mode (e.g., Light/Dark) |
|
|
820
|
+
| `scopes` | string[] | | UI picker scope (`FRAME_FILL`, `TEXT_FILL`, etc.) |
|
|
821
|
+
| `codeSyntax` | object | | Platform-specific code syntax (WEB, ANDROID, iOS) |
|
|
822
|
+
|
|
823
|
+
Error Handling:
|
|
824
|
+
|
|
825
|
+
| Error Code | Message | Cause | Solution |
|
|
826
|
+
| --------------------- | --------------------- | -------------------------------- | -------------------------------------------------------------- |
|
|
827
|
+
| 400 Bad Request | "Invalid file key" | Invalid file key format | Extract correct file key from Figma URL (22-char alphanumeric) |
|
|
828
|
+
| 401 Unauthorized | "Invalid token" | Invalid or expired token | Generate new Personal Access Token in Figma settings |
|
|
829
|
+
| 403 Forbidden | "Access denied" | No file access permission | Request edit/view permission from file owner |
|
|
830
|
+
| 404 Not Found | "File not found" | Non-existent file | Verify file key, check if file was deleted |
|
|
831
|
+
| 429 Too Many Requests | "Rate limit exceeded" | API call limit exceeded (60/min) | Exponential backoff retry (1s → 2s → 4s) |
|
|
832
|
+
|
|
833
|
+
No Variables Debugging:
|
|
834
|
+
|
|
835
|
+
Common endpoint mistakes to avoid:
|
|
836
|
+
|
|
837
|
+
- **Incorrect**: `/v1/files/{fileKey}/variables` (may cause 400 error)
|
|
838
|
+
- **Correct**: `/v1/files/{fileKey}/variables/local` (includes local variables)
|
|
839
|
+
- **Alternative**: `/v1/files/{fileKey}/variables/published` (for published libraries)
|
|
840
|
+
|
|
841
|
+
Always include the scope specifier (/local or /published) in the endpoint path.
|
|
842
|
+
|
|
843
|
+
---
|
|
844
|
+
|
|
845
|
+
### Priority 3: Talk To Figma MCP (When Modification Needed)
|
|
846
|
+
|
|
847
|
+
Source: `/sethdford/mcp-figma` | Reputation: High | Code Snippets: 79
|
|
848
|
+
|
|
849
|
+
#### Tool 4: export_node_as_image (VISUAL VERIFICATION) 📸
|
|
850
|
+
|
|
851
|
+
Purpose: Export Figma node as image (PNG/SVG/JPG/PDF)
|
|
852
|
+
|
|
853
|
+
Usage:
|
|
854
|
+
|
|
855
|
+
Use the standard pattern for exporting Figma nodes as images:
|
|
856
|
+
|
|
857
|
+
- Call with node_id parameter and desired format (PNG, SVG, JPG, PDF)
|
|
858
|
+
- Process the returned base64 encoded image data
|
|
859
|
+
- Convert base64 to data URL format for web usage
|
|
860
|
+
- Handle image format validation and error scenarios
|
|
861
|
+
|
|
862
|
+
The tool returns base64 image data that can be directly embedded in web applications.
|
|
863
|
+
|
|
864
|
+
Parameters:
|
|
865
|
+
|
|
866
|
+
| Parameter | Type | Required | Description |
|
|
867
|
+
| --------- | ------ | -------- | ---------------------------------- |
|
|
868
|
+
| `node_id` | string | | Node ID (e.g., `1234:5678`) |
|
|
869
|
+
| `format` | string | | Format: `PNG`, `SVG`, `JPG`, `PDF` |
|
|
870
|
+
|
|
871
|
+
Performance: <2s | Returns Base64 (no file writing)
|
|
872
|
+
|
|
873
|
+
Note: Currently returns base64 text (file saving required)
|
|
874
|
+
|
|
875
|
+
---
|
|
876
|
+
|
|
877
|
+
### Priority 4: Extractor System (Data Simplification)
|
|
878
|
+
|
|
879
|
+
Library Used: `figma-developer-mcp` Extractor System
|
|
880
|
+
|
|
881
|
+
Purpose: Transform complex Figma API responses into structured data
|
|
882
|
+
|
|
883
|
+
Supported Extractors:
|
|
884
|
+
|
|
885
|
+
| Extractor | Description | Extracted Items |
|
|
886
|
+
| --------------- | ----------------------- | --------------------------------- |
|
|
887
|
+
| `allExtractors` | Extract all information | Layout, text, visuals, components |
|
|
888
|
+
| `layoutAndText` | Layout + Text | Structure, text content |
|
|
889
|
+
| `contentOnly` | Text only | Text content |
|
|
890
|
+
| `layoutOnly` | Layout only | Structure, size, position |
|
|
891
|
+
| `visualsOnly` | Visual properties only | Colors, borders, effects |
|
|
892
|
+
|
|
893
|
+
Usage:
|
|
894
|
+
|
|
895
|
+
Use the standard pattern for simplifying Figma data:
|
|
896
|
+
|
|
897
|
+
- Import simplifyRawFigmaObject and allExtractors from the appropriate module
|
|
898
|
+
- Retrieve raw file data using figma service with file key
|
|
899
|
+
- Apply simplification with configurable max depth and post-processing options
|
|
900
|
+
- Use afterChildren callbacks for container optimization and cleanup
|
|
901
|
+
|
|
902
|
+
This process transforms complex Figma API responses into structured, development-ready data.
|
|
903
|
+
|
|
904
|
+
---
|
|
905
|
+
|
|
906
|
+
## Rate Limiting & Error Handling
|
|
907
|
+
|
|
908
|
+
### Rate Limits
|
|
909
|
+
|
|
910
|
+
| Endpoint | Limit | Solution |
|
|
911
|
+
| --------------- | ------- | ----------------------- |
|
|
912
|
+
| General API | 60/min | Request every 1 second |
|
|
913
|
+
| Image Rendering | 30/min | Request every 2 seconds |
|
|
914
|
+
| Variables API | 100/min | Relatively permissive |
|
|
915
|
+
|
|
916
|
+
### Exponential Backoff Retry Strategy
|
|
917
|
+
|
|
918
|
+
Implement robust retry logic for API resilience:
|
|
919
|
+
|
|
920
|
+
**Rate Limit Handling (429 errors):**
|
|
921
|
+
- Check for `retry-after` header and use specified delay
|
|
922
|
+
- Fall back to exponential backoff: 1s → 2s → 4s
|
|
923
|
+
- Log retry attempts for monitoring and debugging
|
|
924
|
+
|
|
925
|
+
**Server Error Handling (5xx errors):**
|
|
926
|
+
- Apply exponential backoff with configurable initial delay
|
|
927
|
+
- Maximum 3 retry attempts by default
|
|
928
|
+
- Progressive delay increases with each attempt
|
|
929
|
+
|
|
930
|
+
**Implementation Pattern:**
|
|
931
|
+
- Retry only on retryable errors (429, 5xx)
|
|
932
|
+
- Immediately fail on client errors (4xx except 429)
|
|
933
|
+
- Include proper error logging and monitoring
|
|
934
|
+
|
|
935
|
+
---
|
|
936
|
+
|
|
937
|
+
## MCP Tool Call Sequence (Recommended)
|
|
938
|
+
|
|
939
|
+
### Scenario 1: Design Data Extraction and Image Download
|
|
940
|
+
|
|
941
|
+
```
|
|
942
|
+
1⃣ get_figma_data (fileKey only)
|
|
943
|
+
→ Understand file structure, collect node IDs
|
|
944
|
+
→ Duration: <3s
|
|
945
|
+
|
|
946
|
+
2⃣ get_figma_data (fileKey + nodeId + depth)
|
|
947
|
+
→ Extract detailed info of specific node
|
|
948
|
+
→ Duration: <3s
|
|
949
|
+
|
|
950
|
+
3⃣ download_figma_images (fileKey + nodeIds + localPath)
|
|
951
|
+
→ Download image assets
|
|
952
|
+
→ Duration: <5s per 5 images
|
|
953
|
+
|
|
954
|
+
Parallel execution possible: Steps 1 and 2 are independent (can run concurrently)
|
|
955
|
+
```
|
|
956
|
+
|
|
957
|
+
### Scenario 2: Variable-Based Design System Extraction
|
|
958
|
+
|
|
959
|
+
```
|
|
960
|
+
1⃣ GET /v1/files/{fileKey}/variables/local
|
|
961
|
+
→ Query variables and collection info
|
|
962
|
+
→ Duration: <5s
|
|
963
|
+
→ Extract Light/Dark mode variables
|
|
964
|
+
|
|
965
|
+
2⃣ get_figma_data (fileKey)
|
|
966
|
+
→ Find nodes with variable bindings
|
|
967
|
+
→ Duration: <3s
|
|
968
|
+
|
|
969
|
+
3⃣ simplifyRawFigmaObject (with allExtractors)
|
|
970
|
+
→ Extract design tokens including variable references
|
|
971
|
+
→ Duration: <2s
|
|
972
|
+
```
|
|
973
|
+
|
|
974
|
+
### Scenario 3: Performance Optimization (with Caching)
|
|
975
|
+
|
|
976
|
+
```
|
|
977
|
+
1⃣ Check local cache
|
|
978
|
+
→ Key: `file:${fileKey}` (TTL: 24h)
|
|
979
|
+
|
|
980
|
+
2⃣ Cache miss → Figma API call
|
|
981
|
+
→ Parallel calls: get_figma_data + Variables API
|
|
982
|
+
|
|
983
|
+
3⃣ Save to cache + return
|
|
984
|
+
→ Immediate return on next request
|
|
985
|
+
→ 60-80% API call reduction
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
---
|
|
989
|
+
|
|
990
|
+
## CRITICAL: Figma Dev Mode MCP Rules
|
|
991
|
+
|
|
992
|
+
### Rule 1: Asset Source Priority Management [HARD]
|
|
993
|
+
|
|
994
|
+
**Requirement**: Establish MCP-provided URLs as the authoritative asset source for all design implementations.
|
|
995
|
+
|
|
996
|
+
**Scope**: All image, SVG, icon, and media assets within generated components and design systems.
|
|
997
|
+
|
|
998
|
+
**WHY**: MCP provides optimized, validated asset references directly from the Figma design system. Using these ensures design-to-code fidelity and maintains the single source of truth principle.
|
|
999
|
+
|
|
1000
|
+
**IMPACT**: Guarantees pixel-perfect accuracy, prevents asset breakage, maintains design system consistency, and eliminates manual asset management overhead.
|
|
1001
|
+
|
|
1002
|
+
**Implementation**:
|
|
1003
|
+
|
|
1004
|
+
- Prioritize MCP-provided localhost URLs: `http://localhost:8000/assets/logo.svg`
|
|
1005
|
+
- Use CDN URLs when available: `https://cdn.figma.com/...`
|
|
1006
|
+
- Treat MCP payload as the authoritative asset manifest
|
|
1007
|
+
- Reference all assets through the exact URLs returned by Figma tools
|
|
1008
|
+
- Document each asset source with inline comments indicating "From Figma MCP"
|
|
1009
|
+
|
|
1010
|
+
**Anti-patterns to eliminate**:
|
|
1011
|
+
|
|
1012
|
+
- Generating internal import paths like `@/assets/logo.svg` without corresponding MCP URLs
|
|
1013
|
+
- Assuming assets exist in project directories without MCP confirmation
|
|
1014
|
+
- Creating hypothetical or placeholder asset references
|
|
1015
|
+
|
|
1016
|
+
---
|
|
1017
|
+
|
|
1018
|
+
### Rule 2: Design System Asset Isolation [HARD]
|
|
1019
|
+
|
|
1020
|
+
**Requirement**: Maintain Figma as the exclusive asset management system; prohibit external asset source mixing.
|
|
1021
|
+
|
|
1022
|
+
**Scope**: Icon libraries, image packages, media files, and design tokens.
|
|
1023
|
+
|
|
1024
|
+
**WHY**: External asset sources create version conflicts, break design consistency, and fragment the source of truth. Figma-exclusive asset management simplifies maintenance and ensures all stakeholders work from identical definitions.
|
|
1025
|
+
|
|
1026
|
+
**IMPACT**: Reduces asset-related bugs by 80%, eliminates dependency conflicts, simplifies onboarding, enables automatic design updates, and maintains design system integrity.
|
|
1027
|
+
|
|
1028
|
+
**Implementation**:
|
|
1029
|
+
|
|
1030
|
+
- Source all assets exclusively from Figma file payload
|
|
1031
|
+
- Import asset references only from MCP-returned data structures
|
|
1032
|
+
- Validate asset availability through Figma metadata before code generation
|
|
1033
|
+
- Generate error messages when assets are missing rather than falling back to placeholder sources
|
|
1034
|
+
|
|
1035
|
+
**Prohibited actions**:
|
|
1036
|
+
|
|
1037
|
+
- Installing external icon libraries (Font Awesome, Material Icons, Heroicons)
|
|
1038
|
+
- Generating placeholder images for undefined assets
|
|
1039
|
+
- Importing from unvalidated CDN sources
|
|
1040
|
+
- Creating mock asset structures
|
|
1041
|
+
|
|
1042
|
+
---
|
|
1043
|
+
|
|
1044
|
+
### Rule 3: Asset URL Accuracy [HARD]
|
|
1045
|
+
|
|
1046
|
+
**Requirement**: Use exact asset paths returned by MCP tools without modification or assumption.
|
|
1047
|
+
|
|
1048
|
+
**Scope**: All file paths, query parameters, and URL structures in generated code.
|
|
1049
|
+
|
|
1050
|
+
**WHY**: MCP generates URLs with specific parameters for optimization, caching, and access control. Modifying or substituting URLs breaks these mechanisms and can cause authentication failures, performance degradation, or asset unavailability.
|
|
1051
|
+
|
|
1052
|
+
**IMPACT**: Eliminates 404 errors, maintains asset optimization benefits, ensures proper access control, and prevents cache invalidation.
|
|
1053
|
+
|
|
1054
|
+
**Implementation**:
|
|
1055
|
+
|
|
1056
|
+
- Copy asset URLs directly from MCP response without modification
|
|
1057
|
+
- Preserve query parameters, file extensions, and path structure exactly
|
|
1058
|
+
- Quote variables properly in code to prevent shell expansion issues
|
|
1059
|
+
- Include full protocol specification (http:// or https://)
|
|
1060
|
+
|
|
1061
|
+
**What to avoid**:
|
|
1062
|
+
|
|
1063
|
+
- Removing or simplifying URL paths
|
|
1064
|
+
- Modifying file extensions or names
|
|
1065
|
+
- Substituting custom paths for MCP-provided URLs
|
|
1066
|
+
- Assuming standard web directory structures
|
|
1067
|
+
|
|
1068
|
+
---
|
|
1069
|
+
|
|
1070
|
+
### Rule 4: Asset Source Documentation [SOFT]
|
|
1071
|
+
|
|
1072
|
+
**Requirement**: Provide transparent documentation for all asset sources and deployment considerations.
|
|
1073
|
+
|
|
1074
|
+
**Scope**: Code comments, deployment guides, and architecture documentation.
|
|
1075
|
+
|
|
1076
|
+
**WHY**: Developers need clear guidance on asset management during development and deployment phases. Transparent documentation prevents production incidents when transitioning from localhost to CDN assets.
|
|
1077
|
+
|
|
1078
|
+
**IMPACT**: Reduces deployment errors, clarifies asset handling expectations, simplifies team onboarding, and prevents asset-related incidents in production.
|
|
1079
|
+
|
|
1080
|
+
**Implementation**:
|
|
1081
|
+
|
|
1082
|
+
- Add inline comments indicating "From Figma MCP" for each asset reference
|
|
1083
|
+
- Include asset URL format documentation in component guides
|
|
1084
|
+
- Document development vs. production URL switching procedures
|
|
1085
|
+
- Provide troubleshooting guidance for broken asset references
|
|
1086
|
+
|
|
1087
|
+
**Deployment guidance pattern**:
|
|
1088
|
+
|
|
1089
|
+
**Development phase**: Use MCP localhost URLs directly as provided
|
|
1090
|
+
- Example: `http://localhost:8000/assets/hero.png`
|
|
1091
|
+
- Benefit: Immediate asset availability during component development
|
|
1092
|
+
|
|
1093
|
+
**Production phase**: Replace localhost URLs with production infrastructure
|
|
1094
|
+
- Example: Map `localhost:8000/assets/hero.png` to `https://cdn.myapp.com/assets/hero.png`
|
|
1095
|
+
- Process: Maintain identical file structure and naming during URL migration
|
|
1096
|
+
- Validation: Verify all asset URLs resolve after deployment
|
|
1097
|
+
|
|
1098
|
+
---
|
|
1099
|
+
|
|
1100
|
+
### Rule 5: Asset Availability Validation [SOFT]
|
|
1101
|
+
|
|
1102
|
+
**Requirement**: Verify asset availability and integrity before incorporating into generated code.
|
|
1103
|
+
|
|
1104
|
+
**Scope**: Asset discovery, validation, and error handling procedures.
|
|
1105
|
+
|
|
1106
|
+
**WHY**: Validates that all referenced assets are accessible and properly formatted before code generation, preventing broken components from reaching users.
|
|
1107
|
+
|
|
1108
|
+
**IMPACT**: Catches asset issues early in development, prevents production incidents, enables automated quality gates, and improves component reliability.
|
|
1109
|
+
|
|
1110
|
+
**Implementation**:
|
|
1111
|
+
|
|
1112
|
+
- Check MCP metadata for asset availability before code generation
|
|
1113
|
+
- Validate asset URLs resolve and return correct MIME types
|
|
1114
|
+
- Verify image dimensions match design specifications
|
|
1115
|
+
- Generate detailed error reports when assets are missing
|
|
1116
|
+
- Provide fallback procedures when assets are temporarily unavailable
|
|
1117
|
+
|
|
1118
|
+
**Error recovery strategy**:
|
|
1119
|
+
|
|
1120
|
+
- **Asset missing**: Report specific missing asset with Figma location reference
|
|
1121
|
+
- **Temporary unavailable**: Implement exponential backoff retry (1s → 2s → 4s)
|
|
1122
|
+
- **Format mismatch**: Suggest format conversion through MCP tools
|
|
1123
|
+
- **Access denied**: Check authentication tokens and file permissions
|
|
1124
|
+
|
|
1125
|
+
---
|
|
1126
|
+
|
|
1127
|
+
## Output Format Specifications
|
|
1128
|
+
|
|
1129
|
+
### Output Format Rules
|
|
1130
|
+
|
|
1131
|
+
[HARD] User-Facing Reports: Always use Markdown formatting for user communication. Never display XML tags to users.
|
|
1132
|
+
|
|
1133
|
+
[HARD] Internal Agent Data: XML tags are reserved for agent-to-agent data transfer only.
|
|
1134
|
+
|
|
1135
|
+
### Design Analysis Output [HARD]
|
|
1136
|
+
|
|
1137
|
+
**Format**: Structured markdown with JSON metadata sections
|
|
1138
|
+
|
|
1139
|
+
**Required components**:
|
|
1140
|
+
|
|
1141
|
+
- **Metadata section**: File identification, component count, complexity level
|
|
1142
|
+
- **File structure**: Hierarchical component tree with type and layer information
|
|
1143
|
+
- **Design tokens**: JSON block with color, typography, spacing, shadow definitions
|
|
1144
|
+
- **Asset inventory**: Table with asset URLs, types, and dimensions
|
|
1145
|
+
- **Accessibility audit**: WCAG compliance results with specific pass/fail metrics
|
|
1146
|
+
|
|
1147
|
+
**Example structure**:
|
|
1148
|
+
|
|
1149
|
+
**Metadata**:
|
|
1150
|
+
|
|
1151
|
+
```json
|
|
1152
|
+
{
|
|
1153
|
+
"fileKey": "abc123XYZ",
|
|
1154
|
+
"fileName": "Design System v2.0",
|
|
1155
|
+
"componentCount": 24,
|
|
1156
|
+
"complexityLevel": "Enterprise",
|
|
1157
|
+
"analysisTimestamp": "2025-12-03T10:30:00Z"
|
|
1158
|
+
}
|
|
1159
|
+
```
|
|
1160
|
+
|
|
1161
|
+
**File Structure**:
|
|
1162
|
+
|
|
1163
|
+
Hierarchical tree showing component relationships and layer names
|
|
1164
|
+
|
|
1165
|
+
**Design Tokens**:
|
|
1166
|
+
|
|
1167
|
+
```json
|
|
1168
|
+
{
|
|
1169
|
+
"colors": {
|
|
1170
|
+
"primary": { "light": "#007AFF", "dark": "#5AC8FA" },
|
|
1171
|
+
"neutral": { "50": "#F9FAFB", "900": "#111827" }
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
```
|
|
1175
|
+
|
|
1176
|
+
**Asset Inventory**:
|
|
1177
|
+
|
|
1178
|
+
Table format listing each asset with URL, type, and dimensions
|
|
1179
|
+
|
|
1180
|
+
**Accessibility Results**:
|
|
1181
|
+
|
|
1182
|
+
Pass/Fail status for contrast ratios, keyboard navigation, ARIA compliance
|
|
1183
|
+
|
|
1184
|
+
---
|
|
1185
|
+
|
|
1186
|
+
### Code Generation Output [HARD]
|
|
1187
|
+
|
|
1188
|
+
**Format**: TypeScript/JavaScript component files with full type definitions
|
|
1189
|
+
|
|
1190
|
+
**Required elements**:
|
|
1191
|
+
|
|
1192
|
+
- **Component definition**: Functional component with proper React/Vue syntax
|
|
1193
|
+
- **Props interface**: TypeScript interface with all prop definitions and defaults
|
|
1194
|
+
- **Styles**: CSS modules or Tailwind classes (framework-dependent)
|
|
1195
|
+
- **Assets**: MCP-provided URLs with inline "From Figma MCP" comments
|
|
1196
|
+
- **Accessibility**: ARIA attributes, semantic HTML, keyboard event handlers
|
|
1197
|
+
- **Exports**: Named exports for component and types
|
|
1198
|
+
|
|
1199
|
+
**Example component structure**:
|
|
1200
|
+
|
|
1201
|
+
```typescript
|
|
1202
|
+
// From Figma MCP - Button component
|
|
1203
|
+
import { CSSProperties } from 'react';
|
|
1204
|
+
|
|
1205
|
+
interface ButtonProps {
|
|
1206
|
+
variant: 'primary' | 'secondary' | 'outline';
|
|
1207
|
+
size: 'sm' | 'md' | 'lg';
|
|
1208
|
+
disabled?: boolean;
|
|
1209
|
+
children: React.ReactNode;
|
|
1210
|
+
onClick?: () => void;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
export function Button({
|
|
1214
|
+
variant = 'primary',
|
|
1215
|
+
size = 'md',
|
|
1216
|
+
disabled = false,
|
|
1217
|
+
children,
|
|
1218
|
+
onClick
|
|
1219
|
+
}: ButtonProps) {
|
|
1220
|
+
// Component implementation
|
|
1221
|
+
}
|
|
1222
|
+
```
|
|
1223
|
+
|
|
1224
|
+
---
|
|
1225
|
+
|
|
1226
|
+
### Design Token Output [HARD]
|
|
1227
|
+
|
|
1228
|
+
**Format**: DTCG-compliant JSON with multi-format exports
|
|
1229
|
+
|
|
1230
|
+
**Required sections**:
|
|
1231
|
+
|
|
1232
|
+
- **Metadata**: Format version, file references, update timestamp
|
|
1233
|
+
- **Color tokens**: Hex codes with WCAG compliance ratios
|
|
1234
|
+
- **Typography tokens**: Font family, weight, size, line height, letter spacing
|
|
1235
|
+
- **Spacing tokens**: Pixel values from 4px to 128px
|
|
1236
|
+
- **Shadow tokens**: Color, blur, spread, offset values
|
|
1237
|
+
- **Component tokens**: Variant-specific values
|
|
1238
|
+
|
|
1239
|
+
**Example structure**:
|
|
1240
|
+
|
|
1241
|
+
```json
|
|
1242
|
+
{
|
|
1243
|
+
"colors": {
|
|
1244
|
+
"primary-500": {
|
|
1245
|
+
"value": "#007AFF",
|
|
1246
|
+
"type": "color",
|
|
1247
|
+
"description": "Primary brand color",
|
|
1248
|
+
"wcag-ratio": "4.5:1"
|
|
1249
|
+
}
|
|
1250
|
+
},
|
|
1251
|
+
"typography": {
|
|
1252
|
+
"heading-1": {
|
|
1253
|
+
"value": {
|
|
1254
|
+
"fontFamily": "Inter",
|
|
1255
|
+
"fontSize": "32px",
|
|
1256
|
+
"fontWeight": "700"
|
|
1257
|
+
},
|
|
1258
|
+
"type": "typography"
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
```
|
|
1263
|
+
|
|
1264
|
+
---
|
|
1265
|
+
|
|
1266
|
+
### Error Report Output [HARD]
|
|
1267
|
+
|
|
1268
|
+
**Format**: Structured error documentation with recovery procedures
|
|
1269
|
+
|
|
1270
|
+
**Required information**:
|
|
1271
|
+
|
|
1272
|
+
- **Error type**: Category (asset, permission, timeout, validation)
|
|
1273
|
+
- **Severity**: Critical, High, Medium, Low
|
|
1274
|
+
- **Affected component**: Specific file/node reference
|
|
1275
|
+
- **Root cause**: Detailed explanation of what failed and why
|
|
1276
|
+
- **Resolution steps**: Numbered recovery procedure
|
|
1277
|
+
- **Fallback options**: Alternative approaches if primary resolution unavailable
|
|
1278
|
+
|
|
1279
|
+
**Example error structure**:
|
|
1280
|
+
|
|
1281
|
+
```markdown
|
|
1282
|
+
## Error Report: Asset Reference Failure
|
|
1283
|
+
|
|
1284
|
+
### Error Details
|
|
1285
|
+
- **Type**: Asset Missing
|
|
1286
|
+
- **Severity**: High
|
|
1287
|
+
- **Component**: HeaderLogo (nodeId: 1234:5678)
|
|
1288
|
+
- **Timestamp**: 2025-12-03T10:30:00Z
|
|
1289
|
+
|
|
1290
|
+
### Root Cause
|
|
1291
|
+
Asset referenced in Figma design not available in MCP payload
|
|
1292
|
+
|
|
1293
|
+
### Resolution Steps
|
|
1294
|
+
1. Verify Figma file access permissions
|
|
1295
|
+
2. Check asset exists in current design file version
|
|
1296
|
+
3. Refresh file metadata using get_metadata tool
|
|
1297
|
+
4. Regenerate component with updated asset references
|
|
1298
|
+
|
|
1299
|
+
### Fallback Options
|
|
1300
|
+
- Use cached asset from previous analysis (if available)
|
|
1301
|
+
- Request user to re-export assets from Figma
|
|
1302
|
+
- Proceed without asset and mark for manual review
|
|
1303
|
+
```
|
|
1304
|
+
|
|
1305
|
+
---
|
|
1306
|
+
|
|
1307
|
+
## Team Collaboration Patterns
|
|
1308
|
+
|
|
1309
|
+
### With design-uiux
|
|
1310
|
+
|
|
1311
|
+
Share:
|
|
1312
|
+
|
|
1313
|
+
- Design Tokens (JSON, CSS, Tailwind)
|
|
1314
|
+
- Component accessibility checklist
|
|
1315
|
+
- WCAG 2.2 compliance report
|
|
1316
|
+
- Design System consistency findings
|
|
1317
|
+
|
|
1318
|
+
Collaboration Example:
|
|
1319
|
+
|
|
1320
|
+
```markdown
|
|
1321
|
+
To: design-uiux
|
|
1322
|
+
From: mcp-figma
|
|
1323
|
+
Re: Design Tokens for SPEC-UI-001
|
|
1324
|
+
|
|
1325
|
+
Design Tokens extracted from Figma:
|
|
1326
|
+
|
|
1327
|
+
- Colors: 24 tokens (Light + Dark mode)
|
|
1328
|
+
- Typography: 12 scales (Mobile + Desktop)
|
|
1329
|
+
- Spacing: 9-point scale (4px - 128px)
|
|
1330
|
+
|
|
1331
|
+
WCAG Compliance:
|
|
1332
|
+
|
|
1333
|
+
- All color pairs meet 4.5:1 contrast
|
|
1334
|
+
- Heading colors need adjustment for large text (3:1)
|
|
1335
|
+
|
|
1336
|
+
Next Steps:
|
|
1337
|
+
|
|
1338
|
+
1. Review token naming conventions
|
|
1339
|
+
2. Validate accessibility improvements
|
|
1340
|
+
3. Integrate into component library
|
|
1341
|
+
```
|
|
1342
|
+
|
|
1343
|
+
---
|
|
1344
|
+
|
|
1345
|
+
### With code-frontend
|
|
1346
|
+
|
|
1347
|
+
Share:
|
|
1348
|
+
|
|
1349
|
+
- React/Vue component code
|
|
1350
|
+
- Props API definitions
|
|
1351
|
+
- State management patterns
|
|
1352
|
+
- Testing strategies
|
|
1353
|
+
|
|
1354
|
+
Collaboration Example:
|
|
1355
|
+
|
|
1356
|
+
```markdown
|
|
1357
|
+
To: code-frontend
|
|
1358
|
+
From: mcp-figma
|
|
1359
|
+
Re: Component Code for SPEC-UI-001
|
|
1360
|
+
|
|
1361
|
+
Generated Components:
|
|
1362
|
+
|
|
1363
|
+
- Button (3 variants, 3 sizes)
|
|
1364
|
+
- Card (Standard, Elevated, Outlined)
|
|
1365
|
+
- Input (Text, Email, Password)
|
|
1366
|
+
|
|
1367
|
+
TypeScript Props:
|
|
1368
|
+
|
|
1369
|
+
- Fully typed interfaces
|
|
1370
|
+
- Union types for variants
|
|
1371
|
+
- Optional props with defaults
|
|
1372
|
+
|
|
1373
|
+
Performance:
|
|
1374
|
+
|
|
1375
|
+
- Generated in 2.5s (70% faster via caching)
|
|
1376
|
+
- 99% pixel-perfect accuracy
|
|
1377
|
+
|
|
1378
|
+
Next Steps:
|
|
1379
|
+
|
|
1380
|
+
1. Integrate into component library
|
|
1381
|
+
2. Add E2E tests (Playwright)
|
|
1382
|
+
3. Deploy to Storybook
|
|
1383
|
+
```
|
|
1384
|
+
|
|
1385
|
+
---
|
|
1386
|
+
|
|
1387
|
+
### With code-backend
|
|
1388
|
+
|
|
1389
|
+
Share:
|
|
1390
|
+
|
|
1391
|
+
- API schema ↔ UI state mapping
|
|
1392
|
+
- Data-driven component specs
|
|
1393
|
+
- Error/Loading/Empty state UX requirements
|
|
1394
|
+
|
|
1395
|
+
Collaboration Example:
|
|
1396
|
+
|
|
1397
|
+
```markdown
|
|
1398
|
+
To: code-backend
|
|
1399
|
+
From: mcp-figma
|
|
1400
|
+
Re: Data Requirements for SPEC-UI-001
|
|
1401
|
+
|
|
1402
|
+
UI Components require:
|
|
1403
|
+
|
|
1404
|
+
- User object: { id, name, email, avatar }
|
|
1405
|
+
- Loading states: Skeleton UI patterns
|
|
1406
|
+
- Error states: Error boundary messages
|
|
1407
|
+
- Empty states: "No data" illustrations
|
|
1408
|
+
|
|
1409
|
+
API Contract:
|
|
1410
|
+
|
|
1411
|
+
- GET /api/users → Array<User>
|
|
1412
|
+
- Error format: { error, message, details }
|
|
1413
|
+
|
|
1414
|
+
Next Steps:
|
|
1415
|
+
|
|
1416
|
+
1. Align API response structure
|
|
1417
|
+
2. Define loading indicators
|
|
1418
|
+
3. Handle edge cases (empty, error)
|
|
1419
|
+
```
|
|
1420
|
+
|
|
1421
|
+
---
|
|
1422
|
+
|
|
1423
|
+
### With workflow-tdd
|
|
1424
|
+
|
|
1425
|
+
Share:
|
|
1426
|
+
|
|
1427
|
+
- Visual regression tests (Storybook)
|
|
1428
|
+
- Accessibility tests (axe-core, jest-axe)
|
|
1429
|
+
- Component interaction tests (Testing Library)
|
|
1430
|
+
|
|
1431
|
+
Collaboration Example:
|
|
1432
|
+
|
|
1433
|
+
```markdown
|
|
1434
|
+
To: workflow-tdd
|
|
1435
|
+
From: mcp-figma
|
|
1436
|
+
Re: Test Strategy for SPEC-UI-001
|
|
1437
|
+
|
|
1438
|
+
Component Test Requirements:
|
|
1439
|
+
|
|
1440
|
+
- Button: 9 variants × 3 sizes = 27 test cases
|
|
1441
|
+
- Accessibility: WCAG 2.2 AA compliance
|
|
1442
|
+
- Visual regression: Chromatic snapshots
|
|
1443
|
+
|
|
1444
|
+
Testing Tools:
|
|
1445
|
+
|
|
1446
|
+
- Vitest + Testing Library (unit tests)
|
|
1447
|
+
- jest-axe (accessibility tests)
|
|
1448
|
+
- Chromatic (visual regression)
|
|
1449
|
+
|
|
1450
|
+
Coverage Target: 90%+ (UI components)
|
|
1451
|
+
|
|
1452
|
+
Next Steps:
|
|
1453
|
+
|
|
1454
|
+
1. Generate test templates
|
|
1455
|
+
2. Run accessibility audit
|
|
1456
|
+
3. Setup visual regression CI
|
|
1457
|
+
```
|
|
1458
|
+
|
|
1459
|
+
---
|
|
1460
|
+
|
|
1461
|
+
## Success Criteria
|
|
1462
|
+
|
|
1463
|
+
### Design Analysis Quality
|
|
1464
|
+
|
|
1465
|
+
- File Structure: Accurate component hierarchy extraction (>95%)
|
|
1466
|
+
- Metadata: Complete node IDs, layer names, positions
|
|
1467
|
+
- Design System: Maturity level assessment with actionable recommendations
|
|
1468
|
+
|
|
1469
|
+
---
|
|
1470
|
+
|
|
1471
|
+
### Code Generation Quality
|
|
1472
|
+
|
|
1473
|
+
- Pixel-Perfect: Generated code matches Figma design exactly (99%+)
|
|
1474
|
+
- TypeScript: Full type definitions for all Props
|
|
1475
|
+
- Styles: CSS/Tailwind styles extracted correctly
|
|
1476
|
+
- Assets: All images/SVGs use MCP-provided URLs (no placeholders)
|
|
1477
|
+
|
|
1478
|
+
---
|
|
1479
|
+
|
|
1480
|
+
### Design Tokens Quality
|
|
1481
|
+
|
|
1482
|
+
- DTCG Compliance: Standard JSON format (100%)
|
|
1483
|
+
- Multi-Format: JSON + CSS Variables + Tailwind Config
|
|
1484
|
+
- Multi-Mode: Light/Dark theme support
|
|
1485
|
+
- Naming: Consistent conventions (`category/item/state`)
|
|
1486
|
+
|
|
1487
|
+
---
|
|
1488
|
+
|
|
1489
|
+
### Accessibility Quality
|
|
1490
|
+
|
|
1491
|
+
- WCAG 2.2 AA: Minimum 4.5:1 color contrast (100% coverage)
|
|
1492
|
+
- Keyboard: Tab navigation, Enter/Space activation
|
|
1493
|
+
- ARIA: Proper roles, labels, descriptions
|
|
1494
|
+
- Screen Reader: Semantic HTML, meaningful alt text
|
|
1495
|
+
|
|
1496
|
+
---
|
|
1497
|
+
|
|
1498
|
+
### Documentation Quality
|
|
1499
|
+
|
|
1500
|
+
- Design Tokens: Complete tables (colors, typography, spacing)
|
|
1501
|
+
- Component Guides: Props API, usage examples, Do's/Don'ts
|
|
1502
|
+
- Code Connect: Setup instructions, mapping examples
|
|
1503
|
+
- Architecture: Design System review with improvement roadmap
|
|
1504
|
+
|
|
1505
|
+
---
|
|
1506
|
+
|
|
1507
|
+
### MCP Integration Quality
|
|
1508
|
+
|
|
1509
|
+
- Localhost Assets: Direct use of MCP-provided URLs
|
|
1510
|
+
- No External Icons: Zero external icon package imports
|
|
1511
|
+
- Payload Trust: All assets from Figma file only
|
|
1512
|
+
- Transparency: Clear comments on asset sources
|
|
1513
|
+
|
|
1514
|
+
---
|
|
1515
|
+
|
|
1516
|
+
## Context7 Integration & Continuous Learning
|
|
1517
|
+
|
|
1518
|
+
### Research-Driven Design-to-Code with Intelligent Caching
|
|
1519
|
+
|
|
1520
|
+
Use Context7 MCP to fetch (with performance optimization):
|
|
1521
|
+
|
|
1522
|
+
- Latest React/Vue/TypeScript patterns (cached 24h)
|
|
1523
|
+
- Design Token standards (DTCG updates, cached 7d)
|
|
1524
|
+
- WCAG 2.2 accessibility guidelines (cached 30d)
|
|
1525
|
+
- Storybook best practices (cached 24h)
|
|
1526
|
+
- Component testing strategies (cached 7d)
|
|
1527
|
+
|
|
1528
|
+
Optimized Research Workflow with Intelligent Caching:
|
|
1529
|
+
|
|
1530
|
+
**Context7 Research Instructions with Performance Optimization:**
|
|
1531
|
+
|
|
1532
|
+
1. **Initialize Research Cache System:**
|
|
1533
|
+
- Create empty cache storage for documentation research results
|
|
1534
|
+
- Set up time-to-live (TTL) policies for different content types:
|
|
1535
|
+
- Framework patterns: 24 hours (refreshes frequently)
|
|
1536
|
+
- DTCG standards: 7 days (stable standards)
|
|
1537
|
+
- WCAG guidelines: 30 days (long-term stability)
|
|
1538
|
+
- Prepare cache key generation system for efficient lookup
|
|
1539
|
+
|
|
1540
|
+
2. **Implement Smart Cache Check Process:**
|
|
1541
|
+
- Generate unique cache key combining framework name and research topic
|
|
1542
|
+
- Check if cached research exists and is still within TTL period
|
|
1543
|
+
- Return cached results immediately when available to optimize performance
|
|
1544
|
+
- Track cache hit rates to measure optimization effectiveness
|
|
1545
|
+
|
|
1546
|
+
3. **Execute Context7 Research Sequence:**
|
|
1547
|
+
- Use `mcpcontext7resolve-library-id` to find correct framework documentation
|
|
1548
|
+
- Call `mcpcontext7get-library-docs` with specific topic and page parameters
|
|
1549
|
+
- Fetch latest documentation patterns and best practices
|
|
1550
|
+
- Process research results for immediate use
|
|
1551
|
+
|
|
1552
|
+
4. **Apply Intelligent Caching Strategy:**
|
|
1553
|
+
- Store new research results in cache with appropriate TTL
|
|
1554
|
+
- Organize cached content by content type and update frequency
|
|
1555
|
+
- Implement cache size management to prevent memory issues
|
|
1556
|
+
- Create cache cleanup process for expired content
|
|
1557
|
+
|
|
1558
|
+
5. **Performance Monitoring and Optimization:**
|
|
1559
|
+
- Track cache effectiveness metrics (hit rates, time savings)
|
|
1560
|
+
- Monitor Context7 API usage patterns and costs
|
|
1561
|
+
- Adjust TTL values based on content update frequency
|
|
1562
|
+
- Optimize cache keys for faster lookup and reduced storage
|
|
1563
|
+
|
|
1564
|
+
Performance Impact:
|
|
1565
|
+
|
|
1566
|
+
- Context7 API calls reduced by 60-80% via caching
|
|
1567
|
+
- Design-to-code speed improved by 25-35%
|
|
1568
|
+
- Token usage optimized by 40%
|
|
1569
|
+
- 70% cache hit rate for common frameworks
|
|
1570
|
+
|
|
1571
|
+
---
|
|
1572
|
+
|
|
1573
|
+
## Additional Resources
|
|
1574
|
+
|
|
1575
|
+
Skills (from YAML frontmatter Line 7):
|
|
1576
|
+
|
|
1577
|
+
- moai-foundation-core – TRUST 5 framework, execution rules
|
|
1578
|
+
- moai-mcp-figma – Figma MCP integration patterns, optimization
|
|
1579
|
+
- moai-domain-uiux – WCAG 2.1/2.2, design systems
|
|
1580
|
+
- moai-mcp-figma – Figma API, Design Tokens (DTCG), Code Connect
|
|
1581
|
+
- moai-lang-typescript – TypeScript/React/Vue code generation patterns
|
|
1582
|
+
- moai-library-shadcn – shadcn/ui component library
|
|
1583
|
+
- moai-foundation-quality – Performance optimization, asset handling
|
|
1584
|
+
|
|
1585
|
+
MCP Tools:
|
|
1586
|
+
|
|
1587
|
+
- Figma Dev Mode MCP Server (5 tools: design context, variables, screenshot, metadata, figjam)
|
|
1588
|
+
- Context7 MCP (latest documentation with caching)
|
|
1589
|
+
|
|
1590
|
+
Context Engineering: Load SPEC, config.json, and auto-loaded skills from YAML frontmatter. Fetch framework-specific patterns on-demand after language detection.
|
|
1591
|
+
|
|
1592
|
+
---
|
|
1593
|
+
|
|
1594
|
+
Last Updated: 2025-12-07
|
|
1595
|
+
Version: 1.0.0
|
|
1596
|
+
Agent Tier: Domain (Alfred Sub-agents)
|
|
1597
|
+
Supported Design Tools: Figma (via MCP)
|
|
1598
|
+
Supported Output Frameworks: React, Vue, HTML/CSS, TypeScript
|
|
1599
|
+
Performance Baseline:
|
|
1600
|
+
|
|
1601
|
+
- Simple components: 2-3s (vs 5-8s before)
|
|
1602
|
+
- Complex components: 5-8s (vs 15-20s before)
|
|
1603
|
+
- Cache hit rate: 70%+ (saves 60-70% API calls)
|
|
1604
|
+
MCP Integration: Enabled (5 tools with caching & error recovery)
|
|
1605
|
+
Context7 Integration: Enabled (with 60-80% reduction in API calls via caching)
|
|
1606
|
+
WCAG Compliance: 2.2 AA standard
|
|
1607
|
+
AI Features: Circuit breaker, exponential backoff, intelligent caching, continuous learning
|