moai-adk 0.9.1__py3-none-any.whl → 0.11.0__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 (260) hide show
  1. moai_adk/core/project/phase_executor.py +4 -0
  2. moai_adk/core/tags/ci_validator.py +33 -3
  3. moai_adk/core/template_engine.py +6 -2
  4. moai_adk/templates/.git-hooks/pre-push +143 -0
  5. moai_adk/templates/.github/workflows/moai-gitflow.yml +6 -1
  6. moai_adk/templates/.github/workflows/release.yml +6 -2
  7. moai_adk/templates/.github/workflows/tag-validation.yml +57 -8
  8. moai_adk/templates/CLAUDE.md +477 -28
  9. moai_adk/templates/README.md +256 -0
  10. {moai_adk-0.9.1.dist-info → moai_adk-0.11.0.dist-info}/METADATA +740 -90
  11. moai_adk-0.11.0.dist-info/RECORD +77 -0
  12. moai_adk/templates/.claude/agents/alfred/cc-manager.md +0 -316
  13. moai_adk/templates/.claude/agents/alfred/debug-helper.md +0 -208
  14. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +0 -214
  15. moai_adk/templates/.claude/agents/alfred/git-manager.md +0 -406
  16. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +0 -350
  17. moai_adk/templates/.claude/agents/alfred/project-manager.md +0 -273
  18. moai_adk/templates/.claude/agents/alfred/quality-gate.md +0 -343
  19. moai_adk/templates/.claude/agents/alfred/skill-factory.md +0 -865
  20. moai_adk/templates/.claude/agents/alfred/spec-builder.md +0 -287
  21. moai_adk/templates/.claude/agents/alfred/tag-agent.md +0 -287
  22. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +0 -326
  23. moai_adk/templates/.claude/agents/alfred/trust-checker.md +0 -375
  24. moai_adk/templates/.claude/commands/alfred/0-project.md +0 -1189
  25. moai_adk/templates/.claude/commands/alfred/1-plan.md +0 -728
  26. moai_adk/templates/.claude/commands/alfred/2-run.md +0 -545
  27. moai_adk/templates/.claude/commands/alfred/3-sync.md +0 -683
  28. moai_adk/templates/.claude/commands/alfred/9-feedback.md +0 -149
  29. moai_adk/templates/.claude/hooks/alfred/.moai/cache/version-check.json +0 -9
  30. moai_adk/templates/.claude/hooks/alfred/README.md +0 -343
  31. moai_adk/templates/.claude/hooks/alfred/TROUBLESHOOTING.md +0 -471
  32. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +0 -209
  33. moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +0 -198
  34. moai_adk/templates/.claude/hooks/alfred/notification__handle_events.py +0 -102
  35. moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +0 -102
  36. moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +0 -108
  37. moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +0 -102
  38. moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +0 -102
  39. moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +0 -170
  40. moai_adk/templates/.claude/hooks/alfred/shared/core/checkpoint.py +0 -271
  41. moai_adk/templates/.claude/hooks/alfred/shared/core/context.py +0 -67
  42. moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +0 -683
  43. moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +0 -198
  44. moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +0 -198
  45. moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py +0 -21
  46. moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +0 -25
  47. moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +0 -175
  48. moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +0 -90
  49. moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +0 -61
  50. moai_adk/templates/.claude/hooks/alfred/stop__handle_interrupt.py +0 -102
  51. moai_adk/templates/.claude/hooks/alfred/subagent_stop__handle_subagent_end.py +0 -102
  52. moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +0 -120
  53. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +0 -640
  54. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +0 -696
  55. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +0 -474
  56. moai_adk/templates/.claude/settings.json +0 -144
  57. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +0 -113
  58. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/examples.md +0 -29
  59. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/reference.md +0 -28
  60. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +0 -122
  61. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/examples.md +0 -29
  62. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/reference.md +0 -29
  63. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +0 -237
  64. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +0 -615
  65. moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +0 -653
  66. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +0 -113
  67. moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +0 -29
  68. moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +0 -28
  69. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +0 -113
  70. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/examples.md +0 -29
  71. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/reference.md +0 -28
  72. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +0 -113
  73. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/examples.md +0 -29
  74. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/reference.md +0 -28
  75. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +0 -113
  76. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/examples.md +0 -29
  77. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/reference.md +0 -28
  78. moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +0 -269
  79. moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +0 -32
  80. moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +0 -298
  81. moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +0 -26
  82. moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +0 -307
  83. moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +0 -21
  84. moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +0 -252
  85. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +0 -19
  86. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +0 -19
  87. moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +0 -24
  88. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +0 -199
  89. moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +0 -39
  90. moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +0 -316
  91. moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +0 -18
  92. moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +0 -263
  93. moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +0 -30
  94. moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +0 -291
  95. moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +0 -15
  96. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +0 -290
  97. moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +0 -1633
  98. moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +0 -660
  99. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +0 -123
  100. moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +0 -29
  101. moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +0 -30
  102. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +0 -123
  103. moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +0 -29
  104. moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +0 -30
  105. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +0 -123
  106. moai_adk/templates/.claude/skills/moai-domain-database/examples.md +0 -29
  107. moai_adk/templates/.claude/skills/moai-domain-database/reference.md +0 -30
  108. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +0 -124
  109. moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +0 -29
  110. moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +0 -31
  111. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +0 -124
  112. moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +0 -29
  113. moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +0 -31
  114. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +0 -123
  115. moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +0 -29
  116. moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +0 -30
  117. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +0 -123
  118. moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +0 -29
  119. moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +0 -30
  120. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +0 -123
  121. moai_adk/templates/.claude/skills/moai-domain-security/examples.md +0 -29
  122. moai_adk/templates/.claude/skills/moai-domain-security/reference.md +0 -30
  123. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +0 -123
  124. moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +0 -29
  125. moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +0 -30
  126. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +0 -303
  127. moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +0 -1064
  128. moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +0 -1047
  129. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +0 -113
  130. moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +0 -29
  131. moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +0 -28
  132. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +0 -113
  133. moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +0 -29
  134. moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +0 -28
  135. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +0 -113
  136. moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +0 -29
  137. moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +0 -28
  138. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +0 -116
  139. moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +0 -29
  140. moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +0 -28
  141. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +0 -122
  142. moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +0 -29
  143. moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +0 -29
  144. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +0 -113
  145. moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +0 -29
  146. moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +0 -28
  147. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +0 -113
  148. moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +0 -29
  149. moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +0 -28
  150. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +0 -113
  151. moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +0 -29
  152. moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +0 -28
  153. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +0 -307
  154. moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
  155. moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +0 -1099
  156. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +0 -124
  157. moai_adk/templates/.claude/skills/moai-lang-c/examples.md +0 -29
  158. moai_adk/templates/.claude/skills/moai-lang-c/reference.md +0 -31
  159. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +0 -124
  160. moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +0 -29
  161. moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +0 -31
  162. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +0 -123
  163. moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +0 -29
  164. moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +0 -30
  165. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +0 -123
  166. moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +0 -29
  167. moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +0 -30
  168. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +0 -124
  169. moai_adk/templates/.claude/skills/moai-lang-go/examples.md +0 -29
  170. moai_adk/templates/.claude/skills/moai-lang-go/reference.md +0 -31
  171. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +0 -124
  172. moai_adk/templates/.claude/skills/moai-lang-java/examples.md +0 -29
  173. moai_adk/templates/.claude/skills/moai-lang-java/reference.md +0 -31
  174. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +0 -125
  175. moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +0 -29
  176. moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +0 -32
  177. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +0 -124
  178. moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +0 -29
  179. moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +0 -31
  180. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +0 -123
  181. moai_adk/templates/.claude/skills/moai-lang-php/examples.md +0 -29
  182. moai_adk/templates/.claude/skills/moai-lang-php/reference.md +0 -30
  183. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +0 -431
  184. moai_adk/templates/.claude/skills/moai-lang-python/examples.md +0 -624
  185. moai_adk/templates/.claude/skills/moai-lang-python/reference.md +0 -316
  186. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +0 -123
  187. moai_adk/templates/.claude/skills/moai-lang-r/examples.md +0 -29
  188. moai_adk/templates/.claude/skills/moai-lang-r/reference.md +0 -30
  189. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +0 -124
  190. moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +0 -29
  191. moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +0 -31
  192. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +0 -124
  193. moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +0 -29
  194. moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +0 -31
  195. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +0 -123
  196. moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +0 -29
  197. moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +0 -30
  198. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +0 -123
  199. moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +0 -29
  200. moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +0 -30
  201. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +0 -124
  202. moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +0 -29
  203. moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +0 -31
  204. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +0 -123
  205. moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +0 -29
  206. moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +0 -30
  207. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +0 -127
  208. moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +0 -29
  209. moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +0 -34
  210. moai_adk/templates/.claude/skills/moai-skill-factory/CHECKLIST.md +0 -482
  211. moai_adk/templates/.claude/skills/moai-skill-factory/EXAMPLES.md +0 -278
  212. moai_adk/templates/.claude/skills/moai-skill-factory/INTERACTIVE-DISCOVERY.md +0 -524
  213. moai_adk/templates/.claude/skills/moai-skill-factory/METADATA.md +0 -477
  214. moai_adk/templates/.claude/skills/moai-skill-factory/PARALLEL-ANALYSIS-REPORT.md +0 -429
  215. moai_adk/templates/.claude/skills/moai-skill-factory/PYTHON-VERSION-MATRIX.md +0 -391
  216. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-FACTORY-WORKFLOW.md +0 -431
  217. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-UPDATE-ADVISOR.md +0 -577
  218. moai_adk/templates/.claude/skills/moai-skill-factory/SKILL.md +0 -271
  219. moai_adk/templates/.claude/skills/moai-skill-factory/STEP-BY-STEP-GUIDE.md +0 -466
  220. moai_adk/templates/.claude/skills/moai-skill-factory/STRUCTURE.md +0 -583
  221. moai_adk/templates/.claude/skills/moai-skill-factory/WEB-RESEARCH.md +0 -526
  222. moai_adk/templates/.claude/skills/moai-skill-factory/reference.md +0 -465
  223. moai_adk/templates/.claude/skills/moai-skill-factory/scripts/generate-structure.sh +0 -328
  224. moai_adk/templates/.claude/skills/moai-skill-factory/scripts/validate-skill.sh +0 -312
  225. moai_adk/templates/.claude/skills/moai-skill-factory/templates/SKILL_TEMPLATE.md +0 -245
  226. moai_adk/templates/.claude/skills/moai-skill-factory/templates/examples-template.md +0 -285
  227. moai_adk/templates/.claude/skills/moai-skill-factory/templates/reference-template.md +0 -278
  228. moai_adk/templates/.claude/skills/moai-skill-factory/templates/scripts-template.sh +0 -303
  229. moai_adk/templates/.claude/skills/moai-spec-authoring/README.md +0 -137
  230. moai_adk/templates/.claude/skills/moai-spec-authoring/SKILL.md +0 -219
  231. moai_adk/templates/.claude/skills/moai-spec-authoring/examples/validate-spec.sh +0 -161
  232. moai_adk/templates/.claude/skills/moai-spec-authoring/examples.md +0 -541
  233. moai_adk/templates/.claude/skills/moai-spec-authoring/reference.md +0 -622
  234. moai_adk/templates/.github/workflows/tag-report.yml +0 -261
  235. moai_adk/templates/.moai/config.json +0 -113
  236. moai_adk/templates/.moai/docs/quick-issue-creation-guide.md +0 -219
  237. moai_adk/templates/.moai/hooks/install.sh +0 -79
  238. moai_adk/templates/.moai/hooks/pre-commit.sh +0 -66
  239. moai_adk/templates/.moai/memory/CLAUDE-AGENTS-GUIDE.md +0 -208
  240. moai_adk/templates/.moai/memory/CLAUDE-PRACTICES.md +0 -369
  241. moai_adk/templates/.moai/memory/CLAUDE-RULES.md +0 -539
  242. moai_adk/templates/.moai/memory/DEVELOPMENT-GUIDE.md +0 -344
  243. moai_adk/templates/.moai/memory/GITFLOW-PROTECTION-POLICY.md +0 -220
  244. moai_adk/templates/.moai/memory/ISSUE-LABEL-MAPPING.md +0 -150
  245. moai_adk/templates/.moai/memory/SKILLS-DESCRIPTION-POLICY.md +0 -218
  246. moai_adk/templates/.moai/memory/SPEC-METADATA.md +0 -356
  247. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +0 -220
  248. moai_adk/templates/.moai/memory/spec-metadata.md +0 -356
  249. moai_adk/templates/.moai/project/product.md +0 -161
  250. moai_adk/templates/.moai/project/structure.md +0 -156
  251. moai_adk/templates/.moai/project/tech.md +0 -227
  252. moai_adk/templates/src/moai_adk/core/__init__.py +0 -5
  253. moai_adk/templates/src/moai_adk/core/tags/__init__.py +0 -86
  254. moai_adk/templates/src/moai_adk/core/tags/ci_validator.py +0 -433
  255. moai_adk/templates/src/moai_adk/core/tags/cli.py +0 -283
  256. moai_adk/templates/src/moai_adk/core/tags/validator.py +0 -897
  257. moai_adk-0.9.1.dist-info/RECORD +0 -320
  258. {moai_adk-0.9.1.dist-info → moai_adk-0.11.0.dist-info}/WHEEL +0 -0
  259. {moai_adk-0.9.1.dist-info → moai_adk-0.11.0.dist-info}/entry_points.txt +0 -0
  260. {moai_adk-0.9.1.dist-info → moai_adk-0.11.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,198 +0,0 @@
1
- #!/usr/bin/env python3
2
- # @CODE:HOOK-TAG-001 | SPEC: TBD | TEST: tests/hooks/test_tag_validation.py
3
- """TAG validation helpers for MoAI-ADK hooks
4
-
5
- Fast checks used by PreToolUse/PostToolUse to nudge users when
6
- new or modified files are missing required @TAG annotations.
7
-
8
- Configurable rules with sensible defaults:
9
- - Load patterns from .moai/tag-rules.json if present.
10
- - Otherwise, apply default glob patterns (folder names are not hard-coded only).
11
-
12
- Defaults (order matters; first match wins):
13
- 1) SPEC
14
- - .moai/specs/**
15
- - **/SPEC-*/spec.md
16
- 2) TEST
17
- - **/*_test.py, **/test_*.py, **/*.test.* (ts,tsx,js,jsx,go,rs)
18
- - **/*.spec.* (ts,tsx,js,jsx)
19
- - tests/**
20
- 3) DOC
21
- - docs/**/*.md, **/README.md, **/*.api.md
22
- 4) CODE
23
- - Source extensions: .py,.ts,.tsx,.js,.jsx,.go,.rs,.java,.kt,.rb,.php,.c,.cpp,.cs,.swift,.scala
24
- - Excluding TEST patterns
25
-
26
- Notes:
27
- - Best-effort: skip binary/large files and non-target paths
28
- - Do not block execution; return a list of issues for messaging
29
- """
30
-
31
- from __future__ import annotations
32
-
33
- import fnmatch
34
- import json
35
- import subprocess
36
- from dataclasses import dataclass
37
- from pathlib import Path
38
- from typing import Iterable, List, Optional
39
-
40
- DEFAULT_CODE_EXTS = (
41
- ".py", ".ts", ".tsx", ".js", ".jsx", ".go", ".rs",
42
- ".java", ".kt", ".rb", ".php", ".c", ".cpp", ".cs",
43
- ".swift", ".scala"
44
- )
45
-
46
-
47
- @dataclass
48
- class TagIssue:
49
- path: str
50
- expected: str # one of @SPEC, @TEST, @CODE, @DOC
51
- reason: str
52
-
53
-
54
- @dataclass
55
- class Rule:
56
- include: List[str]
57
- expect: str # '@SPEC:' | '@TEST:' | '@CODE:' | '@DOC:'
58
- exclude: List[str]
59
-
60
-
61
- def _load_rules(cwd: str) -> List[Rule]:
62
- """Load tag rules from .moai/tag-rules.json or return defaults.
63
-
64
- Schema example:
65
- {
66
- "rules": [
67
- {"include": ["**/*_test.py", "**/*.test.ts"], "expect": "@TEST:", "exclude": []},
68
- {"include": ["docs/**/*.md", "**/README.md"], "expect": "@DOC:", "exclude": []}
69
- ]
70
- }
71
- """
72
- cfg = Path(cwd) / ".moai" / "tag-rules.json"
73
- if cfg.exists():
74
- try:
75
- data = json.loads(cfg.read_text(encoding="utf-8"))
76
- items = data.get("rules", [])
77
- rules: List[Rule] = []
78
- for it in items:
79
- include = list(it.get("include", []))
80
- expect = str(it.get("expect", ""))
81
- exclude = list(it.get("exclude", []))
82
- if include and expect in ("@SPEC:", "@TEST:", "@CODE:", "@DOC:"):
83
- rules.append(Rule(include=include, expect=expect, exclude=exclude))
84
- if rules:
85
- return rules
86
- except Exception:
87
- pass
88
-
89
- # Defaults (ordered)
90
- return [
91
- Rule(
92
- include=[".moai/specs/**", "**/SPEC-*/spec.md"],
93
- expect="@SPEC:",
94
- exclude=[]
95
- ),
96
- Rule(
97
- include=[
98
- "**/*_test.py", "**/test_*.py", "**/*.test.ts",
99
- "**/*.test.tsx", "**/*.test.js", "**/*.test.jsx",
100
- "**/*.test.go", "**/*.test.rs", "**/*.spec.ts",
101
- "**/*.spec.tsx", "tests/**"
102
- ],
103
- expect="@TEST:",
104
- exclude=[".claude/**"]
105
- ),
106
- Rule(
107
- include=["docs/**/*.md", "**/README.md", "**/*.api.md"],
108
- expect="@DOC:",
109
- exclude=[".claude/**"]
110
- ),
111
- Rule(
112
- include=["**/*"],
113
- expect="@CODE:",
114
- exclude=[
115
- "tests/**", "docs/**", ".moai/**", ".claude/**",
116
- "**/*.md", "**/*.json", "**/*.yml", "**/*.yaml",
117
- "**/*.toml", "**/*.lock", "**/*.svg", "**/*.png",
118
- "**/*.jpg", "**/*.jpeg", "**/*.gif"
119
- ]
120
- ),
121
- ]
122
-
123
-
124
- def _match_any(path: str, patterns: List[str]) -> bool:
125
- return any(fnmatch.fnmatch(path, pat) for pat in patterns)
126
-
127
-
128
- def _needs_tag_str(path_str: str, rules: List[Rule]) -> Optional[str]:
129
- p = path_str
130
- for rule in rules:
131
- if _match_any(p, rule.include) and not _match_any(p, rule.exclude):
132
- if rule.expect == "@CODE:":
133
- # CODE: limit to source-like extensions to reduce noise
134
- if not any(p.endswith(ext) for ext in DEFAULT_CODE_EXTS):
135
- continue
136
- return rule.expect
137
- return None
138
-
139
-
140
- def _has_tag(content: str, expected: str) -> bool:
141
- return expected in content
142
-
143
-
144
- def _iter_recent_changes(cwd: str) -> Iterable[Path]:
145
- root = Path(cwd)
146
- try:
147
- # Staged files
148
- r1 = subprocess.run(
149
- ["git", "diff", "--name-only", "--cached"],
150
- cwd=cwd, capture_output=True, text=True, timeout=1
151
- )
152
- # Modified (unstaged) tracked files
153
- r2 = subprocess.run(
154
- ["git", "ls-files", "-m"],
155
- cwd=cwd, capture_output=True, text=True, timeout=1
156
- )
157
- # Untracked (other) files respecting .gitignore
158
- r3 = subprocess.run(
159
- ["git", "ls-files", "-o", "--exclude-standard"],
160
- cwd=cwd, capture_output=True, text=True, timeout=1
161
- )
162
- names = set()
163
- if r1.returncode == 0:
164
- names.update([line.strip() for line in r1.stdout.splitlines() if line.strip()])
165
- if r2.returncode == 0:
166
- names.update([line.strip() for line in r2.stdout.splitlines() if line.strip()])
167
- if r3.returncode == 0:
168
- names.update([line.strip() for line in r3.stdout.splitlines() if line.strip()])
169
- for n in names:
170
- p = (root / n).resolve()
171
- if p.is_file():
172
- yield p
173
- except Exception:
174
- return []
175
-
176
-
177
- def scan_recent_changes_for_missing_tags(cwd: str) -> list[TagIssue]:
178
- issues: list[TagIssue] = []
179
- rules = _load_rules(cwd)
180
- root = Path(cwd).resolve()
181
- for path in _iter_recent_changes(cwd):
182
- try:
183
- content = path.read_text(encoding="utf-8", errors="ignore")
184
- except Exception:
185
- continue
186
- # compute relative path once and use for matching/excluding
187
- try:
188
- rel = path.resolve().relative_to(root)
189
- rel_s = rel.as_posix()
190
- except Exception:
191
- rel_s = path.name
192
-
193
- expected = _needs_tag_str(rel_s, rules)
194
- if not expected:
195
- continue
196
- if not _has_tag(content, expected):
197
- issues.append(TagIssue(path=rel_s, expected=expected, reason="missing tag"))
198
- return issues
@@ -1,198 +0,0 @@
1
- #!/usr/bin/env python3
2
- # @CODE:VERSION-CACHE-001
3
- """Version information cache with TTL support
4
-
5
- TTL-based caching system for version check results to minimize network calls
6
- during SessionStart hook execution.
7
-
8
- SPEC: SPEC-UPDATE-ENHANCE-001 - SessionStart 버전 체크 시스템 강화
9
- Phase 1: Cache System Implementation
10
- """
11
-
12
- import json
13
- from datetime import datetime, timezone
14
- from pathlib import Path
15
- from typing import Any
16
-
17
-
18
- class VersionCache:
19
- """TTL-based version information cache
20
-
21
- Caches version check results with configurable Time-To-Live (TTL)
22
- to avoid excessive network calls to PyPI during SessionStart events.
23
-
24
- Attributes:
25
- cache_dir: Directory to store cache file
26
- ttl_hours: Time-to-live in hours (default 24)
27
- cache_file: Path to the cache JSON file
28
-
29
- Examples:
30
- >>> cache = VersionCache(Path(".moai/cache"), ttl_hours=24)
31
- >>> cache.save({"current_version": "0.8.1", "latest_version": "0.9.0"})
32
- True
33
- >>> cache.is_valid()
34
- True
35
- >>> data = cache.load()
36
- >>> data["current_version"]
37
- '0.8.1'
38
- """
39
-
40
- def __init__(self, cache_dir: Path, ttl_hours: int = 4):
41
- """Initialize cache with TTL in hours
42
-
43
- Args:
44
- cache_dir: Directory where cache file will be stored
45
- ttl_hours: Time-to-live in hours (default 4)
46
- """
47
- self.cache_dir = Path(cache_dir)
48
- self.ttl_hours = ttl_hours
49
- self.cache_file = self.cache_dir / "version-check.json"
50
-
51
- def _calculate_age_hours(self, last_check_iso: str) -> float:
52
- """Calculate age in hours from ISO timestamp (internal helper)
53
-
54
- Normalizes timezone-aware and naive datetimes for consistent comparison.
55
-
56
- Args:
57
- last_check_iso: ISO format timestamp string
58
-
59
- Returns:
60
- Age in hours
61
-
62
- Raises:
63
- ValueError: If timestamp parsing fails
64
- """
65
- last_check = datetime.fromisoformat(last_check_iso)
66
-
67
- # Normalize to naive datetime (remove timezone for comparison)
68
- if last_check.tzinfo is not None:
69
- last_check = last_check.replace(tzinfo=None)
70
-
71
- now = datetime.now()
72
- return (now - last_check).total_seconds() / 3600
73
-
74
- def is_valid(self) -> bool:
75
- """Check if cache exists and is not expired
76
-
77
- Returns:
78
- True if cache file exists and is within TTL, False otherwise
79
-
80
- Examples:
81
- >>> cache = VersionCache(Path(".moai/cache"))
82
- >>> cache.is_valid()
83
- False # No cache file exists yet
84
- """
85
- if not self.cache_file.exists():
86
- return False
87
-
88
- try:
89
- with open(self.cache_file, 'r') as f:
90
- data = json.load(f)
91
-
92
- age_hours = self._calculate_age_hours(data["last_check"])
93
- return age_hours < self.ttl_hours
94
-
95
- except (json.JSONDecodeError, KeyError, ValueError, OSError):
96
- # Corrupted or invalid cache file
97
- return False
98
-
99
- def load(self) -> dict[str, Any] | None:
100
- """Load cached version info if valid
101
-
102
- Returns:
103
- Cached version info dictionary if valid, None otherwise
104
-
105
- Examples:
106
- >>> cache = VersionCache(Path(".moai/cache"))
107
- >>> data = cache.load()
108
- >>> data is None
109
- True # No valid cache exists
110
- """
111
- if not self.is_valid():
112
- return None
113
-
114
- try:
115
- with open(self.cache_file, 'r') as f:
116
- return json.load(f)
117
- except (json.JSONDecodeError, OSError):
118
- # Graceful degradation on read errors
119
- return None
120
-
121
- def save(self, version_info: dict[str, Any]) -> bool:
122
- """Save version info to cache file
123
-
124
- Creates cache directory if it doesn't exist.
125
- Updates last_check timestamp to current time if not provided.
126
-
127
- Args:
128
- version_info: Version information dictionary to cache
129
-
130
- Returns:
131
- True on successful save, False on error
132
-
133
- Examples:
134
- >>> cache = VersionCache(Path(".moai/cache"))
135
- >>> cache.save({"current_version": "0.8.1"})
136
- True
137
- """
138
- try:
139
- # Create cache directory if it doesn't exist
140
- self.cache_dir.mkdir(parents=True, exist_ok=True)
141
-
142
- # Update last_check timestamp only if not provided (for testing)
143
- if "last_check" not in version_info:
144
- version_info["last_check"] = datetime.now(timezone.utc).isoformat()
145
-
146
- # Write to cache file
147
- with open(self.cache_file, 'w') as f:
148
- json.dump(version_info, f, indent=2)
149
-
150
- return True
151
-
152
- except (OSError, TypeError):
153
- # Graceful degradation on write errors
154
- return False
155
-
156
- def clear(self) -> bool:
157
- """Clear/remove cache file
158
-
159
- Returns:
160
- True if cache file was removed or didn't exist, False on error
161
-
162
- Examples:
163
- >>> cache = VersionCache(Path(".moai/cache"))
164
- >>> cache.clear()
165
- True
166
- """
167
- try:
168
- if self.cache_file.exists():
169
- self.cache_file.unlink()
170
- return True
171
- except OSError:
172
- return False
173
-
174
- def get_age_hours(self) -> float:
175
- """Get age of cache in hours
176
-
177
- Returns:
178
- Age in hours, or 0.0 if cache doesn't exist or is invalid
179
-
180
- Examples:
181
- >>> cache = VersionCache(Path(".moai/cache"))
182
- >>> cache.get_age_hours()
183
- 0.0 # No cache exists
184
- """
185
- if not self.cache_file.exists():
186
- return 0.0
187
-
188
- try:
189
- with open(self.cache_file, 'r') as f:
190
- data = json.load(f)
191
-
192
- return self._calculate_age_hours(data["last_check"])
193
-
194
- except (json.JSONDecodeError, KeyError, ValueError, OSError):
195
- return 0.0
196
-
197
-
198
- __all__ = ["VersionCache"]
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Event handlers for Alfred Hooks
3
-
4
- Claude Code Event Handlers
5
- """
6
-
7
- from .notification import handle_notification, handle_stop, handle_subagent_stop
8
- from .session import handle_session_end, handle_session_start
9
- from .tool import handle_post_tool_use, handle_pre_tool_use
10
- from .user import handle_user_prompt_submit
11
-
12
- __all__ = [
13
- "handle_session_start",
14
- "handle_session_end",
15
- "handle_user_prompt_submit",
16
- "handle_pre_tool_use",
17
- "handle_post_tool_use",
18
- "handle_notification",
19
- "handle_stop",
20
- "handle_subagent_stop",
21
- ]
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Notification and control handlers
3
-
4
- Notification, Stop, SubagentStop event handling
5
- """
6
-
7
- from core import HookPayload, HookResult
8
-
9
-
10
- def handle_notification(payload: HookPayload) -> HookResult:
11
- """Notification event handler (default implementation)"""
12
- return HookResult()
13
-
14
-
15
- def handle_stop(payload: HookPayload) -> HookResult:
16
- """Stop event handler (default implementation)"""
17
- return HookResult()
18
-
19
-
20
- def handle_subagent_stop(payload: HookPayload) -> HookResult:
21
- """SubagentStop event handler (default implementation)"""
22
- return HookResult()
23
-
24
-
25
- __all__ = ["handle_notification", "handle_stop", "handle_subagent_stop"]
@@ -1,175 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Session event handlers
3
-
4
- SessionStart, SessionEnd event handling
5
- """
6
-
7
- from core import HookPayload, HookResult
8
- from core.checkpoint import list_checkpoints
9
- from core.project import count_specs, detect_language, get_git_info, get_package_version_info
10
-
11
-
12
- def handle_session_start(payload: HookPayload) -> HookResult:
13
- """SessionStart event handler with GRACEFUL DEGRADATION
14
-
15
- When Claude Code Session starts, it displays a summary of project status.
16
- You can check the language, Git status, SPEC progress, and checkpoint list at a glance.
17
- All optional operations are wrapped in try-except to ensure hook completes quickly even if
18
- Git commands, file I/O, or other operations timeout or fail.
19
-
20
- Args:
21
- payload: Claude Code event payload (cwd key required)
22
-
23
- Returns:
24
- HookResult(system_message=project status summary message)
25
-
26
- Message Format:
27
- 🚀 MoAI-ADK Session Started
28
- Language: {language}
29
- [Branch: {branch} ({commit hash})] - optional if git fails
30
- [Changes: {Number of Changed Files}] - optional if git fails
31
- [SPEC Progress: {Complete}/{Total} ({percent}%)] - optional if specs fail
32
- [Checkpoints: {number} available] - optional if checkpoint list fails
33
-
34
- Graceful Degradation Strategy:
35
- - CRITICAL: Language detection (must succeed - no try-except)
36
- - OPTIONAL: Git info (skip if timeout/failure)
37
- - OPTIONAL: SPEC progress (skip if timeout/failure)
38
- - OPTIONAL: Checkpoint list (skip if timeout/failure)
39
- - Always display SOMETHING to user, never return empty message
40
-
41
- Note:
42
- - Claude Code processes SessionStart in several stages (clear → compact)
43
- - Display message only at "compact" stage to prevent duplicate output
44
- - "clear" step returns minimal result (empty hookSpecificOutput)
45
- - CRITICAL: All optional operations must complete within 2-3 seconds total
46
-
47
- TDD History:
48
- - RED: Session startup message format test
49
- - GREEN: Generate status message by combining helper functions
50
- - REFACTOR: Improved message format, improved readability, added checkpoint list
51
- - FIX: Prevent duplicate output of clear step (only compact step is displayed)
52
- - UPDATE: Migrated to Claude Code standard Hook schema
53
- - HOTFIX: Add graceful degradation for timeout scenarios (Issue #66)
54
- - Phase 3: Add major version warning and release notes display (@TEST:MAJOR-UPDATE-001-07/08)
55
-
56
- @TAG:CHECKPOINT-EVENT-001
57
- @TAG:HOOKS-TIMEOUT-001
58
- @CODE:MAJOR-UPDATE-WARN-001
59
- """
60
- # Claude Code SessionStart runs in several stages (clear, compact, etc.)
61
- # Ignore the "clear" stage and output messages only at the "compact" stage
62
- event_phase = payload.get("phase", "")
63
- if event_phase == "clear":
64
- # Return minimal valid Hook result for clear phase
65
- return HookResult(continue_execution=True)
66
-
67
- cwd = payload.get("cwd", ".")
68
-
69
- # CRITICAL: Language detection - MUST succeed (no try-except)
70
- language = detect_language(cwd)
71
-
72
- # OPTIONAL: Git info - skip if timeout/failure
73
- git_info = {}
74
- try:
75
- git_info = get_git_info(cwd)
76
- except Exception:
77
- # Graceful degradation - continue without git info
78
- pass
79
-
80
- # OPTIONAL: SPEC progress - skip if timeout/failure
81
- specs = {"completed": 0, "total": 0, "percentage": 0}
82
- try:
83
- specs = count_specs(cwd)
84
- except Exception:
85
- # Graceful degradation - continue without spec info
86
- pass
87
-
88
- # OPTIONAL: Checkpoint list - skip if timeout/failure
89
- checkpoints = []
90
- try:
91
- checkpoints = list_checkpoints(cwd, max_count=10)
92
- except Exception:
93
- # Graceful degradation - continue without checkpoints
94
- pass
95
-
96
- # OPTIONAL: Package version info - skip if timeout/failure
97
- version_info = {}
98
- try:
99
- version_info = get_package_version_info()
100
- except Exception:
101
- # Graceful degradation - continue without version info
102
- pass
103
-
104
- # Build message with available information
105
- branch = git_info.get("branch", "N/A") if git_info else "N/A"
106
- commit = git_info.get("commit", "N/A")[:7] if git_info else "N/A"
107
- changes = git_info.get("changes", 0) if git_info else 0
108
- spec_progress = f"{specs['completed']}/{specs['total']}" if specs["total"] > 0 else "0/0"
109
-
110
- # system_message: displayed directly to the user
111
- lines = [
112
- "🚀 MoAI-ADK Session Started",
113
- "", # Blank line after title
114
- ]
115
-
116
- # Add version info first (at the top, right after title)
117
- if version_info and version_info.get("current") != "unknown":
118
- if version_info.get("update_available"):
119
- # Check if this is a major version update
120
- if version_info.get("is_major_update"):
121
- # Major version warning
122
- lines.append(f" ⚠️ Major version update available: {version_info['current']} → {version_info['latest']}")
123
- lines.append(" Breaking changes detected. Review release notes:")
124
- if version_info.get("release_notes_url"):
125
- lines.append(f" 📝 {version_info['release_notes_url']}")
126
- else:
127
- # Regular update
128
- lines.append(f" 🗿 MoAI-ADK Ver: {version_info['current']} → {version_info['latest']} available ✨")
129
- if version_info.get("release_notes_url"):
130
- lines.append(f" 📝 Release Notes: {version_info['release_notes_url']}")
131
-
132
- # Add upgrade recommendation
133
- if version_info.get("upgrade_command"):
134
- lines.append(f" ⬆️ Upgrade: {version_info['upgrade_command']}")
135
- else:
136
- # No update available - show current version only
137
- lines.append(f" 🗿 MoAI-ADK Ver: {version_info['current']}")
138
-
139
- # Add language info
140
- lines.append(f" 🐍 Language: {language}")
141
-
142
- # Add Git info only if available (not degraded)
143
- if git_info:
144
- lines.append(f" 🌿 Branch: {branch} ({commit})")
145
- lines.append(f" 📝 Changes: {changes}")
146
-
147
- # Add last commit message if available
148
- last_commit = git_info.get("last_commit", "")
149
- if last_commit:
150
- lines.append(f" 🔨 Last: {last_commit}")
151
-
152
- # Add Checkpoint list (show only the latest 3 items)
153
- if checkpoints:
154
- lines.append(f" 🗂️ Checkpoints: {len(checkpoints)} available")
155
- for cp in reversed(checkpoints[-3:]): # Latest 3 items
156
- branch_short = cp["branch"].replace("before-", "")
157
- lines.append(f" 📌 {branch_short}")
158
- lines.append("") # Blank line before restore command
159
- lines.append(" ↩️ Restore: /alfred:0-project restore")
160
-
161
- # Add SPEC progress only if available (not degraded) - at the bottom
162
- if specs["total"] > 0:
163
- lines.append(f" 📋 SPEC Progress: {spec_progress} ({specs['percentage']}%)")
164
-
165
- system_message = "\n".join(lines)
166
-
167
- return HookResult(system_message=system_message)
168
-
169
-
170
- def handle_session_end(payload: HookPayload) -> HookResult:
171
- """SessionEnd event handler (default implementation)"""
172
- return HookResult()
173
-
174
-
175
- __all__ = ["handle_session_start", "handle_session_end"]