moai-adk 0.9.1__py3-none-any.whl → 0.10.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.
- moai_adk/templates/.claude/hooks/alfred/core/project.py +750 -0
- moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +97 -24
- moai_adk/templates/.git-hooks/pre-push +143 -0
- moai_adk/templates/.github/workflows/tag-validation.yml +4 -0
- moai_adk/templates/.moai/memory/gitflow-protection-policy.md +140 -30
- moai_adk/templates/CLAUDE.md +58 -0
- moai_adk/templates/README.md +256 -0
- {moai_adk-0.9.1.dist-info → moai_adk-0.10.1.dist-info}/METADATA +714 -79
- {moai_adk-0.9.1.dist-info → moai_adk-0.10.1.dist-info}/RECORD +12 -23
- moai_adk/templates/.claude/hooks/alfred/.moai/cache/version-check.json +0 -9
- moai_adk/templates/.claude/hooks/alfred/README.md +0 -343
- moai_adk/templates/.claude/hooks/alfred/TROUBLESHOOTING.md +0 -471
- moai_adk/templates/.github/workflows/tag-report.yml +0 -261
- moai_adk/templates/.moai/docs/quick-issue-creation-guide.md +0 -219
- moai_adk/templates/.moai/hooks/install.sh +0 -79
- moai_adk/templates/.moai/hooks/pre-commit.sh +0 -66
- moai_adk/templates/.moai/memory/GITFLOW-PROTECTION-POLICY.md +0 -220
- moai_adk/templates/.moai/memory/SPEC-METADATA.md +0 -356
- moai_adk/templates/src/moai_adk/core/__init__.py +0 -5
- moai_adk/templates/src/moai_adk/core/tags/__init__.py +0 -86
- moai_adk/templates/src/moai_adk/core/tags/ci_validator.py +0 -433
- moai_adk/templates/src/moai_adk/core/tags/cli.py +0 -283
- moai_adk/templates/src/moai_adk/core/tags/validator.py +0 -897
- {moai_adk-0.9.1.dist-info → moai_adk-0.10.1.dist-info}/WHEEL +0 -0
- {moai_adk-0.9.1.dist-info → moai_adk-0.10.1.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.9.1.dist-info → moai_adk-0.10.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: moai-adk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.1
|
|
4
4
|
Summary: MoAI Agentic Development Kit - SPEC-First TDD with Alfred SuperAgent & Complete Skills v2.0
|
|
5
5
|
Project-URL: Homepage, https://github.com/modu-ai/moai-adk
|
|
6
6
|
Project-URL: Repository, https://github.com/modu-ai/moai-adk
|
|
@@ -158,13 +158,13 @@ From the moment you adopt MoAI-ADK, you'll feel:
|
|
|
158
158
|
|
|
159
159
|
---
|
|
160
160
|
|
|
161
|
-
##
|
|
161
|
+
## ⚡ 3-Minute Lightning Start
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
Get your first MoAI-ADK project running in **3 simple steps**. Beginners can finish in under 5 minutes.
|
|
164
164
|
|
|
165
|
-
### Step 1: Install uv (about
|
|
165
|
+
### Step 1: Install uv (about 1 minute)
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
#### Command
|
|
168
168
|
|
|
169
169
|
```bash
|
|
170
170
|
# macOS/Linux
|
|
@@ -173,46 +173,169 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
|
173
173
|
# Windows (PowerShell)
|
|
174
174
|
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
175
175
|
|
|
176
|
-
# Verify
|
|
176
|
+
# Verify
|
|
177
177
|
uv --version
|
|
178
|
-
# Output: uv 0.x.x
|
|
179
178
|
```
|
|
180
179
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
180
|
+
#### Expected Output
|
|
181
|
+
```
|
|
182
|
+
✓ uv 0.5.1 is already installed
|
|
183
|
+
$ uv --version
|
|
184
|
+
uv 0.5.1
|
|
185
|
+
```
|
|
184
186
|
|
|
185
|
-
Install MoAI-ADK
|
|
187
|
+
#### Next: Install MoAI-ADK
|
|
186
188
|
|
|
187
189
|
```bash
|
|
188
|
-
# Install in tool mode (recommended: runs in isolated environment)
|
|
189
190
|
uv tool install moai-adk
|
|
190
191
|
|
|
191
|
-
#
|
|
192
|
+
# Result: ✅ Installed moai-adk v0.9.0
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Verification**:
|
|
196
|
+
```bash
|
|
192
197
|
moai-adk --version
|
|
193
|
-
# Output: MoAI-ADK
|
|
198
|
+
# Output: MoAI-ADK v0.9.0
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
### Step 2: Create Your First Project (about 1 minute)
|
|
204
|
+
|
|
205
|
+
#### Command
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
moai-adk init hello-world
|
|
209
|
+
cd hello-world
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### What Gets Created
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
hello-world/
|
|
216
|
+
├── .moai/ ✅ Alfred configuration
|
|
217
|
+
├── .claude/ ✅ Claude Code automation
|
|
218
|
+
├── CLAUDE.md ✅ Project guide
|
|
219
|
+
└── README.md ✅ Project documentation
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
#### Verification: Check Core Files
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Verify core config file exists
|
|
226
|
+
ls -la .moai/config.json # ✅ Should exist
|
|
227
|
+
ls -la .claude/commands/ # ✅ Should have commands
|
|
228
|
+
|
|
229
|
+
# Or all at once
|
|
230
|
+
moai-adk doctor
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**Expected Output**:
|
|
234
|
+
```
|
|
235
|
+
✅ Python 3.13.0
|
|
236
|
+
✅ uv 0.5.1
|
|
237
|
+
✅ .moai/ directory initialized
|
|
238
|
+
✅ .claude/ directory ready
|
|
239
|
+
✅ 12 agents configured
|
|
240
|
+
✅ 55 skills loaded
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
### Step 3: Start Alfred (about 1 minute)
|
|
246
|
+
|
|
247
|
+
#### Run Claude Code
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
claude
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
#### Enter in Claude Code
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
/alfred:0-project
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
#### Alfred Will Ask
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
Q1: Project name?
|
|
263
|
+
A: hello-world
|
|
264
|
+
|
|
265
|
+
Q2: Project goal?
|
|
266
|
+
A: Learning MoAI-ADK
|
|
267
|
+
|
|
268
|
+
Q3: Main development language?
|
|
269
|
+
A: python
|
|
270
|
+
|
|
271
|
+
Q4: Mode?
|
|
272
|
+
A: personal (for local development)
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
#### Result: Project Ready! ✅
|
|
276
|
+
|
|
194
277
|
```
|
|
278
|
+
✅ Project initialized
|
|
279
|
+
✅ Config saved to .moai/config.json
|
|
280
|
+
✅ Documents created in .moai/project/
|
|
281
|
+
✅ Alfred recommends skills
|
|
282
|
+
|
|
283
|
+
Next: Run /alfred:1-plan "your feature description"
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Next: Complete Your First Feature in 10 Minutes
|
|
289
|
+
|
|
290
|
+
You're now ready to build your first complete feature with SPEC, TDD, and auto-generated docs!
|
|
195
291
|
|
|
196
|
-
|
|
292
|
+
> **→ Continue to: ["First 10-Minute Hands-On: Hello World API"](#-first-10-minute-hands-on-hello-world-api)**
|
|
293
|
+
|
|
294
|
+
In this section you'll experience:
|
|
295
|
+
- ✅ Define an API using SPEC
|
|
296
|
+
- ✅ Complete TDD cycle (RED → GREEN → REFACTOR)
|
|
297
|
+
- ✅ Auto-generate documentation
|
|
298
|
+
- ✅ Understand @TAG system
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Earlier Detailed Guide (Optional Reading)
|
|
303
|
+
|
|
304
|
+
Need more explanations? See detailed guides below.
|
|
305
|
+
|
|
306
|
+
### Detailed Installation Guide
|
|
307
|
+
|
|
308
|
+
**After installing uv, verify PATH is set**:
|
|
309
|
+
```bash
|
|
310
|
+
# If uv command not found, set PATH manually (macOS/Linux)
|
|
311
|
+
export PATH="$HOME/.cargo/bin:$PATH"
|
|
312
|
+
|
|
313
|
+
# Verify again
|
|
314
|
+
uv --version
|
|
315
|
+
```
|
|
197
316
|
|
|
198
|
-
|
|
317
|
+
**Available moai-adk commands**:
|
|
318
|
+
```bash
|
|
319
|
+
moai-adk init # Initialize new project
|
|
320
|
+
moai-adk doctor # System diagnostics
|
|
321
|
+
moai-adk update # Update to latest version
|
|
322
|
+
```
|
|
199
323
|
|
|
200
|
-
|
|
324
|
+
### Detailed Project Creation
|
|
201
325
|
|
|
326
|
+
**Create a new project**:
|
|
202
327
|
```bash
|
|
203
328
|
moai-adk init my-project
|
|
204
329
|
cd my-project
|
|
205
330
|
```
|
|
206
331
|
|
|
207
|
-
**
|
|
208
|
-
|
|
332
|
+
**Add to existing project**:
|
|
209
333
|
```bash
|
|
210
334
|
cd your-existing-project
|
|
211
335
|
moai-adk init .
|
|
212
336
|
```
|
|
213
337
|
|
|
214
|
-
|
|
215
|
-
|
|
338
|
+
Complete directory structure created:
|
|
216
339
|
```
|
|
217
340
|
my-project/
|
|
218
341
|
├── .moai/ # MoAI-ADK project configuration
|
|
@@ -280,107 +403,300 @@ my-project/
|
|
|
280
403
|
└── README.md
|
|
281
404
|
```
|
|
282
405
|
|
|
283
|
-
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Core Concept: 3-Step Repeating Cycle
|
|
409
|
+
|
|
410
|
+
After initial setup, every feature follows this cycle:
|
|
411
|
+
|
|
412
|
+
| Step | Command | What It Does | Output |
|
|
413
|
+
|------|---------|-------------|--------|
|
|
414
|
+
| 🚀 **INIT** | `/alfred:0-project` | Collect project description, create config/docs, recommend Skills | `.moai/config.json`, `.moai/project/*`, initial report |
|
|
415
|
+
| 📋 **PLAN** | `/alfred:1-plan "feature description"` | Analyze requirements, draft SPEC, create Plan Board | `.moai/specs/SPEC-*/spec.md`, plan/acceptance docs, feature branch |
|
|
416
|
+
| 💻 **RUN** | `/alfred:2-run SPEC-ID` | Execute TDD, run tests/implementation/refactor, verify quality | `tests/`, `src/` implementation, quality report, TAG links |
|
|
417
|
+
| 📚 **SYNC** | `/alfred:3-sync` | Auto-sync docs/README/CHANGELOG, organize TAG/PR status | `docs/`, `.moai/reports/sync-report.md`, Ready PR |
|
|
418
|
+
| 💬 **FEEDBACK** | `/alfred:9-feedback` | Interactive GitHub Issue creation (type → title → description → priority) | GitHub Issue + auto labels + priority + URL |
|
|
419
|
+
|
|
420
|
+
> ✅ All commands follow the **Phase 0(optional) → Phase 1 → Phase 2 → Phase 3** cycle. Alfred automatically reports status and suggests next steps.
|
|
421
|
+
>
|
|
422
|
+
> 💡 **New in v0.7.0+**: Use `/alfred:9-feedback` to create GitHub Issues on-the-fly during development. Keep your team in sync without interrupting your workflow.
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## Original Detailed Guide (Complete 7-Step Analysis)
|
|
427
|
+
|
|
428
|
+
For comprehensive explanation, see the previous version in [GitHub History](https://github.com/modu-ai/moai-adk/blob/main/README.md).
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## 🚀 First 10-Minute Hands-On: Hello World API
|
|
435
|
+
|
|
436
|
+
**Goal**: Experience the complete MoAI-ADK workflow in 10 minutes
|
|
437
|
+
**Learn**: SPEC writing, TDD implementation, documentation automation, @TAG system
|
|
438
|
+
|
|
439
|
+
> Already completed the 3-minute quick start? Start here!
|
|
440
|
+
|
|
441
|
+
### Prerequisites
|
|
442
|
+
- ✅ MoAI-ADK installed
|
|
443
|
+
- ✅ Project created (`moai-adk init hello-world`)
|
|
444
|
+
- ✅ Claude Code running
|
|
445
|
+
|
|
446
|
+
---
|
|
284
447
|
|
|
285
|
-
|
|
448
|
+
### Step 1: Write SPEC (2 minutes)
|
|
286
449
|
|
|
450
|
+
#### Command
|
|
287
451
|
```bash
|
|
288
|
-
|
|
289
|
-
claude
|
|
452
|
+
/alfred:1-plan "GET /hello endpoint - receive query parameter 'name' and return greeting"
|
|
290
453
|
```
|
|
291
454
|
|
|
292
|
-
|
|
455
|
+
#### Alfred Automatically Creates
|
|
456
|
+
```
|
|
457
|
+
✅ SPEC ID: HELLO-001
|
|
458
|
+
✅ File: .moai/specs/SPEC-HELLO-001/spec.md
|
|
459
|
+
✅ Branch: feature/SPEC-HELLO-001
|
|
460
|
+
```
|
|
293
461
|
|
|
462
|
+
#### Check Generated SPEC
|
|
463
|
+
```bash
|
|
464
|
+
cat .moai/specs/SPEC-HELLO-001/spec.md
|
|
294
465
|
```
|
|
295
|
-
|
|
466
|
+
|
|
467
|
+
**Example Content**:
|
|
468
|
+
```yaml
|
|
469
|
+
---
|
|
470
|
+
id: HELLO-001
|
|
471
|
+
version: 0.0.1
|
|
472
|
+
status: draft
|
|
473
|
+
priority: high
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
# `@SPEC:HELLO-001: Hello World API
|
|
477
|
+
|
|
478
|
+
## Ubiquitous Requirements
|
|
479
|
+
- System SHALL provide HTTP GET /hello endpoint
|
|
480
|
+
|
|
481
|
+
## Event-driven Requirements
|
|
482
|
+
- WHEN query parameter 'name' is provided, THEN return "Hello, {name}!"
|
|
483
|
+
- WHEN name is absent, THEN return "Hello, World!"
|
|
484
|
+
|
|
485
|
+
## Constraints
|
|
486
|
+
- name limited to 50 characters max
|
|
487
|
+
- Response format: JSON
|
|
296
488
|
```
|
|
297
489
|
|
|
298
|
-
|
|
490
|
+
✅ **Verify**: `ls .moai/specs/SPEC-HELLO-001/`
|
|
299
491
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
### Step 2: TDD Implementation (5 minutes)
|
|
495
|
+
|
|
496
|
+
#### Command
|
|
497
|
+
```bash
|
|
498
|
+
/alfred:2-run HELLO-001
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
#### 🔴 RED Phase: Write Failing Test
|
|
502
|
+
|
|
503
|
+
**File Created**: `tests/test_hello.py`
|
|
504
|
+
|
|
505
|
+
```python
|
|
506
|
+
# `@TEST:HELLO-001 | SPEC: SPEC-HELLO-001.md
|
|
507
|
+
|
|
508
|
+
import pytest
|
|
509
|
+
from fastapi.testclient import TestClient
|
|
510
|
+
from src.hello.api import app
|
|
304
511
|
|
|
305
|
-
|
|
512
|
+
client = TestClient(app)
|
|
306
513
|
|
|
307
|
-
|
|
514
|
+
def test_hello_with_name_should_return_personalized_greeting():
|
|
515
|
+
"""WHEN name provided, THEN return personalized greeting"""
|
|
516
|
+
response = client.get("/hello?name=Alice")
|
|
517
|
+
assert response.status_code == 200
|
|
518
|
+
assert response.json() == {"message": "Hello, Alice!"}
|
|
308
519
|
|
|
520
|
+
def test_hello_without_name_should_return_default_greeting():
|
|
521
|
+
"""WHEN name absent, THEN return default greeting"""
|
|
522
|
+
response = client.get("/hello")
|
|
523
|
+
assert response.status_code == 200
|
|
524
|
+
assert response.json() == {"message": "Hello, World!"}
|
|
309
525
|
```
|
|
310
|
-
|
|
526
|
+
|
|
527
|
+
**Run**:
|
|
528
|
+
```bash
|
|
529
|
+
pytest tests/test_hello.py -v
|
|
311
530
|
```
|
|
312
531
|
|
|
313
|
-
|
|
532
|
+
**Result**: ❌ FAILED (app doesn't exist yet - expected!)
|
|
533
|
+
|
|
534
|
+
**Commit**:
|
|
535
|
+
```bash
|
|
536
|
+
git add tests/test_hello.py
|
|
537
|
+
git commit -m "🔴 test(HELLO-001): add failing hello API tests"
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
#### 🟢 GREEN Phase: Minimal Implementation
|
|
543
|
+
|
|
544
|
+
**File Created**: `src/hello/api.py`
|
|
314
545
|
|
|
315
|
-
|
|
316
|
-
-
|
|
317
|
-
- `feature/spec-user-001` - Git branch auto-created
|
|
546
|
+
```python
|
|
547
|
+
# `@CODE:HELLO-001:API | SPEC: SPEC-HELLO-001.md | TEST: tests/test_hello.py
|
|
318
548
|
|
|
319
|
-
|
|
549
|
+
from fastapi import FastAPI
|
|
320
550
|
|
|
321
|
-
|
|
551
|
+
app = FastAPI()
|
|
322
552
|
|
|
553
|
+
@app.get("/hello")
|
|
554
|
+
def hello(name: str = "World"):
|
|
555
|
+
"""@CODE:HELLO-001:API - Hello endpoint"""
|
|
556
|
+
return {"message": f"Hello, {name}!"}
|
|
323
557
|
```
|
|
324
|
-
|
|
558
|
+
|
|
559
|
+
**Run**:
|
|
560
|
+
```bash
|
|
561
|
+
pytest tests/test_hello.py -v
|
|
325
562
|
```
|
|
326
563
|
|
|
327
|
-
|
|
564
|
+
**Result**: ✅ PASSED (all tests pass!)
|
|
565
|
+
|
|
566
|
+
**Commit**:
|
|
567
|
+
```bash
|
|
568
|
+
git add src/hello/api.py
|
|
569
|
+
git commit -m "🟢 feat(HELLO-001): implement hello API"
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
|
|
574
|
+
#### ♻️ REFACTOR Phase: Add Validation
|
|
575
|
+
|
|
576
|
+
**Enhanced Code**:
|
|
328
577
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
- ♻️ **REFACTOR**: Improve code quality
|
|
578
|
+
```python
|
|
579
|
+
from fastapi import FastAPI, HTTPException
|
|
332
580
|
|
|
333
|
-
|
|
581
|
+
app = FastAPI()
|
|
334
582
|
|
|
335
|
-
|
|
583
|
+
@app.get("/hello")
|
|
584
|
+
def hello(name: str = "World"):
|
|
585
|
+
"""@CODE:HELLO-001:API - Hello endpoint with validation"""
|
|
586
|
+
if len(name) > 50:
|
|
587
|
+
raise HTTPException(status_code=400, detail="Name too long (max 50 chars)")
|
|
588
|
+
return {"message": f"Hello, {name}!"}
|
|
589
|
+
```
|
|
336
590
|
|
|
591
|
+
**Add Test**:
|
|
592
|
+
```python
|
|
593
|
+
def test_hello_with_long_name_should_return_400():
|
|
594
|
+
"""WHEN name exceeds 50 chars, THEN return 400 error"""
|
|
595
|
+
long_name = "a" * 51
|
|
596
|
+
response = client.get(f"/hello?name={long_name}")
|
|
597
|
+
assert response.status_code == 400
|
|
337
598
|
```
|
|
338
|
-
|
|
599
|
+
|
|
600
|
+
**Run**:
|
|
601
|
+
```bash
|
|
602
|
+
pytest tests/test_hello.py -v
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
**Result**: ✅ PASSED (all tests pass!)
|
|
606
|
+
|
|
607
|
+
**Commit**:
|
|
608
|
+
```bash
|
|
609
|
+
git add tests/test_hello.py src/hello/api.py
|
|
610
|
+
git commit -m "♻️ refactor(HELLO-001): add name length validation"
|
|
339
611
|
```
|
|
340
612
|
|
|
341
|
-
|
|
613
|
+
---
|
|
614
|
+
|
|
615
|
+
### Step 3: Documentation Sync (2 minutes)
|
|
342
616
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
-
|
|
346
|
-
|
|
617
|
+
#### Command
|
|
618
|
+
```bash
|
|
619
|
+
/alfred:3-sync
|
|
620
|
+
```
|
|
347
621
|
|
|
348
|
-
|
|
622
|
+
#### Alfred Automatically
|
|
623
|
+
```
|
|
624
|
+
✅ docs/api/hello.md - API documentation generated
|
|
625
|
+
✅ README.md - Usage examples added
|
|
626
|
+
✅ CHANGELOG.md - Release notes added
|
|
627
|
+
✅ TAG chain validated - All @TAG verified
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
#### Check Generated API Documentation
|
|
631
|
+
```bash
|
|
632
|
+
cat docs/api/hello.md
|
|
633
|
+
```
|
|
349
634
|
|
|
350
|
-
|
|
635
|
+
**Example Content**:
|
|
636
|
+
```markdown
|
|
637
|
+
# Hello API Documentation
|
|
351
638
|
|
|
352
|
-
|
|
353
|
-
✅ Test code (85%+ coverage)
|
|
354
|
-
✅ Implementation code (tracked with @TAG)
|
|
355
|
-
✅ API documentation (auto-generated)
|
|
356
|
-
✅ Change history (CHANGELOG)
|
|
357
|
-
✅ Git commit history (RED/GREEN/REFACTOR)
|
|
639
|
+
## GET /hello
|
|
358
640
|
|
|
359
|
-
|
|
641
|
+
### Description
|
|
642
|
+
Returns a personalized greeting based on provided name.
|
|
360
643
|
|
|
361
|
-
###
|
|
644
|
+
### Parameters
|
|
645
|
+
- `name` (query, optional): Person's name (default: "World", max 50 chars)
|
|
362
646
|
|
|
363
|
-
|
|
647
|
+
### Responses
|
|
648
|
+
- **200**: Success
|
|
649
|
+
```json
|
|
650
|
+
{ "message": "Hello, Alice!" }
|
|
651
|
+
```
|
|
652
|
+
- **400**: Name too long
|
|
364
653
|
|
|
654
|
+
### Examples
|
|
365
655
|
```bash
|
|
366
|
-
|
|
367
|
-
|
|
656
|
+
curl "http://localhost:8000/hello?name=Alice"
|
|
657
|
+
# → {"message": "Hello, Alice!"}
|
|
368
658
|
|
|
369
|
-
|
|
370
|
-
|
|
659
|
+
curl "http://localhost:8000/hello"
|
|
660
|
+
# → {"message": "Hello, World!"}
|
|
661
|
+
```
|
|
371
662
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
663
|
+
### Traceability
|
|
664
|
+
- `@SPEC:HELLO-001` - Requirements
|
|
665
|
+
- `@TEST:HELLO-001` - Tests
|
|
666
|
+
- `@CODE:HELLO-001:API` - Implementation
|
|
375
667
|
```
|
|
376
668
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
669
|
+
---
|
|
670
|
+
|
|
671
|
+
### Step 4: Verify TAG Chain (1 minute)
|
|
672
|
+
|
|
673
|
+
#### Command
|
|
674
|
+
```bash
|
|
675
|
+
rg '@(SPEC|TEST|CODE|DOC):HELLO-001' -n
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
#### Output (Complete Traceability)
|
|
679
|
+
```
|
|
680
|
+
.moai/specs/SPEC-HELLO-001/spec.md:7:# `@SPEC:HELLO-001: Hello World API
|
|
681
|
+
tests/test_hello.py:3:# `@TEST:HELLO-001 | SPEC: SPEC-HELLO-001.md
|
|
682
|
+
src/hello/api.py:3:# `@CODE:HELLO-001:API | SPEC: SPEC-HELLO-001.md
|
|
683
|
+
docs/api/hello.md:24:- `@SPEC:HELLO-001`
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
✅ **Complete chain**: SPEC → TEST → CODE → DOC (fully traceable!)
|
|
687
|
+
|
|
688
|
+
---
|
|
689
|
+
|
|
690
|
+
### Summary: What You've Accomplished
|
|
691
|
+
|
|
692
|
+
In just 10 minutes:
|
|
693
|
+
|
|
694
|
+
✅ **SPEC** - Clear requirements documented
|
|
695
|
+
✅ **TDD** - Red → Green → Refactor cycle
|
|
696
|
+
✅ **Implementation** - Simple, testable code with @CODE TAG
|
|
697
|
+
✅ **Documentation** - Auto-generated from code
|
|
698
|
+
✅ **Traceability** - Complete @TAG chain: SPEC → TEST → CODE → DOC
|
|
699
|
+
✅ **Git History** - Clean, semantic commits (🔴 🟢 ♻️)
|
|
384
700
|
|
|
385
701
|
---
|
|
386
702
|
|
|
@@ -2046,6 +2362,325 @@ If you need to temporarily disable hooks, edit `.claude/settings.json`:
|
|
|
2046
2362
|
|
|
2047
2363
|
---
|
|
2048
2364
|
|
|
2365
|
+
## 🔧 Beginner's Troubleshooting Guide
|
|
2366
|
+
|
|
2367
|
+
Common errors and solutions for getting started with MoAI-ADK.
|
|
2368
|
+
|
|
2369
|
+
### 1. uv is Not Installed
|
|
2370
|
+
|
|
2371
|
+
**Symptom**:
|
|
2372
|
+
```bash
|
|
2373
|
+
$ uv --version
|
|
2374
|
+
bash: uv: command not found
|
|
2375
|
+
```
|
|
2376
|
+
|
|
2377
|
+
**Cause**: uv not installed or not in PATH
|
|
2378
|
+
|
|
2379
|
+
**Solution**:
|
|
2380
|
+
|
|
2381
|
+
**macOS/Linux**:
|
|
2382
|
+
```bash
|
|
2383
|
+
# Install
|
|
2384
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
2385
|
+
|
|
2386
|
+
# Restart shell
|
|
2387
|
+
source ~/.bashrc # or ~/.zshrc
|
|
2388
|
+
|
|
2389
|
+
# Verify
|
|
2390
|
+
uv --version
|
|
2391
|
+
```
|
|
2392
|
+
|
|
2393
|
+
**Windows (PowerShell)**:
|
|
2394
|
+
```powershell
|
|
2395
|
+
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
2396
|
+
|
|
2397
|
+
# Verify
|
|
2398
|
+
uv --version
|
|
2399
|
+
```
|
|
2400
|
+
|
|
2401
|
+
**If still not working**:
|
|
2402
|
+
```bash
|
|
2403
|
+
# Manually add PATH (macOS/Linux)
|
|
2404
|
+
export PATH="$HOME/.cargo/bin:$PATH"
|
|
2405
|
+
|
|
2406
|
+
# Verify
|
|
2407
|
+
uv --version
|
|
2408
|
+
```
|
|
2409
|
+
|
|
2410
|
+
---
|
|
2411
|
+
|
|
2412
|
+
### 2. Python Version Mismatch
|
|
2413
|
+
|
|
2414
|
+
**Symptom**:
|
|
2415
|
+
```
|
|
2416
|
+
Python 3.8 found, but 3.13+ required
|
|
2417
|
+
```
|
|
2418
|
+
|
|
2419
|
+
**Cause**: Python version is less than 3.13
|
|
2420
|
+
|
|
2421
|
+
**Solution**:
|
|
2422
|
+
|
|
2423
|
+
**Option A: Using pyenv (Recommended)**:
|
|
2424
|
+
```bash
|
|
2425
|
+
# Install pyenv
|
|
2426
|
+
curl https://pyenv.run | bash
|
|
2427
|
+
|
|
2428
|
+
# Install Python 3.13
|
|
2429
|
+
pyenv install 3.13
|
|
2430
|
+
pyenv global 3.13
|
|
2431
|
+
|
|
2432
|
+
# Verify
|
|
2433
|
+
python --version # Python 3.13.x
|
|
2434
|
+
```
|
|
2435
|
+
|
|
2436
|
+
**Option B: Let uv manage Python**:
|
|
2437
|
+
```bash
|
|
2438
|
+
# uv automatically downloads Python 3.13
|
|
2439
|
+
uv python install 3.13
|
|
2440
|
+
uv python pin 3.13
|
|
2441
|
+
|
|
2442
|
+
# Verify
|
|
2443
|
+
python --version
|
|
2444
|
+
```
|
|
2445
|
+
|
|
2446
|
+
---
|
|
2447
|
+
|
|
2448
|
+
### 3. Git Not Found
|
|
2449
|
+
|
|
2450
|
+
**Symptom**:
|
|
2451
|
+
```
|
|
2452
|
+
✗ Git (runtime): not found
|
|
2453
|
+
```
|
|
2454
|
+
|
|
2455
|
+
**Cause**: Git not installed on system
|
|
2456
|
+
|
|
2457
|
+
**Solution**:
|
|
2458
|
+
|
|
2459
|
+
**macOS**:
|
|
2460
|
+
```bash
|
|
2461
|
+
# Using Homebrew
|
|
2462
|
+
brew install git
|
|
2463
|
+
|
|
2464
|
+
# Or install Xcode Command Line Tools
|
|
2465
|
+
xcode-select --install
|
|
2466
|
+
```
|
|
2467
|
+
|
|
2468
|
+
**Ubuntu/Debian**:
|
|
2469
|
+
```bash
|
|
2470
|
+
sudo apt update
|
|
2471
|
+
sudo apt install git -y
|
|
2472
|
+
```
|
|
2473
|
+
|
|
2474
|
+
**Windows**:
|
|
2475
|
+
```powershell
|
|
2476
|
+
# Using winget
|
|
2477
|
+
winget install Git.Git
|
|
2478
|
+
|
|
2479
|
+
# Or download from https://git-scm.com/download/win
|
|
2480
|
+
```
|
|
2481
|
+
|
|
2482
|
+
**Verify**:
|
|
2483
|
+
```bash
|
|
2484
|
+
git --version # git version 2.x.x
|
|
2485
|
+
```
|
|
2486
|
+
|
|
2487
|
+
---
|
|
2488
|
+
|
|
2489
|
+
### 4. Claude Code Doesn't Recognize .moai/ Folder
|
|
2490
|
+
|
|
2491
|
+
**Symptom**:
|
|
2492
|
+
```
|
|
2493
|
+
"Project not initialized"
|
|
2494
|
+
/alfred:0-project command doesn't work
|
|
2495
|
+
```
|
|
2496
|
+
|
|
2497
|
+
**Cause**: `.moai/` or `.claude/` folders missing or corrupted
|
|
2498
|
+
|
|
2499
|
+
**Solution**:
|
|
2500
|
+
|
|
2501
|
+
```bash
|
|
2502
|
+
# 1. Verify current directory
|
|
2503
|
+
pwd # /path/to/your-project
|
|
2504
|
+
|
|
2505
|
+
# 2. Check if .moai/ exists
|
|
2506
|
+
ls -la .moai/config.json
|
|
2507
|
+
|
|
2508
|
+
# 3. If missing, reinitialize
|
|
2509
|
+
moai-adk init .
|
|
2510
|
+
|
|
2511
|
+
# 4. Restart Claude Code
|
|
2512
|
+
exit # Exit Claude Code
|
|
2513
|
+
claude # Restart
|
|
2514
|
+
```
|
|
2515
|
+
|
|
2516
|
+
**Verify**:
|
|
2517
|
+
```bash
|
|
2518
|
+
moai-adk doctor
|
|
2519
|
+
# All items should show ✅
|
|
2520
|
+
```
|
|
2521
|
+
|
|
2522
|
+
---
|
|
2523
|
+
|
|
2524
|
+
### 5. Module Not Found When Running Tests
|
|
2525
|
+
|
|
2526
|
+
**Symptom**:
|
|
2527
|
+
```
|
|
2528
|
+
FAILED tests/test_hello.py - ModuleNotFoundError: No module named 'fastapi'
|
|
2529
|
+
```
|
|
2530
|
+
|
|
2531
|
+
**Cause**: Required package not installed
|
|
2532
|
+
|
|
2533
|
+
**Solution**:
|
|
2534
|
+
|
|
2535
|
+
```bash
|
|
2536
|
+
# Install dependencies from project root
|
|
2537
|
+
uv sync
|
|
2538
|
+
|
|
2539
|
+
# Or install specific packages
|
|
2540
|
+
uv add fastapi pytest
|
|
2541
|
+
|
|
2542
|
+
# Activate virtual environment
|
|
2543
|
+
source .venv/bin/activate # macOS/Linux
|
|
2544
|
+
.venv\Scripts\activate # Windows
|
|
2545
|
+
|
|
2546
|
+
# Run tests
|
|
2547
|
+
pytest tests/ -v
|
|
2548
|
+
```
|
|
2549
|
+
|
|
2550
|
+
---
|
|
2551
|
+
|
|
2552
|
+
### 6. `/alfred` Commands Not Working
|
|
2553
|
+
|
|
2554
|
+
**Symptom**:
|
|
2555
|
+
```
|
|
2556
|
+
Unknown command: /alfred:1-plan
|
|
2557
|
+
```
|
|
2558
|
+
|
|
2559
|
+
**Cause**: Claude Code version issue or `.claude/` folder corrupted
|
|
2560
|
+
|
|
2561
|
+
**Solution**:
|
|
2562
|
+
|
|
2563
|
+
```bash
|
|
2564
|
+
# 1. Check Claude Code version (need v1.5.0+)
|
|
2565
|
+
claude --version
|
|
2566
|
+
|
|
2567
|
+
# 2. Verify .claude/ folder
|
|
2568
|
+
ls -la .claude/commands/
|
|
2569
|
+
|
|
2570
|
+
# 3. Reinitialize if needed
|
|
2571
|
+
moai-adk init .
|
|
2572
|
+
|
|
2573
|
+
# 4. Restart Claude Code
|
|
2574
|
+
exit
|
|
2575
|
+
claude
|
|
2576
|
+
```
|
|
2577
|
+
|
|
2578
|
+
---
|
|
2579
|
+
|
|
2580
|
+
### 7. TAG Chain Broken
|
|
2581
|
+
|
|
2582
|
+
**Symptom**:
|
|
2583
|
+
```
|
|
2584
|
+
⚠ Orphan TAG detected: @TEST:HELLO-001 (no matching @SPEC)
|
|
2585
|
+
```
|
|
2586
|
+
|
|
2587
|
+
**Cause**: SPEC deleted or TAGs don't match
|
|
2588
|
+
|
|
2589
|
+
**Solution**:
|
|
2590
|
+
|
|
2591
|
+
```bash
|
|
2592
|
+
# 1. Validate TAG chain
|
|
2593
|
+
rg '@(SPEC|TEST|CODE):HELLO-001' -n
|
|
2594
|
+
|
|
2595
|
+
# 2. Check if SPEC exists
|
|
2596
|
+
rg '@SPEC:HELLO-001' -n .moai/specs/
|
|
2597
|
+
|
|
2598
|
+
# 3. If SPEC missing, regenerate
|
|
2599
|
+
/alfred:1-plan "feature description"
|
|
2600
|
+
|
|
2601
|
+
# Or fix TAG in test file
|
|
2602
|
+
# Edit tests/test_hello.py: @TEST:HELLO-001 → @TEST:HELLO-002
|
|
2603
|
+
|
|
2604
|
+
# 4. Sync
|
|
2605
|
+
/alfred:3-sync
|
|
2606
|
+
```
|
|
2607
|
+
|
|
2608
|
+
---
|
|
2609
|
+
|
|
2610
|
+
### 8. General Debugging Commands
|
|
2611
|
+
|
|
2612
|
+
**Check System Status**:
|
|
2613
|
+
```bash
|
|
2614
|
+
moai-adk doctor
|
|
2615
|
+
```
|
|
2616
|
+
Shows all dependency checks + recommendations
|
|
2617
|
+
|
|
2618
|
+
**Check Project Structure**:
|
|
2619
|
+
```bash
|
|
2620
|
+
tree -L 2 .moai/
|
|
2621
|
+
```
|
|
2622
|
+
|
|
2623
|
+
**Validate TAG Chain Integrity**:
|
|
2624
|
+
```bash
|
|
2625
|
+
rg '@(SPEC|TEST|CODE|DOC):' -n | wc -l
|
|
2626
|
+
```
|
|
2627
|
+
Shows total TAG count
|
|
2628
|
+
|
|
2629
|
+
**Check Git Status**:
|
|
2630
|
+
```bash
|
|
2631
|
+
git status
|
|
2632
|
+
git log --oneline -5
|
|
2633
|
+
```
|
|
2634
|
+
|
|
2635
|
+
---
|
|
2636
|
+
|
|
2637
|
+
### Debugging Checklist
|
|
2638
|
+
|
|
2639
|
+
When something goes wrong:
|
|
2640
|
+
|
|
2641
|
+
1. **Read**: Copy the complete error message
|
|
2642
|
+
2. **Search**: Check GitHub Issues for similar errors
|
|
2643
|
+
3. **Diagnose**: Run `moai-adk doctor`
|
|
2644
|
+
4. **Restart**: Quit and restart Claude Code
|
|
2645
|
+
5. **Ask**: Post in GitHub Discussions
|
|
2646
|
+
|
|
2647
|
+
Quick diagnosis with details:
|
|
2648
|
+
```bash
|
|
2649
|
+
moai-adk doctor --verbose
|
|
2650
|
+
```
|
|
2651
|
+
|
|
2652
|
+
---
|
|
2653
|
+
|
|
2654
|
+
### Need More Help?
|
|
2655
|
+
|
|
2656
|
+
- **GitHub Issues**: Search for similar problems
|
|
2657
|
+
- **GitHub Discussions**: Ask questions
|
|
2658
|
+
- **Discord Community**: Real-time chat support
|
|
2659
|
+
|
|
2660
|
+
**When reporting issues, include**:
|
|
2661
|
+
1. Output from `moai-adk doctor --verbose`
|
|
2662
|
+
2. Complete error message (screenshot or text)
|
|
2663
|
+
3. Steps to reproduce
|
|
2664
|
+
4. Your OS and version
|
|
2665
|
+
|
|
2666
|
+
---
|
|
2667
|
+
|
|
2668
|
+
### Frequently Asked Questions
|
|
2669
|
+
|
|
2670
|
+
**Q. Can I install on an existing project?**
|
|
2671
|
+
A. Yes! Run `moai-adk init .` - it only adds `.moai/` structure without touching existing code.
|
|
2672
|
+
|
|
2673
|
+
**Q. How do I run tests?**
|
|
2674
|
+
A. `/alfred:2-run` runs tests first. You can also run `pytest`, `pnpm test` separately.
|
|
2675
|
+
|
|
2676
|
+
**Q. How do I verify documentation is current?**
|
|
2677
|
+
A. Run `/alfred:3-sync` which generates a Sync Report. Check the PR to see the report.
|
|
2678
|
+
|
|
2679
|
+
**Q. Can I do this manually without Alfred?**
|
|
2680
|
+
A. Possible, but remember: SPEC → TEST → CODE → DOC order and keep @TAGs updated.
|
|
2681
|
+
|
|
2682
|
+
---
|
|
2683
|
+
|
|
2049
2684
|
## Additional Resources
|
|
2050
2685
|
|
|
2051
2686
|
| Purpose | Resource |
|