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
@@ -0,0 +1,622 @@
1
+ # moai-project-documentation
2
+
3
+ ## Metadata
4
+
5
+ - **Name**: moai-project-documentation
6
+ - **Domain**: Project Documentation & Planning
7
+ - **Freedom Level**: high
8
+ - **Target Users**: Project owners, architects, tech leads
9
+ - **Invocation**: Skill("moai-project-documentation")
10
+ - **Progressive Disclosure**: Metadata → Content (full guide) → Resources (examples)
11
+
12
+ ---
13
+
14
+ ## Purpose
15
+
16
+ Guide interactive creation of three core project documentation files (product.md, structure.md, tech.md) based on project type and user input. Provides templates, examples, checklists, and best practices for each project type (Web App, CLI Tool, Library, Data Science).
17
+
18
+ ---
19
+
20
+ ## Quick Start
21
+
22
+ **When to use this Skill:**
23
+ - During `/alfred:0-project` to generate project documentation
24
+ - To refine existing product.md, structure.md, or tech.md
25
+ - To understand best practices for project documentation
26
+
27
+ **Basic Usage:**
28
+ ```
29
+ User: /alfred:0-project
30
+ Alfred: Invokes Skill("moai-project-documentation")
31
+ Skill: Guides user through project type selection → documentation generation
32
+ ```
33
+
34
+ ---
35
+
36
+ ## Core Content
37
+
38
+ ### Part 1: Project Type Selection
39
+
40
+ Ask user to identify their project type:
41
+
42
+ 1. **Web Application**
43
+ - Examples: SaaS, web dashboard, REST API backend
44
+ - Focus: User personas, adoption metrics, real-time features
45
+ - Template style: Business-focused with UX emphasis
46
+
47
+ 2. **Mobile Application**
48
+ - Examples: iOS/Android app, cross-platform app (Flutter, React Native)
49
+ - Focus: User retention, app store metrics, offline capability
50
+ - Template style: UX-driven with platform-specific performance
51
+ - Frameworks: Flutter, React Native, Swift, Kotlin
52
+
53
+ 3. **CLI Tool / Utility**
54
+ - Examples: Data validator, deployment tool, package manager
55
+ - Focus: Performance, integration, ecosystem adoption
56
+ - Template style: Technical with use case emphasis
57
+
58
+ 4. **Shared Library / SDK**
59
+ - Examples: Type validator, data parser, API client
60
+ - Focus: Developer experience, ecosystem adoption, performance
61
+ - Template style: API-first with integration focus
62
+
63
+ 5. **Data Science / ML Project**
64
+ - Examples: Recommendation system, ML pipeline, analytics
65
+ - Focus: Data quality, model metrics, scalability
66
+ - Template style: Metrics-driven with data emphasis
67
+
68
+ ---
69
+
70
+ ### Part 2: Product.md Writing Guide
71
+
72
+ #### Document Structure
73
+
74
+ ```markdown
75
+ # Mission & Strategy
76
+ - What problem do we solve?
77
+ - Who are the users?
78
+ - What's our value proposition?
79
+
80
+ # Success Metrics
81
+ - How do we measure impact?
82
+ - What are KPIs?
83
+ - How often do we measure?
84
+
85
+ # Next Features (SPEC Backlog)
86
+ - What features are coming?
87
+ - How are they prioritized?
88
+ ```
89
+
90
+ #### Writing by Project Type
91
+
92
+ **Web Application Product.md Focus:**
93
+ - User personas (team lead, individual contributor, customer)
94
+ - Adoption targets (80% within 2 weeks)
95
+ - Integration capabilities (Slack, GitHub, Jira)
96
+ - Real-time collaboration features
97
+
98
+ **Mobile Application Product.md Focus:**
99
+ - User personas (iOS users, Android users, power users)
100
+ - Retention metrics (DAU, MAU, churn rate)
101
+ - App store presence (rating target, download goal)
102
+ - Offline capability requirements
103
+ - Push notification strategy
104
+ - Platform-specific features (GPS, camera, contacts)
105
+
106
+ **CLI Tool Product.md Focus:**
107
+ - Target workflow (validate → deploy → monitor)
108
+ - Performance benchmarks (1M records in <5s)
109
+ - Multi-format support (JSON, CSV, Avro)
110
+ - Ecosystem adoption (GitHub stars, npm downloads)
111
+
112
+ **Library Product.md Focus:**
113
+ - API design philosophy (composable, type-safe)
114
+ - Developer experience (time-to-first-validation <5 min)
115
+ - Performance characteristics (zero-cost abstractions)
116
+ - Community engagement (issue response time, contributions)
117
+
118
+ **Data Science Product.md Focus:**
119
+ - Model metrics (accuracy, precision, recall)
120
+ - Data quality requirements
121
+ - Scalability targets (1B+ records)
122
+ - Integration with ML platforms (MLflow, W&B)
123
+
124
+ ---
125
+
126
+ ### Part 3: Structure.md Writing Guide
127
+
128
+ #### Document Structure
129
+
130
+ ```markdown
131
+ # System Architecture
132
+ - What's the overall design pattern?
133
+ - What layers/tiers exist?
134
+ - How do components interact?
135
+
136
+ # Core Modules
137
+ - What are the main building blocks?
138
+ - What's each module responsible for?
139
+ - How do they communicate?
140
+
141
+ # External Integrations
142
+ - What external systems do we depend on?
143
+ - How do we authenticate?
144
+ - What's our fallback strategy?
145
+
146
+ # Traceability
147
+ - How do SPECs map to code?
148
+ - How do we trace changes?
149
+ ```
150
+
151
+ #### Architecture Patterns by Project Type
152
+
153
+ **Web Application Architecture:**
154
+ ```
155
+ Frontend (React/Vue) ↔ API Layer (FastAPI/Node) ↔ Database (PostgreSQL)
156
+
157
+ WebSocket Server (Real-time features)
158
+
159
+ Message Queue (Async jobs)
160
+
161
+ Background Workers
162
+ ```
163
+
164
+ **Mobile Application Architecture:**
165
+ ```
166
+ UI Layer (Screens, Widgets)
167
+
168
+ State Management (Bloc, Redux, Riverpod)
169
+
170
+ Data Layer (Local DB: SQLite/Realm, Remote: REST/GraphQL)
171
+
172
+ Authentication (OAuth, JWT)
173
+
174
+ Native Modules (Camera, GPS, Contacts)
175
+
176
+ Offline Sync Engine
177
+ ```
178
+
179
+ **CLI Tool Architecture:**
180
+ ```
181
+ Input Parsing → Command Router → Core Logic → Output Formatter
182
+
183
+ Validation Layer
184
+
185
+ Caching Layer
186
+ ```
187
+
188
+ **Library Architecture:**
189
+ ```
190
+ Public API Surface
191
+
192
+ Type Guards / Validation
193
+
194
+ Core Logic
195
+
196
+ Platform Adapters (Node.js, Browser, Deno)
197
+ ```
198
+
199
+ **Data Science Architecture:**
200
+ ```
201
+ Data Ingestion → Feature Engineering → Model Training → Inference
202
+
203
+ Feature Store
204
+
205
+ Model Registry
206
+
207
+ Monitoring & Alerting
208
+ ```
209
+
210
+ ---
211
+
212
+ ### Part 4: Tech.md Writing Guide
213
+
214
+ #### Document Structure
215
+
216
+ ```markdown
217
+ # Technology Stack
218
+ - What language(s)?
219
+ - What version ranges?
220
+ - Why these choices?
221
+
222
+ # Quality Gates
223
+ - What's required to merge?
224
+ - How do we measure quality?
225
+ - What tools enforce standards?
226
+
227
+ # Security Policy
228
+ - How do we manage secrets?
229
+ - How do we handle vulnerabilities?
230
+ - What's our incident response?
231
+
232
+ # Deployment Strategy
233
+ - Where do we deploy?
234
+ - How do we release?
235
+ - How do we rollback?
236
+ ```
237
+
238
+ #### Tech Stack Examples by Type
239
+
240
+ **Web Application:**
241
+ ```
242
+ Frontend: TypeScript, React 18, Vitest, TailwindCSS
243
+ Backend: Python 3.13, FastAPI, pytest (85% coverage)
244
+ Database: PostgreSQL 15, Alembic migrations
245
+ DevOps: Docker, Kubernetes, GitHub Actions
246
+ Quality: TypeScript strict mode, mypy, ruff, GitHub code scanning
247
+ ```
248
+
249
+ **Mobile Application:**
250
+ ```
251
+ Framework: Flutter 3.13 or React Native 0.72
252
+ Language: Dart or TypeScript
253
+ Testing: flutter test or Jest, 80%+ coverage
254
+ State Management: Riverpod, Bloc, or Redux
255
+ Local Database: SQLite, Hive, or Realm
256
+ HTTP Client: Dio or Axios wrapper
257
+ UI: Material Design or Cupertino
258
+ DevOps: Fastlane, GitHub Actions for app store deployment
259
+ Quality: flutter analyze, dart format, excellent test coverage
260
+ Performance: App size <50MB (iOS), startup <2s
261
+ ```
262
+
263
+ **CLI Tool:**
264
+ ```
265
+ Language: Go 1.21 or Python 3.13
266
+ Testing: Go's built-in testing or pytest
267
+ Packaging: Single binary (Go) or PyPI (Python)
268
+ Quality: golangci-lint or ruff, <100MB binary
269
+ Performance: <100ms startup time
270
+ ```
271
+
272
+ **Library:**
273
+ ```
274
+ Language: TypeScript 5.2 or Python 3.13
275
+ Testing: Vitest or pytest, 90%+ coverage (libraries = higher bar)
276
+ Package Manager: npm/pnpm or uv
277
+ Documentation: TSDoc/JSDoc or Google-style docstrings
278
+ Type Safety: TypeScript strict or mypy strict
279
+ ```
280
+
281
+ **Data Science:**
282
+ ```
283
+ Language: Python 3.13, Jupyter notebooks
284
+ ML Framework: scikit-learn, PyTorch, or TensorFlow
285
+ Data: pandas, Polars, DuckDB
286
+ Testing: pytest, nbval (notebook validation)
287
+ Experiment Tracking: MLflow, Weights & Biases
288
+ Quality: 80% code coverage, data validation tests
289
+ ```
290
+
291
+ ---
292
+
293
+ ### Part 5: Writing Checklists
294
+
295
+ #### Product.md Checklist
296
+ - [ ] Mission statement is 1-2 sentences
297
+ - [ ] Users are specific (not "developers")
298
+ - [ ] Problems are ranked by priority
299
+ - [ ] Success metrics are measurable
300
+ - [ ] Feature backlog has 3-5 next SPECs
301
+ - [ ] HISTORY section has v0.1.0
302
+
303
+ #### Structure.md Checklist
304
+ - [ ] Architecture is visualized or clearly described
305
+ - [ ] Modules map to git directories
306
+ - [ ] External integrations list auth and failure modes
307
+ - [ ] Traceability explains TAG system
308
+ - [ ] Trade-offs are documented (why this design?)
309
+ - [ ] HISTORY section has v0.1.0
310
+
311
+ #### Tech.md Checklist
312
+ - [ ] Primary language with version range specified
313
+ - [ ] Quality gates define failure criteria (what blocks merges?)
314
+ - [ ] Security policy covers secrets, audits, incidents
315
+ - [ ] Deployment describes full release flow
316
+ - [ ] Environment profiles (dev/test/prod) included
317
+ - [ ] HISTORY section has v0.1.0
318
+
319
+ ---
320
+
321
+ ### Part 6: Common Mistakes to Avoid
322
+
323
+ ❌ **Too Vague**
324
+ - "Users are developers"
325
+ - "We'll measure success by growth"
326
+
327
+ ✅ **Specific**
328
+ - "Solo developers building web apps under time pressure, 3-7 person teams"
329
+ - "Measure success by 80% adoption within 2 weeks, 5 features/sprint velocity"
330
+
331
+ ---
332
+
333
+ ❌ **Over-Specified in product.md**
334
+ - Function names, database schemas, API endpoints
335
+ - "We'll use Redis cache with 1-hour TTL"
336
+
337
+ ✅ **Architecture-Level**
338
+ - "Caching layer for performance"
339
+ - "Integration with external payment provider"
340
+
341
+ ---
342
+
343
+ ❌ **Inconsistent Across Documents**
344
+ - product.md: "5 concurrent users"
345
+ - structure.md: "Designed for 10,000 daily users"
346
+
347
+ ✅ **Aligned**
348
+ - All 3 documents agree on target scale, user types, quality standards
349
+
350
+ ---
351
+
352
+ ❌ **Outdated**
353
+ - Last updated 6 months ago
354
+ - HISTORY section has no recent entries
355
+
356
+ ✅ **Fresh**
357
+ - HISTORY updated every sprint
358
+ - version number incremented on changes
359
+
360
+ ---
361
+
362
+ ## Examples by Project Type
363
+
364
+ ### Example 1: Web App (TaskFlow)
365
+
366
+ **Product.md excerpt:**
367
+ ```markdown
368
+ ## Mission
369
+ "Simplify team collaboration through real-time task management."
370
+
371
+ ## Users: Engineering Team Lead
372
+ - Manages 5-7 person team
373
+ - Needs: Centralized visibility, blocker tracking, code review integration
374
+ - Success: Reduce sprint planning from 2h to 45 min
375
+ ```
376
+
377
+ **Structure.md excerpt:**
378
+ ```markdown
379
+ ## Architecture: Layered
380
+ - Frontend: React dashboard with real-time updates (WebSocket)
381
+ - API: GraphQL backend with permission checks
382
+ - Database: PostgreSQL with event log table
383
+ - Cache: Redis for session and frequently accessed data
384
+ ```
385
+
386
+ **Tech.md excerpt:**
387
+ ```markdown
388
+ ## Primary Language: TypeScript 5.2+
389
+ - Rationale: Type safety, strong React tooling, compiled performance
390
+
391
+ ## Quality Gates
392
+ - Test coverage: 85% minimum
393
+ - Type errors: Zero in strict mode
394
+ - Bundle size: <200KB gzipped
395
+ ```
396
+
397
+ ---
398
+
399
+ ### Example 2: Mobile App (FitTracker)
400
+
401
+ **Product.md excerpt:**
402
+ ```markdown
403
+ ## Mission
404
+ "Make fitness tracking simple and engaging with offline-first capabilities."
405
+
406
+ ## Users: Individual Fitness Enthusiast
407
+ - Tracks workouts daily, wants quick data entry
408
+ - Needs: Offline support (no WiFi at gym), social sharing, integration with Apple Health/Google Fit
409
+ - Success: 100K downloads in 3 months, 4.5+ star rating
410
+
411
+ ## Metrics
412
+ - DAU (Daily Active Users): 60% of installs
413
+ - Session length: Average 5-10 minutes
414
+ - Retention: 30-day retention >40%
415
+ ```
416
+
417
+ **Structure.md excerpt:**
418
+ ```markdown
419
+ ## Architecture: Layered with Offline-First
420
+ UI Layer (Screens) → State Management (Riverpod) → Data Layer (SQLite) → Cloud Sync
421
+
422
+ - UI: Bottom navigation, workout detail screens, statistics charts
423
+ - State: Provider-based state (Riverpod) for reactive updates
424
+ - Local DB: SQLite with drift ORM for type-safe queries
425
+ - Sync: Background sync engine that resolves conflicts
426
+ - Native: Permission handling for HealthKit, sensors
427
+ ```
428
+
429
+ **Tech.md excerpt:**
430
+ ```markdown
431
+ ## Primary Language: Dart 3.0+ (Flutter)
432
+ - Rationale: Single codebase for iOS/Android, hot reload, excellent performance
433
+
434
+ ## Quality Gates
435
+ - Test coverage: 80% (widget + unit tests)
436
+ - App size: <50MB iOS, <60MB Android
437
+ - Startup time: <2 seconds
438
+ - Frame rate: 60fps (no jank)
439
+
440
+ ## Deployment
441
+ - App Store & Google Play via Fastlane
442
+ - TestFlight for beta testing
443
+ - Version every 2 weeks
444
+ ```
445
+ ---
446
+
447
+ ### Example 3: CLI Tool (DataValidate)
448
+
449
+ **Product.md excerpt:**
450
+ ```markdown
451
+ ## Mission
452
+ "Validate data integrity before it reaches your database."
453
+
454
+ ## Success Metrics
455
+ - Adoption: 10,000+ monthly downloads by month 3
456
+ - Performance: Validate 1M records in <5 seconds
457
+ - Satisfaction: 4.5+ rating on npm
458
+ ```
459
+
460
+ **Structure.md excerpt:**
461
+ ```markdown
462
+ ## Architecture: Pipeline
463
+ Input Parsing → Schema Loading → Validation Engine → Error Formatting → Output
464
+
465
+ - Input Layer: Supports JSON, CSV, Avro formats
466
+ - Schema Layer: Caches compiled schemas
467
+ - Validation: Single-threaded streaming, memory-efficient
468
+ - Output: Structured errors with line numbers and suggestions
469
+ ```
470
+
471
+ **Tech.md excerpt:**
472
+ ```markdown
473
+ ## Primary Language: Go 1.21+
474
+ - Rationale: Fast compilation, single binary, native concurrency
475
+
476
+ ## Build
477
+ - Binary size: <100MB
478
+ - Startup time: <100ms
479
+ - Distribution: GitHub Releases + Homebrew
480
+ ```
481
+
482
+ ---
483
+
484
+ ### Example 4: Library (TypeGuard)
485
+
486
+ **Product.md excerpt:**
487
+ ```markdown
488
+ ## Mission
489
+ "Bring TypeScript type safety to runtime with zero overhead."
490
+
491
+ ## Value Prop
492
+ - Zero boilerplate (auto-generate guards from interfaces)
493
+ - Fast validation (<100μs per object)
494
+ - Clear error messages (field-by-field trace)
495
+ ```
496
+
497
+ **Structure.md excerpt:**
498
+ ```markdown
499
+ ## Modules
500
+ - Type Guards: Generate runtime guards from TypeScript types
501
+ - Validators: Custom validation functions (email, URL, regex)
502
+ - Error Formatter: Detailed error messages with paths
503
+ - Platform Adapters: Node.js, Browser, Deno support
504
+ ```
505
+
506
+ **Tech.md excerpt:**
507
+ ```markdown
508
+ ## Primary Language: TypeScript 5.2+
509
+ - Test coverage: 90% (libraries have higher bar)
510
+ - Type checking: Zero errors in strict mode
511
+ - Bundle: <50KB gzipped, tree-shakeable
512
+ ```
513
+
514
+ ---
515
+
516
+ ### Example 5: Data Science (ML Pipeline)
517
+
518
+ **Product.md excerpt:**
519
+ ```markdown
520
+ ## Mission
521
+ "Predict customer churn with 90%+ accuracy in production."
522
+
523
+ ## Success Metrics
524
+ - Model accuracy: 90%+ on test set
525
+ - Inference latency: <100ms p95
526
+ - Data quality: 99%+ complete features
527
+ ```
528
+
529
+ **Structure.md excerpt:**
530
+ ```markdown
531
+ ## Pipeline
532
+ Data Ingestion → Feature Engineering → Model Training → Validation → Inference
533
+
534
+ - Data Layer: PostgreSQL + Snowflake for warehousing
535
+ - Feature Store: Feast for feature versioning
536
+ - Model Registry: MLflow for experiment tracking
537
+ - Monitoring: DataDog alerts on model drift
538
+ ```
539
+
540
+ **Tech.md excerpt:**
541
+ ```markdown
542
+ ## Primary Language: Python 3.13+
543
+ - ML Framework: scikit-learn + XGBoost
544
+ - Data: pandas + Polars for processing
545
+ - Notebooks: Jupyter with nbval validation
546
+ - Testing: pytest for pipeline tests (80% coverage)
547
+ ```
548
+
549
+ ---
550
+
551
+ ## Resources & Templates
552
+
553
+ ### Quick Generator (for project-manager agent)
554
+
555
+ When invoking from `/alfred:0-project`:
556
+
557
+ 1. **Ask: What's your project type?**
558
+ - Options: Web App, Mobile App, CLI Tool, Library, Data Science
559
+
560
+ 2. **Ask: Who are your primary users?**
561
+ - Text input: Free-form description
562
+
563
+ 3. **Ask: What problem does it solve?**
564
+ - Text input: 1-2 sentence problem statement
565
+
566
+ 4. **Ask: How will you measure success?**
567
+ - Suggestions based on project type:
568
+ - Web App: Adoption rate, feature velocity, user engagement
569
+ - Mobile App: DAU/MAU, app store rating, retention rate, download count
570
+ - CLI: Downloads, performance benchmarks, ecosystem adoption
571
+ - Library: npm downloads, community contributions, GitHub stars
572
+ - Data Science: Model accuracy, data quality, inference latency
573
+
574
+ 5. **Generate**:
575
+ - Create product.md with user inputs
576
+ - Generate structure.md template for their architecture
577
+ - Create tech.md with recommended stack for their type
578
+
579
+ 6. **Offer next step**: `/alfred:1-plan` to create first SPEC
580
+
581
+ ---
582
+
583
+ ## Integration with Alfred Workflow
584
+
585
+ **When invoked:**
586
+ ```python
587
+ # In project-manager agent during /alfred:0-project
588
+ Skill("moai-project-documentation")
589
+ → Ask project type
590
+ → Gather user inputs
591
+ → Generate .moai/project/product.md
592
+ → Generate .moai/project/structure.md
593
+ → Generate .moai/project/tech.md
594
+ ```
595
+
596
+ **Output files:**
597
+ ```
598
+ .moai/project/
599
+ ├── product.md (generated from user input + project type)
600
+ ├── structure.md (template + user architecture choices)
601
+ └── tech.md (recommended stack + quality gates)
602
+ ```
603
+
604
+ ---
605
+
606
+ ## Versioning & Updates
607
+
608
+ **When to update this Skill:**
609
+ - New programming languages added to MoAI
610
+ - New project type examples needed
611
+ - Quality gate standards change
612
+ - Package management tools evolve
613
+
614
+ **Current version:** 0.1.0 (2025-11-04)
615
+
616
+ ---
617
+
618
+ ## Further Reading
619
+
620
+ - EARS requirement authoring: moai-foundation-ears
621
+ - SPEC creation guide: moai-spec-authoring
622
+ - Project initialization: moai-project-init-flow