moai-adk 0.4.5__py3-none-any.whl → 0.20.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of moai-adk might be problematic. Click here for more details.

Files changed (433) hide show
  1. moai_adk/__init__.py +1 -1
  2. moai_adk/__main__.py +74 -1
  3. moai_adk/cli/commands/__init__.py +1 -1
  4. moai_adk/cli/commands/analyze.py +119 -0
  5. moai_adk/cli/commands/backup.py +25 -1
  6. moai_adk/cli/commands/doctor.py +31 -5
  7. moai_adk/cli/commands/improve_user_experience.py +307 -0
  8. moai_adk/cli/commands/init.py +111 -10
  9. moai_adk/cli/commands/status.py +33 -3
  10. moai_adk/cli/commands/update.py +921 -130
  11. moai_adk/cli/commands/validate_links.py +120 -0
  12. moai_adk/cli/prompts/init_prompts.py +22 -87
  13. moai_adk/core/analysis/__init__.py +9 -0
  14. moai_adk/core/analysis/session_analyzer.py +388 -0
  15. moai_adk/core/analysis/tag_chain_analyzer.py +344 -0
  16. moai_adk/core/analysis/tag_chain_repair.py +879 -0
  17. moai_adk/core/config/__init__.py +19 -0
  18. moai_adk/core/config/migration.py +235 -0
  19. moai_adk/core/git/__init__.py +1 -1
  20. moai_adk/core/git/branch.py +1 -1
  21. moai_adk/core/git/commit.py +1 -1
  22. moai_adk/core/git/manager.py +1 -1
  23. moai_adk/core/issue_creator.py +313 -0
  24. moai_adk/core/mcp/setup.py +56 -0
  25. moai_adk/core/mcp/setup_old.py +296 -0
  26. moai_adk/core/project/backup_utils.py +1 -1
  27. moai_adk/core/project/checker.py +2 -2
  28. moai_adk/core/project/detector.py +211 -12
  29. moai_adk/core/project/initializer.py +85 -15
  30. moai_adk/core/project/phase_executor.py +76 -13
  31. moai_adk/core/project/validator.py +13 -13
  32. moai_adk/core/quality/__init__.py +1 -1
  33. moai_adk/core/quality/trust_checker.py +1 -1
  34. moai_adk/core/quality/validators/__init__.py +1 -1
  35. moai_adk/core/quality/validators/base_validator.py +1 -1
  36. moai_adk/core/tags/__init__.py +86 -0
  37. moai_adk/core/tags/auto_corrector.py +693 -0
  38. moai_adk/core/tags/ci_validator.py +463 -0
  39. moai_adk/core/tags/cli.py +283 -0
  40. moai_adk/core/tags/generator.py +109 -0
  41. moai_adk/core/tags/inserter.py +99 -0
  42. moai_adk/core/tags/mapper.py +126 -0
  43. moai_adk/core/tags/parser.py +76 -0
  44. moai_adk/core/tags/policy_validator.py +580 -0
  45. moai_adk/core/tags/pre_commit_validator.py +421 -0
  46. moai_adk/core/tags/reporter.py +956 -0
  47. moai_adk/core/tags/rollback_manager.py +525 -0
  48. moai_adk/core/tags/tags.py +149 -0
  49. moai_adk/core/tags/validator.py +897 -0
  50. moai_adk/core/template/__init__.py +1 -1
  51. moai_adk/core/template/backup.py +1 -1
  52. moai_adk/core/template/merger.py +50 -1
  53. moai_adk/core/template/processor.py +119 -13
  54. moai_adk/core/template_engine.py +268 -0
  55. moai_adk/templates/.claude/agents/alfred/backend-expert.md +348 -0
  56. moai_adk/templates/.claude/agents/alfred/cc-manager.md +209 -944
  57. moai_adk/templates/.claude/agents/alfred/database-expert.md +352 -0
  58. moai_adk/templates/.claude/agents/alfred/debug-helper.md +34 -5
  59. moai_adk/templates/.claude/agents/alfred/devops-expert.md +464 -0
  60. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +38 -8
  61. moai_adk/templates/.claude/agents/alfred/format-expert.md +469 -0
  62. moai_adk/templates/.claude/agents/alfred/frontend-expert.md +357 -0
  63. moai_adk/templates/.claude/agents/alfred/git-manager.md +128 -9
  64. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +104 -6
  65. moai_adk/templates/.claude/agents/alfred/project-manager.md +88 -16
  66. moai_adk/templates/.claude/agents/alfred/quality-gate.md +36 -9
  67. moai_adk/templates/.claude/agents/alfred/security-expert.md +270 -0
  68. moai_adk/templates/.claude/agents/alfred/skill-factory.md +865 -0
  69. moai_adk/templates/.claude/agents/alfred/spec-builder.md +214 -43
  70. moai_adk/templates/.claude/agents/alfred/tag-agent.md +111 -9
  71. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +309 -160
  72. moai_adk/templates/.claude/agents/alfred/trust-checker.md +36 -7
  73. moai_adk/templates/.claude/agents/alfred/ui-ux-expert.md +605 -0
  74. moai_adk/templates/.claude/commands/alfred/0-project.md +393 -966
  75. moai_adk/templates/.claude/commands/alfred/1-plan.md +651 -367
  76. moai_adk/templates/.claude/commands/alfred/2-run.md +388 -241
  77. moai_adk/templates/.claude/commands/alfred/3-sync.md +1921 -410
  78. moai_adk/templates/.claude/commands/alfred/9-feedback.md +153 -0
  79. moai_adk/templates/.claude/commands/alfred/release-new.md +3604 -0
  80. moai_adk/templates/.claude/hooks/alfred/core/project.py +484 -20
  81. moai_adk/templates/.claude/hooks/alfred/core/timeout.py +136 -0
  82. moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +108 -0
  83. moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +198 -0
  84. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +14 -6
  85. moai_adk/templates/.claude/hooks/alfred/post_tool__enable_streaming_ui.py +50 -0
  86. moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +93 -0
  87. moai_adk/templates/.claude/hooks/alfred/post_tool__tag_auto_corrector.py +407 -0
  88. moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +99 -0
  89. moai_adk/templates/.claude/hooks/alfred/pre_tool__realtime_tag_monitor.py +335 -0
  90. moai_adk/templates/.claude/hooks/alfred/pre_tool__tag_policy_validator.py +325 -0
  91. moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +93 -0
  92. moai_adk/templates/.claude/hooks/alfred/session_start__auto_cleanup.py +580 -0
  93. moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +298 -0
  94. moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +170 -0
  95. moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/checkpoint.py +3 -3
  96. moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/context.py +5 -5
  97. moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +749 -0
  98. moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +230 -0
  99. moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +198 -0
  100. moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py +21 -0
  101. moai_adk/templates/.claude/hooks/alfred/shared/handlers/daily_analysis.py +351 -0
  102. moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +154 -0
  103. moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +174 -0
  104. moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +87 -0
  105. moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +61 -0
  106. moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +111 -0
  107. moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +1 -0
  108. moai_adk/templates/.claude/hooks/alfred/utils/hook_config.py +94 -0
  109. moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +161 -0
  110. moai_adk/templates/.claude/output-styles/alfred/alfred-moai-adk-beginner.md +267 -0
  111. moai_adk/templates/.claude/output-styles/alfred/keating-personal-tutor.md +440 -0
  112. moai_adk/templates/.claude/output-styles/alfred/r2d2-agentic-coding.md +583 -0
  113. moai_adk/templates/.claude/settings.json +96 -14
  114. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/SKILL.md +70 -0
  115. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/examples.md +62 -0
  116. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/reference.md +242 -0
  117. moai_adk/templates/.claude/skills/moai-alfred-ask-user-questions/SKILL.md +237 -0
  118. moai_adk/templates/.claude/skills/moai-alfred-ask-user-questions/examples.md +871 -0
  119. moai_adk/templates/.claude/skills/moai-alfred-ask-user-questions/reference.md +653 -0
  120. moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/README.md +162 -0
  121. moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/SKILL.md +227 -0
  122. moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/examples.md +354 -0
  123. moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/reference.md +158 -0
  124. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +179 -79
  125. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/examples.md +117 -0
  126. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/scripts/pre-review-check.sh +62 -0
  127. moai_adk/templates/.claude/skills/moai-alfred-config-schema/SKILL.md +132 -0
  128. moai_adk/templates/.claude/skills/moai-alfred-config-schema/examples.md +28 -0
  129. moai_adk/templates/.claude/skills/moai-alfred-config-schema/reference.md +444 -0
  130. moai_adk/templates/.claude/skills/moai-alfred-context-budget/SKILL.md +62 -0
  131. moai_adk/templates/.claude/skills/moai-alfred-context-budget/examples.md +28 -0
  132. moai_adk/templates/.claude/skills/moai-alfred-context-budget/reference.md +405 -0
  133. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/SKILL.md +51 -0
  134. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/examples.md +355 -0
  135. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/reference.md +239 -0
  136. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/SKILL.md +323 -0
  137. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/examples.md +286 -0
  138. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/reference.md +126 -0
  139. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/SKILL.md +229 -0
  140. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/examples.md +4 -0
  141. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/reference.md +150 -0
  142. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +87 -73
  143. moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +29 -0
  144. moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +28 -0
  145. moai_adk/templates/.claude/skills/moai-alfred-personas/README.md +42 -0
  146. moai_adk/templates/.claude/skills/moai-alfred-personas/SKILL.md +429 -0
  147. moai_adk/templates/.claude/skills/moai-alfred-personas/examples.md +520 -0
  148. moai_adk/templates/.claude/skills/moai-alfred-personas/reference.md +405 -0
  149. moai_adk/templates/.claude/skills/moai-alfred-practices/SKILL.md +89 -0
  150. moai_adk/templates/.claude/skills/moai-alfred-practices/examples.md +122 -0
  151. moai_adk/templates/.claude/skills/moai-alfred-practices/reference.md +369 -0
  152. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/SKILL.md +508 -0
  153. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/examples.md +481 -0
  154. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/reference.md +100 -0
  155. moai_adk/templates/.claude/skills/moai-alfred-rules/SKILL.md +77 -0
  156. moai_adk/templates/.claude/skills/moai-alfred-rules/examples.md +265 -0
  157. moai_adk/templates/.claude/skills/moai-alfred-rules/reference.md +539 -0
  158. moai_adk/templates/.claude/skills/moai-alfred-session-state/SKILL.md +320 -0
  159. moai_adk/templates/.claude/skills/moai-alfred-session-state/examples.md +4 -0
  160. moai_adk/templates/.claude/skills/moai-alfred-session-state/reference.md +84 -0
  161. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/README.md +137 -0
  162. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/SKILL.md +219 -0
  163. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples/validate-spec.sh +161 -0
  164. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples.md +541 -0
  165. moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/reference.md +622 -0
  166. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/SKILL.md +19 -0
  167. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/examples.md +4 -0
  168. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/reference.md +211 -0
  169. moai_adk/templates/.claude/skills/moai-alfred-workflow/SKILL.md +288 -0
  170. moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +269 -0
  171. moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +32 -0
  172. moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +298 -0
  173. moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +26 -0
  174. moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +307 -0
  175. moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +21 -0
  176. moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +252 -0
  177. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +19 -0
  178. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +19 -0
  179. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +24 -0
  180. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +199 -0
  181. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +39 -0
  182. moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +316 -0
  183. moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +18 -0
  184. moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +263 -0
  185. moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +30 -0
  186. moai_adk/templates/.claude/skills/moai-cc-skill-factory/CHECKLIST.md +482 -0
  187. moai_adk/templates/.claude/skills/moai-cc-skill-factory/EXAMPLES.md +303 -0
  188. moai_adk/templates/.claude/skills/moai-cc-skill-factory/INTERACTIVE-DISCOVERY.md +524 -0
  189. moai_adk/templates/.claude/skills/moai-cc-skill-factory/METADATA.md +477 -0
  190. moai_adk/templates/.claude/skills/moai-cc-skill-factory/PARALLEL-ANALYSIS-REPORT.md +429 -0
  191. moai_adk/templates/.claude/skills/moai-cc-skill-factory/PYTHON-VERSION-MATRIX.md +391 -0
  192. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-FACTORY-WORKFLOW.md +431 -0
  193. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-UPDATE-ADVISOR.md +577 -0
  194. moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL.md +273 -0
  195. moai_adk/templates/.claude/skills/moai-cc-skill-factory/STEP-BY-STEP-GUIDE.md +466 -0
  196. moai_adk/templates/.claude/skills/moai-cc-skill-factory/STRUCTURE.md +583 -0
  197. moai_adk/templates/.claude/skills/moai-cc-skill-factory/WEB-RESEARCH.md +526 -0
  198. moai_adk/templates/.claude/skills/moai-cc-skill-factory/reference.md +608 -0
  199. moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/generate-structure.sh +328 -0
  200. moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/validate-skill.sh +312 -0
  201. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/SKILL_TEMPLATE.md +245 -0
  202. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/examples-template.md +285 -0
  203. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/reference-template.md +278 -0
  204. moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/scripts-template.sh +303 -0
  205. moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +291 -0
  206. moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +15 -0
  207. moai_adk/templates/.claude/skills/moai-change-logger/SKILL.md +563 -0
  208. moai_adk/templates/.claude/skills/moai-design-systems/SKILL.md +802 -0
  209. moai_adk/templates/.claude/skills/moai-design-systems/examples.md +1238 -0
  210. moai_adk/templates/.claude/skills/moai-design-systems/reference.md +673 -0
  211. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +234 -43
  212. moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +1633 -0
  213. moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +660 -0
  214. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +97 -69
  215. moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +29 -0
  216. moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +30 -0
  217. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +97 -72
  218. moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +29 -0
  219. moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +30 -0
  220. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +97 -74
  221. moai_adk/templates/.claude/skills/moai-domain-database/examples.md +29 -0
  222. moai_adk/templates/.claude/skills/moai-domain-database/reference.md +30 -0
  223. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +98 -74
  224. moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +29 -0
  225. moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +31 -0
  226. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +102 -73
  227. moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +29 -0
  228. moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +31 -0
  229. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +97 -73
  230. moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +29 -0
  231. moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +30 -0
  232. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +97 -67
  233. moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +29 -0
  234. moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +30 -0
  235. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +97 -79
  236. moai_adk/templates/.claude/skills/moai-domain-security/examples.md +29 -0
  237. moai_adk/templates/.claude/skills/moai-domain-security/reference.md +30 -0
  238. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -71
  239. moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +29 -0
  240. moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +30 -0
  241. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +265 -64
  242. moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +1064 -0
  243. moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +1047 -0
  244. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +87 -78
  245. moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +29 -0
  246. moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +28 -0
  247. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +87 -70
  248. moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +29 -0
  249. moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +28 -0
  250. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +87 -86
  251. moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +29 -0
  252. moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +28 -0
  253. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +80 -62
  254. moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +29 -0
  255. moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +28 -0
  256. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +207 -50
  257. moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +29 -0
  258. moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +29 -0
  259. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +90 -71
  260. moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +29 -0
  261. moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +28 -0
  262. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +78 -58
  263. moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +29 -0
  264. moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +28 -0
  265. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +78 -51
  266. moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +29 -0
  267. moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +28 -0
  268. moai_adk/templates/.claude/skills/moai-foundation-trust/.!11330!examples.md +0 -0
  269. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +253 -32
  270. moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
  271. moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +1099 -0
  272. moai_adk/templates/.claude/skills/moai-jit-docs-enhanced/SKILL.md +460 -0
  273. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +98 -74
  274. moai_adk/templates/.claude/skills/moai-lang-c/examples.md +29 -0
  275. moai_adk/templates/.claude/skills/moai-lang-c/reference.md +31 -0
  276. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +98 -76
  277. moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +29 -0
  278. moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +31 -0
  279. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +2358 -70
  280. moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +29 -0
  281. moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +30 -0
  282. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +2962 -68
  283. moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +29 -0
  284. moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +30 -0
  285. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +1898 -70
  286. moai_adk/templates/.claude/skills/moai-lang-go/examples.md +29 -0
  287. moai_adk/templates/.claude/skills/moai-lang-go/reference.md +31 -0
  288. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +1465 -68
  289. moai_adk/templates/.claude/skills/moai-lang-java/examples.md +29 -0
  290. moai_adk/templates/.claude/skills/moai-lang-java/reference.md +31 -0
  291. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +2364 -66
  292. moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +29 -0
  293. moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +32 -0
  294. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +1630 -69
  295. moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +29 -0
  296. moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +31 -0
  297. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +89 -61
  298. moai_adk/templates/.claude/skills/moai-lang-php/examples.md +29 -0
  299. moai_adk/templates/.claude/skills/moai-lang-php/reference.md +30 -0
  300. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +735 -66
  301. moai_adk/templates/.claude/skills/moai-lang-python/examples.md +624 -0
  302. moai_adk/templates/.claude/skills/moai-lang-python/reference.md +316 -0
  303. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +97 -73
  304. moai_adk/templates/.claude/skills/moai-lang-r/examples.md +29 -0
  305. moai_adk/templates/.claude/skills/moai-lang-r/reference.md +30 -0
  306. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +98 -73
  307. moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +29 -0
  308. moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +31 -0
  309. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +1834 -70
  310. moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +29 -0
  311. moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +31 -0
  312. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +99 -74
  313. moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +29 -0
  314. moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +30 -0
  315. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +97 -74
  316. moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +29 -0
  317. moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +30 -0
  318. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +98 -74
  319. moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +29 -0
  320. moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +31 -0
  321. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +1959 -69
  322. moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +29 -0
  323. moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +30 -0
  324. moai_adk/templates/.claude/skills/moai-lang-template/SKILL.md +348 -0
  325. moai_adk/templates/.claude/skills/moai-lang-template/VARIABLES.md +98 -0
  326. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +1230 -66
  327. moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +29 -0
  328. moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +34 -0
  329. moai_adk/templates/.claude/skills/moai-learning-optimizer/SKILL.md +575 -0
  330. moai_adk/templates/.claude/skills/moai-project-batch-questions/README.md +50 -0
  331. moai_adk/templates/.claude/skills/moai-project-batch-questions/SKILL.md +304 -0
  332. moai_adk/templates/.claude/skills/moai-project-batch-questions/examples.md +417 -0
  333. moai_adk/templates/.claude/skills/moai-project-batch-questions/reference.md +704 -0
  334. moai_adk/templates/.claude/skills/moai-project-config-manager/README.md +87 -0
  335. moai_adk/templates/.claude/skills/moai-project-config-manager/SKILL.md +552 -0
  336. moai_adk/templates/.claude/skills/moai-project-config-manager/examples.md +1109 -0
  337. moai_adk/templates/.claude/skills/moai-project-config-manager/reference.md +514 -0
  338. moai_adk/templates/.claude/skills/moai-project-config-manager/validate.py +106 -0
  339. moai_adk/templates/.claude/skills/moai-project-documentation/README.md +11 -0
  340. moai_adk/templates/.claude/skills/moai-project-documentation/SKILL.md +622 -0
  341. moai_adk/templates/.claude/skills/moai-project-documentation/examples.md +20 -0
  342. moai_adk/templates/.claude/skills/moai-project-documentation/reference.md +12 -0
  343. moai_adk/templates/.claude/skills/moai-project-language-initializer/README.md +152 -0
  344. moai_adk/templates/.claude/skills/moai-project-language-initializer/SKILL.md +285 -0
  345. moai_adk/templates/.claude/skills/moai-project-language-initializer/examples.md +333 -0
  346. moai_adk/templates/.claude/skills/moai-project-language-initializer/reference.md +386 -0
  347. moai_adk/templates/.claude/skills/moai-project-template-optimizer/README.md +49 -0
  348. moai_adk/templates/.claude/skills/moai-project-template-optimizer/SKILL.md +319 -0
  349. moai_adk/templates/.claude/skills/moai-project-template-optimizer/examples.md +58 -0
  350. moai_adk/templates/.claude/skills/moai-project-template-optimizer/reference.md +123 -0
  351. moai_adk/templates/.claude/skills/moai-session-info/SKILL.md +314 -0
  352. moai_adk/templates/.claude/skills/moai-streaming-ui/SKILL.md +552 -0
  353. moai_adk/templates/.claude/skills/moai-tag-policy-validator/SKILL.md +570 -0
  354. moai_adk/templates/.git-hooks/pre-commit +66 -0
  355. moai_adk/templates/.git-hooks/pre-push +255 -0
  356. moai_adk/templates/.github/workflows/c-tag-validation.yml +11 -0
  357. moai_adk/templates/.github/workflows/cpp-tag-validation.yml +11 -0
  358. moai_adk/templates/.github/workflows/csharp-tag-validation.yml +11 -0
  359. moai_adk/templates/.github/workflows/dart-tag-validation.yml +11 -0
  360. moai_adk/templates/.github/workflows/go-tag-validation.yml +130 -0
  361. moai_adk/templates/.github/workflows/java-tag-validation.yml +11 -0
  362. moai_adk/templates/.github/workflows/javascript-tag-validation.yml +135 -0
  363. moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +11 -0
  364. moai_adk/templates/.github/workflows/moai-gitflow.yml +166 -3
  365. moai_adk/templates/.github/workflows/moai-release-create.yml +100 -0
  366. moai_adk/templates/.github/workflows/moai-release-pipeline.yml +188 -0
  367. moai_adk/templates/.github/workflows/php-tag-validation.yml +11 -0
  368. moai_adk/templates/.github/workflows/python-tag-validation.yml +118 -0
  369. moai_adk/templates/.github/workflows/release.yml +118 -0
  370. moai_adk/templates/.github/workflows/ruby-tag-validation.yml +11 -0
  371. moai_adk/templates/.github/workflows/rust-tag-validation.yml +11 -0
  372. moai_adk/templates/.github/workflows/shell-tag-validation.yml +11 -0
  373. moai_adk/templates/.github/workflows/spec-issue-sync.yml +338 -0
  374. moai_adk/templates/.github/workflows/swift-tag-validation.yml +11 -0
  375. moai_adk/templates/.github/workflows/tag-report.yml +269 -0
  376. moai_adk/templates/.github/workflows/tag-validation.yml +186 -0
  377. moai_adk/templates/.github/workflows/typescript-tag-validation.yml +154 -0
  378. moai_adk/templates/.mcp.json +31 -0
  379. moai_adk/templates/.moai/config.json +80 -7
  380. moai_adk/templates/CLAUDE.md +562 -546
  381. moai_adk/utils/banner.py +5 -5
  382. moai_adk/utils/common.py +294 -0
  383. moai_adk/utils/link_validator.py +235 -0
  384. moai_adk/utils/logger.py +8 -8
  385. moai_adk/utils/user_experience.py +451 -0
  386. moai_adk-0.20.1.dist-info/METADATA +233 -0
  387. moai_adk-0.20.1.dist-info/RECORD +404 -0
  388. moai_adk/templates/.claude/hooks/alfred/README.md +0 -230
  389. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +0 -156
  390. moai_adk/templates/.claude/hooks/alfred/core/__init__.py +0 -85
  391. moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +0 -25
  392. moai_adk/templates/.claude/hooks/alfred/handlers/session.py +0 -92
  393. moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +0 -70
  394. moai_adk/templates/.claude/hooks/alfred/handlers/user.py +0 -41
  395. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +0 -636
  396. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +0 -692
  397. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +0 -470
  398. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +0 -103
  399. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +0 -103
  400. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +0 -95
  401. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +0 -105
  402. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +0 -97
  403. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +0 -97
  404. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +0 -90
  405. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +0 -99
  406. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +0 -87
  407. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +0 -62
  408. moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +0 -94
  409. moai_adk/templates/.claude/skills/moai-claude-code/examples.md +0 -513
  410. moai_adk/templates/.claude/skills/moai-claude-code/reference.md +0 -433
  411. moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +0 -332
  412. moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +0 -384
  413. moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +0 -363
  414. moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +0 -595
  415. moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +0 -496
  416. moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +0 -100
  417. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +0 -99
  418. moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +0 -100
  419. moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +0 -98
  420. moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +0 -98
  421. moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -69
  422. moai_adk/templates/.moai/memory/development-guide.md +0 -344
  423. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +0 -220
  424. moai_adk/templates/.moai/memory/spec-metadata.md +0 -356
  425. moai_adk/templates/.moai/project/product.md +0 -161
  426. moai_adk/templates/.moai/project/structure.md +0 -156
  427. moai_adk/templates/.moai/project/tech.md +0 -227
  428. moai_adk/templates/__init__.py +0 -2
  429. moai_adk-0.4.5.dist-info/METADATA +0 -369
  430. moai_adk-0.4.5.dist-info/RECORD +0 -152
  431. {moai_adk-0.4.5.dist-info → moai_adk-0.20.1.dist-info}/WHEEL +0 -0
  432. {moai_adk-0.4.5.dist-info → moai_adk-0.20.1.dist-info}/entry_points.txt +0 -0
  433. {moai_adk-0.4.5.dist-info → moai_adk-0.20.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,879 @@
1
+ # @CODE:VAL-001
2
+ """TAG chain repair tool for creating missing links.
3
+
4
+ Automatically creates missing SPEC, CODE, and TEST elements to
5
+ restore broken TAG chains based on priority and domain.
6
+
7
+ @SPEC:DOCS-005: TAG 체인 복구 및 자동 생성 도구
8
+ """
9
+
10
+ import re
11
+ from dataclasses import dataclass
12
+ from pathlib import Path
13
+ from typing import Dict, List, Tuple
14
+
15
+ from moai_adk.core.analysis.tag_chain_analyzer import (
16
+ ChainAnalysisResult,
17
+ TagChainAnalyzer,
18
+ )
19
+
20
+
21
+ @dataclass
22
+ class RepairTask:
23
+ """Represents a TAG chain repair task."""
24
+
25
+ domain: str
26
+ number: int
27
+ action: str # "create_spec", "create_code", "create_test"
28
+ priority: str # "high", "medium", "low"
29
+ estimated_effort: str # "low", "medium", "high"
30
+ dependencies: List[str] = None
31
+
32
+ def __post_init__(self):
33
+ if self.dependencies is None:
34
+ self.dependencies = []
35
+
36
+
37
+ @dataclass
38
+ class RepairPlan:
39
+ """Represents a complete TAG chain repair plan."""
40
+
41
+ high_priority_tasks: List[RepairTask]
42
+ medium_priority_tasks: List[RepairTask]
43
+ low_priority_tasks: List[RepairTask]
44
+ summary: Dict[str, int]
45
+
46
+ def get_tasks_by_priority(self) -> List[Tuple[str, List[RepairTask]]]:
47
+ """Get all tasks organized by priority."""
48
+ return [
49
+ ("high", self.high_priority_tasks),
50
+ ("medium", self.medium_priority_tasks),
51
+ ("low", self.low_priority_tasks)
52
+ ]
53
+
54
+
55
+ class TagChainRepairer:
56
+ """Repairs broken TAG chains by creating missing elements."""
57
+
58
+ def __init__(self, root_path: Path = Path(".")):
59
+ self.root_path = root_path
60
+ self.analyzer = TagChainAnalyzer(root_path)
61
+ self.repair_templates = {
62
+ "create_spec": self._create_spec_template,
63
+ "create_code": self._create_code_template,
64
+ "create_test": self._create_test_template,
65
+ }
66
+
67
+ def analyze_and_create_plan(self) -> Tuple[ChainAnalysisResult, RepairPlan]:
68
+ """Analyze TAG chains and create repair plan."""
69
+ result = self.analyzer.analyze_all_chains()
70
+ plan = self._create_repair_plan(result)
71
+ return result, plan
72
+
73
+ def _create_repair_plan(self, result: ChainAnalysisResult) -> RepairPlan:
74
+ """Create repair plan based on analysis result."""
75
+ tasks = []
76
+ summary = {"total_tasks": 0, "high_priority": 0, "medium_priority": 0, "low_priority": 0}
77
+
78
+ # Define high-priority domains
79
+ high_priority_domains = {
80
+ "LDE", "CORE", "INSTALLER", "SEC", "AUTH", "TEST", "VALIDATOR",
81
+ "GIT", "PROJECT", "QUALITY", "PHASE", "INIT", "UPDATE",
82
+ "TEMPLATE", "CONFIG", "LANGUAGE", "DETECT", "NETWORK",
83
+ "VERSION", "CACHE", "HOOK", "CLI", "BACKUP"
84
+ }
85
+
86
+ # Process broken chains
87
+ for detail in result.broken_chain_details:
88
+ domain = detail["domain"]
89
+ missing = detail["missing"]
90
+ number = self._extract_number_from_domain(domain)
91
+
92
+ for element in missing:
93
+ if element == "SPEC":
94
+ task = RepairTask(
95
+ domain=domain,
96
+ number=number,
97
+ action="create_spec",
98
+ priority="high" if domain in high_priority_domains else "medium",
99
+ estimated_effort="medium"
100
+ )
101
+ elif element == "CODE":
102
+ task = RepairTask(
103
+ domain=domain,
104
+ number=number,
105
+ action="create_code",
106
+ priority="high" if domain in high_priority_domains else "medium",
107
+ estimated_effort="medium"
108
+ )
109
+ elif element == "TEST":
110
+ task = RepairTask(
111
+ domain=domain,
112
+ number=number,
113
+ action="create_test",
114
+ priority="high" if domain in high_priority_domains else "medium",
115
+ estimated_effort="low"
116
+ )
117
+ else:
118
+ continue
119
+
120
+ tasks.append(task)
121
+ summary["total_tasks"] += 1
122
+ summary[f"{task.priority}_priority"] += 1
123
+
124
+ # Process orphans
125
+ for orphan_type, orphans in result.orphans_by_type.items():
126
+ for tag in orphans:
127
+ domain = self._extract_domain_from_tag(tag)
128
+ number = self._extract_number_from_domain(domain)
129
+
130
+ if orphan_type == "code_without_spec":
131
+ task = RepairTask(
132
+ domain=domain,
133
+ number=number,
134
+ action="create_spec",
135
+ priority="medium",
136
+ estimated_effort="low"
137
+ )
138
+ elif orphan_type == "code_without_test":
139
+ task = RepairTask(
140
+ domain=domain,
141
+ number=number,
142
+ action="create_test",
143
+ priority="medium",
144
+ estimated_effort="low"
145
+ )
146
+ elif orphan_type == "test_without_code":
147
+ task = RepairTask(
148
+ domain=domain,
149
+ number=number,
150
+ action="create_code",
151
+ priority="high",
152
+ estimated_effort="medium"
153
+ )
154
+ elif orphan_type == "spec_without_code":
155
+ task = RepairTask(
156
+ domain=domain,
157
+ number=number,
158
+ action="create_code",
159
+ priority="high",
160
+ estimated_effort="medium"
161
+ )
162
+ else:
163
+ continue
164
+
165
+ tasks.append(task)
166
+ summary["total_tasks"] += 1
167
+ summary[f"{task.priority}_priority"] += 1
168
+
169
+ # Sort tasks by priority and domain
170
+ tasks.sort(key=lambda x: (
171
+ {"high": 0, "medium": 1, "low": 2}[x.priority],
172
+ x.domain
173
+ ))
174
+
175
+ # Organize by priority
176
+ high_priority = [t for t in tasks if t.priority == "high"]
177
+ medium_priority = [t for t in tasks if t.priority == "medium"]
178
+ low_priority = [t for t in tasks if t.priority == "low"]
179
+
180
+ return RepairPlan(
181
+ high_priority_tasks=high_priority,
182
+ medium_priority_tasks=medium_priority,
183
+ low_priority_tasks=low_priority,
184
+ summary=summary
185
+ )
186
+
187
+ def _extract_number_from_domain(self, domain: str) -> int:
188
+ """Extract number from domain string."""
189
+ # Look for numbers in domain (e.g., "LDE-PRIORITY-001" -> 1)
190
+ match = re.search(r'(\d+)$', domain)
191
+ if match:
192
+ return int(match.group(1))
193
+ return 1
194
+
195
+ def _extract_domain_from_tag(self, tag: str) -> str:
196
+ """Extract domain from TAG."""
197
+ match = re.match(r'@[A-Z]+:([A-Z0-9-]+)\d{3}', tag)
198
+ if match:
199
+ return match.group(1)
200
+ return tag.split(":")[1].rsplit("-", 1)[0]
201
+
202
+ def _create_spec_template(self, domain: str, number: int) -> str:
203
+ """Create SPEC template for given domain and number."""
204
+ spec_id = f"@SPEC:{domain}-{number:03d}"
205
+
206
+ # Domain-specific templates
207
+ if "LDE" in domain:
208
+ return f"""---
209
+ id: {domain.lower().replace('-', '-')}-{number}
210
+ version: 0.1.0
211
+ status: draft
212
+ created: 2025-11-05
213
+ author: @Goos
214
+ priority: high
215
+ category: feature
216
+ labels:
217
+ - lde
218
+ - development
219
+ - enhancement
220
+ ---
221
+
222
+ # {spec_id}
223
+
224
+ ## HISTORY
225
+
226
+ ### v0.1.0 (2025-11-05)
227
+ - **INITIAL**: LDE 기능 개선
228
+ - **AUTHOR**: @Goos
229
+ - **SCOPE**: 개발 경험 및 효율성 향상
230
+
231
+ ---
232
+
233
+ ## Environment (환경)
234
+
235
+ ### 현재 상태
236
+
237
+ ### 가정
238
+
239
+ ### 요구사항
240
+
241
+ ### Ubiquitous Requirements (기본 요구사항)
242
+
243
+ ### Event-driven Requirements (이벤트 기반)
244
+
245
+ ### State-driven Requirements (상태 기반)
246
+
247
+ ### Constraints (제약사항)
248
+
249
+ ---
250
+
251
+ ## Traceability (@TAG)
252
+
253
+ ### 핵심 TAG 체인
254
+
255
+ - **SPEC**: {spec_id}
256
+ - **CODE**: @CODE:{domain}-{number:03d}
257
+ - **TEST**: @TEST:{domain}-{number:03d}
258
+
259
+ ---
260
+
261
+ ## Specifications (상세 명세)
262
+
263
+ ### 1. 기능 명세
264
+
265
+ ### 2. 구현 요구사항
266
+
267
+ ### 3. 테스트 요구사항
268
+
269
+ ---
270
+
271
+ ## 성공 지표
272
+
273
+ ---
274
+
275
+ ## 리스크 및 �난화 방안
276
+
277
+ ---
278
+
279
+ ## 다음 단계
280
+
281
+ **작성일**: 2025-11-05
282
+ **버전**: 0.1.0
283
+ **상태**: Draft
284
+ """
285
+ elif "CORE" in domain:
286
+ return f"""---
287
+ id: core-{domain.lower().replace('-', '-')}-{number}
288
+ version: 0.1.0
289
+ status: draft
290
+ created: 2025-11-05
291
+ author: @Goos
292
+ priority: high
293
+ category: core
294
+ labels:
295
+ - core
296
+ - project
297
+ - infrastructure
298
+ ---
299
+
300
+ # {spec_id}
301
+
302
+ ## HISTORY
303
+
304
+ ### v0.1.0 (2025-11-05)
305
+ - **INITIAL**: 핵심 기능 개선
306
+ - **AUTHOR**: @Goos
307
+ - **SCOPE**: 프로젝트 핵심 인프라 개선
308
+
309
+ ---
310
+
311
+ ## Environment (환경)
312
+
313
+ ### 현재 상태
314
+
315
+ ### 가정
316
+
317
+ ### 요구사항
318
+
319
+ ### Ubiquitous Requirements (기본 요구사항)
320
+
321
+ ### Event-driven Requirements (이벤트 기반)
322
+
323
+ ### State-driven Requirements (상태 기반)
324
+
325
+ ### Constraints (제약사항)
326
+
327
+ ---
328
+
329
+ ## Traceability (@TAG)
330
+
331
+ ### 핵심 TAG 체인
332
+
333
+ - **SPEC**: {spec_id}
334
+ - **CODE**: @CODE:{domain}-{number:03d}
335
+ - **TEST**: @TEST:{domain}-{number:03d}
336
+
337
+ ---
338
+
339
+ ## Specifications (상세 명세)
340
+
341
+ ### 1. 기능 명세
342
+
343
+ ### 2. 구현 요구사항
344
+
345
+ ### 3. 테스트 요구사항
346
+
347
+ ---
348
+
349
+ ## 성공 지표
350
+
351
+ ---
352
+
353
+ ## 리스크 및 완화 방안
354
+
355
+ ---
356
+
357
+ ## 다음 단계
358
+
359
+ **작성일**: 2025-11-05
360
+ **버전**: 0.1.0
361
+ **상태**: Draft
362
+ """
363
+ elif "INSTALLER" in domain:
364
+ return f"""---
365
+ id: installer-{domain.lower().replace('-', '-')}-{number}
366
+ version: 0.1.0
367
+ status: draft
368
+ created: 2025-11-05
369
+ author: @Goos
370
+ priority: high
371
+ category: installer
372
+ labels:
373
+ - installer
374
+ - setup
375
+ - deployment
376
+ ---
377
+
378
+ # {spec_id}
379
+
380
+ ## HISTORY
381
+
382
+ ### v0.1.0 (2025-11-05)
383
+ - **INITIAL**: 설치기 개선
384
+ - **AUTHOR**: @Goos
385
+ - **SCOPE**: 설치 및 배포 프로세스 개선
386
+
387
+ ---
388
+
389
+ ## Environment (환경)
390
+
391
+ ### 현재 상태
392
+
393
+ ### 가정
394
+
395
+ ### 요구사항
396
+
397
+ ### Ubiquitous Requirements (기본 요구사항)
398
+
399
+ ### Event-driven Requirements (이벤트 기반)
400
+
401
+ ### State-driven Requirements (상태 기반)
402
+
403
+ ### Constraints (제약사항)
404
+
405
+ ---
406
+
407
+ ## Traceability (@TAG)
408
+
409
+ ### 핵심 TAG 체인
410
+
411
+ - **SPEC**: {spec_id}
412
+ - **CODE**: @CODE:{domain}-{number:03d}
413
+ - **TEST**: @TEST:{domain}-{number:03d}
414
+
415
+ ---
416
+
417
+ ## Specifications (상세 명세)
418
+
419
+ ### 1. 설치 명세
420
+
421
+ ### 2. 배포 요구사항
422
+
423
+ ### 3. 테스트 요구사항
424
+
425
+ ---
426
+
427
+ ## 성공 지표
428
+
429
+ ---
430
+
431
+ ## 리스크 및 완화 방안
432
+
433
+ ---
434
+
435
+ ## 다음 단계
436
+
437
+ **작성일**: 2025-11-05
438
+ **버전**: 0.1.0
439
+ **상태**: Draft
440
+ """
441
+ else:
442
+ # Generic template
443
+ return f"""---
444
+ id: {domain.lower().replace('-', '-')}-{number}
445
+ version: 0.1.0
446
+ status: draft
447
+ created: 2025-11-05
448
+ author: @Goos
449
+ priority: medium
450
+ category: feature
451
+ labels:
452
+ - {domain.lower()}
453
+ ---
454
+
455
+ # {spec_id}
456
+
457
+ ## HISTORY
458
+
459
+ ### v0.1.0 (2025-11-05)
460
+ - **INITIAL**: {domain} 도메인 기능 개선
461
+ - **AUTHOR**: @Goos
462
+ - **SCOPE**: {domain} 기능 개선 및 유지보수성 향상
463
+
464
+ ---
465
+
466
+ ## Environment (환경)
467
+
468
+ ### 현재 상태
469
+
470
+ ### 가정
471
+
472
+ ### 요구사항
473
+
474
+ ### Ubiquitous Requirements (기본 요구사항)
475
+
476
+ ### Event-driven Requirements (이벤트 기반)
477
+
478
+ ### State-driven Requirements (상태 기반)
479
+
480
+ ### Constraints (제약사항)
481
+
482
+ ---
483
+
484
+ ## Traceability (@TAG)
485
+
486
+ ### 핵심 TAG 체인
487
+
488
+ - **SPEC**: {spec_id}
489
+ - **CODE**: @CODE:{domain}-{number:03d}
490
+ - **TEST**: @TEST:{domain}-{number:03d}
491
+
492
+ ---
493
+
494
+ ## Specifications (상세 명세)
495
+
496
+ ### 1. 기능 명세
497
+
498
+ ### 2. 구현 요구사항
499
+
500
+ ### 3. 테스트 요구사항
501
+
502
+ ---
503
+
504
+ ## 성공 지표
505
+
506
+ ---
507
+
508
+ ## 리스크 및 완화 방안
509
+
510
+ ---
511
+
512
+ ## 다음 단계
513
+
514
+ **작성일**: 2025-11-05
515
+ **버전**: 0.1.0
516
+ **상태**: Draft
517
+ """
518
+
519
+ def _create_code_template(self, domain: str, number: int) -> str:
520
+ """Create CODE template for given domain and number."""
521
+ code_id = f"@CODE:{domain}-{number:03d}"
522
+
523
+ # Determine module based on domain
524
+ if "LDE" in domain:
525
+ module = "lde"
526
+ elif "CORE" in domain:
527
+ module = "core"
528
+ elif "INSTALLER" in domain:
529
+ module = "installer"
530
+ elif "CLI" in domain:
531
+ module = "cli"
532
+ elif "UTILS" in domain:
533
+ module = "utils"
534
+ else:
535
+ module = "core"
536
+
537
+ return f'''# {code_id}
538
+ """{domain} 기능 구현.
539
+
540
+ {domain} 도메인의 핵심 기능을 구현합니다.
541
+
542
+ @SPEC:{domain}-{number:03d}: {domain} 기능 명세
543
+ """
544
+
545
+ from typing import Any, Dict, List, Optional
546
+ from pathlib import Path
547
+
548
+
549
+ def {domain.lower().replace('-', '_')}_function(
550
+ param1: Optional[str] = None,
551
+ param2: Optional[Dict[str, Any]] = None
552
+ ) -> Any:
553
+ """{domain} 핵심 기능.
554
+
555
+ Args:
556
+ param1: 첫 번째 매개변수
557
+ param2: 두 번째 매개변수 (선택적)
558
+
559
+ Returns:
560
+ 처리 결과 객체
561
+
562
+ Examples:
563
+ >>> result = {domain.lower().replace('-', '_')}_function("test", {{"key": "value"}})
564
+ >>> print(result)
565
+ "processed_result"
566
+ """
567
+ if param1 is None:
568
+ param1 = "default_value"
569
+
570
+ if param2 is None:
571
+ param2 = {{}}
572
+
573
+ # 핵심 로직 구현
574
+ result = _process_{domain.lower().replace('-', '_')}_logic(param1, param2)
575
+
576
+ return result
577
+
578
+
579
+ def _process_{domain.lower().replace('-', '_')}_logic(
580
+ input_data: str,
581
+ config: Dict[str, Any]
582
+ ) -> Any:
583
+ """내부 로직 처리.
584
+
585
+ Args:
586
+ input_data: 입력 데이터
587
+ config: 설정 정보
588
+
589
+ Returns:
590
+ 처리된 결과
591
+ """
592
+ # 여기에 {domain} 특화 로직 구현
593
+ processed_data = input_data.upper() if config.get("uppercase", False) else input_data
594
+
595
+ return {{
596
+ "status": "success",
597
+ "input": input_data,
598
+ "output": processed_data,
599
+ "config": config
600
+ }}
601
+
602
+
603
+ def validate_{domain.lower().replace('-', '_')}_input(data: Any) -> bool:
604
+ """입력 데이터 검증.
605
+
606
+ Args:
607
+ data: 검증할 데이터
608
+
609
+ Returns:
610
+ 유효성 검증 결과
611
+ """
612
+ if data is None:
613
+ return False
614
+
615
+ # 여기에 {domain} 특화 검증 로직 추가
616
+ return isinstance(data, (str, dict, list))
617
+
618
+
619
+ # @TEST:{domain}-{number:03d}: 단위 테스트 포함
620
+ if __name__ == "__main__":
621
+ # 간단한 실행 예시
622
+ test_result = {domain.lower().replace('-', '_')}_function("test")
623
+ print(f"Test result: {{test_result}}")
624
+ '''
625
+
626
+ def _create_test_template(self, domain: str, number: int) -> str:
627
+ """Create TEST template for given domain and number."""
628
+ test_id = f"@TEST:{domain}-{number:03d}"
629
+
630
+ # Determine test type based on domain
631
+ if "LDE" in domain:
632
+ test_type = "feature"
633
+ elif "CORE" in domain:
634
+ test_type = "unit"
635
+ elif "INSTALLER" in domain:
636
+ test_type = "integration"
637
+ elif "CLI" in domain:
638
+ test_type = "e2e"
639
+ else:
640
+ test_type = "unit"
641
+
642
+ return f'''# {test_id}
643
+ """{domain} 기능 테스트.
644
+
645
+ {domain} 도메인의 핵심 기능을 검증하기 위한 테스트 코드입니다.
646
+
647
+ @SPEC:{domain}-{number:03d}: {domain} 기능 명세
648
+ @CODE:{domain}-{number:03d}: {domain} 기능 구현
649
+ """
650
+
651
+ import pytest
652
+ from pathlib import Path
653
+ from unittest.mock import Mock, patch
654
+
655
+ from src.moai_adk.{domain.lower().replace('-', '_')}.{domain.lower().replace('-', '_')} import (
656
+ {domain.lower().replace('-', '_')}_function,
657
+ validate_{domain.lower().replace('-', '_')}_input,
658
+ )
659
+
660
+
661
+ class Test{domain.replace('-', '_')}:
662
+ """{domain} 기능 테스트 클래스."""
663
+
664
+ def test_{domain.lower().replace('-', '_')}_function_basic(self):
665
+ """기본 {domain} 기능 테스트."""
666
+ result = {domain.lower().replace('-', '_')}_function("test_input")
667
+
668
+ assert result["status"] == "success"
669
+ assert result["input"] == "test_input"
670
+ assert result["config"] == {{}}
671
+
672
+ def test_{domain.lower().replace('-', '_')}_function_with_params(self):
673
+ """매개변수가 포함된 {domain} 기능 테스트."""
674
+ param2 = {{"key": "value", "uppercase": True}}
675
+ result = {domain.lower().replace('-', '_')}_function("test", param2)
676
+
677
+ assert result["status"] == "success"
678
+ assert result["input"] == "test"
679
+ assert result["output"] == "TEST" # uppercase=True 적용
680
+ assert result["config"] == param2
681
+
682
+ def test_{domain.lower().replace('-', '_')}_function_defaults(self):
683
+ """기본값 사용 테스트."""
684
+ result = {domain.lower().replace('-', '_')}_function()
685
+
686
+ assert result["status"] == "success"
687
+ assert result["input"] == "default_value"
688
+
689
+ def test_validate_{domain.lower().replace('-', '_')}_input_valid(self):
690
+ """유효한 입력 데이터 검증 테스트."""
691
+ assert validate_{domain.lower().replace('-', '_')}_input("valid_string") is True
692
+ assert validate_{domain.lower().replace('-', '_')}_input({{"key": "value"}}) is True
693
+ assert validate_{domain.lower().replace('-', '_')}_input([1, 2, 3]) is True
694
+
695
+ def test_validate_{domain.lower().replace('-', '_')}_input_invalid(self):
696
+ """무효한 입력 데이터 검증 테스트."""
697
+ assert validate_{domain.lower().replace('-', '_')}_input(None) is False
698
+ assert validate_{domain.lower().replace('-', '_')}_input(123) is False
699
+ assert validate_{domain.lower().replace('-', '_')}_input(12.34) is False
700
+
701
+ def test_{domain.lower().replace('-', '_')}_function_error_handling(self):
702
+ """에러 처리 테스트."""
703
+ with pytest.raises(Exception):
704
+ # 예상되는 예외 상황 테스트
705
+ {domain.lower().replace('-', '_')}_function(None, None)
706
+
707
+ @patch('src.moai_adk.{domain.lower().replace('-', '_')}.{domain.lower().replace('-', '_')}._process_{domain.lower().replace('-', '_')}_logic')
708
+ def test_{domain.lower().replace('-', '_')}_function_integration(self, mock_process):
709
+ """통합 테스트."""
710
+ mock_process.return_value = {{"mock": "result"}}
711
+
712
+ result = {domain.lower().replace('-', '_')}_function("test_input")
713
+
714
+ mock_process.assert_called_once_with("test_input", {{}})
715
+ assert result == {{"mock": "result"}}
716
+
717
+
718
+ def test_{domain.lower().replace('-', '_')}_function_edge_cases():
719
+ """경계 조건 테스트."""
720
+ # 빈 문자열 테스트
721
+ result = {domain.lower().replace('-', '_')}_function("")
722
+ assert result["status"] == "success"
723
+ assert result["input"] == ""
724
+
725
+ # 빈 딕셔너리 테스트
726
+ result = {domain.lower().replace('-', '_')}_function("test", {{}})
727
+ assert result["status"] == "success"
728
+ assert result["input"] == "test"
729
+
730
+ # 대규모 데이터 테스트
731
+ large_data = "x" * 10000
732
+ result = {domain.lower().replace('-', '_')}_function(large_data)
733
+ assert result["status"] == "success"
734
+ assert len(result["output"]) == 10000
735
+
736
+
737
+ # @TEST:{domain}-{number:03d}: 테스트 실행
738
+ if __name__ == "__main__":
739
+ pytest.main([__file__, "-v"])
740
+ '''
741
+
742
+ def execute_repair_plan(self, plan: RepairPlan, dry_run: bool = True) -> Dict[str, List[str]]:
743
+ """Execute repair plan (dry run by default)."""
744
+ results = {"created": [], "skipped": [], "errors": []}
745
+
746
+ for priority, tasks in plan.get_tasks_by_priority():
747
+ for task in tasks:
748
+ try:
749
+ if dry_run:
750
+ result = f"[DRY RUN] Would create: {task.action} for {task.domain}-{task.number:03d}"
751
+ results["skipped"].append(result)
752
+ else:
753
+ created_files = self._execute_repair_task(task)
754
+ results["created"].extend(created_files)
755
+ except Exception as e:
756
+ error_msg = f"Error repairing {task.domain}-{task.number:03d}: {str(e)}"
757
+ results["errors"].append(error_msg)
758
+
759
+ return results
760
+
761
+ def _execute_repair_task(self, task: RepairTask) -> List[str]:
762
+ """Execute a single repair task."""
763
+ created_files = []
764
+
765
+ if task.action == "create_spec":
766
+ spec_content = self._create_spec_template(task.domain, task.number)
767
+ spec_path = self.root_path / ".moai" / "specs" / f"spec-{task.domain.lower()}-{task.number:03d}.md"
768
+ spec_path.parent.mkdir(parents=True, exist_ok=True)
769
+ spec_path.write_text(spec_content, encoding='utf-8')
770
+ created_files.append(str(spec_path))
771
+
772
+ elif task.action == "create_code":
773
+ code_content = self._create_code_template(task.domain, task.number)
774
+ # Determine appropriate module path
775
+ if "LDE" in task.domain:
776
+ code_path = self.root_path / "src" / "moai_adk" / "lde" / f"{task.domain.lower()}.py"
777
+ elif "CORE" in task.domain:
778
+ code_path = self.root_path / "src" / "moai_adk" / "core" / f"{task.domain.lower()}.py"
779
+ elif "UTILS" in task.domain:
780
+ code_path = self.root_path / "src" / "moai_adk" / "utils" / f"{task.domain.lower()}.py"
781
+ elif "CLI" in task.domain:
782
+ code_path = self.root_path / "src" / "moai_adk" / "cli" / "commands" / f"{task.domain.lower()}.py"
783
+ else:
784
+ code_path = self.root_path / "src" / "moai_adk" / "core" / f"{task.domain.lower()}.py"
785
+
786
+ code_path.parent.mkdir(parents=True, exist_ok=True)
787
+ code_path.write_text(code_content, encoding='utf-8')
788
+ created_files.append(str(code_path))
789
+
790
+ elif task.action == "create_test":
791
+ test_content = self._create_test_template(task.domain, task.number)
792
+ # Determine appropriate test path
793
+ if "LDE" in task.domain:
794
+ test_path = self.root_path / "tests" / "unit" / "lde" / f"test_{task.domain.lower()}.py"
795
+ elif "CORE" in task.domain:
796
+ test_path = self.root_path / "tests" / "unit" / "core" / f"test_{task.domain.lower()}.py"
797
+ elif "UTILS" in task.domain:
798
+ test_path = self.root_path / "tests" / "unit" / "utils" / f"test_{task.domain.lower()}.py"
799
+ elif "CLI" in task.domain:
800
+ test_path = self.root_path / "tests" / "unit" / "cli" / f"test_{task.domain.lower()}.py"
801
+ else:
802
+ test_path = self.root_path / "tests" / "unit" / f"test_{task.domain.lower()}.py"
803
+
804
+ test_path.parent.mkdir(parents=True, exist_ok=True)
805
+ test_path.write_text(test_content, encoding='utf-8')
806
+ created_files.append(str(test_path))
807
+
808
+ return created_files
809
+
810
+
811
+ def repair_tag_chains(root_path: Path = Path("."), dry_run: bool = True) -> Tuple[ChainAnalysisResult, RepairPlan, Dict[str, List[str]]]:
812
+ """Convenience function to repair TAG chains."""
813
+ repairer = TagChainRepairer(root_path)
814
+ result, plan = repairer.analyze_and_create_plan()
815
+ execution_results = repairer.execute_repair_plan(plan, dry_run)
816
+ return result, plan, execution_results
817
+
818
+
819
+ def main():
820
+ """Main function for CLI usage."""
821
+ import argparse
822
+
823
+ parser = argparse.ArgumentParser(description="Repair TAG chains in MoAI-ADK")
824
+ parser.add_argument("--path", default=".", help="Path to analyze (default: current directory)")
825
+ parser.add_argument("--execute", action="store_true", help="Execute repairs (default: dry run)")
826
+ parser.add_argument("--high-priority-only", action="store_true", help="Only repair high priority items")
827
+ parser.add_argument("--output", help="Output file for JSON report")
828
+
829
+ args = parser.parse_args()
830
+
831
+ result, plan, execution_results = repair_tag_chains(Path(args.path), not args.execute)
832
+
833
+ if args.output:
834
+ import json
835
+ with open(args.output, 'w') as f:
836
+ json.dump({
837
+ "analysis": {
838
+ "total_chains": result.total_chains,
839
+ "complete_chains": result.complete_chains,
840
+ "partial_chains": result.partial_chains,
841
+ "broken_chains": result.broken_chains
842
+ },
843
+ "plan": {
844
+ "summary": plan.summary,
845
+ "high_priority_count": len(plan.high_priority_tasks),
846
+ "medium_priority_count": len(plan.medium_priority_tasks),
847
+ "low_priority_count": len(plan.low_priority_tasks)
848
+ },
849
+ "execution": execution_results
850
+ }, f, indent=2)
851
+ else:
852
+ print("=== TAG Chain Repair Results ===")
853
+ print(f"Analysis: {result.total_chains} total chains, {result.broken_chains} broken ({result.complete_chains} complete)")
854
+ print(f"Plan: {plan.summary['total_tasks']} tasks ({plan.summary['high_priority_priority']} high, {plan.summary['medium_priority_priority']} medium, {plan.summary['low_priority_priority']} low priority)")
855
+
856
+ if args.high_priority_only:
857
+ print("=== High Priority Tasks ===")
858
+ for task in plan.high_priority_tasks:
859
+ print(f"- {task.action.upper()} for {task.domain}-{task.number:03d} ({task.priority} priority)")
860
+ else:
861
+ print("=== All Tasks ===")
862
+ for priority, tasks in plan.get_tasks_by_priority():
863
+ print(f"\n{priority.upper()} Priority ({len(tasks)} tasks):")
864
+ for task in tasks:
865
+ print(f"- {task.action.upper()} for {task.domain}-{task.number:03d}")
866
+
867
+ print("\n=== Execution Results ===")
868
+ print(f"Created: {len(execution_results['created'])} files")
869
+ print(f"Skipped (dry run): {len(execution_results['skipped'])}")
870
+ print(f"Errors: {len(execution_results['errors'])}")
871
+
872
+ if execution_results['errors']:
873
+ print("\nErrors:")
874
+ for error in execution_results['errors']:
875
+ print(f"- {error}")
876
+
877
+
878
+ if __name__ == "__main__":
879
+ main()