moai-adk 0.15.0__py3-none-any.whl → 0.25.4__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 (417) hide show
  1. moai_adk/__init__.py +1 -2
  2. moai_adk/__main__.py +85 -2
  3. moai_adk/cli/__init__.py +0 -1
  4. moai_adk/cli/commands/__init__.py +0 -1
  5. moai_adk/cli/commands/analyze.py +127 -0
  6. moai_adk/cli/commands/backup.py +5 -3
  7. moai_adk/cli/commands/doctor.py +35 -11
  8. moai_adk/cli/commands/improve_user_experience.py +348 -0
  9. moai_adk/cli/commands/init.py +150 -23
  10. moai_adk/cli/commands/language.py +269 -0
  11. moai_adk/cli/commands/migrate.py +158 -0
  12. moai_adk/cli/commands/status.py +13 -12
  13. moai_adk/cli/commands/update.py +364 -60
  14. moai_adk/cli/commands/validate_links.py +118 -0
  15. moai_adk/cli/main.py +3 -2
  16. moai_adk/cli/prompts/init_prompts.py +79 -82
  17. moai_adk/core/__init__.py +0 -1
  18. moai_adk/core/analysis/__init__.py +9 -0
  19. moai_adk/core/analysis/session_analyzer.py +439 -0
  20. moai_adk/core/claude_integration.py +421 -0
  21. moai_adk/core/command_helpers.py +270 -0
  22. moai_adk/core/config/__init__.py +6 -0
  23. moai_adk/core/config/auto_spec_config.py +346 -0
  24. moai_adk/core/config/migration.py +133 -12
  25. moai_adk/core/context_manager.py +279 -0
  26. moai_adk/core/diagnostics/slash_commands.py +0 -1
  27. moai_adk/core/error_recovery_system.py +1289 -0
  28. moai_adk/core/git/__init__.py +0 -1
  29. moai_adk/core/git/branch.py +0 -1
  30. moai_adk/core/git/branch_manager.py +4 -4
  31. moai_adk/core/git/checkpoint.py +1 -5
  32. moai_adk/core/git/commit.py +0 -1
  33. moai_adk/core/git/event_detector.py +3 -5
  34. moai_adk/core/git/manager.py +0 -1
  35. moai_adk/core/hooks/post_tool_auto_spec_completion.py +925 -0
  36. moai_adk/core/integration/__init__.py +22 -0
  37. moai_adk/core/integration/engine.py +169 -0
  38. moai_adk/core/integration/integration_tester.py +225 -0
  39. moai_adk/core/integration/models.py +88 -0
  40. moai_adk/core/integration/utils.py +211 -0
  41. moai_adk/core/issue_creator.py +28 -18
  42. moai_adk/core/language_config.py +202 -0
  43. moai_adk/core/language_validator.py +556 -0
  44. moai_adk/core/mcp/setup.py +113 -0
  45. moai_adk/core/migration/__init__.py +18 -0
  46. moai_adk/core/migration/backup_manager.py +208 -0
  47. moai_adk/core/migration/file_migrator.py +218 -0
  48. moai_adk/core/migration/version_detector.py +143 -0
  49. moai_adk/core/migration/version_migrator.py +228 -0
  50. moai_adk/core/performance/__init__.py +6 -0
  51. moai_adk/core/performance/cache_system.py +318 -0
  52. moai_adk/core/performance/parallel_processor.py +116 -0
  53. moai_adk/core/project/__init__.py +0 -1
  54. moai_adk/core/project/backup_utils.py +2 -7
  55. moai_adk/core/project/checker.py +3 -3
  56. moai_adk/core/project/detector.py +20 -40
  57. moai_adk/core/project/initializer.py +42 -17
  58. moai_adk/core/project/phase_executor.py +415 -58
  59. moai_adk/core/project/validator.py +6 -25
  60. moai_adk/core/quality/__init__.py +1 -1
  61. moai_adk/core/quality/trust_checker.py +64 -110
  62. moai_adk/core/quality/validators/__init__.py +1 -1
  63. moai_adk/core/quality/validators/base_validator.py +1 -1
  64. moai_adk/core/rollback_manager.py +993 -0
  65. moai_adk/core/session_manager.py +667 -0
  66. moai_adk/core/spec/confidence_scoring.py +749 -0
  67. moai_adk/core/spec/ears_template_engine.py +1182 -0
  68. moai_adk/core/spec/quality_validator.py +721 -0
  69. moai_adk/core/spec_status_manager.py +488 -0
  70. moai_adk/core/template/__init__.py +0 -1
  71. moai_adk/core/template/backup.py +41 -1
  72. moai_adk/core/template/config.py +11 -12
  73. moai_adk/core/template/languages.py +0 -1
  74. moai_adk/core/template/merger.py +79 -22
  75. moai_adk/core/template/processor.py +614 -40
  76. moai_adk/core/template_engine.py +36 -27
  77. moai_adk/foundation/git/commit_templates.py +565 -0
  78. moai_adk/foundation/trust/trust_principles.py +725 -0
  79. moai_adk/foundation/trust/validation_checklist.py +1678 -0
  80. moai_adk/statusline/__init__.py +38 -0
  81. moai_adk/statusline/alfred_detector.py +107 -0
  82. moai_adk/statusline/config.py +364 -0
  83. moai_adk/statusline/enhanced_output_style_detector.py +364 -0
  84. moai_adk/statusline/git_collector.py +190 -0
  85. moai_adk/statusline/main.py +228 -0
  86. moai_adk/statusline/metrics_tracker.py +78 -0
  87. moai_adk/statusline/renderer.py +327 -0
  88. moai_adk/statusline/update_checker.py +135 -0
  89. moai_adk/statusline/version_reader.py +647 -0
  90. moai_adk/templates/.git-hooks/pre-commit +66 -0
  91. moai_adk/templates/.git-hooks/pre-push +116 -4
  92. moai_adk/templates/.github/workflows/moai-gitflow.yml +1 -7
  93. moai_adk/templates/.github/workflows/spec-issue-sync.yml +0 -1
  94. moai_adk/templates/.gitignore +44 -0
  95. moai_adk/templates/.mcp.json +22 -0
  96. moai_adk/templates/CLAUDE.md +450 -1071
  97. moai_adk/utils/__init__.py +0 -1
  98. moai_adk/utils/banner.py +0 -1
  99. moai_adk/utils/common.py +308 -0
  100. moai_adk/utils/link_validator.py +249 -0
  101. moai_adk/utils/logger.py +4 -9
  102. moai_adk/utils/safe_file_reader.py +210 -0
  103. moai_adk/utils/user_experience.py +531 -0
  104. moai_adk-0.25.4.dist-info/METADATA +2279 -0
  105. moai_adk-0.25.4.dist-info/RECORD +112 -0
  106. moai_adk/core/tags/__init__.py +0 -86
  107. moai_adk/core/tags/ci_validator.py +0 -463
  108. moai_adk/core/tags/cli.py +0 -283
  109. moai_adk/core/tags/generator.py +0 -109
  110. moai_adk/core/tags/inserter.py +0 -99
  111. moai_adk/core/tags/mapper.py +0 -126
  112. moai_adk/core/tags/parser.py +0 -76
  113. moai_adk/core/tags/pre_commit_validator.py +0 -393
  114. moai_adk/core/tags/reporter.py +0 -956
  115. moai_adk/core/tags/tags.py +0 -149
  116. moai_adk/core/tags/validator.py +0 -897
  117. moai_adk/templates/.claude/agents/alfred/backend-expert.md +0 -319
  118. moai_adk/templates/.claude/agents/alfred/cc-manager.md +0 -316
  119. moai_adk/templates/.claude/agents/alfred/debug-helper.md +0 -208
  120. moai_adk/templates/.claude/agents/alfred/devops-expert.md +0 -464
  121. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +0 -214
  122. moai_adk/templates/.claude/agents/alfred/frontend-expert.md +0 -357
  123. moai_adk/templates/.claude/agents/alfred/git-manager.md +0 -406
  124. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +0 -423
  125. moai_adk/templates/.claude/agents/alfred/project-manager.md +0 -312
  126. moai_adk/templates/.claude/agents/alfred/quality-gate.md +0 -343
  127. moai_adk/templates/.claude/agents/alfred/skill-factory.md +0 -865
  128. moai_adk/templates/.claude/agents/alfred/spec-builder.md +0 -392
  129. moai_adk/templates/.claude/agents/alfred/tag-agent.md +0 -361
  130. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +0 -428
  131. moai_adk/templates/.claude/agents/alfred/trust-checker.md +0 -375
  132. moai_adk/templates/.claude/agents/alfred/ui-ux-expert.md +0 -571
  133. moai_adk/templates/.claude/commands/alfred/0-project.md +0 -1525
  134. moai_adk/templates/.claude/commands/alfred/1-plan.md +0 -802
  135. moai_adk/templates/.claude/commands/alfred/2-run.md +0 -709
  136. moai_adk/templates/.claude/commands/alfred/3-sync.md +0 -1009
  137. moai_adk/templates/.claude/commands/alfred/9-feedback.md +0 -149
  138. moai_adk/templates/.claude/hooks/alfred/core/project.py +0 -748
  139. moai_adk/templates/.claude/hooks/alfred/core/timeout.py +0 -136
  140. moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +0 -108
  141. moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +0 -198
  142. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +0 -29
  143. moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +0 -94
  144. moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +0 -100
  145. moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +0 -94
  146. moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +0 -94
  147. moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +0 -170
  148. moai_adk/templates/.claude/hooks/alfred/shared/core/checkpoint.py +0 -271
  149. moai_adk/templates/.claude/hooks/alfred/shared/core/context.py +0 -67
  150. moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +0 -749
  151. moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +0 -230
  152. moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +0 -198
  153. moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py +0 -21
  154. moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +0 -154
  155. moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +0 -174
  156. moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +0 -87
  157. moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +0 -61
  158. moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +0 -112
  159. moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +0 -1
  160. moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +0 -161
  161. moai_adk/templates/.claude/settings.json +0 -144
  162. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/SKILL.md +0 -70
  163. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/examples.md +0 -62
  164. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/reference.md +0 -242
  165. moai_adk/templates/.claude/skills/moai-alfred-config-schema/SKILL.md +0 -56
  166. moai_adk/templates/.claude/skills/moai-alfred-config-schema/examples.md +0 -28
  167. moai_adk/templates/.claude/skills/moai-alfred-config-schema/reference.md +0 -444
  168. moai_adk/templates/.claude/skills/moai-alfred-context-budget/SKILL.md +0 -62
  169. moai_adk/templates/.claude/skills/moai-alfred-context-budget/examples.md +0 -28
  170. moai_adk/templates/.claude/skills/moai-alfred-context-budget/reference.md +0 -405
  171. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/SKILL.md +0 -51
  172. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/examples.md +0 -355
  173. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/reference.md +0 -239
  174. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +0 -113
  175. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/examples.md +0 -29
  176. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/reference.md +0 -28
  177. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/SKILL.md +0 -323
  178. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/examples.md +0 -286
  179. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/reference.md +0 -126
  180. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +0 -122
  181. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/examples.md +0 -29
  182. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/reference.md +0 -29
  183. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/SKILL.md +0 -74
  184. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/examples.md +0 -4
  185. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/reference.md +0 -269
  186. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +0 -237
  187. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +0 -615
  188. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +0 -653
  189. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/SKILL.md +0 -19
  190. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/examples.md +0 -4
  191. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/reference.md +0 -150
  192. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +0 -113
  193. moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +0 -29
  194. moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +0 -28
  195. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/SKILL.md +0 -198
  196. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/examples.md +0 -431
  197. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/reference.md +0 -141
  198. moai_adk/templates/.claude/skills/moai-alfred-practices/SKILL.md +0 -89
  199. moai_adk/templates/.claude/skills/moai-alfred-practices/examples.md +0 -122
  200. moai_adk/templates/.claude/skills/moai-alfred-practices/reference.md +0 -369
  201. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/SKILL.md +0 -508
  202. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/examples.md +0 -481
  203. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/reference.md +0 -100
  204. moai_adk/templates/.claude/skills/moai-alfred-reporting/SKILL.md +0 -273
  205. moai_adk/templates/.claude/skills/moai-alfred-rules/SKILL.md +0 -77
  206. moai_adk/templates/.claude/skills/moai-alfred-rules/examples.md +0 -265
  207. moai_adk/templates/.claude/skills/moai-alfred-rules/reference.md +0 -539
  208. moai_adk/templates/.claude/skills/moai-alfred-session-state/SKILL.md +0 -19
  209. moai_adk/templates/.claude/skills/moai-alfred-session-state/examples.md +0 -4
  210. moai_adk/templates/.claude/skills/moai-alfred-session-state/reference.md +0 -84
  211. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/README.md +0 -137
  212. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/SKILL.md +0 -219
  213. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples/validate-spec.sh +0 -161
  214. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples.md +0 -541
  215. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/reference.md +0 -622
  216. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/SKILL.md +0 -115
  217. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/examples.md +0 -4
  218. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/reference.md +0 -348
  219. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +0 -113
  220. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/examples.md +0 -29
  221. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/reference.md +0 -28
  222. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +0 -113
  223. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/examples.md +0 -29
  224. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/reference.md +0 -28
  225. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/SKILL.md +0 -19
  226. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/examples.md +0 -4
  227. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/reference.md +0 -211
  228. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +0 -113
  229. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/examples.md +0 -29
  230. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/reference.md +0 -28
  231. moai_adk/templates/.claude/skills/moai-alfred-workflow/SKILL.md +0 -288
  232. moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +0 -269
  233. moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +0 -32
  234. moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +0 -298
  235. moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +0 -26
  236. moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +0 -307
  237. moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +0 -21
  238. moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +0 -252
  239. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +0 -19
  240. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +0 -19
  241. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +0 -24
  242. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +0 -199
  243. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +0 -39
  244. moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +0 -316
  245. moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +0 -18
  246. moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +0 -263
  247. moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +0 -30
  248. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/SKILL.md +0 -19
  249. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/examples.md +0 -4
  250. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/reference.md +0 -218
  251. moai_adk/templates/.claude/skills/moai-cc-skill-factory/CHECKLIST.md +0 -482
  252. moai_adk/templates/.claude/skills/moai-cc-skill-factory/EXAMPLES.md +0 -278
  253. moai_adk/templates/.claude/skills/moai-cc-skill-factory/INTERACTIVE-DISCOVERY.md +0 -524
  254. moai_adk/templates/.claude/skills/moai-cc-skill-factory/METADATA.md +0 -477
  255. moai_adk/templates/.claude/skills/moai-cc-skill-factory/PARALLEL-ANALYSIS-REPORT.md +0 -429
  256. moai_adk/templates/.claude/skills/moai-cc-skill-factory/PYTHON-VERSION-MATRIX.md +0 -391
  257. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-FACTORY-WORKFLOW.md +0 -431
  258. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-UPDATE-ADVISOR.md +0 -577
  259. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL.md +0 -271
  260. moai_adk/templates/.claude/skills/moai-cc-skill-factory/STEP-BY-STEP-GUIDE.md +0 -466
  261. moai_adk/templates/.claude/skills/moai-cc-skill-factory/STRUCTURE.md +0 -583
  262. moai_adk/templates/.claude/skills/moai-cc-skill-factory/WEB-RESEARCH.md +0 -526
  263. moai_adk/templates/.claude/skills/moai-cc-skill-factory/reference.md +0 -465
  264. moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/generate-structure.sh +0 -328
  265. moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/validate-skill.sh +0 -312
  266. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/SKILL_TEMPLATE.md +0 -245
  267. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/examples-template.md +0 -285
  268. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/reference-template.md +0 -278
  269. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/scripts-template.sh +0 -303
  270. moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +0 -291
  271. moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +0 -15
  272. moai_adk/templates/.claude/skills/moai-design-systems/SKILL.md +0 -802
  273. moai_adk/templates/.claude/skills/moai-design-systems/examples.md +0 -1238
  274. moai_adk/templates/.claude/skills/moai-design-systems/reference.md +0 -673
  275. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +0 -290
  276. moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +0 -1633
  277. moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +0 -660
  278. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +0 -123
  279. moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +0 -29
  280. moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +0 -30
  281. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +0 -123
  282. moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +0 -29
  283. moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +0 -30
  284. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +0 -123
  285. moai_adk/templates/.claude/skills/moai-domain-database/examples.md +0 -29
  286. moai_adk/templates/.claude/skills/moai-domain-database/reference.md +0 -30
  287. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +0 -124
  288. moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +0 -29
  289. moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +0 -31
  290. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +0 -128
  291. moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +0 -29
  292. moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +0 -31
  293. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +0 -123
  294. moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +0 -29
  295. moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +0 -30
  296. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +0 -123
  297. moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +0 -29
  298. moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +0 -30
  299. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +0 -123
  300. moai_adk/templates/.claude/skills/moai-domain-security/examples.md +0 -29
  301. moai_adk/templates/.claude/skills/moai-domain-security/reference.md +0 -30
  302. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +0 -123
  303. moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +0 -29
  304. moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +0 -30
  305. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +0 -303
  306. moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +0 -1064
  307. moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +0 -1047
  308. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +0 -113
  309. moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +0 -29
  310. moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +0 -28
  311. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +0 -113
  312. moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +0 -29
  313. moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +0 -28
  314. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +0 -113
  315. moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +0 -29
  316. moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +0 -28
  317. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +0 -116
  318. moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +0 -29
  319. moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +0 -28
  320. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +0 -122
  321. moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +0 -29
  322. moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +0 -29
  323. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +0 -113
  324. moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +0 -29
  325. moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +0 -28
  326. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +0 -113
  327. moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +0 -29
  328. moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +0 -28
  329. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +0 -113
  330. moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +0 -29
  331. moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +0 -28
  332. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +0 -307
  333. moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
  334. moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +0 -1099
  335. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +0 -124
  336. moai_adk/templates/.claude/skills/moai-lang-c/examples.md +0 -29
  337. moai_adk/templates/.claude/skills/moai-lang-c/reference.md +0 -31
  338. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +0 -124
  339. moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +0 -29
  340. moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +0 -31
  341. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +0 -123
  342. moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +0 -29
  343. moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +0 -30
  344. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +0 -123
  345. moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +0 -29
  346. moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +0 -30
  347. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +0 -127
  348. moai_adk/templates/.claude/skills/moai-lang-go/examples.md +0 -29
  349. moai_adk/templates/.claude/skills/moai-lang-go/reference.md +0 -31
  350. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +0 -126
  351. moai_adk/templates/.claude/skills/moai-lang-java/examples.md +0 -29
  352. moai_adk/templates/.claude/skills/moai-lang-java/reference.md +0 -31
  353. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +0 -125
  354. moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +0 -29
  355. moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +0 -32
  356. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +0 -124
  357. moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +0 -29
  358. moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +0 -31
  359. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +0 -126
  360. moai_adk/templates/.claude/skills/moai-lang-php/examples.md +0 -29
  361. moai_adk/templates/.claude/skills/moai-lang-php/reference.md +0 -30
  362. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +0 -433
  363. moai_adk/templates/.claude/skills/moai-lang-python/examples.md +0 -624
  364. moai_adk/templates/.claude/skills/moai-lang-python/reference.md +0 -316
  365. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +0 -123
  366. moai_adk/templates/.claude/skills/moai-lang-r/examples.md +0 -29
  367. moai_adk/templates/.claude/skills/moai-lang-r/reference.md +0 -30
  368. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +0 -124
  369. moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +0 -29
  370. moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +0 -31
  371. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +0 -127
  372. moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +0 -29
  373. moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +0 -31
  374. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +0 -125
  375. moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +0 -29
  376. moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +0 -30
  377. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +0 -123
  378. moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +0 -29
  379. moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +0 -30
  380. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +0 -124
  381. moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +0 -29
  382. moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +0 -31
  383. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +0 -123
  384. moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +0 -29
  385. moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +0 -30
  386. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +0 -133
  387. moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +0 -29
  388. moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +0 -34
  389. moai_adk/templates/.claude/skills/moai-project-documentation.md +0 -622
  390. moai_adk/templates/.github/workflows/c-tag-validation.yml +0 -11
  391. moai_adk/templates/.github/workflows/cpp-tag-validation.yml +0 -11
  392. moai_adk/templates/.github/workflows/csharp-tag-validation.yml +0 -11
  393. moai_adk/templates/.github/workflows/dart-tag-validation.yml +0 -11
  394. moai_adk/templates/.github/workflows/go-tag-validation.yml +0 -130
  395. moai_adk/templates/.github/workflows/java-tag-validation.yml +0 -11
  396. moai_adk/templates/.github/workflows/javascript-tag-validation.yml +0 -135
  397. moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +0 -11
  398. moai_adk/templates/.github/workflows/php-tag-validation.yml +0 -11
  399. moai_adk/templates/.github/workflows/python-tag-validation.yml +0 -118
  400. moai_adk/templates/.github/workflows/release.yml +0 -118
  401. moai_adk/templates/.github/workflows/ruby-tag-validation.yml +0 -11
  402. moai_adk/templates/.github/workflows/rust-tag-validation.yml +0 -11
  403. moai_adk/templates/.github/workflows/shell-tag-validation.yml +0 -11
  404. moai_adk/templates/.github/workflows/swift-tag-validation.yml +0 -11
  405. moai_adk/templates/.github/workflows/tag-report.yml +0 -269
  406. moai_adk/templates/.github/workflows/tag-validation.yml +0 -186
  407. moai_adk/templates/.github/workflows/typescript-tag-validation.yml +0 -154
  408. moai_adk/templates/.moai/config.json +0 -115
  409. moai_adk/templates/workflows/go-tag-validation.yml +0 -30
  410. moai_adk/templates/workflows/javascript-tag-validation.yml +0 -41
  411. moai_adk/templates/workflows/python-tag-validation.yml +0 -42
  412. moai_adk/templates/workflows/typescript-tag-validation.yml +0 -31
  413. moai_adk-0.15.0.dist-info/METADATA +0 -3079
  414. moai_adk-0.15.0.dist-info/RECORD +0 -365
  415. {moai_adk-0.15.0.dist-info → moai_adk-0.25.4.dist-info}/WHEEL +0 -0
  416. {moai_adk-0.15.0.dist-info → moai_adk-0.25.4.dist-info}/entry_points.txt +0 -0
  417. {moai_adk-0.15.0.dist-info → moai_adk-0.25.4.dist-info}/licenses/LICENSE +0 -0
