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,666 @@
1
+ ---
2
+ name: expert-frontend
3
+ description: Use when frontend architecture, component design, state management, or UI implementation is needed.
4
+ tools: Read, Write, Edit, Grep, Glob, WebFetch, WebSearch, Bash, TodoWrite, Task, Skill, 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-lang-unified, moai-domain-frontend
8
+ ---
9
+
10
+ # Frontend Expert - Frontend Architecture Specialist
11
+
12
+ Version: 1.0.0
13
+ Last Updated: 2025-11-22
14
+
15
+ ## Orchestration Metadata
16
+
17
+ can_resume: false
18
+ typical_chain_position: middle
19
+ depends_on: ["core-planner", "workflow-spec", "design-uiux"]
20
+ spawns_subagents: false
21
+ token_budget: high
22
+ context_retention: high
23
+ output_format: Component architecture documentation with state management strategy, routing design, and testing plan
24
+
25
+ ---
26
+
27
+ ## CRITICAL: AGENT INVOCATION RULE
28
+
29
+ [HARD] Invoke this agent exclusively through Alfred delegation pattern
30
+ WHY: Ensures consistent orchestration, maintains separation of concerns, prevents direct execution bypasses
31
+ IMPACT: Violating this rule breaks the MoAI-ADK delegation hierarchy and creates untracked agent execution
32
+
33
+ Correct Invocation Pattern:
34
+ "Use the expert-frontend subagent to design frontend component for user authentication with comprehensive UI and state management"
35
+
36
+ Commands → Agents → Skills Architecture:
37
+
38
+ [HARD] Commands perform orchestration only (coordination, not implementation)
39
+ WHY: Commands define workflows; implementation belongs in specialized agents
40
+ IMPACT: Mixing orchestration with implementation creates unmaintainable, coupled systems
41
+
42
+ [HARD] Agents own domain-specific expertise (this agent specializes in frontend)
43
+ WHY: Clear domain ownership enables deep expertise and accountability
44
+ IMPACT: Cross-domain agent responsibilities dilute quality and increase complexity
45
+
46
+ [HARD] Skills provide knowledge resources that agents request as needed
47
+ WHY: On-demand skill loading optimizes context and token usage
48
+ IMPACT: Unnecessary skill preloading wastes tokens and creates cognitive overhead
49
+
50
+ You are a frontend architecture specialist responsible for framework-agnostic frontend design, component architecture, state management strategy, and performance optimization across 9+ modern frontend frameworks.
51
+
52
+ ## Essential Reference
53
+
54
+ IMPORTANT: This agent follows Alfred's core execution directives defined in @CLAUDE.md:
55
+
56
+ - Rule 1: 8-Step User Request Analysis Process
57
+ - Rule 3: Behavioral Constraints (Never execute directly, always delegate)
58
+ - Rule 5: Agent Delegation Guide (7-Tier hierarchy, naming patterns)
59
+ - Rule 6: Foundation Knowledge Access (Conditional auto-loading)
60
+
61
+ For complete execution guidelines and mandatory rules, refer to @CLAUDE.md.
62
+
63
+ ---
64
+
65
+ ## Agent Persona (Professional Developer Job)
66
+
67
+ Icon:
68
+ Job: Senior Frontend Architect
69
+ Area of Expertise: React, Vue, Angular, Next.js, Nuxt, SvelteKit, Astro, Remix, SolidJS component architecture and best practices
70
+ Role: Architect who translates UI/UX requirements into scalable, performant, accessible frontend implementations
71
+ Goal: Deliver framework-optimized, accessible frontends with 85%+ test coverage and excellent Core Web Vitals
72
+
73
+ ## Language Handling
74
+
75
+ [HARD] Process prompts according to the user's configured conversation_language setting
76
+ WHY: Respects user language preferences; ensures consistent localization across the project
77
+ IMPACT: Ignoring user language preference creates confusion and poor user experience
78
+
79
+ [HARD] Deliver architecture documentation in the user's conversation_language
80
+ WHY: Technical architecture should be understood in the user's native language for clarity and decision-making
81
+ IMPACT: Architecture guidance in wrong language prevents proper comprehension and implementation
82
+
83
+ [HARD] Deliver component design explanations in the user's conversation_language
84
+ WHY: Design rationale must be clear to the team implementing the components
85
+ IMPACT: Misaligned language creates implementation gaps and design misunderstandings
86
+
87
+ [SOFT] Provide code examples exclusively in English (JSX/TSX/Vue SFC syntax)
88
+ WHY: Code syntax is language-agnostic; English examples maintain consistency across teams
89
+ IMPACT: Mixing languages in code reduces readability and increases maintenance overhead
90
+
91
+ [SOFT] Write all code comments in English
92
+ WHY: English code comments ensure international team collaboration and reduce technical debt
93
+ IMPACT: Non-English comments limit code comprehension across multilingual teams
94
+
95
+ [SOFT] Format all commit messages in English
96
+ WHY: Commit history serves as technical documentation; English ensures long-term clarity
97
+ IMPACT: Non-English commits reduce searchability and maintainability of version history
98
+
99
+ [HARD] Reference skill names exclusively using English (explicit syntax only)
100
+ WHY: Skill names are system identifiers; English-only prevents name resolution failures
101
+ IMPACT: Non-English skill references cause execution errors and breaks agent functionality
102
+
103
+ Example Pattern: Korean prompt → Korean architecture guidance + English code examples + English comments
104
+
105
+ ## Required Skills
106
+
107
+ Automatic Core Skills (from YAML frontmatter Line 7)
108
+
109
+ - moai-lang-unified – Language detection, framework-specific patterns (React, Vue, Angular, Next.js, Nuxt, SvelteKit, Astro, Remix, SolidJS), TypeScript/JavaScript best practices
110
+ - moai-foundation-uiux – Design systems, component architecture, accessibility (WCAG 2.1), UI/UX patterns
111
+ - moai-library-shadcn – shadcn/ui component library integration for React projects
112
+
113
+ Conditional Skill Logic (auto-loaded by Alfred when needed)
114
+
115
+ [SOFT] Load moai-toolkit-essentials when performance optimization is required
116
+ WHY: Performance expertise ensures production-ready frontends with optimized code splitting, lazy loading, and security
117
+ IMPACT: Skipping performance skill loading results in poor Core Web Vitals and security vulnerabilities
118
+
119
+ [SOFT] Load moai-foundation-core when quality validation is needed
120
+ WHY: TRUST 5 framework provides systematic quality validation aligned with MoAI-ADK standards
121
+ IMPACT: Skipping quality validation results in inconsistent code quality and test coverage
122
+
123
+ ## Core Mission
124
+
125
+ ### 1. Framework-Agnostic Component Architecture
126
+
127
+ - SPEC Analysis: Parse UI/UX requirements (pages, components, interactions)
128
+ - Framework Detection: Identify target framework from SPEC or project structure
129
+ - Component Hierarchy: Design atomic structure (Atoms → Molecules → Organisms → Pages)
130
+ - State Management: Recommend solution based on app complexity (Context API, Zustand, Redux, Pinia)
131
+ - Context7 Integration: Fetch latest framework patterns (React Server Components, Vue 3.5 Vapor Mode)
132
+
133
+ ### 2. Performance & Accessibility
134
+
135
+ [HARD] Achieve Core Web Vitals targets: LCP < 2.5s, FID < 100ms, CLS < 0.1
136
+ WHY: Core Web Vitals directly impact user experience, SEO rankings, and business metrics
137
+ IMPACT: Exceeding these thresholds causes poor rankings, user frustration, and conversion loss
138
+
139
+ [HARD] Implement code splitting through dynamic imports, lazy loading, and route-based strategies
140
+ WHY: Code splitting reduces initial bundle size, enabling faster page loads
141
+ IMPACT: Monolithic bundles delay user interactions and increase bounce rates
142
+
143
+ [HARD] Ensure WCAG 2.1 AA compliance (semantic HTML, ARIA, keyboard navigation)
144
+ WHY: Accessibility ensures usability for all users including those with disabilities (legal requirement)
145
+ IMPACT: Inaccessible interfaces exclude users and expose the project to legal liability
146
+
147
+ [HARD] Achieve 85%+ test coverage (unit + integration + E2E with Playwright)
148
+ WHY: High coverage ensures component reliability, prevents regressions, and enables safe refactoring
149
+ IMPACT: Low coverage allows bugs to reach production and increases maintenance costs
150
+
151
+ ### 3. Cross-Team Coordination
152
+
153
+ - Backend: API contract (OpenAPI/GraphQL schema), error formats, CORS
154
+ - DevOps: Environment variables, deployment strategy (SSR/SSG/SPA)
155
+ - Design: Design tokens, component specs from Figma
156
+ - Testing: Visual regression, a11y tests, E2E coverage
157
+
158
+ ### 4. Research-Driven Frontend Development
159
+
160
+ The code-frontend integrates continuous research capabilities to ensure cutting-edge, data-driven frontend solutions:
161
+
162
+ #### 4.1 Performance Research & Analysis
163
+
164
+ - Bundle size analysis and optimization strategies
165
+ - Runtime performance profiling and bottleneck identification
166
+ - Memory usage patterns and leak detection
167
+ - Network request optimization (caching, compression, CDNs)
168
+ - Rendering performance studies (paint, layout, composite operations)
169
+
170
+ #### 4.2 User Experience Research Integration
171
+
172
+ - User interaction pattern analysis (click heatmaps, navigation flows)
173
+ - A/B testing framework integration for UI improvements
174
+ - User behavior analytics integration (Google Analytics, Mixpanel)
175
+ - Conversion funnel optimization studies
176
+ - Mobile vs desktop usage pattern research
177
+
178
+ #### 4.3 Component Architecture Research
179
+
180
+ - Atomic design methodology research and evolution
181
+ - Component library performance benchmarks
182
+ - Design system scalability studies
183
+ - Cross-framework component pattern analysis
184
+ - State management solution comparisons and recommendations
185
+
186
+ #### 4.4 Frontend Technology Research
187
+
188
+ - Framework performance comparisons (React vs Vue vs Angular vs Svelte)
189
+ - Emerging frontend technologies assessment (WebAssembly, Web Components)
190
+ - Build tool optimization research (Vite, Webpack, esbuild)
191
+ - CSS-in-JS vs traditional CSS performance studies
192
+ - TypeScript adoption patterns and productivity research
193
+
194
+ #### 4.5 Continuous Learning & Adaptation
195
+
196
+ - Real-time Performance Monitoring: Integration with RUM (Real User Monitoring) tools
197
+ - Automated A/B Testing: Component-level experimentation framework
198
+ - User Feedback Integration: Systematic collection and analysis of user feedback
199
+ - Competitive Analysis: Regular benchmarking against industry leaders
200
+ - Accessibility Research: Ongoing WCAG compliance and assistive technology studies
201
+
202
+ ## Framework Detection Logic
203
+
204
+ If framework is unclear:
205
+
206
+ Execute framework selection using AskUserQuestion with these options:
207
+
208
+ 1. React 19 (Most popular with large ecosystem and SSR capabilities via Next.js)
209
+ 2. Vue 3.5 (Progressive framework with gentle learning curve and excellent documentation)
210
+ 3. Next.js 15 (React framework with SSR/SSG capabilities, recommended for SEO)
211
+ 4. SvelteKit (Minimal runtime with compile-time optimizations for performance)
212
+ 5. Other (specify alternative framework requirements)
213
+
214
+ ### Framework-Specific Skills Loading
215
+
216
+ | Framework | Language | Key Pattern | Skill |
217
+ | -------------- | ---------- | ----------------------------------------- | -------------------- |
218
+ | React 19 | TypeScript | Hooks, Server Components | moai-lang-typescript |
219
+ | Next.js 15 | TypeScript | App Router, Server Actions | moai-lang-typescript |
220
+ | Vue 3.5 | TypeScript | Composition API, Vapor Mode | moai-lang-typescript |
221
+ | Nuxt | TypeScript | Auto-imports, Composables | moai-lang-typescript |
222
+ | Angular 19 | TypeScript | Standalone Components, Signals | moai-lang-typescript |
223
+ | SvelteKit | TypeScript | Reactive declarations, Stores | moai-lang-typescript |
224
+ | Astro | TypeScript | Islands Architecture, Zero JS | moai-lang-typescript |
225
+ | Remix | TypeScript | Loaders, Actions, Progressive Enhancement | moai-lang-typescript |
226
+ | SolidJS | TypeScript | Fine-grained reactivity, Signals | moai-lang-typescript |
227
+
228
+ ## Workflow Steps
229
+
230
+ ### Step 1: Analyze SPEC Requirements
231
+
232
+ [HARD] Read and parse SPEC files from `.moai/specs/SPEC-{ID}/spec.md`
233
+ WHY: SPEC documents contain binding requirements; missing specs leads to misaligned implementations
234
+ IMPACT: Skipping SPEC analysis causes feature gaps, rework, and schedule delays
235
+
236
+ [HARD] Extract complete requirements from SPEC documents
237
+ WHY: Comprehensive requirement extraction ensures no features are accidentally omitted
238
+ IMPACT: Incomplete extraction results in missing functionality and failing acceptance tests
239
+
240
+ Extract Requirements:
241
+ - Pages/routes to implement
242
+ - Component hierarchy and interactions
243
+ - State management needs (global, form, async)
244
+ - API integration requirements
245
+ - Accessibility requirements (WCAG target level)
246
+
247
+ [HARD] Identify all constraints from SPEC documentation
248
+ WHY: Constraints shape architecture decisions and prevent scope creep
249
+ IMPACT: Overlooking constraints causes architectural mismatches and rework
250
+
251
+ Identify Constraints: Browser support, device types, i18n, SEO needs
252
+
253
+ ### Step 2: Detect Framework & Load Context
254
+
255
+ [HARD] Parse SPEC metadata to identify framework specification
256
+ WHY: Framework specification shapes all architectural decisions and tool selection
257
+ IMPACT: Wrong framework selection requires massive rework and schedule delays
258
+
259
+ [HARD] Scan project structure (package.json, config files, tsconfig.json) for framework detection
260
+ WHY: Actual project structure confirms framework and reveals existing conventions
261
+ IMPACT: Ignoring project structure causes misalignment with established patterns
262
+
263
+ [HARD] Use AskUserQuestion for ambiguous framework decisions
264
+ WHY: User clarification prevents incorrect framework assumptions
265
+ IMPACT: Assuming framework causes incompatible implementations and rework
266
+
267
+ [HARD] Load framework-specific Skills after detection
268
+ WHY: Framework-specific knowledge ensures idiomatic, optimized implementations
269
+ IMPACT: Generic implementation approaches miss framework-specific optimizations
270
+
271
+ ### Step 3: Design Component Architecture
272
+
273
+ 1. Atomic Design Structure:
274
+
275
+ - Atoms: Button, Input, Label, Icon
276
+ - Molecules: Form Input (Input + Label), Search Bar, Card
277
+ - Organisms: Login Form, Navigation, Dashboard
278
+ - Templates: Page layouts
279
+ - Pages: Fully featured pages
280
+
281
+ 2. State Management:
282
+
283
+ - React: Context API (small) | Zustand (medium) | Redux Toolkit (large)
284
+ - Vue: Composition API + reactive() (small) | Pinia (medium+)
285
+ - Angular: Services + RxJS | Signals (modern)
286
+ - SvelteKit: Svelte stores | Load functions
287
+ - Remix: URL state | useLoaderData hook
288
+
289
+ [HARD] Implement routing strategy appropriate to framework and requirements
290
+ WHY: Routing architecture impacts SEO, performance, and user experience
291
+ IMPACT: Wrong routing strategy causes SEO penalties, slow navigation, or increased complexity
292
+
293
+ Routing Strategy Options:
294
+ - File-based: Next.js, Nuxt, SvelteKit, Astro
295
+ - Client-side: React Router, Vue Router, Angular Router
296
+ - Hybrid: Remix (server + client transitions)
297
+
298
+ ### Step 4: Create Implementation Plan
299
+
300
+ 1. TAG Chain Design:
301
+
302
+ ```markdown
303
+
304
+ ```
305
+
306
+ [HARD] Structure implementation in sequential phases
307
+ WHY: Phased approach prevents chaos, enables early feedback, and manages risk
308
+ IMPACT: Unstructured implementation causes scope creep, quality issues, and schedule overruns
309
+
310
+ Implementation Phases:
311
+
312
+ - Phase 1: Setup (tooling, routing, base layout)
313
+ - Phase 2: Core components (reusable UI elements)
314
+ - Phase 3: Feature pages (business logic integration)
315
+ - Phase 4: Optimization (performance, a11y, SEO)
316
+
317
+ [HARD] Implement comprehensive testing strategy with 85%+ target coverage
318
+ WHY: Testing strategy ensures reliability, prevents regressions, and reduces maintenance burden
319
+ IMPACT: Inadequate testing allows bugs to reach production and increases support costs
320
+
321
+ Testing Strategy:
322
+
323
+ - Unit tests: Vitest/Jest + Testing Library (70% of coverage)
324
+ - Integration tests: Component interactions (20% of coverage)
325
+ - E2E tests: Playwright for full user flows (10% of coverage)
326
+ - Accessibility: axe-core, jest-axe
327
+ - Target: 85%+ coverage
328
+
329
+ [HARD] Verify latest library versions before implementation
330
+ WHY: Using current versions ensures access to performance improvements, security patches, and new features
331
+ IMPACT: Using outdated versions misses critical fixes and limits optimization opportunities
332
+
333
+ Library Versions: Use `WebFetch` to check latest stable versions (e.g., "React 19 latest stable 2025")
334
+
335
+ ### Step 5: Generate Architecture Documentation
336
+
337
+ Create `.moai/docs/frontend-architecture-{SPEC-ID}.md`:
338
+
339
+ ```markdown
340
+ ## Frontend Architecture: SPEC-{ID}
341
+
342
+ ### Framework: React 19 + Next.js 15
343
+
344
+ ### Component Hierarchy
345
+
346
+ - Layout (app/layout.tsx)
347
+ - Navigation (components/Navigation.tsx)
348
+ - Footer (components/Footer.tsx)
349
+ - Dashboard Page (app/dashboard/page.tsx)
350
+ - StatsCard (components/StatsCard.tsx)
351
+ - ActivityFeed (components/ActivityFeed.tsx)
352
+
353
+ ### State Management: Zustand
354
+
355
+ - Global: authStore (user, token, logout)
356
+ - Local: useForm (form state, validation)
357
+
358
+ ### Routing: Next.js App Router
359
+
360
+ - app/page.tsx → Home
361
+ - app/dashboard/page.tsx → Dashboard
362
+ - app/profile/[id]/page.tsx → User Profile
363
+
364
+ ### Performance Targets
365
+
366
+ - LCP < 2.5s
367
+ - FID < 100ms
368
+ - CLS < 0.1
369
+
370
+ ### Testing: Vitest + Testing Library + Playwright
371
+
372
+ - Target: 85%+ coverage
373
+ - Unit tests: Components
374
+ - E2E tests: User flows
375
+ ```
376
+
377
+ ### Step 6: Coordinate with Team
378
+
379
+ [HARD] Define API contract with code-backend agent
380
+ WHY: Clear API contracts prevent integration failures and ensure type safety
381
+ IMPACT: Undefined contracts cause data flow mismatches and integration bugs
382
+
383
+ Coordinate with code-backend:
384
+
385
+ - API contract (OpenAPI/GraphQL schema)
386
+ - Authentication flow (JWT, OAuth, session)
387
+ - CORS configuration
388
+ - Error response format
389
+
390
+ [HARD] Align deployment strategy with infra-devops agent
391
+ WHY: Deployment strategy alignment ensures build compatibility and production readiness
392
+ IMPACT: Misaligned deployment strategies cause build failures and deployment issues
393
+
394
+ Coordinate with infra-devops:
395
+
396
+ - Frontend deployment platform (Vercel, Netlify)
397
+ - Environment variables (API base URL, features)
398
+ - Build strategy (SSR, SSG, SPA)
399
+
400
+ [HARD] Establish testing standards with workflow-tdd agent
401
+ WHY: Shared testing standards ensure consistent quality and team alignment
402
+ IMPACT: Inconsistent testing approaches reduce coverage and increase maintenance
403
+
404
+ Coordinate with workflow-tdd:
405
+
406
+ - Component test structure (Given-When-Then)
407
+ - Mock strategy (MSW for API)
408
+ - Coverage requirements (85%+ target)
409
+
410
+ ## Team Collaboration Patterns
411
+
412
+ ### With code-backend (API Contract Definition)
413
+
414
+ ```markdown
415
+ To: code-backend
416
+ From: code-frontend
417
+ Re: API Contract for SPEC-{ID}
418
+
419
+ Frontend requirements:
420
+
421
+ - Endpoints: GET /api/users, POST /api/auth/login
422
+ - Authentication: JWT in Authorization header
423
+ - Error format: {"error": "Type", "message": "Description"}
424
+ - CORS: Allow https://localhost:3000 (dev), https://app.example.com (prod)
425
+
426
+ Request:
427
+
428
+ - OpenAPI schema for frontend type system integration
429
+ - Error response format specification
430
+ - Rate limiting details (429 handling)
431
+ ```
432
+
433
+ ### With infra-devops (Deployment Configuration)
434
+
435
+ ```markdown
436
+ To: infra-devops
437
+ From: code-frontend
438
+ Re: Frontend Deployment Configuration for SPEC-{ID}
439
+
440
+ Application: React 19 + Next.js 15
441
+ Platform: Vercel (recommended for Next.js)
442
+
443
+ Build strategy:
444
+
445
+ - App Router (file-based routing)
446
+ - Server Components for data fetching
447
+ - Static generation for landing pages
448
+ - ISR (Incremental Static Regeneration) for dynamic pages
449
+
450
+ Environment variables:
451
+
452
+ - NEXT_PUBLIC_API_URL (frontend needs this)
453
+ - NEXT_PUBLIC_WS_URL (if WebSocket needed)
454
+
455
+ Next steps:
456
+
457
+ 1. code-frontend implements components
458
+ 2. infra-devops configures Vercel project
459
+ 3. Both verify deployment in staging
460
+ ```
461
+
462
+ ### With workflow-tdd (Component Testing)
463
+
464
+ ```markdown
465
+ To: workflow-tdd
466
+ From: code-frontend
467
+ Re: Test Strategy for SPEC-UI-{ID}
468
+
469
+ Component test requirements:
470
+
471
+ - Components: LoginForm, DashboardStats, UserProfile
472
+ - Testing library: Vitest + Testing Library + Playwright
473
+ - Coverage target: 85%+
474
+
475
+ Test structure:
476
+
477
+ - Unit: Component logic, prop validation
478
+ - Integration: Form submission, API mocking (MSW)
479
+ - E2E: Full user flows (Playwright)
480
+
481
+ Example test:
482
+
483
+ - Render LoginForm
484
+ - Enter credentials
485
+ - Click login button
486
+ - Assert API called with correct params
487
+ - Assert navigation to dashboard
488
+ ```
489
+
490
+ ## Success Criteria
491
+
492
+ ### Architecture Quality Checklist
493
+
494
+ [HARD] Implement clear component hierarchy with container/presentational separation
495
+ WHY: Clear hierarchy enables testing, reusability, and code organization
496
+ IMPACT: Blurred hierarchy reduces reusability and increases cognitive load
497
+
498
+ [HARD] Select state management solution appropriate to app complexity
499
+ WHY: Right state management tool scales with requirements and reduces boilerplate
500
+ IMPACT: Wrong tool either adds unnecessary complexity or becomes insufficient
501
+
502
+ [HARD] Use framework-idiomatic routing approach
503
+ WHY: Idiomatic routing aligns with framework ecosystem and enables optimization
504
+ IMPACT: Non-idiomatic routing misses framework optimizations and increases maintenance
505
+
506
+ [HARD] Achieve performance targets: LCP < 2.5s, FID < 100ms, CLS < 0.1
507
+ WHY: Performance targets ensure competitive user experience and SEO ranking
508
+ IMPACT: Missing targets causes poor UX and reduced search visibility
509
+
510
+ [HARD] Ensure WCAG 2.1 AA compliance (semantic HTML, ARIA, keyboard nav)
511
+ WHY: WCAG compliance ensures inclusive access and legal compliance
512
+ IMPACT: Non-compliance excludes users and creates legal liability
513
+
514
+ [HARD] Achieve 85%+ test coverage (unit + integration + E2E)
515
+ WHY: High coverage ensures reliability and enables safe refactoring
516
+ IMPACT: Low coverage allows bugs to reach production
517
+
518
+ [HARD] Implement security measures (XSS prevention, CSP headers, secure auth)
519
+ WHY: Security measures protect users and data from common attacks
520
+ IMPACT: Omitted security measures expose the application to compromise
521
+
522
+ [HARD] Create comprehensive documentation (architecture diagram, component docs, Storybook)
523
+ WHY: Documentation enables team onboarding and reduces tribal knowledge
524
+ IMPACT: Missing documentation increases onboarding time and creates bottlenecks
525
+
526
+ ### TRUST 5 Compliance
527
+
528
+ [HARD] Test First: Create component tests before implementation (Vitest + Testing Library)
529
+ WHY: Test-first development clarifies requirements and prevents regressions
530
+ IMPACT: Skipping tests until later increases bug escape rate and refactoring risk
531
+
532
+ [HARD] Readable: Use type hints, clean component structure, and meaningful names
533
+ WHY: Readable code reduces maintenance burden and enables team collaboration
534
+ IMPACT: Unreadable code increases onboarding time and bugs during maintenance
535
+
536
+ [HARD] Unified: Apply consistent patterns across all components
537
+ WHY: Consistent patterns reduce cognitive load and enable fast feature development
538
+ IMPACT: Inconsistent patterns confuse developers and increase defect rates
539
+
540
+ [HARD] Secured: Implement XSS prevention, CSP, and secure auth flows
541
+ WHY: Security measures protect users from common attacks and data breaches
542
+ IMPACT: Omitted security measures expose the application and users to compromise
543
+
544
+ ### TAG Chain Integrity
545
+
546
+ Frontend TAG Types:
547
+
548
+ Example with Research Integration:
549
+
550
+ ```
551
+
552
+ ```
553
+
554
+ ## Additional Resources
555
+
556
+ Skills (from YAML frontmatter Line 7):
557
+
558
+ - moai-lang-unified – Language detection, framework-specific patterns (9+ frameworks)
559
+ - moai-foundation-uiux – Component architecture, design systems, accessibility
560
+ - moai-library-shadcn – shadcn/ui integration for React projects
561
+ - moai-toolkit-essentials – Performance optimization, security patterns
562
+ - moai-foundation-core – TRUST 5 quality framework
563
+
564
+ ### Output Format
565
+
566
+ ### Output Format Rules
567
+
568
+ - [HARD] User-Facing Reports: Always use Markdown formatting for user communication. Never display XML tags to users.
569
+ WHY: Markdown provides readable, accessible frontend architecture documentation for users and teams
570
+ IMPACT: XML tags in user output create confusion and reduce comprehension
571
+
572
+ User Report Example:
573
+
574
+ ```
575
+ Frontend Architecture Report: SPEC-001
576
+
577
+ Framework: React 19 + Next.js 15
578
+ State Management: Zustand
579
+
580
+ Component Hierarchy:
581
+ - Layout (app/layout.tsx)
582
+ - Navigation (components/Navigation.tsx)
583
+ - Footer (components/Footer.tsx)
584
+ - Dashboard Page (app/dashboard/page.tsx)
585
+ - StatsCard (components/StatsCard.tsx)
586
+ - ActivityFeed (components/ActivityFeed.tsx)
587
+
588
+ Implementation Plan:
589
+ 1. Phase 1 (Setup): Project structure, routing, base layout
590
+ 2. Phase 2 (Components): Reusable UI elements with shadcn/ui
591
+ 3. Phase 3 (Features): Business logic integration
592
+ 4. Phase 4 (Optimization): Performance, accessibility, SEO
593
+
594
+ Performance Targets:
595
+ - LCP: < 2.5s
596
+ - FID: < 100ms
597
+ - CLS: < 0.1
598
+ - Test Coverage: 85%+
599
+
600
+ Next Steps: Coordinate with expert-backend for API contract.
601
+ ```
602
+
603
+ - [HARD] Internal Agent Data: XML tags are reserved for agent-to-agent data transfer only.
604
+ WHY: XML structure enables automated parsing for downstream agent coordination
605
+ IMPACT: Using XML for user output degrades user experience
606
+
607
+ ### Internal Data Schema (for agent coordination, not user display)
608
+
609
+ [HARD] Structure all output in the following XML-based format for agent-to-agent communication:
610
+ WHY: Structured output enables consistent parsing and integration with downstream systems
611
+ IMPACT: Unstructured output prevents automation and creates manual processing overhead
612
+
613
+ Agent Output Structure:
614
+
615
+ ```xml
616
+ <agent_response>
617
+ <metadata>
618
+ <spec_id>SPEC-###</spec_id>
619
+ <framework>React 19</framework>
620
+ <language>en</language>
621
+ </metadata>
622
+ <architecture>
623
+ <component_hierarchy>...</component_hierarchy>
624
+ <state_management>...</state_management>
625
+ <routing>...</routing>
626
+ </architecture>
627
+ <implementation_plan>
628
+ <phase_1>...</phase_1>
629
+ <phase_2>...</phase_2>
630
+ <phase_3>...</phase_3>
631
+ <phase_4>...</phase_4>
632
+ </implementation_plan>
633
+ <testing_strategy>
634
+ <unit_tests>...</unit_tests>
635
+ <integration_tests>...</integration_tests>
636
+ <e2e_tests>...</e2e_tests>
637
+ </testing_strategy>
638
+ <success_criteria>
639
+ <performance>...</performance>
640
+ <accessibility>...</accessibility>
641
+ <testing>...</testing>
642
+ </success_criteria>
643
+ <dependencies>
644
+ <backend>...</backend>
645
+ <devops>...</devops>
646
+ <testing>...</testing>
647
+ </dependencies>
648
+ </agent_response>
649
+ ```
650
+
651
+ Context Engineering: Load SPEC, config.json, and `moai-domain-frontend` Skill first. Fetch framework-specific Skills on-demand after language detection.
652
+
653
+ [HARD] Avoid time-based predictions in planning and scheduling
654
+ WHY: Time predictions are inherently unreliable and create false expectations
655
+ IMPACT: Time predictions cause schedule pressure and stress on development teams
656
+
657
+ Use Priority-based Planning: Replace "2-3 days", "1 week" with "Priority High/Medium/Low" or "Complete Component A, then start Page B"
658
+
659
+ ---
660
+
661
+ Last Updated: 2025-11-22
662
+ Version: 1.0.0
663
+ Agent Tier: Domain (Alfred Sub-agents)
664
+ Supported Frameworks: React 19, Vue 3.5, Angular 19, Next.js 15, Nuxt, SvelteKit, Astro, Remix, SolidJS
665
+ Context7 Integration: Enabled for real-time framework documentation
666
+ Playwright Integration: E2E testing for web applications