moai-adk 0.3.13__py3-none-any.whl → 0.4.1__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (141) hide show
  1. moai_adk/__init__.py +1 -1
  2. moai_adk/__main__.py +1 -1
  3. moai_adk/cli/commands/__init__.py +1 -1
  4. moai_adk/cli/commands/doctor.py +2 -2
  5. moai_adk/cli/commands/init.py +10 -5
  6. moai_adk/cli/commands/status.py +1 -1
  7. moai_adk/cli/commands/update.py +210 -8
  8. moai_adk/cli/prompts/init_prompts.py +15 -19
  9. moai_adk/core/__init__.py +1 -1
  10. moai_adk/core/diagnostics/slash_commands.py +1 -1
  11. moai_adk/core/git/branch.py +1 -1
  12. moai_adk/core/git/manager.py +1 -1
  13. moai_adk/core/project/backup_utils.py +1 -0
  14. moai_adk/core/project/phase_executor.py +3 -1
  15. moai_adk/core/project/validator.py +3 -2
  16. moai_adk/core/quality/__init__.py +1 -1
  17. moai_adk/core/quality/trust_checker.py +1 -1
  18. moai_adk/core/quality/validators/__init__.py +1 -1
  19. moai_adk/core/quality/validators/base_validator.py +1 -1
  20. moai_adk/core/template/__init__.py +1 -1
  21. moai_adk/core/template/backup.py +12 -3
  22. moai_adk/core/template/config.py +24 -0
  23. moai_adk/core/template/languages.py +1 -1
  24. moai_adk/core/template/merger.py +74 -4
  25. moai_adk/core/template/processor.py +62 -14
  26. moai_adk/templates/.claude/agents/alfred/cc-manager.md +765 -191
  27. moai_adk/templates/.claude/agents/alfred/debug-helper.md +116 -103
  28. moai_adk/templates/.claude/agents/alfred/doc-syncer.md +130 -116
  29. moai_adk/templates/.claude/agents/alfred/git-manager.md +186 -174
  30. moai_adk/templates/.claude/agents/alfred/implementation-planner.md +227 -213
  31. moai_adk/templates/.claude/agents/alfred/project-manager.md +205 -125
  32. moai_adk/templates/.claude/agents/alfred/quality-gate.md +224 -209
  33. moai_adk/templates/.claude/agents/alfred/spec-builder.md +174 -160
  34. moai_adk/templates/.claude/agents/alfred/tag-agent.md +151 -139
  35. moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +209 -196
  36. moai_adk/templates/.claude/agents/alfred/trust-checker.md +247 -233
  37. moai_adk/templates/.claude/commands/alfred/0-project.md +856 -355
  38. moai_adk/templates/.claude/commands/alfred/1-plan.md +572 -0
  39. moai_adk/templates/.claude/commands/alfred/2-run.md +470 -0
  40. moai_adk/templates/.claude/commands/alfred/3-sync.md +366 -356
  41. moai_adk/templates/.claude/hooks/alfred/README.md +52 -52
  42. moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +44 -48
  43. moai_adk/templates/.claude/hooks/alfred/core/__init__.py +17 -17
  44. moai_adk/templates/.claude/hooks/alfred/core/checkpoint.py +59 -59
  45. moai_adk/templates/.claude/hooks/alfred/core/context.py +19 -19
  46. moai_adk/templates/.claude/hooks/alfred/core/project.py +52 -52
  47. moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +1 -1
  48. moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +4 -4
  49. moai_adk/templates/.claude/hooks/alfred/handlers/session.py +30 -51
  50. moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +16 -17
  51. moai_adk/templates/.claude/hooks/alfred/handlers/user.py +11 -11
  52. moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +308 -307
  53. moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +297 -296
  54. moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +191 -190
  55. moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +112 -0
  56. moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +103 -0
  57. moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +103 -0
  58. moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +95 -0
  59. moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +99 -0
  60. moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +105 -0
  61. moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +97 -0
  62. moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +97 -0
  63. moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +90 -0
  64. moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +99 -0
  65. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +87 -0
  66. moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +62 -0
  67. moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +94 -0
  68. moai_adk/templates/.claude/skills/moai-claude-code/examples.md +513 -0
  69. moai_adk/templates/.claude/skills/moai-claude-code/reference.md +433 -0
  70. moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +332 -0
  71. moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +384 -0
  72. moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +363 -0
  73. moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +595 -0
  74. moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +496 -0
  75. moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +99 -0
  76. moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +95 -0
  77. moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +98 -0
  78. moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +100 -0
  79. moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +100 -0
  80. moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +99 -0
  81. moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +99 -0
  82. moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +93 -0
  83. moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +105 -0
  84. moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -0
  85. moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +102 -0
  86. moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +104 -0
  87. moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +96 -0
  88. moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +112 -0
  89. moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +98 -0
  90. moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +90 -0
  91. moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +94 -0
  92. moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +93 -0
  93. moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +86 -0
  94. moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +86 -0
  95. moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +100 -0
  96. moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +100 -0
  97. moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +102 -0
  98. moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +100 -0
  99. moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +98 -0
  100. moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +99 -0
  101. moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +100 -0
  102. moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +100 -0
  103. moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +98 -0
  104. moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +96 -0
  105. moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +98 -0
  106. moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +99 -0
  107. moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +98 -0
  108. moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +98 -0
  109. moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +96 -0
  110. moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +99 -0
  111. moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +99 -0
  112. moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +100 -0
  113. moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +100 -0
  114. moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +100 -0
  115. moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +100 -0
  116. moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +99 -0
  117. moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +96 -0
  118. moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +44 -43
  119. moai_adk/templates/.github/workflows/moai-gitflow.yml +36 -35
  120. moai_adk/templates/.moai/config.json +9 -6
  121. moai_adk/templates/.moai/memory/development-guide.md +220 -221
  122. moai_adk/templates/.moai/memory/gitflow-protection-policy.md +85 -85
  123. moai_adk/templates/.moai/memory/spec-metadata.md +149 -150
  124. moai_adk/templates/.moai/project/product.md +90 -90
  125. moai_adk/templates/.moai/project/structure.md +85 -85
  126. moai_adk/templates/.moai/project/tech.md +117 -117
  127. moai_adk/templates/CLAUDE.md +354 -573
  128. moai_adk/templates/__init__.py +1 -1
  129. moai_adk/utils/__init__.py +1 -1
  130. moai_adk/utils/banner.py +7 -7
  131. moai_adk/utils/logger.py +1 -1
  132. moai_adk-0.4.1.dist-info/METADATA +303 -0
  133. moai_adk-0.4.1.dist-info/RECORD +152 -0
  134. moai_adk/templates/.claude/commands/alfred/1-spec.md +0 -532
  135. moai_adk/templates/.claude/commands/alfred/2-build.md +0 -432
  136. moai_adk/templates/.moai/hooks/pre-push.sample +0 -88
  137. moai_adk-0.3.13.dist-info/METADATA +0 -1586
  138. moai_adk-0.3.13.dist-info/RECORD +0 -90
  139. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/WHEEL +0 -0
  140. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/entry_points.txt +0 -0
  141. {moai_adk-0.3.13.dist-info → moai_adk-0.4.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,97 @@
1
+ ---
2
+
3
+ name: moai-domain-web-api
4
+ description: REST API and GraphQL design patterns with authentication, versioning, and OpenAPI documentation. Use when working on web API contracts scenarios.
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ ---
9
+
10
+ # Web API Expert
11
+
12
+ ## Skill Metadata
13
+ | Field | Value |
14
+ | ----- | ----- |
15
+ | Allowed tools | Read (read_file), Bash (terminal) |
16
+ | Auto-load | On demand for API delivery |
17
+ | Trigger cues | REST/GraphQL design, contract testing, versioning, integration hardening. |
18
+ | Tier | 4 |
19
+
20
+ ## What it does
21
+
22
+ Provides expertise in designing and implementing RESTful APIs and GraphQL services, including authentication mechanisms (JWT, OAuth2), API versioning strategies, and OpenAPI documentation.
23
+
24
+ ## When to use
25
+
26
+ - Engages when designing or validating web APIs and their lifecycle controls.
27
+ - “API design”, “REST API pattern”, “GraphQL schema”, “JWT authentication”
28
+ - Automatically invoked when working with API projects
29
+ - Web API SPEC implementation (`/alfred:2-run`)
30
+
31
+ ## How it works
32
+
33
+ **REST API Design**:
34
+ - **RESTful principles**: Resource-based URLs, HTTP verbs (GET, POST, PUT, DELETE)
35
+ - **Status codes**: Proper use of 2xx, 4xx, 5xx codes
36
+ - **HATEOAS**: Hypermedia links in responses
37
+ - **Pagination**: Cursor-based or offset-based
38
+
39
+ **GraphQL Design**:
40
+ - **Schema definition**: Types, queries, mutations, subscriptions
41
+ - **Resolver implementation**: Data fetching logic
42
+ - **N+1 problem**: DataLoader for batching
43
+ - **Schema stitching**: Federated GraphQL
44
+
45
+ **Authentication & Authorization**:
46
+ - **JWT (JSON Web Token)**: Stateless authentication
47
+ - **OAuth2**: Authorization framework (flows: authorization code, client credentials)
48
+ - **API keys**: Simple authentication
49
+ - **RBAC/ABAC**: Role/Attribute-based access control
50
+
51
+ **API Versioning**:
52
+ - **URL versioning**: /v1/users, /v2/users
53
+ - **Header versioning**: Accept: application/vnd.api.v2+json
54
+ - **Deprecation strategy**: Sunset header
55
+
56
+ **Documentation**:
57
+ - **OpenAPI (Swagger)**: API specification
58
+ - **API documentation**: Auto-generated docs
59
+ - **Postman collections**: Request examples
60
+
61
+ ## Examples
62
+ ```bash
63
+ $ uvicorn app.main:app --reload
64
+ $ newman run postman_collection.json
65
+ ```
66
+
67
+ ## Inputs
68
+ - Domain-related design documents and user requirements.
69
+ - Project technology stack and operational constraints.
70
+
71
+ ## Outputs
72
+ - Domain-specific architecture or implementation guidelines.
73
+ - Recommended list of associated sub-agents/skills.
74
+
75
+ ## Failure Modes
76
+ - When the domain document does not exist or is ambiguous.
77
+ - When the project strategy is unconfirmed and cannot be specified.
78
+
79
+ ## Dependencies
80
+ - `.moai/project/` document and latest technical briefing are required.
81
+
82
+ ## References
83
+ - Microsoft. "REST API Design Guidelines." https://learn.microsoft.com/azure/architecture/best-practices/api-design (accessed 2025-03-29).
84
+ - OpenAPI Initiative. "OpenAPI Specification." https://spec.openapis.org/oas/latest.html (accessed 2025-03-29).
85
+
86
+ ## Changelog
87
+ - 2025-03-29: Codified input/output and failure responses for domain skills.
88
+
89
+ ## Works well with
90
+
91
+ - alfred-trust-validation (API security validation)
92
+ - backend-expert (server implementation)
93
+ - security-expert (authentication patterns)
94
+
95
+ ## Best Practices
96
+ - Record supporting documentation (version/link) for each domain decision.
97
+ - Review performance, security, and operational requirements simultaneously at an early stage.
@@ -0,0 +1,102 @@
1
+ ---
2
+
3
+ name: moai-essentials-debug
4
+ description: Advanced debugging with stack trace analysis, error pattern detection, and fix suggestions. Use when delivering quick diagnostic support for everyday issues.
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ - Edit
10
+ - TodoWrite
11
+ ---
12
+
13
+ # Alfred Debugger Pro
14
+
15
+ ## Skill Metadata
16
+ | Field | Value |
17
+ | ----- | ----- |
18
+ | Allowed tools | Read (read_file), Write (write_file), Edit (edit_file), Bash (terminal), TodoWrite (todo_write) |
19
+ | Auto-load | On demand during Run stage (debug-helper) |
20
+ | Trigger cues | Runtime error triage, stack trace analysis, root cause investigation requests. |
21
+
22
+ ## What it does
23
+
24
+ Advanced debugging support with stack trace analysis, common error pattern detection, and actionable fix suggestions.
25
+
26
+ ## When to use
27
+
28
+ - Loads when users share stack traces or ask why a failure occurred.
29
+ - “Resolve the error”, “What is the cause of this error?”, “Stack trace analysis”
30
+ - Automatically invoked on runtime errors (via debug-helper sub-agent)
31
+ - "Why not?", "Solving NullPointerException"
32
+
33
+ ## How it works
34
+
35
+ **Stack Trace Analysis**:
36
+ ```python
37
+ # Error example
38
+ jwt.exceptions.ExpiredSignatureError: Signature has expired
39
+
40
+ # Alfred Analysis
41
+ 📍 Error Location: src/auth/service.py:142
42
+ 🔍 Root Cause: JWT token has expired
43
+ 💡 Fix Suggestion:
44
+ 1. Implement token refresh logic
45
+ 2. Check expiration before validation
46
+ 3. Handle ExpiredSignatureError gracefully
47
+ ```
48
+
49
+ **Common Error Patterns**:
50
+ - `NullPointerException` → Optional usage, guard clauses
51
+ - `IndexError` → Boundary checks
52
+ - `KeyError` → `.get()` with defaults
53
+ - `TypeError` → Type hints, input validation
54
+ - `ConnectionError` → Retry logic, timeouts
55
+
56
+ **Debugging Checklist**:
57
+ - [ ] Reproducible?
58
+ - [ ] Log messages?
59
+ - [ ] Input data?
60
+ - [ ] Recent changes?
61
+ - [ ] Dependency versions?
62
+
63
+ **Language-specific Tips**:
64
+ - **Python**: Logging, type guards
65
+ - **TypeScript**: Type guards, null checks
66
+ - **Java**: Optional, try-with-resources
67
+
68
+ ## Examples
69
+ ```markdown
70
+ - Checks the current diff and lists items that can be modified immediately.
71
+ - Schedule follow-up tasks with TodoWrite.
72
+ ```
73
+
74
+ ## Inputs
75
+ - A snapshot of the code/tests/documentation you are currently working on.
76
+ - Ongoing agent status information.
77
+
78
+ ## Outputs
79
+ - Immediately actionable checklists or improvement suggestions.
80
+ - Recommendations on whether to take next steps or not.
81
+
82
+ ## Failure Modes
83
+ - If you cannot find the required files or test results.
84
+ - When the scope of work is excessively large and cannot be resolved with simple support.
85
+
86
+ ## Dependencies
87
+ - Mainly used in conjunction with `tdd-implementer`, `quality-gate`, etc.
88
+
89
+ ## References
90
+ - Microsoft. "Debugging Techniques." https://learn.microsoft.com/visualstudio/debugger/ (accessed 2025-03-29).
91
+ - JetBrains. "Debugging Code." https://www.jetbrains.com/help/idea/debugging-code.html (accessed 2025-03-29).
92
+
93
+ ## Changelog
94
+ - 2025-03-29: Overhauled input/output definitions for Essentials skills.
95
+
96
+ ## Works well with
97
+
98
+ - moai-essentials-refactor
99
+
100
+ ## Best Practices
101
+ - Record results, even for simple improvements, to increase traceability.
102
+ - Clearly mark items that require human review to distinguish them from automation.
@@ -0,0 +1,104 @@
1
+ ---
2
+
3
+ name: moai-essentials-perf
4
+ description: Performance optimization with profiling, bottleneck detection, and tuning strategies. Use when performing baseline performance reviews.
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ - Edit
10
+ - TodoWrite
11
+ ---
12
+
13
+ # Alfred Performance Optimizer
14
+
15
+ ## Skill Metadata
16
+ | Field | Value |
17
+ | ----- | ----- |
18
+ | Allowed tools | Read (read_file), Write (write_file), Edit (edit_file), Bash (terminal), TodoWrite (todo_write) |
19
+ | Auto-load | On demand during Run stage (performance triage) |
20
+ | Trigger cues | Latency complaints, profiling requests, throughput bottleneck analysis. |
21
+
22
+ ## What it does
23
+
24
+ Performance analysis and optimization with profiling tools, bottleneck detection, and language-specific optimization techniques.
25
+
26
+ ## When to use
27
+
28
+ - Loads when diagnosing performance regressions or planning optimization work.
29
+ - “Improve performance”, “Find slow parts”, “How to optimize?”
30
+ - “Profiling”, “Bottleneck”, “Memory leak”
31
+
32
+ ## How it works
33
+
34
+ **Profiling Tools**:
35
+ - **Python**: cProfile, memory_profiler
36
+ - **TypeScript**: Chrome DevTools, clinic.js
37
+ - **Java**: JProfiler, VisualVM
38
+ - **Go**: pprof
39
+ - **Rust**: flamegraph, criterion
40
+
41
+ **Common Performance Issues**:
42
+ - **N+1 Query Problem**: Use eager loading/joins
43
+ - **Inefficient Loop**: O(n²) → O(n) with Set/Map
44
+ - **Memory Leak**: Remove event listeners, close connections
45
+
46
+ **Optimization Checklist**:
47
+ - [ ] Current performance benchmark
48
+ - [ ] Bottleneck identification
49
+ - [ ] Profiling data collected
50
+ - [ ] Algorithm complexity improved (O(n²) → O(n))
51
+ - [ ] Unnecessary operations removed
52
+ - [ ] Caching applied
53
+ - [ ] Async processing introduced
54
+ - [ ] Post-optimization benchmark
55
+ - [ ] Side effects checked
56
+
57
+ **Language-specific Optimizations**:
58
+ - **Python**: List comprehension, generators, @lru_cache
59
+ - **TypeScript**: Memoization, lazy loading, code splitting
60
+ - **Java**: Stream API, parallel processing
61
+ - **Go**: Goroutines, buffered channels
62
+ - **Rust**: Zero-cost abstractions, borrowing
63
+
64
+ **Performance Targets**:
65
+ - API response time: <200ms (P95)
66
+ - Page load time: <2s
67
+ - Memory usage: <512MB
68
+ - CPU usage: <70%
69
+
70
+ ## Examples
71
+ ```markdown
72
+ - Checks the current diff and lists items that can be modified immediately.
73
+ - Schedule follow-up tasks with TodoWrite.
74
+ ```
75
+
76
+ ## Inputs
77
+ - A snapshot of the code/tests/documentation you are currently working on.
78
+ - Ongoing agent status information.
79
+
80
+ ## Outputs
81
+ - Immediately actionable checklists or improvement suggestions.
82
+ - Recommendations on whether to take next steps or not.
83
+
84
+ ## Failure Modes
85
+ - If you cannot find the required files or test results.
86
+ - When the scope of work is excessively large and cannot be resolved with simple support.
87
+
88
+ ## Dependencies
89
+ - Mainly used in conjunction with `tdd-implementer`, `quality-gate`, etc.
90
+
91
+ ## References
92
+ - Google SRE. "The Four Golden Signals." https://sre.google/sre-book/monitoring-distributed-systems/ (accessed 2025-03-29).
93
+ - Dynatrace. "Application Performance Monitoring Best Practices." https://www.dynatrace.com/resources/ebooks/ (accessed 2025-03-29).
94
+
95
+ ## Changelog
96
+ - 2025-03-29: Overhauled input/output definitions for Essentials skills.
97
+
98
+ ## Works well with
99
+
100
+ - moai-essentials-refactor
101
+
102
+ ## Best Practices
103
+ - Record results, even for simple improvements, to increase traceability.
104
+ - Clearly mark items that require human review to distinguish them from automation.
@@ -0,0 +1,96 @@
1
+ ---
2
+
3
+ name: moai-essentials-refactor
4
+ description: Refactoring guidance with design patterns and code improvement strategies. Use when planning incremental refactors with safety nets.
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ - Edit
10
+ - TodoWrite
11
+ ---
12
+
13
+ # Alfred Refactoring Coach
14
+
15
+ ## Skill Metadata
16
+ | Field | Value |
17
+ | ----- | ----- |
18
+ | Allowed tools | Read (read_file), Write (write_file), Edit (edit_file), Bash (terminal), TodoWrite (todo_write) |
19
+ | Auto-load | On demand during Run stage (refactor planning) |
20
+ | Trigger cues | Refactoring plans, code smell cleanup, design pattern coaching. |
21
+
22
+ ## What it does
23
+
24
+ Refactoring guidance with design pattern recommendations, code smell detection, and step-by-step improvement plans.
25
+
26
+ ## When to use
27
+
28
+ - Loads when the user asks how to restructure code or apply design patterns.
29
+ - “Help with refactoring”, “How can I improve this code?”, “Apply design patterns”
30
+ - “Code organization”, “Remove duplication”, “Separate functions”
31
+
32
+ ## How it works
33
+
34
+ **Refactoring Techniques**:
35
+ - **Extract Method**: Separate long methods
36
+ - **Replace Conditional with Polymorphism**: Remove conditional statements
37
+ - **Introduce Parameter Object**: Group parameters
38
+ - **Extract Class**: Massive class separation
39
+
40
+ **Design Pattern Recommendations**:
41
+ - Complex object creation → **Builder Pattern**
42
+ - Type-specific behavior → **Strategy Pattern**
43
+ - Global state → **Singleton Pattern**
44
+ - Incompatible interfaces → **Adapter Pattern**
45
+ - Delayed object creation → **Factory Pattern**
46
+
47
+ **3-Strike Rule**:
48
+ ```
49
+ 1st occurrence: Just implement
50
+ 2nd occurrence: Notice similarity (leave as-is)
51
+ 3rd occurrence: Pattern confirmed → Refactor! 🔧
52
+ ```
53
+
54
+ **Refactoring Checklist**:
55
+ - [ ] All tests passing before refactoring
56
+ - [ ] Code smells identified
57
+ - [ ] Refactoring goal clear
58
+ - [ ] Change one thing at a time
59
+ - [ ] Run tests after each change
60
+ - [ ] Commit frequently
61
+
62
+ ## Examples
63
+ ```markdown
64
+ - Checks the current diff and lists items that can be modified immediately.
65
+ - Schedule follow-up tasks with TodoWrite.
66
+ ```
67
+
68
+ ## Inputs
69
+ - A snapshot of the code/tests/documentation you are currently working on.
70
+ - Ongoing agent status information.
71
+
72
+ ## Outputs
73
+ - Immediately actionable checklists or improvement suggestions.
74
+ - Recommendations on whether to take next steps or not.
75
+
76
+ ## Failure Modes
77
+ - If you cannot find the required files or test results.
78
+ - When the scope of work is excessively large and cannot be resolved with simple support.
79
+
80
+ ## Dependencies
81
+ - Mainly used in conjunction with `tdd-implementer`, `quality-gate`, etc.
82
+
83
+ ## References
84
+ - Fowler, Martin. "Refactoring: Improving the Design of Existing Code." Addison-Wesley, 2018.
85
+ - IEEE Software. "Managing Technical Debt." IEEE Software, 2021.
86
+
87
+ ## Changelog
88
+ - 2025-03-29: Overhauled input/output definitions for Essentials skills.
89
+
90
+ ## Works well with
91
+
92
+ - moai-essentials-review
93
+
94
+ ## Best Practices
95
+ - Record results, even for simple improvements, to increase traceability.
96
+ - Clearly mark items that require human review to distinguish them from automation.
@@ -0,0 +1,112 @@
1
+ ---
2
+
3
+ name: moai-essentials-review
4
+ description: Automated code review with SOLID principles, code smells, and language-specific best practices. Use when preparing concise review checklists for code changes.
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ - Edit
10
+ - TodoWrite
11
+ ---
12
+
13
+ # Alfred Code Reviewer
14
+
15
+ ## Skill Metadata
16
+ | Field | Value |
17
+ | ----- | ----- |
18
+ | Allowed tools | Read (read_file), Write (write_file), Edit (edit_file), Bash (terminal), TodoWrite (todo_write) |
19
+ | Auto-load | On demand during Sync stage (review gate) |
20
+ | Trigger cues | Code review requests, quality checklist preparation, merge readiness checks. |
21
+
22
+ ## What it does
23
+
24
+ Automated code review with language-specific best practices, SOLID principles verification, and code smell detection.
25
+
26
+ ## When to use
27
+
28
+ - Loads when someone asks for a code review or a pre-merge quality assessment.
29
+ - “Please review the code”, “How can this code be improved?”, “Check the code quality”
30
+ - Optionally invoked after `/alfred:3-sync`
31
+ - Before merging PR
32
+
33
+ ## How it works
34
+
35
+ **Code Constraints Check**:
36
+ - File ≤300 LOC
37
+ - Function ≤50 LOC
38
+ - Parameters ≤5
39
+ - Cyclomatic complexity ≤10
40
+
41
+ **SOLID Principles**:
42
+ - Single Responsibility
43
+ - Open/Closed
44
+ - Liskov Substitution
45
+ - Interface Segregation
46
+ - Dependency Inversion
47
+
48
+ **Code Smell Detection**:
49
+ - Long Method
50
+ - Large Class
51
+ - Duplicate Code
52
+ - Dead Code
53
+ - Magic Numbers
54
+
55
+ **Language-specific Best Practices**:
56
+ - Python: List comprehension, type hints, PEP 8
57
+ - TypeScript: Strict typing, async/await, error handling
58
+ - Java: Streams API, Optional, Design patterns
59
+
60
+ **Review Report**:
61
+ ```markdown
62
+ ## Code Review Report
63
+
64
+ ### 🔴 Critical Issues (3)
65
+ 1. **src/auth/service.py:45** - Function too long (85 > 50 LOC)
66
+ 2. **src/api/handler.ts:120** - Missing error handling
67
+ 3. **src/db/repository.java:200** - Magic number
68
+
69
+ ### ⚠️ Warnings (5)
70
+ 1. **src/utils/helper.py:30** - Unused import
71
+
72
+ ### ✅ Good Practices Found
73
+ - Test coverage: 92%
74
+ - Consistent naming
75
+ ```
76
+
77
+ ## Examples
78
+ ```markdown
79
+ - Checks the current diff and lists items that can be modified immediately.
80
+ - Schedule follow-up tasks with TodoWrite.
81
+ ```
82
+
83
+ ## Inputs
84
+ - A snapshot of the code/tests/documentation you are currently working on.
85
+ - Ongoing agent status information.
86
+
87
+ ## Outputs
88
+ - Immediately actionable checklists or improvement suggestions.
89
+ - Recommendations on whether to take next steps or not.
90
+
91
+ ## Failure Modes
92
+ - If you cannot find the required files or test results.
93
+ - When the scope of work is excessively large and cannot be resolved with simple support.
94
+
95
+ ## Dependencies
96
+ - Mainly used in conjunction with `tdd-implementer`, `quality-gate`, etc.
97
+
98
+ ## References
99
+ - IEEE. "Recommended Practice for Software Reviews." IEEE 1028-2008.
100
+ - Cisco. "Peer Review Best Practices." https://www.cisco.com/c/en/us/support/docs/optical/ons-15454-esc/15114-peer-review.html (accessed 2025-03-29).
101
+
102
+ ## Changelog
103
+ - 2025-03-29: Overhauled input/output definitions for Essentials skills.
104
+
105
+ ## Works well with
106
+
107
+ - moai-foundation-specs
108
+ - moai-essentials-refactor
109
+
110
+ ## Best Practices
111
+ - Record results, even for simple improvements, to increase traceability.
112
+ - Clearly mark items that require human review to distinguish them from automation.
@@ -0,0 +1,98 @@
1
+ ---
2
+
3
+ name: moai-foundation-ears
4
+ description: EARS requirement authoring guide (Ubiquitous/Event/State/Optional/Constraints). Use when teams need guidance on EARS requirements structure.
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ - Edit
10
+ - TodoWrite
11
+ ---
12
+
13
+ # Alfred EARS Authoring Guide
14
+
15
+ ## Skill Metadata
16
+ | Field | Value |
17
+ | ----- | ----- |
18
+ | Allowed tools | Read (read_file), Write (write_file), Edit (edit_file), Bash (terminal), TodoWrite (todo_write) |
19
+ | Auto-load | SessionStart (foundation bootstrap) |
20
+ | Trigger cues | Requests to draft or refine EARS-style requirements, “write spec”, or “requirements format” cues. |
21
+
22
+ ## What it does
23
+
24
+ EARS (Easy Approach to Requirements Syntax) authoring guide for writing clear, testable requirements using 5 statement patterns.
25
+
26
+ ## When to use
27
+
28
+ - Activates whenever the user asks to draft structured requirements or mentions EARS syntax.
29
+ - “Writing SPEC”, “Requirements summary”, “EARS syntax”
30
+ - Automatically invoked by `/alfred:1-plan`
31
+ - When writing or refining SPEC documents
32
+
33
+ ## How it works
34
+
35
+ EARS provides 5 statement patterns for structured requirements:
36
+
37
+ ### 1. Ubiquitous (Basic Requirements)
38
+ **Format**: The system must provide [function]
39
+ **Example**: The system must provide user authentication function
40
+
41
+ ### 2. Event-driven (event-based)
42
+ **Format**: WHEN If [condition], the system must [operate]
43
+ **Example**: WHEN When the user logs in, the system must issue a JWT token
44
+
45
+ ### 3. State-driven
46
+ **Format**: WHILE When in [state], the system must [operate]
47
+ **Example**: WHILE When the user is authenticated, the system must allow access to protected resources
48
+
49
+ ### 4. Optional (Optional function)
50
+ **Format**: If WHERE [condition], the system can [operate]
51
+ **Example**: If WHERE refresh token is provided, the system can issue a new access token
52
+
53
+ ### 5. Constraints
54
+ **Format**: IF [condition], the system SHOULD [constrain]
55
+ **Example**: IF an invalid token is provided, the system SHOULD deny access
56
+
57
+ ## Writing Tips
58
+
59
+ ✅ Be specific and measurable
60
+ ✅ Avoid vague terms (“adequate”, “sufficient”, “fast”)
61
+ ✅ One requirement per statement
62
+ ✅ Make it testable
63
+
64
+ ## Examples
65
+ ```markdown
66
+ - Scan standard documents and report missing sections.
67
+ - Changed regulations are reflected in CLAUDE.md.
68
+ ```
69
+
70
+ ## Inputs
71
+ - Project standard documents (e.g. `CLAUDE.md`, `.moai/config.json`).
72
+ - Latest printouts from relevant sub-agents.
73
+
74
+ ## Outputs
75
+ - Templates or policy summaries conforming to the MoAI-ADK standard.
76
+ - Reusable rules/checklists.
77
+
78
+ ## Failure Modes
79
+ - When required standard files are missing or have limited access rights.
80
+ - When conflicting policies are detected and coordination is required.
81
+
82
+ ## Dependencies
83
+ - There is great synergy when called together with cc-manager.
84
+
85
+ ## References
86
+ - Mavin, A., et al. "Easy Approach to Requirements Syntax (EARS)." IEEE RE, 2009.
87
+ - INCOSE. "Guide for Writing Requirements." INCOSE-TP-2010-006-02 (accessed 2025-03-29).
88
+
89
+ ## Changelog
90
+ - 2025-03-29: Foundation skill templates have been enhanced to align with best practice structures.
91
+
92
+ ## Works well with
93
+
94
+ - moai-foundation-specs
95
+
96
+ ## Best Practices
97
+ - When changing standards, the reason for change and supporting documents are recorded.
98
+ - Follow the single source principle and avoid modifying the same item in multiple places.
@@ -0,0 +1,90 @@
1
+ ---
2
+
3
+ name: moai-foundation-git
4
+ description: Git workflow automation (branching, TDD commits, PR management). Use when standardizing Git practices across the project.
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ - Edit
10
+ - TodoWrite
11
+ ---
12
+
13
+ # Alfred Git Workflow
14
+
15
+ ## Skill Metadata
16
+ | Field | Value |
17
+ | ----- | ----- |
18
+ | Allowed tools | Read (read_file), Write (write_file), Edit (edit_file), Bash (terminal), TodoWrite (todo_write) |
19
+ | Auto-load | SessionStart (foundation bootstrap) |
20
+ | Trigger cues | Branch creation, commit convention, PR readiness, and release gating requests. |
21
+
22
+ ## What it does
23
+
24
+ Automates Git operations following MoAI-ADK conventions: branch creation, locale-based TDD commits, Draft PR creation, and PR Ready transition.
25
+
26
+ ## When to use
27
+
28
+ - Activates when Git workflow automation is needed for branching, commits, or PR promotion.
29
+ - “Create branch”, “Create PR”, “Create commit”
30
+ - Automatically invoked by `/alfred:1-plan`, `/alfred:2-run`, `/alfred:3-sync`
31
+ - Git workflow automation needed
32
+
33
+ ## How it works
34
+
35
+ **1. Branch Creation**:
36
+ ```bash
37
+ git checkout develop
38
+ git checkout -b feature/SPEC-AUTH-001
39
+ ```
40
+
41
+ **2. Locale-based TDD Commits**:
42
+ - **Korean (ko)**: 🔴 RED: [Test Description]
43
+ - **English (en)**: 🔴 RED: [Test description]
44
+ - **Japanese (ja)**: 🔴 RED: [テスト説明]
45
+ - **Chinese (zh)**: 🔴 RED: [测试说明]
46
+
47
+ Configured via `.moai/config.json`:
48
+ ```json
49
+ {"project": {"locale": "ko"}}
50
+ ```
51
+
52
+ **3. Draft PR Creation**:
53
+ Creates Draft PR with SPEC reference and test checklist.
54
+
55
+ **4. PR Ready Transition** (via `/alfred:3-sync`):
56
+ - Updates PR from Draft → Ready
57
+ - Adds quality gate checklist
58
+ - Verifies TRUST 5-principles
59
+
60
+ ## Examples
61
+ ```markdown
62
+ - Scan standard documents and report missing sections.
63
+ - Changed regulations are reflected in CLAUDE.md.
64
+ ```
65
+
66
+ ## Best Practices
67
+ - When changing standards, the reason for change and supporting documents are recorded.
68
+ - Follow the single source principle and avoid modifying the same item in multiple places.
69
+
70
+ ## Inputs
71
+ - Project standard documents (e.g. `CLAUDE.md`, `.moai/config.json`).
72
+ - Latest printouts from relevant sub-agents.
73
+
74
+ ## Outputs
75
+ - Templates or policy summaries conforming to the MoAI-ADK standard.
76
+ - Reusable rules/checklists.
77
+
78
+ ## Failure Modes
79
+ - When required standard files are missing or have limited access rights.
80
+ - When conflicting policies are detected and coordination is required.
81
+
82
+ ## Dependencies
83
+ - There is great synergy when called together with cc-manager.
84
+
85
+ ## References
86
+ - Vincent Driessen. "A successful Git branching model." https://nvie.com/posts/a-successful-git-branching-model/ (accessed 2025-03-29).
87
+ - GitHub Docs. "GitHub Flow." https://docs.github.com/en/get-started/using-github/github-flow (accessed 2025-03-29).
88
+
89
+ ## Changelog
90
+ - 2025-03-29: Foundation skill templates have been enhanced to align with best practice structures.