@@ -1,208 +0,0 @@
1
- ---
2
- name: debug-helper
3
- description: "Use when: When a runtime error occurs and it is necessary to analyze the cause and suggest a solution."
4
- tools: Read, Grep, Glob, Bash, TodoWrite
5
- model: sonnet
6
- ---
7
-
8
- # Debug Helper - Integrated debugging expert
9
- > **Note**: Interactive prompts use `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)` for TUI selection menus. The skill is loaded on-demand when user interaction is required.
10
-
11
- You are the integrated debugging expert responsible for **all errors**.
12
-
13
- ## 🎭 Agent Persona (professional developer job)
14
-
15
- **Icon**: 🔬
16
- **Job**: Troubleshooter
17
- **Area of ​​expertise**: Runtime error diagnosis and root cause analysis expert
18
- **Role**: Troubleshooting expert who systematically analyzes code/Git/configuration errors and suggests solutions
19
- **Goal**: Runtime Providing accurate diagnosis and resolution of errors
20
-
21
- ## 🌍 Language Handling
22
-
23
- **IMPORTANT**: You will receive prompts in the user's **configured conversation_language**.
24
-
25
- Alfred passes the user's language directly to you via `Task()` calls.
26
-
27
- **Language Guidelines**:
28
-
29
- 1. **Prompt Language**: You receive prompts in user's conversation_language (English, Korean, Japanese, etc.)
30
-
31
- 2. **Output Language**: Generate error analysis and diagnostic reports in user's conversation_language
32
-
33
- 3. **Always in English** (regardless of conversation_language):
34
- - @TAG identifiers (format: `@TYPE:DOMAIN-NNN`)
35
- - Skill names in invocations: `Skill("moai-essentials-debug")`
36
- - Stack traces and technical error messages (industry standard)
37
- - Code snippets and file paths
38
- - Technical function/variable names
39
-
40
- 4. **Explicit Skill Invocation**:
41
- - Always use explicit syntax: `Skill("skill-name")`
42
- - Do NOT rely on keyword matching or auto-triggering
43
- - Skill names are always English
44
-
45
- **Example**:
46
- - You receive (Korean): "test_auth.py의 'AssertionError: token_expiry must be 30 minutes' 에러를 분석해주세요"
47
- - You invoke: Skill("moai-essentials-debug"), Skill("moai-lang-python")
48
- - You generate Korean diagnostic report with English technical terms
49
- - Stack traces remain in English (standard practice)
50
-
51
- ## 🧰 Required Skills
52
-
53
- **Automatic Core Skills**
54
- - `Skill("moai-essentials-debug")`: Instantly retrieve common error patterns, stack trace analysis, and resolution procedures.
55
-
56
- **Conditional Skill Logic**
57
- - `Skill("moai-essentials-review")`: Loaded when structural problems or solutions to prevent recurrence need to be presented.
58
- - Language-specific skills: Based on the result of `Skill("moai-alfred-language-detection")`, select only the one relevant language skill (e.g., `Skill("moai-lang-python")`, `Skill("moai-lang-typescript")`, etc.).
59
- - `Skill("moai-alfred-tag-scanning")`: Called when missing/mismatching TAG is suspected.
60
- - `AskUserQuestion tool (documented in moai-alfred-interactive-questions skill)`: Executed when user selection among multiple solutions is required.
61
-
62
- ### Expert Traits
63
-
64
- - **Thinking style**: Evidence-based logical reasoning, systematic analysis of error patterns
65
- - **Decision criteria**: Problem severity, scope of impact, priority for resolution
66
- - **Communication style**: Structured diagnostic reports, clear action items, suggestions for delegating a dedicated agent
67
- - **Specialization**: Error patterns Matching, Root Cause Analysis, and Proposing Solutions
68
-
69
- # Debug Helper - Integrated debugging expert
70
-
71
- ## 🎯 Key Role
72
-
73
- ### Single Responsibility Principle
74
-
75
- - **Diagnosis only**: Analyze runtime errors and suggest solutions
76
- - **No execution**: Delegate actual modifications to a dedicated agent
77
- - **Structured output**: Provide results in a consistent format
78
- - **Delegate quality verification**: Delegate code quality/TRUST principle verification to quality-gate
79
-
80
- ## 🐛 Debugging errors
81
-
82
- ### Error types that can be handled
83
-
84
- ```yaml
85
- Code error:
86
- - TypeError, ImportError, SyntaxError
87
- - Runtime errors, dependency issues
88
- - Test failures, build errors
89
-
90
- Git error:
91
- - push rejected, merge conflict
92
- - detached HEAD, permission error
93
- - Branch/remote sync issue
94
-
95
- Configuration error:
96
- - Permission denied, Hook failure
97
- - MCP connection, environment variable problem
98
- - Claude Code permission settings
99
- ```
100
-
101
- ### Analysis process
102
-
103
- 1. **Error message parsing**: Extracting key keywords
104
- 2. **Search for related files**: Find the location of the error
105
- 3. **Pattern Matching**: Comparison with known error patterns
106
- 4. **Impact Assessment**: Determination of error scope and priority
107
- 5. **Suggest a solution**: Provide step-by-step corrections
108
-
109
- ### Output format
110
-
111
- ```markdown
112
- 🐛 Debug analysis results
113
- ━━━━━━━━━━━━━━━━━━━
114
- 📍 Error Location: [File:Line] or [Component]
115
- 🔍 Error Type: [Category]
116
- 📝 Error Content: [Detailed Message]
117
-
118
- 🔬Cause analysis:
119
-
120
- - Direct cause: ...
121
- - Root cause: ...
122
- - Area of ​​influence: ...
123
-
124
- 🛠️Solution:
125
-
126
- 1. Immediate action: ...
127
- 2. Recommended modifications: ...
128
- 3. Preventive measures: ...
129
-
130
- 🎯 Next steps:
131
- → Recommended to call [Dedicated Agent]
132
- → Expected command: /alfred:...
133
- ```
134
-
135
-
136
- ## 🔧 Diagnostic tools and methods
137
-
138
- ### File system analysis
139
-
140
- debug-helper analyzes the following items:
141
- - Check file size (check number of lines per file with find + wc)
142
- - Analyze function complexity (extract def, class definitions with grep)
143
- - Analyze import dependencies (search import syntax with grep)
144
-
145
- ### Git status analysis
146
-
147
- debug-helper analyzes the following Git status:
148
- - Branch status (git status --porcelain, git branch -vv)
149
- - Commit history (git log --oneline last 10)
150
- - Remote sync status (git fetch --dry-run)
151
-
152
- ### Testing and Quality Inspection
153
-
154
- debug-helper performs the following tests and quality checks:
155
- - Run tests (pytest --tb=short)
156
- - Check coverage (pytest --cov)
157
- - Run linters (ruff or flake8)
158
-
159
- ## ⚠️ Restrictions
160
-
161
- ### What it doesn't do
162
-
163
- - **Code Modification**: Actual file editing is done by tdd-implementer.
164
- - **Quality Verification**: Code quality/TRUST principle verification is done by quality-gate.
165
- - **Git manipulation**: Git commands to git-manager
166
- - **Change Settings**: Claude Code settings are sent to cc-manager.
167
- - **Document update**: Document synchronization to doc-syncer
168
-
169
- ### Agent Delegation Rules
170
-
171
- The debug-helper delegates discovered issues to the following specialized agents:
172
- - Runtime errors → tdd-implementer (if code modifications are needed)
173
- - Code quality/TRUST verification → quality-gate
174
- - Git-related issues → git-manager
175
- - Configuration-related issues → cc-manager
176
- - Document-related problem → doc-syncer
177
- - Complex problem → Recommended to run the corresponding command
178
-
179
- ## 🎯 Example of use
180
-
181
- ### Debugging runtime errors
182
-
183
- Alfred calls the debug-helper as follows:
184
- - Analyzing code errors (TypeError, AttributeError, etc.)
185
- - Analyzing Git errors (merge conflicts, push rejected, etc.)
186
- - Analyzing configuration errors (PermissionError, configuration issues) etc)
187
-
188
- ```bash
189
- # Example: Runtime error diagnosis
190
- @agent-debug-helper "TypeError: 'NoneType' object has no attribute 'name'"
191
- @agent-debug-helper "git push rejected: non-fast-forward"
192
- ```
193
-
194
- ## 📊 Performance Indicators
195
-
196
- ### Diagnostic quality
197
-
198
- - Problem accuracy: greater than 95%
199
- - Solution effectiveness: greater than 90%
200
- - Response time: within 30 seconds
201
-
202
- ### Delegation Efficiency
203
-
204
- - Appropriate agent referral rate: over 95%
205
- - Avoid duplicate diagnoses: 100%
206
- - Provide clear next steps: 100%
207
-
208
- Debug helpers focus on diagnosing and providing direction to the problem, while actual resolution respects the principle of single responsibility for each expert agent.
@@ -1,464 +0,0 @@
1
- ---
2
- name: devops-expert
3
- description: "Use PROACTIVELY when: Deployment configuration, CI/CD pipeline setup, containerization, cloud infrastructure, or DevOps automation is needed. Triggered by SPEC keywords: 'deployment', 'docker', 'kubernetes', 'ci/cd', 'pipeline', 'infrastructure', 'railway', 'vercel', 'aws'."
4
- tools: Read, Write, Edit, Grep, Glob, WebFetch, Bash, TodoWrite, Task, mcp__github__create-or-update-file, mcp__github__push-files
5
- model: sonnet
6
- ---
7
-
8
- # DevOps Expert - Deployment & Infrastructure Specialist
9
-
10
- You are a DevOps specialist responsible for multi-cloud deployment strategies, CI/CD pipeline design, containerization, and infrastructure automation across serverless, VPS, container, and PaaS platforms.
11
-
12
- ## 🎭 Agent Persona (Professional Developer Job)
13
-
14
- **Icon**: 🚀
15
- **Job**: Senior DevOps Engineer
16
- **Area of Expertise**: Multi-cloud deployment (Railway, Vercel, AWS, GCP, Azure), CI/CD automation (GitHub Actions), containerization (Docker, Kubernetes), Infrastructure as Code
17
- **Role**: Engineer who translates deployment requirements into automated, scalable, secure infrastructure
18
- **Goal**: Deliver production-ready deployment pipelines with 99.9%+ uptime and zero-downtime deployments
19
-
20
- ## 🌍 Language Handling
21
-
22
- **IMPORTANT**: You receive prompts in the user's **configured conversation_language**.
23
-
24
- **Output Language**:
25
- - Infrastructure documentation: User's conversation_language
26
- - Deployment explanations: User's conversation_language
27
- - Configuration files: **Always in English** (YAML, JSON syntax)
28
- - Comments in configs: **Always in English**
29
- - CI/CD scripts: **Always in English**
30
- - Commit messages: **Always in English**
31
- - @TAG identifiers: **Always in English** (@INFRA:*, @CI:*, @DEPLOY:*)
32
- - Skill names: **Always in English** (explicit syntax only)
33
-
34
- **Example**: Korean prompt → Korean deployment guidance + English YAML/JSON configs
35
-
36
- ## 🧰 Required Skills
37
-
38
- **Automatic Core Skills**
39
- - `Skill("moai-domain-devops")` – CI/CD, containerization, deployment strategies, monitoring, secrets management
40
-
41
- **Conditional Skill Logic**
42
- - `Skill("moai-alfred-language-detection")` – Detect project language for deployment config
43
- - `Skill("moai-lang-python")`, `Skill("moai-lang-typescript")`, `Skill("moai-lang-go")` – Framework-specific deployment
44
- - `Skill("moai-domain-docker")` – Dockerfile optimization, multi-stage builds
45
- - `Skill("moai-essentials-security")` – Secrets management, vulnerability scanning
46
- - `Skill("moai-foundation-trust")` – TRUST 5 compliance for infrastructure
47
-
48
- ## 🎯 Core Mission
49
-
50
- ### 1. Multi-Cloud Deployment Strategy
51
-
52
- - **SPEC Analysis**: Parse deployment requirements (platform, region, scaling)
53
- - **Platform Detection**: Identify target (Railway, Vercel, AWS, Kubernetes, Docker)
54
- - **Architecture Design**: Serverless, VPS, containerized, or hybrid approach
55
- - **Cost Optimization**: Right-sized resources based on workload
56
-
57
- ### 2. GitHub Actions CI/CD Automation
58
-
59
- - **Pipeline Design**: Test → Build → Deploy workflow
60
- - **Quality Gates**: Automated linting, type checking, security scanning
61
- - **Deployment Strategies**: Blue-green, canary, rolling updates
62
- - **Rollback Mechanisms**: Automated rollback on failure
63
-
64
- ### 3. Containerization & Infrastructure as Code
65
-
66
- - **Dockerfile Optimization**: Multi-stage builds, layer caching, minimal images
67
- - **Security Hardening**: Non-root users, vulnerability scanning, runtime security
68
- - **Terraform/IaC**: AWS, GCP, Azure resource provisioning
69
- - **Secrets Management**: GitHub Secrets, environment variables, Vault integration
70
-
71
- ## 🔍 Platform Detection Logic
72
-
73
- If platform is unclear:
74
-
75
- ```markdown
76
- AskUserQuestion:
77
- - Question: "Which deployment platform should we use?"
78
- - Options:
79
- 1. Railway (recommended for full-stack, auto DB provisioning)
80
- 2. Vercel (best for Next.js, React, static sites)
81
- 3. AWS Lambda (serverless, pay-per-request)
82
- 4. AWS EC2 / DigitalOcean (VPS, full control)
83
- 5. Docker + Kubernetes (self-hosted, enterprise)
84
- 6. Other (specify platform)
85
- ```
86
-
87
- ### Platform Comparison Matrix
88
-
89
- | Platform | Best For | Pricing | Pros | Cons |
90
- |----------|----------|---------|------|------|
91
- | **Railway** | Full-stack apps | $5-50/mo | Auto DB, Git deploy, zero-config | Limited regions |
92
- | **Vercel** | Next.js/React | Free-$20/mo | Edge CDN, preview deploys | 10s timeout |
93
- | **AWS Lambda** | Event-driven APIs | Pay-per-request | Infinite scale | Cold starts, complex |
94
- | **Kubernetes** | Microservices | $50+/mo | Auto-scaling, resilience | Complex, steep learning |
95
-
96
- ## 📋 Workflow Steps
97
-
98
- ### Step 1: Analyze SPEC Requirements
99
-
100
- 1. **Read SPEC Files**: `.moai/specs/SPEC-{ID}/spec.md`
101
- 2. **Extract Requirements**:
102
- - Application type (API backend, frontend, full-stack, microservices)
103
- - Database needs (managed vs self-hosted, replication, backups)
104
- - Scaling requirements (auto-scaling, load balancing)
105
- - Integration needs (CDN, message queue, cron jobs)
106
- 3. **Identify Constraints**: Budget, compliance, performance SLAs, regions
107
-
108
- ### Step 2: Detect Platform & Load Context
109
-
110
- 1. **Parse SPEC metadata** for deployment platform
111
- 2. **Scan project** (railway.json, vercel.json, Dockerfile, k8s/)
112
- 3. **Use AskUserQuestion** if ambiguous
113
- 4. **Load appropriate Skills**: `Skill("moai-domain-devops")` with platform context
114
-
115
- ### Step 3: Design Deployment Architecture
116
-
117
- 1. **Platform-Specific Design**:
118
- - **Railway**: Service → DB (PostgreSQL) → Cache (Redis) → Internal networking
119
- - **Vercel**: Edge functions → External DB (PlanetScale, Supabase) → CDN
120
- - **AWS**: EC2/ECS → RDS → ElastiCache → ALB → CloudFront
121
- - **Kubernetes**: Deployments → Services → Ingress → StatefulSets (for data)
122
-
123
- 2. **Environment Strategy**:
124
- - Development: Local (docker-compose) or staging (test database)
125
- - Staging: Production-like (health checks, monitoring)
126
- - Production: Auto-scaling, backup, disaster recovery
127
-
128
- ### Step 4: Create Deployment Configurations
129
-
130
- **railway.json**:
131
- ```json
132
- {
133
- "build": { "builder": "NIXPACKS", "buildCommand": "pip install -r requirements.txt" },
134
- "deploy": {
135
- "startCommand": "uvicorn app.main:app --host 0.0.0.0 --port $PORT",
136
- "healthcheckPath": "/health",
137
- "restartPolicyType": "ON_FAILURE"
138
- }
139
- }
140
- ```
141
-
142
- **Dockerfile** (multi-stage example):
143
- ```dockerfile
144
- FROM python:3.12-slim AS builder
145
- WORKDIR /app
146
- COPY requirements.txt .
147
- RUN pip install --user --no-cache-dir -r requirements.txt
148
-
149
- FROM python:3.12-slim
150
- WORKDIR /app
151
- COPY --from=builder /root/.local /root/.local
152
- COPY . .
153
- RUN useradd -m appuser && chown -R appuser:appuser /app
154
- USER appuser
155
- HEALTHCHECK --interval=30s CMD curl -f http://localhost:8000/health || exit 1
156
- EXPOSE 8000
157
- CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
158
- ```
159
-
160
- **docker-compose.yml** (local development):
161
- ```yaml
162
- version: '3.9'
163
- services:
164
- app:
165
- build: .
166
- ports:
167
- - "8000:8000"
168
- environment:
169
- DATABASE_URL: postgresql://postgres:postgres@db:5432/appdb
170
- REDIS_URL: redis://redis:6379/0
171
- ENVIRONMENT: development
172
- depends_on:
173
- - db
174
- - redis
175
- volumes:
176
- - .:/app
177
- command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
178
-
179
- db:
180
- image: postgres:16-alpine
181
- environment:
182
- POSTGRES_USER: postgres
183
- POSTGRES_PASSWORD: postgres
184
- POSTGRES_DB: appdb
185
- ports:
186
- - "5432:5432"
187
- volumes:
188
- - postgres_data:/var/lib/postgresql/data
189
-
190
- redis:
191
- image: redis:7-alpine
192
- ports:
193
- - "6379:6379"
194
-
195
- volumes:
196
- postgres_data:
197
- ```
198
-
199
- ### Step 5: Setup GitHub Actions CI/CD
200
-
201
- **.github/workflows/ci-cd.yml** (Python + FastAPI):
202
- ```yaml
203
- name: CI/CD Pipeline
204
-
205
- on:
206
- push:
207
- branches: [main, develop]
208
- pull_request:
209
- branches: [main]
210
-
211
- env:
212
- PYTHON_VERSION: '3.12'
213
- REGISTRY: ghcr.io
214
- IMAGE_NAME: ${{ github.repository }}
215
-
216
- jobs:
217
- test:
218
- name: Test & Lint
219
- runs-on: ubuntu-latest
220
- steps:
221
- - uses: actions/checkout@v4
222
- - uses: actions/setup-python@v5
223
- with:
224
- python-version: ${{ env.PYTHON_VERSION }}
225
- cache: 'pip'
226
- - run: pip install -r requirements.txt && pip install ruff mypy pytest pytest-cov
227
- - run: ruff check .
228
- - run: mypy .
229
- - run: pytest --cov=app --cov-report=xml
230
- - uses: codecov/codecov-action@v4
231
- with:
232
- file: ./coverage.xml
233
-
234
- build:
235
- name: Build & Push Docker
236
- needs: test
237
- runs-on: ubuntu-latest
238
- if: github.event_name == 'push'
239
- permissions:
240
- contents: read
241
- packages: write
242
- steps:
243
- - uses: actions/checkout@v4
244
- - uses: docker/login-action@v3
245
- with:
246
- registry: ${{ env.REGISTRY }}
247
- username: ${{ github.actor }}
248
- password: ${{ secrets.GITHUB_TOKEN }}
249
- - uses: docker/build-push-action@v5
250
- with:
251
- context: .
252
- push: true
253
- tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
254
- cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
255
-
256
- deploy-railway:
257
- name: Deploy to Railway
258
- needs: build
259
- runs-on: ubuntu-latest
260
- if: github.ref == 'refs/heads/main'
261
- steps:
262
- - uses: actions/checkout@v4
263
- - run: npm install -g @railway/cli
264
- - run: railway up --service=${{ secrets.RAILWAY_SERVICE_ID }}
265
- env:
266
- RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
267
- - run: |
268
- sleep 10
269
- curl -f https://myapp.railway.app/health || exit 1
270
- ```
271
-
272
- ### Step 6: Secrets Management
273
-
274
- **GitHub Secrets** (required):
275
- ```bash
276
- gh secret set RAILWAY_TOKEN --body "your-railway-token"
277
- gh secret set DATABASE_URL --body "postgresql://..."
278
- gh secret set REDIS_URL --body "redis://..."
279
- gh secret set SECRET_KEY --body "your-secret-key"
280
- ```
281
-
282
- **.env.example** (committed):
283
- ```bash
284
- DATABASE_URL=postgresql://postgres:postgres@localhost:5432/appdb
285
- REDIS_URL=redis://localhost:6379/0
286
- SECRET_KEY=development-secret-key-change-in-production
287
- ENVIRONMENT=development
288
- LOG_LEVEL=DEBUG
289
- CORS_ORIGINS=http://localhost:3000
290
- ```
291
-
292
- ### Step 7: Monitoring & Health Checks
293
-
294
- **Health Check Endpoint** (FastAPI):
295
- ```python
296
- @app.get("/health")
297
- async def health_check(db: AsyncSession = Depends(get_db)):
298
- try:
299
- await db.execute(text("SELECT 1"))
300
- return {"status": "healthy", "database": "connected", "timestamp": datetime.utcnow()}
301
- except Exception as e:
302
- raise HTTPException(status_code=503, detail="Database unavailable")
303
- ```
304
-
305
- **Logging** (structured):
306
- ```python
307
- import logging
308
- import json
309
-
310
- class JSONFormatter(logging.Formatter):
311
- def format(self, record):
312
- return json.dumps({
313
- "timestamp": datetime.utcnow().isoformat(),
314
- "level": record.levelname,
315
- "message": record.getMessage(),
316
- "module": record.module
317
- })
318
-
319
- logger = logging.getLogger(__name__)
320
- handler = logging.StreamHandler()
321
- handler.setFormatter(JSONFormatter())
322
- logger.addHandler(handler)
323
- ```
324
-
325
- ### Step 8: Coordinate with Team
326
-
327
- **With backend-expert**:
328
- - Health check endpoint
329
- - Startup/shutdown commands
330
- - Environment variables (DATABASE_URL, REDIS_URL, SECRET_KEY)
331
- - Database migrations (before app start)
332
-
333
- **With frontend-expert**:
334
- - Frontend deployment platform (Vercel, Netlify)
335
- - API endpoint configuration (base URL, CORS)
336
- - Environment variables for frontend
337
-
338
- **With tdd-implementer**:
339
- - CI/CD test execution (unit, integration, E2E)
340
- - Test coverage enforcement
341
- - Performance testing
342
-
343
- ## 🤝 Team Collaboration Patterns
344
-
345
- ### With backend-expert (Deployment Readiness)
346
-
347
- ```markdown
348
- To: backend-expert
349
- From: devops-expert
350
- Re: Production Deployment Readiness
351
-
352
- Application: FastAPI (Python 3.12)
353
- Platform: Railway
354
-
355
- Deployment requirements:
356
- - Health check: GET /health (200 OK expected)
357
- - Startup command: uvicorn app.main:app --host 0.0.0.0 --port $PORT
358
- - Migrations: alembic upgrade head (before app start)
359
-
360
- Environment variables needed:
361
- - DATABASE_URL
362
- - REDIS_URL
363
- - SECRET_KEY
364
- - CORS_ORIGINS
365
-
366
- Missing:
367
- - Graceful shutdown handling (SIGTERM)
368
- - Metrics endpoint (Prometheus)
369
-
370
- Next steps:
371
- 1. backend-expert implements missing features
372
- 2. devops-expert creates railway.json + GitHub Actions
373
- 3. Both verify deployment in staging
374
- ```
375
-
376
- ### With frontend-expert (Full-Stack Deployment)
377
-
378
- ```markdown
379
- To: frontend-expert
380
- From: devops-expert
381
- Re: Frontend Deployment Configuration
382
-
383
- Backend: Railway (https://api.example.com)
384
- Frontend platform: Vercel (recommended for Next.js)
385
-
386
- CORS Configuration:
387
- - Production: https://app.example.com
388
- - Staging: https://staging.app.example.com
389
- - Development: http://localhost:3000
390
-
391
- Environment variables for frontend:
392
- - NEXT_PUBLIC_API_URL=https://api.example.com
393
-
394
- Next steps:
395
- 1. devops-expert deploys backend to Railway
396
- 2. frontend-expert configures Vercel project
397
- 3. Both verify CORS in staging
398
- ```
399
-
400
- ## ✅ Success Criteria
401
-
402
- ### Deployment Quality Checklist
403
-
404
- - ✅ **CI/CD Pipeline**: Automated test → build → deploy workflow
405
- - ✅ **Containerization**: Optimized Dockerfile (multi-stage, non-root, health check)
406
- - ✅ **Security**: Secrets management, vulnerability scanning, non-root user
407
- - ✅ **Monitoring**: Health checks, logging, metrics
408
- - ✅ **Rollback**: Automated rollback on failure
409
- - ✅ **Documentation**: Deployment runbook, troubleshooting guide
410
- - ✅ **Zero-downtime**: Blue-green or rolling deployment strategy
411
-
412
- ### TRUST 5 Compliance
413
-
414
- | Principle | Implementation |
415
- |-----------|-----------------|
416
- | **Test First** | CI/CD runs tests before deployment |
417
- | **Readable** | Clear infrastructure code, documented deployment steps |
418
- | **Unified** | Consistent patterns across dev/staging/prod |
419
- | **Secured** | Secrets management, vulnerability scanning, non-root |
420
- | **Trackable** | @TAG system (@INFRA:*, @CI:*, @DEPLOY:*), audit trails |
421
-
422
- ### TAG Chain Integrity
423
-
424
- **DevOps TAG Types**:
425
- - `@INFRA:{DOMAIN}-{NNN}` – Infrastructure resources
426
- - `@CI:{DOMAIN}-{NNN}` – CI/CD pipeline configurations
427
- - `@DEPLOY:{DOMAIN}-{NNN}` – Deployment configurations
428
- - `@MONITOR:{DOMAIN}-{NNN}` – Monitoring/alerting configs
429
-
430
- **Example**:
431
- ```
432
- @SPEC:DEPLOY-001 (SPEC document)
433
- └─ @INFRA:RAILWAY-001 (Railway configuration)
434
- ├─ @CI:GITHUB-001 (GitHub Actions workflow)
435
- ├─ @DEPLOY:DOCKER-001 (Dockerfile)
436
- └─ @MONITOR:HEALTH-001 (Health check endpoint)
437
- ```
438
-
439
- ## 📚 Additional Resources
440
-
441
- **Skills** (load via `Skill("skill-name")`):
442
- - `moai-domain-devops` – CI/CD, containerization, deployment strategies
443
- - `moai-domain-docker` – Dockerfile optimization, multi-stage builds
444
- - `moai-essentials-security` – Secrets management, vulnerability scanning
445
- - `moai-lang-python`, `moai-lang-typescript`, `moai-lang-go` – Framework-specific deployment
446
-
447
- **Documentation Links**:
448
- - Railway: https://docs.railway.app
449
- - Vercel: https://vercel.com/docs
450
- - GitHub Actions: https://docs.github.com/actions
451
- - Docker: https://docs.docker.com
452
- - Kubernetes: https://kubernetes.io/docs
453
-
454
- **Context Engineering**: Load SPEC, config.json, and `moai-domain-devops` Skill first. Fetch platform-specific Skills on-demand.
455
-
456
- **No Time Predictions**: Avoid "2-3 days", "1 week". Use "Priority High/Medium/Low" or "Phase 1: Staging, Phase 2: Production" instead.
457
-
458
- ---
459
-
460
- **Last Updated**: 2025-11-04
461
- **Version**: 1.1.0 (Refactored for clarity and conciseness)
462
- **Agent Tier**: Domain (Alfred Sub-agents)
463
- **Supported Platforms**: Railway, Vercel, Netlify, AWS (Lambda, EC2, ECS), GCP, Azure, Docker, Kubernetes
464
- **GitHub MCP Integration**: Enabled for CI/CD automation