moai-adk 0.9.0__py3-none-any.whl → 0.15.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 (186) hide show
  1. moai_adk/cli/commands/init.py +14 -2
  2. moai_adk/cli/commands/update.py +214 -56
  3. moai_adk/core/issue_creator.py +2 -2
  4. moai_adk/core/project/detector.py +201 -12
  5. moai_adk/core/project/initializer.py +62 -1
  6. moai_adk/core/project/phase_executor.py +48 -6
  7. moai_adk/core/tags/ci_validator.py +34 -4
  8. moai_adk/core/tags/pre_commit_validator.py +40 -2
  9. moai_adk/core/tags/reporter.py +2 -3
  10. moai_adk/core/tags/validator.py +1 -1
  11. moai_adk/core/template_engine.py +20 -5
  12. moai_adk/templates/.claude/agents/alfred/backend-expert.md +319 -0
  13. moai_adk/templates/.claude/agents/alfred/devops-expert.md +464 -0
  14. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +1 -1
  15. moai_adk/templates/.claude/agents/alfred/frontend-expert.md +357 -0
  16. moai_adk/templates/.claude/agents/alfred/git-manager.md +2 -2
  17. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +76 -3
  18. moai_adk/templates/.claude/agents/alfred/project-manager.md +49 -10
  19. moai_adk/templates/.claude/agents/alfred/quality-gate.md +3 -3
  20. moai_adk/templates/.claude/agents/alfred/spec-builder.md +108 -3
  21. moai_adk/templates/.claude/agents/alfred/tag-agent.md +74 -0
  22. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +107 -5
  23. moai_adk/templates/.claude/agents/alfred/trust-checker.md +2 -2
  24. moai_adk/templates/.claude/agents/alfred/ui-ux-expert.md +571 -0
  25. moai_adk/templates/.claude/commands/alfred/0-project.md +465 -129
  26. moai_adk/templates/.claude/commands/alfred/1-plan.md +139 -65
  27. moai_adk/templates/.claude/commands/alfred/2-run.md +214 -50
  28. moai_adk/templates/.claude/commands/alfred/3-sync.md +372 -46
  29. moai_adk/templates/.claude/commands/alfred/9-feedback.md +1 -1
  30. moai_adk/templates/.claude/hooks/alfred/core/project.py +25 -27
  31. moai_adk/templates/.claude/hooks/alfred/core/timeout.py +136 -0
  32. moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +108 -0
  33. moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +4 -4
  34. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +29 -0
  35. moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +11 -19
  36. moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +11 -19
  37. moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +11 -19
  38. moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +10 -18
  39. moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +2 -2
  40. moai_adk/templates/.claude/hooks/alfred/shared/core/checkpoint.py +3 -3
  41. moai_adk/templates/.claude/hooks/alfred/shared/core/context.py +5 -5
  42. moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +40 -41
  43. moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +55 -23
  44. moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +4 -4
  45. moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +132 -3
  46. moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +9 -10
  47. moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +3 -6
  48. moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +19 -0
  49. moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +14 -22
  50. moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +1 -0
  51. moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +161 -0
  52. moai_adk/templates/.claude/settings.json +5 -5
  53. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/SKILL.md +70 -0
  54. moai_adk/templates/.claude/skills/moai-alfred-agent-guide/examples.md +62 -0
  55. moai_adk/templates/{.moai/memory/CLAUDE-AGENTS-GUIDE.md → .claude/skills/moai-alfred-agent-guide/reference.md} +34 -0
  56. moai_adk/templates/.claude/skills/moai-alfred-config-schema/SKILL.md +56 -0
  57. moai_adk/templates/.claude/skills/moai-alfred-config-schema/examples.md +28 -0
  58. moai_adk/templates/.claude/skills/moai-alfred-config-schema/reference.md +444 -0
  59. moai_adk/templates/.claude/skills/moai-alfred-context-budget/SKILL.md +62 -0
  60. moai_adk/templates/.claude/skills/moai-alfred-context-budget/examples.md +28 -0
  61. moai_adk/templates/.claude/skills/moai-alfred-context-budget/reference.md +405 -0
  62. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/SKILL.md +51 -0
  63. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/examples.md +355 -0
  64. moai_adk/templates/.claude/skills/moai-alfred-dev-guide/reference.md +239 -0
  65. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/SKILL.md +323 -0
  66. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/examples.md +286 -0
  67. moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/reference.md +126 -0
  68. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/SKILL.md +74 -0
  69. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/examples.md +4 -0
  70. moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/reference.md +269 -0
  71. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/SKILL.md +19 -0
  72. moai_adk/templates/.claude/skills/moai-alfred-issue-labels/examples.md +4 -0
  73. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/SKILL.md +198 -0
  74. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/examples.md +431 -0
  75. moai_adk/templates/.claude/skills/moai-alfred-persona-roles/reference.md +141 -0
  76. moai_adk/templates/.claude/skills/moai-alfred-practices/SKILL.md +89 -0
  77. moai_adk/templates/.claude/skills/moai-alfred-practices/examples.md +122 -0
  78. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/SKILL.md +508 -0
  79. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/examples.md +481 -0
  80. moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/reference.md +100 -0
  81. moai_adk/templates/.claude/skills/moai-alfred-reporting/SKILL.md +273 -0
  82. moai_adk/templates/.claude/skills/moai-alfred-rules/SKILL.md +77 -0
  83. moai_adk/templates/.claude/skills/moai-alfred-rules/examples.md +265 -0
  84. moai_adk/templates/.claude/skills/moai-alfred-session-state/SKILL.md +19 -0
  85. moai_adk/templates/.claude/skills/moai-alfred-session-state/examples.md +4 -0
  86. moai_adk/templates/.claude/skills/moai-alfred-session-state/reference.md +84 -0
  87. moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/SKILL.md +5 -5
  88. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/SKILL.md +115 -0
  89. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/examples.md +4 -0
  90. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/reference.md +348 -0
  91. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/SKILL.md +19 -0
  92. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/examples.md +4 -0
  93. moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/reference.md +211 -0
  94. moai_adk/templates/.claude/skills/moai-alfred-workflow/SKILL.md +288 -0
  95. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/SKILL.md +19 -0
  96. moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/examples.md +4 -0
  97. moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL.md +3 -3
  98. moai_adk/templates/.claude/skills/moai-design-systems/SKILL.md +802 -0
  99. moai_adk/templates/.claude/skills/moai-design-systems/examples.md +1238 -0
  100. moai_adk/templates/.claude/skills/moai-design-systems/reference.md +673 -0
  101. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +17 -13
  102. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +15 -12
  103. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +14 -12
  104. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +14 -11
  105. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +10 -8
  106. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +15 -12
  107. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +13 -11
  108. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +16 -10
  109. moai_adk/templates/.claude/skills/moai-project-documentation.md +622 -0
  110. moai_adk/templates/.git-hooks/pre-push +143 -0
  111. moai_adk/templates/.github/workflows/c-tag-validation.yml +11 -0
  112. moai_adk/templates/.github/workflows/cpp-tag-validation.yml +11 -0
  113. moai_adk/templates/.github/workflows/csharp-tag-validation.yml +11 -0
  114. moai_adk/templates/.github/workflows/dart-tag-validation.yml +11 -0
  115. moai_adk/templates/.github/workflows/go-tag-validation.yml +130 -0
  116. moai_adk/templates/.github/workflows/java-tag-validation.yml +11 -0
  117. moai_adk/templates/.github/workflows/javascript-tag-validation.yml +135 -0
  118. moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +11 -0
  119. moai_adk/templates/.github/workflows/moai-gitflow.yml +182 -25
  120. moai_adk/templates/.github/workflows/moai-release-pipeline.yml +35 -29
  121. moai_adk/templates/.github/workflows/php-tag-validation.yml +11 -0
  122. moai_adk/templates/.github/workflows/python-tag-validation.yml +118 -0
  123. moai_adk/templates/.github/workflows/release.yml +76 -7
  124. moai_adk/templates/.github/workflows/ruby-tag-validation.yml +11 -0
  125. moai_adk/templates/.github/workflows/rust-tag-validation.yml +11 -0
  126. moai_adk/templates/.github/workflows/shell-tag-validation.yml +11 -0
  127. moai_adk/templates/.github/workflows/spec-issue-sync.yml +208 -41
  128. moai_adk/templates/.github/workflows/swift-tag-validation.yml +11 -0
  129. moai_adk/templates/.github/workflows/tag-report.yml +269 -0
  130. moai_adk/templates/.github/workflows/tag-validation.yml +186 -0
  131. moai_adk/templates/.github/workflows/typescript-tag-validation.yml +154 -0
  132. moai_adk/templates/.moai/config.json +3 -1
  133. moai_adk/templates/CLAUDE.md +940 -45
  134. moai_adk/templates/workflows/go-tag-validation.yml +30 -0
  135. moai_adk/templates/workflows/javascript-tag-validation.yml +41 -0
  136. moai_adk/templates/workflows/python-tag-validation.yml +42 -0
  137. moai_adk/templates/workflows/typescript-tag-validation.yml +31 -0
  138. moai_adk/utils/banner.py +5 -5
  139. {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/METADATA +1166 -455
  140. {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/RECORD +169 -109
  141. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +0 -209
  142. moai_adk/templates/.claude/hooks/alfred/notification__handle_events.py +0 -102
  143. moai_adk/templates/.claude/hooks/alfred/stop__handle_interrupt.py +0 -102
  144. moai_adk/templates/.claude/hooks/alfred/subagent_stop__handle_subagent_end.py +0 -102
  145. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +0 -640
  146. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +0 -696
  147. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +0 -474
  148. moai_adk/templates/.github/ISSUE_TEMPLATE/spec.yml +0 -176
  149. moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -69
  150. moai_adk/templates/.moai/memory/DEVELOPMENT-GUIDE.md +0 -344
  151. moai_adk/templates/.moai/memory/SPEC-METADATA.md +0 -356
  152. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +0 -330
  153. moai_adk/templates/.moai/project/product.md +0 -161
  154. moai_adk/templates/.moai/project/structure.md +0 -156
  155. moai_adk/templates/.moai/project/tech.md +0 -227
  156. moai_adk/templates/README.md +0 -256
  157. moai_adk/templates/__init__.py +0 -2
  158. /moai_adk/templates/{.moai/memory/ISSUE-LABEL-MAPPING.md → .claude/skills/moai-alfred-issue-labels/reference.md} +0 -0
  159. /moai_adk/templates/{.moai/memory/CLAUDE-PRACTICES.md → .claude/skills/moai-alfred-practices/reference.md} +0 -0
  160. /moai_adk/templates/{.moai/memory/CLAUDE-RULES.md → .claude/skills/moai-alfred-rules/reference.md} +0 -0
  161. /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/README.md +0 -0
  162. /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/examples/validate-spec.sh +0 -0
  163. /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/examples.md +0 -0
  164. /moai_adk/templates/.claude/skills/{moai-spec-authoring → moai-alfred-spec-authoring}/reference.md +0 -0
  165. /moai_adk/templates/{.moai/memory/SKILLS-DESCRIPTION-POLICY.md → .claude/skills/moai-cc-skill-descriptions/reference.md} +0 -0
  166. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/CHECKLIST.md +0 -0
  167. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/EXAMPLES.md +0 -0
  168. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/INTERACTIVE-DISCOVERY.md +0 -0
  169. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/METADATA.md +0 -0
  170. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/PARALLEL-ANALYSIS-REPORT.md +0 -0
  171. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/PYTHON-VERSION-MATRIX.md +0 -0
  172. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL-FACTORY-WORKFLOW.md +0 -0
  173. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/SKILL-UPDATE-ADVISOR.md +0 -0
  174. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/STEP-BY-STEP-GUIDE.md +0 -0
  175. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/STRUCTURE.md +0 -0
  176. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/WEB-RESEARCH.md +0 -0
  177. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/reference.md +0 -0
  178. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/scripts/generate-structure.sh +0 -0
  179. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/scripts/validate-skill.sh +0 -0
  180. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/SKILL_TEMPLATE.md +0 -0
  181. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/examples-template.md +0 -0
  182. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/reference-template.md +0 -0
  183. /moai_adk/templates/.claude/skills/{moai-skill-factory → moai-cc-skill-factory}/templates/scripts-template.sh +0 -0
  184. {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/WHEEL +0 -0
  185. {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/entry_points.txt +0 -0
  186. {moai_adk-0.9.0.dist-info → moai_adk-0.15.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,330 +0,0 @@
1
- # GitFlow Protection Policy
2
-
3
- **Document ID**: @DOC:GITFLOW-POLICY-ALIAS
4
- **Published**: 2025-10-17
5
- **Updated**: 2025-10-29
6
- **Status**: **Enforced via GitHub Branch Protection** (v0.8.3+)
7
- **Scope**: Personal and Team modes
8
-
9
- ---
10
-
11
- ## Overview
12
-
13
- MoAI-ADK **enforces** a GitFlow-inspired workflow through GitHub Branch Protection. As of v0.8.3, the `main` branch is protected and requires Pull Requests for all changes, including from administrators.
14
-
15
- **What Changed**: Previously (v0.3.5-v0.8.2), we used an advisory approach with warnings. Now we enforce proper GitFlow to ensure code quality and prevent accidental direct pushes to main.
16
-
17
- ## Key Requirements (Enforced)
18
-
19
- ### 1. Main Branch Access (Enforced)
20
-
21
- | Requirement | Summary | Enforcement |
22
- |-------------|---------|-------------|
23
- | **Merge via develop** | MUST merge `develop` into `main` | ✅ Enforced |
24
- | **Feature branches off develop** | MUST branch from `develop` and raise PRs back to `develop` | ✅ Enforced |
25
- | **Release process** | Release flow: `develop` → `main` (PR required) | ✅ Enforced |
26
- | **Force push** | Blocked on `main` | ✅ Blocked |
27
- | **Direct push** | Blocked on `main` (PR required) | ✅ Blocked |
28
-
29
- ### 2. Git Workflow (Required)
30
-
31
- ```
32
- ┌─────────────────────────────────────────────────────────┐
33
- │ ENFORCED GITFLOW │
34
- │ (GitHub Branch Protection Active) │
35
- └─────────────────────────────────────────────────────────┘
36
-
37
- develop (required base branch)
38
- ↑ ↓
39
- ┌─────────────────┐
40
- │ │
41
- │ developer work │
42
- │ │
43
- ↓ ↑
44
- feature/SPEC-{ID} [PR: feature -> develop]
45
- [code review + approval]
46
- [Merge to develop]
47
-
48
- develop (stable)
49
-
50
- │ (release manager prepares)
51
-
52
- [PR: develop -> main]
53
- [Code review + approval REQUIRED]
54
- [All discussions resolved]
55
- [CI/CD validation]
56
- [tag creation]
57
-
58
- main (protected release)
59
- ```
60
-
61
- **Enforcement**: Direct pushes to `main` are **blocked** via GitHub Branch Protection. All changes must go through Pull Requests.
62
-
63
- ## Technical Implementation
64
-
65
- ### Pre-push Hook (Advisory Mode)
66
-
67
- **Location**: `.git/hooks/pre-push`
68
- **Purpose**: Warn on `main` branch pushes without blocking them
69
-
70
- ```bash
71
- # When attempting to push to main:
72
- ⚠️ ADVISORY: Non-standard GitFlow detected
73
-
74
- Current branch: feature/SPEC-123
75
- Target branch: main
76
-
77
- Recommended GitFlow workflow:
78
- 1. Work on feature/SPEC-{ID} branch (created from develop)
79
- 2. Push to feature/SPEC-{ID} and create PR to develop
80
- 3. Merge into develop after code review
81
- 4. When develop is stable, create PR from develop to main
82
- 5. Release manager merges develop -> main with tag
83
-
84
- ✓ Push will proceed (flexibility mode enabled)
85
- ```
86
-
87
- ### Force Push Advisory
88
-
89
- ```bash
90
- ⚠️ ADVISORY: Force-push to main branch detected
91
-
92
- Recommended approach:
93
- - Use GitHub PR with proper code review
94
- - Ensure changes are merged via fast-forward
95
-
96
- ✓ Push will proceed (flexibility mode enabled)
97
- ```
98
-
99
- ---
100
-
101
- ## Workflow Examples
102
-
103
- ### Scenario 1: Standard Feature Development (Recommended)
104
-
105
- ```bash
106
- # 1. Sync latest code from develop
107
- git checkout develop
108
- git pull origin develop
109
-
110
- # 2. Create a feature branch (from develop)
111
- git checkout -b feature/SPEC-001-new-feature
112
-
113
- # 3. Implement the change
114
- # ... write code and tests ...
115
-
116
- # 4. Commit
117
- git add .
118
- git commit -m "..."
119
-
120
- # 5. Push
121
- git push origin feature/SPEC-001-new-feature
122
-
123
- # 6. Open a PR: feature/SPEC-001-new-feature -> develop
124
-
125
- # 7. Merge into develop after review and approval
126
- ```
127
-
128
- ### Scenario 2: Fast Hotfix (Flexible)
129
-
130
- ```bash
131
- # When an urgent fix is required:
132
-
133
- # Option 1: Recommended (via develop)
134
- git checkout develop
135
- git checkout -b hotfix/critical-bug
136
- # ... apply fix ...
137
- git push origin hotfix/critical-bug
138
- # Open PRs: hotfix -> develop -> main
139
-
140
- # Option 2: Direct fix on main (allowed, not recommended)
141
- git checkout main
142
- # ... apply fix ...
143
- git commit -m "Fix critical bug"
144
- git push origin main # ⚠️ Advisory warning appears but push continues
145
- ```
146
-
147
- ### Scenario 3: Release (Standard or Flexible)
148
-
149
- ```bash
150
- # Standard approach (recommended):
151
- git checkout develop
152
- gh pr create --base main --head develop --title "Release v1.0.0"
153
-
154
- # Direct push (allowed):
155
- git checkout develop
156
- git push origin main # ⚠️ Advisory warning appears but push continues
157
- git tag -a v1.0.0 -m "Release v1.0.0"
158
- git push origin v1.0.0
159
- ```
160
-
161
- ---
162
-
163
- ## Policy Modes
164
-
165
- ### Strict Mode (Active, v0.8.3+) ✅ ENFORCED
166
-
167
- **GitHub Branch Protection Enabled**:
168
- - ✅ **enforce_admins: true** - Administrators must follow all rules
169
- - ✅ **required_pull_request_reviews** - 1 approval required
170
- - ✅ **required_conversation_resolution** - All discussions must be resolved
171
- - ✅ **Block direct pushes to `main`** - PR required for all users
172
- - ✅ **Block force pushes** - Prevents history rewriting
173
- - ✅ **Block branch deletion** - Protects main from accidental deletion
174
-
175
- **What This Means**:
176
- - ❌ No one (including admins) can push directly to `main`
177
- - ✅ All changes must go through Pull Requests
178
- - ✅ PRs require code review approval
179
- - ✅ All code discussions must be resolved before merge
180
- - ✅ Enforces proper GitFlow: feature → develop → main
181
-
182
- ### Advisory Mode (Legacy, v0.3.5 - v0.8.2)
183
-
184
- - ⚠️ Warned but allowed direct pushes to `main`
185
- - ⚠️ Warned but allowed force pushes
186
- - ⚠️ Recommended best practices while preserving flexibility
187
- - ❌ **Deprecated** - Replaced by Strict Mode for better quality control
188
-
189
- ---
190
-
191
- ## Recommended Checklist
192
-
193
- Every contributor should ensure:
194
-
195
- - [ ] `.git/hooks/pre-push` exists and is executable (755)
196
- - [ ] Feature branches fork from `develop`
197
- - [ ] Pull requests target `develop`
198
- - [ ] Releases merge `develop` → `main`
199
-
200
- **Verification Commands**:
201
- ```bash
202
- ls -la .git/hooks/pre-push
203
- git branch -vv
204
- ```
205
-
206
- ---
207
-
208
- ## FAQ
209
-
210
- **Q: Can we merge into `main` from branches other than `develop`?**
211
- A: Yes. You will see an advisory warning, but the merge proceeds. The recommended path remains `develop` → `main`.
212
-
213
- **Q: Are force pushes allowed?**
214
- A: Yes. You receive a warning, but the push succeeds. Use with caution.
215
-
216
- **Q: Can we commit/push directly to `main`?**
217
- A: Yes. Expect an advisory warning, yet the push continues.
218
-
219
- **Q: Can I disable the hook entirely?**
220
- A: Yes. Remove `.git/hooks/pre-push` or strip its execute permission.
221
-
222
- **Q: Why switch to Advisory Mode?**
223
- A: Advisory Mode was used in v0.3.5-v0.8.2. As of v0.8.3, we've switched to Strict Mode with GitHub Branch Protection for better quality control.
224
-
225
- **Q: What if develop falls behind main?**
226
- A: This can happen when hotfixes or releases go directly to main. Regularly sync main → develop to prevent divergence. See "Maintaining develop-main Sync" section below.
227
-
228
- **Q: Can I bypass branch protection in emergencies?**
229
- A: No. Even administrators must follow the PR process. For true emergencies, temporarily disable protection via GitHub Settings (requires admin access), but re-enable immediately after.
230
-
231
- ---
232
-
233
- ## Maintaining develop-main Sync
234
-
235
- ### ⚠️ Critical Rule: develop Must Stay Current
236
-
237
- **Problem**: When main receives direct commits (hotfixes, emergency releases) without syncing back to develop, GitFlow breaks:
238
-
239
- ```
240
- ❌ BAD STATE:
241
- develop: 3 commits ahead, 29 commits behind main
242
- - develop has outdated dependencies
243
- - New features branch from old code
244
- - Merge conflicts multiply over time
245
- ```
246
-
247
- ### Signs of Drift
248
-
249
- Monitor for these warnings:
250
- - `git status` shows "Your branch is X commits behind main"
251
- - Feature branches conflict with main during PR
252
- - CI/CD failures due to dependency mismatches
253
- - Version numbers in develop don't match main
254
-
255
- ### Recovery Procedure
256
-
257
- When develop falls behind main:
258
-
259
- 1. **Assess the Gap**
260
- ```bash
261
- git log --oneline develop..main # Commits in main but not develop
262
- git log --oneline main..develop # Commits in develop but not main
263
- ```
264
-
265
- 2. **Sync Strategy: Merge main into develop (Recommended)**
266
- ```bash
267
- git checkout develop
268
- git pull origin develop # Get latest develop
269
- git merge main # Merge main into develop
270
- # Resolve conflicts if any (prefer main for version/config files)
271
- git push origin develop
272
- ```
273
-
274
- 3. **Emergency Only: Reset develop to main (Destructive)**
275
- ```bash
276
- # ⚠️ ONLY if develop's unique commits are unwanted
277
- git checkout develop
278
- git reset --hard main
279
- git push origin develop --force
280
- ```
281
-
282
- ### Prevention: Regular Sync Schedule
283
-
284
- **After every main release** (REQUIRED):
285
- ```bash
286
- # Immediately after merging develop → main:
287
- git checkout develop
288
- git merge main
289
- git push origin develop
290
- ```
291
-
292
- **Weekly maintenance** (for active projects):
293
- ```bash
294
- # Every Monday morning:
295
- git checkout develop
296
- git pull origin main
297
- git push origin develop
298
- ```
299
-
300
- ### Real-World Case Study (2025-10-29)
301
-
302
- **Situation**: develop was 29 commits behind main due to:
303
- - v0.8.2, v0.8.3 released directly to main
304
- - No reverse sync to develop
305
- - Feature branches contained outdated code
306
-
307
- **Resolution**:
308
- - Merged main → develop (14 file conflicts)
309
- - Resolved conflicts prioritizing main's versions
310
- - TAG validation bypassed for merge commit
311
- - Enabled Strict Mode to prevent future direct pushes
312
-
313
- **Lesson**: With Strict Mode active, this won't happen again. All releases must go through develop → main PR flow.
314
-
315
- ---
316
-
317
- ## Policy Change Log
318
-
319
- | Date | Change | Owner |
320
- |------|------|--------|
321
- | 2025-10-17 | Initial policy drafted (Strict Mode) | git-manager |
322
- | 2025-10-17 | Switched to Advisory Mode (warnings only) | git-manager |
323
- | 2025-10-29 | **Enabled GitHub Branch Protection (Strict Mode)** | Alfred |
324
- | 2025-10-29 | Added develop-main sync guidelines and real-world case study | Alfred |
325
- | 2025-10-29 | Enforced `enforce_admins`, `required_conversation_resolution` | Alfred |
326
-
327
- ---
328
-
329
- **This policy is advisory—adapt it to fit your project needs.**
330
- **Reach out to the team lead or release engineer for questions or suggestions.**
@@ -1,161 +0,0 @@
1
- ---
2
- id: PRODUCT-001
3
- version: 0.1.3
4
- status: active
5
- created: 2025-10-01
6
- updated: 2025-10-17
7
- author: @project-owner
8
- priority: high
9
- ---
10
-
11
- # {{PROJECT_NAME}} Product Definition
12
-
13
- ## HISTORY
14
-
15
- ### v0.1.3 (2025-10-17)
16
- - **UPDATED**: Template version synced (v0.3.8)
17
- - **AUTHOR**: @Alfred
18
- - **SECTIONS**: Mission (finalized team of 12 agents: Alfred + 11 specialists)
19
- - Added implementation-planner, tdd-implementer, quality-gate
20
- - Split code-builder into implementation-planner + tdd-implementer + quality-gate
21
-
22
- ### v0.1.2 (2025-10-17)
23
- - **UPDATED**: Agent count adjusted (9 → 11)
24
- - **AUTHOR**: @Alfred
25
- - **SECTIONS**: Mission (updated Alfred SuperAgent roster)
26
-
27
- ### v0.1.1 (2025-10-17)
28
- - **UPDATED**: Template defaults aligned with the real MoAI-ADK project
29
- - **AUTHOR**: @Alfred
30
- - **SECTIONS**: Mission, User, Problem, Strategy, Success populated with project context
31
-
32
- ### v0.1.0 (2025-10-01)
33
- - **INITIAL**: Authored the product definition document
34
- - **AUTHOR**: @project-owner
35
- - **SECTIONS**: Mission, User, Problem, Strategy, Success, Legacy
36
-
37
- ---
38
-
39
- ## @DOC:MISSION-001 Core Mission
40
-
41
- > **"No SPEC, no CODE."**
42
-
43
- {{PROJECT_NAME}} combats Frankenstein code at the root by enforcing a **SPEC-first TDD methodology**.
44
-
45
- ### Core Value Proposition
46
-
47
- #### Four Key Values
48
-
49
- 1. **Consistency**: A three-step SPEC → TDD → Sync pipeline safeguards delivery quality.
50
- 2. **Quality**: TRUST principles (Test First, Readable, Unified, Secured, Trackable) apply automatically.
51
- 3. **Traceability**: The @TAG system (`@SPEC → @TEST → @CODE → @DOC`) preserves end-to-end lineage.
52
- 4. **Universality**: Supports diverse programming languages and frameworks.
53
-
54
- #### Alfred SuperAgent
55
-
56
- **Alfred** coordinates a team of 12 AI agents (Alfred + 11 specialists):
57
- - **spec-builder** 🏗️: Authors SPECs (EARS pattern) – Sonnet
58
- - **implementation-planner** 📋: Analyzes SPECs and derives implementation plans – Sonnet
59
- - **tdd-implementer** 🔬: Executes RED–GREEN–REFACTOR cycles – Sonnet
60
- - **quality-gate** 🛡️: Enforces TRUST principles – Haiku
61
- - **doc-syncer** 📖: Maintains living documentation – Haiku
62
- - **tag-agent** 🏷️: Manages the TAG system – Haiku
63
- - **git-manager** 🚀: Automates Git workflows – Haiku
64
- - **debug-helper** 🔍: Diagnoses runtime issues – Sonnet
65
- - **trust-checker** ✅: Verifies TRUST compliance – Haiku
66
- - **cc-manager** 🛠️: Configures Claude Code – Sonnet
67
- - **project-manager** 📂: Bootstraps projects – Sonnet
68
-
69
- ## @SPEC:USER-001 Primary Users
70
-
71
- ### Primary Audience
72
- - **Who**: [Describe your main user segment]
73
- - **Core Needs**: [Explain the problems they want solved]
74
- - **Critical Scenarios**: [Outline their primary usage scenarios]
75
-
76
- ### Secondary Audience (Optional)
77
- - **Who**: [Describe any secondary user group]
78
- - **Needs**: [Capture their requirements]
79
-
80
- ## @SPEC:PROBLEM-001 Problems to Solve
81
-
82
- ### High Priority
83
- 1. [Top problem to resolve]
84
- 2. [Second critical problem]
85
- 3. [Third critical problem]
86
-
87
- ### Medium Priority
88
- - [Problems with moderate urgency]
89
-
90
- ### Current Failure Cases
91
- - [Limitations or failure patterns in existing solutions]
92
-
93
- ## @DOC:STRATEGY-001 Differentiators & Strengths
94
-
95
- ### Strengths Versus Alternatives
96
- 1. [Primary differentiator]
97
- - **When it matters**: [Scenario where the strength shines]
98
-
99
- 2. [Second differentiator]
100
- - **When it matters**: [Concrete usage example]
101
-
102
- ## @SPEC:SUCCESS-001 Success Metrics
103
-
104
- ### Immediately Measurable KPIs
105
- 1. [Metric 1]
106
- - **Baseline**: [Target value and measurement approach]
107
-
108
- 2. [Metric 2]
109
- - **Baseline**: [Target value and measurement approach]
110
-
111
- ### Measurement Cadence
112
- - **Daily**: [Metrics tracked daily]
113
- - **Weekly**: [Metrics tracked weekly]
114
- - **Monthly**: [Metrics tracked monthly]
115
-
116
- ## Legacy Context
117
-
118
- ### Existing Assets
119
- - [Reusable assets or resources]
120
- - [Relevant past projects or experience]
121
-
122
- ## TODO:SPEC-BACKLOG-001 Next SPEC Candidates
123
-
124
- 1. **SPEC-001**: [First feature to implement]
125
- 2. **SPEC-002**: [Second feature to implement]
126
- 3. **SPEC-003**: [Third feature to implement]
127
-
128
- ## EARS Requirement Authoring Guide
129
-
130
- ### EARS (Easy Approach to Requirements Syntax)
131
-
132
- Use these EARS patterns to keep SPEC requirements structured:
133
-
134
- #### EARS Patterns
135
- 1. **Ubiquitous Requirements**: The system shall provide [capability].
136
- 2. **Event-driven Requirements**: WHEN [condition], the system shall [behaviour].
137
- 3. **State-driven Requirements**: WHILE [state], the system shall [behaviour].
138
- 4. **Optional Features**: WHERE [condition], the system may [behaviour].
139
- 5. **Constraints**: IF [condition], the system shall enforce [constraint].
140
-
141
- #### Sample Application
142
- ```markdown
143
- ### Ubiquitous Requirements (Foundational)
144
- - The system shall provide user management capabilities.
145
-
146
- ### Event-driven Requirements
147
- - WHEN a user signs up, the system shall send a welcome email.
148
-
149
- ### State-driven Requirements
150
- - WHILE a user remains logged in, the system shall display a personalized dashboard.
151
-
152
- ### Optional Features
153
- - WHERE an account is premium, the system may offer advanced features.
154
-
155
- ### Constraints
156
- - IF an account is locked, the system shall reject login attempts.
157
- ```
158
-
159
- ---
160
-
161
- _This document serves as the baseline when `/alfred:1-plan` runs._
@@ -1,156 +0,0 @@
1
- ---
2
- id: STRUCTURE-001
3
- version: 0.1.1
4
- status: active
5
- created: 2025-10-01
6
- updated: 2025-10-17
7
- author: @architect
8
- priority: medium
9
- ---
10
-
11
- # {{PROJECT_NAME}} Structure Design
12
-
13
- ## HISTORY
14
-
15
- ### v0.1.1 (2025-10-17)
16
- - **UPDATED**: Template version synced (v0.3.8)
17
- - **AUTHOR**: @Alfred
18
- - **SECTIONS**: Metadata standardization (single `author` field, added `priority`)
19
-
20
- ### v0.1.0 (2025-10-01)
21
- - **INITIAL**: Authored the structure design document
22
- - **AUTHOR**: @architect
23
- - **SECTIONS**: Architecture, Modules, Integration, Traceability
24
-
25
- ---
26
-
27
- ## @DOC:ARCHITECTURE-001 System Architecture
28
-
29
- ### Architectural Strategy
30
-
31
- **[Describe the end-to-end architectural approach for the project]**
32
-
33
- ```
34
- Project Architecture
35
- - [Layer 1] # [Describe its responsibilities]
36
- - [Layer 2] # [Describe its responsibilities]
37
- - [Layer 3] # [Describe its responsibilities]
38
- - [Layer 4] # [Describe its responsibilities]
39
- ```
40
-
41
- **Rationale**: [Explain the trade-offs behind the chosen architecture]
42
-
43
- ## @DOC:MODULES-001 Module Responsibilities
44
-
45
- ### 1. [Primary Module 1]
46
-
47
- - **Responsibilities**: [Key duties of the module]
48
- - **Inputs**: [Data it consumes]
49
- - **Processing**: [Core processing steps]
50
- - **Outputs**: [Produced artifacts]
51
-
52
- | Component | Role | Key Capabilities |
53
- | ------------- | ------ | ---------------- |
54
- | [Component 1] | [Role] | [Feature list] |
55
- | [Component 2] | [Role] | [Feature list] |
56
-
57
- ### 2. [Primary Module 2]
58
-
59
- - **Responsibilities**: [Key duties of the module]
60
- - **Inputs**: [Data it consumes]
61
- - **Processing**: [Core processing steps]
62
- - **Outputs**: [Produced artifacts]
63
-
64
- ## @DOC:INTEGRATION-001 External Integrations
65
-
66
- ### [External System 1] Integration
67
-
68
- - **Authentication**: [Method used]
69
- - **Data Exchange**: [Formats and protocols]
70
- - **Failure Handling**: [Fallback strategy]
71
- - **Risk Level**: [Risk profile and mitigation]
72
-
73
- ### [External System 2] Integration
74
-
75
- - **Purpose**: [Why it is used]
76
- - **Dependency Level**: [Degree of reliance and alternatives]
77
- - **Performance Requirements**: [Latency, throughput, etc.]
78
-
79
- ## @DOC:TRACEABILITY-001 Traceability Strategy
80
-
81
- ### Applying the TAG Framework
82
-
83
- **Full TDD Alignment**: SPEC → Tests → Implementation → Documentation
84
- - `@SPEC:ID` (`.moai/specs/`) → `@TEST:ID` (`tests/`) → `@CODE:ID` (`src/`) → `@DOC:ID` (`docs/`)
85
-
86
- **Implementation Detail Levels**: Annotation within `@CODE:ID`
87
- - `@CODE:ID:API` – REST APIs, GraphQL endpoints
88
- - `@CODE:ID:UI` – Components, views, screens
89
- - `@CODE:ID:DATA` – Data models, schemas, types
90
- - `@CODE:ID:DOMAIN` – Business logic, domain rules
91
- - `@CODE:ID:INFRA` – Infrastructure, databases, integrations
92
-
93
- ### Managing TAG Traceability (Code-Scan Approach)
94
-
95
- - **Verification**: Run `/alfred:3-sync`, which scans with `rg '@(SPEC|TEST|CODE|DOC):' -n`
96
- - **Coverage**: Full project source (`.moai/specs/`, `tests/`, `src/`, `docs/`)
97
- - **Cadence**: Validate whenever the code changes
98
- - **Code-First Principle**: TAG truth lives in the source itself
99
-
100
- ## Legacy Context
101
-
102
- ### Current System Snapshot
103
-
104
- **[Describe the existing system or assets]**
105
-
106
- ```
107
- Current System/
108
- ├── [Component 1]/ # [Current state]
109
- ├── [Component 2]/ # [Current state]
110
- └── [Component 3]/ # [Current state]
111
- ```
112
-
113
- ### Migration Considerations
114
-
115
- 1. **[Migration item 1]** – [Plan and priority]
116
- 2. **[Migration item 2]** – [Plan and priority]
117
- 3. **[Migration item 3]** – [Plan and priority]
118
-
119
- ## TODO:STRUCTURE-001 Structural Improvements
120
-
121
- 1. **Define module interfaces** – [Plan details]
122
- 2. **Dependency management strategy** – [Plan details]
123
- 3. **Scalability roadmap** – [Plan details]
124
-
125
- ## EARS for Architectural Requirements
126
-
127
- ### Applying EARS to Architecture
128
-
129
- Use EARS patterns to write clear architectural requirements:
130
-
131
- #### Architectural EARS Example
132
- ```markdown
133
- ### Ubiquitous Requirements (Baseline Architecture)
134
- - The system shall adopt a layered architecture.
135
- - The system shall maintain loose coupling across modules.
136
-
137
- ### Event-driven Requirements
138
- - WHEN an external API call fails, the system shall execute fallback logic.
139
- - WHEN a data change event occurs, the system shall notify dependent modules.
140
-
141
- ### State-driven Requirements
142
- - WHILE the system operates in scale-out mode, it shall load new modules dynamically.
143
- - WHILE in development mode, the system shall provide verbose debug information.
144
-
145
- ### Optional Features
146
- - WHERE the deployment runs in the cloud, the system may use distributed caching.
147
- - WHERE high performance is required, the system may apply in-memory caching.
148
-
149
- ### Constraints
150
- - IF the security level is elevated, the system shall encrypt all inter-module communication.
151
- - Each module shall keep cyclomatic complexity under 15.
152
- ```
153
-
154
- ---
155
-
156
- _This structure informs the TDD implementation when `/alfred:2-run` runs._