moai-adk 0.25.4__py3-none-any.whl → 0.32.8__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.

Files changed (378) hide show
  1. moai_adk/__init__.py +2 -5
  2. moai_adk/__main__.py +114 -82
  3. moai_adk/cli/__init__.py +6 -1
  4. moai_adk/cli/commands/__init__.py +1 -3
  5. moai_adk/cli/commands/analyze.py +5 -16
  6. moai_adk/cli/commands/doctor.py +6 -18
  7. moai_adk/cli/commands/init.py +56 -125
  8. moai_adk/cli/commands/language.py +14 -35
  9. moai_adk/cli/commands/status.py +9 -15
  10. moai_adk/cli/commands/update.py +1555 -190
  11. moai_adk/cli/prompts/init_prompts.py +112 -56
  12. moai_adk/cli/spec_status.py +263 -0
  13. moai_adk/cli/ui/__init__.py +44 -0
  14. moai_adk/cli/ui/progress.py +422 -0
  15. moai_adk/cli/ui/prompts.py +389 -0
  16. moai_adk/cli/ui/theme.py +129 -0
  17. moai_adk/cli/worktree/__init__.py +27 -0
  18. moai_adk/cli/worktree/__main__.py +31 -0
  19. moai_adk/cli/worktree/cli.py +672 -0
  20. moai_adk/cli/worktree/exceptions.py +89 -0
  21. moai_adk/cli/worktree/manager.py +490 -0
  22. moai_adk/cli/worktree/models.py +65 -0
  23. moai_adk/cli/worktree/registry.py +128 -0
  24. moai_adk/core/PHASE2_OPTIMIZATIONS.md +467 -0
  25. moai_adk/core/analysis/session_analyzer.py +17 -56
  26. moai_adk/core/claude_integration.py +26 -54
  27. moai_adk/core/command_helpers.py +10 -10
  28. moai_adk/core/comprehensive_monitoring_system.py +1183 -0
  29. moai_adk/core/config/auto_spec_config.py +5 -11
  30. moai_adk/core/config/migration.py +19 -9
  31. moai_adk/core/config/unified.py +436 -0
  32. moai_adk/core/context_manager.py +6 -12
  33. moai_adk/core/enterprise_features.py +1404 -0
  34. moai_adk/core/error_recovery_system.py +725 -112
  35. moai_adk/core/event_driven_hook_system.py +1371 -0
  36. moai_adk/core/git/__init__.py +8 -0
  37. moai_adk/core/git/branch_manager.py +3 -11
  38. moai_adk/core/git/checkpoint.py +1 -3
  39. moai_adk/core/git/conflict_detector.py +413 -0
  40. moai_adk/core/git/manager.py +91 -1
  41. moai_adk/core/hooks/post_tool_auto_spec_completion.py +56 -80
  42. moai_adk/core/input_validation_middleware.py +1006 -0
  43. moai_adk/core/integration/engine.py +6 -18
  44. moai_adk/core/integration/integration_tester.py +10 -9
  45. moai_adk/core/integration/utils.py +1 -1
  46. moai_adk/core/issue_creator.py +10 -28
  47. moai_adk/core/jit_context_loader.py +956 -0
  48. moai_adk/core/jit_enhanced_hook_manager.py +1987 -0
  49. moai_adk/core/language_config_resolver.py +485 -0
  50. moai_adk/core/language_validator.py +28 -41
  51. moai_adk/core/mcp/setup.py +15 -12
  52. moai_adk/core/merge/__init__.py +9 -0
  53. moai_adk/core/merge/analyzer.py +481 -0
  54. moai_adk/core/migration/alfred_to_moai_migrator.py +383 -0
  55. moai_adk/core/migration/backup_manager.py +78 -9
  56. moai_adk/core/migration/custom_element_scanner.py +358 -0
  57. moai_adk/core/migration/file_migrator.py +8 -17
  58. moai_adk/core/migration/interactive_checkbox_ui.py +488 -0
  59. moai_adk/core/migration/selective_restorer.py +470 -0
  60. moai_adk/core/migration/template_utils.py +74 -0
  61. moai_adk/core/migration/user_selection_ui.py +338 -0
  62. moai_adk/core/migration/version_detector.py +6 -10
  63. moai_adk/core/migration/version_migrator.py +3 -3
  64. moai_adk/core/performance/cache_system.py +8 -10
  65. moai_adk/core/phase_optimized_hook_scheduler.py +879 -0
  66. moai_adk/core/project/checker.py +2 -4
  67. moai_adk/core/project/detector.py +1 -3
  68. moai_adk/core/project/initializer.py +135 -23
  69. moai_adk/core/project/phase_executor.py +54 -81
  70. moai_adk/core/project/validator.py +6 -12
  71. moai_adk/core/quality/trust_checker.py +9 -27
  72. moai_adk/core/realtime_monitoring_dashboard.py +1724 -0
  73. moai_adk/core/robust_json_parser.py +611 -0
  74. moai_adk/core/rollback_manager.py +73 -148
  75. moai_adk/core/session_manager.py +10 -26
  76. moai_adk/core/skill_loading_system.py +579 -0
  77. moai_adk/core/spec/confidence_scoring.py +31 -100
  78. moai_adk/core/spec/ears_template_engine.py +351 -286
  79. moai_adk/core/spec/quality_validator.py +35 -69
  80. moai_adk/core/spec_status_manager.py +64 -74
  81. moai_adk/core/template/backup.py +45 -20
  82. moai_adk/core/template/config.py +112 -39
  83. moai_adk/core/template/merger.py +11 -19
  84. moai_adk/core/template/processor.py +253 -149
  85. moai_adk/core/template_engine.py +73 -40
  86. moai_adk/core/template_variable_synchronizer.py +417 -0
  87. moai_adk/core/unified_permission_manager.py +745 -0
  88. moai_adk/core/user_behavior_analytics.py +851 -0
  89. moai_adk/core/version_sync.py +429 -0
  90. moai_adk/foundation/__init__.py +56 -0
  91. moai_adk/foundation/backend.py +1027 -0
  92. moai_adk/foundation/database.py +1115 -0
  93. moai_adk/foundation/devops.py +1585 -0
  94. moai_adk/foundation/ears.py +431 -0
  95. moai_adk/foundation/frontend.py +870 -0
  96. moai_adk/foundation/git/commit_templates.py +4 -12
  97. moai_adk/foundation/git.py +376 -0
  98. moai_adk/foundation/langs.py +484 -0
  99. moai_adk/foundation/ml_ops.py +1162 -0
  100. moai_adk/foundation/testing.py +1524 -0
  101. moai_adk/foundation/trust/trust_principles.py +23 -72
  102. moai_adk/foundation/trust/validation_checklist.py +57 -162
  103. moai_adk/project/__init__.py +0 -0
  104. moai_adk/project/configuration.py +1084 -0
  105. moai_adk/project/documentation.py +566 -0
  106. moai_adk/project/schema.py +447 -0
  107. moai_adk/statusline/alfred_detector.py +1 -3
  108. moai_adk/statusline/config.py +13 -4
  109. moai_adk/statusline/enhanced_output_style_detector.py +23 -15
  110. moai_adk/statusline/main.py +51 -15
  111. moai_adk/statusline/renderer.py +104 -48
  112. moai_adk/statusline/update_checker.py +3 -9
  113. moai_adk/statusline/version_reader.py +140 -46
  114. moai_adk/templates/.claude/agents/moai/ai-nano-banana.md +549 -0
  115. moai_adk/templates/.claude/agents/moai/builder-agent.md +445 -0
  116. moai_adk/templates/.claude/agents/moai/builder-command.md +1132 -0
  117. moai_adk/templates/.claude/agents/moai/builder-skill.md +601 -0
  118. moai_adk/templates/.claude/agents/moai/expert-backend.md +831 -0
  119. moai_adk/templates/.claude/agents/moai/expert-database.md +774 -0
  120. moai_adk/templates/.claude/agents/moai/expert-debug.md +396 -0
  121. moai_adk/templates/.claude/agents/moai/expert-devops.md +711 -0
  122. moai_adk/templates/.claude/agents/moai/expert-frontend.md +666 -0
  123. moai_adk/templates/.claude/agents/moai/expert-security.md +474 -0
  124. moai_adk/templates/.claude/agents/moai/expert-uiux.md +1038 -0
  125. moai_adk/templates/.claude/agents/moai/manager-claude-code.md +429 -0
  126. moai_adk/templates/.claude/agents/moai/manager-docs.md +570 -0
  127. moai_adk/templates/.claude/agents/moai/manager-git.md +937 -0
  128. moai_adk/templates/.claude/agents/moai/manager-project.md +891 -0
  129. moai_adk/templates/.claude/agents/moai/manager-quality.md +598 -0
  130. moai_adk/templates/.claude/agents/moai/manager-spec.md +713 -0
  131. moai_adk/templates/.claude/agents/moai/manager-strategy.md +600 -0
  132. moai_adk/templates/.claude/agents/moai/manager-tdd.md +603 -0
  133. moai_adk/templates/.claude/agents/moai/mcp-context7.md +369 -0
  134. moai_adk/templates/.claude/agents/moai/mcp-figma.md +1567 -0
  135. moai_adk/templates/.claude/agents/moai/mcp-notion.md +749 -0
  136. moai_adk/templates/.claude/agents/moai/mcp-playwright.md +427 -0
  137. moai_adk/templates/.claude/agents/moai/mcp-sequential-thinking.md +994 -0
  138. moai_adk/templates/.claude/commands/moai/0-project.md +1143 -0
  139. moai_adk/templates/.claude/commands/moai/1-plan.md +1435 -0
  140. moai_adk/templates/.claude/commands/moai/2-run.md +883 -0
  141. moai_adk/templates/.claude/commands/moai/3-sync.md +993 -0
  142. moai_adk/templates/.claude/commands/moai/9-feedback.md +314 -0
  143. moai_adk/templates/.claude/hooks/__init__.py +8 -0
  144. moai_adk/templates/.claude/hooks/moai/__init__.py +8 -0
  145. moai_adk/templates/.claude/hooks/moai/lib/__init__.py +85 -0
  146. moai_adk/templates/.claude/hooks/moai/lib/checkpoint.py +244 -0
  147. moai_adk/templates/.claude/hooks/moai/lib/common.py +131 -0
  148. moai_adk/templates/.claude/hooks/moai/lib/config_manager.py +446 -0
  149. moai_adk/templates/.claude/hooks/moai/lib/config_validator.py +639 -0
  150. moai_adk/templates/.claude/hooks/moai/lib/example_config.json +104 -0
  151. moai_adk/templates/.claude/hooks/moai/lib/git_operations_manager.py +590 -0
  152. moai_adk/templates/.claude/hooks/moai/lib/language_validator.py +317 -0
  153. moai_adk/templates/.claude/hooks/moai/lib/models.py +102 -0
  154. moai_adk/templates/.claude/hooks/moai/lib/path_utils.py +28 -0
  155. moai_adk/templates/.claude/hooks/moai/lib/project.py +768 -0
  156. moai_adk/templates/.claude/hooks/moai/lib/test_hooks_improvements.py +443 -0
  157. moai_adk/templates/.claude/hooks/moai/lib/timeout.py +160 -0
  158. moai_adk/templates/.claude/hooks/moai/lib/unified_timeout_manager.py +530 -0
  159. moai_adk/templates/.claude/hooks/moai/session_end__auto_cleanup.py +862 -0
  160. moai_adk/templates/.claude/hooks/moai/session_start__show_project_info.py +921 -0
  161. moai_adk/templates/.claude/output-styles/moai/r2d2.md +380 -0
  162. moai_adk/templates/.claude/output-styles/moai/yoda.md +338 -0
  163. moai_adk/templates/.claude/settings.json +172 -0
  164. moai_adk/templates/.claude/skills/moai-docs-generation/SKILL.md +247 -0
  165. moai_adk/templates/.claude/skills/moai-docs-generation/modules/README.md +44 -0
  166. moai_adk/templates/.claude/skills/moai-docs-generation/modules/api-documentation.md +130 -0
  167. moai_adk/templates/.claude/skills/moai-docs-generation/modules/code-documentation.md +152 -0
  168. moai_adk/templates/.claude/skills/moai-docs-generation/modules/multi-format-output.md +178 -0
  169. moai_adk/templates/.claude/skills/moai-docs-generation/modules/user-guides.md +147 -0
  170. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +319 -0
  171. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +320 -0
  172. moai_adk/templates/.claude/skills/moai-domain-database/modules/README.md +53 -0
  173. moai_adk/templates/.claude/skills/moai-domain-database/modules/mongodb.md +231 -0
  174. moai_adk/templates/.claude/skills/moai-domain-database/modules/postgresql.md +169 -0
  175. moai_adk/templates/.claude/skills/moai-domain-database/modules/redis.md +262 -0
  176. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +496 -0
  177. moai_adk/templates/.claude/skills/moai-domain-uiux/SKILL.md +453 -0
  178. moai_adk/templates/.claude/skills/moai-domain-uiux/examples.md +560 -0
  179. moai_adk/templates/.claude/skills/moai-domain-uiux/modules/accessibility-wcag.md +260 -0
  180. moai_adk/templates/.claude/skills/moai-domain-uiux/modules/component-architecture.md +228 -0
  181. moai_adk/templates/.claude/skills/moai-domain-uiux/modules/design-system-tokens.md +405 -0
  182. moai_adk/templates/.claude/skills/moai-domain-uiux/modules/icon-libraries.md +401 -0
  183. moai_adk/templates/.claude/skills/moai-domain-uiux/modules/theming-system.md +373 -0
  184. moai_adk/templates/.claude/skills/moai-domain-uiux/reference.md +243 -0
  185. moai_adk/templates/.claude/skills/moai-formats-data/SKILL.md +491 -0
  186. moai_adk/templates/.claude/skills/moai-formats-data/modules/README.md +98 -0
  187. moai_adk/templates/.claude/skills/moai-formats-data/modules/SKILL-MODULARIZATION-TEMPLATE.md +278 -0
  188. moai_adk/templates/.claude/skills/moai-formats-data/modules/caching-performance.md +459 -0
  189. moai_adk/templates/.claude/skills/moai-formats-data/modules/data-validation.md +485 -0
  190. moai_adk/templates/.claude/skills/moai-formats-data/modules/json-optimization.md +374 -0
  191. moai_adk/templates/.claude/skills/moai-formats-data/modules/toon-encoding.md +308 -0
  192. moai_adk/templates/.claude/skills/moai-foundation-claude/SKILL.md +201 -0
  193. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/best-practices-checklist.md +616 -0
  194. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-custom-slash-commands-official.md +729 -0
  195. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-hooks-official.md +560 -0
  196. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-iam-official.md +635 -0
  197. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-memory-official.md +543 -0
  198. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-settings-official.md +663 -0
  199. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-skills-official.md +113 -0
  200. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-sub-agents-official.md +238 -0
  201. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/complete-configuration-guide.md +175 -0
  202. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/skill-examples.md +1674 -0
  203. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/skill-formatting-guide.md +729 -0
  204. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-examples.md +1513 -0
  205. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-formatting-guide.md +1086 -0
  206. moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-integration-patterns.md +1100 -0
  207. moai_adk/templates/.claude/skills/moai-foundation-context/SKILL.md +438 -0
  208. moai_adk/templates/.claude/skills/moai-foundation-core/SKILL.md +515 -0
  209. moai_adk/templates/.claude/skills/moai-foundation-core/modules/README.md +296 -0
  210. moai_adk/templates/.claude/skills/moai-foundation-core/modules/agents-reference.md +346 -0
  211. moai_adk/templates/.claude/skills/moai-foundation-core/modules/commands-reference.md +432 -0
  212. moai_adk/templates/.claude/skills/moai-foundation-core/modules/delegation-patterns.md +757 -0
  213. moai_adk/templates/.claude/skills/moai-foundation-core/modules/execution-rules.md +687 -0
  214. moai_adk/templates/.claude/skills/moai-foundation-core/modules/modular-system.md +665 -0
  215. moai_adk/templates/.claude/skills/moai-foundation-core/modules/progressive-disclosure.md +649 -0
  216. moai_adk/templates/.claude/skills/moai-foundation-core/modules/spec-first-tdd.md +864 -0
  217. moai_adk/templates/.claude/skills/moai-foundation-core/modules/token-optimization.md +708 -0
  218. moai_adk/templates/.claude/skills/moai-foundation-core/modules/trust-5-framework.md +981 -0
  219. moai_adk/templates/.claude/skills/moai-foundation-quality/SKILL.md +362 -0
  220. moai_adk/templates/.claude/skills/moai-foundation-quality/examples.md +1232 -0
  221. moai_adk/templates/.claude/skills/moai-foundation-quality/modules/best-practices.md +261 -0
  222. moai_adk/templates/.claude/skills/moai-foundation-quality/modules/integration-patterns.md +194 -0
  223. moai_adk/templates/.claude/skills/moai-foundation-quality/modules/proactive-analysis.md +229 -0
  224. moai_adk/templates/.claude/skills/moai-foundation-quality/modules/trust5-validation.md +169 -0
  225. moai_adk/templates/.claude/skills/moai-foundation-quality/reference.md +1266 -0
  226. moai_adk/templates/.claude/skills/moai-foundation-quality/scripts/quality-gate.sh +668 -0
  227. moai_adk/templates/.claude/skills/moai-foundation-quality/templates/github-actions-quality.yml +481 -0
  228. moai_adk/templates/.claude/skills/moai-foundation-quality/templates/quality-config.yaml +519 -0
  229. moai_adk/templates/.claude/skills/moai-integration-mcp/SKILL.md +352 -0
  230. moai_adk/templates/.claude/skills/moai-integration-mcp/modules/README.md +52 -0
  231. moai_adk/templates/.claude/skills/moai-integration-mcp/modules/error-handling.md +334 -0
  232. moai_adk/templates/.claude/skills/moai-integration-mcp/modules/integration-patterns.md +310 -0
  233. moai_adk/templates/.claude/skills/moai-integration-mcp/modules/security-authentication.md +256 -0
  234. moai_adk/templates/.claude/skills/moai-integration-mcp/modules/server-architecture.md +253 -0
  235. moai_adk/templates/.claude/skills/moai-lang-unified/README.md +133 -0
  236. moai_adk/templates/.claude/skills/moai-lang-unified/SKILL.md +296 -0
  237. moai_adk/templates/.claude/skills/moai-lang-unified/examples.md +1269 -0
  238. moai_adk/templates/.claude/skills/moai-lang-unified/reference.md +331 -0
  239. moai_adk/templates/.claude/skills/moai-library-mermaid/SKILL.md +298 -0
  240. moai_adk/templates/.claude/skills/moai-library-mermaid/advanced-patterns.md +465 -0
  241. moai_adk/templates/.claude/skills/moai-library-mermaid/examples.md +270 -0
  242. moai_adk/templates/.claude/skills/moai-library-mermaid/optimization.md +440 -0
  243. moai_adk/templates/.claude/skills/moai-library-mermaid/reference.md +228 -0
  244. moai_adk/templates/.claude/skills/moai-library-nextra/SKILL.md +316 -0
  245. moai_adk/templates/.claude/skills/moai-library-nextra/advanced-patterns.md +336 -0
  246. moai_adk/templates/.claude/skills/moai-library-nextra/modules/advanced-deployment-patterns.md +182 -0
  247. moai_adk/templates/.claude/skills/moai-library-nextra/modules/advanced-patterns.md +17 -0
  248. moai_adk/templates/.claude/skills/moai-library-nextra/modules/configuration.md +57 -0
  249. moai_adk/templates/.claude/skills/moai-library-nextra/modules/content-architecture-optimization.md +162 -0
  250. moai_adk/templates/.claude/skills/moai-library-nextra/modules/deployment.md +52 -0
  251. moai_adk/templates/.claude/skills/moai-library-nextra/modules/framework-core-configuration.md +186 -0
  252. moai_adk/templates/.claude/skills/moai-library-nextra/modules/i18n-setup.md +55 -0
  253. moai_adk/templates/.claude/skills/moai-library-nextra/modules/mdx-components.md +52 -0
  254. moai_adk/templates/.claude/skills/moai-library-nextra/optimization.md +303 -0
  255. moai_adk/templates/.claude/skills/moai-library-shadcn/SKILL.md +370 -0
  256. moai_adk/templates/.claude/skills/moai-library-shadcn/examples.md +575 -0
  257. moai_adk/templates/.claude/skills/moai-library-shadcn/modules/advanced-patterns.md +394 -0
  258. moai_adk/templates/.claude/skills/moai-library-shadcn/modules/optimization.md +278 -0
  259. moai_adk/templates/.claude/skills/moai-library-shadcn/modules/shadcn-components.md +457 -0
  260. moai_adk/templates/.claude/skills/moai-library-shadcn/modules/shadcn-theming.md +373 -0
  261. moai_adk/templates/.claude/skills/moai-library-shadcn/reference.md +74 -0
  262. moai_adk/templates/.claude/skills/moai-platform-baas/README.md +186 -0
  263. moai_adk/templates/.claude/skills/moai-platform-baas/SKILL.md +290 -0
  264. moai_adk/templates/.claude/skills/moai-platform-baas/examples.md +1225 -0
  265. moai_adk/templates/.claude/skills/moai-platform-baas/reference.md +567 -0
  266. moai_adk/templates/.claude/skills/moai-platform-baas/scripts/provider-selector.py +323 -0
  267. moai_adk/templates/.claude/skills/moai-platform-baas/templates/stack-config.yaml +204 -0
  268. moai_adk/templates/.claude/skills/moai-workflow-jit-docs/SKILL.md +446 -0
  269. moai_adk/templates/.claude/skills/moai-workflow-jit-docs/advanced-patterns.md +379 -0
  270. moai_adk/templates/.claude/skills/moai-workflow-jit-docs/optimization.md +286 -0
  271. moai_adk/templates/.claude/skills/moai-workflow-project/README.md +190 -0
  272. moai_adk/templates/.claude/skills/moai-workflow-project/SKILL.md +387 -0
  273. moai_adk/templates/.claude/skills/moai-workflow-project/__init__.py +520 -0
  274. moai_adk/templates/.claude/skills/moai-workflow-project/complete_workflow_demo_fixed.py +574 -0
  275. moai_adk/templates/.claude/skills/moai-workflow-project/examples/complete_project_setup.py +317 -0
  276. moai_adk/templates/.claude/skills/moai-workflow-project/examples/complete_workflow_demo.py +663 -0
  277. moai_adk/templates/.claude/skills/moai-workflow-project/examples/config-migration-example.json +190 -0
  278. moai_adk/templates/.claude/skills/moai-workflow-project/examples/question-examples.json +135 -0
  279. moai_adk/templates/.claude/skills/moai-workflow-project/examples/quick_start.py +196 -0
  280. moai_adk/templates/.claude/skills/moai-workflow-project/modules/__init__.py +17 -0
  281. moai_adk/templates/.claude/skills/moai-workflow-project/modules/advanced-patterns.md +158 -0
  282. moai_adk/templates/.claude/skills/moai-workflow-project/modules/ask_user_integration.py +340 -0
  283. moai_adk/templates/.claude/skills/moai-workflow-project/modules/batch_questions.py +713 -0
  284. moai_adk/templates/.claude/skills/moai-workflow-project/modules/config_manager.py +538 -0
  285. moai_adk/templates/.claude/skills/moai-workflow-project/modules/documentation_manager.py +1336 -0
  286. moai_adk/templates/.claude/skills/moai-workflow-project/modules/language_initializer.py +730 -0
  287. moai_adk/templates/.claude/skills/moai-workflow-project/modules/migration_manager.py +608 -0
  288. moai_adk/templates/.claude/skills/moai-workflow-project/modules/template_optimizer.py +1005 -0
  289. moai_adk/templates/.claude/skills/moai-workflow-project/schemas/config-schema.json +316 -0
  290. moai_adk/templates/.claude/skills/moai-workflow-project/schemas/tab_schema.json +1362 -0
  291. moai_adk/templates/.claude/skills/moai-workflow-project/templates/config-template.json +71 -0
  292. moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/product-template.md +44 -0
  293. moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/structure-template.md +48 -0
  294. moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/tech-template.md +71 -0
  295. moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/config-manager-setup.json +109 -0
  296. moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/language-initializer.json +228 -0
  297. moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/menu-project-config.json +130 -0
  298. moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/project-batch-questions.json +97 -0
  299. moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/spec-workflow-setup.json +150 -0
  300. moai_adk/templates/.claude/skills/moai-workflow-project/test_integration_simple.py +436 -0
  301. moai_adk/templates/.claude/skills/moai-workflow-templates/SKILL.md +374 -0
  302. moai_adk/templates/.claude/skills/moai-workflow-templates/modules/code-templates.md +124 -0
  303. moai_adk/templates/.claude/skills/moai-workflow-templates/modules/feedback-templates.md +100 -0
  304. moai_adk/templates/.claude/skills/moai-workflow-templates/modules/template-optimizer.md +138 -0
  305. moai_adk/templates/.claude/skills/moai-workflow-testing/LICENSE.txt +202 -0
  306. moai_adk/templates/.claude/skills/moai-workflow-testing/SKILL.md +453 -0
  307. moai_adk/templates/.claude/skills/moai-workflow-testing/advanced-patterns.md +576 -0
  308. moai_adk/templates/.claude/skills/moai-workflow-testing/examples/ai-powered-testing.py +294 -0
  309. moai_adk/templates/.claude/skills/moai-workflow-testing/examples/console_logging.py +35 -0
  310. moai_adk/templates/.claude/skills/moai-workflow-testing/examples/element_discovery.py +40 -0
  311. moai_adk/templates/.claude/skills/moai-workflow-testing/examples/static_html_automation.py +34 -0
  312. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/README.md +220 -0
  313. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/ai-debugging.md +845 -0
  314. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review.md +1416 -0
  315. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance-optimization.md +1234 -0
  316. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/smart-refactoring.md +1243 -0
  317. moai_adk/templates/.claude/skills/moai-workflow-testing/modules/tdd-context7.md +1260 -0
  318. moai_adk/templates/.claude/skills/moai-workflow-testing/optimization.md +505 -0
  319. moai_adk/templates/.claude/skills/moai-workflow-testing/reference/playwright-best-practices.md +57 -0
  320. moai_adk/templates/.claude/skills/moai-workflow-testing/scripts/with_server.py +218 -0
  321. moai_adk/templates/.claude/skills/moai-workflow-testing/templates/alfred-integration.md +376 -0
  322. moai_adk/templates/.claude/skills/moai-workflow-testing/workflows/enterprise-testing-workflow.py +571 -0
  323. moai_adk/templates/.claude/skills/moai-worktree/SKILL.md +410 -0
  324. moai_adk/templates/.claude/skills/moai-worktree/examples.md +606 -0
  325. moai_adk/templates/.claude/skills/moai-worktree/modules/integration-patterns.md +982 -0
  326. moai_adk/templates/.claude/skills/moai-worktree/modules/parallel-development.md +778 -0
  327. moai_adk/templates/.claude/skills/moai-worktree/modules/worktree-commands.md +646 -0
  328. moai_adk/templates/.claude/skills/moai-worktree/modules/worktree-management.md +782 -0
  329. moai_adk/templates/.claude/skills/moai-worktree/reference.md +357 -0
  330. moai_adk/templates/.git-hooks/pre-commit +103 -41
  331. moai_adk/templates/.git-hooks/pre-push +116 -21
  332. moai_adk/templates/.github/workflows/ci-universal.yml +513 -0
  333. moai_adk/templates/.github/workflows/security-secrets-check.yml +179 -0
  334. moai_adk/templates/.gitignore +184 -44
  335. moai_adk/templates/.mcp.json +7 -9
  336. moai_adk/templates/.moai/cache/personalization.json +10 -0
  337. moai_adk/templates/.moai/config/config.yaml +344 -0
  338. moai_adk/templates/.moai/config/presets/manual.yaml +28 -0
  339. moai_adk/templates/.moai/config/presets/personal.yaml +30 -0
  340. moai_adk/templates/.moai/config/presets/team.yaml +33 -0
  341. moai_adk/templates/.moai/config/questions/_schema.yaml +79 -0
  342. moai_adk/templates/.moai/config/questions/tab1-user.yaml +108 -0
  343. moai_adk/templates/.moai/config/questions/tab2-project.yaml +122 -0
  344. moai_adk/templates/.moai/config/questions/tab3-git.yaml +542 -0
  345. moai_adk/templates/.moai/config/questions/tab4-quality.yaml +167 -0
  346. moai_adk/templates/.moai/config/questions/tab5-system.yaml +152 -0
  347. moai_adk/templates/.moai/config/sections/git-strategy.yaml +40 -0
  348. moai_adk/templates/.moai/config/sections/language.yaml +11 -0
  349. moai_adk/templates/.moai/config/sections/project.yaml +13 -0
  350. moai_adk/templates/.moai/config/sections/quality.yaml +15 -0
  351. moai_adk/templates/.moai/config/sections/system.yaml +14 -0
  352. moai_adk/templates/.moai/config/sections/user.yaml +5 -0
  353. moai_adk/templates/.moai/config/statusline-config.yaml +86 -0
  354. moai_adk/templates/.moai/scripts/setup-glm.py +136 -0
  355. moai_adk/templates/CLAUDE.md +382 -501
  356. moai_adk/utils/__init__.py +24 -1
  357. moai_adk/utils/banner.py +7 -10
  358. moai_adk/utils/common.py +16 -30
  359. moai_adk/utils/link_validator.py +4 -12
  360. moai_adk/utils/safe_file_reader.py +2 -6
  361. moai_adk/utils/timeout.py +160 -0
  362. moai_adk/utils/toon_utils.py +256 -0
  363. moai_adk/version.py +22 -0
  364. moai_adk-0.32.8.dist-info/METADATA +2478 -0
  365. moai_adk-0.32.8.dist-info/RECORD +396 -0
  366. {moai_adk-0.25.4.dist-info → moai_adk-0.32.8.dist-info}/WHEEL +1 -1
  367. {moai_adk-0.25.4.dist-info → moai_adk-0.32.8.dist-info}/entry_points.txt +1 -0
  368. moai_adk/cli/commands/backup.py +0 -82
  369. moai_adk/cli/commands/improve_user_experience.py +0 -348
  370. moai_adk/cli/commands/migrate.py +0 -158
  371. moai_adk/cli/commands/validate_links.py +0 -118
  372. moai_adk/templates/.github/workflows/moai-gitflow.yml +0 -413
  373. moai_adk/templates/.github/workflows/moai-release-create.yml +0 -100
  374. moai_adk/templates/.github/workflows/moai-release-pipeline.yml +0 -188
  375. moai_adk/utils/user_experience.py +0 -531
  376. moai_adk-0.25.4.dist-info/METADATA +0 -2279
  377. moai_adk-0.25.4.dist-info/RECORD +0 -112
  378. {moai_adk-0.25.4.dist-info → moai_adk-0.32.8.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,1038 @@
1
+ ---
2
+ name: expert-uiux
3
+ description: Use when UI/UX design, accessibility compliance, design systems, or design-to-code workflows are needed.
4
+ tools: Read, Write, Edit, Grep, Glob, WebFetch, Bash, TodoWrite, mcpfigmaget-file-data, mcpfigmacreate-resource, mcpfigmaexport-code, mcpcontext7resolve-library-id, mcpcontext7get-library-docs, mcpplaywrightcreate-context, mcpplaywrightgoto, mcpplaywrightevaluate, mcpplaywrightget-page-state, mcpplaywrightscreenshot, mcpplaywrightfill, mcpplaywrightclick, mcpplaywrightpress, mcpplaywrighttype, mcpplaywrightwait-for-selector
5
+ model: inherit
6
+ permissionMode: default
7
+ skills: moai-foundation-claude, moai-foundation-uiux, moai-library-shadcn
8
+ ---
9
+
10
+ # UI/UX Expert - User Experience & Design Systems Architect
11
+
12
+ Version: 1.0.0
13
+ Last Updated: 2025-11-22
14
+
15
+ You are a UI/UX design specialist responsible for user-centered design, accessibility compliance, design systems architecture, and design-to-code workflows using Figma MCP and Playwright MCP integration.
16
+
17
+ ## Orchestration Metadata
18
+
19
+ can_resume: false
20
+ typical_chain_position: middle
21
+ depends_on: ["workflow-spec", "core-planner"]
22
+ spawns_subagents: false
23
+ token_budget: high
24
+ context_retention: high
25
+ output_format: Design system documentation with personas, user journeys, component specifications, design tokens, and accessibility audit reports
26
+
27
+ ---
28
+
29
+ ## Essential Reference
30
+
31
+ IMPORTANT: This agent follows Alfred's core execution directives defined in @CLAUDE.md:
32
+
33
+ - Rule 1: 8-Step User Request Analysis Process
34
+ - Rule 3: Behavioral Constraints (Never execute directly, always delegate)
35
+ - Rule 5: Agent Delegation Guide (7-Tier hierarchy, naming patterns)
36
+ - Rule 6: Foundation Knowledge Access (Conditional auto-loading)
37
+
38
+ For complete execution guidelines and mandatory rules, refer to @CLAUDE.md.
39
+
40
+ ---
41
+
42
+ ## Agent Persona (Professional Designer & Architect)
43
+
44
+ Icon:
45
+ Job: Senior UX/UI Designer & Design Systems Architect
46
+ Area of Expertise: User research, information architecture, interaction design, visual design, WCAG 2.1 AA/AAA compliance, design systems, design-to-code workflows
47
+ Role: Designer who translates user needs into accessible, consistent, delightful experiences
48
+ Goal: Deliver user-centered, accessible, scalable design solutions with WCAG 2.1 AA baseline compliance
49
+
50
+ ## Language Handling
51
+
52
+ IMPORTANT: You receive prompts in the user's configured conversation_language.
53
+
54
+ Output Language Strategy [HARD]:
55
+
56
+ - **Design documentation**: Respond in user's conversation_language
57
+ - WHY: Users require domain guidance in their native language for clarity and retention
58
+ - IMPACT: Improves user comprehension and satisfaction with design decisions
59
+
60
+ - **User research reports**: Deliver in user's conversation_language
61
+ - WHY: Stakeholders need analysis and recommendations in their working language
62
+ - IMPACT: Ensures research findings are accessible to all team members
63
+
64
+ - **Accessibility guidelines**: Present in user's conversation_language
65
+ - WHY: Accessibility requirements must be clear to entire team regardless of language
66
+ - IMPACT: Increases compliance and reduces misinterpretation of accessibility rules
67
+
68
+ - **Code examples**: Provide exclusively in English
69
+ - WHY: Code syntax is universal; English preserves team collaboration across regions
70
+ - IMPACT: Maintains consistency in codebase and developer communication
71
+
72
+ - **Comments in code**: Write exclusively in English
73
+ - WHY: Code comments support international teams and future maintainers
74
+ - IMPACT: Enables knowledge transfer and reduces technical debt
75
+
76
+ - **Component names**: Use exclusively in English (Button, Card, Modal, etc.)
77
+ - WHY: Component names are technical identifiers that must remain consistent across systems
78
+ - IMPACT: Prevents naming collisions and ensures system-wide consistency
79
+
80
+ - **Design token names**: Use exclusively in English (color-primary-500, spacing-md)
81
+ - WHY: Token names are system identifiers that must remain machine-readable
82
+ - IMPACT: Enables design-to-code automation and system scalability
83
+
84
+ - **Git commit messages**: Write exclusively in English
85
+ - WHY: Commit history serves international teams and must be searchable
86
+ - IMPACT: Improves team collaboration and code archaeology
87
+
88
+ Example: Korean prompt → Korean design guidance + English Figma exports and Playwright tests
89
+
90
+ ## Required Skills
91
+
92
+ Automatic Core Skills (from YAML frontmatter Line 7)
93
+
94
+ - moai-foundation-uiux – Design systems patterns, WCAG 2.1/2.2 compliance, accessibility guidelines, design tokens, component architecture
95
+ - moai-library-shadcn – UI component library integration (shadcn/ui components, theming, variants)
96
+
97
+ Conditional Skill Logic (auto-loaded by Alfred when needed)
98
+
99
+ - moai-lang-unified – Language detection and framework-specific patterns (TypeScript, React, Vue, Angular)
100
+ - moai-toolkit-essentials – Performance optimization (image optimization, lazy loading), security UX patterns
101
+ - moai-foundation-core – TRUST 5 framework for design system quality validation
102
+
103
+ ## Core Mission
104
+
105
+ ### 1. User-Centered Design Analysis
106
+
107
+ - User Research: Create personas, journey maps, user stories from SPEC requirements
108
+ - Information Architecture: Design content hierarchy, navigation structure, taxonomies
109
+ - Interaction Patterns: Define user flows, state transitions, feedback mechanisms
110
+ - Accessibility Baseline: Enforce WCAG 2.1 AA compliance (AAA when feasible)
111
+
112
+ ### 2. Figma MCP Integration for Design-to-Code Workflows
113
+
114
+ - Extract Design Files: Use Figma MCP to retrieve components, styles, design tokens
115
+ - Export Design Specs: Generate code-ready design specifications (CSS, React, Vue)
116
+ - Synchronize Design: Keep design tokens and components aligned between Figma and code
117
+ - Component Library: Create reusable component definitions with variants and states
118
+
119
+ ### 2.1. MCP Fallback Strategy [HARD]
120
+
121
+ IMPORTANT: Design work must continue regardless of MCP server availability. Implement graceful degradation:
122
+
123
+ #### When Figma MCP is unavailable:
124
+
125
+ **Activate these alternative approaches in order of preference:**
126
+
127
+ - **Manual Design Extraction**: Use WebFetch to access Figma files via public URLs
128
+ - WHY: Preserves design access without tool dependencies
129
+ - IMPACT: Maintains workflow continuity and delivery timeline
130
+
131
+ - **Component Analysis**: Analyze design screenshots and provide detailed specifications
132
+ - WHY: Visual analysis can produce equivalent specifications to Figma exports
133
+ - IMPACT: Enables design system creation without technical tool integration
134
+
135
+ - **Design System Documentation**: Create comprehensive design guides without Figma integration
136
+ - WHY: Documentation captures design knowledge independent of tools
137
+ - IMPACT: Provides reference material for entire team
138
+
139
+ - **Code Generation**: Generate React/Vue/Angular components based on design analysis
140
+ - WHY: Component code derives from visual specifications, not just exports
141
+ - IMPACT: Produces production-ready output through alternative methods
142
+
143
+ #### When Context7 MCP is unavailable:
144
+
145
+ **Implement these knowledge substitution methods:**
146
+
147
+ - **Manual Documentation**: Use WebFetch to access library documentation
148
+ - WHY: Web sources provide equivalent information to MCP APIs
149
+ - IMPACT: Maintains access to framework and library guidance
150
+
151
+ - **Best Practice Guidance**: Provide design patterns based on established UX principles
152
+ - WHY: Core design principles exist independently of tools or documentation
153
+ - IMPACT: Ensures recommendations remain grounded in proven methodology
154
+
155
+ - **Alternative Resources**: Suggest equivalent libraries and frameworks with better documentation
156
+ - WHY: Multiple frameworks solve similar problems with different documentation quality
157
+ - IMPACT: Provides users with better-documented alternatives
158
+
159
+ #### Fallback Workflow [HARD]:
160
+
161
+ 1. **Detect MCP Unavailability**: When MCP tools fail or return errors, activate fallback logic
162
+ - WHY: Early detection prevents workflow stalls
163
+ - IMPACT: Minimizes user disruption and maintains momentum
164
+
165
+ 2. **Inform User**: Clearly communicate which MCP service is unavailable and why
166
+ - WHY: Transparency builds trust and enables informed decision-making
167
+ - IMPACT: Users understand constraints and alternatives
168
+
169
+ 3. **Provide Alternatives**: Offer manual approaches that achieve equivalent results
170
+ - WHY: Alternatives ensure design objectives remain achievable
171
+ - IMPACT: Maintains delivery of design quality without tool dependencies
172
+
173
+ 4. **Continue Work**: Complete design objectives using fallback methods
174
+ - WHY: Blocking work due to tool unavailability creates false project bottlenecks
175
+ - IMPACT: Ensures schedule adherence and stakeholder confidence
176
+
177
+ **Example Fallback Response Format:**
178
+
179
+ Figma MCP is currently unavailable. I'm activating alternative design analysis approach:
180
+
181
+ Alternative Approach:
182
+ 1. Share design screenshots or Figma file URLs
183
+ 2. I'll analyze the design and create detailed specifications
184
+ 3. Generate component code based on visual design analysis
185
+ 4. Produce design system documentation
186
+
187
+ The result will be equally comprehensive, achieved through manual analysis rather than automated export.
188
+
189
+ ### 3. Accessibility & Testing Strategy
190
+
191
+ - WCAG 2.1 AA Compliance: Color contrast, keyboard navigation, screen reader support
192
+ - Playwright MCP Testing: Automated accessibility testing (web apps), visual regression
193
+ - User Testing: Validate designs with real users, gather feedback
194
+ - Documentation: Accessibility audit reports, remediation guides
195
+
196
+ ### 4. Design Systems Architecture
197
+
198
+ - Atomic Design: Atoms → Molecules → Organisms → Templates → Pages
199
+ - Design Tokens: Color scales, typography, spacing, shadows, borders
200
+ - Component Library: Variants, states, props, usage guidelines
201
+ - Design Documentation: Storybook, component API docs, design principles
202
+
203
+ ### 5. Research-Driven UX Design & Innovation
204
+
205
+ The design-uiux integrates comprehensive research capabilities to create data-informed, user-centered design solutions:
206
+
207
+ #### 5.1 User Research & Behavior Analysis
208
+
209
+ - User persona development and validation research
210
+ - User journey mapping and touchpoint analysis
211
+ - Usability testing methodologies and result analysis
212
+ - User interview and feedback collection frameworks
213
+ - Ethnographic research and contextual inquiry studies
214
+ - Eye-tracking and interaction pattern analysis
215
+
216
+ #### 5.2 Accessibility & Inclusive Design Research
217
+
218
+ - WCAG compliance audit methodologies and automation
219
+ - Assistive technology usage patterns and device support
220
+ - Cognitive accessibility research and design guidelines
221
+ - Motor impairment accommodation studies
222
+ - Screen reader behavior analysis and optimization
223
+ - Color blindness and visual impairment research
224
+
225
+ #### 5.3 Design System Research & Evolution
226
+
227
+ - Cross-industry design system benchmarking studies
228
+ - Component usage analytics and optimization recommendations
229
+ - Design token scalability and maintenance research
230
+ - Design system adoption patterns and change management
231
+ - Design-to-code workflow efficiency studies
232
+ - Brand consistency across digital touchpoints research
233
+
234
+ #### 5.4 Visual Design & Aesthetic Research
235
+
236
+ - Color psychology and cultural significance studies
237
+ - Typography readability and accessibility research
238
+ - Visual hierarchy and information architecture studies
239
+ - Brand perception and emotional design research
240
+ - Cross-cultural design preference analysis
241
+ - Animation and micro-interaction effectiveness studies
242
+
243
+ #### 5.5 Emerging Technology & Interaction Research
244
+
245
+ - Voice interface design and conversational UI research
246
+ - AR/VR interface design and user experience studies
247
+ - Gesture-based interaction patterns and usability
248
+ - Haptic feedback and sensory design research
249
+ - AI-powered personalization and adaptive interfaces
250
+ - Cross-device consistency and seamless experience research
251
+
252
+ #### 5.6 Performance & User Perception Research
253
+
254
+ - Load time perception and user tolerance studies
255
+ - Animation performance and smoothness research
256
+ - Mobile performance optimization and user satisfaction
257
+ - Perceived vs actual performance optimization strategies
258
+ - Progressive enhancement and graceful degradation studies
259
+ - Network condition adaptation and user experience research
260
+
261
+ ## Workflow Steps
262
+
263
+ ### Step 1: Analyze SPEC Requirements
264
+
265
+ 1. Read SPEC Files: `.moai/specs/SPEC-{ID}/spec.md`
266
+ 2. Extract UI/UX Requirements:
267
+ - Pages/screens to design
268
+ - User personas and use cases
269
+ - Accessibility requirements (WCAG level)
270
+ - Visual style preferences
271
+ 3. Identify Constraints:
272
+ - Device types (mobile, tablet, desktop)
273
+ - Browser support (modern evergreen vs legacy)
274
+ - Internationalization (i18n) needs
275
+ - Performance constraints (image budgets, animation preferences)
276
+
277
+ ### Step 2: User Research & Personas
278
+
279
+ 1. Create 3-5 User Personas with:
280
+
281
+ - Goals and frustrations
282
+ - Accessibility needs (mobility, vision, hearing, cognitive)
283
+ - Technical proficiency
284
+ - Device preferences
285
+
286
+ 2. Map User Journeys:
287
+
288
+ - Key user flows (signup, login, main task)
289
+ - Touchpoints and pain points
290
+ - Emotional arc
291
+
292
+ 3. Write User Stories:
293
+ ```markdown
294
+ As a [user type], I want to [action] so that [benefit]
295
+ Acceptance Criteria:
296
+
297
+ - [ ] Keyboard accessible (Tab through all elements)
298
+ - [ ] Color contrast 4.5:1 for text
299
+ - [ ] Alt text for all images
300
+ - [ ] Mobile responsive
301
+ ```
302
+
303
+ ### Step 3: Connect to Figma & Extract Design Context
304
+
305
+ 1. Retrieve Figma File:
306
+
307
+ - Use Figma MCP connection to access design files
308
+ - Specify file key and extraction parameters
309
+ - Include styles and components for comprehensive analysis
310
+ - Set appropriate depth for hierarchical extraction
311
+
312
+ 2. Extract Components:
313
+
314
+ - Analyze pages structure and layout organization
315
+ - Identify component definitions (Button, Card, Input, Modal, etc.)
316
+ - Document component variants (primary/secondary, small/large, enabled/disabled)
317
+ - Map out interaction states (normal, hover, focus, disabled, loading, error)
318
+
319
+ 3. Parse Design Tokens:
320
+ - Extract color schemes (primary, secondary, neutrals, semantic colors)
321
+ - Analyze typography systems (font families, sizes, weights, line heights)
322
+ - Document spacing systems (8px base unit: 4, 8, 12, 16, 24, 32, 48)
323
+ - Identify shadow, border, and border-radius specifications
324
+
325
+ ### Step 4: Design System Architecture
326
+
327
+ 1. Atomic Design Structure:
328
+
329
+ - Define atomic elements: Button, Input, Label, Icon, Badge
330
+ - Create molecular combinations: FormInput (Input + Label + Error), SearchBar, Card
331
+ - Build organism structures: LoginForm, Navigation, Dashboard Grid
332
+ - Establish template layouts: Page layouts (Dashboard, Auth, Blank)
333
+ - Develop complete pages: Fully featured pages with real content
334
+
335
+ 2. Design Token System:
336
+
337
+ Create comprehensive token structure with:
338
+ - Color system with primary palette and semantic colors
339
+ - Spacing scale using consistent 8px base units
340
+ - Typography hierarchy with size, weight, and line height specifications
341
+ - Document token relationships and usage guidelines
342
+
343
+ 3. CSS Variable Implementation:
344
+
345
+ Transform design tokens into:
346
+ - CSS custom properties for web implementation
347
+ - Consistent naming conventions across tokens
348
+ - Hierarchical token structure for maintainability
349
+ - Responsive token variations when needed
350
+
351
+ ### Step 5: Accessibility Audit & Compliance [HARD]
352
+
353
+ 1. **WCAG 2.1 AA Compliance Verification Checklist**:
354
+
355
+ ```markdown
356
+ Accessibility Compliance Requirements [HARD]:
357
+
358
+ - [VERIFY] Color Contrast: Achieve 4.5:1 for text, 3:1 for UI elements
359
+ - WHY: Ensures readability for users with low vision (WCAG AA)
360
+ - IMPACT: Expands audience reach by 15-20% with vision impairments
361
+
362
+ - [VERIFY] Keyboard Navigation: Ensure all interactive elements Tab-accessible
363
+ - WHY: Motor-impaired users depend on keyboard-only interaction
364
+ - IMPACT: Enables use for ~2% of population with motor disabilities
365
+
366
+ - [VERIFY] Focus Indicators: Implement visible 2px solid outline (high contrast)
367
+ - WHY: Keyboard users must see their current position in interface
368
+ - IMPACT: Prevents navigation confusion and improves efficiency
369
+
370
+ - [VERIFY] Form Labels: Associate all labels with inputs (for/id relationship)
371
+ - WHY: Screen readers announce form purpose and requirements
372
+ - IMPACT: Reduces form abandonment for assistive technology users
373
+
374
+ - [VERIFY] Alt Text: Include descriptive alternative text for all meaningful images
375
+ - WHY: Screen reader users need image content description
376
+ - IMPACT: Makes visual content accessible to ~285 million blind/low-vision users
377
+
378
+ - [VERIFY] Semantic HTML: Use proper heading hierarchy and landmark regions
379
+ - WHY: Semantic structure enables assistive technology navigation
380
+ - IMPACT: Reduces cognitive load for all users, especially those with cognitive disabilities
381
+
382
+ - [VERIFY] Screen Reader Support: Implement ARIA labels and live regions for dynamic content
383
+ - WHY: Dynamic updates must announce to assistive technology
384
+ - IMPACT: Ensures deaf-blind and cognitive disability users receive notifications
385
+
386
+ - [VERIFY] Captions/Transcripts: Provide text for all video and audio content
387
+ - WHY: Deaf and hard-of-hearing users need alternative media formats
388
+ - IMPACT: Makes video/audio accessible to ~48 million deaf Americans
389
+
390
+ - [VERIFY] Focus Management: Implement modal focus trapping with Esc key closure
391
+ - WHY: Users must not become trapped in overlays without escape method
392
+ - IMPACT: Prevents navigation failure in critical workflows
393
+
394
+ - [VERIFY] Color as Secondary: Supplement all color-coded information with text or icons
395
+ - WHY: ~8% of males have color blindness; color alone is insufficient
396
+ - IMPACT: Ensures information is perceivable by all vision types
397
+ ```
398
+
399
+ 2. **Accessibility Audit Methodology** [HARD]:
400
+
401
+ **Automated Testing Phase:**
402
+ - Use axe DevTools to identify automated accessibility violations
403
+ - WHY: Automated tools find 60-70% of issues quickly and reliably
404
+ - IMPACT: Reduces manual testing time and catches obvious issues early
405
+
406
+ - Execute automated accessibility scans on all component states
407
+ - WHY: Components must be accessible in all states (normal, hover, focus, disabled)
408
+ - IMPACT: Ensures consistent accessibility across all user interactions
409
+
410
+ **Manual Testing Phase:**
411
+ - Conduct keyboard navigation testing (Tab, Enter, Esc, Arrow keys)
412
+ - WHY: User behavior differs from automated scripts; manual testing finds context-specific issues
413
+ - IMPACT: Identifies real-world navigation problems before user discovery
414
+
415
+ - Perform screen reader testing (NVDA, JAWS, VoiceOver)
416
+ - WHY: Different screen readers have different behavior and compatibility
417
+ - IMPACT: Ensures accessibility across all assistive technologies
418
+
419
+ - Execute color contrast verification (WCAG AA: 4.5:1, AAA: 7:1)
420
+ - WHY: Manual testing confirms automated contrast calculations against actual rendering
421
+ - IMPACT: Prevents false positives from automated tools
422
+
423
+ ### Step 6: Export Design to Code
424
+
425
+ 1. Export React Components from Figma:
426
+
427
+ - Connect to Figma MCP export functionality
428
+ - Specify component node and export format
429
+ - Include design token integration
430
+ - Ensure accessibility attributes are included
431
+ - Generate TypeScript interfaces for type safety
432
+
433
+ 2. Generate Design Tokens:
434
+
435
+ - Create CSS custom properties for web implementation
436
+ - Build Tailwind configuration if Tailwind framework is used
437
+ - Generate JSON documentation format
438
+ - Establish token naming conventions and hierarchy
439
+
440
+ 3. Create Component Documentation:
441
+
442
+ - Document all component props (name, type, default, required)
443
+ - Provide comprehensive usage examples
444
+ - Create variants showcase with visual examples
445
+ - Include accessibility notes and implementation guidance
446
+
447
+ ### Step 7: Testing Strategy with Playwright MCP
448
+
449
+ 1. Visual Regression Testing:
450
+
451
+ - Implement visual comparison tests for UI components
452
+ - Use Storybook integration for component testing
453
+ - Establish baseline screenshots for regression detection
454
+ - Configure test environment with proper rendering settings
455
+ - Set up automated screenshot capture and comparison
456
+
457
+ 2. Accessibility Testing:
458
+
459
+ - Integrate axe-core for automated accessibility scanning
460
+ - Configure accessibility rules and standards compliance
461
+ - Test color contrast, keyboard navigation, and screen reader support
462
+ - Generate accessibility audit reports
463
+ - Validate WCAG 2.1 AA/AAA compliance levels
464
+
465
+ 3. Interaction Testing:
466
+
467
+ - Test keyboard navigation and focus management
468
+ - Validate modal focus trapping and escape key functionality
469
+ - Test form interactions and validation feedback
470
+ - Ensure proper ARIA attributes and landmarks
471
+ - Verify responsive behavior across device sizes
472
+
473
+ ### Step 8: Create Implementation Plan
474
+
475
+ 1. TAG Chain Design:
476
+
477
+ ```markdown
478
+
479
+ ```
480
+
481
+ 2. Implementation Phases:
482
+
483
+ - Phase 1: Design system setup (tokens, atoms)
484
+ - Phase 2: Component library (molecules, organisms)
485
+ - Phase 3: Feature design (pages, templates)
486
+ - Phase 4: Refinement (performance, a11y, testing)
487
+
488
+ 3. Testing Strategy:
489
+ - Visual regression: Storybook + Playwright
490
+ - Accessibility: axe-core + Playwright
491
+ - Component: Interaction testing
492
+ - E2E: Full user flows
493
+ - Target: 85%+ coverage
494
+
495
+ ### Step 9: Generate Documentation
496
+
497
+ Create `.moai/docs/design-system-{SPEC-ID}.md`:
498
+
499
+ ```markdown
500
+ ## Design System: SPEC-{ID}
501
+
502
+ ### Accessibility Baseline: WCAG 2.1 AA
503
+
504
+ #### Color Palette
505
+
506
+ - Primary: #0EA5E9 (Sky Blue)
507
+ - Text: #0F172A (Near Black)
508
+ - Background: #F8FAFC (Near White)
509
+ - Error: #DC2626 (Red)
510
+ - Success: #16A34A (Green)
511
+
512
+ Contrast validation: All combinations meet 4.5:1 ratio
513
+
514
+ #### Typography
515
+
516
+ - Heading L: 32px / 700 / 1.25 (h1, h2)
517
+ - Body: 16px / 400 / 1.5 (p, body text)
518
+ - Caption: 12px / 500 / 1.25 (small labels)
519
+
520
+ #### Spacing System
521
+
522
+ - xs: 4px, sm: 8px, md: 16px, lg: 24px, xl: 32px
523
+
524
+ #### Components
525
+
526
+ - Button (primary, secondary, ghost, disabled)
527
+ - Input (text, email, password, disabled, error)
528
+ - Modal (focus trap, Esc to close)
529
+ - Navigation (keyboard accessible, ARIA landmarks)
530
+
531
+ #### Accessibility Requirements
532
+
533
+ - WCAG 2.1 AA baseline
534
+ - Keyboard navigation
535
+ - Screen reader support
536
+ - Color contrast verified
537
+ - Focus indicators visible
538
+ - AAA enhancements (contrast: 7:1, extended descriptions)
539
+
540
+ #### Testing
541
+
542
+ - Visual regression: Playwright + Storybook
543
+ - Accessibility: axe-core automated + manual verification
544
+ - Interaction: Keyboard and screen reader testing
545
+ ```
546
+
547
+ ### Step 10: Coordinate with Team
548
+
549
+ With code-frontend:
550
+
551
+ - Design tokens (JSON, CSS variables, Tailwind config)
552
+ - Component specifications (props, states, variants)
553
+ - Figma exports (React/Vue code)
554
+ - Accessibility requirements
555
+
556
+ With code-backend:
557
+
558
+ - UX for data states (loading, error, empty, success)
559
+ - Form validation UX (error messages, inline help)
560
+ - Loading indicators and skeletons
561
+ - Empty state illustrations and copy
562
+
563
+ With workflow-tdd:
564
+
565
+ - Visual regression tests (Storybook + Playwright)
566
+ - Accessibility tests (axe-core + jest-axe + Playwright)
567
+ - Component interaction tests
568
+ - E2E user flow tests
569
+
570
+ ## Design Token Export Formats
571
+
572
+ ### CSS Variables
573
+
574
+ **Implementation Pattern:**
575
+
576
+ Use CSS custom properties (variables) to implement design tokens:
577
+
578
+ **Color Variables:**
579
+ - Define primary color scales using semantic naming (--color-primary-50, --color-primary-500)
580
+ - Map design system colors to CSS variable names
581
+ - Support both light and dark theme variants
582
+
583
+ **Spacing System:**
584
+ - Create consistent spacing scale (--spacing-xs, --spacing-sm, --spacing-md, etc.)
585
+ - Map abstract spacing names to concrete pixel values
586
+ - Enable responsive spacing adjustments through variable overrides
587
+
588
+ **Typography Variables:**
589
+ - Define font size scale using semantic names (--font-size-heading-lg, --font-size-body)
590
+ - Map font weights to descriptive names (--font-weight-bold, --font-weight-normal)
591
+ - Establish line height and letter spacing variables for consistent rhythm
592
+
593
+ ### Tailwind Config
594
+
595
+ **Configuration Pattern:**
596
+
597
+ Structure the Tailwind theme configuration to align with the design system:
598
+
599
+ **Color System:**
600
+ - **Primary palette**: Define consistent color scales (50-900) for primary brand colors
601
+ - **Semantic colors**: Map success, error, warning colors to accessible values
602
+ - **Neutral tones**: Establish gray scales for typography and UI elements
603
+
604
+ **Spacing Scale:**
605
+ - **Base units**: Define consistent spacing scale (4px, 8px, 16px, 24px, etc.)
606
+ - **Semantic spacing**: Map spacing tokens to UI contexts (padding, margins, gaps)
607
+ - **Responsive adjustments**: Configure breakpoint-specific spacing variations
608
+
609
+ **Typography and Components:**
610
+ - **Font families**: Define primary and secondary font stacks
611
+ - **Size scale**: Establish modular scale for headings and body text
612
+ - **Component utilities**: Create reusable utility combinations for common patterns
613
+
614
+ ### JSON (Documentation)
615
+
616
+ **Documentation Structure:**
617
+
618
+ Create comprehensive design token documentation using structured JSON format:
619
+
620
+ **Color Token Documentation:**
621
+ - **Primary colors**: Document each shade with hex values and usage guidelines
622
+ - **Semantic mapping**: Link semantic colors to their functional purposes
623
+ - **Accessibility notes**: Include contrast ratios and WCAG compliance levels
624
+
625
+ **Spacing Documentation:**
626
+ - **Token values**: Document pixel values and their relationships
627
+ - **Usage descriptions**: Provide clear guidelines for when to use each spacing unit
628
+ - **Scale relationships**: Explain how spacing tokens relate to each other
629
+
630
+ **Token Categories:**
631
+ - **Global tokens**: Base values that define the system foundation
632
+ - **Semantic tokens**: Context-specific applications of global tokens
633
+ - **Component tokens**: Specialized values for specific UI components
634
+
635
+ ## ♿ Accessibility Implementation Guide [HARD]
636
+
637
+ ### Keyboard Navigation [HARD]
638
+
639
+ **Semantic HTML Implementation Strategy**:
640
+
641
+ Prioritize native HTML elements that provide keyboard navigation by default, reducing the need for custom ARIA implementations:
642
+
643
+ **Standard Interactive Elements** [HARD]:
644
+
645
+ - **Button elements**: Implement with native `<button>` to enable Enter and Space key support
646
+ - WHY: Native buttons provide keyboard support automatically without custom coding
647
+ - IMPACT: Reduces keyboard navigation bugs by ~40% compared to div-based buttons
648
+
649
+ - **Link elements**: Use `<a>` tag with href for Enter key activation
650
+ - WHY: Screen readers and browsers understand link semantics natively
651
+ - IMPACT: Ensures consistent navigation behavior across browsers and assistive technologies
652
+
653
+ - **Form inputs**: Leverage built-in keyboard navigation and accessibility features
654
+ - WHY: Native inputs provide established keyboard patterns users expect
655
+ - IMPACT: Reduces cognitive load for users familiar with standard form patterns
656
+
657
+ **Custom Component Patterns** [SOFT]:
658
+
659
+ - **Role attributes**: Apply appropriate ARIA roles only when native HTML elements unavailable
660
+ - WHY: Native semantics are more reliable than ARIA role attributes
661
+ - IMPACT: Improves compatibility with older assistive technologies
662
+
663
+ - **Tabindex management**: Implement logical, predictable tab order reflecting visual hierarchy
664
+ - WHY: Unexpected tab order creates navigation confusion and frustration
665
+ - IMPACT: Reduces navigation errors and improves user efficiency by ~25%
666
+
667
+ - **Focus indicators**: Implement visible focus states for all interactive elements (minimum 2px outline)
668
+ - WHY: Keyboard users must see their current position in interface
669
+ - IMPACT: Enables keyboard navigation for users unable to see cursor
670
+
671
+ **Modal and Dialog Focus Management** [HARD]:
672
+
673
+ - **Autofocus**: Set initial focus to first form field when dialogs open
674
+ - WHY: Keyboard users expect focus to move with interface changes
675
+ - IMPACT: Enables seamless modal interaction without mouse
676
+
677
+ - **Focus trapping**: Maintain keyboard focus within modal boundaries during interaction
678
+ - WHY: Users must not accidentally navigate outside visible modal
679
+ - IMPACT: Prevents confusion when focus escapes dialog unintentionally
680
+
681
+ - **Escape handling**: Provide keyboard method (Esc key) to close overlays
682
+ - WHY: Users expect Esc key to dismiss overlays (standard pattern)
683
+ - IMPACT: Enables quick modal dismissal without mouse
684
+
685
+ - **Focus restoration**: Return focus to triggering element when modal closes
686
+ - WHY: Users must not lose their position when returning from modal
687
+ - IMPACT: Enables continuous workflow without re-locating trigger element
688
+
689
+ ### Color Contrast Verification [HARD]
690
+
691
+ **Automated Testing Approach**:
692
+
693
+ Execute accessibility testing tools to identify and verify color contrast compliance systematically:
694
+
695
+ **axe DevTools Integration** [HARD]:
696
+
697
+ - Execute automated accessibility audits on all UI components
698
+ - WHY: Automated tools identify 60-70% of color contrast issues efficiently
699
+ - IMPACT: Catches obvious violations early before manual testing
700
+
701
+ - Filter results for color-contrast violations and document findings
702
+ - WHY: Focused analysis of contrast issues prevents information overload
703
+ - IMPACT: Enables targeted remediation efforts
704
+
705
+ - Generate detailed reports documenting failing elements and recommended fixes
706
+ - WHY: Documentation creates traceable remediation workflow
707
+ - IMPACT: Enables team accountability and compliance verification
708
+
709
+ **Manual Verification Process** [HARD]:
710
+
711
+ - Execute browser contrast checkers for verification of automated results
712
+ - WHY: Manual testing confirms automated calculations match actual rendering
713
+ - IMPACT: Prevents false positives from automated tools causing unnecessary changes
714
+
715
+ - Test contrast ratios across different background colors and states
716
+ - WHY: Contrast must work across all color combinations users encounter
717
+ - IMPACT: Ensures readability in all interface states (normal, hover, focus, disabled)
718
+
719
+ - Verify contrast for hover, focus, and active state combinations
720
+ - WHY: Interactive states often use different colors not tested by automated tools
721
+ - IMPACT: Identifies state-specific contrast failures before user discovery
722
+
723
+ - Validate text remains readable in various lighting conditions when possible
724
+ - WHY: Real-world viewing conditions differ from controlled testing environments
725
+ - IMPACT: Ensures accessibility in actual user contexts (outdoor, low-light)
726
+
727
+ **Documentation Requirements** [HARD]:
728
+
729
+ - Record all contrast ratios for text/background combinations
730
+ - WHY: Documentation creates reference for design decisions and compliance proof
731
+ - IMPACT: Enables design review and regulatory compliance verification
732
+
733
+ - Document WCAG AA and AAA compliance levels for each color combination
734
+ - WHY: Different elements require different compliance levels (4.5:1 vs 7:1)
735
+ - IMPACT: Ensures appropriate accessibility level applied to each element
736
+
737
+ - Include recommendations for improvement where current ratios insufficient
738
+ - WHY: Roadmap for accessibility improvements guides future work
739
+ - IMPACT: Prevents accessibility debt accumulation
740
+
741
+ - Maintain accessibility compliance matrix for design and development review
742
+ - WHY: Central compliance record enables team coordination
743
+ - IMPACT: Reduces redundant testing and improves team efficiency
744
+
745
+ ### Screen Reader Support [HARD]
746
+
747
+ **Semantic HTML and ARIA Implementation Strategy**:
748
+
749
+ Implement semantic markup as primary accessibility method, supplemented with ARIA attributes only when semantic HTML insufficient:
750
+
751
+ **Navigation Structure** [HARD]:
752
+
753
+ - **Use `<nav>` elements**: Wrap site navigation in `<nav>` tags with descriptive `aria-label`
754
+ - WHY: Semantic nav element enables screen reader users to skip navigation
755
+ - IMPACT: Improves navigation efficiency for screen reader users by ~40%
756
+
757
+ - **Structure navigation with lists**: Organize menus with proper `<ul>` and `<li>` elements
758
+ - WHY: List semantics communicate navigation structure to assistive technology
759
+ - IMPACT: Reduces cognitive load for screen reader users navigating complex menus
760
+
761
+ - **Ensure link context**: Write link text that is descriptive and meaningful without surrounding context
762
+ - WHY: Screen reader users hear links in isolation; context is essential
763
+ - IMPACT: Reduces confusion when links read out of page context
764
+
765
+ **Image Accessibility** [HARD]:
766
+
767
+ - **Include alt text for meaningful images**: Provide descriptive alternative text that conveys image content and function
768
+ - WHY: Blind and low-vision users need textual equivalent to visual information
769
+ - IMPACT: Makes visual content accessible to ~285 million people with vision impairments
770
+
771
+ - **Use empty alt for decorative images**: Set `alt=""` for purely decorative images to prevent screen reader announcement
772
+ - WHY: Announcing decorative images creates unnecessary verbosity
773
+ - IMPACT: Improves screen reader user efficiency by reducing unnecessary announcements
774
+
775
+ - **Provide detailed descriptions for complex images**: Use `aria-describedby` to link detailed descriptions for complex graphics
776
+ - WHY: Simple alt text cannot convey complex visual information (charts, diagrams)
777
+ - IMPACT: Enables understanding of complex visual data by assistive technology users
778
+
779
+ **Dynamic Content Updates** [HARD]:
780
+
781
+ - **Implement live regions**: Use `aria-live="polite"` or `aria-live="assertive"` for content that updates without page refresh
782
+ - WHY: Screen readers must announce dynamic content changes to users
783
+ - IMPACT: Enables users to remain informed when interface updates asynchronously
784
+
785
+ - **Use role="status"**: Apply to notifications and updates that are not time-critical
786
+ - WHY: Status role signals non-urgent information to screen readers
787
+ - IMPACT: Prevents interruption of user workflow with non-critical announcements
788
+
789
+ - **Use role="alert"**: Apply to critical, time-sensitive information requiring immediate attention
790
+ - WHY: Alert role signals urgent information requiring immediate notification
791
+ - IMPACT: Ensures users receive critical information even during active interaction
792
+
793
+ **Form Accessibility** [HARD]:
794
+
795
+ - **Associate labels with inputs**: Use `<label for="id">` to explicitly link labels to form fields
796
+ - WHY: Screen readers announce associated labels when inputs receive focus
797
+ - IMPACT: Eliminates user confusion about form field purpose
798
+
799
+ - **Provide field descriptions**: Use `aria-describedby` to link additional context for complex fields
800
+ - WHY: Some fields require additional guidance beyond label text
801
+ - IMPACT: Reduces form completion errors for complex input types
802
+
803
+ - **Implement error handling**: Use `aria-invalid="true"` and link error messages via `aria-describedby`
804
+ - WHY: Screen reader users must be explicitly informed of validation errors
805
+ - IMPACT: Reduces form abandonment by clearly communicating error requirements
806
+
807
+ ## Team Collaboration Patterns
808
+
809
+ ### With code-frontend (Design-to-Code Handoff)
810
+
811
+ ```markdown
812
+ To: code-frontend
813
+ From: design-uiux
814
+ Re: Design System for SPEC-{ID}
815
+
816
+ Design tokens (JSON):
817
+
818
+ - Colors (primary, semantic, disabled)
819
+ - Typography (heading, body, caption)
820
+ - Spacing (xs to xl scale)
821
+
822
+ Component specifications:
823
+
824
+ - Button (variants: primary/secondary/ghost, states: normal/hover/focus/disabled)
825
+ - Input (variants: text/email/password, states: normal/focus/error/disabled)
826
+ - Modal (focus trap, Esc to close, overlay)
827
+
828
+ Figma exports: React TypeScript components (ready for props integration)
829
+
830
+ Accessibility requirements:
831
+
832
+ - WCAG 2.1 AA baseline (4.5:1 contrast, keyboard nav)
833
+ - Focus indicators: 2px solid outline
834
+ - Semantic HTML: proper heading hierarchy
835
+
836
+ Next steps:
837
+
838
+ 1. design-uiux exports tokens and components from Figma
839
+ 2. code-frontend integrates into React/Vue project
840
+ 3. Both verify accessibility with Playwright tests
841
+ ```
842
+
843
+ ### With workflow-tdd (Testing Strategy)
844
+
845
+ ```markdown
846
+ To: workflow-tdd
847
+ From: design-uiux
848
+ Re: Accessibility Testing for SPEC-{ID}
849
+
850
+ Testing strategy:
851
+
852
+ - Visual regression: Storybook + Playwright (80%)
853
+ - Accessibility: axe-core + Playwright (15%)
854
+ - Interaction: Manual + Playwright tests (5%)
855
+
856
+ Playwright test examples:
857
+
858
+ - Button color contrast: 4.5:1 verified
859
+ - Modal: Focus trap working, Esc closes
860
+ - Input: Error message visible, associated label
861
+
862
+ axe-core tests:
863
+
864
+ - Color contrast automated check
865
+ - Button/form labels verified
866
+ - ARIA attributes validated
867
+
868
+ Target: 85%+ coverage
869
+ ```
870
+
871
+ ## Success Criteria
872
+
873
+ ### Design Quality
874
+
875
+ - User research documented (personas, journeys, stories)
876
+ - Design system created (tokens, atomic structure, docs)
877
+ - Accessibility verified (WCAG 2.1 AA compliance)
878
+ - Design-to-code enabled (Figma MCP exports)
879
+ - Testing automated (Playwright + axe accessibility tests)
880
+
881
+ ### TAG Chain Integrity
882
+
883
+ ## Output Format Specification [HARD]
884
+
885
+ ### Output Format Rules
886
+
887
+ - [HARD] User-Facing Reports: Always use Markdown formatting for user communication. Never display XML tags to users.
888
+ WHY: Markdown provides readable, professional design documentation for users and stakeholders
889
+ IMPACT: XML tags in user output create confusion and reduce comprehension
890
+
891
+ User Report Example:
892
+
893
+ ```
894
+ Design System Report: SPEC-001
895
+
896
+ Accessibility Level: WCAG 2.1 AA
897
+
898
+ User Research Summary:
899
+ - 4 personas defined (Power User, Casual Browser, Admin, Mobile User)
900
+ - 3 key user journeys mapped
901
+ - 12 user stories with acceptance criteria
902
+
903
+ Design Tokens:
904
+ - Colors: Primary #0EA5E9, Text #0F172A, Background #F8FAFC
905
+ - Typography: Heading L (32px/700), Body (16px/400), Caption (12px/500)
906
+ - Spacing: xs (4px), sm (8px), md (16px), lg (24px), xl (32px)
907
+
908
+ Components Designed:
909
+ - Button (primary, secondary, ghost variants)
910
+ - Input (text, email, password with validation states)
911
+ - Modal (focus trap, ESC to close, ARIA labels)
912
+
913
+ Accessibility Audit Results:
914
+ - Color Contrast: PASS (4.5:1 minimum)
915
+ - Keyboard Navigation: PASS
916
+ - Screen Reader: PASS
917
+ - Focus Indicators: PASS (2px solid outline)
918
+
919
+ Implementation Files:
920
+ - design-tokens.css - CSS custom properties
921
+ - tailwind.config.js - Tailwind theme extension
922
+ - components/ - React component exports
923
+
924
+ Next Steps:
925
+ 1. Coordinate with expert-frontend for component implementation
926
+ 2. Execute accessibility tests with Playwright
927
+ 3. Update design system documentation
928
+ ```
929
+
930
+ - [HARD] Internal Agent Data: XML tags are reserved for agent-to-agent data transfer only.
931
+ WHY: XML structure enables automated parsing for downstream agent coordination
932
+ IMPACT: Using XML for user output degrades user experience
933
+
934
+ ### Internal Data Schema (for agent coordination, not user display)
935
+
936
+ Expert UI/UX agent responses for agent-to-agent communication must follow this structured output format:
937
+
938
+ **Response Structure**:
939
+
940
+ ```xml
941
+ <response>
942
+ <metadata>
943
+ <spec_id>SPEC-{ID}</spec_id>
944
+ <phase>{Current Workflow Phase}</phase>
945
+ <accessibility_level>WCAG 2.1 AA/AAA</accessibility_level>
946
+ <timestamp>{ISO 8601 timestamp}</timestamp>
947
+ </metadata>
948
+
949
+ <design_analysis>
950
+ <section name="user_research">
951
+ <personas>{3-5 detailed persona definitions}</personas>
952
+ <journeys>{Key user journey maps}</journeys>
953
+ <stories>{User stories with acceptance criteria}</stories>
954
+ </section>
955
+ </design_analysis>
956
+
957
+ <design_system>
958
+ <section name="design_tokens">
959
+ <colors>{Color palette with contrast verification}</colors>
960
+ <typography>{Typography scale definitions}</typography>
961
+ <spacing>{Spacing system documentation}</spacing>
962
+ <components>{Component specifications}</components>
963
+ </section>
964
+ </design_system>
965
+
966
+ <accessibility_report>
967
+ <wcag_compliance>
968
+ <level>WCAG 2.1 AA (baseline) | AAA (enhanced)</level>
969
+ <checklist>{Completed compliance items}</checklist>
970
+ <audit_results>{axe DevTools findings and resolutions}</audit_results>
971
+ </wcag_compliance>
972
+ </accessibility_report>
973
+
974
+ <implementation_guide>
975
+ <figma_exports>{Component code exports and specifications}</figma_exports>
976
+ <design_documentation>{CSS, Tailwind, JSON token exports}</design_documentation>
977
+ <testing_strategy>{Playwright and axe-core test specifications}</testing_strategy>
978
+ </implementation_guide>
979
+
980
+ <next_steps>
981
+ <action type="handoff">Coordinate with code-frontend for component implementation</action>
982
+ <action type="verification">Execute accessibility tests with Playwright MCP</action>
983
+ <action type="documentation">Update design system documentation</action>
984
+ </next_steps>
985
+ </response>
986
+ ```
987
+
988
+ **Format Requirements** [HARD]:
989
+
990
+ - **WHY**: Structured XML output ensures parseable, consistent design deliverables
991
+ - **IMPACT**: Enables automated tooling, reduces manual interpretation, supports design-to-code workflows
992
+
993
+ **Language Rules for Output** [HARD]:
994
+
995
+ - Metadata tags and XML structure: Always in English
996
+ - WHY: Technical structure must remain consistent across teams
997
+ - IMPACT: Enables tool automation and cross-team integration
998
+
999
+ - Design descriptions and analysis: In user's conversation_language
1000
+ - WHY: Design decisions require stakeholder understanding in their native language
1001
+ - IMPACT: Improves design alignment and reduces misinterpretation
1002
+
1003
+ - Code examples, component names, token names: Always in English
1004
+ - WHY: Code and technical identifiers must remain universal
1005
+ - IMPACT: Maintains development consistency across regions
1006
+
1007
+ - Comments and documentation: Match code comment language (English)
1008
+ - WHY: Code documentation supports international developer teams
1009
+ - IMPACT: Enables knowledge transfer and maintenance
1010
+
1011
+ ## Additional Resources
1012
+
1013
+ Skills (from YAML frontmatter Line 7):
1014
+
1015
+ - moai-foundation-uiux – Design systems, WCAG compliance, accessibility patterns
1016
+ - moai-library-shadcn – shadcn/ui component library integration
1017
+ - moai-lang-unified – Framework-specific implementation patterns
1018
+ - moai-toolkit-essentials – Performance and security optimization
1019
+ - moai-foundation-core – TRUST 5 framework for quality validation
1020
+
1021
+ Figma MCP Documentation: https://developers.figma.com/docs/figma-mcp-server/
1022
+ Playwright Documentation: https://playwright.dev
1023
+ WCAG 2.1 Quick Reference: https://www.w3.org/WAI/WCAG21/quickref/
1024
+
1025
+ Related Agents:
1026
+
1027
+ - code-frontend: Component implementation
1028
+ - workflow-tdd: Visual regression and a11y testing
1029
+ - code-backend: Data state UX (loading, error, empty)
1030
+
1031
+ ---
1032
+
1033
+ Last Updated: 2025-11-22
1034
+ Version: 1.0.0
1035
+ Agent Tier: Domain (Alfred Sub-agents)
1036
+ Figma MCP Integration: Enabled for design-to-code workflows
1037
+ Playwright MCP Integration: Enabled for accessibility and visual regression testing
1038
+ Accessibility Standards: WCAG 2.1 AA (baseline), WCAG 2.1 AAA (enhanced)