moai-adk 0.4.0__py3-none-any.whl → 0.4.4__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.
- moai_adk/__init__.py +2 -3
- moai_adk/cli/commands/init.py +10 -5
- moai_adk/cli/commands/update.py +274 -118
- moai_adk/cli/prompts/init_prompts.py +14 -18
- moai_adk/core/diagnostics/slash_commands.py +1 -1
- moai_adk/core/project/backup_utils.py +2 -11
- moai_adk/core/project/checker.py +2 -2
- moai_adk/core/project/phase_executor.py +11 -14
- moai_adk/core/project/validator.py +3 -2
- moai_adk/core/quality/__init__.py +1 -1
- moai_adk/core/quality/trust_checker.py +63 -63
- moai_adk/core/quality/validators/__init__.py +1 -1
- moai_adk/core/quality/validators/base_validator.py +1 -1
- moai_adk/core/template/backup.py +21 -8
- moai_adk/core/template/merger.py +14 -4
- moai_adk/core/template/processor.py +24 -5
- moai_adk/templates/.claude/agents/alfred/cc-manager.md +446 -424
- moai_adk/templates/.claude/agents/alfred/debug-helper.md +116 -103
- moai_adk/templates/.claude/agents/alfred/doc-syncer.md +130 -116
- moai_adk/templates/.claude/agents/alfred/git-manager.md +186 -174
- moai_adk/templates/.claude/agents/alfred/implementation-planner.md +227 -213
- moai_adk/templates/.claude/agents/alfred/project-manager.md +216 -128
- moai_adk/templates/.claude/agents/alfred/quality-gate.md +224 -209
- moai_adk/templates/.claude/agents/alfred/spec-builder.md +174 -160
- moai_adk/templates/.claude/agents/alfred/tag-agent.md +151 -139
- moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +209 -196
- moai_adk/templates/.claude/agents/alfred/trust-checker.md +247 -233
- moai_adk/templates/.claude/commands/alfred/0-project.md +756 -640
- moai_adk/templates/.claude/commands/alfred/1-plan.md +343 -333
- moai_adk/templates/.claude/commands/alfred/2-run.md +297 -285
- moai_adk/templates/.claude/commands/alfred/3-sync.md +387 -356
- moai_adk/templates/.claude/hooks/alfred/README.md +52 -52
- moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +44 -48
- moai_adk/templates/.claude/hooks/alfred/core/__init__.py +17 -17
- moai_adk/templates/.claude/hooks/alfred/core/checkpoint.py +59 -59
- moai_adk/templates/.claude/hooks/alfred/core/context.py +19 -19
- moai_adk/templates/.claude/hooks/alfred/core/project.py +52 -52
- moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +1 -1
- moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +4 -4
- moai_adk/templates/.claude/hooks/alfred/handlers/session.py +27 -27
- moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +16 -17
- moai_adk/templates/.claude/hooks/alfred/handlers/user.py +11 -11
- moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +308 -307
- moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +297 -296
- moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +191 -190
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +112 -0
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +103 -0
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +103 -0
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +95 -0
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +105 -0
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +97 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +97 -0
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +90 -0
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +99 -0
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +87 -0
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +62 -0
- moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +70 -43
- moai_adk/templates/.claude/skills/moai-claude-code/examples.md +141 -141
- moai_adk/templates/.claude/skills/moai-claude-code/reference.md +179 -165
- moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +78 -78
- moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +90 -90
- moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +39 -25
- moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +117 -74
- moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +131 -134
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +43 -11
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +43 -12
- moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +47 -11
- moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +47 -11
- moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +51 -14
- moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +46 -10
- moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +62 -25
- moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +44 -17
- moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +44 -14
- moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +45 -13
- moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +46 -14
- moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +48 -8
- moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +44 -11
- moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +44 -12
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +44 -12
- moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +44 -43
- moai_adk/templates/.github/workflows/moai-gitflow.yml +36 -35
- moai_adk/templates/.moai/config.json +9 -6
- moai_adk/templates/.moai/memory/development-guide.md +220 -221
- moai_adk/templates/.moai/memory/gitflow-protection-policy.md +85 -85
- moai_adk/templates/.moai/memory/spec-metadata.md +229 -150
- moai_adk/templates/.moai/project/product.md +90 -90
- moai_adk/templates/.moai/project/structure.md +85 -85
- moai_adk/templates/.moai/project/tech.md +117 -117
- moai_adk/templates/CLAUDE.md +564 -709
- moai_adk-0.4.4.dist-info/METADATA +369 -0
- moai_adk-0.4.4.dist-info/RECORD +152 -0
- moai_adk/templates/.claude/commands/alfred/1-spec.md +0 -31
- moai_adk/templates/.claude/commands/alfred/2-build.md +0 -30
- moai_adk/templates/.claude/skills/scripts/standardize_skills.py +0 -166
- moai_adk/templates/.claude/skills/scripts/verify_standardization.sh +0 -43
- moai_adk/templates/.moai/hooks/pre-push.sample +0 -88
- moai_adk-0.4.0.dist-info/METADATA +0 -1816
- moai_adk-0.4.0.dist-info/RECORD +0 -145
- {moai_adk-0.4.0.dist-info → moai_adk-0.4.4.dist-info}/WHEEL +0 -0
- {moai_adk-0.4.0.dist-info → moai_adk-0.4.4.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.4.0.dist-info → moai_adk-0.4.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,155 +1,156 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: Agentic Coding
|
|
3
|
-
description:
|
|
3
|
+
description: Agent-based coding mode that integrates hands-on development and collaboration
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Agentic Coding
|
|
7
|
+
> Interactive prompts rely on `Skill("moai-alfred-tui-survey")` so AskUserQuestion renders TUI selection menus for user surveys and approvals.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
**Audience**: Professional developers, team leaders, architects
|
|
9
10
|
|
|
10
|
-
Alfred SuperAgent
|
|
11
|
+
Alfred SuperAgent is an integrated coding mode that automatically switches between rapid development and collaboration by coordinating nine specialized agents.
|
|
11
12
|
|
|
12
13
|
## ▶◀ Alfred SuperAgent
|
|
13
14
|
|
|
14
|
-
Alfred
|
|
15
|
+
Alfred is the central orchestrator of MoAI-ADK, coordinating nine specialized agents.
|
|
15
16
|
|
|
16
|
-
### 9
|
|
17
|
+
### 9 professional agents
|
|
17
18
|
|
|
18
|
-
|
|
|
19
|
-
|
|
20
|
-
| **spec-builder** 🏗️
|
|
21
|
-
| **code-builder** 💎
|
|
22
|
-
| **doc-syncer** 📖
|
|
23
|
-
| **tag-agent** 🏷️
|
|
24
|
-
| **git-manager** 🚀
|
|
25
|
-
| **debug-helper** 🔬
|
|
26
|
-
| **trust-checker** ✅
|
|
27
|
-
| **cc-manager** 🛠️
|
|
28
|
-
| **project-manager** 📋 |
|
|
19
|
+
| agent | Job duties | Area of expertise | call |
|
|
20
|
+
| --------------------- | ---------------------- | --------------------------------- | ---------------------- |
|
|
21
|
+
| **spec-builder** 🏗️ | System Architect | SPEC Creation, EARS Specification | `/alfred:1-plan` |
|
|
22
|
+
| **code-builder** 💎 | Senior Developer | TDD Implementation | `/alfred:2-run` |
|
|
23
|
+
| **doc-syncer** 📖 | Technical writer | Document Synchronization | `/alfred:3-sync` |
|
|
24
|
+
| **tag-agent** 🏷️ | Knowledge Manager | TAG traceability | `@agent-tag-agent` |
|
|
25
|
+
| **git-manager** 🚀 | Release Engineer | Git workflow | `@agent-git-manager` |
|
|
26
|
+
| **debug-helper** 🔬 | Troubleshooting expert | Error Diagnosis | `@agent-debug-helper` |
|
|
27
|
+
| **trust-checker** ✅ | Quality Assurance Lead | TRUST verification | `@agent-trust-checker` |
|
|
28
|
+
| **cc-manager** 🛠️ | DevOps Engineer | Claude Code Settings | `@agent-cc-manager` |
|
|
29
|
+
| **project-manager** 📋 | Project Manager | Project initialization | `/alfred:0-project` |
|
|
29
30
|
|
|
30
|
-
### Alfred
|
|
31
|
+
### Alfred Orchestration
|
|
31
32
|
|
|
32
33
|
```
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
→
|
|
34
|
+
User request → Alfred analysis → Task routing
|
|
35
|
+
├─ Direct processing (simple inquiry)
|
|
36
|
+
├─ Single Agent (single expert delegation)
|
|
37
|
+
├─ Sequential (Sequential: 1-spec → 2-build → 3-sync)
|
|
38
|
+
└─ Parallel (Parallel: Test + Lint + Build)
|
|
39
|
+
→ Quality gate verification → Integrated reporting of Alfred results
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
##
|
|
42
|
+
## Two ways to work
|
|
42
43
|
|
|
43
|
-
### ⚡ Fast Mode (
|
|
44
|
+
### ⚡ Fast Mode (default)
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
**Automatic Activation**: Fast development, implementation-focused work
|
|
46
47
|
|
|
47
|
-
- SPEC → TDD → SYNC
|
|
48
|
-
-
|
|
49
|
-
- 8
|
|
50
|
-
- TRUST 5
|
|
51
|
-
-
|
|
48
|
+
- SPEC → TDD → SYNC automation
|
|
49
|
+
- Concise technical communication
|
|
50
|
+
- Support for 8 languages (TypeScript, Python, Go, Rust, Java, Dart, Swift, Kotlin)
|
|
51
|
+
- Automatic verification of TRUST 5 principles
|
|
52
|
+
- Real-time confirmation of TAG traceability
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
54
|
+
**Features**:
|
|
55
|
+
- Minimum instructions, maximum efficiency
|
|
56
|
+
- Decision-driven rather than trade-offs
|
|
57
|
+
- Automated quality gates
|
|
57
58
|
|
|
58
59
|
### 🤝 Collab Mode
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
**Automatically activated**: When detecting keywords “collaboration”, “brainstorming”, “design”, “review”, “opinion”, “what do you think”
|
|
61
62
|
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
63
|
+
- Question-based conversation
|
|
64
|
+
- Trade-off analysis
|
|
65
|
+
- Providing architecture diagrams
|
|
66
|
+
- Real-time code review
|
|
67
|
+
- Decision support
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
69
|
+
**Features**:
|
|
70
|
+
- Emphasis on equal partnership
|
|
71
|
+
- Presentation of various alternatives
|
|
72
|
+
- Tone of thinking together
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
**Mode Switching**: Automatically switched, no explicit switching required
|
|
74
75
|
|
|
75
|
-
##
|
|
76
|
+
## Core principles
|
|
76
77
|
|
|
77
|
-
- **SPEC
|
|
78
|
-
- **TAG
|
|
79
|
-
- **TRUST
|
|
80
|
-
-
|
|
81
|
-
-
|
|
78
|
+
- **SPEC priority**: Everything starts with @SPEC:ID (no specification, no code)
|
|
79
|
+
- **TAG integrity**: `rg` scan-based real-time verification (CODE-FIRST principle)
|
|
80
|
+
- **TRUST compliance**: 5-principle automatic verification and quality gate
|
|
81
|
+
- **Multilingual**: Supports 8 languages (TypeScript, Python, Go, Rust, Java, Dart, Swift, Kotlin)
|
|
82
|
+
- **Technical clarity**: Concise communication, trade-off-focused explanations
|
|
82
83
|
|
|
83
|
-
## 3
|
|
84
|
+
## 3-step workflow
|
|
84
85
|
|
|
85
|
-
### 1️⃣ SPEC
|
|
86
|
+
### 1️⃣ Write SPEC (`/alfred:1-plan`)
|
|
86
87
|
|
|
87
|
-
**Alfred → spec-builder
|
|
88
|
+
**Alfred → spec-builder delegation**:
|
|
88
89
|
|
|
89
90
|
```
|
|
90
|
-
|
|
91
|
+
Request: "Create AUTH-001 JWT Authentication System SPEC"
|
|
91
92
|
|
|
92
|
-
spec-builder
|
|
93
|
-
1.
|
|
94
|
-
2. EARS
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
Run spec-builder:
|
|
94
|
+
1. Check for duplicates: rg "@SPEC:AUTH-001" -n → No duplicates ✓
|
|
95
|
+
2. Write EARS syntax:
|
|
96
|
+
- Ubiquitous: The system must provide JWT-based authentication
|
|
97
|
+
- Event-driven: WHEN When valid credentials are provided, issue a JWT token
|
|
98
|
+
- Constraints: Token expiration time 30 minutes or less
|
|
98
99
|
3. YAML Front Matter + @SPEC:AUTH-001 TAG
|
|
99
|
-
4. HISTORY
|
|
100
|
-
5.
|
|
100
|
+
4. HISTORY section (v0.0.1 INITIAL)
|
|
101
|
+
5. Proposal to create Git branch: feature/spec-auth-001
|
|
101
102
|
|
|
102
|
-
|
|
103
|
+
User confirmation required → Proceed to create branch and save SPEC? (y/n)
|
|
103
104
|
```
|
|
104
105
|
|
|
105
|
-
|
|
106
|
+
**Generated results**:
|
|
106
107
|
- `.moai/specs/SPEC-AUTH-001/spec.md`
|
|
107
|
-
- `@SPEC:AUTH-001` TAG
|
|
108
|
-
- GitHub Issue
|
|
109
|
-
- Draft PR
|
|
108
|
+
- Assign `@SPEC:AUTH-001` TAG
|
|
109
|
+
- Create GitHub Issue (Team mode)
|
|
110
|
+
- Create Draft PR (Team mode)
|
|
110
111
|
|
|
111
|
-
**Collab Mode
|
|
112
|
+
**When Collab Mode is activated**:
|
|
112
113
|
```
|
|
113
|
-
💭
|
|
114
|
+
💭 Brainstorm authentication system approaches
|
|
114
115
|
|
|
115
|
-
1. JWT
|
|
116
|
-
2. Session
|
|
117
|
-
3. Hybrid:
|
|
116
|
+
1. JWT-based: Stateless, excellent scalability / difficult to invalidate tokens
|
|
117
|
+
2. Session-based: Easy central control / Increased server load
|
|
118
|
+
3. Hybrid: Combines the best of both worlds / Increases complexity
|
|
118
119
|
|
|
119
|
-
|
|
120
|
+
Which direction is better?
|
|
120
121
|
|
|
121
|
-
|
|
122
|
+
User: "Hybrid method"
|
|
122
123
|
|
|
123
|
-
Alfred:
|
|
124
|
+
Alfred: Good choice! If you summarize it in EARS phrase...
|
|
124
125
|
```
|
|
125
126
|
|
|
126
|
-
### 2️⃣ TDD
|
|
127
|
+
### 2️⃣ TDD implementation (`/alfred:2-run`)
|
|
127
128
|
|
|
128
|
-
**Alfred → code-builder
|
|
129
|
+
**Alfred → code-builder delegation**:
|
|
129
130
|
|
|
130
131
|
```
|
|
131
|
-
|
|
132
|
+
Request: "SPEC-AUTH-001 TDD Implementation"
|
|
132
133
|
|
|
133
|
-
Alfred
|
|
134
|
-
- SPEC
|
|
135
|
-
-
|
|
136
|
-
-
|
|
134
|
+
Alfred Analysis:
|
|
135
|
+
- SPEC Reference: SPEC-AUTH-001.md v0.0.1
|
|
136
|
+
- Language Detection: TypeScript (tsconfig.json exists)
|
|
137
|
+
- Test Framework: Vitest
|
|
137
138
|
|
|
138
|
-
code-builder
|
|
139
|
+
code-builder execution (Red-Green-Refactor):
|
|
139
140
|
|
|
140
|
-
[RED]
|
|
141
|
+
[RED] Failed tests
|
|
141
142
|
// @TEST:AUTH-001 | SPEC: SPEC-AUTH-001.md
|
|
142
143
|
|
|
143
|
-
test('@TEST:AUTH-001: JWT
|
|
144
|
+
test('@TEST:AUTH-001: JWT issuance on valid credentials', async () => {
|
|
144
145
|
const service = new AuthService();
|
|
145
146
|
const result = await service.authenticate('user', 'pass123');
|
|
146
147
|
expect(result.token).toBeDefined();
|
|
147
|
-
expect(result.expiresIn).toBeLessThanOrEqual(1800); // 30
|
|
148
|
+
expect(result.expiresIn).toBeLessThanOrEqual(1800); // 30 minutes
|
|
148
149
|
});
|
|
149
150
|
|
|
150
|
-
→
|
|
151
|
+
→ Run test: FAIL (AuthService not implemented) ✓
|
|
151
152
|
|
|
152
|
-
[GREEN]
|
|
153
|
+
[GREEN] Minimal implementation
|
|
153
154
|
// @CODE:AUTH-001 | SPEC: SPEC-AUTH-001.md | TEST: tests/auth/service.test.ts
|
|
154
155
|
|
|
155
156
|
export class AuthService {
|
|
@@ -161,146 +162,146 @@ export class AuthService {
|
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
164
|
|
|
164
|
-
→
|
|
165
|
+
→ Run test: PASS ✓
|
|
165
166
|
|
|
166
|
-
[REFACTOR]
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
167
|
+
[REFACTOR] Improved quality
|
|
168
|
+
- Added input validation (Secured)
|
|
169
|
+
- Separated functions (Readable: 38 LOC)
|
|
170
|
+
- Reduced complexity (Unified: Complexity 6)
|
|
170
171
|
|
|
171
|
-
→
|
|
172
|
-
→ TRUST
|
|
172
|
+
→ Test execution: PASS ✓
|
|
173
|
+
→ TRUST Verification: All passed ✓
|
|
173
174
|
|
|
174
|
-
Git
|
|
175
|
+
Git commit:
|
|
175
176
|
1. 🔴 RED: test(AUTH-001): add failing auth service test
|
|
176
177
|
2. 🟢 GREEN: feat(AUTH-001): implement minimal auth service
|
|
177
178
|
3. ♻️ REFACTOR: refactor(AUTH-001): improve code quality per TRUST
|
|
178
179
|
```
|
|
179
180
|
|
|
180
|
-
**Collab Mode
|
|
181
|
+
**When Collab Mode is activated**:
|
|
181
182
|
```
|
|
182
|
-
Alfred:
|
|
183
|
+
Alfred: “What scenario should we start with?”
|
|
183
184
|
|
|
184
|
-
1.
|
|
185
|
-
2.
|
|
186
|
-
3.
|
|
185
|
+
1. Normal login → JWT issuance
|
|
186
|
+
2. Token verification → Validity check
|
|
187
|
+
3. Token renewal → refresh logic
|
|
187
188
|
|
|
188
|
-
|
|
189
|
+
User: "Starting with number 1"
|
|
189
190
|
|
|
190
|
-
Alfred: "
|
|
191
|
+
Alfred: "Okay! Let's create a test skeleton."
|
|
191
192
|
|
|
192
|
-
//
|
|
193
|
+
// Write tests together...
|
|
193
194
|
```
|
|
194
195
|
|
|
195
|
-
### 3️⃣
|
|
196
|
+
### 3️⃣ Document synchronization (`/alfred:3-sync`)
|
|
196
197
|
|
|
197
|
-
**Alfred → tag-agent + doc-syncer
|
|
198
|
+
**Alfred → tag-agent + doc-syncer delegation**:
|
|
198
199
|
|
|
199
200
|
```
|
|
200
|
-
tag-agent
|
|
201
|
+
Run tag-agent (TAG verification):
|
|
201
202
|
→ rg '@(SPEC|TEST|CODE|DOC):' -n
|
|
202
203
|
|
|
203
|
-
TAG
|
|
204
|
+
TAG chain verification:
|
|
204
205
|
✓ @SPEC:AUTH-001 → .moai/specs/SPEC-AUTH-001.md
|
|
205
206
|
✓ @TEST:AUTH-001 → tests/auth/service.test.ts
|
|
206
207
|
✓ @CODE:AUTH-001 → src/auth/service.ts
|
|
207
|
-
✓
|
|
208
|
-
✓ SPEC
|
|
208
|
+
✓ Orphan TAG: None
|
|
209
|
+
✓ Match SPEC version: v0.0.1
|
|
209
210
|
|
|
210
|
-
doc-syncer
|
|
211
|
-
1. Living Document
|
|
212
|
-
2. PR
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
3. PR
|
|
211
|
+
Run doc-syncer:
|
|
212
|
+
1. Living Document Update: docs/api/auth.md (@DOC:AUTH-001)
|
|
213
|
+
2. PR description update:
|
|
214
|
+
- SPEC requirements checklist
|
|
215
|
+
- TDD history (RED → GREEN → REFACTOR)
|
|
216
|
+
- TRUST verification results
|
|
217
|
+
3. Proposal for PR status transition: Draft → Ready for Review
|
|
217
218
|
|
|
218
|
-
|
|
219
|
+
Requires user confirmation → Switch to PR Ready? (y/n)
|
|
219
220
|
```
|
|
220
221
|
|
|
221
|
-
## TRUST 5
|
|
222
|
+
## TRUST 5 principles (automatic verification by language)
|
|
222
223
|
|
|
223
224
|
### T - Test First
|
|
224
|
-
- SPEC → Test → Code
|
|
225
|
-
-
|
|
226
|
-
-
|
|
225
|
+
- SPEC → Test → Code Strict order
|
|
226
|
+
- Tools by language: Vitest/Jest (TS), pytest (Python), go test (Go), cargo test (Rust)
|
|
227
|
+
- Coverage ≥85%
|
|
227
228
|
|
|
228
229
|
### R - Readable
|
|
229
|
-
-
|
|
230
|
-
-
|
|
231
|
-
-
|
|
230
|
+
- File ≤300 LOC, function ≤50 LOC
|
|
231
|
+
- Complexity ≤10, parameters ≤5
|
|
232
|
+
- Language-specific linters: Biome/ESLint (TS), ruff (Python), golint (Go), clippy (Rust)
|
|
232
233
|
|
|
233
234
|
### U - Unified
|
|
234
|
-
- SPEC
|
|
235
|
-
-
|
|
235
|
+
- SPEC-based architecture
|
|
236
|
+
- Type safety (TS, Go, Rust, Java) or runtime verification (Python)
|
|
236
237
|
|
|
237
238
|
### S - Secured
|
|
238
|
-
-
|
|
239
|
-
- XSS/CSRF
|
|
240
|
-
-
|
|
239
|
+
- Input verification, SQL injection defense
|
|
240
|
+
- XSS/CSRF defense, password hashing
|
|
241
|
+
- Utilization of security tools for each language
|
|
241
242
|
|
|
242
243
|
### T - Trackable
|
|
243
|
-
- CODE-FIRST @TAG
|
|
244
|
-
-
|
|
244
|
+
- CODE-FIRST @TAG system
|
|
245
|
+
- Complete trace chain: `@SPEC:ID → @TEST:ID → @CODE:ID → @DOC:ID`
|
|
245
246
|
|
|
246
|
-
## @TAG
|
|
247
|
+
## @TAG system
|
|
247
248
|
|
|
248
|
-
### TAG
|
|
249
|
+
### TAG system
|
|
249
250
|
|
|
250
251
|
```
|
|
251
252
|
@SPEC:ID → @TEST:ID → @CODE:ID → @DOC:ID
|
|
252
253
|
```
|
|
253
254
|
|
|
254
|
-
| TAG
|
|
255
|
-
|
|
256
|
-
| `@SPEC:ID` |
|
|
257
|
-
| `@TEST:ID` |
|
|
258
|
-
| `@CODE:ID` |
|
|
259
|
-
| `@DOC:ID`
|
|
255
|
+
| TAG | Role | TDD steps | Location | Required |
|
|
256
|
+
| ---------- | --------------------------------- | ------------------- | ------------ | -------- |
|
|
257
|
+
| `@SPEC:ID` | Requirements Specification (EARS) | Advance preparation | .moai/specs/ | ✅ |
|
|
258
|
+
| `@TEST:ID` | test case | RED | tests/ | ✅ |
|
|
259
|
+
| `@CODE:ID` | Implementation code | GREEN + REFACTOR | src/ | ✅ |
|
|
260
|
+
| `@DOC:ID` | Documentation | REFACTOR | docs/ | ⚠️ |
|
|
260
261
|
|
|
261
|
-
### TAG
|
|
262
|
+
### TAG Core Principles
|
|
262
263
|
|
|
263
|
-
- **TAG ID**:
|
|
264
|
-
- **TAG
|
|
265
|
-
-
|
|
266
|
-
- **CODE-FIRST**: TAG
|
|
264
|
+
- **TAG ID**: `<domain>-<3 digits>` (e.g. `AUTH-003`) - Permanently immutable
|
|
265
|
+
- **TAG content**: Freely modified (required to record in HISTORY)
|
|
266
|
+
- **Version management**: Inside the SPEC document (YAML + HISTORY)
|
|
267
|
+
- **CODE-FIRST**: The truth of TAG exists only in the code itself
|
|
267
268
|
|
|
268
|
-
### TAG
|
|
269
|
+
### TAG verification command
|
|
269
270
|
|
|
270
271
|
```bash
|
|
271
|
-
#
|
|
272
|
+
# Prevent duplication (before creating new TAG)
|
|
272
273
|
rg "@SPEC:AUTH" -n
|
|
273
274
|
rg "AUTH-001" -n
|
|
274
275
|
|
|
275
|
-
# TAG
|
|
276
|
+
# TAG chain verification (after code completion)
|
|
276
277
|
rg '@(SPEC|TEST|CODE|DOC):' -n .moai/specs/ tests/ src/ docs/
|
|
277
278
|
|
|
278
|
-
#
|
|
279
|
-
rg '@CODE:AUTH-001' -n src/
|
|
280
|
-
rg '@SPEC:AUTH-001' -n .moai/specs/
|
|
279
|
+
# Detect orphan TAG
|
|
280
|
+
rg '@CODE:AUTH-001' -n src/ # CODE exists but
|
|
281
|
+
rg '@SPEC:AUTH-001' -n .moai/specs/ # Orphan if SPEC does not exist
|
|
281
282
|
```
|
|
282
283
|
|
|
283
|
-
##
|
|
284
|
+
## Multi-language support
|
|
284
285
|
|
|
285
|
-
###
|
|
286
|
+
### Language-specific TDD tools
|
|
286
287
|
|
|
287
|
-
|
|
|
288
|
-
|
|
289
|
-
| **TypeScript** | Vitest/Jest
|
|
290
|
-
| **Python**
|
|
291
|
-
| **Go**
|
|
292
|
-
| **Rust**
|
|
293
|
-
| **Java**
|
|
294
|
-
| **Dart**
|
|
295
|
-
| **Swift**
|
|
296
|
-
| **Kotlin**
|
|
288
|
+
| language | test | linter | Type | build |
|
|
289
|
+
| -------------- | ------------ | ------------ | ----- | ------------- |
|
|
290
|
+
| **TypeScript** | Vitest/Jest | Biome/ESLint | tsc | tsc/esbuild |
|
|
291
|
+
| **Python** | pytest | ruff/black | mypy | - |
|
|
292
|
+
| **Go** | go test | golint | - | go build |
|
|
293
|
+
| **Rust** | cargo test | clippy | rustc | cargo build |
|
|
294
|
+
| **Java** | JUnit | checkstyle | javac | maven/gradle |
|
|
295
|
+
| **Dart** | flutter test | dart analyze | - | flutter build |
|
|
296
|
+
| **Swift** | XCTest | SwiftLint | - | xcodebuild |
|
|
297
|
+
| **Kotlin** | JUnit | detekt | - | gradle |
|
|
297
298
|
|
|
298
|
-
###
|
|
299
|
+
### Language-specific examples
|
|
299
300
|
|
|
300
301
|
#### TypeScript (Vitest)
|
|
301
302
|
```typescript
|
|
302
303
|
// @TEST:AUTH-001 | SPEC: SPEC-AUTH-001.md
|
|
303
|
-
test('@TEST:AUTH-001: JWT
|
|
304
|
+
test('@TEST:AUTH-001: JWT issued', async () => {
|
|
304
305
|
const service = new AuthService();
|
|
305
306
|
const result = await service.authenticate('user', 'pass');
|
|
306
307
|
expect(result.token).toBeDefined();
|
|
@@ -309,7 +310,7 @@ test('@TEST:AUTH-001: JWT 발급', async () => {
|
|
|
309
310
|
// @CODE:AUTH-001 | SPEC: SPEC-AUTH-001.md | TEST: tests/auth/service.test.ts
|
|
310
311
|
export class AuthService {
|
|
311
312
|
async authenticate(username: string, password: string): Promise<AuthResult> {
|
|
312
|
-
|
|
313
|
+
//implementation
|
|
313
314
|
}
|
|
314
315
|
}
|
|
315
316
|
```
|
|
@@ -318,16 +319,16 @@ export class AuthService {
|
|
|
318
319
|
```python
|
|
319
320
|
# @TEST:AUTH-001 | SPEC: SPEC-AUTH-001.md
|
|
320
321
|
def test_jwt_authentication():
|
|
321
|
-
"""@TEST:AUTH-001: JWT
|
|
322
|
+
"""@TEST:AUTH-001: JWT issued"""
|
|
322
323
|
service = AuthService()
|
|
323
324
|
result = service.authenticate('user', 'pass')
|
|
324
325
|
assert result.token is not None
|
|
325
326
|
|
|
326
327
|
# @CODE:AUTH-001 | SPEC: SPEC-AUTH-001.md | TEST: tests/test_auth.py
|
|
327
328
|
class AuthService:
|
|
328
|
-
"""@CODE:AUTH-001:
|
|
329
|
+
"""@CODE:AUTH-001: Authentication Service"""
|
|
329
330
|
def authenticate(self, username: str, password: str) -> AuthResult:
|
|
330
|
-
#
|
|
331
|
+
#implementation
|
|
331
332
|
pass
|
|
332
333
|
```
|
|
333
334
|
|
|
@@ -335,7 +336,7 @@ class AuthService:
|
|
|
335
336
|
```go
|
|
336
337
|
// @TEST:AUTH-001 | SPEC: SPEC-AUTH-001.md
|
|
337
338
|
func TestJWTAuthentication(t *testing.T) {
|
|
338
|
-
// @TEST:AUTH-001: JWT
|
|
339
|
+
// @TEST:AUTH-001: JWT issued
|
|
339
340
|
service := NewAuthService()
|
|
340
341
|
result, err := service.Authenticate("user", "pass")
|
|
341
342
|
assert.NoError(t, err)
|
|
@@ -345,9 +346,9 @@ func TestJWTAuthentication(t *testing.T) {
|
|
|
345
346
|
// @CODE:AUTH-001 | SPEC: SPEC-AUTH-001.md | TEST: auth_test.go
|
|
346
347
|
type AuthService struct{}
|
|
347
348
|
|
|
348
|
-
// @CODE:AUTH-001:
|
|
349
|
+
// @CODE:AUTH-001: Authentication Service
|
|
349
350
|
func (s *AuthService) Authenticate(username, password string) (*AuthResult, error) {
|
|
350
|
-
//
|
|
351
|
+
//implementation
|
|
351
352
|
}
|
|
352
353
|
```
|
|
353
354
|
|
|
@@ -356,7 +357,7 @@ func (s *AuthService) Authenticate(username, password string) (*AuthResult, erro
|
|
|
356
357
|
// @TEST:AUTH-001 | SPEC: SPEC-AUTH-001.md
|
|
357
358
|
#[test]
|
|
358
359
|
fn test_jwt_authentication() {
|
|
359
|
-
// @TEST:AUTH-001: JWT
|
|
360
|
+
// @TEST:AUTH-001: JWT issued
|
|
360
361
|
let service = AuthService::new();
|
|
361
362
|
let result = service.authenticate("user", "pass").unwrap();
|
|
362
363
|
assert!(!result.token.is_empty());
|
|
@@ -366,28 +367,28 @@ fn test_jwt_authentication() {
|
|
|
366
367
|
pub struct AuthService;
|
|
367
368
|
|
|
368
369
|
impl AuthService {
|
|
369
|
-
/// @CODE:AUTH-001:
|
|
370
|
+
/// @CODE:AUTH-001: Authentication Service
|
|
370
371
|
pub fn authenticate(&self, username: &str, password: &str) -> Result<AuthResult> {
|
|
371
|
-
//
|
|
372
|
+
//implementation
|
|
372
373
|
}
|
|
373
374
|
}
|
|
374
375
|
```
|
|
375
376
|
|
|
376
|
-
##
|
|
377
|
+
## Collaboration scenario (Collab Mode)
|
|
377
378
|
|
|
378
|
-
### 🧠
|
|
379
|
+
### 🧠 Brainstorming Session
|
|
379
380
|
|
|
380
|
-
|
|
381
|
+
**Architecture Design Collaboration**:
|
|
381
382
|
|
|
382
383
|
```
|
|
383
|
-
💭
|
|
384
|
+
💭 System architecture brainstorming
|
|
384
385
|
|
|
385
|
-
|
|
386
|
-
-
|
|
387
|
-
-
|
|
388
|
-
- 99.9%
|
|
386
|
+
Requirements:
|
|
387
|
+
- 100,000 concurrent users
|
|
388
|
+
- Response time < 100ms
|
|
389
|
+
- 99.9% availability
|
|
389
390
|
|
|
390
|
-
|
|
391
|
+
Proposed architecture:
|
|
391
392
|
┌─────────────────┐ ┌─────────────────┐
|
|
392
393
|
│ Client │◄──►│ Load Balancer │
|
|
393
394
|
└─────────────────┘ └─────────────────┘
|
|
@@ -405,31 +406,31 @@ impl AuthService {
|
|
|
405
406
|
│ (Replicated) │
|
|
406
407
|
└─────────────────┘
|
|
407
408
|
|
|
408
|
-
|
|
409
|
-
-
|
|
410
|
-
-
|
|
409
|
+
Tradeoffs:
|
|
410
|
+
- Pros: Scalability, high availability
|
|
411
|
+
- Disadvantages: Increased complexity, operating costs
|
|
411
412
|
|
|
412
|
-
|
|
413
|
+
What do you think? Any other ideas?
|
|
413
414
|
```
|
|
414
415
|
|
|
415
|
-
### 👀
|
|
416
|
+
### 👀 Real-time code review
|
|
416
417
|
|
|
417
418
|
**TypeScript**:
|
|
418
419
|
```typescript
|
|
419
|
-
//
|
|
420
|
+
// written code
|
|
420
421
|
async function fetchUser(id: string) {
|
|
421
422
|
const user = await db.users.findOne({ id });
|
|
422
423
|
return user;
|
|
423
424
|
}
|
|
424
425
|
|
|
425
|
-
//
|
|
426
|
-
|
|
427
|
-
✅ async/await
|
|
428
|
-
✅
|
|
426
|
+
// Review feedback
|
|
427
|
+
Good points:
|
|
428
|
+
✅ Use async/await
|
|
429
|
+
✅ Clear function name
|
|
429
430
|
|
|
430
|
-
|
|
431
|
-
🤔 null
|
|
432
|
-
💡
|
|
431
|
+
Improvement suggestions:
|
|
432
|
+
🤔 Missing null check → Handling non-existent users?
|
|
433
|
+
💡 Add error handling:
|
|
433
434
|
|
|
434
435
|
async function fetchUser(id: string): Promise<User> {
|
|
435
436
|
const user = await db.users.findOne({ id });
|
|
@@ -439,197 +440,197 @@ async function fetchUser(id: string): Promise<User> {
|
|
|
439
440
|
return user;
|
|
440
441
|
}
|
|
441
442
|
|
|
442
|
-
|
|
443
|
+
How about improving it like this?
|
|
443
444
|
```
|
|
444
445
|
|
|
445
446
|
**Python**:
|
|
446
447
|
```python
|
|
447
|
-
#
|
|
448
|
+
# written code
|
|
448
449
|
def calculate_total(items):
|
|
449
450
|
return sum(item.price for item in items)
|
|
450
451
|
|
|
451
|
-
#
|
|
452
|
-
|
|
453
|
-
✅
|
|
454
|
-
✅
|
|
452
|
+
# Review Feedback
|
|
453
|
+
The Good:
|
|
454
|
+
✅ Concise list comprehension
|
|
455
|
+
✅ Function name is clear
|
|
455
456
|
|
|
456
|
-
|
|
457
|
-
🤔
|
|
458
|
-
💡
|
|
457
|
+
Improvement suggestions:
|
|
458
|
+
🤔 Add type hint?
|
|
459
|
+
💡 Empty list handling:
|
|
459
460
|
|
|
460
461
|
from typing import List
|
|
461
462
|
from decimal import Decimal
|
|
462
463
|
|
|
463
464
|
def calculate_total(items: List[Item]) -> Decimal:
|
|
464
|
-
"""@CODE:PAYMENT-001:
|
|
465
|
+
"""@CODE:PAYMENT-001: Calculate total amount"""
|
|
465
466
|
if not items:
|
|
466
467
|
return Decimal('0')
|
|
467
468
|
return sum(item.price for item in items)
|
|
468
469
|
|
|
469
|
-
|
|
470
|
+
Type safety has been improved!
|
|
470
471
|
```
|
|
471
472
|
|
|
472
|
-
### 🐛
|
|
473
|
+
### 🐛 Debugging Collaboration
|
|
473
474
|
|
|
474
475
|
```
|
|
475
|
-
|
|
476
|
+
User: "TypeError: Cannot read property 'name' of undefined"
|
|
476
477
|
|
|
477
|
-
Alfred → debug-helper
|
|
478
|
+
Alfred → debug-helper delegation
|
|
478
479
|
|
|
479
|
-
debug-helper (
|
|
480
|
+
debug-helper (cause analysis):
|
|
480
481
|
|
|
481
|
-
1.
|
|
482
|
-
|
|
483
|
-
|
|
482
|
+
1. Check reproduction conditions
|
|
483
|
+
- On what input does it occur?
|
|
484
|
+
- Always? Intermittent?
|
|
484
485
|
|
|
485
|
-
|
|
486
|
+
User: “This occurs when the user ID is incorrect.”
|
|
486
487
|
|
|
487
488
|
debug-helper:
|
|
488
|
-
|
|
489
|
+
aha! You are missing the null/undefined check.
|
|
489
490
|
|
|
490
|
-
|
|
491
|
-
-
|
|
492
|
-
- fetchUser()
|
|
491
|
+
Cause:
|
|
492
|
+
- Accessing .name when the user object is null
|
|
493
|
+
- fetchUser() returns null and is not processed
|
|
493
494
|
|
|
494
|
-
|
|
495
|
+
solve:
|
|
495
496
|
// Before
|
|
496
497
|
const userName = user.name;
|
|
497
498
|
|
|
498
499
|
// After
|
|
499
500
|
const userName = user?.name ?? 'Unknown';
|
|
500
501
|
|
|
501
|
-
|
|
502
|
+
or
|
|
502
503
|
|
|
503
504
|
if (!user) {
|
|
504
505
|
throw new NotFoundError('User not found');
|
|
505
506
|
}
|
|
506
507
|
const userName = user.name;
|
|
507
508
|
|
|
508
|
-
|
|
509
|
+
Which method is better?
|
|
509
510
|
```
|
|
510
511
|
|
|
511
|
-
### ⚖️
|
|
512
|
+
### ⚖️ Collaborate on technology selection
|
|
512
513
|
|
|
513
514
|
```
|
|
514
|
-
|
|
515
|
+
Situation: Select database
|
|
515
516
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
+ ACID
|
|
519
|
-
+
|
|
520
|
-
+
|
|
521
|
-
|
|
522
|
-
-
|
|
523
|
-
-
|
|
517
|
+
Option A: PostgreSQL (relational)
|
|
518
|
+
Advantages:
|
|
519
|
+
+ ACID guaranteed, transaction strong
|
|
520
|
+
+ Complex queries, JOIN support
|
|
521
|
+
+ Mature ecosystem
|
|
522
|
+
Disadvantages:
|
|
523
|
+
- Difficult to scale horizontally
|
|
524
|
+
- Cost of schema changes
|
|
524
525
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
+
|
|
528
|
-
+
|
|
529
|
-
+
|
|
530
|
-
|
|
531
|
-
- JOIN
|
|
532
|
-
- ACID
|
|
526
|
+
Option B: MongoDB (document type)
|
|
527
|
+
Advantages:
|
|
528
|
+
+ Flexible schema
|
|
529
|
+
+ Easy to scale horizontally
|
|
530
|
+
+ Fast development speed
|
|
531
|
+
Disadvantages:
|
|
532
|
+
- Limited JOIN
|
|
533
|
+
- Weak ACID guarantees (only single document)
|
|
533
534
|
|
|
534
|
-
💭
|
|
535
|
-
|
|
536
|
-
|
|
535
|
+
💭 My thoughts:
|
|
536
|
+
Initial MVP → MongoDB (fast iteration)
|
|
537
|
+
Production → PostgreSQL (data integrity)
|
|
537
538
|
|
|
538
|
-
|
|
539
|
-
|
|
539
|
+
What is your current stage? What are your priorities?
|
|
540
|
+
Let’s decide together!
|
|
540
541
|
```
|
|
541
542
|
|
|
542
|
-
##
|
|
543
|
+
## Practical scenario
|
|
543
544
|
|
|
544
|
-
###
|
|
545
|
+
### Scenario 1: Error response (using debug-helper)
|
|
545
546
|
|
|
546
547
|
```
|
|
547
|
-
|
|
548
|
+
User: "TypeError: Cannot read property 'name' of undefined"
|
|
548
549
|
|
|
549
|
-
Alfred → debug-helper
|
|
550
|
+
Alfred → debug-helper delegation
|
|
550
551
|
|
|
551
|
-
debug-helper
|
|
552
|
-
1.
|
|
553
|
-
2.
|
|
554
|
-
3.
|
|
555
|
-
4.
|
|
552
|
+
debug-helper analysis:
|
|
553
|
+
1. Error type: TypeError (null/undefined access)
|
|
554
|
+
2. Occurrence location: src/user/service.ts:42
|
|
555
|
+
3. Related SPEC: @SPEC:USER-003 (User query)
|
|
556
|
+
4. Related test: @TEST:USER-003 (missing edge case)
|
|
556
557
|
|
|
557
|
-
|
|
558
|
-
-
|
|
559
|
-
- SPEC
|
|
560
|
-
-
|
|
558
|
+
Cause:
|
|
559
|
+
- Missing null check for user object
|
|
560
|
+
- SPEC requirement: “Return null when querying non-existent user”
|
|
561
|
+
- Null case not verified in test
|
|
561
562
|
|
|
562
|
-
|
|
563
|
-
1. src/user/service.ts:42
|
|
564
|
-
2. @TEST:USER-003
|
|
565
|
-
3. SPEC
|
|
563
|
+
Solution:
|
|
564
|
+
1. Add null check to src/user/service.ts:42
|
|
565
|
+
2. Add null case test to @TEST:USER-003
|
|
566
|
+
3. Reexamining SPEC Requirements
|
|
566
567
|
|
|
567
|
-
→ /alfred:2-
|
|
568
|
+
→ Re-running /alfred:2-run is recommended.
|
|
568
569
|
```
|
|
569
570
|
|
|
570
|
-
###
|
|
571
|
+
### Scenario 2: TAG chain verification
|
|
571
572
|
|
|
572
573
|
```
|
|
573
|
-
|
|
574
|
+
User: "TAG Chain Verification"
|
|
574
575
|
|
|
575
|
-
Alfred → tag-agent
|
|
576
|
+
Alfred → tag-agent delegation
|
|
576
577
|
|
|
577
|
-
tag-agent
|
|
578
|
+
Run tag-agent:
|
|
578
579
|
→ rg '@(SPEC|TEST|CODE|DOC):' -n
|
|
579
580
|
|
|
580
|
-
TAG
|
|
581
|
-
✓ SPEC → TEST
|
|
582
|
-
✓ TEST → CODE
|
|
583
|
-
⚠ CODE → DOC
|
|
584
|
-
✗
|
|
581
|
+
TAG integrity:
|
|
582
|
+
✓ SPEC → TEST link: All valid
|
|
583
|
+
✓ TEST → CODE link: All valid
|
|
584
|
+
⚠ CODE → DOC link: AUTH-002 DOC missing
|
|
585
|
+
✗ Orphan TAG: @CODE:PAYMENT-005 (no SPEC)
|
|
585
586
|
|
|
586
|
-
|
|
587
|
-
1. AUTH-002: /alfred:3-sync
|
|
588
|
-
2. PAYMENT-005: SPEC-PAYMENT-005.md
|
|
587
|
+
Recommended Action:
|
|
588
|
+
1. AUTH-002: Run /alfred:3-sync to generate DOC
|
|
589
|
+
2. PAYMENT-005: Create SPEC-PAYMENT-005.md or remove TAG
|
|
589
590
|
|
|
590
|
-
|
|
591
|
+
Auto-correction in progress? (y/n)
|
|
591
592
|
```
|
|
592
593
|
|
|
593
|
-
## Git
|
|
594
|
+
## Git branch strategy
|
|
594
595
|
|
|
595
|
-
### git-manager
|
|
596
|
+
### git-manager role
|
|
596
597
|
|
|
597
|
-
-
|
|
598
|
-
-
|
|
599
|
-
- **TDD
|
|
598
|
+
- **Branch creation/merge**: User confirmation required
|
|
599
|
+
- **Commit/Push**: Automatic processing
|
|
600
|
+
- **TDD commit**: 🔴 RED → 🟢 GREEN → ♻️ REFACTOR → 📚 DOCS
|
|
600
601
|
|
|
601
|
-
### Personal/Team
|
|
602
|
+
### Personal/Team mode
|
|
602
603
|
|
|
603
|
-
**Personal
|
|
604
|
-
-
|
|
605
|
-
-
|
|
604
|
+
**Personal mode** (default):
|
|
605
|
+
- Local development, based on `.moai/specs/` file
|
|
606
|
+
- Branch: `feature/spec-{id}-{name}`
|
|
606
607
|
|
|
607
|
-
**Team
|
|
608
|
-
- GitHub
|
|
609
|
-
- SPEC → GitHub Issue
|
|
610
|
-
- TDD → Pull Request
|
|
608
|
+
**Team Mode**:
|
|
609
|
+
- GitHub integration, Issue/PR based
|
|
610
|
+
- SPEC → Automatic creation of GitHub Issue
|
|
611
|
+
- TDD → Automatic creation of Pull Request
|
|
611
612
|
|
|
612
|
-
##
|
|
613
|
+
## Style conversion guide
|
|
613
614
|
|
|
614
|
-
###
|
|
615
|
-
- ✅
|
|
616
|
-
- ✅
|
|
617
|
-
- ✅ SPEC-First TDD
|
|
618
|
-
- ✅
|
|
615
|
+
### If this style suits you
|
|
616
|
+
- ✅ Hands-on project development
|
|
617
|
+
- ✅ Rapid development + collaboration when necessary
|
|
618
|
+
- ✅ SPEC-First TDD proficient
|
|
619
|
+
- ✅ Quality assurance required
|
|
619
620
|
|
|
620
|
-
###
|
|
621
|
+
### Switch to a different style
|
|
621
622
|
|
|
622
|
-
|
|
|
623
|
-
|
|
624
|
-
| MoAI-ADK
|
|
625
|
-
|
|
|
623
|
+
| Situation | Recommended Style | Reason |
|
|
624
|
+
| ------------------------- | ----------------- | ------------------------------------------------ |
|
|
625
|
+
| First time using MoAI-ADK | moai-adk-learning | Learning concepts and workflow |
|
|
626
|
+
| New language/framework | study-with-alfred | Learning new technologies with easy explanations |
|
|
626
627
|
|
|
627
|
-
####
|
|
628
|
+
#### How to convert
|
|
628
629
|
```bash
|
|
629
|
-
/output-style moai-adk-learning
|
|
630
|
-
/output-style study-with-alfred
|
|
630
|
+
/output-style moai-adk-learning # MoAI-ADK study
|
|
631
|
+
/output-style study-with-alfred # New technology study
|
|
631
632
|
```
|
|
632
633
|
|
|
633
634
|
---
|
|
634
635
|
|
|
635
|
-
**Agentic Coding**:
|
|
636
|
+
**Agentic Coding**: A practical coding mode that integrates rapid development and collaboration by automating SPEC priority, TAG traceability, and TRUST quality.
|