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,433 +0,0 @@
1
- #!/usr/bin/env python3
2
- # @CODE:DOC-TAG-004 | Component 2: CI/CD pipeline TAG validator
3
- """CI/CD TAG validation module for GitHub Actions
4
-
5
- This module extends PreCommitValidator for CI/CD environments:
6
- - Fetches PR changed files via GitHub API
7
- - Generates structured validation reports (JSON/markdown)
8
- - Posts validation results as PR comments
9
- - Supports strict mode (block merge on warnings) and info mode
10
-
11
- Used by GitHub Actions workflow to validate TAGs on every PR.
12
- """
13
-
14
- import json
15
- import os
16
- from typing import Any, Dict, List, Optional
17
-
18
- import requests
19
-
20
- from .pre_commit_validator import (
21
- PreCommitValidator,
22
- ValidationResult,
23
- )
24
-
25
-
26
- class CIValidator(PreCommitValidator):
27
- """CI/CD TAG validator for GitHub Actions
28
-
29
- Extends PreCommitValidator with CI/CD-specific features:
30
- - GitHub API integration for PR file detection
31
- - Structured report generation for automation
32
- - Markdown comment formatting for PR feedback
33
- - Environment variable support for GitHub Actions
34
-
35
- Args:
36
- github_token: GitHub API token (default: from GITHUB_TOKEN env)
37
- repo_owner: Repository owner (default: from GITHUB_REPOSITORY env)
38
- repo_name: Repository name (default: from GITHUB_REPOSITORY env)
39
- strict_mode: Treat warnings as errors
40
- check_orphans: Enable orphan TAG detection
41
- tag_pattern: Custom TAG regex pattern
42
- """
43
-
44
- def __init__(
45
- self,
46
- github_token: Optional[str] = None,
47
- repo_owner: Optional[str] = None,
48
- repo_name: Optional[str] = None,
49
- strict_mode: bool = False,
50
- check_orphans: bool = True,
51
- tag_pattern: Optional[str] = None
52
- ):
53
- super().__init__(strict_mode, check_orphans, tag_pattern)
54
-
55
- # GitHub configuration from environment or parameters
56
- self.github_token = github_token or os.environ.get('GITHUB_TOKEN', '')
57
-
58
- # Parse repo info from GITHUB_REPOSITORY (format: "owner/repo")
59
- repo_full = os.environ.get('GITHUB_REPOSITORY', '')
60
- if '/' in repo_full and not repo_owner and not repo_name:
61
- parts = repo_full.split('/', 1)
62
- self.repo_owner = parts[0]
63
- self.repo_name = parts[1]
64
- else:
65
- self.repo_owner = repo_owner or ''
66
- self.repo_name = repo_name or ''
67
-
68
- def get_pr_changed_files(self, pr_number: int) -> List[str]:
69
- """Fetch list of changed files in a PR via GitHub API
70
-
71
- Args:
72
- pr_number: Pull request number
73
-
74
- Returns:
75
- List of relative file paths changed in the PR
76
- """
77
- if not self.github_token or not self.repo_owner or not self.repo_name:
78
- return []
79
-
80
- url = (
81
- f"https://api.github.com/repos/"
82
- f"{self.repo_owner}/{self.repo_name}/pulls/{pr_number}/files"
83
- )
84
-
85
- headers = {
86
- 'Authorization': f'Bearer {self.github_token}',
87
- 'Accept': 'application/vnd.github.v3+json'
88
- }
89
-
90
- try:
91
- response = requests.get(url, headers=headers, timeout=10)
92
- response.raise_for_status()
93
-
94
- files_data = response.json()
95
- return [file_info['filename'] for file_info in files_data]
96
-
97
- except Exception:
98
- # Return empty list on any error (network, auth, etc.)
99
- return []
100
-
101
- def validate_pr_changes(
102
- self,
103
- pr_number: int,
104
- base_branch: str = "main"
105
- ) -> ValidationResult:
106
- """Validate TAG annotations in PR changed files
107
-
108
- Main CI/CD validation method:
109
- 1. Fetch changed files from GitHub API
110
- 2. Run validation checks on those files
111
- 3. Return structured validation result
112
-
113
- Args:
114
- pr_number: Pull request number
115
- base_branch: Base branch name (not used currently)
116
-
117
- Returns:
118
- ValidationResult with errors and warnings
119
- """
120
- # Get PR changed files
121
- files = self.get_pr_changed_files(pr_number)
122
-
123
- if not files:
124
- return ValidationResult(is_valid=True)
125
-
126
- # Validate the changed files
127
- return self.validate_files(files)
128
-
129
- def generate_report(self, result: ValidationResult) -> Dict[str, Any]:
130
- """Generate structured validation report
131
-
132
- Creates JSON-serializable report with:
133
- - Status (success/failure/success_with_warnings)
134
- - Error details (message, tag, locations)
135
- - Warning details (message, tag, location)
136
- - Statistics (counts)
137
- - Configuration (strict_mode)
138
-
139
- Args:
140
- result: ValidationResult from validation
141
-
142
- Returns:
143
- Dictionary with structured report data
144
- """
145
- # Determine status
146
- if not result.is_valid:
147
- status = 'failure'
148
- elif result.warnings:
149
- status = 'success_with_warnings'
150
- else:
151
- status = 'success'
152
-
153
- # Build error list
154
- errors = []
155
- for error in result.errors:
156
- errors.append({
157
- 'message': error.message,
158
- 'tag': error.tag,
159
- 'locations': [
160
- {'file': filepath, 'line': line_num}
161
- for filepath, line_num in error.locations
162
- ]
163
- })
164
-
165
- # Build warning list
166
- warnings = []
167
- for warning in result.warnings:
168
- warnings.append({
169
- 'message': warning.message,
170
- 'tag': warning.tag,
171
- 'location': {
172
- 'file': warning.location[0],
173
- 'line': warning.location[1]
174
- }
175
- })
176
-
177
- # Calculate statistics
178
- statistics = {
179
- 'total_errors': len(result.errors),
180
- 'total_warnings': len(result.warnings),
181
- 'total_issues': len(result.errors) + len(result.warnings)
182
- }
183
-
184
- # Build complete report
185
- report = {
186
- 'status': status,
187
- 'is_valid': result.is_valid,
188
- 'strict_mode': self.strict_mode,
189
- 'summary': self._generate_summary(result),
190
- 'errors': errors,
191
- 'warnings': warnings,
192
- 'statistics': statistics
193
- }
194
-
195
- return report
196
-
197
- def _generate_summary(self, result: ValidationResult) -> str:
198
- """Generate human-readable summary text
199
-
200
- Args:
201
- result: ValidationResult
202
-
203
- Returns:
204
- Summary string
205
- """
206
- if result.is_valid and not result.warnings:
207
- return "All TAG validations passed. No issues found."
208
- elif result.is_valid and result.warnings:
209
- return f"Validation passed with {len(result.warnings)} warning(s)."
210
- else:
211
- return f"Validation failed with {len(result.errors)} error(s)."
212
-
213
- def format_pr_comment(
214
- self,
215
- result: ValidationResult,
216
- pr_url: str
217
- ) -> str:
218
- """Format validation result as markdown PR comment
219
-
220
- Creates formatted markdown comment with:
221
- - Status indicator (emoji)
222
- - Summary message
223
- - Error/warning table
224
- - Action items
225
- - Documentation links
226
-
227
- Args:
228
- result: ValidationResult from validation
229
- pr_url: URL of the pull request
230
-
231
- Returns:
232
- Markdown-formatted comment string
233
- """
234
- lines = []
235
-
236
- # Header with status indicator
237
- if result.is_valid and not result.warnings:
238
- lines.append("## ✅ TAG Validation Passed")
239
- lines.append("")
240
- lines.append("All TAG annotations are valid. No issues found.")
241
- elif result.is_valid and result.warnings:
242
- lines.append("## ⚠️ TAG Validation Passed with Warnings")
243
- lines.append("")
244
- lines.append(f"Validation passed but found {len(result.warnings)} warning(s).")
245
- else:
246
- lines.append("## ❌ TAG Validation Failed")
247
- lines.append("")
248
- lines.append(f"Found {len(result.errors)} error(s) that must be fixed.")
249
-
250
- lines.append("")
251
-
252
- # Error table
253
- if result.errors:
254
- lines.append("### Errors")
255
- lines.append("")
256
- lines.append("| TAG | Issue | Location |")
257
- lines.append("|-----|-------|----------|")
258
-
259
- for error in result.errors:
260
- tag = error.tag
261
- message = error.message
262
- locations = ', '.join([
263
- f"`{f}:{l}`" for f, l in error.locations[:3]
264
- ])
265
- if len(error.locations) > 3:
266
- locations += f" (+{len(error.locations) - 3} more)"
267
-
268
- lines.append(f"| `{tag}` | {message} | {locations} |")
269
-
270
- lines.append("")
271
-
272
- # Warning table
273
- if result.warnings:
274
- lines.append("### Warnings")
275
- lines.append("")
276
- lines.append("| TAG | Issue | Location |")
277
- lines.append("|-----|-------|----------|")
278
-
279
- for warning in result.warnings:
280
- tag = warning.tag
281
- message = warning.message
282
- location = f"`{warning.location[0]}:{warning.location[1]}`"
283
-
284
- lines.append(f"| `{tag}` | {message} | {location} |")
285
-
286
- lines.append("")
287
-
288
- # Action items
289
- if result.errors or result.warnings:
290
- lines.append("### How to Fix")
291
- lines.append("")
292
-
293
- if result.errors:
294
- lines.append("**Errors (must fix):**")
295
- lines.append("- Remove duplicate TAG declarations")
296
- lines.append("- Ensure TAGs follow format: `@PREFIX:DOMAIN-TYPE-NNN`")
297
- lines.append("")
298
-
299
- if result.warnings:
300
- lines.append("**Warnings (recommended):**")
301
- lines.append("- Add corresponding TEST tags for CODE tags")
302
- lines.append("- Add corresponding CODE tags for TEST tags")
303
- lines.append("- Complete TAG chain: SPEC → CODE → TEST → DOC")
304
- lines.append("")
305
-
306
- # Documentation link
307
- lines.append("---")
308
- lines.append("")
309
- lines.append("📚 **Documentation:** [TAG System Guide](.moai/memory/tag-system-guide.md)")
310
- lines.append("")
311
- lines.append(f"🔗 **PR:** {pr_url}")
312
-
313
- return "\n".join(lines)
314
-
315
- def get_pr_number_from_event(self) -> Optional[int]:
316
- """Extract PR number from GitHub Actions event file
317
-
318
- Reads GITHUB_EVENT_PATH to get PR number from event payload.
319
-
320
- Returns:
321
- PR number or None if not found
322
- """
323
- event_path = os.environ.get('GITHUB_EVENT_PATH')
324
- if not event_path:
325
- return None
326
-
327
- try:
328
- with open(event_path, 'r') as f:
329
- event_data = json.load(f)
330
- return event_data.get('pull_request', {}).get('number')
331
- except Exception:
332
- return None
333
-
334
- def generate_tag_report_link(self, pr_number: int) -> str:
335
- """Generate link to TAG reports for this PR
336
-
337
- Integration point with Component 4 (Reporting).
338
- Provides link to automated TAG reports generated by GitHub Actions.
339
-
340
- Args:
341
- pr_number: Pull request number
342
-
343
- Returns:
344
- Markdown link to TAG reports
345
- """
346
- # Link to GitHub Actions artifacts or docs directory
347
- if self.repo_owner and self.repo_name:
348
- docs_url = (
349
- f"https://github.com/{self.repo_owner}/{self.repo_name}/tree/main/docs"
350
- )
351
- return f"📊 [View TAG Reports]({docs_url})"
352
- else:
353
- return "📊 TAG Reports: See docs/ directory"
354
-
355
-
356
- def main():
357
- """CLI entry point for CI/CD validation"""
358
- import argparse
359
- import sys
360
-
361
- parser = argparse.ArgumentParser(
362
- description="Validate TAG annotations in GitHub PR"
363
- )
364
- parser.add_argument(
365
- "--pr-number",
366
- type=int,
367
- help="Pull request number (default: from GitHub Actions event)"
368
- )
369
- parser.add_argument(
370
- "--strict",
371
- action="store_true",
372
- help="Treat warnings as errors"
373
- )
374
- parser.add_argument(
375
- "--no-orphan-check",
376
- action="store_true",
377
- help="Disable orphan TAG checking"
378
- )
379
- parser.add_argument(
380
- "--output-json",
381
- help="Output report to JSON file"
382
- )
383
- parser.add_argument(
384
- "--output-comment",
385
- help="Output PR comment to file"
386
- )
387
-
388
- args = parser.parse_args()
389
-
390
- validator = CIValidator(
391
- strict_mode=args.strict,
392
- check_orphans=not args.no_orphan_check
393
- )
394
-
395
- # Get PR number
396
- pr_number = args.pr_number
397
- if not pr_number:
398
- pr_number = validator.get_pr_number_from_event()
399
-
400
- if not pr_number:
401
- print("Error: Could not determine PR number", file=sys.stderr)
402
- sys.exit(1)
403
-
404
- # Run validation
405
- result = validator.validate_pr_changes(pr_number)
406
-
407
- # Generate report
408
- report = validator.generate_report(result)
409
-
410
- # Output JSON report if requested
411
- if args.output_json:
412
- with open(args.output_json, 'w') as f:
413
- json.dump(report, f, indent=2)
414
-
415
- # Output PR comment if requested
416
- if args.output_comment:
417
- pr_url = (
418
- f"https://github.com/{validator.repo_owner}/"
419
- f"{validator.repo_name}/pull/{pr_number}"
420
- )
421
- comment = validator.format_pr_comment(result, pr_url)
422
- with open(args.output_comment, 'w') as f:
423
- f.write(comment)
424
-
425
- # Print summary
426
- print(result.format())
427
-
428
- # Exit with error code if validation failed
429
- sys.exit(0 if result.is_valid else 1)
430
-
431
-
432
- if __name__ == "__main__":
433
- main()
@@ -1,283 +0,0 @@
1
- #!/usr/bin/env python3
2
- # @CODE:DOC-TAG-004 | Component 3: CLI utility for TAG validation
3
- """CLI utility for moai-adk validate-tags command
4
-
5
- This module provides a command-line interface to the central TAG validator:
6
- - Validate files or directories
7
- - Generate reports in multiple formats (detailed, summary, JSON)
8
- - Support various validation modes (strict, custom patterns)
9
- - Save reports to files
10
-
11
- Usage:
12
- moai-adk validate-tags .
13
- moai-adk validate-tags --strict src/
14
- moai-adk validate-tags --format json --output report.json
15
- moai-adk validate-tags --no-duplicates --no-orphans
16
- """
17
-
18
- import argparse
19
- import sys
20
- from pathlib import Path
21
- from typing import Optional
22
-
23
- from .validator import (
24
- CentralValidationResult,
25
- CentralValidator,
26
- ValidationConfig,
27
- )
28
-
29
-
30
- def create_parser() -> argparse.ArgumentParser:
31
- """Create argument parser for CLI
32
-
33
- Returns:
34
- ArgumentParser with all CLI options
35
- """
36
- parser = argparse.ArgumentParser(
37
- prog="moai-adk validate-tags",
38
- description="Validate TAG annotations in MoAI-ADK projects",
39
- formatter_class=argparse.RawDescriptionHelpFormatter,
40
- epilog="""
41
- Examples:
42
- moai-adk validate-tags . # Validate entire project
43
- moai-adk validate-tags --strict src/ # Strict validation of src/
44
- moai-adk validate-tags --format json # JSON report output
45
- moai-adk validate-tags --output report.json # Save report to file
46
- moai-adk validate-tags --no-orphans # Disable orphan checking
47
- moai-adk validate-tags --file-types py,js,md # Validate specific file types
48
-
49
- Report Formats:
50
- detailed - Full report with all issues, locations, and suggestions (default)
51
- summary - Concise summary with statistics only
52
- json - Machine-readable JSON format
53
-
54
- Validation Modes:
55
- Normal - Errors block, warnings reported but pass
56
- Strict - Both errors and warnings block (use --strict flag)
57
- """
58
- )
59
-
60
- # Positional argument
61
- parser.add_argument(
62
- "path",
63
- nargs="?",
64
- default=".",
65
- help="Path to file or directory to validate (default: current directory)"
66
- )
67
-
68
- # Validation options
69
- parser.add_argument(
70
- "--strict",
71
- action="store_true",
72
- help="Treat warnings as errors (block on warnings)"
73
- )
74
-
75
- parser.add_argument(
76
- "--no-duplicates",
77
- action="store_true",
78
- help="Disable duplicate TAG checking"
79
- )
80
-
81
- parser.add_argument(
82
- "--no-orphans",
83
- action="store_true",
84
- help="Disable orphan TAG checking"
85
- )
86
-
87
- parser.add_argument(
88
- "--no-chain-check",
89
- action="store_true",
90
- help="Disable TAG chain integrity checking"
91
- )
92
-
93
- # File filtering options
94
- parser.add_argument(
95
- "--file-types",
96
- help="Comma-separated file types to validate (e.g., py,js,ts)"
97
- )
98
-
99
- parser.add_argument(
100
- "--ignore-patterns",
101
- help="Comma-separated glob patterns to ignore (e.g., .git/*,*.pyc)"
102
- )
103
-
104
- # Report options
105
- parser.add_argument(
106
- "--format",
107
- choices=["detailed", "summary", "json"],
108
- default="detailed",
109
- help="Report format (default: detailed)"
110
- )
111
-
112
- parser.add_argument(
113
- "--output",
114
- "-o",
115
- help="Output file path (default: stdout)"
116
- )
117
-
118
- # Quiet mode
119
- parser.add_argument(
120
- "--quiet",
121
- "-q",
122
- action="store_true",
123
- help="Suppress output, only return exit code"
124
- )
125
-
126
- # Version
127
- parser.add_argument(
128
- "--version",
129
- action="version",
130
- version="moai-adk 0.7.0"
131
- )
132
-
133
- return parser
134
-
135
-
136
- def validate_path(path_str: str) -> Optional[Path]:
137
- """Validate that path exists
138
-
139
- Args:
140
- path_str: Path string to validate
141
-
142
- Returns:
143
- Path object if valid, None otherwise
144
- """
145
- path = Path(path_str)
146
- if not path.exists():
147
- print(f"Error: Path does not exist: {path_str}", file=sys.stderr)
148
- return None
149
- return path
150
-
151
-
152
- def create_config_from_args(args: argparse.Namespace) -> ValidationConfig:
153
- """Create ValidationConfig from CLI arguments
154
-
155
- Args:
156
- args: Parsed command-line arguments
157
-
158
- Returns:
159
- ValidationConfig object
160
- """
161
- config = ValidationConfig(
162
- strict_mode=args.strict,
163
- check_duplicates=not args.no_duplicates,
164
- check_orphans=not args.no_orphans,
165
- check_chain_integrity=not args.no_chain_check,
166
- report_format=args.format
167
- )
168
-
169
- # Parse file types if provided
170
- if args.file_types:
171
- config.allowed_file_types = [
172
- ft.strip() for ft in args.file_types.split(",")
173
- ]
174
-
175
- # Parse ignore patterns if provided
176
- if args.ignore_patterns:
177
- config.ignore_patterns = [
178
- pattern.strip() for pattern in args.ignore_patterns.split(",")
179
- ]
180
-
181
- return config
182
-
183
-
184
- def run_validation(path: Path, config: ValidationConfig) -> CentralValidationResult:
185
- """Run validation on path
186
-
187
- Args:
188
- path: Path to validate (file or directory)
189
- config: ValidationConfig object
190
-
191
- Returns:
192
- CentralValidationResult
193
- """
194
- validator = CentralValidator(config=config)
195
-
196
- if path.is_file():
197
- result = validator.validate_files([str(path)])
198
- else:
199
- result = validator.validate_directory(str(path))
200
-
201
- return result
202
-
203
-
204
- def output_report(
205
- result: CentralValidationResult,
206
- validator: CentralValidator,
207
- format: str,
208
- output_file: Optional[str],
209
- quiet: bool
210
- ) -> None:
211
- """Output validation report
212
-
213
- Args:
214
- result: CentralValidationResult
215
- validator: CentralValidator instance
216
- format: Report format (detailed|summary|json)
217
- output_file: Output file path (None for stdout)
218
- quiet: Suppress output if True
219
- """
220
- if quiet:
221
- return
222
-
223
- # Generate report
224
- report = validator.create_report(result, format=format)
225
-
226
- # Output to file or stdout
227
- if output_file:
228
- try:
229
- with open(output_file, 'w') as f:
230
- f.write(report)
231
- print(f"Report saved to: {output_file}", file=sys.stderr)
232
- except Exception as e:
233
- print(f"Error writing report: {e}", file=sys.stderr)
234
- sys.exit(1)
235
- else:
236
- print(report)
237
-
238
-
239
- def main(argv: Optional[list] = None) -> int:
240
- """Main CLI entry point
241
-
242
- Args:
243
- argv: Command-line arguments (default: sys.argv[1:])
244
-
245
- Returns:
246
- Exit code (0 for success, 1 for failure)
247
- """
248
- parser = create_parser()
249
- args = parser.parse_args(argv)
250
-
251
- # Validate path
252
- path = validate_path(args.path)
253
- if path is None:
254
- return 1
255
-
256
- # Create configuration from args
257
- config = create_config_from_args(args)
258
-
259
- # Run validation
260
- try:
261
- result = run_validation(path, config)
262
- except Exception as e:
263
- print(f"Validation error: {e}", file=sys.stderr)
264
- return 1
265
-
266
- # Create validator for report generation
267
- validator = CentralValidator(config=config)
268
-
269
- # Output report
270
- output_report(
271
- result=result,
272
- validator=validator,
273
- format=args.format,
274
- output_file=args.output,
275
- quiet=args.quiet
276
- )
277
-
278
- # Return exit code
279
- return 0 if result.is_valid else 1
280
-
281
-
282
- if __name__ == "__main__":
283
- sys.exit(main())