moai-adk 0.15.1__py3-none-any.whl → 0.25.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 +1 -2
- moai_adk/__main__.py +85 -2
- moai_adk/cli/__init__.py +0 -1
- moai_adk/cli/commands/__init__.py +0 -1
- moai_adk/cli/commands/analyze.py +127 -0
- moai_adk/cli/commands/backup.py +5 -3
- moai_adk/cli/commands/doctor.py +35 -11
- moai_adk/cli/commands/improve_user_experience.py +348 -0
- moai_adk/cli/commands/init.py +150 -23
- moai_adk/cli/commands/language.py +269 -0
- moai_adk/cli/commands/migrate.py +158 -0
- moai_adk/cli/commands/status.py +13 -12
- moai_adk/cli/commands/update.py +364 -60
- moai_adk/cli/commands/validate_links.py +118 -0
- moai_adk/cli/main.py +3 -2
- moai_adk/cli/prompts/init_prompts.py +79 -82
- moai_adk/core/__init__.py +0 -1
- moai_adk/core/analysis/__init__.py +9 -0
- moai_adk/core/analysis/session_analyzer.py +439 -0
- moai_adk/core/claude_integration.py +421 -0
- moai_adk/core/command_helpers.py +270 -0
- moai_adk/core/config/__init__.py +6 -0
- moai_adk/core/config/auto_spec_config.py +346 -0
- moai_adk/core/config/migration.py +133 -12
- moai_adk/core/context_manager.py +279 -0
- moai_adk/core/diagnostics/slash_commands.py +0 -1
- moai_adk/core/error_recovery_system.py +1289 -0
- moai_adk/core/git/__init__.py +0 -1
- moai_adk/core/git/branch.py +0 -1
- moai_adk/core/git/branch_manager.py +4 -4
- moai_adk/core/git/checkpoint.py +1 -5
- moai_adk/core/git/commit.py +0 -1
- moai_adk/core/git/event_detector.py +3 -5
- moai_adk/core/git/manager.py +0 -1
- moai_adk/core/hooks/post_tool_auto_spec_completion.py +925 -0
- moai_adk/core/integration/__init__.py +22 -0
- moai_adk/core/integration/engine.py +169 -0
- moai_adk/core/integration/integration_tester.py +225 -0
- moai_adk/core/integration/models.py +88 -0
- moai_adk/core/integration/utils.py +211 -0
- moai_adk/core/issue_creator.py +28 -18
- moai_adk/core/language_config.py +202 -0
- moai_adk/core/language_validator.py +556 -0
- moai_adk/core/mcp/setup.py +113 -0
- moai_adk/core/migration/__init__.py +18 -0
- moai_adk/core/migration/backup_manager.py +208 -0
- moai_adk/core/migration/file_migrator.py +218 -0
- moai_adk/core/migration/version_detector.py +143 -0
- moai_adk/core/migration/version_migrator.py +228 -0
- moai_adk/core/performance/__init__.py +6 -0
- moai_adk/core/performance/cache_system.py +318 -0
- moai_adk/core/performance/parallel_processor.py +116 -0
- moai_adk/core/project/__init__.py +0 -1
- moai_adk/core/project/backup_utils.py +2 -7
- moai_adk/core/project/checker.py +3 -3
- moai_adk/core/project/detector.py +20 -40
- moai_adk/core/project/initializer.py +42 -17
- moai_adk/core/project/phase_executor.py +415 -58
- moai_adk/core/project/validator.py +6 -25
- moai_adk/core/quality/__init__.py +1 -1
- moai_adk/core/quality/trust_checker.py +64 -110
- moai_adk/core/quality/validators/__init__.py +1 -1
- moai_adk/core/quality/validators/base_validator.py +1 -1
- moai_adk/core/rollback_manager.py +993 -0
- moai_adk/core/session_manager.py +667 -0
- moai_adk/core/spec/confidence_scoring.py +749 -0
- moai_adk/core/spec/ears_template_engine.py +1182 -0
- moai_adk/core/spec/quality_validator.py +721 -0
- moai_adk/core/spec_status_manager.py +488 -0
- moai_adk/core/template/__init__.py +0 -1
- moai_adk/core/template/backup.py +41 -1
- moai_adk/core/template/config.py +11 -12
- moai_adk/core/template/languages.py +0 -1
- moai_adk/core/template/merger.py +79 -22
- moai_adk/core/template/processor.py +614 -40
- moai_adk/core/template_engine.py +36 -27
- moai_adk/foundation/git/commit_templates.py +565 -0
- moai_adk/foundation/trust/trust_principles.py +725 -0
- moai_adk/foundation/trust/validation_checklist.py +1678 -0
- moai_adk/statusline/__init__.py +38 -0
- moai_adk/statusline/alfred_detector.py +107 -0
- moai_adk/statusline/config.py +364 -0
- moai_adk/statusline/enhanced_output_style_detector.py +364 -0
- moai_adk/statusline/git_collector.py +190 -0
- moai_adk/statusline/main.py +228 -0
- moai_adk/statusline/metrics_tracker.py +78 -0
- moai_adk/statusline/renderer.py +327 -0
- moai_adk/statusline/update_checker.py +135 -0
- moai_adk/statusline/version_reader.py +647 -0
- moai_adk/templates/.git-hooks/pre-commit +66 -0
- moai_adk/templates/.git-hooks/pre-push +116 -4
- moai_adk/templates/.github/workflows/moai-gitflow.yml +1 -7
- moai_adk/templates/.github/workflows/spec-issue-sync.yml +0 -1
- moai_adk/templates/.gitignore +44 -0
- moai_adk/templates/.mcp.json +22 -0
- moai_adk/templates/CLAUDE.md +450 -1071
- moai_adk/utils/__init__.py +0 -1
- moai_adk/utils/banner.py +0 -1
- moai_adk/utils/common.py +308 -0
- moai_adk/utils/link_validator.py +249 -0
- moai_adk/utils/logger.py +4 -9
- moai_adk/utils/safe_file_reader.py +210 -0
- moai_adk/utils/user_experience.py +531 -0
- moai_adk-0.25.4.dist-info/METADATA +2279 -0
- moai_adk-0.25.4.dist-info/RECORD +112 -0
- moai_adk/core/tags/__init__.py +0 -86
- moai_adk/core/tags/ci_validator.py +0 -463
- moai_adk/core/tags/cli.py +0 -283
- moai_adk/core/tags/generator.py +0 -109
- moai_adk/core/tags/inserter.py +0 -99
- moai_adk/core/tags/mapper.py +0 -126
- moai_adk/core/tags/parser.py +0 -76
- moai_adk/core/tags/pre_commit_validator.py +0 -393
- moai_adk/core/tags/reporter.py +0 -956
- moai_adk/core/tags/tags.py +0 -149
- moai_adk/core/tags/validator.py +0 -897
- moai_adk/templates/.claude/agents/alfred/backend-expert.md +0 -319
- moai_adk/templates/.claude/agents/alfred/cc-manager.md +0 -316
- moai_adk/templates/.claude/agents/alfred/debug-helper.md +0 -208
- moai_adk/templates/.claude/agents/alfred/devops-expert.md +0 -464
- moai_adk/templates/.claude/agents/alfred/doc-syncer.md +0 -214
- moai_adk/templates/.claude/agents/alfred/frontend-expert.md +0 -357
- moai_adk/templates/.claude/agents/alfred/git-manager.md +0 -406
- moai_adk/templates/.claude/agents/alfred/implementation-planner.md +0 -423
- moai_adk/templates/.claude/agents/alfred/project-manager.md +0 -312
- moai_adk/templates/.claude/agents/alfred/quality-gate.md +0 -343
- moai_adk/templates/.claude/agents/alfred/skill-factory.md +0 -865
- moai_adk/templates/.claude/agents/alfred/spec-builder.md +0 -426
- moai_adk/templates/.claude/agents/alfred/tag-agent.md +0 -361
- moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +0 -428
- moai_adk/templates/.claude/agents/alfred/trust-checker.md +0 -375
- moai_adk/templates/.claude/agents/alfred/ui-ux-expert.md +0 -571
- moai_adk/templates/.claude/commands/alfred/0-project.md +0 -1854
- moai_adk/templates/.claude/commands/alfred/1-plan.md +0 -880
- moai_adk/templates/.claude/commands/alfred/2-run.md +0 -793
- moai_adk/templates/.claude/commands/alfred/3-sync.md +0 -1084
- moai_adk/templates/.claude/commands/alfred/9-feedback.md +0 -149
- moai_adk/templates/.claude/hooks/alfred/core/project.py +0 -748
- moai_adk/templates/.claude/hooks/alfred/core/timeout.py +0 -136
- moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +0 -108
- moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +0 -198
- moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +0 -29
- moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +0 -94
- moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +0 -100
- moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +0 -94
- moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +0 -94
- moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +0 -170
- moai_adk/templates/.claude/hooks/alfred/shared/core/checkpoint.py +0 -271
- moai_adk/templates/.claude/hooks/alfred/shared/core/context.py +0 -67
- moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +0 -749
- moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +0 -230
- moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +0 -198
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py +0 -21
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +0 -154
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +0 -174
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +0 -87
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +0 -61
- moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +0 -112
- moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +0 -1
- moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +0 -161
- moai_adk/templates/.claude/settings.json +0 -144
- moai_adk/templates/.claude/skills/moai-alfred-agent-guide/SKILL.md +0 -70
- moai_adk/templates/.claude/skills/moai-alfred-agent-guide/examples.md +0 -62
- moai_adk/templates/.claude/skills/moai-alfred-agent-guide/reference.md +0 -242
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/SKILL.md +0 -56
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/examples.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/reference.md +0 -444
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/SKILL.md +0 -62
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/examples.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/reference.md +0 -405
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/SKILL.md +0 -51
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/examples.md +0 -355
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/reference.md +0 -239
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/SKILL.md +0 -323
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/examples.md +0 -286
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/reference.md +0 -126
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +0 -122
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/reference.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/SKILL.md +0 -74
- moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/reference.md +0 -269
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +0 -237
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +0 -615
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +0 -653
- moai_adk/templates/.claude/skills/moai-alfred-issue-labels/SKILL.md +0 -19
- moai_adk/templates/.claude/skills/moai-alfred-issue-labels/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-alfred-issue-labels/reference.md +0 -150
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-persona-roles/SKILL.md +0 -198
- moai_adk/templates/.claude/skills/moai-alfred-persona-roles/examples.md +0 -431
- moai_adk/templates/.claude/skills/moai-alfred-persona-roles/reference.md +0 -141
- moai_adk/templates/.claude/skills/moai-alfred-practices/SKILL.md +0 -89
- moai_adk/templates/.claude/skills/moai-alfred-practices/examples.md +0 -122
- moai_adk/templates/.claude/skills/moai-alfred-practices/reference.md +0 -369
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/SKILL.md +0 -508
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/examples.md +0 -481
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/reference.md +0 -100
- moai_adk/templates/.claude/skills/moai-alfred-reporting/SKILL.md +0 -273
- moai_adk/templates/.claude/skills/moai-alfred-rules/SKILL.md +0 -77
- moai_adk/templates/.claude/skills/moai-alfred-rules/examples.md +0 -265
- moai_adk/templates/.claude/skills/moai-alfred-rules/reference.md +0 -539
- moai_adk/templates/.claude/skills/moai-alfred-session-state/SKILL.md +0 -19
- moai_adk/templates/.claude/skills/moai-alfred-session-state/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-alfred-session-state/reference.md +0 -84
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/README.md +0 -137
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/SKILL.md +0 -219
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples/validate-spec.sh +0 -161
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples.md +0 -541
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/reference.md +0 -622
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/SKILL.md +0 -115
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/reference.md +0 -348
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/SKILL.md +0 -19
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/reference.md +0 -211
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-workflow/SKILL.md +0 -288
- moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +0 -269
- moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +0 -32
- moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +0 -298
- moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +0 -26
- moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +0 -307
- moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +0 -21
- moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +0 -252
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +0 -19
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +0 -19
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +0 -24
- moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +0 -199
- moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +0 -39
- moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +0 -316
- moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +0 -18
- moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +0 -263
- moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +0 -30
- moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/SKILL.md +0 -19
- moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/reference.md +0 -218
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/CHECKLIST.md +0 -482
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/EXAMPLES.md +0 -278
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/INTERACTIVE-DISCOVERY.md +0 -524
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/METADATA.md +0 -477
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/PARALLEL-ANALYSIS-REPORT.md +0 -429
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/PYTHON-VERSION-MATRIX.md +0 -391
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-FACTORY-WORKFLOW.md +0 -431
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-UPDATE-ADVISOR.md +0 -577
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL.md +0 -271
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/STEP-BY-STEP-GUIDE.md +0 -466
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/STRUCTURE.md +0 -583
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/WEB-RESEARCH.md +0 -526
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/reference.md +0 -465
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/generate-structure.sh +0 -328
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/validate-skill.sh +0 -312
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/SKILL_TEMPLATE.md +0 -245
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/examples-template.md +0 -285
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/reference-template.md +0 -278
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/scripts-template.sh +0 -303
- moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +0 -291
- moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +0 -15
- moai_adk/templates/.claude/skills/moai-design-systems/SKILL.md +0 -802
- moai_adk/templates/.claude/skills/moai-design-systems/examples.md +0 -1238
- moai_adk/templates/.claude/skills/moai-design-systems/reference.md +0 -673
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +0 -290
- moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +0 -1633
- moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +0 -660
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-database/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-database/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +0 -128
- moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-security/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-security/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +0 -303
- moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +0 -1064
- moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +0 -1047
- moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +0 -116
- moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +0 -122
- moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +0 -307
- moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
- moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +0 -1099
- moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-c/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-c/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +0 -127
- moai_adk/templates/.claude/skills/moai-lang-go/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-go/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +0 -126
- moai_adk/templates/.claude/skills/moai-lang-java/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-java/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +0 -125
- moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +0 -32
- moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +0 -126
- moai_adk/templates/.claude/skills/moai-lang-php/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-php/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +0 -433
- moai_adk/templates/.claude/skills/moai-lang-python/examples.md +0 -624
- moai_adk/templates/.claude/skills/moai-lang-python/reference.md +0 -316
- moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-r/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-r/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +0 -127
- moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +0 -125
- moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +0 -133
- moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +0 -34
- moai_adk/templates/.claude/skills/moai-project-documentation.md +0 -622
- moai_adk/templates/.github/workflows/c-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/cpp-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/csharp-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/dart-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/go-tag-validation.yml +0 -130
- moai_adk/templates/.github/workflows/java-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/javascript-tag-validation.yml +0 -135
- moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/php-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/python-tag-validation.yml +0 -118
- moai_adk/templates/.github/workflows/release.yml +0 -118
- moai_adk/templates/.github/workflows/ruby-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/rust-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/shell-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/swift-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/tag-report.yml +0 -269
- moai_adk/templates/.github/workflows/tag-validation.yml +0 -186
- moai_adk/templates/.github/workflows/typescript-tag-validation.yml +0 -154
- moai_adk/templates/.moai/config.json +0 -115
- moai_adk/templates/workflows/go-tag-validation.yml +0 -30
- moai_adk/templates/workflows/javascript-tag-validation.yml +0 -41
- moai_adk/templates/workflows/python-tag-validation.yml +0 -42
- moai_adk/templates/workflows/typescript-tag-validation.yml +0 -31
- moai_adk-0.15.1.dist-info/METADATA +0 -3094
- moai_adk-0.15.1.dist-info/RECORD +0 -365
- {moai_adk-0.15.1.dist-info → moai_adk-0.25.4.dist-info}/WHEEL +0 -0
- {moai_adk-0.15.1.dist-info → moai_adk-0.25.4.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.15.1.dist-info → moai_adk-0.25.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,3094 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: moai-adk
|
|
3
|
-
Version: 0.15.1
|
|
4
|
-
Summary: MoAI Agentic Development Kit - SPEC-First TDD with Alfred SuperAgent & Complete Skills v2.0
|
|
5
|
-
Project-URL: Homepage, https://github.com/modu-ai/moai-adk
|
|
6
|
-
Project-URL: Repository, https://github.com/modu-ai/moai-adk
|
|
7
|
-
Project-URL: Issues, https://github.com/modu-ai/moai-adk/issues
|
|
8
|
-
Project-URL: Changelog, https://github.com/modu-ai/moai-adk/releases
|
|
9
|
-
Author-email: MoAI Team <support@moduai.kr>
|
|
10
|
-
License: MIT
|
|
11
|
-
License-File: LICENSE
|
|
12
|
-
Keywords: agentic,ai,alfred,claude,development,spec-first,tdd,toolkit
|
|
13
|
-
Classifier: Development Status :: 4 - Beta
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
-
Classifier: Topic :: Software Development :: Quality Assurance
|
|
22
|
-
Classifier: Topic :: Software Development :: Testing
|
|
23
|
-
Requires-Python: >=3.11
|
|
24
|
-
Requires-Dist: click>=8.1.0
|
|
25
|
-
Requires-Dist: gitpython>=3.1.45
|
|
26
|
-
Requires-Dist: jinja2>=3.0.0
|
|
27
|
-
Requires-Dist: packaging>=21.0
|
|
28
|
-
Requires-Dist: pyfiglet>=1.0.2
|
|
29
|
-
Requires-Dist: pyyaml>=6.0
|
|
30
|
-
Requires-Dist: questionary>=2.0.0
|
|
31
|
-
Requires-Dist: requests>=2.28.0
|
|
32
|
-
Requires-Dist: rich>=13.0.0
|
|
33
|
-
Provides-Extra: dev
|
|
34
|
-
Requires-Dist: mypy>=1.7.0; extra == 'dev'
|
|
35
|
-
Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
|
|
36
|
-
Requires-Dist: pytest-xdist>=3.8.0; extra == 'dev'
|
|
37
|
-
Requires-Dist: pytest>=8.4.2; extra == 'dev'
|
|
38
|
-
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
39
|
-
Requires-Dist: types-pyyaml>=6.0.0; extra == 'dev'
|
|
40
|
-
Provides-Extra: security
|
|
41
|
-
Requires-Dist: bandit>=1.8.0; extra == 'security'
|
|
42
|
-
Requires-Dist: pip-audit>=2.7.0; extra == 'security'
|
|
43
|
-
Description-Content-Type: text/markdown
|
|
44
|
-
|
|
45
|
-
# MoAI-ADK (Agentic Development Kit)
|
|
46
|
-
|
|
47
|
-
[한국어](README.ko.md) | [English](README.md)
|
|
48
|
-
|
|
49
|
-
[](https://pypi.org/project/moai-adk/)
|
|
50
|
-
[](https://opensource.org/licenses/MIT)
|
|
51
|
-
[](https://www.python.org/)
|
|
52
|
-
[](https://github.com/modu-ai/moai-adk/actions/workflows/moai-gitflow.yml)
|
|
53
|
-
[](https://codecov.io/gh/modu-ai/moai-adk)
|
|
54
|
-
[](https://github.com/modu-ai/moai-adk)
|
|
55
|
-
|
|
56
|
-
> **MoAI-ADK delivers a seamless development workflow that naturally connects SPEC → TEST (TDD) → CODE → DOCUMENTATION with AI.**
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## 1. MoAI-ADK at a Glance
|
|
61
|
-
|
|
62
|
-
MoAI-ADK transforms AI-powered development with three core principles. Use the navigation below to jump to the section that matches your needs.
|
|
63
|
-
|
|
64
|
-
If you're **new to MoAI-ADK**, start with "What is MoAI-ADK?".
|
|
65
|
-
If you want to **get started quickly**, jump straight to "5-Minute Quick Start".
|
|
66
|
-
If you've **already installed it and want to understand the concepts**, we recommend "5 Key Concepts".
|
|
67
|
-
|
|
68
|
-
| Question | Jump To |
|
|
69
|
-
| ---------------------------------- | ------------------------------------------------------------------------ |
|
|
70
|
-
| First time here—what is it? | [What is MoAI-ADK?](#what-is-moai-adk) |
|
|
71
|
-
| How do I get started? | [5-Minute Quick Start](#5-minute-quick-start) |
|
|
72
|
-
| What's the basic flow? | [Core Workflow (0 → 3)](#core-workflow-0--3) |
|
|
73
|
-
| What do Plan/Run/Sync commands do? | [Command Cheat Sheet](#command-cheat-sheet) |
|
|
74
|
-
| What are SPEC, TDD, TAG? | [5 Key Concepts](#5-key-concepts) |
|
|
75
|
-
| Tell me about agents/Skills | [Sub-agents & Skills Overview](#sub-agents--skills-overview) |
|
|
76
|
-
| Want to dive deeper? | [Additional Resources](#additional-resources) |
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## What is MoAI-ADK?
|
|
81
|
-
|
|
82
|
-
### The Problem: Trust Crisis in AI Development
|
|
83
|
-
|
|
84
|
-
Today, countless developers want help from Claude or ChatGPT, but can't shake one fundamental doubt: **"Can I really trust the code this AI generates?"**
|
|
85
|
-
|
|
86
|
-
The reality looks like this. Ask an AI to "build a login feature" and you'll get syntactically perfect code. But these problems keep repeating:
|
|
87
|
-
|
|
88
|
-
- **Unclear Requirements**: The basic question "What exactly should we build?" remains unanswered. Email/password login? OAuth? 2FA? Everything relies on guessing.
|
|
89
|
-
- **Missing Tests**: Most AIs only test the "happy path". Wrong password? Network error? Three months later, bugs explode in production.
|
|
90
|
-
- **Documentation Drift**: Code gets modified but docs stay the same. The question "Why is this code here?" keeps repeating.
|
|
91
|
-
- **Context Loss**: Even within the same project, you have to explain everything from scratch each time. Project structure, decision rationale, previous attempts—nothing gets recorded.
|
|
92
|
-
- **Impact Tracking Impossible**: When requirements change, you can't track which code is affected.
|
|
93
|
-
|
|
94
|
-
### The Solution: SPEC-First TDD with Alfred SuperAgent
|
|
95
|
-
|
|
96
|
-
**MoAI-ADK** (MoAI Agentic Development Kit) is an open-source framework designed to **systematically solve** these problems.
|
|
97
|
-
|
|
98
|
-
The core principle is simple yet powerful:
|
|
99
|
-
|
|
100
|
-
> **"No tests without code, no SPEC without tests"**
|
|
101
|
-
|
|
102
|
-
More precisely, it's the reverse order:
|
|
103
|
-
|
|
104
|
-
> **"SPEC comes first. No tests without SPEC. No complete documentation without tests and code."**
|
|
105
|
-
|
|
106
|
-
When you follow this order, magical things happen:
|
|
107
|
-
|
|
108
|
-
**1️⃣ Clear Requirements**
|
|
109
|
-
Write SPECs first with the `/alfred:1-plan` command. A vague request like "login feature" transforms into **clear requirements** like "WHEN valid credentials are provided, the system SHALL issue a JWT token". Alfred's spec-builder uses EARS syntax to create professional SPECs in just 3 minutes.
|
|
110
|
-
|
|
111
|
-
**2️⃣ Test Guarantee**
|
|
112
|
-
`/alfred:2-run` automatically performs Test-Driven Development (TDD). It proceeds in RED (failing test) → GREEN (minimal implementation) → REFACTOR (cleanup) order, **guaranteeing 85%+ test coverage**. No more "testing later". Tests drive code creation.
|
|
113
|
-
|
|
114
|
-
**3️⃣ Automatic Documentation Sync**
|
|
115
|
-
A single `/alfred:3-sync` command **synchronizes** all code, tests, and documentation. README, CHANGELOG, API docs, and Living Documents all update automatically. Six months later, code and docs still match.
|
|
116
|
-
|
|
117
|
-
**4️⃣ Tracking with @TAG System**
|
|
118
|
-
Every piece of code, test, and documentation gets a `@TAG:ID`. When requirements change later, one command—`rg "@SPEC:EX-AUTH-001"`—**finds all related tests, implementations, and docs**. You gain confidence during refactoring.
|
|
119
|
-
|
|
120
|
-
**5️⃣ Alfred Remembers Context**
|
|
121
|
-
A team of AI agents collaborate to **remember** your project's structure, decision rationale, and work history. No need to repeat the same questions.
|
|
122
|
-
|
|
123
|
-
### MoAI-ADK's 3 Core Promises
|
|
124
|
-
|
|
125
|
-
For beginners to remember easily, MoAI-ADK's value simplifies to three things:
|
|
126
|
-
|
|
127
|
-
**First, SPEC comes before code**
|
|
128
|
-
Start by clearly defining what to build. Writing SPEC helps discover problems before implementation. Communication costs with teammates drop dramatically.
|
|
129
|
-
|
|
130
|
-
**Second, tests drive code (TDD)**
|
|
131
|
-
Write tests before implementation (RED). Implement minimally to pass tests (GREEN). Then clean up the code (REFACTOR). Result: fewer bugs, confidence in refactoring, code anyone can understand.
|
|
132
|
-
|
|
133
|
-
**Third, documentation and code always match**
|
|
134
|
-
One `/alfred:3-sync` command auto-updates all documentation. README, CHANGELOG, API docs, and Living Documents always sync with code. No more despair when modifying six-month-old code.
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## Why Do You Need It?
|
|
139
|
-
|
|
140
|
-
### Real Challenges in AI Development
|
|
141
|
-
|
|
142
|
-
Modern AI-powered development faces various challenges. MoAI-ADK **systematically solves** all these problems:
|
|
143
|
-
|
|
144
|
-
| Concern | Traditional Approach Problem | MoAI-ADK Solution |
|
|
145
|
-
| ------------------------------- | -------------------------------------------------- | ------------------------------------------------------------- |
|
|
146
|
-
| "Can't trust AI code" | Implementation without tests, unclear verification | Enforces SPEC → TEST → CODE order, guarantees 85%+ coverage |
|
|
147
|
-
| "Repeating same explanations" | Context loss, unrecorded project history | Alfred remembers everything, 19 AI team members collaborate |
|
|
148
|
-
| "Hard to write prompts" | Don't know how to write good prompts | `/alfred` commands provide standardized prompts automatically |
|
|
149
|
-
| "Documentation always outdated" | Forget to update docs after code changes | `/alfred:3-sync` auto-syncs with one command |
|
|
150
|
-
| "Don't know what changed where" | Hard to search code, unclear intent | @TAG chain connects SPEC → TEST → CODE → DOC |
|
|
151
|
-
| "Team onboarding takes forever" | New members can't grasp code context | Reading SPEC makes intent immediately clear |
|
|
152
|
-
|
|
153
|
-
### Benefits You Can Experience Right Now
|
|
154
|
-
|
|
155
|
-
From the moment you adopt MoAI-ADK, you'll feel:
|
|
156
|
-
|
|
157
|
-
- **Faster Development**: Clear SPEC reduces round-trip explanation time
|
|
158
|
-
- **Fewer Bugs**: SPEC-based tests catch issues early
|
|
159
|
-
- **Better Code Understanding**: @TAG and SPEC make intent immediately clear
|
|
160
|
-
- **Lower Maintenance Costs**: Code and docs always match
|
|
161
|
-
- **Efficient Team Collaboration**: Clear communication through SPEC and TAG
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## 🖥️ Platform Support
|
|
166
|
-
|
|
167
|
-
### Supported Platforms
|
|
168
|
-
- ✅ **macOS** (11.0+)
|
|
169
|
-
- ✅ **Linux** (Ubuntu 20.04+, Debian 11+, etc.)
|
|
170
|
-
- ✅ **Windows** (10/11) - Full support as of v0.11.0
|
|
171
|
-
- Note: Hooks system requires Python 3.11+
|
|
172
|
-
- All hook features work seamlessly on Windows with cross-platform timeout handling
|
|
173
|
-
|
|
174
|
-
### System Requirements
|
|
175
|
-
- **Python**: 3.11 or higher
|
|
176
|
-
- **Git**: 2.30+
|
|
177
|
-
- **GitHub CLI** (`gh`): Optional, required for PR automation in team mode
|
|
178
|
-
|
|
179
|
-
---
|
|
180
|
-
|
|
181
|
-
## ⚡ 3-Minute Lightning Start
|
|
182
|
-
|
|
183
|
-
Get your first MoAI-ADK project running in **3 simple steps**. Beginners can finish in under 5 minutes.
|
|
184
|
-
|
|
185
|
-
### Step 1: Install uv (about 1 minute)
|
|
186
|
-
|
|
187
|
-
#### Command
|
|
188
|
-
|
|
189
|
-
**Choose your platform**:
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
# macOS/Linux
|
|
193
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
194
|
-
|
|
195
|
-
# Windows (PowerShell) - RECOMMENDED FOR WINDOWS USERS
|
|
196
|
-
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
197
|
-
|
|
198
|
-
# Windows (Git Bash) - Alternative
|
|
199
|
-
curl -LsSf https://astral.sh/uv/install.sh | bash
|
|
200
|
-
|
|
201
|
-
# WSL (Windows Subsystem for Linux)
|
|
202
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
203
|
-
|
|
204
|
-
# Verify installation
|
|
205
|
-
uv --version
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
**Platform Selection Guide**:
|
|
209
|
-
|
|
210
|
-
| Platform | Method | Notes |
|
|
211
|
-
|----------|--------|-------|
|
|
212
|
-
| **macOS** | bash | Native UNIX-based, use standard installation |
|
|
213
|
-
| **Linux** | bash | Native Linux support |
|
|
214
|
-
| **Windows (Native)** | ⭐ PowerShell | **RECOMMENDED** - Most stable, native Windows support |
|
|
215
|
-
| **Windows (Git Bash)** | bash | Alternative if PowerShell unavailable |
|
|
216
|
-
| **WSL** | bash | Use Linux installation within WSL2 |
|
|
217
|
-
|
|
218
|
-
**Important Notes on Windows**:
|
|
219
|
-
- 🟢 **PowerShell (Native)**: Most reliable and stable method. No WSL or Git Bash needed.
|
|
220
|
-
- 🟡 **Git Bash / WSL**: Works, but may encounter path issues. Try PowerShell first.
|
|
221
|
-
- ❌ **Do NOT use WSL if**: You're testing on Windows—PowerShell native is easier and faster.
|
|
222
|
-
|
|
223
|
-
**Why PowerShell for Windows?**
|
|
224
|
-
- Fewer environment setup issues
|
|
225
|
-
- Better Windows integration
|
|
226
|
-
- Faster execution
|
|
227
|
-
- No WSL overhead
|
|
228
|
-
|
|
229
|
-
#### Expected Output
|
|
230
|
-
```
|
|
231
|
-
✓ uv 0.5.1 is already installed
|
|
232
|
-
$ uv --version
|
|
233
|
-
uv 0.5.1
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
#### Next: Install MoAI-ADK
|
|
237
|
-
|
|
238
|
-
```bash
|
|
239
|
-
uv tool install moai-adk
|
|
240
|
-
|
|
241
|
-
# Result: ✅ Installed moai-adk v0.14.0
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
**Verification**:
|
|
245
|
-
```bash
|
|
246
|
-
moai-adk --version
|
|
247
|
-
# Output: MoAI-ADK v0.14.0
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
### Step 2: Create Your First Project (about 1 minute)
|
|
253
|
-
|
|
254
|
-
#### Command
|
|
255
|
-
|
|
256
|
-
```bash
|
|
257
|
-
moai-adk init hello-world
|
|
258
|
-
cd hello-world
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
#### What Gets Created
|
|
262
|
-
|
|
263
|
-
```
|
|
264
|
-
hello-world/
|
|
265
|
-
├── .moai/ ✅ Alfred configuration
|
|
266
|
-
├── .claude/ ✅ Claude Code automation
|
|
267
|
-
├── CLAUDE.md ✅ Project guide
|
|
268
|
-
└── README.md ✅ Project documentation
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
#### Verification: Check Core Files
|
|
272
|
-
|
|
273
|
-
```bash
|
|
274
|
-
# Verify core config file exists
|
|
275
|
-
ls -la .moai/config.json # ✅ Should exist
|
|
276
|
-
ls -la .claude/commands/ # ✅ Should have commands
|
|
277
|
-
|
|
278
|
-
# Or all at once
|
|
279
|
-
moai-adk doctor
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
**Expected Output**:
|
|
283
|
-
```
|
|
284
|
-
✅ Python 3.13.0
|
|
285
|
-
✅ uv 0.5.1
|
|
286
|
-
✅ .moai/ directory initialized
|
|
287
|
-
✅ .claude/ directory ready
|
|
288
|
-
✅ 16 agents configured
|
|
289
|
-
✅ 74 skills loaded
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
---
|
|
293
|
-
|
|
294
|
-
### Step 3: Start Alfred (about 1 minute)
|
|
295
|
-
|
|
296
|
-
#### Run Claude Code
|
|
297
|
-
|
|
298
|
-
```bash
|
|
299
|
-
claude
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
#### Enter in Claude Code
|
|
303
|
-
|
|
304
|
-
```
|
|
305
|
-
/alfred:0-project
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
#### Alfred Will Ask
|
|
309
|
-
|
|
310
|
-
```
|
|
311
|
-
Q1: Project name?
|
|
312
|
-
A: hello-world
|
|
313
|
-
|
|
314
|
-
Q2: Project goal?
|
|
315
|
-
A: Learning MoAI-ADK
|
|
316
|
-
|
|
317
|
-
Q3: Main development language?
|
|
318
|
-
A: python
|
|
319
|
-
|
|
320
|
-
Q4: Mode?
|
|
321
|
-
A: personal (for local development)
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
#### Result: Project Ready! ✅
|
|
325
|
-
|
|
326
|
-
```
|
|
327
|
-
✅ Project initialized
|
|
328
|
-
✅ Config saved to .moai/config.json
|
|
329
|
-
✅ Documents created in .moai/project/
|
|
330
|
-
✅ Alfred recommends skills
|
|
331
|
-
|
|
332
|
-
Next: Run /alfred:1-plan "your feature description"
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
---
|
|
336
|
-
|
|
337
|
-
## Next: Complete Your First Feature in 10 Minutes
|
|
338
|
-
|
|
339
|
-
You're now ready to build your first complete feature with SPEC, TDD, and auto-generated docs!
|
|
340
|
-
|
|
341
|
-
> **→ Continue to: ["First 10-Minute Hands-On: Hello World API"](#-first-10-minute-hands-on-hello-world-api)**
|
|
342
|
-
|
|
343
|
-
In this section you'll experience:
|
|
344
|
-
- ✅ Define an API using SPEC
|
|
345
|
-
- ✅ Complete TDD cycle (RED → GREEN → REFACTOR)
|
|
346
|
-
- ✅ Auto-generate documentation
|
|
347
|
-
- ✅ Understand @TAG system
|
|
348
|
-
|
|
349
|
-
---
|
|
350
|
-
|
|
351
|
-
## Language Support
|
|
352
|
-
|
|
353
|
-
MoAI-ADK automatically detects and supports **15 programming languages** with dedicated CI/CD workflows:
|
|
354
|
-
|
|
355
|
-
### Core Languages (v0.11.0+)
|
|
356
|
-
- **Python** (pytest, mypy, ruff, 85% coverage target)
|
|
357
|
-
- **JavaScript** (npm/yarn/pnpm/bun auto-detect, 80% coverage target)
|
|
358
|
-
- **TypeScript** (tsc type checking, biome/eslint, 85% coverage target)
|
|
359
|
-
- **Go** (golangci-lint, gofmt, 75% coverage target)
|
|
360
|
-
|
|
361
|
-
### Extended Languages (v0.11.1+)
|
|
362
|
-
- **Ruby** (RSpec, Rubocop, bundle)
|
|
363
|
-
- **PHP** (PHPUnit, PHPCS, composer)
|
|
364
|
-
- **Java** (JUnit 5, Jacoco, Maven/Gradle auto-detection)
|
|
365
|
-
- **Rust** (cargo test, clippy, rustfmt)
|
|
366
|
-
- **Dart** (flutter test, dart analyze)
|
|
367
|
-
- **Swift** (XCTest, SwiftLint, SPM)
|
|
368
|
-
- **Kotlin** (JUnit 5, ktlint, Gradle)
|
|
369
|
-
- **C#** (xUnit, StyleCop, dotnet CLI)
|
|
370
|
-
- **C** (gcc/clang, cppcheck, CMake)
|
|
371
|
-
- **C++** (g++/clang++, Google Test, cpplint)
|
|
372
|
-
- **Shell** (shellcheck, bats-core)
|
|
373
|
-
|
|
374
|
-
### How Language Detection Works
|
|
375
|
-
|
|
376
|
-
When you run `/alfred:2-run SPEC-XXX`, MoAI-ADK automatically:
|
|
377
|
-
1. Scans your project for configuration files (package.json, pyproject.toml, go.mod, Cargo.toml, pom.xml, build.gradle, etc.)
|
|
378
|
-
2. Detects your project's primary language using priority-based detection (Rust → Dart → Swift → ... → Shell)
|
|
379
|
-
3. Auto-detects build tools (Maven/Gradle for Java, CMake for C/C++, SPM for Swift, etc.)
|
|
380
|
-
4. Selects the appropriate CI/CD workflow template
|
|
381
|
-
5. Generates language-specific testing and linting configuration
|
|
382
|
-
|
|
383
|
-
### Supported Languages
|
|
384
|
-
|
|
385
|
-
For detailed language detection priority and build tool detection, see [Language Detection Guide](.moai/docs/language-detection-guide.md)
|
|
386
|
-
|
|
387
|
-
### Customization
|
|
388
|
-
|
|
389
|
-
For advanced workflow customization, see [Workflow Templates Guide](.moai/docs/workflow-templates.md)
|
|
390
|
-
|
|
391
|
-
---
|
|
392
|
-
|
|
393
|
-
## Language Localization Architecture (v0.7.0+)
|
|
394
|
-
|
|
395
|
-
### Hybrid Language Model
|
|
396
|
-
|
|
397
|
-
MoAI-ADK v0.7.0 introduced a **two-layer language architecture** that enables global teams to work in their preferred language while keeping the infrastructure in English for consistency and maintainability.
|
|
398
|
-
|
|
399
|
-
### Layer 1: User Conversation & Dynamic Content
|
|
400
|
-
|
|
401
|
-
**All user-facing content uses your configured `conversation_language`** (set during `/alfred:0-project`):
|
|
402
|
-
|
|
403
|
-
- ✅ **Responses & Explanations**: Your language (Korean, Japanese, Spanish, English, Chinese, etc.)
|
|
404
|
-
- ✅ **Generated Documents**: SPEC, test files, implementation guides in your language
|
|
405
|
-
- ✅ **Code Comments**: Function docstrings and inline comments in your language
|
|
406
|
-
- ✅ **Git Commit Messages**: All commits in your language
|
|
407
|
-
- ✅ **Sub-agent Communication**: All task prompts in your language
|
|
408
|
-
|
|
409
|
-
### Layer 2: Static Infrastructure (English Only)
|
|
410
|
-
|
|
411
|
-
**System infrastructure stays in English** for global consistency:
|
|
412
|
-
|
|
413
|
-
- 🔒 `.claude/agents/` — Agent templates (English)
|
|
414
|
-
- 🔒 `.claude/commands/` — Command templates (English)
|
|
415
|
-
- 🔒 `.claude/skills/` — Skill content (English, industry standard)
|
|
416
|
-
- 🔒 `.moai/memory/` — Internal guidelines (English)
|
|
417
|
-
- 🔒 @TAG identifiers — Technical markers (English)
|
|
418
|
-
- 🔒 Package code in `src/moai_adk/` — Source code comments (English for global distribution)
|
|
419
|
-
|
|
420
|
-
### Configuration Example
|
|
421
|
-
|
|
422
|
-
```json
|
|
423
|
-
{
|
|
424
|
-
"language": {
|
|
425
|
-
"conversation_language": "ko",
|
|
426
|
-
"conversation_language_name": "Korean"
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
When configured, Alfred will:
|
|
432
|
-
- Respond in Korean (모든 대화)
|
|
433
|
-
- Generate SPECs in Korean
|
|
434
|
-
- Write code comments in Korean
|
|
435
|
-
- Create Git commits in Korean
|
|
436
|
-
- All while using English-only Skill() invocations internally
|
|
437
|
-
|
|
438
|
-
### Supported Languages
|
|
439
|
-
|
|
440
|
-
- 🇬🇧 English
|
|
441
|
-
- 🇰🇷 Korean (한국어)
|
|
442
|
-
- 🇯🇵 Japanese (日本語)
|
|
443
|
-
- 🇨🇳 Chinese (中文)
|
|
444
|
-
- 🇪🇸 Spanish (Español)
|
|
445
|
-
|
|
446
|
-
### Implementation Status (v0.7.0+)
|
|
447
|
-
|
|
448
|
-
| Component | Status | Details |
|
|
449
|
-
|-----------|--------|---------|
|
|
450
|
-
| **Config System** | ✅ Complete | Nested language structure in `.moai/config.json` |
|
|
451
|
-
| **Sub-agent Instructions** | ✅ Complete | All 16 agents support language parameter |
|
|
452
|
-
| **Code Generation** | ✅ Complete | Comments/docs in user language |
|
|
453
|
-
| **Git Integration** | ✅ Complete | Commit messages in user language |
|
|
454
|
-
| **Dynamic Content** | ✅ Complete | All reports/explanations in user language |
|
|
455
|
-
|
|
456
|
-
### Why This Matters
|
|
457
|
-
|
|
458
|
-
1. **Global Accessibility**: Support teams in any language without translating infrastructure
|
|
459
|
-
2. **Developer Experience**: Write code comments in your native language
|
|
460
|
-
3. **Maintainability**: Infrastructure stays in English (single source of truth)
|
|
461
|
-
4. **Scalability**: Add new languages instantly without code changes
|
|
462
|
-
|
|
463
|
-
### How to Change Language
|
|
464
|
-
|
|
465
|
-
**During Project Initialization**:
|
|
466
|
-
```bash
|
|
467
|
-
/alfred:0-project
|
|
468
|
-
# Select your language when prompted
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
**After Project Creation**:
|
|
472
|
-
Edit `.moai/config.json`:
|
|
473
|
-
```json
|
|
474
|
-
{
|
|
475
|
-
"language": {
|
|
476
|
-
"conversation_language": "ja",
|
|
477
|
-
"conversation_language_name": "Japanese"
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
Then restart Claude Code for changes to take effect.
|
|
483
|
-
|
|
484
|
-
---
|
|
485
|
-
|
|
486
|
-
## Earlier Detailed Guide (Optional Reading)
|
|
487
|
-
|
|
488
|
-
Need more explanations? See detailed guides below.
|
|
489
|
-
|
|
490
|
-
### Detailed Installation Guide
|
|
491
|
-
|
|
492
|
-
**After installing uv, verify PATH is set**:
|
|
493
|
-
```bash
|
|
494
|
-
# If uv command not found, set PATH manually (macOS/Linux)
|
|
495
|
-
export PATH="$HOME/.cargo/bin:$PATH"
|
|
496
|
-
|
|
497
|
-
# Verify again
|
|
498
|
-
uv --version
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
**Available moai-adk commands**:
|
|
502
|
-
```bash
|
|
503
|
-
moai-adk init # Initialize new project
|
|
504
|
-
moai-adk doctor # System diagnostics
|
|
505
|
-
moai-adk update # Update to latest version
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
### Detailed Project Creation
|
|
509
|
-
|
|
510
|
-
**Create a new project**:
|
|
511
|
-
```bash
|
|
512
|
-
moai-adk init my-project
|
|
513
|
-
cd my-project
|
|
514
|
-
```
|
|
515
|
-
|
|
516
|
-
**Add to existing project**:
|
|
517
|
-
```bash
|
|
518
|
-
cd your-existing-project
|
|
519
|
-
moai-adk init .
|
|
520
|
-
```
|
|
521
|
-
|
|
522
|
-
Complete directory structure created:
|
|
523
|
-
```
|
|
524
|
-
my-project/
|
|
525
|
-
├── .moai/ # MoAI-ADK project configuration
|
|
526
|
-
│ ├── config.json # Project settings (language, mode, owner)
|
|
527
|
-
│ ├── project/ # Project information
|
|
528
|
-
│ │ ├── product.md # Product vision and goals
|
|
529
|
-
│ │ ├── structure.md # Directory structure
|
|
530
|
-
│ │ └── tech.md # Tech stack and architecture
|
|
531
|
-
│ ├── memory/ # Alfred's knowledge base (8 files)
|
|
532
|
-
│ │ ├── CLAUDE-AGENTS-GUIDE.md # Sub-agent collaboration guide
|
|
533
|
-
│ │ ├── CLAUDE-RULES.md # Decision rules and standards
|
|
534
|
-
│ │ ├── CLAUDE-PRACTICES.md # Workflow patterns and examples
|
|
535
|
-
│ │ ├── CONFIG-SCHEMA.md # .moai/config.json schema
|
|
536
|
-
│ │ ├── DEVELOPMENT-GUIDE.md # SPEC-First TDD workflow guide
|
|
537
|
-
│ │ ├── GITFLOW-PROTECTION-POLICY.md # Git branch protection
|
|
538
|
-
│ │ ├── SKILLS-DESCRIPTION-POLICY.md # Skills management policy
|
|
539
|
-
│ │ └── SPEC-METADATA.md # SPEC YAML frontmatter standard
|
|
540
|
-
│ ├── specs/ # SPEC files
|
|
541
|
-
│ │ └── SPEC-XXX-001/ # Each SPEC in its own folder
|
|
542
|
-
│ │ └── spec.md # EARS-format specification
|
|
543
|
-
│ └── reports/ # Analysis reports
|
|
544
|
-
├── .claude/ # Claude Code automation
|
|
545
|
-
│ ├── agents/ # 12 Sub-agents
|
|
546
|
-
│ │ └── alfred/
|
|
547
|
-
│ │ ├── project-manager.md # Project initialization
|
|
548
|
-
│ │ ├── spec-builder.md # SPEC authoring (EARS)
|
|
549
|
-
│ │ ├── implementation-planner.md # Architecture & TAG design
|
|
550
|
-
│ │ ├── tdd-implementer.md # RED-GREEN-REFACTOR loop
|
|
551
|
-
│ │ ├── doc-syncer.md # Documentation sync
|
|
552
|
-
│ │ ├── quality-gate.md # TRUST 5 verification
|
|
553
|
-
│ │ ├── tag-agent.md # TAG chain validation
|
|
554
|
-
│ │ ├── trust-checker.md # Code quality checks
|
|
555
|
-
│ │ ├── debug-helper.md # Error analysis & fixes
|
|
556
|
-
│ │ ├── git-manager.md # GitFlow & PR management
|
|
557
|
-
│ │ ├── cc-manager.md # Claude Code optimization
|
|
558
|
-
│ │ └── skill-factory.md # Skills creation & updates
|
|
559
|
-
│ ├── commands/ # 4 Alfred commands
|
|
560
|
-
│ │ └── alfred/
|
|
561
|
-
│ │ ├── 0-project.md # Project initialization
|
|
562
|
-
│ │ ├── 1-plan.md # SPEC authoring
|
|
563
|
-
│ │ ├── 2-run.md # TDD implementation
|
|
564
|
-
│ │ └── 3-sync.md # Documentation sync
|
|
565
|
-
│ ├── skills/ # 55+ Claude Skills
|
|
566
|
-
│ │ ├── moai-foundation-* # 6 Foundation tier
|
|
567
|
-
│ │ ├── moai-essentials-* # 4 Essentials tier
|
|
568
|
-
│ │ ├── moai-alfred-* # 7 Alfred tier
|
|
569
|
-
│ │ ├── moai-domain-* # 10 Domain tier
|
|
570
|
-
│ │ ├── moai-lang-* # 18 Language tier
|
|
571
|
-
│ │ ├── moai-cc-* # 8 Claude Code tier
|
|
572
|
-
│ │ ├── moai-skill-factory # 1 Skill Factory
|
|
573
|
-
│ │ └── moai-spec-authoring # 1 SPEC authoring
|
|
574
|
-
│ ├── hooks/ # Event-driven automation
|
|
575
|
-
│ │ └── alfred/
|
|
576
|
-
│ │ └── alfred_hooks.py # 5 hooks (Session, PreTool, etc.)
|
|
577
|
-
│ └── settings.json # Claude Code settings
|
|
578
|
-
├── src/ # Implementation code
|
|
579
|
-
├── tests/ # Test code
|
|
580
|
-
├── docs/ # Auto-generated documentation
|
|
581
|
-
├── CLAUDE.md # Alfred's core directives
|
|
582
|
-
└── README.md
|
|
583
|
-
```
|
|
584
|
-
|
|
585
|
-
---
|
|
586
|
-
|
|
587
|
-
## Core Concept: 3-Step Repeating Cycle
|
|
588
|
-
|
|
589
|
-
After initial setup, every feature follows this cycle:
|
|
590
|
-
|
|
591
|
-
| Step | Command | What It Does | Output |
|
|
592
|
-
|------|---------|-------------|--------|
|
|
593
|
-
| 🚀 **INIT** | `/alfred:0-project` | Collect project description, create config/docs, recommend Skills | `.moai/config.json`, `.moai/project/*`, initial report |
|
|
594
|
-
| 📋 **PLAN** | `/alfred:1-plan "feature description"` | Analyze requirements, draft SPEC, create Plan Board | `.moai/specs/SPEC-*/spec.md`, plan/acceptance docs, feature branch |
|
|
595
|
-
| 💻 **RUN** | `/alfred:2-run SPEC-ID` | Execute TDD, run tests/implementation/refactor, verify quality | `tests/`, `src/` implementation, quality report, TAG links |
|
|
596
|
-
| 📚 **SYNC** | `/alfred:3-sync` | Auto-sync docs/README/CHANGELOG, organize TAG/PR status | `docs/`, `.moai/reports/sync-report.md`, Ready PR |
|
|
597
|
-
| 💬 **FEEDBACK** | `/alfred:9-feedback` | Interactive GitHub Issue creation (type → title → description → priority) | GitHub Issue + auto labels + priority + URL |
|
|
598
|
-
|
|
599
|
-
> ✅ All commands follow the **Phase 0(optional) → Phase 1 → Phase 2 → Phase 3** cycle. Alfred automatically reports status and suggests next steps.
|
|
600
|
-
>
|
|
601
|
-
> 💡 **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.
|
|
602
|
-
|
|
603
|
-
---
|
|
604
|
-
|
|
605
|
-
## Original Detailed Guide (Complete 7-Step Analysis)
|
|
606
|
-
|
|
607
|
-
For comprehensive explanation, see the previous version in [GitHub History](https://github.com/modu-ai/moai-adk/blob/main/README.md).
|
|
608
|
-
|
|
609
|
-
---
|
|
610
|
-
|
|
611
|
-
---
|
|
612
|
-
|
|
613
|
-
## 🚀 First 10-Minute Hands-On: Hello World API
|
|
614
|
-
|
|
615
|
-
**Goal**: Experience the complete MoAI-ADK workflow in 10 minutes
|
|
616
|
-
**Learn**: SPEC writing, TDD implementation, documentation automation, @TAG system
|
|
617
|
-
|
|
618
|
-
> Already completed the 3-minute quick start? Start here!
|
|
619
|
-
|
|
620
|
-
### Prerequisites
|
|
621
|
-
- ✅ MoAI-ADK installed
|
|
622
|
-
- ✅ Project created (`moai-adk init hello-world`)
|
|
623
|
-
- ✅ Claude Code running
|
|
624
|
-
|
|
625
|
-
---
|
|
626
|
-
|
|
627
|
-
### Step 1: Write SPEC (2 minutes)
|
|
628
|
-
|
|
629
|
-
#### Command
|
|
630
|
-
```bash
|
|
631
|
-
/alfred:1-plan "GET /hello endpoint - receive query parameter 'name' and return greeting"
|
|
632
|
-
```
|
|
633
|
-
|
|
634
|
-
#### Alfred Automatically Creates
|
|
635
|
-
```
|
|
636
|
-
✅ SPEC ID: HELLO-001
|
|
637
|
-
✅ File: .moai/specs/SPEC-HELLO-001/spec.md
|
|
638
|
-
✅ Branch: feature/SPEC-HELLO-001
|
|
639
|
-
```
|
|
640
|
-
|
|
641
|
-
#### Check Generated SPEC
|
|
642
|
-
```bash
|
|
643
|
-
cat .moai/specs/SPEC-HELLO-001/spec.md
|
|
644
|
-
```
|
|
645
|
-
|
|
646
|
-
**Example Content**:
|
|
647
|
-
```yaml
|
|
648
|
-
---
|
|
649
|
-
id: HELLO-001
|
|
650
|
-
version: 0.0.1
|
|
651
|
-
status: draft
|
|
652
|
-
priority: high
|
|
653
|
-
---
|
|
654
|
-
|
|
655
|
-
# `@SPEC:EX-HELLO-001: Hello World API
|
|
656
|
-
|
|
657
|
-
## Ubiquitous Requirements
|
|
658
|
-
- System SHALL provide HTTP GET /hello endpoint
|
|
659
|
-
|
|
660
|
-
## Event-driven Requirements
|
|
661
|
-
- WHEN query parameter 'name' is provided, THEN return "Hello, {name}!"
|
|
662
|
-
- WHEN name is absent, THEN return "Hello, World!"
|
|
663
|
-
|
|
664
|
-
## Constraints
|
|
665
|
-
- name limited to 50 characters max
|
|
666
|
-
- Response format: JSON
|
|
667
|
-
```
|
|
668
|
-
|
|
669
|
-
✅ **Verify**: `ls .moai/specs/SPEC-HELLO-001/`
|
|
670
|
-
|
|
671
|
-
---
|
|
672
|
-
|
|
673
|
-
### Step 2: TDD Implementation (5 minutes)
|
|
674
|
-
|
|
675
|
-
#### Command
|
|
676
|
-
```bash
|
|
677
|
-
/alfred:2-run HELLO-001
|
|
678
|
-
```
|
|
679
|
-
|
|
680
|
-
#### 🔴 RED Phase: Write Failing Test
|
|
681
|
-
|
|
682
|
-
**File Created**: `tests/test_hello.py`
|
|
683
|
-
|
|
684
|
-
```python
|
|
685
|
-
# `@TEST:EX-HELLO-001 | SPEC: SPEC-HELLO-001.md
|
|
686
|
-
|
|
687
|
-
import pytest
|
|
688
|
-
from fastapi.testclient import TestClient
|
|
689
|
-
from src.hello.api import app
|
|
690
|
-
|
|
691
|
-
client = TestClient(app)
|
|
692
|
-
|
|
693
|
-
def test_hello_with_name_should_return_personalized_greeting():
|
|
694
|
-
"""WHEN name provided, THEN return personalized greeting"""
|
|
695
|
-
response = client.get("/hello?name=Alice")
|
|
696
|
-
assert response.status_code == 200
|
|
697
|
-
assert response.json() == {"message": "Hello, Alice!"}
|
|
698
|
-
|
|
699
|
-
def test_hello_without_name_should_return_default_greeting():
|
|
700
|
-
"""WHEN name absent, THEN return default greeting"""
|
|
701
|
-
response = client.get("/hello")
|
|
702
|
-
assert response.status_code == 200
|
|
703
|
-
assert response.json() == {"message": "Hello, World!"}
|
|
704
|
-
```
|
|
705
|
-
|
|
706
|
-
**Run**:
|
|
707
|
-
```bash
|
|
708
|
-
pytest tests/test_hello.py -v
|
|
709
|
-
```
|
|
710
|
-
|
|
711
|
-
**Result**: ❌ FAILED (app doesn't exist yet - expected!)
|
|
712
|
-
|
|
713
|
-
**Commit**:
|
|
714
|
-
```bash
|
|
715
|
-
git add tests/test_hello.py
|
|
716
|
-
git commit -m "🔴 test(HELLO-001): add failing hello API tests"
|
|
717
|
-
```
|
|
718
|
-
|
|
719
|
-
---
|
|
720
|
-
|
|
721
|
-
#### 🟢 GREEN Phase: Minimal Implementation
|
|
722
|
-
|
|
723
|
-
**File Created**: `src/hello/api.py`
|
|
724
|
-
|
|
725
|
-
```python
|
|
726
|
-
# `@CODE:EX-HELLO-001:API | SPEC: SPEC-HELLO-001.md | TEST: tests/test_hello.py
|
|
727
|
-
|
|
728
|
-
from fastapi import FastAPI
|
|
729
|
-
|
|
730
|
-
app = FastAPI()
|
|
731
|
-
|
|
732
|
-
@app.get("/hello")
|
|
733
|
-
def hello(name: str = "World"):
|
|
734
|
-
"""@CODE:EX-HELLO-001:API - Hello endpoint"""
|
|
735
|
-
return {"message": f"Hello, {name}!"}
|
|
736
|
-
```
|
|
737
|
-
|
|
738
|
-
**Run**:
|
|
739
|
-
```bash
|
|
740
|
-
pytest tests/test_hello.py -v
|
|
741
|
-
```
|
|
742
|
-
|
|
743
|
-
**Result**: ✅ PASSED (all tests pass!)
|
|
744
|
-
|
|
745
|
-
**Commit**:
|
|
746
|
-
```bash
|
|
747
|
-
git add src/hello/api.py
|
|
748
|
-
git commit -m "🟢 feat(HELLO-001): implement hello API"
|
|
749
|
-
```
|
|
750
|
-
|
|
751
|
-
---
|
|
752
|
-
|
|
753
|
-
#### ♻️ REFACTOR Phase: Add Validation
|
|
754
|
-
|
|
755
|
-
**Enhanced Code**:
|
|
756
|
-
|
|
757
|
-
```python
|
|
758
|
-
from fastapi import FastAPI, HTTPException
|
|
759
|
-
|
|
760
|
-
app = FastAPI()
|
|
761
|
-
|
|
762
|
-
@app.get("/hello")
|
|
763
|
-
def hello(name: str = "World"):
|
|
764
|
-
"""@CODE:EX-HELLO-001:API - Hello endpoint with validation"""
|
|
765
|
-
if len(name) > 50:
|
|
766
|
-
raise HTTPException(status_code=400, detail="Name too long (max 50 chars)")
|
|
767
|
-
return {"message": f"Hello, {name}!"}
|
|
768
|
-
```
|
|
769
|
-
|
|
770
|
-
**Add Test**:
|
|
771
|
-
```python
|
|
772
|
-
def test_hello_with_long_name_should_return_400():
|
|
773
|
-
"""WHEN name exceeds 50 chars, THEN return 400 error"""
|
|
774
|
-
long_name = "a" * 51
|
|
775
|
-
response = client.get(f"/hello?name={long_name}")
|
|
776
|
-
assert response.status_code == 400
|
|
777
|
-
```
|
|
778
|
-
|
|
779
|
-
**Run**:
|
|
780
|
-
```bash
|
|
781
|
-
pytest tests/test_hello.py -v
|
|
782
|
-
```
|
|
783
|
-
|
|
784
|
-
**Result**: ✅ PASSED (all tests pass!)
|
|
785
|
-
|
|
786
|
-
**Commit**:
|
|
787
|
-
```bash
|
|
788
|
-
git add tests/test_hello.py src/hello/api.py
|
|
789
|
-
git commit -m "♻️ refactor(HELLO-001): add name length validation"
|
|
790
|
-
```
|
|
791
|
-
|
|
792
|
-
---
|
|
793
|
-
|
|
794
|
-
### Step 3: Documentation Sync (2 minutes)
|
|
795
|
-
|
|
796
|
-
#### Command
|
|
797
|
-
```bash
|
|
798
|
-
/alfred:3-sync
|
|
799
|
-
```
|
|
800
|
-
|
|
801
|
-
#### Alfred Automatically
|
|
802
|
-
```
|
|
803
|
-
✅ docs/api/hello.md - API documentation generated
|
|
804
|
-
✅ README.md - Usage examples added
|
|
805
|
-
✅ CHANGELOG.md - Release notes added
|
|
806
|
-
✅ TAG chain validated - All @TAG verified
|
|
807
|
-
```
|
|
808
|
-
|
|
809
|
-
#### Check Generated API Documentation
|
|
810
|
-
```bash
|
|
811
|
-
cat docs/api/hello.md
|
|
812
|
-
```
|
|
813
|
-
|
|
814
|
-
**Example Content**:
|
|
815
|
-
```markdown
|
|
816
|
-
# Hello API Documentation
|
|
817
|
-
|
|
818
|
-
## GET /hello
|
|
819
|
-
|
|
820
|
-
### Description
|
|
821
|
-
Returns a personalized greeting based on provided name.
|
|
822
|
-
|
|
823
|
-
### Parameters
|
|
824
|
-
- `name` (query, optional): Person's name (default: "World", max 50 chars)
|
|
825
|
-
|
|
826
|
-
### Responses
|
|
827
|
-
- **200**: Success
|
|
828
|
-
```json
|
|
829
|
-
{ "message": "Hello, Alice!" }
|
|
830
|
-
```
|
|
831
|
-
- **400**: Name too long
|
|
832
|
-
|
|
833
|
-
### Examples
|
|
834
|
-
```bash
|
|
835
|
-
curl "http://localhost:8000/hello?name=Alice"
|
|
836
|
-
# → {"message": "Hello, Alice!"}
|
|
837
|
-
|
|
838
|
-
curl "http://localhost:8000/hello"
|
|
839
|
-
# → {"message": "Hello, World!"}
|
|
840
|
-
```
|
|
841
|
-
|
|
842
|
-
### Traceability
|
|
843
|
-
- `@SPEC:EX-HELLO-001` - Requirements
|
|
844
|
-
- `@TEST:EX-HELLO-001` - Tests
|
|
845
|
-
- `@CODE:EX-HELLO-001:API` - Implementation
|
|
846
|
-
```
|
|
847
|
-
|
|
848
|
-
---
|
|
849
|
-
|
|
850
|
-
### Step 4: Verify TAG Chain (1 minute)
|
|
851
|
-
|
|
852
|
-
#### Command
|
|
853
|
-
```bash
|
|
854
|
-
rg '@(SPEC|TEST|CODE|DOC):HELLO-001' -n
|
|
855
|
-
```
|
|
856
|
-
|
|
857
|
-
#### Output (Complete Traceability)
|
|
858
|
-
```
|
|
859
|
-
.moai/specs/SPEC-HELLO-001/spec.md:7:# `@SPEC:EX-HELLO-001: Hello World API
|
|
860
|
-
tests/test_hello.py:3:# `@TEST:EX-HELLO-001 | SPEC: SPEC-HELLO-001.md
|
|
861
|
-
src/hello/api.py:3:# `@CODE:EX-HELLO-001:API | SPEC: SPEC-HELLO-001.md
|
|
862
|
-
docs/api/hello.md:24:- `@SPEC:EX-HELLO-001`
|
|
863
|
-
```
|
|
864
|
-
|
|
865
|
-
✅ **Complete chain**: SPEC → TEST → CODE → DOC (fully traceable!)
|
|
866
|
-
|
|
867
|
-
---
|
|
868
|
-
|
|
869
|
-
### Summary: What You've Accomplished
|
|
870
|
-
|
|
871
|
-
In just 10 minutes:
|
|
872
|
-
|
|
873
|
-
✅ **SPEC** - Clear requirements documented
|
|
874
|
-
✅ **TDD** - Red → Green → Refactor cycle
|
|
875
|
-
✅ **Implementation** - Simple, testable code with @CODE TAG
|
|
876
|
-
✅ **Documentation** - Auto-generated from code
|
|
877
|
-
✅ **Traceability** - Complete @TAG chain: SPEC → TEST → CODE → DOC
|
|
878
|
-
✅ **Git History** - Clean, semantic commits (🔴 🟢 ♻️)
|
|
879
|
-
|
|
880
|
-
---
|
|
881
|
-
|
|
882
|
-
## Understanding CLAUDE.md (Alfred's Configuration Documents)
|
|
883
|
-
|
|
884
|
-
MoAI-ADK's AI coordination is powered by **Alfred**, the MoAI SuperAgent. Alfred's behavior and decision-making are guided by a set of **internal configuration documents** in the `.claude/` directory.
|
|
885
|
-
|
|
886
|
-
### 4-Document Structure
|
|
887
|
-
|
|
888
|
-
When you run MoAI-ADK, Alfred loads configuration from **4 coordinated documents** (stored in your `.claude/` directory):
|
|
889
|
-
|
|
890
|
-
| Document | Size | Purpose | When Alfred Reads It |
|
|
891
|
-
| -------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
892
|
-
| **CLAUDE.md** | ~7kb | Alfred's identity, core directives, project metadata | At session start (bootstrap) |
|
|
893
|
-
| **CLAUDE-AGENTS-GUIDE.md** | ~14kb | Sub-agent roster (19 members), Skills distribution (55 packs), team structure | When selecting which agent to invoke |
|
|
894
|
-
| **CLAUDE-RULES.md** | ~17kb | Decision-making rules (Skill invocation, Interactive Questions, TAG validation), commit templates, TRUST 5 gates | During each decision point (e.g., when to ask user questions) |
|
|
895
|
-
| **CLAUDE-PRACTICES.md** | ~8kb | Practical workflows, context engineering (JIT retrieval), on-demand agent patterns, real examples | During implementation phase |
|
|
896
|
-
|
|
897
|
-
### Why This Structure Matters
|
|
898
|
-
|
|
899
|
-
**For Developers**: These documents define how Alfred interprets your requirements and orchestrates development. Understanding them helps you:
|
|
900
|
-
|
|
901
|
-
- Write clearer specifications that Alfred understands better
|
|
902
|
-
- Know which agent/Skill will be invoked for your request
|
|
903
|
-
- Understand decision points where Alfred might ask you questions
|
|
904
|
-
|
|
905
|
-
**For AI**: Progressive disclosure means:
|
|
906
|
-
|
|
907
|
-
- **Session Start**: Load only CLAUDE.md (7kb) — minimal overhead
|
|
908
|
-
- **On-Demand**: Load CLAUDE-AGENTS-GUIDE.md, CLAUDE-RULES.md, CLAUDE-PRACTICES.md only when needed
|
|
909
|
-
- **Result**: Faster session boot, cleaner context, clear decision logic
|
|
910
|
-
|
|
911
|
-
### Example: What Happens When You Run `/alfred:2-run`
|
|
912
|
-
|
|
913
|
-
1. **CLAUDE.md** is already loaded → Alfred knows its role and project context
|
|
914
|
-
2. Alfred checks **CLAUDE-RULES.md** → "Should I ask user questions? Which Skill applies here?"
|
|
915
|
-
3. If implementing code: Alfred loads **CLAUDE-AGENTS-GUIDE.md** → "Which agent executes TDD?"
|
|
916
|
-
4. During implementation: Alfred loads **CLAUDE-PRACTICES.md** → "How do I structure the RED → GREEN → REFACTOR workflow?"
|
|
917
|
-
|
|
918
|
-
### Customizing Alfred's Behavior
|
|
919
|
-
|
|
920
|
-
**Most developers never modify these files.** MoAI-ADK ships with optimized defaults.
|
|
921
|
-
|
|
922
|
-
**If you need to customize Alfred's behavior** (rare), edit these documents in your project's `.claude/` directory:
|
|
923
|
-
|
|
924
|
-
- Add new decision rules in **CLAUDE-RULES.md**
|
|
925
|
-
- Adjust agent selection logic in **CLAUDE-AGENTS-GUIDE.md**
|
|
926
|
-
- Document team-specific workflows in **CLAUDE-PRACTICES.md**
|
|
927
|
-
|
|
928
|
-
> ⚠️ **Important**: These are internal configuration files for Alfred, not user guides. Keep them concise and decision-focused. Most teams don't modify them.
|
|
929
|
-
|
|
930
|
-
### Language Policy in CLAUDE.md (v0.7.0+)
|
|
931
|
-
|
|
932
|
-
**Key Language Rules**:
|
|
933
|
-
|
|
934
|
-
1. **User Conversation**: Your configured language (Korean, Japanese, Spanish, etc.)
|
|
935
|
-
- All responses, explanations, and guidance use your `conversation_language`
|
|
936
|
-
- Alfred reads this from `.moai/config.json`
|
|
937
|
-
|
|
938
|
-
2. **Code & Git History**: Your configured language
|
|
939
|
-
- Code comments: Your language
|
|
940
|
-
- Commit messages: Your language
|
|
941
|
-
- Documentation: Your language
|
|
942
|
-
|
|
943
|
-
3. **Infrastructure Only**: English
|
|
944
|
-
- `.claude/agents/`, `.claude/commands/`, `.claude/skills/` stay in English
|
|
945
|
-
- `@TAG` identifiers and technical terms use English
|
|
946
|
-
- `.moai/memory/` files remain in English
|
|
947
|
-
|
|
948
|
-
**Example**:
|
|
949
|
-
```
|
|
950
|
-
Your CLAUDE.md talks to you in Korean (한국어)
|
|
951
|
-
Your code comments are in Korean (한국어)
|
|
952
|
-
Your git commits are in Korean (한국어)
|
|
953
|
-
Your SPEC documents are in Korean (한국어)
|
|
954
|
-
|
|
955
|
-
But Alfred's internal commands use English:
|
|
956
|
-
✅ Skill("moai-foundation-trust")
|
|
957
|
-
✅ @CODE:EX-AUTH-001 (TAG format)
|
|
958
|
-
✅ .claude/skills/ (infrastructure)
|
|
959
|
-
```
|
|
960
|
-
|
|
961
|
-
**See Also**: [Language Localization Architecture](#language-localization-architecture-v070) for complete details on the hybrid language model.
|
|
962
|
-
|
|
963
|
-
---
|
|
964
|
-
|
|
965
|
-
## Alfred's Memory Files (.moai/memory/)
|
|
966
|
-
|
|
967
|
-
Alfred's knowledge base consists of **14 memory files** stored in `.moai/memory/`. These files define standards, rules, and guidelines that Alfred and Sub-agents reference during development.
|
|
968
|
-
|
|
969
|
-
### Core Knowledge Base (14 Files)
|
|
970
|
-
|
|
971
|
-
**Core Guides (3 files)**:
|
|
972
|
-
|
|
973
|
-
| File | Size | Purpose | Who Uses It |
|
|
974
|
-
| ------------------------ | ----- | ---------------------------------------- | ---------------------- |
|
|
975
|
-
| `CLAUDE-AGENTS-GUIDE.md` | ~15KB | Sub-agent selection & collaboration | Alfred, Developers |
|
|
976
|
-
| `CLAUDE-PRACTICES.md` | ~12KB | Real-world workflow examples & patterns | Alfred, All Sub-agents |
|
|
977
|
-
| `CLAUDE-RULES.md` | ~19KB | Skill/TAG/Git rules & decision standards | Alfred, All Sub-agents |
|
|
978
|
-
|
|
979
|
-
**Standards (4 files)**:
|
|
980
|
-
|
|
981
|
-
| File | Size | Purpose | Who Uses It |
|
|
982
|
-
| ------------------------------ | ----- | ------------------------------------- | -------------------------- |
|
|
983
|
-
| `CONFIG-SCHEMA.md` | ~12KB | `.moai/config.json` schema definition | project-manager |
|
|
984
|
-
| `DEVELOPMENT-GUIDE.md` | ~14KB | SPEC-First TDD workflow guide | All Sub-agents, Developers |
|
|
985
|
-
| `GITFLOW-PROTECTION-POLICY.md` | ~6KB | Git branch protection policy | git-manager |
|
|
986
|
-
| `SPEC-METADATA.md` | ~9KB | SPEC YAML frontmatter standard (SSOT) | spec-builder, doc-syncer |
|
|
987
|
-
|
|
988
|
-
**Implementation Analysis (7 files)**: Internal reports and policy documents for Skills management, workflow improvements, and team integration analysis.
|
|
989
|
-
|
|
990
|
-
### When Are Memory Files Loaded?
|
|
991
|
-
|
|
992
|
-
**Session Start (Always)**:
|
|
993
|
-
|
|
994
|
-
- `CLAUDE.md`
|
|
995
|
-
- `CLAUDE-AGENTS-GUIDE.md`
|
|
996
|
-
- `CLAUDE-RULES.md`
|
|
997
|
-
|
|
998
|
-
**Just-In-Time (Command Execution)**:
|
|
999
|
-
|
|
1000
|
-
- `/alfred:1-plan` → `SPEC-METADATA.md`, `DEVELOPMENT-GUIDE.md`
|
|
1001
|
-
- `/alfred:2-run` → `DEVELOPMENT-GUIDE.md`
|
|
1002
|
-
- `/alfred:3-sync` → `DEVELOPMENT-GUIDE.md`
|
|
1003
|
-
|
|
1004
|
-
**Conditional (On-Demand)**:
|
|
1005
|
-
|
|
1006
|
-
- Config changes → `CONFIG-SCHEMA.md`
|
|
1007
|
-
- Git operations → `GITFLOW-PROTECTION-POLICY.md`
|
|
1008
|
-
- Skill creation → `SKILLS-DESCRIPTION-POLICY.md`
|
|
1009
|
-
|
|
1010
|
-
### Why Memory Files Matter
|
|
1011
|
-
|
|
1012
|
-
1. **Single Source of Truth (SSOT)**: Each standard is defined exactly once, eliminating conflicts
|
|
1013
|
-
2. **Context Efficiency**: JIT loading reduces initial session overhead (only 3 files at start)
|
|
1014
|
-
3. **Consistent Decisions**: All Sub-agents follow the same rules from `CLAUDE-RULES.md`
|
|
1015
|
-
4. **Traceability**: SPEC metadata, @TAG rules, and Git standards all documented
|
|
1016
|
-
|
|
1017
|
-
### Usage Frequency
|
|
1018
|
-
|
|
1019
|
-
| Priority | Files | Usage Pattern |
|
|
1020
|
-
| --------- | -------------------------------------------------- | ------------------- |
|
|
1021
|
-
| Very High | `CLAUDE-RULES.md` | Every decision |
|
|
1022
|
-
| High | `DEVELOPMENT-GUIDE.md`, `SPEC-METADATA.md` | All commands |
|
|
1023
|
-
| Medium | `CLAUDE-AGENTS-GUIDE.md`, `CLAUDE-PRACTICES.md` | Agent coordination |
|
|
1024
|
-
| Low | `CONFIG-SCHEMA.md`, `GITFLOW-PROTECTION-POLICY.md` | Specific operations |
|
|
1025
|
-
|
|
1026
|
-
> 📚 **Complete Analysis**: See `.moai/memory/MEMORY-FILES-USAGE.md` for comprehensive documentation on who uses each file, when they're loaded, where they're referenced, and why they're needed.
|
|
1027
|
-
|
|
1028
|
-
---
|
|
1029
|
-
|
|
1030
|
-
## Keeping MoAI-ADK Up-to-Date
|
|
1031
|
-
|
|
1032
|
-
### Check Version
|
|
1033
|
-
|
|
1034
|
-
```bash
|
|
1035
|
-
# Check currently installed version
|
|
1036
|
-
moai-adk --version
|
|
1037
|
-
|
|
1038
|
-
# Check latest version on PyPI
|
|
1039
|
-
uv tool list # Check current version of moai-adk
|
|
1040
|
-
```
|
|
1041
|
-
|
|
1042
|
-
### Upgrading
|
|
1043
|
-
|
|
1044
|
-
#### Method 1: MoAI-ADK Built-in Update Command (Recommended - 3-Stage Workflow, v0.6.3+)
|
|
1045
|
-
<!-- @DOC:UPDATE-REFACTOR-002-003 -->
|
|
1046
|
-
|
|
1047
|
-
MoAI-ADK's `update` command provides **automatic tool detection** and **intelligent 3-stage workflow** with **70-80% performance improvement** for templates already synchronized:
|
|
1048
|
-
|
|
1049
|
-
**Basic 3-Stage Workflow** (automatic tool detection):
|
|
1050
|
-
```bash
|
|
1051
|
-
# Stage 1: Package version check
|
|
1052
|
-
# Shows version comparison, upgrades if needed
|
|
1053
|
-
moai-adk update
|
|
1054
|
-
|
|
1055
|
-
# Stage 2: Config version comparison (NEW in v0.6.3)
|
|
1056
|
-
# Compares package template version with project config
|
|
1057
|
-
# If already synchronized, exits early (70-80% faster!)
|
|
1058
|
-
|
|
1059
|
-
# Stage 3: Template sync (only if needed)
|
|
1060
|
-
# Creates backup → Syncs templates → Updates config
|
|
1061
|
-
# Message: "✓ Templates synced!" or "Templates are up to date!"
|
|
1062
|
-
```
|
|
1063
|
-
|
|
1064
|
-
**Check for updates without applying them**:
|
|
1065
|
-
```bash
|
|
1066
|
-
# Preview available updates (shows package & config versions)
|
|
1067
|
-
moai-adk update --check
|
|
1068
|
-
```
|
|
1069
|
-
|
|
1070
|
-
**Templates-only mode** (skip package upgrade, useful for manual upgrades):
|
|
1071
|
-
```bash
|
|
1072
|
-
# If you manually upgraded the package, sync templates only
|
|
1073
|
-
# Still performs Stage 2 config comparison for accuracy
|
|
1074
|
-
moai-adk update --templates-only
|
|
1075
|
-
```
|
|
1076
|
-
|
|
1077
|
-
**CI/CD mode** (auto-confirm all prompts):
|
|
1078
|
-
```bash
|
|
1079
|
-
# Auto-confirms all prompts - useful in automated pipelines
|
|
1080
|
-
# Runs all 3 stages automatically
|
|
1081
|
-
moai-adk update --yes
|
|
1082
|
-
```
|
|
1083
|
-
|
|
1084
|
-
**Force mode** (skip backup creation):
|
|
1085
|
-
```bash
|
|
1086
|
-
# Update without creating backup (use with caution)
|
|
1087
|
-
# Still performs config version comparison
|
|
1088
|
-
moai-adk update --force
|
|
1089
|
-
```
|
|
1090
|
-
|
|
1091
|
-
**How the 3-Stage Workflow Works** (v0.6.3):
|
|
1092
|
-
|
|
1093
|
-
| Stage | Condition | Action | Performance |
|
|
1094
|
-
|-------|-----------|--------|-------------|
|
|
1095
|
-
| **Stage 1** | Package: current < latest | Detects installer → Upgrades package | ~20-30s |
|
|
1096
|
-
| **Stage 2** | Config: compare versions | Reads template_version from config.json | ~1s ⚡ **NEW!** |
|
|
1097
|
-
| **Stage 3** | Config: package > project | Creates backup → Syncs templates (if needed) | ~10-15s |
|
|
1098
|
-
|
|
1099
|
-
**Performance Improvement** (v0.6.3):
|
|
1100
|
-
- **Same version case**: 12-18s → 3-4s (**70-80% faster!** ⚡)
|
|
1101
|
-
- Stage 1: ~1s (version check)
|
|
1102
|
-
- Stage 2: ~1s (config comparison)
|
|
1103
|
-
- Stage 3: **skipped** (already synchronized)
|
|
1104
|
-
|
|
1105
|
-
- **CI/CD repeated runs**: **-30% cost reduction**
|
|
1106
|
-
- First run: Full sync
|
|
1107
|
-
- Subsequent runs: Only version checks (~3-4s)
|
|
1108
|
-
|
|
1109
|
-
**Why 3 stages?**
|
|
1110
|
-
Python processes cannot upgrade themselves while running. The 3-stage workflow is necessary for safety AND performance:
|
|
1111
|
-
1. **Stage 1**: Package upgrade detection (compares with PyPI)
|
|
1112
|
-
2. **Stage 2**: Template sync necessity detection (compares config versions) - NEW v0.6.3
|
|
1113
|
-
3. **Stage 3**: Templates and configuration sync (only if necessary)
|
|
1114
|
-
|
|
1115
|
-
**Key Improvement in v0.6.3**:
|
|
1116
|
-
Previously, all updates would sync templates even if nothing changed. Now, config version comparison (Stage 2) detects when templates are already current, **skipping Stage 3 entirely** (saves 10-15 seconds!)
|
|
1117
|
-
|
|
1118
|
-
**Config Version Tracking**:
|
|
1119
|
-
```json
|
|
1120
|
-
{
|
|
1121
|
-
"project": {
|
|
1122
|
-
"template_version": "0.6.3" // Tracks last synchronized template version
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
```
|
|
1126
|
-
This field allows MoAI-ADK to accurately determine if templates need synchronization without re-syncing everything.
|
|
1127
|
-
|
|
1128
|
-
#### Method 2: Upgrade with uv tool command
|
|
1129
|
-
|
|
1130
|
-
**Upgrade specific tool (recommended)**
|
|
1131
|
-
|
|
1132
|
-
```bash
|
|
1133
|
-
# Upgrade only moai-adk to latest version
|
|
1134
|
-
uv tool upgrade moai-adk
|
|
1135
|
-
```
|
|
1136
|
-
|
|
1137
|
-
**Upgrade all installed tools**
|
|
1138
|
-
|
|
1139
|
-
```bash
|
|
1140
|
-
# Upgrade all uv tool installations to latest versions
|
|
1141
|
-
uv tool update
|
|
1142
|
-
```
|
|
1143
|
-
|
|
1144
|
-
**Install specific version**
|
|
1145
|
-
|
|
1146
|
-
```bash
|
|
1147
|
-
# Reinstall specific version (e.g., 0.4.2)
|
|
1148
|
-
uv tool install moai-adk
|
|
1149
|
-
```
|
|
1150
|
-
|
|
1151
|
-
### Verify After Update
|
|
1152
|
-
|
|
1153
|
-
```bash
|
|
1154
|
-
# 1. Check installed version
|
|
1155
|
-
moai-adk --version
|
|
1156
|
-
|
|
1157
|
-
# 2. Verify project works correctly
|
|
1158
|
-
moai-adk doctor
|
|
1159
|
-
|
|
1160
|
-
# 3. Check updated features in Alfred
|
|
1161
|
-
cd your-project
|
|
1162
|
-
claude
|
|
1163
|
-
/alfred:0-project # Verify new features like language selection
|
|
1164
|
-
```
|
|
1165
|
-
|
|
1166
|
-
> 💡 **New 2-Stage Update Workflow**:
|
|
1167
|
-
>
|
|
1168
|
-
> - **Stage 1**: `moai-adk update` detects installer (uv tool, pipx, or pip) and upgrades package
|
|
1169
|
-
> - **Stage 2**: `moai-adk update` again to sync templates, config, and agent/Skills
|
|
1170
|
-
> - **Smart detection**: Auto-detects whether package upgrade is needed based on version comparison
|
|
1171
|
-
> - **CI/CD ready**: Use `moai-adk update --yes` for fully automated updates in pipelines
|
|
1172
|
-
> - **Manual upgrade path**: Use `moai-adk update --templates-only` after manually upgrading the package
|
|
1173
|
-
> - **Rollback safe**: Automatic backups in `.moai-backups/` before template sync
|
|
1174
|
-
|
|
1175
|
-
### Optimize Project Templates with `/alfred:0-project update` (v0.9.0+)
|
|
1176
|
-
|
|
1177
|
-
After upgrading MoAI-ADK with `moai-adk update`, your project templates and configurations may need optimization to stay in sync with the latest package version. Use the **dedicated Alfred command** to automatically merge template updates while preserving your customizations.
|
|
1178
|
-
|
|
1179
|
-
#### When to Run `/alfred:0-project update`
|
|
1180
|
-
|
|
1181
|
-
**Automatic Trigger**: After running `moai-adk update`, your project's `optimized` flag is set based on template changes:
|
|
1182
|
-
|
|
1183
|
-
```bash
|
|
1184
|
-
# 1. Upgrade MoAI-ADK package
|
|
1185
|
-
moai-adk update
|
|
1186
|
-
# Output: ✓ Package upgraded to v0.9.0!
|
|
1187
|
-
# ℹ️ Next: Run `/alfred:0-project update` in Claude Code to optimize templates
|
|
1188
|
-
|
|
1189
|
-
# 2. Open Claude Code
|
|
1190
|
-
claude
|
|
1191
|
-
|
|
1192
|
-
# 3. Run optimization command
|
|
1193
|
-
/alfred:0-project update
|
|
1194
|
-
```
|
|
1195
|
-
|
|
1196
|
-
#### What `/alfred:0-project update` Does
|
|
1197
|
-
|
|
1198
|
-
**Phase 1: Smart Backup & Analysis**
|
|
1199
|
-
- ✅ Creates automatic backup in `.moai-backups/` (preserves all customizations)
|
|
1200
|
-
- ✅ Compares backup version with new template version
|
|
1201
|
-
- ✅ Generates comparison report showing changed sections
|
|
1202
|
-
- ✅ Presents user-friendly analysis with merge recommendations
|
|
1203
|
-
|
|
1204
|
-
**Phase 2: Smart Merge (User Approval)**
|
|
1205
|
-
After reviewing the analysis, you can choose:
|
|
1206
|
-
- **"Proceed"** → Execute smart merge (merge backup + latest template)
|
|
1207
|
-
- **"Preview"** → View detailed change summary before proceeding
|
|
1208
|
-
- **"Skip"** → Keep current files unchanged (safe to proceed later)
|
|
1209
|
-
|
|
1210
|
-
**Phase 3: Preserve Customizations**
|
|
1211
|
-
- ✅ Maintains latest template structure (sections, headers, @TAG format)
|
|
1212
|
-
- ✅ Inserts only your customizations (actual content you wrote)
|
|
1213
|
-
- ✅ Preserves HISTORY sections cumulatively
|
|
1214
|
-
- ✅ Updates version numbers automatically
|
|
1215
|
-
|
|
1216
|
-
#### Complete Example
|
|
1217
|
-
|
|
1218
|
-
```bash
|
|
1219
|
-
# Terminal: Upgrade MoAI-ADK
|
|
1220
|
-
$ moai-adk update
|
|
1221
|
-
✓ Package upgraded to v0.9.0!
|
|
1222
|
-
|
|
1223
|
-
# Claude Code
|
|
1224
|
-
/alfred:0-project update
|
|
1225
|
-
|
|
1226
|
-
# Alfred displays:
|
|
1227
|
-
# 📊 Project Update Analysis
|
|
1228
|
-
#
|
|
1229
|
-
# Current: CLAUDE.md v0.8.1 (248 lines, template + your customizations)
|
|
1230
|
-
# Latest: Template v0.9.0 (787 lines, expanded guidelines)
|
|
1231
|
-
#
|
|
1232
|
-
# Changes Detected:
|
|
1233
|
-
# ✅ Alfred Persona System (new)
|
|
1234
|
-
# ✅ Language Boundary Rules (enhanced)
|
|
1235
|
-
# ✅ Report Style Standards (new)
|
|
1236
|
-
# ✅ Your Customizations: Preserved (한국어, GOOS🪿엉아, etc.)
|
|
1237
|
-
|
|
1238
|
-
# User selects: 🔄 Smart Merge Proceed
|
|
1239
|
-
|
|
1240
|
-
# Result:
|
|
1241
|
-
# ✅ Merge Complete!
|
|
1242
|
-
# - CLAUDE.md updated (v0.8.1 → v0.9.0)
|
|
1243
|
-
# - User customizations preserved
|
|
1244
|
-
# - config.json updated with optimization metadata
|
|
1245
|
-
# - Backup saved to .moai-backups/20251102-221000/
|
|
1246
|
-
```
|
|
1247
|
-
|
|
1248
|
-
#### Key Features
|
|
1249
|
-
|
|
1250
|
-
1. **Automatic Backup**: Always creates backup before merge (safe rollback available)
|
|
1251
|
-
2. **Smart Detection**: Identifies template defaults vs. your customizations
|
|
1252
|
-
3. **Preservation Policy**: Never overwrites your custom content
|
|
1253
|
-
4. **Version Tracking**: Automatically updates template_version in config.json
|
|
1254
|
-
5. **HISTORY Section**: Cumulative merge history preserved
|
|
1255
|
-
|
|
1256
|
-
#### Command Reference
|
|
1257
|
-
|
|
1258
|
-
| Operation | Command |
|
|
1259
|
-
|-----------|---------|
|
|
1260
|
-
| **Optimize** | `/alfred:0-project update` |
|
|
1261
|
-
| **Review First** | Select "Preview" option when prompted |
|
|
1262
|
-
| **Keep Current** | Select "Skip" option (safe—run later anytime) |
|
|
1263
|
-
| **Check Status** | `cat .moai/config.json \| grep -A2 optimization` |
|
|
1264
|
-
|
|
1265
|
-
#### Rollback If Needed
|
|
1266
|
-
|
|
1267
|
-
If something goes wrong, restore from automatic backup:
|
|
1268
|
-
|
|
1269
|
-
```bash
|
|
1270
|
-
# List available backups
|
|
1271
|
-
ls -lt .moai-backups/
|
|
1272
|
-
|
|
1273
|
-
# Restore from backup (example)
|
|
1274
|
-
cp -r .moai-backups/20251102-221000/CLAUDE.md ./CLAUDE.md
|
|
1275
|
-
cp -r .moai-backups/20251102-221000/.moai/config.json ./.moai/config.json
|
|
1276
|
-
```
|
|
1277
|
-
|
|
1278
|
-
#### Why This Matters
|
|
1279
|
-
|
|
1280
|
-
- **Stay Current**: Get latest Alfred improvements, fixes, and features
|
|
1281
|
-
- **Keep Your Work**: All customizations preserved through merges
|
|
1282
|
-
- **No Manual Editing**: Smart merge handles complex version synchronization
|
|
1283
|
-
- **Trust the Process**: Automatic backups ensure safe rollback anytime
|
|
1284
|
-
|
|
1285
|
-
---
|
|
1286
|
-
|
|
1287
|
-
## Development Setup for Contributors
|
|
1288
|
-
|
|
1289
|
-
If you're developing **MoAI-ADK itself**, follow these steps to set up your development environment.
|
|
1290
|
-
|
|
1291
|
-
### Prerequisites
|
|
1292
|
-
|
|
1293
|
-
- Python 3.13+
|
|
1294
|
-
- `uv` package manager
|
|
1295
|
-
- Git
|
|
1296
|
-
|
|
1297
|
-
### Setup Steps
|
|
1298
|
-
|
|
1299
|
-
#### Step 1: Clone and Install in Editable Mode
|
|
1300
|
-
|
|
1301
|
-
```bash
|
|
1302
|
-
# Clone the repository
|
|
1303
|
-
git clone https://github.com/modu-ai/moai-adk.git
|
|
1304
|
-
cd moai-adk
|
|
1305
|
-
|
|
1306
|
-
# Install in editable mode (creates symlink, not a copy)
|
|
1307
|
-
uv pip install -e .
|
|
1308
|
-
|
|
1309
|
-
# Or with pip (also works)
|
|
1310
|
-
pip install -e .
|
|
1311
|
-
```
|
|
1312
|
-
|
|
1313
|
-
The editable install allows your local changes to be immediately reflected when using `moai-adk` command.
|
|
1314
|
-
|
|
1315
|
-
#### Step 2: Initialize Development Configuration
|
|
1316
|
-
|
|
1317
|
-
After the editable install, initialize the development repository's configuration:
|
|
1318
|
-
|
|
1319
|
-
```bash
|
|
1320
|
-
# Run the initialization script
|
|
1321
|
-
bash .moai/scripts/init-dev-config.sh
|
|
1322
|
-
```
|
|
1323
|
-
|
|
1324
|
-
**What this script does:**
|
|
1325
|
-
- Extracts the actual version from `pyproject.toml`
|
|
1326
|
-
- Replaces template placeholders (`{{MOAI_VERSION}}`) with actual version values in `.moai/config.json`
|
|
1327
|
-
- Sets up `project.template_version` field
|
|
1328
|
-
- Ensures the `moai-adk update` command works correctly on first run
|
|
1329
|
-
|
|
1330
|
-
**Why is this necessary?**
|
|
1331
|
-
|
|
1332
|
-
When you install MoAI-ADK in editable mode, the `.moai/config.json` file contains unsubstituted template placeholders. This causes the first `moai-adk update` command to fail with version comparison errors. The init script resolves these placeholders so everything works seamlessly.
|
|
1333
|
-
|
|
1334
|
-
#### Step 3: Verify Setup
|
|
1335
|
-
|
|
1336
|
-
```bash
|
|
1337
|
-
# Check that moai-adk works
|
|
1338
|
-
moai-adk --version
|
|
1339
|
-
|
|
1340
|
-
# Run the health check
|
|
1341
|
-
moai-adk doctor
|
|
1342
|
-
|
|
1343
|
-
# Expected output:
|
|
1344
|
-
# ✅ Python version: 3.13+
|
|
1345
|
-
# ✅ UV installed
|
|
1346
|
-
# ✅ Project structure: Valid
|
|
1347
|
-
# ✅ Configuration: Ready
|
|
1348
|
-
```
|
|
1349
|
-
|
|
1350
|
-
#### Step 4: Run Tests
|
|
1351
|
-
|
|
1352
|
-
```bash
|
|
1353
|
-
# Run all tests with coverage
|
|
1354
|
-
pytest tests/
|
|
1355
|
-
|
|
1356
|
-
# Run specific test module
|
|
1357
|
-
pytest tests/unit/test_update.py -v
|
|
1358
|
-
|
|
1359
|
-
# Run with coverage report
|
|
1360
|
-
pytest tests/ --cov=src/moai_adk --cov-report=html
|
|
1361
|
-
|
|
1362
|
-
# Check coverage thresholds
|
|
1363
|
-
pytest tests/ --cov=src/moai_adk --cov-report=term-missing
|
|
1364
|
-
```
|
|
1365
|
-
|
|
1366
|
-
### Common Development Workflow
|
|
1367
|
-
|
|
1368
|
-
#### After Making Code Changes
|
|
1369
|
-
|
|
1370
|
-
```bash
|
|
1371
|
-
# 1. Run tests to ensure nothing broke
|
|
1372
|
-
pytest tests/ -v
|
|
1373
|
-
|
|
1374
|
-
# 2. Check code style
|
|
1375
|
-
ruff check src/
|
|
1376
|
-
ruff format src/
|
|
1377
|
-
|
|
1378
|
-
# 3. Type checking
|
|
1379
|
-
mypy src/
|
|
1380
|
-
|
|
1381
|
-
# 4. If you modified update.py, test the update command
|
|
1382
|
-
moai-adk update --check
|
|
1383
|
-
```
|
|
1384
|
-
|
|
1385
|
-
#### Testing the Update Command
|
|
1386
|
-
|
|
1387
|
-
The update command has been fixed to handle invalid version strings gracefully. To test it in development:
|
|
1388
|
-
|
|
1389
|
-
```bash
|
|
1390
|
-
# Test update without applying it
|
|
1391
|
-
moai-adk update --check
|
|
1392
|
-
|
|
1393
|
-
# Test with force mode (skips backup)
|
|
1394
|
-
moai-adk update --force
|
|
1395
|
-
|
|
1396
|
-
# Test with specific version
|
|
1397
|
-
moai-adk update --templates-only
|
|
1398
|
-
```
|
|
1399
|
-
|
|
1400
|
-
### Understanding the Init Script
|
|
1401
|
-
|
|
1402
|
-
The `.moai/scripts/init-dev-config.sh` script performs these operations:
|
|
1403
|
-
|
|
1404
|
-
1. **Extracts Version**: Reads `pyproject.toml` to get the current version
|
|
1405
|
-
2. **Updates Config**: Modifies `.moai/config.json` to set:
|
|
1406
|
-
- `moai.version` → actual version value
|
|
1407
|
-
- `project.template_version` → actual version value
|
|
1408
|
-
3. **Validates**: Ensures the JSON structure is preserved correctly
|
|
1409
|
-
4. **Provides Feedback**: Shows what was updated and verifies the changes
|
|
1410
|
-
|
|
1411
|
-
### Troubleshooting Development Setup
|
|
1412
|
-
|
|
1413
|
-
#### Problem: `moai-adk` command not found
|
|
1414
|
-
|
|
1415
|
-
```bash
|
|
1416
|
-
# Solution 1: Reinstall in editable mode
|
|
1417
|
-
uv pip install -e .
|
|
1418
|
-
|
|
1419
|
-
# Solution 2: Verify uv environment
|
|
1420
|
-
uv pip list | grep moai-adk
|
|
1421
|
-
|
|
1422
|
-
# Solution 3: Use full path
|
|
1423
|
-
python -m moai_adk --version
|
|
1424
|
-
```
|
|
1425
|
-
|
|
1426
|
-
#### Problem: `.moai/config.json` still has placeholders after running init script
|
|
1427
|
-
|
|
1428
|
-
```bash
|
|
1429
|
-
# Manually check the config
|
|
1430
|
-
cat .moai/config.json | grep -i moai_version
|
|
1431
|
-
|
|
1432
|
-
# If still showing {{MOAI_VERSION}}, rerun the script:
|
|
1433
|
-
bash .moai/scripts/init-dev-config.sh
|
|
1434
|
-
|
|
1435
|
-
# Or manually update using Python:
|
|
1436
|
-
python3 << 'EOF'
|
|
1437
|
-
import json
|
|
1438
|
-
from pathlib import Path
|
|
1439
|
-
|
|
1440
|
-
config_path = Path(".moai/config.json")
|
|
1441
|
-
config = json.loads(config_path.read_text())
|
|
1442
|
-
|
|
1443
|
-
# Update manually
|
|
1444
|
-
config['moai']['version'] = "0.8.1"
|
|
1445
|
-
config['project']['template_version'] = "0.8.1"
|
|
1446
|
-
|
|
1447
|
-
config_path.write_text(json.dumps(config, indent=2) + '\n')
|
|
1448
|
-
print("✅ Config updated manually")
|
|
1449
|
-
EOF
|
|
1450
|
-
```
|
|
1451
|
-
|
|
1452
|
-
#### Problem: `moai-adk update` requires running twice
|
|
1453
|
-
|
|
1454
|
-
This issue has been **fixed** in v0.8.1+. If you're experiencing this:
|
|
1455
|
-
|
|
1456
|
-
1. Ensure you've run the init script: `bash .moai/scripts/init-dev-config.sh`
|
|
1457
|
-
2. Update to the latest version: `pip install -e --upgrade .`
|
|
1458
|
-
3. Verify the config has actual versions: `cat .moai/config.json | grep version`
|
|
1459
|
-
|
|
1460
|
-
**What was the issue?**
|
|
1461
|
-
- Development installations had unsubstituted `{{MOAI_VERSION}}` placeholders in config
|
|
1462
|
-
- First `moai-adk update` would fail comparing "0.8.1" vs "{{MOAI_VERSION}}"
|
|
1463
|
-
- Second run might partially work after partial sync
|
|
1464
|
-
|
|
1465
|
-
**How it's fixed:**
|
|
1466
|
-
- `init-dev-config.sh` replaces placeholders with actual versions
|
|
1467
|
-
- Code now gracefully handles InvalidVersion exceptions
|
|
1468
|
-
- Added comprehensive unit tests for placeholder detection
|
|
1469
|
-
|
|
1470
|
-
#### Problem: UV Tool Upgrade Shows "Nothing to upgrade" Despite New Version
|
|
1471
|
-
|
|
1472
|
-
**Status**: Automatically fixed in v0.9.1+ with cache refresh retry
|
|
1473
|
-
|
|
1474
|
-
**Symptoms:**
|
|
1475
|
-
- `moai-adk update` shows "Nothing to upgrade"
|
|
1476
|
-
- PyPI has a newer version available
|
|
1477
|
-
- Caused by stale UV cache metadata
|
|
1478
|
-
|
|
1479
|
-
**Automatic Fix (v0.9.1+):**
|
|
1480
|
-
The system now automatically detects stale cache and retries:
|
|
1481
|
-
1. Detects "Nothing to upgrade" message
|
|
1482
|
-
2. Compares installed version vs PyPI latest version
|
|
1483
|
-
3. Clears UV cache: `uv cache clean moai-adk`
|
|
1484
|
-
4. Automatically retries upgrade
|
|
1485
|
-
5. Completes in a single command run
|
|
1486
|
-
|
|
1487
|
-
**Manual Workaround (if needed):**
|
|
1488
|
-
```bash
|
|
1489
|
-
# Clear UV cache and retry
|
|
1490
|
-
uv cache clean moai-adk && moai-adk update
|
|
1491
|
-
```
|
|
1492
|
-
|
|
1493
|
-
**Technical Details:**
|
|
1494
|
-
- Root cause: UV caches PyPI metadata that can become outdated
|
|
1495
|
-
- Detection: Compares version strings when "Nothing to upgrade" appears
|
|
1496
|
-
- Retry limit: Maximum 1 retry to prevent infinite loops
|
|
1497
|
-
- Timeout: 10 seconds for cache clear operation
|
|
1498
|
-
|
|
1499
|
-
**References:**
|
|
1500
|
-
- SPEC: @SPEC:EX-UPDATE-001
|
|
1501
|
-
- Implementation: @CODE:EX-UPDATE-001-001, @CODE:EX-UPDATE-001-002, @CODE:EX-UPDATE-001-003
|
|
1502
|
-
- Tests: @TEST:EX-UPDATE-001
|
|
1503
|
-
|
|
1504
|
-
### Contributing Tests
|
|
1505
|
-
|
|
1506
|
-
When adding new features, always include tests:
|
|
1507
|
-
|
|
1508
|
-
```bash
|
|
1509
|
-
# Add tests to tests/unit/ or tests/integration/
|
|
1510
|
-
# Follow existing test patterns in test_update.py
|
|
1511
|
-
|
|
1512
|
-
# Run your new tests
|
|
1513
|
-
pytest tests/unit/test_*.py -v
|
|
1514
|
-
|
|
1515
|
-
# Ensure coverage remains ≥ 85%
|
|
1516
|
-
pytest tests/ --cov=src/moai_adk --cov-report=term-missing
|
|
1517
|
-
```
|
|
1518
|
-
|
|
1519
|
-
### Making a Pull Request
|
|
1520
|
-
|
|
1521
|
-
Before opening a PR, ensure:
|
|
1522
|
-
|
|
1523
|
-
```bash
|
|
1524
|
-
# 1. All tests pass
|
|
1525
|
-
pytest tests/ -v
|
|
1526
|
-
|
|
1527
|
-
# 2. Coverage is adequate
|
|
1528
|
-
pytest tests/ --cov=src/moai_adk --cov-report=term-missing
|
|
1529
|
-
|
|
1530
|
-
# 3. Code is formatted
|
|
1531
|
-
ruff format src/
|
|
1532
|
-
ruff check src/
|
|
1533
|
-
|
|
1534
|
-
# 4. Types are valid
|
|
1535
|
-
mypy src/
|
|
1536
|
-
|
|
1537
|
-
# 5. Init script works
|
|
1538
|
-
bash .moai/scripts/init-dev-config.sh
|
|
1539
|
-
|
|
1540
|
-
# 6. Update command works
|
|
1541
|
-
moai-adk update --check
|
|
1542
|
-
```
|
|
1543
|
-
|
|
1544
|
-
---
|
|
1545
|
-
|
|
1546
|
-
## Core Workflow (0 → 3)
|
|
1547
|
-
|
|
1548
|
-
Alfred iteratively develops projects with four commands.
|
|
1549
|
-
|
|
1550
|
-
```mermaid
|
|
1551
|
-
%%{init: {'theme':'neutral'}}%%
|
|
1552
|
-
graph TD
|
|
1553
|
-
Start([User Request]) --> Init[0. Init<br/>/alfred:0-project]
|
|
1554
|
-
Init --> Plan[1. Plan & SPEC<br/>/alfred:1-plan]
|
|
1555
|
-
Plan --> Run[2. Run & TDD<br/>/alfred:2-run]
|
|
1556
|
-
Run --> Sync[3. Sync & Docs<br/>/alfred:3-sync]
|
|
1557
|
-
Sync --> Plan
|
|
1558
|
-
Sync -.-> End([Release])
|
|
1559
|
-
```
|
|
1560
|
-
|
|
1561
|
-
### 0. INIT — Project Preparation
|
|
1562
|
-
|
|
1563
|
-
- Questions about project introduction, target, language, mode (locale)
|
|
1564
|
-
- Auto-generates `.moai/config.json`, `.moai/project/*` 5 documents
|
|
1565
|
-
- Language detection and recommended Skill Pack deployment (Foundation + Essentials + Domain/Language)
|
|
1566
|
-
- Template cleanup, initial Git/backup checks
|
|
1567
|
-
|
|
1568
|
-
### 1. PLAN — Agree on What to Build
|
|
1569
|
-
|
|
1570
|
-
- Write SPEC with EARS template (includes `@SPEC:ID`)
|
|
1571
|
-
- Organize Plan Board, implementation ideas, risk factors
|
|
1572
|
-
- Auto-create branch/initial Draft PR in Team mode
|
|
1573
|
-
|
|
1574
|
-
### 2. RUN — Test-Driven Development (TDD)
|
|
1575
|
-
|
|
1576
|
-
- Phase 1 `implementation-planner`: Design libraries, folders, TAG layout
|
|
1577
|
-
- Phase 2 `tdd-implementer`: RED (failing test) → GREEN (minimal implementation) → REFACTOR (cleanup)
|
|
1578
|
-
- quality-gate verifies TRUST 5 principles, coverage changes
|
|
1579
|
-
|
|
1580
|
-
### 3. SYNC — Documentation & PR Organization
|
|
1581
|
-
|
|
1582
|
-
- Sync Living Document, README, CHANGELOG, etc.
|
|
1583
|
-
- Validate TAG chain and recover orphan TAGs
|
|
1584
|
-
- Generate Sync Report, transition Draft → Ready for Review, support `--auto-merge` option
|
|
1585
|
-
|
|
1586
|
-
---
|
|
1587
|
-
|
|
1588
|
-
## Command Cheat Sheet
|
|
1589
|
-
|
|
1590
|
-
| Command | What it does | Key Outputs |
|
|
1591
|
-
| ------------------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------ |
|
|
1592
|
-
| `/alfred:0-project` | Collect project description, create config/docs, recommend Skills | `.moai/config.json`, `.moai/project/*`, initial report |
|
|
1593
|
-
| `/alfred:1-plan <description>` | Analyze requirements, draft SPEC, write Plan Board | `.moai/specs/SPEC-*/spec.md`, plan/acceptance docs, feature branch |
|
|
1594
|
-
| `/alfred:2-run <SPEC-ID>` | Execute TDD, test/implement/refactor, verify quality | `tests/`, `src/` implementation, quality report, TAG connection |
|
|
1595
|
-
| `/alfred:3-sync` | Sync docs/README/CHANGELOG, organize TAG/PR status | `docs/`, `.moai/reports/sync-report.md`, Ready PR |
|
|
1596
|
-
| `/alfred:9-feedback` | Interactively create GitHub Issues (type → title → description → priority) | GitHub Issue with auto labels, priority, URL |
|
|
1597
|
-
|
|
1598
|
-
> ❗ All commands maintain **Phase 0 (optional) → Phase 1 → Phase 2 → Phase 3** cycle structure. Alfred automatically reports execution status and next-step suggestions.
|
|
1599
|
-
>
|
|
1600
|
-
> 💡 **New in v0.7.0+**: `/alfred:9-feedback` enables instant GitHub Issue creation during development, keeping your workflow uninterrupted while keeping issues tracked and visible to the team.
|
|
1601
|
-
|
|
1602
|
-
---
|
|
1603
|
-
|
|
1604
|
-
## SPEC GitHub Issue Automation
|
|
1605
|
-
|
|
1606
|
-
MoAI-ADK now provides **automatic GitHub Issue synchronization** from SPEC documents, seamlessly integrating requirements with issue tracking in team mode.
|
|
1607
|
-
|
|
1608
|
-
### How It Works
|
|
1609
|
-
|
|
1610
|
-
When you create a SPEC document using `/alfred:1-plan` and push it to a feature branch:
|
|
1611
|
-
|
|
1612
|
-
1. **GitHub Actions Workflow** automatically triggers on PR events
|
|
1613
|
-
2. **SPEC Metadata** (ID, version, status, priority) is extracted from YAML frontmatter
|
|
1614
|
-
3. **GitHub Issue** is created with full SPEC content and metadata table
|
|
1615
|
-
4. **PR Comment** is added with a link to the created issue
|
|
1616
|
-
5. **Labels** are automatically applied based on priority (critical, high, medium, low)
|
|
1617
|
-
|
|
1618
|
-
### What Gets Synchronized
|
|
1619
|
-
|
|
1620
|
-
**From SPEC to GitHub Issue:**
|
|
1621
|
-
- **SPEC ID**: Unique identifier (e.g., AUTH-001, USER-001)
|
|
1622
|
-
- **Version**: Semantic versioning (v0.1.0, v1.0.0)
|
|
1623
|
-
- **Status**: draft, in-review, in-progress, completed, stable
|
|
1624
|
-
- **Priority**: critical, high, medium, low (becomes GitHub label)
|
|
1625
|
-
- **Full Content**: EARS requirements, acceptance criteria, dependencies
|
|
1626
|
-
|
|
1627
|
-
**GitHub Issue Format:**
|
|
1628
|
-
```markdown
|
|
1629
|
-
# [SPEC-AUTH-001] User Authentication (v1.0.0)
|
|
1630
|
-
|
|
1631
|
-
## SPEC Metadata
|
|
1632
|
-
|
|
1633
|
-
| Field | Value |
|
|
1634
|
-
|-------|-------|
|
|
1635
|
-
| **ID** | AUTH-001 |
|
|
1636
|
-
| **Version** | v1.0.0 |
|
|
1637
|
-
| **Status** | in-progress |
|
|
1638
|
-
| **Priority** | high |
|
|
1639
|
-
|
|
1640
|
-
## SPEC Document
|
|
1641
|
-
|
|
1642
|
-
[Full SPEC content from .moai/specs/SPEC-AUTH-001/spec.md]
|
|
1643
|
-
|
|
1644
|
-
---
|
|
1645
|
-
|
|
1646
|
-
📎 **Branch**: `feature/AUTH-001`
|
|
1647
|
-
🔗 **PR**: #123
|
|
1648
|
-
📝 **Auto-synced**: This issue is automatically synchronized from the SPEC document
|
|
1649
|
-
```
|
|
1650
|
-
|
|
1651
|
-
### Features
|
|
1652
|
-
|
|
1653
|
-
✅ **Automatic Issue Creation**: GitHub Issue created on every PR with SPEC file changes
|
|
1654
|
-
✅ **Metadata Extraction**: ID, version, status, priority automatically parsed from YAML frontmatter
|
|
1655
|
-
✅ **PR Integration**: Issue linked to PR via automatic comment
|
|
1656
|
-
✅ **Label Management**: Priority-based labels (critical, high, medium, low) auto-applied
|
|
1657
|
-
✅ **CodeRabbit Review** (local only): AI-powered SPEC quality validation in local development
|
|
1658
|
-
|
|
1659
|
-
### Setup Requirements
|
|
1660
|
-
|
|
1661
|
-
**GitHub Actions Workflow**: `.github/workflows/spec-issue-sync.yml`
|
|
1662
|
-
**GitHub Issue Template**: `.github/ISSUE_TEMPLATE/spec.yml`
|
|
1663
|
-
**GitHub Labels**: `spec`, `planning`, `critical`, `high`, `medium`, `low`
|
|
1664
|
-
|
|
1665
|
-
All templates are automatically installed with MoAI-ADK and synced during `moai-adk init`.
|
|
1666
|
-
|
|
1667
|
-
### CodeRabbit Integration (Local Only)
|
|
1668
|
-
|
|
1669
|
-
When working in your **local development environment**, CodeRabbit provides automatic SPEC quality review:
|
|
1670
|
-
|
|
1671
|
-
**What CodeRabbit Reviews:**
|
|
1672
|
-
- ✅ All 7 required metadata fields (id, version, status, created, updated, author, priority)
|
|
1673
|
-
- ✅ HISTORY section formatting and chronological order
|
|
1674
|
-
- ✅ EARS requirements structure (Ubiquitous, Event-driven, State-driven, Constraints, Optional)
|
|
1675
|
-
- ✅ Acceptance criteria in Given-When-Then format
|
|
1676
|
-
- ✅ @TAG system compliance for traceability
|
|
1677
|
-
|
|
1678
|
-
**CodeRabbit Configuration**: `.coderabbit.yaml` (local only, not distributed in packages)
|
|
1679
|
-
|
|
1680
|
-
> **Note**: CodeRabbit integration is available only in local development environments. Package users receive core GitHub Issue automation without CodeRabbit review.
|
|
1681
|
-
|
|
1682
|
-
### Workflow Example
|
|
1683
|
-
|
|
1684
|
-
```bash
|
|
1685
|
-
# 1. Create SPEC
|
|
1686
|
-
/alfred:1-plan "User authentication feature"
|
|
1687
|
-
|
|
1688
|
-
# 2. SPEC file created at .moai/specs/SPEC-AUTH-001/spec.md
|
|
1689
|
-
# 3. Feature branch created: feature/SPEC-AUTH-001
|
|
1690
|
-
# 4. Draft PR created (team mode)
|
|
1691
|
-
|
|
1692
|
-
# 5. GitHub Actions automatically:
|
|
1693
|
-
# - Parses SPEC metadata
|
|
1694
|
-
# - Creates GitHub Issue #45
|
|
1695
|
-
# - Adds PR comment: "✅ SPEC GitHub Issue Created - Issue: #45"
|
|
1696
|
-
# - Applies labels: spec, planning, high
|
|
1697
|
-
|
|
1698
|
-
# 6. CodeRabbit reviews SPEC (local only):
|
|
1699
|
-
# - Validates metadata
|
|
1700
|
-
# - Checks EARS requirements
|
|
1701
|
-
# - Provides quality score
|
|
1702
|
-
|
|
1703
|
-
# 7. Continue with TDD implementation
|
|
1704
|
-
/alfred:2-run AUTH-001
|
|
1705
|
-
```
|
|
1706
|
-
|
|
1707
|
-
### Benefits
|
|
1708
|
-
|
|
1709
|
-
1. **Centralized Tracking**: All SPEC requirements tracked as GitHub Issues
|
|
1710
|
-
2. **Team Visibility**: Non-technical stakeholders can follow progress via Issues
|
|
1711
|
-
3. **Automated Workflow**: No manual issue creation—fully automated from SPEC to Issue
|
|
1712
|
-
4. **Traceability**: Direct link between SPEC files, Issues, PRs, and implementation
|
|
1713
|
-
5. **Quality Assurance**: CodeRabbit validates SPEC quality before implementation (local only)
|
|
1714
|
-
|
|
1715
|
-
---
|
|
1716
|
-
|
|
1717
|
-
## 🚀 Quick Issue Creation with `/alfred:9-feedback`
|
|
1718
|
-
|
|
1719
|
-
Encountered a bug or want to suggest a feature while using MoAI-ADK? Create GitHub Issues instantly with a single command directly from Claude Code without interrupting your workflow.
|
|
1720
|
-
|
|
1721
|
-
### Overview
|
|
1722
|
-
|
|
1723
|
-
```bash
|
|
1724
|
-
/alfred:9-feedback
|
|
1725
|
-
```
|
|
1726
|
-
|
|
1727
|
-
When you run this command, Alfred guides you through an interactive dialog to automatically create an issue:
|
|
1728
|
-
- 🐛 **Bug Report** - Document problems you encounter
|
|
1729
|
-
- ✨ **Feature Request** - Suggest new capabilities
|
|
1730
|
-
- ⚡ **Improvement** - Propose enhancements to existing features
|
|
1731
|
-
- ❓ **Question/Discussion** - Ask questions for team discussion
|
|
1732
|
-
|
|
1733
|
-
### Quick Example
|
|
1734
|
-
|
|
1735
|
-
```bash
|
|
1736
|
-
# Run in Claude Code
|
|
1737
|
-
/alfred:9-feedback
|
|
1738
|
-
```
|
|
1739
|
-
|
|
1740
|
-
### Interactive Step-by-Step Flow
|
|
1741
|
-
|
|
1742
|
-
**1️⃣ Select Issue Type**
|
|
1743
|
-
|
|
1744
|
-
```
|
|
1745
|
-
What type of issue do you want to create?
|
|
1746
|
-
|
|
1747
|
-
[ ] 🐛 Bug Report - Something isn't working
|
|
1748
|
-
[ ] ✨ Feature Request - Suggest new functionality
|
|
1749
|
-
[ ] ⚡ Improvement - Enhance existing features
|
|
1750
|
-
[ ] ❓ Question/Discussion - Ask the team
|
|
1751
|
-
```
|
|
1752
|
-
|
|
1753
|
-
**2️⃣ Enter Issue Title**
|
|
1754
|
-
|
|
1755
|
-
```
|
|
1756
|
-
What's the issue title? (be concise)
|
|
1757
|
-
Example: moai-adk update fails with template sync error
|
|
1758
|
-
```
|
|
1759
|
-
|
|
1760
|
-
**3️⃣ Enter Detailed Description (Optional)**
|
|
1761
|
-
|
|
1762
|
-
```
|
|
1763
|
-
Provide a detailed description (optional—press Enter to skip):
|
|
1764
|
-
|
|
1765
|
-
Example:
|
|
1766
|
-
When running moai-adk update:
|
|
1767
|
-
- Symptom: .claude/ directory permission error
|
|
1768
|
-
- Environment: macOS 14.2, Python 3.13, moai-adk v0.15.0
|
|
1769
|
-
- Expected: Templates should synchronize successfully
|
|
1770
|
-
- Actual: Permission denied error and termination
|
|
1771
|
-
```
|
|
1772
|
-
|
|
1773
|
-
**4️⃣ Select Priority Level**
|
|
1774
|
-
|
|
1775
|
-
```
|
|
1776
|
-
What's the priority level?
|
|
1777
|
-
|
|
1778
|
-
[ ] 🔴 Critical - System down, data loss, security breach
|
|
1779
|
-
[ ] 🟠 High - Major feature broken, significant impact
|
|
1780
|
-
[✓] 🟡 Medium - Normal priority (default)
|
|
1781
|
-
[ ] 🟢 Low - Minor issues, nice-to-have
|
|
1782
|
-
```
|
|
1783
|
-
|
|
1784
|
-
### Automatic Issue Creation
|
|
1785
|
-
|
|
1786
|
-
Alfred automatically:
|
|
1787
|
-
1. Adds emoji to title: `🐛 [BUG] moai-adk update fails with template sync error`
|
|
1788
|
-
2. Formats the issue in GitHub format
|
|
1789
|
-
3. Auto-applies appropriate labels: `bug`, `reported`, `priority-high`
|
|
1790
|
-
4. Creates the issue in your repository
|
|
1791
|
-
|
|
1792
|
-
### Completion Output
|
|
1793
|
-
|
|
1794
|
-
```
|
|
1795
|
-
✅ GitHub Issue #245 created successfully!
|
|
1796
|
-
|
|
1797
|
-
📋 Title: 🐛 [BUG] moai-adk update fails with template sync error
|
|
1798
|
-
🔴 Priority: High
|
|
1799
|
-
🏷️ Labels: bug, reported, priority-high
|
|
1800
|
-
🔗 URL: https://github.com/modu-ai/moai-adk/issues/245
|
|
1801
|
-
|
|
1802
|
-
💡 Tip: Reference this issue number in your commit messages
|
|
1803
|
-
```
|
|
1804
|
-
|
|
1805
|
-
### Key Features
|
|
1806
|
-
|
|
1807
|
-
| Feature | Description |
|
|
1808
|
-
|---------|-------------|
|
|
1809
|
-
| **Simple Command** | Just `/alfred:9-feedback`—no arguments needed |
|
|
1810
|
-
| **Interactive** | Step-by-step dialog for intuitive issue creation |
|
|
1811
|
-
| **Auto-labeled** | Issue type and priority automatically assigned as labels |
|
|
1812
|
-
| **Instant Creation** | Issue created in GitHub within ~30 seconds |
|
|
1813
|
-
| **Team Shared** | Issue immediately visible and trackable for your team |
|
|
1814
|
-
|
|
1815
|
-
### Use Cases
|
|
1816
|
-
|
|
1817
|
-
**📌 Bug Report Example**
|
|
1818
|
-
|
|
1819
|
-
```
|
|
1820
|
-
/alfred:9-feedback
|
|
1821
|
-
→ Select 🐛 Bug Report
|
|
1822
|
-
→ Title: "moai-adk update fails with template sync error"
|
|
1823
|
-
→ Describe the symptom and environment
|
|
1824
|
-
→ Select 🟠 High priority
|
|
1825
|
-
→ Issue #246 automatically created
|
|
1826
|
-
```
|
|
1827
|
-
|
|
1828
|
-
**💡 Feature Request Example**
|
|
1829
|
-
|
|
1830
|
-
```
|
|
1831
|
-
/alfred:9-feedback
|
|
1832
|
-
→ Select ✨ Feature Request
|
|
1833
|
-
→ Title: "Add --dry-run option to moai-adk update"
|
|
1834
|
-
→ Describe the desired behavior
|
|
1835
|
-
→ Select 🟡 Medium priority
|
|
1836
|
-
→ Issue #247 automatically created
|
|
1837
|
-
```
|
|
1838
|
-
|
|
1839
|
-
### Best Practices
|
|
1840
|
-
|
|
1841
|
-
- ✅ Be clear and concise in your title
|
|
1842
|
-
- ✅ Include environment details for bug reports (OS, Python version, moai-adk version)
|
|
1843
|
-
- ✅ Description is optional—skip if title is self-explanatory
|
|
1844
|
-
- ❌ Avoid including personal information or sensitive data
|
|
1845
|
-
- ❌ Check existing issues to prevent duplicates before creating new ones
|
|
1846
|
-
|
|
1847
|
-
---
|
|
1848
|
-
|
|
1849
|
-
---
|
|
1850
|
-
|
|
1851
|
-
## 5 Key Concepts
|
|
1852
|
-
|
|
1853
|
-
MoAI-ADK consists of 5 key concepts. Each concept connects to the others, and together they create a powerful development system.
|
|
1854
|
-
|
|
1855
|
-
### Key Concept 1: SPEC-First (Requirements First)
|
|
1856
|
-
|
|
1857
|
-
**Metaphor**: Like building a house without an architect, you shouldn't code without a blueprint.
|
|
1858
|
-
|
|
1859
|
-
**Core Idea**: Before implementation, **clearly define "what to build"**. This isn't just documentation—it's an **executable spec** that both teams and AI can understand.
|
|
1860
|
-
|
|
1861
|
-
**EARS Syntax 5 Patterns**:
|
|
1862
|
-
|
|
1863
|
-
1. **Ubiquitous** (basic function): "The system SHALL provide JWT-based authentication"
|
|
1864
|
-
2. **Event-driven** (conditional): "WHEN valid credentials are provided, the system SHALL issue a token"
|
|
1865
|
-
3. **State-driven** (during state): "WHILE the user is authenticated, the system SHALL allow access to protected resources"
|
|
1866
|
-
4. **Optional** (optional): "WHERE a refresh token exists, the system MAY issue a new token"
|
|
1867
|
-
5. **Constraints** (constraints): "Token expiration time SHALL NOT exceed 15 minutes"
|
|
1868
|
-
|
|
1869
|
-
**How?** The `/alfred:1-plan` command automatically creates professional SPECs in EARS format.
|
|
1870
|
-
|
|
1871
|
-
**What You Get**:
|
|
1872
|
-
|
|
1873
|
-
- ✅ Clear requirements everyone on the team understands
|
|
1874
|
-
- ✅ SPEC-based test cases (what to test is already defined)
|
|
1875
|
-
- ✅ When requirements change, track all affected code with `@SPEC:ID` TAG
|
|
1876
|
-
|
|
1877
|
-
---
|
|
1878
|
-
|
|
1879
|
-
### Key Concept 2: TDD (Test-Driven Development)
|
|
1880
|
-
|
|
1881
|
-
**Metaphor**: Like finding the route after setting a destination, you set goals with tests, then write code.
|
|
1882
|
-
|
|
1883
|
-
**Core Idea**: Write tests **before** implementation. Like checking ingredients before cooking, this clarifies requirements before implementation.
|
|
1884
|
-
|
|
1885
|
-
**3-Step Cycle**:
|
|
1886
|
-
|
|
1887
|
-
1. **🔴 RED**: Write a failing test first
|
|
1888
|
-
|
|
1889
|
-
- Each SPEC requirement becomes a test case
|
|
1890
|
-
- Must fail because implementation doesn't exist yet
|
|
1891
|
-
- Git commit: `test(AUTH-001): add failing test`
|
|
1892
|
-
|
|
1893
|
-
2. **🟢 GREEN**: Minimal implementation to pass the test
|
|
1894
|
-
|
|
1895
|
-
- Make it pass using the simplest approach
|
|
1896
|
-
- Passing comes before perfection
|
|
1897
|
-
- Git commit: `feat(AUTH-001): implement minimal solution`
|
|
1898
|
-
|
|
1899
|
-
3. **♻️ REFACTOR**: Clean up and improve code
|
|
1900
|
-
- Apply TRUST 5 principles
|
|
1901
|
-
- Remove duplication, improve readability
|
|
1902
|
-
- Tests must still pass
|
|
1903
|
-
- Git commit: `refactor(AUTH-001): improve code quality`
|
|
1904
|
-
|
|
1905
|
-
**How?** The `/alfred:2-run` command automatically executes these 3 steps.
|
|
1906
|
-
|
|
1907
|
-
**What You Get**:
|
|
1908
|
-
|
|
1909
|
-
- ✅ Guaranteed 85%+ coverage (no code without tests)
|
|
1910
|
-
- ✅ Refactoring confidence (always verifiable with tests)
|
|
1911
|
-
- ✅ Clear Git history (trace RED → GREEN → REFACTOR process)
|
|
1912
|
-
|
|
1913
|
-
---
|
|
1914
|
-
|
|
1915
|
-
### Key Concept 3: @TAG System
|
|
1916
|
-
|
|
1917
|
-
**Metaphor**: Like package tracking numbers, you should be able to trace code's journey.
|
|
1918
|
-
|
|
1919
|
-
**Core Idea**: Add `@TAG:ID` to all SPECs, tests, code, and documentation to create **one-to-one correspondence**.
|
|
1920
|
-
|
|
1921
|
-
**TAG Chain**:
|
|
1922
|
-
|
|
1923
|
-
```
|
|
1924
|
-
@SPEC:EX-AUTH-001 (requirements)
|
|
1925
|
-
↓
|
|
1926
|
-
@TEST:EX-AUTH-001 (test)
|
|
1927
|
-
↓
|
|
1928
|
-
@CODE:EX-AUTH-001 (implementation)
|
|
1929
|
-
↓
|
|
1930
|
-
@DOC:EX-AUTH-001 (documentation)
|
|
1931
|
-
```
|
|
1932
|
-
|
|
1933
|
-
**TAG ID Rules**: `<Domain>-<3 digits>`
|
|
1934
|
-
|
|
1935
|
-
- AUTH-001, AUTH-002, AUTH-003...
|
|
1936
|
-
- USER-001, USER-002...
|
|
1937
|
-
- Once assigned, **never change**
|
|
1938
|
-
|
|
1939
|
-
**How to Use?** When requirements change:
|
|
1940
|
-
|
|
1941
|
-
```bash
|
|
1942
|
-
# Find everything related to AUTH-001
|
|
1943
|
-
rg '@TAG:AUTH-001' -n
|
|
1944
|
-
|
|
1945
|
-
# Result: Shows all SPEC, TEST, CODE, DOC at once
|
|
1946
|
-
# → Clear what needs modification
|
|
1947
|
-
```
|
|
1948
|
-
|
|
1949
|
-
**How?** The `/alfred:3-sync` command validates TAG chains and detects orphan TAGs (TAGs without correspondence).
|
|
1950
|
-
|
|
1951
|
-
**What You Get**:
|
|
1952
|
-
|
|
1953
|
-
- ✅ Clear intent for all code (reading SPEC explains why this code exists)
|
|
1954
|
-
- ✅ Instantly identify all affected code during refactoring
|
|
1955
|
-
- ✅ Code remains understandable 3 months later (trace TAG → SPEC)
|
|
1956
|
-
|
|
1957
|
-
---
|
|
1958
|
-
|
|
1959
|
-
### Key Concept 4: TRUST 5 Principles
|
|
1960
|
-
|
|
1961
|
-
**Metaphor**: Like a healthy body, good code must satisfy all 5 elements.
|
|
1962
|
-
|
|
1963
|
-
**Core Idea**: All code must follow these 5 principles. `/alfred:3-sync` automatically verifies them.
|
|
1964
|
-
|
|
1965
|
-
1. **🧪 Test First** (tests come first)
|
|
1966
|
-
|
|
1967
|
-
- Test coverage ≥ 85%
|
|
1968
|
-
- All code protected by tests
|
|
1969
|
-
- Adding feature = adding test
|
|
1970
|
-
|
|
1971
|
-
2. **📖 Readable** (easy-to-read code)
|
|
1972
|
-
|
|
1973
|
-
- Functions ≤ 50 lines, files ≤ 300 lines
|
|
1974
|
-
- Variable names reveal intent
|
|
1975
|
-
- Pass linters (ESLint/ruff/clippy)
|
|
1976
|
-
|
|
1977
|
-
3. **🎯 Unified** (consistent structure)
|
|
1978
|
-
|
|
1979
|
-
- Maintain SPEC-based architecture
|
|
1980
|
-
- Same patterns repeat (reduces learning curve)
|
|
1981
|
-
- Type safety or runtime validation
|
|
1982
|
-
|
|
1983
|
-
4. **🔒 Secured** (security)
|
|
1984
|
-
|
|
1985
|
-
- Input validation (defend against XSS, SQL Injection)
|
|
1986
|
-
- Password hashing (bcrypt, Argon2)
|
|
1987
|
-
- Protect sensitive information (environment variables)
|
|
1988
|
-
|
|
1989
|
-
5. **🔗 Trackable** (traceability)
|
|
1990
|
-
- Use @TAG system
|
|
1991
|
-
- Include TAG in Git commits
|
|
1992
|
-
- Document all decisions
|
|
1993
|
-
|
|
1994
|
-
**How?** The `/alfred:3-sync` command automatically performs TRUST verification.
|
|
1995
|
-
|
|
1996
|
-
**What You Get**:
|
|
1997
|
-
|
|
1998
|
-
- ✅ Production-quality code guaranteed
|
|
1999
|
-
- ✅ Entire team develops with same standards
|
|
2000
|
-
- ✅ Fewer bugs, prevent security vulnerabilities in advance
|
|
2001
|
-
|
|
2002
|
-
---
|
|
2003
|
-
|
|
2004
|
-
### Key Concept 5: Alfred SuperAgent
|
|
2005
|
-
|
|
2006
|
-
**Metaphor**: Like a personal assistant, Alfred handles all the complex work.
|
|
2007
|
-
|
|
2008
|
-
**Core Idea**: **19 AI agents** collaborate to automate the entire development process:
|
|
2009
|
-
|
|
2010
|
-
**Agent Composition**:
|
|
2011
|
-
|
|
2012
|
-
- **Alfred SuperAgent**: Overall orchestration (1)
|
|
2013
|
-
- **Core Sub-agents**: Specialized tasks like SPEC writing, TDD implementation, documentation sync (10)
|
|
2014
|
-
- **Zero-project Specialists**: Project initialization, language detection, etc. (6)
|
|
2015
|
-
- **Built-in Agents**: General questions, codebase exploration (2)
|
|
2016
|
-
|
|
2017
|
-
**55 Claude Skills**:
|
|
2018
|
-
|
|
2019
|
-
- **Foundation** (6): TRUST/TAG/SPEC/Git/EARS principles
|
|
2020
|
-
- **Essentials** (4): Debugging, performance, refactoring, code review
|
|
2021
|
-
- **Alfred** (7): Workflow automation
|
|
2022
|
-
- **Domain** (10): Backend, frontend, security, etc.
|
|
2023
|
-
- **Language** (18): Python, JavaScript, Go, Rust, Java, Kotlin, Swift, Dart, C/C#, Ruby, PHP, SQL, Shell, and more
|
|
2024
|
-
- **Ops** (1): Claude Code session management
|
|
2025
|
-
- **Other** (2): Skill factory, Spec authoring
|
|
2026
|
-
|
|
2027
|
-
**How?** `/alfred:*` commands automatically activate the right expert team.
|
|
2028
|
-
|
|
2029
|
-
**What You Get**:
|
|
2030
|
-
|
|
2031
|
-
- ✅ No prompt writing needed (use standardized commands)
|
|
2032
|
-
- ✅ Automatically remember project context (no repeating same questions)
|
|
2033
|
-
- ✅ Auto-assemble optimal expert team (activate appropriate Sub-agents)
|
|
2034
|
-
|
|
2035
|
-
> **Want to learn more?** Check detailed rules in `.moai/memory/development-guide.md`.
|
|
2036
|
-
|
|
2037
|
-
---
|
|
2038
|
-
|
|
2039
|
-
## First Hands-on: Todo API Example
|
|
2040
|
-
|
|
2041
|
-
Let's now **experience MoAI-ADK's complete workflow** firsthand. We'll build a simple "Todo Management API" and see how SPEC, TDD, and documentation connect.
|
|
2042
|
-
|
|
2043
|
-
### Step 1: PLAN - Write SPEC (about 3 minutes)
|
|
2044
|
-
|
|
2045
|
-
```bash
|
|
2046
|
-
/alfred:1-plan "Todo add, view, update, delete API"
|
|
2047
|
-
```
|
|
2048
|
-
|
|
2049
|
-
**Execution Result**:
|
|
2050
|
-
|
|
2051
|
-
Alfred's **spec-builder** automatically generates:
|
|
2052
|
-
|
|
2053
|
-
```yaml
|
|
2054
|
-
# .moai/specs/SPEC-TODO-001/spec.md
|
|
2055
|
-
|
|
2056
|
-
---
|
|
2057
|
-
id: TODO-001
|
|
2058
|
-
version: 0.0.1
|
|
2059
|
-
status: draft
|
|
2060
|
-
created: 2025-10-22
|
|
2061
|
-
updated: 2025-10-22
|
|
2062
|
-
author: @user
|
|
2063
|
-
priority: high
|
|
2064
|
-
---
|
|
2065
|
-
|
|
2066
|
-
# @SPEC:EX-TODO-001: Todo Management API
|
|
2067
|
-
|
|
2068
|
-
## Ubiquitous Requirements
|
|
2069
|
-
- The system SHALL be able to add todos
|
|
2070
|
-
- The system SHALL be able to view all todos
|
|
2071
|
-
- The system SHALL be able to update specific todos
|
|
2072
|
-
- The system SHALL be able to delete todos
|
|
2073
|
-
|
|
2074
|
-
## Event-driven Requirements
|
|
2075
|
-
- WHEN a new todo is requested via POST /todos, the system SHALL save the todo and return a 201 response
|
|
2076
|
-
- WHEN GET /todos/{id} is requested with an existing todo ID, the system SHALL return that todo
|
|
2077
|
-
- WHEN GET is requested with a non-existent todo ID, the system SHALL return a 404 error
|
|
2078
|
-
|
|
2079
|
-
## Constraints
|
|
2080
|
-
- Todo title SHALL be minimum 1 character, maximum 200 characters
|
|
2081
|
-
- Each todo SHALL automatically record creation time
|
|
2082
|
-
```
|
|
2083
|
-
|
|
2084
|
-
**Also auto-generated**:
|
|
2085
|
-
|
|
2086
|
-
- 📋 `Plan Board`: Implementation ideas, risk factors, solution strategies
|
|
2087
|
-
- ✅ `Acceptance Criteria`: Verification standards
|
|
2088
|
-
- 🌿 `feature/spec-todo-001` Git branch
|
|
2089
|
-
|
|
2090
|
-
### Step 2: RUN - TDD Implementation (about 5 minutes)
|
|
2091
|
-
|
|
2092
|
-
```bash
|
|
2093
|
-
/alfred:2-run TODO-001
|
|
2094
|
-
```
|
|
2095
|
-
|
|
2096
|
-
**Phase 1: Establish Implementation Strategy**
|
|
2097
|
-
|
|
2098
|
-
The **implementation-planner** Sub-agent decides:
|
|
2099
|
-
|
|
2100
|
-
- 📚 Libraries: FastAPI + SQLAlchemy
|
|
2101
|
-
- 📁 Folder structure: `src/todo/`, `tests/todo/`
|
|
2102
|
-
- 🏷️ TAG design: `@CODE:EX-TODO-001:API`, `@CODE:EX-TODO-001:MODEL`, `@CODE:EX-TODO-001:REPO`
|
|
2103
|
-
|
|
2104
|
-
**Phase 2: RED → GREEN → REFACTOR**
|
|
2105
|
-
|
|
2106
|
-
**🔴 RED: Write Tests First**
|
|
2107
|
-
|
|
2108
|
-
```python
|
|
2109
|
-
# tests/test_todo_api.py
|
|
2110
|
-
# @TEST:README-EXAMPLE-TODO | SPEC: SPEC-TODO-001.md
|
|
2111
|
-
|
|
2112
|
-
import pytest
|
|
2113
|
-
from src.todo.api import create_todo, get_todos
|
|
2114
|
-
|
|
2115
|
-
def test_create_todo_should_return_201_with_todo_id():
|
|
2116
|
-
"""WHEN a new todo is requested via POST /todos,
|
|
2117
|
-
the system SHALL save the todo and return a 201 response"""
|
|
2118
|
-
response = create_todo({"title": "Buy groceries"})
|
|
2119
|
-
assert response.status_code == 201
|
|
2120
|
-
assert "id" in response.json()
|
|
2121
|
-
assert response.json()["title"] == "Buy groceries"
|
|
2122
|
-
|
|
2123
|
-
def test_get_todos_should_return_all_todos():
|
|
2124
|
-
"""The system SHALL be able to view all todos"""
|
|
2125
|
-
create_todo({"title": "Task 1"})
|
|
2126
|
-
create_todo({"title": "Task 2"})
|
|
2127
|
-
|
|
2128
|
-
response = get_todos()
|
|
2129
|
-
assert response.status_code == 200
|
|
2130
|
-
assert len(response.json()) >= 2
|
|
2131
|
-
|
|
2132
|
-
def test_get_todo_with_invalid_id_should_return_404():
|
|
2133
|
-
"""WHEN GET is requested with a non-existent todo ID,
|
|
2134
|
-
the system SHALL return a 404 error"""
|
|
2135
|
-
response = get_todo(999)
|
|
2136
|
-
assert response.status_code == 404
|
|
2137
|
-
```
|
|
2138
|
-
|
|
2139
|
-
**Execute**: `pytest tests/test_todo_api.py -v`
|
|
2140
|
-
**Result**: ❌ All fail (create_todo not defined)
|
|
2141
|
-
|
|
2142
|
-
**Git Commit**:
|
|
2143
|
-
|
|
2144
|
-
```bash
|
|
2145
|
-
git commit -m "🔴 test(TODO-001): add failing API tests"
|
|
2146
|
-
```
|
|
2147
|
-
|
|
2148
|
-
**🟢 GREEN: Minimal Implementation**
|
|
2149
|
-
|
|
2150
|
-
```python
|
|
2151
|
-
# src/todo/api.py
|
|
2152
|
-
# @CODE:EX-TODO-001:API | SPEC: SPEC-TODO-001.md | TEST: tests/test_todo_api.py
|
|
2153
|
-
|
|
2154
|
-
from fastapi import FastAPI, HTTPException
|
|
2155
|
-
from pydantic import BaseModel
|
|
2156
|
-
import uuid
|
|
2157
|
-
|
|
2158
|
-
app = FastAPI()
|
|
2159
|
-
todos_db = {}
|
|
2160
|
-
|
|
2161
|
-
class TodoRequest(BaseModel):
|
|
2162
|
-
title: str
|
|
2163
|
-
|
|
2164
|
-
@app.post("/todos", status_code=201)
|
|
2165
|
-
def create_todo(todo: TodoRequest):
|
|
2166
|
-
"""@CODE:EX-TODO-001:API - POST endpoint"""
|
|
2167
|
-
todo_id = str(uuid.uuid4())
|
|
2168
|
-
todos_db[todo_id] = {"id": todo_id, "title": todo.title}
|
|
2169
|
-
return todos_db[todo_id]
|
|
2170
|
-
|
|
2171
|
-
@app.get("/todos")
|
|
2172
|
-
def get_todos():
|
|
2173
|
-
"""@CODE:EX-TODO-001:API - GET all endpoint"""
|
|
2174
|
-
return list(todos_db.values())
|
|
2175
|
-
|
|
2176
|
-
@app.get("/todos/{todo_id}")
|
|
2177
|
-
def get_todo(todo_id: str):
|
|
2178
|
-
"""@CODE:EX-TODO-001:API - GET by ID endpoint"""
|
|
2179
|
-
if todo_id not in todos_db:
|
|
2180
|
-
raise HTTPException(status_code=404, detail="Todo not found")
|
|
2181
|
-
return todos_db[todo_id]
|
|
2182
|
-
```
|
|
2183
|
-
|
|
2184
|
-
**Execute**: `pytest tests/test_todo_api.py -v`
|
|
2185
|
-
**Result**: ✅ All pass!
|
|
2186
|
-
|
|
2187
|
-
**Git Commit**:
|
|
2188
|
-
|
|
2189
|
-
```bash
|
|
2190
|
-
git commit -m "🟢 feat(TODO-001): implement minimal Todo API"
|
|
2191
|
-
```
|
|
2192
|
-
|
|
2193
|
-
**♻️ REFACTOR: Code Improvement**
|
|
2194
|
-
|
|
2195
|
-
```python
|
|
2196
|
-
# src/todo/models.py
|
|
2197
|
-
# @CODE:EX-TODO-001:MODEL | SPEC: SPEC-TODO-001.md
|
|
2198
|
-
|
|
2199
|
-
from datetime import datetime
|
|
2200
|
-
from sqlalchemy import Column, String, DateTime
|
|
2201
|
-
from sqlalchemy.ext.declarative import declarative_base
|
|
2202
|
-
|
|
2203
|
-
Base = declarative_base()
|
|
2204
|
-
|
|
2205
|
-
class Todo(Base):
|
|
2206
|
-
"""@CODE:EX-TODO-001:MODEL - Todo data model"""
|
|
2207
|
-
__tablename__ = "todos"
|
|
2208
|
-
|
|
2209
|
-
id = Column(String, primary_key=True)
|
|
2210
|
-
title = Column(String(200), nullable=False, index=True) # Constraint: max 200 chars
|
|
2211
|
-
created_at = Column(DateTime, default=datetime.utcnow) # Auto creation time
|
|
2212
|
-
|
|
2213
|
-
def validate(self):
|
|
2214
|
-
"""@CODE:EX-TODO-001:MODEL - Validation"""
|
|
2215
|
-
if not self.title or len(self.title) > 200:
|
|
2216
|
-
raise ValueError("Title must be 1-200 characters")
|
|
2217
|
-
```
|
|
2218
|
-
|
|
2219
|
-
**Execute**: `pytest tests/test_todo_api.py -v`
|
|
2220
|
-
**Result**: ✅ Still all pass!
|
|
2221
|
-
|
|
2222
|
-
**Git Commit**:
|
|
2223
|
-
|
|
2224
|
-
```bash
|
|
2225
|
-
git commit -m "♻️ refactor(TODO-001): add database models and validation"
|
|
2226
|
-
```
|
|
2227
|
-
|
|
2228
|
-
**Phase 3: Quality Verification**
|
|
2229
|
-
|
|
2230
|
-
```bash
|
|
2231
|
-
# TRUST verification
|
|
2232
|
-
✅ Test First: 87% coverage
|
|
2233
|
-
✅ Readable: All functions < 50 lines
|
|
2234
|
-
✅ Unified: Consistent API patterns
|
|
2235
|
-
✅ Secured: Input validation complete
|
|
2236
|
-
✅ Trackable: All code has @TAG:TODO-001
|
|
2237
|
-
```
|
|
2238
|
-
|
|
2239
|
-
### Step 3: SYNC - Documentation Sync (about 1 minute)
|
|
2240
|
-
|
|
2241
|
-
```bash
|
|
2242
|
-
/alfred:3-sync
|
|
2243
|
-
```
|
|
2244
|
-
|
|
2245
|
-
**Automatically Performed**:
|
|
2246
|
-
|
|
2247
|
-
1. **TAG Chain Validation**
|
|
2248
|
-
|
|
2249
|
-
```bash
|
|
2250
|
-
✅ @SPEC:EX-TODO-001 → .moai/specs/SPEC-TODO-001/spec.md
|
|
2251
|
-
✅ @TEST:README-EXAMPLE-TODO → tests/test_todo_api.py
|
|
2252
|
-
✅ @CODE:EX-TODO-001 → src/todo/ (3 files)
|
|
2253
|
-
✅ @DOC:EX-TODO-001 → docs/api/todo.md (auto-generated)
|
|
2254
|
-
|
|
2255
|
-
TAG Chain Integrity: 100%
|
|
2256
|
-
Orphan TAGs: None
|
|
2257
|
-
```
|
|
2258
|
-
|
|
2259
|
-
2. **Living Document Generation**
|
|
2260
|
-
|
|
2261
|
-
```markdown
|
|
2262
|
-
# @DOC:EX-TODO-001: Todo Management API
|
|
2263
|
-
|
|
2264
|
-
## Overview
|
|
2265
|
-
|
|
2266
|
-
REST API for managing tasks with CRUD operations.
|
|
2267
|
-
|
|
2268
|
-
## Endpoints
|
|
2269
|
-
|
|
2270
|
-
### Create Todo
|
|
2271
|
-
|
|
2272
|
-
- Method: POST
|
|
2273
|
-
- URL: /todos
|
|
2274
|
-
- Request: {"title": "string (1-200 chars)"}
|
|
2275
|
-
- Response: 201 Created with todo object
|
|
2276
|
-
- Implemented in: @CODE:EX-TODO-001:API
|
|
2277
|
-
- Tested in: @TEST:README-EXAMPLE-TODO
|
|
2278
|
-
|
|
2279
|
-
### Get All Todos
|
|
2280
|
-
|
|
2281
|
-
- Method: GET
|
|
2282
|
-
- URL: /todos
|
|
2283
|
-
- Response: 200 OK with array of todos
|
|
2284
|
-
|
|
2285
|
-
[... etc ...]
|
|
2286
|
-
```
|
|
2287
|
-
|
|
2288
|
-
3. **README Update**
|
|
2289
|
-
|
|
2290
|
-
```markdown
|
|
2291
|
-
## Features
|
|
2292
|
-
|
|
2293
|
-
- ✅ Todo Management API (TODO-001)
|
|
2294
|
-
```
|
|
2295
|
-
|
|
2296
|
-
4. **CHANGELOG Generation**
|
|
2297
|
-
|
|
2298
|
-
```markdown
|
|
2299
|
-
# Changelog
|
|
2300
|
-
|
|
2301
|
-
## [0.1.0] - 2025-10-22
|
|
2302
|
-
|
|
2303
|
-
### Added
|
|
2304
|
-
|
|
2305
|
-
- Todo Management API with CRUD operations (@SPEC:EX-TODO-001)
|
|
2306
|
-
- Create new todos
|
|
2307
|
-
- List all todos
|
|
2308
|
-
- Update existing todos
|
|
2309
|
-
- Delete todos
|
|
2310
|
-
|
|
2311
|
-
### Implementation Details
|
|
2312
|
-
|
|
2313
|
-
- SPEC: .moai/specs/SPEC-TODO-001/spec.md
|
|
2314
|
-
- Tests: tests/test_todo_api.py (87% coverage)
|
|
2315
|
-
- Code: src/todo/ with models, API, repository layers
|
|
2316
|
-
```
|
|
2317
|
-
|
|
2318
|
-
### Step 4: Verification (about 1 minute)
|
|
2319
|
-
|
|
2320
|
-
Let's verify everything generated is properly connected:
|
|
2321
|
-
|
|
2322
|
-
```bash
|
|
2323
|
-
# 1️⃣ Check TAG chain
|
|
2324
|
-
rg '@(SPEC|TEST|CODE|DOC):TODO-001' -n
|
|
2325
|
-
|
|
2326
|
-
# Output:
|
|
2327
|
-
# .moai/specs/SPEC-TODO-001/spec.md:1: # @SPEC:EX-TODO-001: Todo Management API
|
|
2328
|
-
# tests/test_todo_api.py:2: # @TEST:README-EXAMPLE-TODO | SPEC: SPEC-TODO-001.md
|
|
2329
|
-
# src/todo/api.py:5: # @CODE:EX-TODO-001:API | SPEC: SPEC-TODO-001.md
|
|
2330
|
-
# src/todo/models.py:5: # @CODE:EX-TODO-001:MODEL | SPEC: SPEC-TODO-001.md
|
|
2331
|
-
# docs/api/todo.md:1: # @DOC:EX-TODO-001: Todo Management API
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
# 2️⃣ Run tests
|
|
2335
|
-
pytest tests/test_todo_api.py -v
|
|
2336
|
-
# ✅ test_create_todo_should_return_201_with_todo_id PASSED
|
|
2337
|
-
# ✅ test_get_todos_should_return_all_todos PASSED
|
|
2338
|
-
# ✅ test_get_todo_with_invalid_id_should_return_404 PASSED
|
|
2339
|
-
# ✅ 3 passed in 0.05s
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
# 3️⃣ Check generated documentation
|
|
2343
|
-
cat docs/api/todo.md # API documentation auto-generated
|
|
2344
|
-
cat README.md # Todo API added
|
|
2345
|
-
cat CHANGELOG.md # Change history recorded
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
# 4️⃣ Check Git history
|
|
2349
|
-
git log --oneline | head -5
|
|
2350
|
-
# a1b2c3d ✅ sync(TODO-001): update docs and changelog
|
|
2351
|
-
# f4e5d6c ♻️ refactor(TODO-001): add database models
|
|
2352
|
-
# 7g8h9i0 🟢 feat(TODO-001): implement minimal API
|
|
2353
|
-
# 1j2k3l4 🔴 test(TODO-001): add failing tests
|
|
2354
|
-
# 5m6n7o8 🌿 Create feature/spec-todo-001 branch
|
|
2355
|
-
```
|
|
2356
|
-
|
|
2357
|
-
### After 15 Minutes: Complete System
|
|
2358
|
-
|
|
2359
|
-
```
|
|
2360
|
-
✅ SPEC written (3 minutes)
|
|
2361
|
-
└─ @SPEC:EX-TODO-001 TAG assigned
|
|
2362
|
-
└─ Clear requirements in EARS format
|
|
2363
|
-
|
|
2364
|
-
✅ TDD implementation (5 minutes)
|
|
2365
|
-
└─ 🔴 RED: Tests written first
|
|
2366
|
-
└─ 🟢 GREEN: Minimal implementation
|
|
2367
|
-
└─ ♻️ REFACTOR: Quality improvement
|
|
2368
|
-
└─ @TEST:README-EXAMPLE-TODO, @CODE:EX-TODO-001 TAGs assigned
|
|
2369
|
-
└─ 87% coverage, TRUST 5 principles verified
|
|
2370
|
-
|
|
2371
|
-
✅ Documentation sync (1 minute)
|
|
2372
|
-
└─ Living Document auto-generated
|
|
2373
|
-
└─ README, CHANGELOG updated
|
|
2374
|
-
└─ TAG chain validation complete
|
|
2375
|
-
└─ @DOC:EX-TODO-001 TAG assigned
|
|
2376
|
-
└─ PR status: Draft → Ready for Review
|
|
2377
|
-
|
|
2378
|
-
Result:
|
|
2379
|
-
- 📋 Clear SPEC (SPEC-TODO-001.md)
|
|
2380
|
-
- 🧪 85%+ test coverage (test_todo_api.py)
|
|
2381
|
-
- 💎 Production-quality code (src/todo/)
|
|
2382
|
-
- 📖 Auto-generated API documentation (docs/api/todo.md)
|
|
2383
|
-
- 📝 Change history tracking (CHANGELOG.md)
|
|
2384
|
-
- 🔗 Everything connected with TAGs
|
|
2385
|
-
```
|
|
2386
|
-
|
|
2387
|
-
> **This is MoAI-ADK's true power.** Not just a simple API implementation,
|
|
2388
|
-
> but a **complete development artifact** with everything from SPEC through tests, code, and documentation consistently connected!
|
|
2389
|
-
|
|
2390
|
-
---
|
|
2391
|
-
|
|
2392
|
-
## Sub-agents & Skills Overview
|
|
2393
|
-
|
|
2394
|
-
Alfred works by combining multiple specialized agents with Claude Skills.
|
|
2395
|
-
|
|
2396
|
-
### Core Sub-agents (Plan → Run → Sync)
|
|
2397
|
-
|
|
2398
|
-
| Sub-agent | Model | Role |
|
|
2399
|
-
| ------------------ | ------ | ----------------------------------------------------------------------- |
|
|
2400
|
-
| project-manager 📋 | Sonnet | Project initialization, metadata interviews |
|
|
2401
|
-
| spec-builder 🏗️ | Sonnet | Plan board, EARS SPEC authoring, expert consultation recommendations |
|
|
2402
|
-
| code-builder 💎 | Sonnet | Performs complete TDD with `implementation-planner` + `tdd-implementer` |
|
|
2403
|
-
| doc-syncer 📖 | Haiku | Living Doc, README, CHANGELOG sync |
|
|
2404
|
-
| tag-agent 🏷️ | Haiku | TAG inventory, orphan detection, @EXPERT TAG validation |
|
|
2405
|
-
| git-manager 🚀 | Haiku | GitFlow, Draft/Ready, Auto Merge |
|
|
2406
|
-
| debug-helper 🔍 | Sonnet | Failure analysis, fix-forward strategy |
|
|
2407
|
-
| trust-checker ✅ | Haiku | TRUST 5 quality gate |
|
|
2408
|
-
| quality-gate 🛡️ | Haiku | Coverage change and release blocker review |
|
|
2409
|
-
| cc-manager 🛠️ | Sonnet | Claude Code session optimization, Skill deployment |
|
|
2410
|
-
|
|
2411
|
-
### Expert Agents (Proactively Triggered by SPEC Keywords)
|
|
2412
|
-
|
|
2413
|
-
Expert agents activate automatically when `implementation-planner` detects domain-specific keywords in SPEC documents. They provide architecture guidance, technology recommendations, and risk analysis for their specialized domains.
|
|
2414
|
-
|
|
2415
|
-
| Expert Agent | Model | Specialty | Auto-Trigger Keywords |
|
|
2416
|
-
| ----------------- | ------ | --------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
2417
|
-
| backend-expert 🔧 | Sonnet | Backend architecture, API design, database, auth | 'backend', 'api', 'server', 'database', 'deployment', 'authentication' |
|
|
2418
|
-
| frontend-expert 💻| Sonnet | Frontend architecture, components, state mgmt | 'frontend', 'ui', 'page', 'component', 'client-side', 'web interface' |
|
|
2419
|
-
| devops-expert 🚀 | Sonnet | DevOps, CI/CD, deployment, containerization | 'deployment', 'docker', 'kubernetes', 'ci/cd', 'pipeline', 'aws' |
|
|
2420
|
-
| ui-ux-expert 🎨 | Sonnet | UI/UX design, accessibility (WCAG), design systems | 'design', 'ux', 'accessibility', 'a11y', 'figma', 'design system' |
|
|
2421
|
-
|
|
2422
|
-
**How It Works**:
|
|
2423
|
-
- When `/alfred:2-run` starts, `implementation-planner` scans the SPEC content
|
|
2424
|
-
- Matching keywords trigger automatic expert agent invocation
|
|
2425
|
-
- Experts provide domain-specific architecture guidance
|
|
2426
|
-
- All expert consultations are tagged with `@EXPERT:DOMAIN` for traceability
|
|
2427
|
-
|
|
2428
|
-
### Skills (Progressive Disclosure - v0.4 New!)
|
|
2429
|
-
|
|
2430
|
-
Alfred organizes Claude Skills in a 4-tier architecture using **Progressive Disclosure** to load Just-In-Time only when needed. Each Skill is a production-grade guide stored in `.claude/skills/` directory.
|
|
2431
|
-
|
|
2432
|
-
#### Foundation Tier
|
|
2433
|
-
|
|
2434
|
-
Core skills containing fundamental TRUST/TAG/SPEC/Git/EARS/Language principles
|
|
2435
|
-
|
|
2436
|
-
| Skill | Description |
|
|
2437
|
-
| ----------------------- | ---------------------------------------------------------------------------------- |
|
|
2438
|
-
| `moai-foundation-trust` | TRUST 5-principles (Test 85%+, Readable, Unified, Secured, Trackable) verification |
|
|
2439
|
-
| `moai-foundation-tags` | @TAG markers scan and inventory generation (CODE-FIRST principle) |
|
|
2440
|
-
| `moai-foundation-specs` | SPEC YAML frontmatter validation and HISTORY section management |
|
|
2441
|
-
| `moai-foundation-ears` | EARS (Easy Approach to Requirements Syntax) requirements writing guide |
|
|
2442
|
-
| `moai-foundation-git` | Git workflow automation (branching, TDD commits, PR management) |
|
|
2443
|
-
| `moai-foundation-langs` | Project language/framework auto-detection (package.json, pyproject.toml, etc.) |
|
|
2444
|
-
|
|
2445
|
-
#### Essentials Tier
|
|
2446
|
-
|
|
2447
|
-
Core tools needed for daily development work
|
|
2448
|
-
|
|
2449
|
-
| Skill | Description |
|
|
2450
|
-
| -------------------------- | ---------------------------------------------------------------------- |
|
|
2451
|
-
| `moai-essentials-debug` | Stack trace analysis, error pattern detection, quick diagnosis support |
|
|
2452
|
-
| `moai-essentials-perf` | Performance profiling, bottleneck detection, tuning strategies |
|
|
2453
|
-
| `moai-essentials-refactor` | Refactoring guide, design patterns, code improvement strategies |
|
|
2454
|
-
| `moai-essentials-review` | Automated code review, SOLID principles, code smell detection |
|
|
2455
|
-
|
|
2456
|
-
#### Alfred Tier
|
|
2457
|
-
|
|
2458
|
-
MoAI-ADK internal workflow orchestration skills
|
|
2459
|
-
|
|
2460
|
-
| Skill | Description |
|
|
2461
|
-
| -------------------------------------- | ------------------------------------------------------------------------- |
|
|
2462
|
-
| `moai-alfred-ears-authoring` | EARS syntax validation and requirement pattern guidance |
|
|
2463
|
-
| `moai-alfred-git-workflow` | MoAI-ADK conventions (feature branch, TDD commits, Draft PR) automation |
|
|
2464
|
-
| `moai-alfred-language-detection` | Project language/runtime detection and test tool recommendations |
|
|
2465
|
-
| `moai-alfred-spec-metadata-validation` | SPEC YAML frontmatter and HISTORY section consistency validation |
|
|
2466
|
-
| `moai-alfred-tag-scanning` | Complete @TAG marker scan and inventory generation (CODE-FIRST principle) |
|
|
2467
|
-
| `moai-alfred-trust-validation` | TRUST 5-principles compliance verification |
|
|
2468
|
-
| `moai-alfred-interactive-questions` | Claude Code Tools AskUserQuestion TUI menu standardization |
|
|
2469
|
-
|
|
2470
|
-
#### Domain Tier
|
|
2471
|
-
|
|
2472
|
-
Specialized domain expertise
|
|
2473
|
-
|
|
2474
|
-
| Skill | Description |
|
|
2475
|
-
| -------------------------- | ---------------------------------------------------------------------------------------- |
|
|
2476
|
-
| `moai-domain-backend` | Backend architecture, API design, scaling guide |
|
|
2477
|
-
| `moai-domain-cli-tool` | CLI tool development, argument parsing, POSIX compliance, user-friendly help messages |
|
|
2478
|
-
| `moai-domain-data-science` | Data analysis, visualization, statistical modeling, reproducible research workflows |
|
|
2479
|
-
| `moai-domain-database` | Database design, schema optimization, indexing strategies, migration management |
|
|
2480
|
-
| `moai-domain-design-systems` | Design system architecture, W3C DTCG tokens, WCAG 2.2 accessibility, design-to-code, Figma MCP |
|
|
2481
|
-
| `moai-domain-devops` | CI/CD pipelines, Docker containerization, Kubernetes orchestration, IaC |
|
|
2482
|
-
| `moai-domain-frontend` | React/Vue/Angular development, state management, performance optimization, accessibility |
|
|
2483
|
-
| `moai-domain-ml` | Machine learning model training, evaluation, deployment, MLOps workflows |
|
|
2484
|
-
| `moai-domain-mobile-app` | Flutter/React Native development, state management, native integration |
|
|
2485
|
-
| `moai-domain-security` | OWASP Top 10, static analysis (SAST), dependency security, secrets management |
|
|
2486
|
-
| `moai-domain-web-api` | REST API, GraphQL design patterns, authentication, versioning, OpenAPI documentation |
|
|
2487
|
-
|
|
2488
|
-
#### Language Tier
|
|
2489
|
-
|
|
2490
|
-
Programming language-specific best practices
|
|
2491
|
-
|
|
2492
|
-
| Skill | Description |
|
|
2493
|
-
| ---------------------- | --------------------------------------------------------- |
|
|
2494
|
-
| `moai-lang-python` | pytest, mypy, ruff, black, uv package management |
|
|
2495
|
-
| `moai-lang-typescript` | Vitest, Biome, strict typing, npm/pnpm |
|
|
2496
|
-
| `moai-lang-javascript` | Jest, ESLint, Prettier, npm package management |
|
|
2497
|
-
| `moai-lang-go` | go test, golint, gofmt, standard library |
|
|
2498
|
-
| `moai-lang-rust` | cargo test, clippy, rustfmt, ownership/borrow checker |
|
|
2499
|
-
| `moai-lang-java` | JUnit, Maven/Gradle, Checkstyle, Spring Boot patterns |
|
|
2500
|
-
| `moai-lang-kotlin` | JUnit, Gradle, ktlint, coroutines, extension functions |
|
|
2501
|
-
| `moai-lang-swift` | XCTest, SwiftLint, iOS/macOS development patterns |
|
|
2502
|
-
| `moai-lang-dart` | flutter test, dart analyze, Flutter widget patterns |
|
|
2503
|
-
| `moai-lang-csharp` | xUnit, .NET tooling, LINQ, async/await patterns |
|
|
2504
|
-
| `moai-lang-cpp` | Google Test, clang-format, modern C++ (C++17/20) |
|
|
2505
|
-
| `moai-lang-c` | Unity test framework, cppcheck, Make build system |
|
|
2506
|
-
| `moai-lang-scala` | ScalaTest, sbt, functional programming patterns |
|
|
2507
|
-
| `moai-lang-ruby` | RSpec, RuboCop, Bundler, Rails patterns |
|
|
2508
|
-
| `moai-lang-php` | PHPUnit, Composer, PSR standards |
|
|
2509
|
-
| `moai-lang-sql` | Test frameworks, query optimization, migration management |
|
|
2510
|
-
| `moai-lang-shell` | bats, shellcheck, POSIX compliance |
|
|
2511
|
-
| `moai-lang-r` | testthat, lintr, data analysis patterns |
|
|
2512
|
-
|
|
2513
|
-
#### Claude Code Ops
|
|
2514
|
-
|
|
2515
|
-
Claude Code session management
|
|
2516
|
-
|
|
2517
|
-
| Skill | Description |
|
|
2518
|
-
| ------------------ | ---------------------------------------------------------------------------------- |
|
|
2519
|
-
| `moai-claude-code` | Claude Code agents, commands, skills, plugins, settings scaffolding and monitoring |
|
|
2520
|
-
|
|
2521
|
-
> **v0.4.6 New Feature**: Claude Skills organized in 4-tier architecture (100% complete in v0.4.6). Each Skill loads via Progressive Disclosure only when needed to minimize context cost. Organized in Foundation → Essentials → Alfred → Domain/Language/Ops tiers, with all skills including production-grade documentation and executable TDD examples.
|
|
2522
|
-
|
|
2523
|
-
---
|
|
2524
|
-
|
|
2525
|
-
## AI Model Selection Guide
|
|
2526
|
-
|
|
2527
|
-
| Scenario | Default Model | Why |
|
|
2528
|
-
| ---------------------------------------------------- | --------------------- | ----------------------------------------------- |
|
|
2529
|
-
| Specifications, design, refactoring, problem solving | **Claude 4.5 Sonnet** | Strong in deep reasoning and structured writing |
|
|
2530
|
-
| Document sync, TAG checks, Git automation | **Claude 4.5 Haiku** | Strong in rapid iteration, string processing |
|
|
2531
|
-
|
|
2532
|
-
- Start with Haiku for patterned tasks; switch to Sonnet when complex judgment is needed.
|
|
2533
|
-
- If you manually change models, noting "why switched" in logs helps collaboration.
|
|
2534
|
-
|
|
2535
|
-
---
|
|
2536
|
-
|
|
2537
|
-
## Claude Code Hooks Guide
|
|
2538
|
-
|
|
2539
|
-
MoAI-ADK provides 4 main **Claude Code Hooks** that seamlessly integrate with your development workflow. These hooks enable automatic checkpoints, JIT context loading, and session monitoring—all happening transparently in the background.
|
|
2540
|
-
|
|
2541
|
-
### What Are Hooks?
|
|
2542
|
-
|
|
2543
|
-
Hooks are **event-driven** scripts that trigger automatically at specific points in your Claude Code session. Think of them as safety guardrails and productivity boosters that work behind the scenes without interrupting your flow.
|
|
2544
|
-
|
|
2545
|
-
### Installed Hooks
|
|
2546
|
-
|
|
2547
|
-
#### 1. SessionStart (Session Initialization)
|
|
2548
|
-
|
|
2549
|
-
**Triggers**: When you start a Claude Code session in your project
|
|
2550
|
-
**Purpose**: Display project status at a glance
|
|
2551
|
-
|
|
2552
|
-
**What You See**:
|
|
2553
|
-
|
|
2554
|
-
```
|
|
2555
|
-
🚀 MoAI-ADK Session Started
|
|
2556
|
-
Language: Python
|
|
2557
|
-
Branch: develop
|
|
2558
|
-
Changes: 2 files
|
|
2559
|
-
SPEC Progress: 12/25 (48%)
|
|
2560
|
-
```
|
|
2561
|
-
|
|
2562
|
-
**Why It Matters**: Instantly understand your project's current state without running multiple commands.
|
|
2563
|
-
|
|
2564
|
-
#### 2. PreToolUse (Before Tool Execution)
|
|
2565
|
-
|
|
2566
|
-
**Triggers**: Before executing file edits, Bash commands, or MultiEdit operations
|
|
2567
|
-
**Purpose**: Detect risky operations and automatically create safety checkpoints + TAG Guard
|
|
2568
|
-
|
|
2569
|
-
**Protection Against**:
|
|
2570
|
-
|
|
2571
|
-
- `rm -rf` (file deletion)
|
|
2572
|
-
- `git merge`, `git reset --hard` (Git dangerous operations)
|
|
2573
|
-
- Editing critical files (`CLAUDE.md`, `config.json`)
|
|
2574
|
-
- Mass edits (10+ files at once via MultiEdit)
|
|
2575
|
-
|
|
2576
|
-
**TAG Guard**:
|
|
2577
|
-
Automatically detects missing @TAG annotations in changed files:
|
|
2578
|
-
|
|
2579
|
-
- Scans staged, modified, and untracked files
|
|
2580
|
-
- Warns when SPEC/TEST/CODE/DOC files lack required @TAG markers
|
|
2581
|
-
- Configurable rules via `.moai/tag-rules.json`
|
|
2582
|
-
- Non-blocking (gentle reminder, doesn't stop execution)
|
|
2583
|
-
|
|
2584
|
-
**What You See**:
|
|
2585
|
-
|
|
2586
|
-
```
|
|
2587
|
-
🛡️ Checkpoint created: before-delete-20251023-143000
|
|
2588
|
-
Operation: delete
|
|
2589
|
-
```
|
|
2590
|
-
|
|
2591
|
-
Or when TAGs are missing:
|
|
2592
|
-
|
|
2593
|
-
```
|
|
2594
|
-
⚠️ TAG 누락 감지: 생성/수정한 파일 중 @TAG가 없는 항목이 있습니다.
|
|
2595
|
-
- src/auth/service.py → 기대 태그: @CODE:
|
|
2596
|
-
- tests/test_auth.py → 기대 태그: @TEST:
|
|
2597
|
-
권장 조치:
|
|
2598
|
-
1) SPEC/TEST/CODE/DOC 유형에 맞는 @TAG를 파일 상단 주석이나 헤더에 추가
|
|
2599
|
-
2) rg로 확인: rg '@(SPEC|TEST|CODE|DOC):' -n <경로>
|
|
2600
|
-
```
|
|
2601
|
-
|
|
2602
|
-
**Why It Matters**: Prevents data loss from mistakes and ensures @TAG traceability. You can always restore from the checkpoint if something goes wrong.
|
|
2603
|
-
|
|
2604
|
-
#### 3. UserPromptSubmit (Prompt Input)
|
|
2605
|
-
|
|
2606
|
-
**Triggers**: When you submit a prompt to Claude
|
|
2607
|
-
**Purpose**: JIT (Just-In-Time) context loading—automatically add relevant files
|
|
2608
|
-
|
|
2609
|
-
**How It Works**:
|
|
2610
|
-
|
|
2611
|
-
- You type: "Fix AUTH bug"
|
|
2612
|
-
- Hook scans for AUTH-related files
|
|
2613
|
-
- Auto-loads: SPEC, tests, implementation, docs related to AUTH
|
|
2614
|
-
- Claude receives full context without you manually specifying files
|
|
2615
|
-
|
|
2616
|
-
**Why It Matters**: Saves time and ensures Claude has all the relevant context for your request.
|
|
2617
|
-
|
|
2618
|
-
#### 4. SessionEnd (Session Cleanup)
|
|
2619
|
-
|
|
2620
|
-
**Triggers**: When you close your Claude Code session
|
|
2621
|
-
**Purpose**: Cleanup tasks and state preservation
|
|
2622
|
-
|
|
2623
|
-
**Why It Matters**: Ensures clean session transitions and proper state management.
|
|
2624
|
-
|
|
2625
|
-
### Technical Details
|
|
2626
|
-
|
|
2627
|
-
- **Location**: `.claude/hooks/alfred/`
|
|
2628
|
-
- **Environment Variable**: `$CLAUDE_PROJECT_DIR` (dynamically references project root)
|
|
2629
|
-
- **Performance**: Each hook executes in <100ms
|
|
2630
|
-
- **Logging**: Errors output to stderr (stdout reserved for JSON payloads)
|
|
2631
|
-
|
|
2632
|
-
### How to Disable Hooks
|
|
2633
|
-
|
|
2634
|
-
If you need to temporarily disable hooks, edit `.claude/settings.json`:
|
|
2635
|
-
|
|
2636
|
-
```json
|
|
2637
|
-
{
|
|
2638
|
-
"hooks": {
|
|
2639
|
-
"SessionStart": [], // Disabled
|
|
2640
|
-
"PreToolUse": [...] // Still active
|
|
2641
|
-
}
|
|
2642
|
-
}
|
|
2643
|
-
```
|
|
2644
|
-
|
|
2645
|
-
### Troubleshooting
|
|
2646
|
-
|
|
2647
|
-
**Problem: Hook doesn't execute**
|
|
2648
|
-
|
|
2649
|
-
- ✅ Verify `.claude/settings.json` is properly configured
|
|
2650
|
-
- ✅ Check `uv` is installed: `which uv`
|
|
2651
|
-
- ✅ Ensure hook script has execute permissions: `chmod +x .claude/hooks/alfred/alfred_hooks.py`
|
|
2652
|
-
|
|
2653
|
-
**Problem: Performance degradation**
|
|
2654
|
-
|
|
2655
|
-
- ✅ Check if any hook exceeds 100ms execution time
|
|
2656
|
-
- ✅ Disable unnecessary hooks
|
|
2657
|
-
- ✅ Review error messages in stderr output
|
|
2658
|
-
|
|
2659
|
-
**Problem: Too many checkpoints created**
|
|
2660
|
-
|
|
2661
|
-
- ✅ Review PreToolUse trigger conditions
|
|
2662
|
-
- ✅ Adjust detection thresholds in `core/checkpoint.py` if needed
|
|
2663
|
-
|
|
2664
|
-
### Installed Hooks (5 total)
|
|
2665
|
-
|
|
2666
|
-
| Hook | Status | Feature |
|
|
2667
|
-
| -------------------- | --------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
2668
|
-
| **SessionStart** | ✅ Active | Project status summary (language, Git, SPEC progress, checkpoints) |
|
|
2669
|
-
| **PreToolUse** | ✅ Active | Risk detection + auto checkpoint (critical-delete, delete, merge, script) + **TAG Guard** (missing @TAG detection) |
|
|
2670
|
-
| **UserPromptSubmit** | ✅ Active | JIT context loading (auto-load related SPEC, tests, code, docs) |
|
|
2671
|
-
| **PostToolUse** | ✅ Active | Auto-run tests after code changes (9 languages: Python, TS, JS, Go, Rust, Java, Kotlin, Swift, Dart) |
|
|
2672
|
-
| **SessionEnd** | ✅ Active | Session cleanup and state saving |
|
|
2673
|
-
|
|
2674
|
-
### Future Enhancements
|
|
2675
|
-
|
|
2676
|
-
- **Notification**: Important event alerts (logging, notifications)
|
|
2677
|
-
- **Stop/SubagentStop**: Cleanup when agents terminate
|
|
2678
|
-
- Advanced security: `dd` commands, supply chain checks
|
|
2679
|
-
|
|
2680
|
-
### Learn More
|
|
2681
|
-
|
|
2682
|
-
- Comprehensive analysis: `.moai/reports/hooks-analysis-and-implementation.md`
|
|
2683
|
-
- PostToolUse implementation: `.moai/reports/phase3-posttool-implementation-complete.md`
|
|
2684
|
-
- Security enhancements: `.moai/reports/security-enhancement-critical-delete.md`
|
|
2685
|
-
- Hook implementation: `.claude/hooks/alfred/`
|
|
2686
|
-
- Hook tests: `tests/hooks/`
|
|
2687
|
-
|
|
2688
|
-
---
|
|
2689
|
-
|
|
2690
|
-
## Frequently Asked Questions (FAQ)
|
|
2691
|
-
|
|
2692
|
-
- **Q. Can I install on an existing project?**
|
|
2693
|
-
- A. Yes. Run `moai-adk init .` to add only the `.moai/` structure without touching existing code.
|
|
2694
|
-
- **Q. How do I run tests?**
|
|
2695
|
-
- A. `/alfred:2-run` runs them first; rerun `pytest`, `pnpm test`, etc. per language as needed.
|
|
2696
|
-
- **Q. How do I ensure documentation stays current?**
|
|
2697
|
-
- A. `/alfred:3-sync` generates a Sync Report. Check the report in Pull Requests.
|
|
2698
|
-
- **Q. Can I work manually?**
|
|
2699
|
-
- A. Yes, but keep the SPEC → TEST → CODE → DOC order and always leave TAGs.
|
|
2700
|
-
|
|
2701
|
-
---
|
|
2702
|
-
|
|
2703
|
-
## Latest Updates (New!)
|
|
2704
|
-
|
|
2705
|
-
| Version | Key Features | Date |
|
|
2706
|
-
| ----------- | ------------------------------------------------------------------------------------------------ | ---------- |
|
|
2707
|
-
| **v0.8.2** | 📖 EARS terminology update: "Constraints" → "Unwanted Behaviors" for clarity | 2025-10-29 |
|
|
2708
|
-
| **v0.8.1** | 🔄 Command rename: `/alfred:9-help` → `/alfred:9-feedback` + User feedback workflow improvements | 2025-10-28 |
|
|
2709
|
-
| **v0.8.0** | 🏷️ @DOC TAG auto-generation system + SessionStart version check enhancement | 2025-10-27 |
|
|
2710
|
-
| **v0.7.0** | 🌍 Complete language localization system (English, Korean, Japanese, Chinese, Spanish) | 2025-10-26 |
|
|
2711
|
-
| **v0.6.3** | ⚡ 3-Stage update workflow: 70-80% performance improvement via parallel operations | 2025-10-25 |
|
|
2712
|
-
| **v0.6.0** | 🏗️ Major architecture refactor + Enhanced SPEC metadata structure (7 required + 9 optional) | 2025-10-24 |
|
|
2713
|
-
| **v0.5.7** | 🎯 SPEC → GitHub Issue automation + CodeRabbit integration + Auto PR comments | 2025-10-27 |
|
|
2714
|
-
| **v0.4.11** | ✨ TAG Guard system + CLAUDE.md formatting improvements + Code cleanup | 2025-10-23 |
|
|
2715
|
-
|
|
2716
|
-
> 📦 **Install Now**: `uv tool install moai-adk` or `pip install moai-adk`
|
|
2717
|
-
|
|
2718
|
-
---
|
|
2719
|
-
|
|
2720
|
-
## 🔧 Beginner's Troubleshooting Guide
|
|
2721
|
-
|
|
2722
|
-
Common errors and solutions for getting started with MoAI-ADK.
|
|
2723
|
-
|
|
2724
|
-
### 1. uv is Not Installed
|
|
2725
|
-
|
|
2726
|
-
**Symptom**:
|
|
2727
|
-
```bash
|
|
2728
|
-
$ uv --version
|
|
2729
|
-
bash: uv: command not found
|
|
2730
|
-
```
|
|
2731
|
-
|
|
2732
|
-
**Cause**: uv not installed or not in PATH
|
|
2733
|
-
|
|
2734
|
-
**Solution**:
|
|
2735
|
-
|
|
2736
|
-
**macOS/Linux**:
|
|
2737
|
-
```bash
|
|
2738
|
-
# Install
|
|
2739
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
2740
|
-
|
|
2741
|
-
# Restart shell
|
|
2742
|
-
source ~/.bashrc # or ~/.zshrc
|
|
2743
|
-
|
|
2744
|
-
# Verify
|
|
2745
|
-
uv --version
|
|
2746
|
-
```
|
|
2747
|
-
|
|
2748
|
-
**Windows (PowerShell)**:
|
|
2749
|
-
```powershell
|
|
2750
|
-
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
2751
|
-
|
|
2752
|
-
# Verify
|
|
2753
|
-
uv --version
|
|
2754
|
-
```
|
|
2755
|
-
|
|
2756
|
-
**If still not working**:
|
|
2757
|
-
```bash
|
|
2758
|
-
# Manually add PATH (macOS/Linux)
|
|
2759
|
-
export PATH="$HOME/.cargo/bin:$PATH"
|
|
2760
|
-
|
|
2761
|
-
# Verify
|
|
2762
|
-
uv --version
|
|
2763
|
-
```
|
|
2764
|
-
|
|
2765
|
-
---
|
|
2766
|
-
|
|
2767
|
-
### 2. Python Version Mismatch
|
|
2768
|
-
|
|
2769
|
-
**Symptom**:
|
|
2770
|
-
```
|
|
2771
|
-
Python 3.8 found, but 3.13+ required
|
|
2772
|
-
```
|
|
2773
|
-
|
|
2774
|
-
**Cause**: Python version is less than 3.13
|
|
2775
|
-
|
|
2776
|
-
**Solution**:
|
|
2777
|
-
|
|
2778
|
-
**Option A: Using pyenv (Recommended)**:
|
|
2779
|
-
```bash
|
|
2780
|
-
# Install pyenv
|
|
2781
|
-
curl https://pyenv.run | bash
|
|
2782
|
-
|
|
2783
|
-
# Install Python 3.13
|
|
2784
|
-
pyenv install 3.13
|
|
2785
|
-
pyenv global 3.13
|
|
2786
|
-
|
|
2787
|
-
# Verify
|
|
2788
|
-
python --version # Python 3.13.x
|
|
2789
|
-
```
|
|
2790
|
-
|
|
2791
|
-
**Option B: Let uv manage Python**:
|
|
2792
|
-
```bash
|
|
2793
|
-
# uv automatically downloads Python 3.13
|
|
2794
|
-
uv python install 3.13
|
|
2795
|
-
uv python pin 3.13
|
|
2796
|
-
|
|
2797
|
-
# Verify
|
|
2798
|
-
python --version
|
|
2799
|
-
```
|
|
2800
|
-
|
|
2801
|
-
---
|
|
2802
|
-
|
|
2803
|
-
### 3. Git Not Found
|
|
2804
|
-
|
|
2805
|
-
**Symptom**:
|
|
2806
|
-
```
|
|
2807
|
-
✗ Git (runtime): not found
|
|
2808
|
-
```
|
|
2809
|
-
|
|
2810
|
-
**Cause**: Git not installed on system
|
|
2811
|
-
|
|
2812
|
-
**Solution**:
|
|
2813
|
-
|
|
2814
|
-
**macOS**:
|
|
2815
|
-
```bash
|
|
2816
|
-
# Using Homebrew
|
|
2817
|
-
brew install git
|
|
2818
|
-
|
|
2819
|
-
# Or install Xcode Command Line Tools
|
|
2820
|
-
xcode-select --install
|
|
2821
|
-
```
|
|
2822
|
-
|
|
2823
|
-
**Ubuntu/Debian**:
|
|
2824
|
-
```bash
|
|
2825
|
-
sudo apt update
|
|
2826
|
-
sudo apt install git -y
|
|
2827
|
-
```
|
|
2828
|
-
|
|
2829
|
-
**Windows**:
|
|
2830
|
-
```powershell
|
|
2831
|
-
# Using winget
|
|
2832
|
-
winget install Git.Git
|
|
2833
|
-
|
|
2834
|
-
# Or download from https://git-scm.com/download/win
|
|
2835
|
-
```
|
|
2836
|
-
|
|
2837
|
-
**Verify**:
|
|
2838
|
-
```bash
|
|
2839
|
-
git --version # git version 2.x.x
|
|
2840
|
-
```
|
|
2841
|
-
|
|
2842
|
-
---
|
|
2843
|
-
|
|
2844
|
-
### 4. Claude Code Doesn't Recognize .moai/ Folder
|
|
2845
|
-
|
|
2846
|
-
**Symptom**:
|
|
2847
|
-
```
|
|
2848
|
-
"Project not initialized"
|
|
2849
|
-
/alfred:0-project command doesn't work
|
|
2850
|
-
```
|
|
2851
|
-
|
|
2852
|
-
**Cause**: `.moai/` or `.claude/` folders missing or corrupted
|
|
2853
|
-
|
|
2854
|
-
**Solution**:
|
|
2855
|
-
|
|
2856
|
-
```bash
|
|
2857
|
-
# 1. Verify current directory
|
|
2858
|
-
pwd # /path/to/your-project
|
|
2859
|
-
|
|
2860
|
-
# 2. Check if .moai/ exists
|
|
2861
|
-
ls -la .moai/config.json
|
|
2862
|
-
|
|
2863
|
-
# 3. If missing, reinitialize
|
|
2864
|
-
moai-adk init .
|
|
2865
|
-
|
|
2866
|
-
# 4. Restart Claude Code
|
|
2867
|
-
exit # Exit Claude Code
|
|
2868
|
-
claude # Restart
|
|
2869
|
-
```
|
|
2870
|
-
|
|
2871
|
-
**Verify**:
|
|
2872
|
-
```bash
|
|
2873
|
-
moai-adk doctor
|
|
2874
|
-
# All items should show ✅
|
|
2875
|
-
```
|
|
2876
|
-
|
|
2877
|
-
---
|
|
2878
|
-
|
|
2879
|
-
### 5. Module Not Found When Running Tests
|
|
2880
|
-
|
|
2881
|
-
**Symptom**:
|
|
2882
|
-
```
|
|
2883
|
-
FAILED tests/test_hello.py - ModuleNotFoundError: No module named 'fastapi'
|
|
2884
|
-
```
|
|
2885
|
-
|
|
2886
|
-
**Cause**: Required package not installed
|
|
2887
|
-
|
|
2888
|
-
**Solution**:
|
|
2889
|
-
|
|
2890
|
-
```bash
|
|
2891
|
-
# Install dependencies from project root
|
|
2892
|
-
uv sync
|
|
2893
|
-
|
|
2894
|
-
# Or install specific packages
|
|
2895
|
-
uv add fastapi pytest
|
|
2896
|
-
|
|
2897
|
-
# Activate virtual environment
|
|
2898
|
-
source .venv/bin/activate # macOS/Linux
|
|
2899
|
-
.venv\Scripts\activate # Windows
|
|
2900
|
-
|
|
2901
|
-
# Run tests
|
|
2902
|
-
pytest tests/ -v
|
|
2903
|
-
```
|
|
2904
|
-
|
|
2905
|
-
---
|
|
2906
|
-
|
|
2907
|
-
### 6. `/alfred` Commands Not Working
|
|
2908
|
-
|
|
2909
|
-
**Symptom**:
|
|
2910
|
-
```
|
|
2911
|
-
Unknown command: /alfred:1-plan
|
|
2912
|
-
```
|
|
2913
|
-
|
|
2914
|
-
**Cause**: Claude Code version issue or `.claude/` folder corrupted
|
|
2915
|
-
|
|
2916
|
-
**Solution**:
|
|
2917
|
-
|
|
2918
|
-
```bash
|
|
2919
|
-
# 1. Check Claude Code version (need v1.5.0+)
|
|
2920
|
-
claude --version
|
|
2921
|
-
|
|
2922
|
-
# 2. Verify .claude/ folder
|
|
2923
|
-
ls -la .claude/commands/
|
|
2924
|
-
|
|
2925
|
-
# 3. Reinitialize if needed
|
|
2926
|
-
moai-adk init .
|
|
2927
|
-
|
|
2928
|
-
# 4. Restart Claude Code
|
|
2929
|
-
exit
|
|
2930
|
-
claude
|
|
2931
|
-
```
|
|
2932
|
-
|
|
2933
|
-
---
|
|
2934
|
-
|
|
2935
|
-
### 7. TAG Chain Broken
|
|
2936
|
-
|
|
2937
|
-
**Symptom**:
|
|
2938
|
-
```
|
|
2939
|
-
⚠ Orphan TAG detected: @TEST:EX-HELLO-001 (no matching @SPEC)
|
|
2940
|
-
```
|
|
2941
|
-
|
|
2942
|
-
**Cause**: SPEC deleted or TAGs don't match
|
|
2943
|
-
|
|
2944
|
-
**Solution**:
|
|
2945
|
-
|
|
2946
|
-
```bash
|
|
2947
|
-
# 1. Validate TAG chain
|
|
2948
|
-
rg '@(SPEC|TEST|CODE):HELLO-001' -n
|
|
2949
|
-
|
|
2950
|
-
# 2. Check if SPEC exists
|
|
2951
|
-
rg '@SPEC:EX-HELLO-001' -n .moai/specs/
|
|
2952
|
-
|
|
2953
|
-
# 3. If SPEC missing, regenerate
|
|
2954
|
-
/alfred:1-plan "feature description"
|
|
2955
|
-
|
|
2956
|
-
# Or fix TAG in test file
|
|
2957
|
-
# Edit tests/test_hello.py: @TEST:EX-HELLO-001 → @TEST:README-EXAMPLE-HELLO
|
|
2958
|
-
|
|
2959
|
-
# 4. Sync
|
|
2960
|
-
/alfred:3-sync
|
|
2961
|
-
```
|
|
2962
|
-
|
|
2963
|
-
---
|
|
2964
|
-
|
|
2965
|
-
### 8. General Debugging Commands
|
|
2966
|
-
|
|
2967
|
-
**Check System Status**:
|
|
2968
|
-
```bash
|
|
2969
|
-
moai-adk doctor
|
|
2970
|
-
```
|
|
2971
|
-
Shows all dependency checks + recommendations
|
|
2972
|
-
|
|
2973
|
-
**Check Project Structure**:
|
|
2974
|
-
```bash
|
|
2975
|
-
tree -L 2 .moai/
|
|
2976
|
-
```
|
|
2977
|
-
|
|
2978
|
-
**Validate TAG Chain Integrity**:
|
|
2979
|
-
```bash
|
|
2980
|
-
rg '@(SPEC|TEST|CODE|DOC):' -n | wc -l
|
|
2981
|
-
```
|
|
2982
|
-
Shows total TAG count
|
|
2983
|
-
|
|
2984
|
-
**Check Git Status**:
|
|
2985
|
-
```bash
|
|
2986
|
-
git status
|
|
2987
|
-
git log --oneline -5
|
|
2988
|
-
```
|
|
2989
|
-
|
|
2990
|
-
---
|
|
2991
|
-
|
|
2992
|
-
### Debugging Checklist
|
|
2993
|
-
|
|
2994
|
-
When something goes wrong:
|
|
2995
|
-
|
|
2996
|
-
1. **Read**: Copy the complete error message
|
|
2997
|
-
2. **Search**: Check GitHub Issues for similar errors
|
|
2998
|
-
3. **Diagnose**: Run `moai-adk doctor`
|
|
2999
|
-
4. **Restart**: Quit and restart Claude Code
|
|
3000
|
-
5. **Ask**: Post in GitHub Discussions
|
|
3001
|
-
|
|
3002
|
-
Quick diagnosis with details:
|
|
3003
|
-
```bash
|
|
3004
|
-
moai-adk doctor --verbose
|
|
3005
|
-
```
|
|
3006
|
-
|
|
3007
|
-
---
|
|
3008
|
-
|
|
3009
|
-
### Need More Help?
|
|
3010
|
-
|
|
3011
|
-
- **GitHub Issues**: Search for similar problems
|
|
3012
|
-
- **GitHub Discussions**: Ask questions
|
|
3013
|
-
- **Discord Community**: Real-time chat support
|
|
3014
|
-
|
|
3015
|
-
**When reporting issues, include**:
|
|
3016
|
-
1. Output from `moai-adk doctor --verbose`
|
|
3017
|
-
2. Complete error message (screenshot or text)
|
|
3018
|
-
3. Steps to reproduce
|
|
3019
|
-
4. Your OS and version
|
|
3020
|
-
|
|
3021
|
-
---
|
|
3022
|
-
|
|
3023
|
-
### Frequently Asked Questions
|
|
3024
|
-
|
|
3025
|
-
**Q. Can I install on an existing project?**
|
|
3026
|
-
A. Yes! Run `moai-adk init .` - it only adds `.moai/` structure without touching existing code.
|
|
3027
|
-
|
|
3028
|
-
**Q. How do I run tests?**
|
|
3029
|
-
A. `/alfred:2-run` runs tests first. You can also run `pytest`, `pnpm test` separately.
|
|
3030
|
-
|
|
3031
|
-
**Q. How do I verify documentation is current?**
|
|
3032
|
-
A. Run `/alfred:3-sync` which generates a Sync Report. Check the PR to see the report.
|
|
3033
|
-
|
|
3034
|
-
**Q. Can I do this manually without Alfred?**
|
|
3035
|
-
A. Possible, but remember: SPEC → TEST → CODE → DOC order and keep @TAGs updated.
|
|
3036
|
-
|
|
3037
|
-
---
|
|
3038
|
-
|
|
3039
|
-
## Additional Resources
|
|
3040
|
-
|
|
3041
|
-
| Purpose | Resource |
|
|
3042
|
-
| ------------------------- | --------------------------------------------------------------- |
|
|
3043
|
-
| Skills detailed structure | `.claude/skills/` directory (74 Skills) |
|
|
3044
|
-
| Sub-agent details | `.claude/agents/alfred/` directory (16 agents + 4 commands) |
|
|
3045
|
-
| Workflow guide | `.claude/commands/alfred/` (4 commands: 0-project ~ 3-sync) |
|
|
3046
|
-
| Documentation | Coming soon (see `.moai/`, `.claude/`, `docs/` in your project) |
|
|
3047
|
-
| Release notes | GitHub Releases: https://github.com/modu-ai/moai-adk/releases |
|
|
3048
|
-
|
|
3049
|
-
---
|
|
3050
|
-
|
|
3051
|
-
## Community & Support
|
|
3052
|
-
|
|
3053
|
-
| Channel | Link |
|
|
3054
|
-
| ------------------------ | -------------------------------------------------------- |
|
|
3055
|
-
| **GitHub Repository** | https://github.com/modu-ai/moai-adk |
|
|
3056
|
-
| **Issues & Discussions** | https://github.com/modu-ai/moai-adk/issues |
|
|
3057
|
-
| **PyPI Package** | https://pypi.org/project/moai-adk/ |
|
|
3058
|
-
| **Latest Release** | https://github.com/modu-ai/moai-adk/releases |
|
|
3059
|
-
| **Documentation** | See `.moai/`, `.claude/`, `docs/` within project |
|
|
3060
|
-
|
|
3061
|
-
---
|
|
3062
|
-
|
|
3063
|
-
## 🚀 MoAI-ADK Philosophy
|
|
3064
|
-
|
|
3065
|
-
> **"No CODE without SPEC"**
|
|
3066
|
-
|
|
3067
|
-
MoAI-ADK is not simply a code generation tool. Alfred SuperAgent with its 19-member team and 55+ Claude Skills together guarantee:
|
|
3068
|
-
|
|
3069
|
-
- ✅ **SPEC → TEST (TDD) → CODE → DOCS consistency**
|
|
3070
|
-
- ✅ **Complete history tracking with @TAG system**
|
|
3071
|
-
- ✅ **Guaranteed 87.84%+ coverage**
|
|
3072
|
-
- ✅ **Iterative development with 4-stage workflow (0-project → 1-plan → 2-run → 3-sync)**
|
|
3073
|
-
- ✅ **Collaborate with AI transparently and traceably**
|
|
3074
|
-
|
|
3075
|
-
Start a new experience of **trustworthy AI development** with Alfred! 🤖
|
|
3076
|
-
|
|
3077
|
-
---
|
|
3078
|
-
|
|
3079
|
-
**MoAI-ADK** — SPEC-First TDD with AI SuperAgent & Complete Skills + TAG Guard
|
|
3080
|
-
|
|
3081
|
-
- 📦 PyPI: https://pypi.org/project/moai-adk/
|
|
3082
|
-
- 🏠 GitHub: https://github.com/modu-ai/moai-adk
|
|
3083
|
-
- 📝 License: MIT
|
|
3084
|
-
- ⭐ Skills: 55+ Production-Ready Guides
|
|
3085
|
-
- ✅ Tests: 467/476 Passing (85.60% coverage)
|
|
3086
|
-
- 🏷️ TAG Guard: Automatic @TAG validation in PreToolUse Hook
|
|
3087
|
-
|
|
3088
|
-
---
|
|
3089
|
-
|
|
3090
|
-
## ⭐ Star History
|
|
3091
|
-
|
|
3092
|
-
[](https://www.star-history.com/#modu-ai/moai-adk&Date)
|
|
3093
|
-
|
|
3094
|
-
---
|