moai-adk 0.35.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of moai-adk might be problematic. Click here for more details.
- moai_adk/__init__.py +10 -0
- moai_adk/__main__.py +199 -0
- moai_adk/cli/__init__.py +6 -0
- moai_adk/cli/commands/__init__.py +17 -0
- moai_adk/cli/commands/analyze.py +116 -0
- moai_adk/cli/commands/doctor.py +272 -0
- moai_adk/cli/commands/init.py +372 -0
- moai_adk/cli/commands/language.py +248 -0
- moai_adk/cli/commands/status.py +104 -0
- moai_adk/cli/commands/update.py +2686 -0
- moai_adk/cli/main.py +13 -0
- moai_adk/cli/prompts/__init__.py +5 -0
- moai_adk/cli/prompts/init_prompts.py +219 -0
- moai_adk/cli/spec_status.py +263 -0
- moai_adk/cli/ui/__init__.py +44 -0
- moai_adk/cli/ui/progress.py +422 -0
- moai_adk/cli/ui/prompts.py +389 -0
- moai_adk/cli/ui/theme.py +129 -0
- moai_adk/cli/worktree/__init__.py +27 -0
- moai_adk/cli/worktree/__main__.py +31 -0
- moai_adk/cli/worktree/cli.py +683 -0
- moai_adk/cli/worktree/exceptions.py +89 -0
- moai_adk/cli/worktree/manager.py +493 -0
- moai_adk/cli/worktree/models.py +65 -0
- moai_adk/cli/worktree/registry.py +422 -0
- moai_adk/core/PHASE2_OPTIMIZATIONS.md +467 -0
- moai_adk/core/__init__.py +1 -0
- moai_adk/core/analysis/__init__.py +9 -0
- moai_adk/core/analysis/session_analyzer.py +400 -0
- moai_adk/core/claude_integration.py +393 -0
- moai_adk/core/command_helpers.py +270 -0
- moai_adk/core/comprehensive_monitoring_system.py +1183 -0
- moai_adk/core/config/__init__.py +19 -0
- moai_adk/core/config/auto_spec_config.py +340 -0
- moai_adk/core/config/migration.py +244 -0
- moai_adk/core/config/unified.py +436 -0
- moai_adk/core/context_manager.py +273 -0
- moai_adk/core/diagnostics/__init__.py +19 -0
- moai_adk/core/diagnostics/slash_commands.py +159 -0
- moai_adk/core/enterprise_features.py +1404 -0
- moai_adk/core/error_recovery_system.py +1902 -0
- moai_adk/core/event_driven_hook_system.py +1371 -0
- moai_adk/core/git/__init__.py +31 -0
- moai_adk/core/git/branch.py +25 -0
- moai_adk/core/git/branch_manager.py +129 -0
- moai_adk/core/git/checkpoint.py +134 -0
- moai_adk/core/git/commit.py +67 -0
- moai_adk/core/git/conflict_detector.py +413 -0
- moai_adk/core/git/event_detector.py +79 -0
- moai_adk/core/git/manager.py +216 -0
- moai_adk/core/hooks/post_tool_auto_spec_completion.py +901 -0
- moai_adk/core/input_validation_middleware.py +1006 -0
- moai_adk/core/integration/__init__.py +22 -0
- moai_adk/core/integration/engine.py +157 -0
- moai_adk/core/integration/integration_tester.py +226 -0
- moai_adk/core/integration/models.py +88 -0
- moai_adk/core/integration/utils.py +211 -0
- moai_adk/core/issue_creator.py +305 -0
- moai_adk/core/jit_context_loader.py +956 -0
- moai_adk/core/jit_enhanced_hook_manager.py +1987 -0
- moai_adk/core/language_config.py +202 -0
- moai_adk/core/language_config_resolver.py +572 -0
- moai_adk/core/language_validator.py +543 -0
- moai_adk/core/mcp/setup.py +116 -0
- moai_adk/core/merge/__init__.py +9 -0
- moai_adk/core/merge/analyzer.py +605 -0
- moai_adk/core/migration/__init__.py +18 -0
- moai_adk/core/migration/alfred_to_moai_migrator.py +383 -0
- moai_adk/core/migration/backup_manager.py +277 -0
- moai_adk/core/migration/custom_element_scanner.py +358 -0
- moai_adk/core/migration/file_migrator.py +209 -0
- moai_adk/core/migration/interactive_checkbox_ui.py +488 -0
- moai_adk/core/migration/selective_restorer.py +470 -0
- moai_adk/core/migration/template_utils.py +74 -0
- moai_adk/core/migration/user_selection_ui.py +338 -0
- moai_adk/core/migration/version_detector.py +139 -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 +316 -0
- moai_adk/core/performance/parallel_processor.py +116 -0
- moai_adk/core/phase_optimized_hook_scheduler.py +879 -0
- moai_adk/core/project/__init__.py +1 -0
- moai_adk/core/project/backup_utils.py +70 -0
- moai_adk/core/project/checker.py +300 -0
- moai_adk/core/project/detector.py +293 -0
- moai_adk/core/project/initializer.py +387 -0
- moai_adk/core/project/phase_executor.py +716 -0
- moai_adk/core/project/validator.py +139 -0
- moai_adk/core/quality/__init__.py +6 -0
- moai_adk/core/quality/trust_checker.py +377 -0
- moai_adk/core/quality/validators/__init__.py +6 -0
- moai_adk/core/quality/validators/base_validator.py +19 -0
- moai_adk/core/realtime_monitoring_dashboard.py +1724 -0
- moai_adk/core/robust_json_parser.py +611 -0
- moai_adk/core/rollback_manager.py +918 -0
- moai_adk/core/session_manager.py +651 -0
- moai_adk/core/skill_loading_system.py +579 -0
- moai_adk/core/spec/confidence_scoring.py +680 -0
- moai_adk/core/spec/ears_template_engine.py +1247 -0
- moai_adk/core/spec/quality_validator.py +687 -0
- moai_adk/core/spec_status_manager.py +478 -0
- moai_adk/core/template/__init__.py +7 -0
- moai_adk/core/template/backup.py +174 -0
- moai_adk/core/template/config.py +191 -0
- moai_adk/core/template/languages.py +43 -0
- moai_adk/core/template/merger.py +233 -0
- moai_adk/core/template/processor.py +1200 -0
- moai_adk/core/template_engine.py +310 -0
- moai_adk/core/template_variable_synchronizer.py +417 -0
- moai_adk/core/unified_permission_manager.py +745 -0
- moai_adk/core/user_behavior_analytics.py +851 -0
- moai_adk/core/version_sync.py +429 -0
- moai_adk/foundation/__init__.py +56 -0
- moai_adk/foundation/backend.py +1027 -0
- moai_adk/foundation/database.py +1115 -0
- moai_adk/foundation/devops.py +1585 -0
- moai_adk/foundation/ears.py +431 -0
- moai_adk/foundation/frontend.py +870 -0
- moai_adk/foundation/git/commit_templates.py +557 -0
- moai_adk/foundation/git.py +376 -0
- moai_adk/foundation/langs.py +484 -0
- moai_adk/foundation/ml_ops.py +1162 -0
- moai_adk/foundation/testing.py +1524 -0
- moai_adk/foundation/trust/trust_principles.py +676 -0
- moai_adk/foundation/trust/validation_checklist.py +1573 -0
- moai_adk/project/__init__.py +0 -0
- moai_adk/project/configuration.py +1084 -0
- moai_adk/project/documentation.py +566 -0
- moai_adk/project/schema.py +447 -0
- moai_adk/statusline/__init__.py +38 -0
- moai_adk/statusline/alfred_detector.py +105 -0
- moai_adk/statusline/config.py +376 -0
- moai_adk/statusline/enhanced_output_style_detector.py +372 -0
- moai_adk/statusline/git_collector.py +190 -0
- moai_adk/statusline/main.py +322 -0
- moai_adk/statusline/metrics_tracker.py +78 -0
- moai_adk/statusline/renderer.py +343 -0
- moai_adk/statusline/update_checker.py +129 -0
- moai_adk/statusline/version_reader.py +741 -0
- moai_adk/templates/.claude/agents/moai/ai-nano-banana.md +714 -0
- moai_adk/templates/.claude/agents/moai/builder-agent.md +474 -0
- moai_adk/templates/.claude/agents/moai/builder-command.md +1172 -0
- moai_adk/templates/.claude/agents/moai/builder-plugin.md +637 -0
- moai_adk/templates/.claude/agents/moai/builder-skill.md +666 -0
- moai_adk/templates/.claude/agents/moai/expert-backend.md +899 -0
- moai_adk/templates/.claude/agents/moai/expert-database.md +777 -0
- moai_adk/templates/.claude/agents/moai/expert-debug.md +401 -0
- moai_adk/templates/.claude/agents/moai/expert-devops.md +720 -0
- moai_adk/templates/.claude/agents/moai/expert-frontend.md +734 -0
- moai_adk/templates/.claude/agents/moai/expert-performance.md +657 -0
- moai_adk/templates/.claude/agents/moai/expert-security.md +513 -0
- moai_adk/templates/.claude/agents/moai/expert-testing.md +733 -0
- moai_adk/templates/.claude/agents/moai/expert-uiux.md +1041 -0
- moai_adk/templates/.claude/agents/moai/manager-claude-code.md +432 -0
- moai_adk/templates/.claude/agents/moai/manager-docs.md +573 -0
- moai_adk/templates/.claude/agents/moai/manager-git.md +1060 -0
- moai_adk/templates/.claude/agents/moai/manager-project.md +891 -0
- moai_adk/templates/.claude/agents/moai/manager-quality.md +624 -0
- moai_adk/templates/.claude/agents/moai/manager-spec.md +809 -0
- moai_adk/templates/.claude/agents/moai/manager-strategy.md +780 -0
- moai_adk/templates/.claude/agents/moai/manager-tdd.md +784 -0
- moai_adk/templates/.claude/agents/moai/mcp-context7.md +458 -0
- moai_adk/templates/.claude/agents/moai/mcp-figma.md +1607 -0
- moai_adk/templates/.claude/agents/moai/mcp-notion.md +789 -0
- moai_adk/templates/.claude/agents/moai/mcp-playwright.md +469 -0
- moai_adk/templates/.claude/agents/moai/mcp-sequential-thinking.md +1032 -0
- moai_adk/templates/.claude/commands/moai/0-project.md +1386 -0
- moai_adk/templates/.claude/commands/moai/1-plan.md +1427 -0
- moai_adk/templates/.claude/commands/moai/2-run.md +943 -0
- moai_adk/templates/.claude/commands/moai/3-sync.md +1324 -0
- moai_adk/templates/.claude/commands/moai/9-feedback.md +314 -0
- moai_adk/templates/.claude/hooks/__init__.py +8 -0
- moai_adk/templates/.claude/hooks/moai/__init__.py +8 -0
- moai_adk/templates/.claude/hooks/moai/lib/__init__.py +85 -0
- moai_adk/templates/.claude/hooks/moai/lib/checkpoint.py +244 -0
- moai_adk/templates/.claude/hooks/moai/lib/common.py +131 -0
- moai_adk/templates/.claude/hooks/moai/lib/config_manager.py +446 -0
- moai_adk/templates/.claude/hooks/moai/lib/config_validator.py +639 -0
- moai_adk/templates/.claude/hooks/moai/lib/example_config.json +104 -0
- moai_adk/templates/.claude/hooks/moai/lib/git_operations_manager.py +590 -0
- moai_adk/templates/.claude/hooks/moai/lib/language_validator.py +317 -0
- moai_adk/templates/.claude/hooks/moai/lib/models.py +102 -0
- moai_adk/templates/.claude/hooks/moai/lib/path_utils.py +28 -0
- moai_adk/templates/.claude/hooks/moai/lib/project.py +768 -0
- moai_adk/templates/.claude/hooks/moai/lib/test_hooks_improvements.py +443 -0
- moai_adk/templates/.claude/hooks/moai/lib/timeout.py +160 -0
- moai_adk/templates/.claude/hooks/moai/lib/unified_timeout_manager.py +530 -0
- moai_adk/templates/.claude/hooks/moai/session_end__auto_cleanup.py +862 -0
- moai_adk/templates/.claude/hooks/moai/session_start__show_project_info.py +1083 -0
- moai_adk/templates/.claude/output-styles/moai/r2d2.md +560 -0
- moai_adk/templates/.claude/output-styles/moai/yoda.md +359 -0
- moai_adk/templates/.claude/settings.json +172 -0
- moai_adk/templates/.claude/skills/moai-ai-nano-banana/SKILL.md +307 -0
- moai_adk/templates/.claude/skills/moai-ai-nano-banana/examples.md +431 -0
- moai_adk/templates/.claude/skills/moai-ai-nano-banana/scripts/batch_generate.py +560 -0
- moai_adk/templates/.claude/skills/moai-ai-nano-banana/scripts/generate_image.py +362 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/SKILL.md +249 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/examples.md +406 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/modules/README.md +44 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/modules/api-documentation.md +130 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/modules/code-documentation.md +152 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/modules/multi-format-output.md +178 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/modules/user-guides.md +147 -0
- moai_adk/templates/.claude/skills/moai-docs-generation/reference.md +328 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +320 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +718 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +464 -0
- moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +323 -0
- moai_adk/templates/.claude/skills/moai-domain-database/examples.md +830 -0
- moai_adk/templates/.claude/skills/moai-domain-database/modules/README.md +53 -0
- moai_adk/templates/.claude/skills/moai-domain-database/modules/mongodb.md +231 -0
- moai_adk/templates/.claude/skills/moai-domain-database/modules/postgresql.md +169 -0
- moai_adk/templates/.claude/skills/moai-domain-database/modules/redis.md +262 -0
- moai_adk/templates/.claude/skills/moai-domain-database/reference.md +545 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +497 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +968 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +664 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/SKILL.md +455 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/examples.md +560 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/modules/accessibility-wcag.md +260 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/modules/component-architecture.md +228 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/modules/icon-libraries.md +401 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/modules/theming-system.md +373 -0
- moai_adk/templates/.claude/skills/moai-domain-uiux/reference.md +243 -0
- moai_adk/templates/.claude/skills/moai-formats-data/SKILL.md +492 -0
- moai_adk/templates/.claude/skills/moai-formats-data/examples.md +804 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/README.md +98 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/SKILL-MODULARIZATION-TEMPLATE.md +278 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/caching-performance.md +459 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/data-validation.md +485 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/json-optimization.md +374 -0
- moai_adk/templates/.claude/skills/moai-formats-data/modules/toon-encoding.md +308 -0
- moai_adk/templates/.claude/skills/moai-formats-data/reference.md +585 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/SKILL.md +202 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/examples.md +732 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/best-practices-checklist.md +616 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-custom-slash-commands-official.md +729 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-hooks-official.md +560 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-iam-official.md +635 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-memory-official.md +543 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-settings-official.md +663 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-skills-official.md +113 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/claude-code-sub-agents-official.md +238 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/complete-configuration-guide.md +175 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/skill-examples.md +1674 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/skill-formatting-guide.md +729 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-examples.md +1513 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-formatting-guide.md +1086 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference/sub-agents/sub-agent-integration-patterns.md +1100 -0
- moai_adk/templates/.claude/skills/moai-foundation-claude/reference.md +209 -0
- moai_adk/templates/.claude/skills/moai-foundation-context/SKILL.md +441 -0
- moai_adk/templates/.claude/skills/moai-foundation-context/examples.md +1048 -0
- moai_adk/templates/.claude/skills/moai-foundation-context/reference.md +246 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/SKILL.md +420 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/examples.md +358 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/README.md +296 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/agents-reference.md +359 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/commands-reference.md +432 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/delegation-patterns.md +757 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/execution-rules.md +687 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/modular-system.md +665 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/progressive-disclosure.md +649 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/spec-first-tdd.md +864 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/token-optimization.md +708 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/modules/trust-5-framework.md +981 -0
- moai_adk/templates/.claude/skills/moai-foundation-core/reference.md +478 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/SKILL.md +315 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/examples.md +228 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/modules/assumption-matrix.md +80 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/modules/cognitive-bias.md +199 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/modules/first-principles.md +140 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/modules/trade-off-analysis.md +154 -0
- moai_adk/templates/.claude/skills/moai-foundation-philosopher/reference.md +157 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/SKILL.md +364 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/examples.md +1232 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/modules/best-practices.md +261 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/modules/integration-patterns.md +194 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/modules/proactive-analysis.md +229 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/modules/trust5-validation.md +169 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/reference.md +1266 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/scripts/quality-gate.sh +668 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/templates/github-actions-quality.yml +481 -0
- moai_adk/templates/.claude/skills/moai-foundation-quality/templates/quality-config.yaml +519 -0
- moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +649 -0
- moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +478 -0
- moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +612 -0
- moai_adk/templates/.claude/skills/moai-lang-flutter/SKILL.md +477 -0
- moai_adk/templates/.claude/skills/moai-lang-flutter/examples.md +1090 -0
- moai_adk/templates/.claude/skills/moai-lang-flutter/reference.md +686 -0
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +376 -0
- moai_adk/templates/.claude/skills/moai-lang-go/examples.md +919 -0
- moai_adk/templates/.claude/skills/moai-lang-go/reference.md +737 -0
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +385 -0
- moai_adk/templates/.claude/skills/moai-lang-java/examples.md +864 -0
- moai_adk/templates/.claude/skills/moai-lang-java/reference.md +291 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +382 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +1006 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +562 -0
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +644 -0
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +481 -0
- moai_adk/templates/.claude/skills/moai-lang-python/examples.md +977 -0
- moai_adk/templates/.claude/skills/moai-lang-python/reference.md +804 -0
- moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +579 -0
- moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +687 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +372 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +659 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +504 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +497 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +633 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +423 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +497 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +918 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +672 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +368 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +1089 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +731 -0
- moai_adk/templates/.claude/skills/moai-library-mermaid/SKILL.md +300 -0
- moai_adk/templates/.claude/skills/moai-library-mermaid/advanced-patterns.md +465 -0
- moai_adk/templates/.claude/skills/moai-library-mermaid/examples.md +270 -0
- moai_adk/templates/.claude/skills/moai-library-mermaid/optimization.md +440 -0
- moai_adk/templates/.claude/skills/moai-library-mermaid/reference.md +228 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/SKILL.md +319 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/advanced-patterns.md +336 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/examples.md +592 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/advanced-deployment-patterns.md +182 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/advanced-patterns.md +17 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/configuration.md +57 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/content-architecture-optimization.md +162 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/deployment.md +52 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/framework-core-configuration.md +186 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/i18n-setup.md +55 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/modules/mdx-components.md +52 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/optimization.md +303 -0
- moai_adk/templates/.claude/skills/moai-library-nextra/reference.md +379 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/SKILL.md +372 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/examples.md +575 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/modules/advanced-patterns.md +394 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/modules/optimization.md +278 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/modules/shadcn-components.md +457 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/modules/shadcn-theming.md +373 -0
- moai_adk/templates/.claude/skills/moai-library-shadcn/reference.md +74 -0
- moai_adk/templates/.claude/skills/moai-mcp-figma/SKILL.md +402 -0
- moai_adk/templates/.claude/skills/moai-mcp-figma/advanced-patterns.md +607 -0
- moai_adk/templates/.claude/skills/moai-mcp-notion/SKILL.md +300 -0
- moai_adk/templates/.claude/skills/moai-mcp-notion/advanced-patterns.md +537 -0
- moai_adk/templates/.claude/skills/moai-platform-auth0/SKILL.md +291 -0
- moai_adk/templates/.claude/skills/moai-platform-clerk/SKILL.md +390 -0
- moai_adk/templates/.claude/skills/moai-platform-convex/SKILL.md +398 -0
- moai_adk/templates/.claude/skills/moai-platform-firebase-auth/SKILL.md +379 -0
- moai_adk/templates/.claude/skills/moai-platform-firestore/SKILL.md +358 -0
- moai_adk/templates/.claude/skills/moai-platform-neon/SKILL.md +467 -0
- moai_adk/templates/.claude/skills/moai-platform-railway/SKILL.md +377 -0
- moai_adk/templates/.claude/skills/moai-platform-supabase/SKILL.md +466 -0
- moai_adk/templates/.claude/skills/moai-platform-vercel/SKILL.md +482 -0
- moai_adk/templates/.claude/skills/moai-plugin-builder/SKILL.md +474 -0
- moai_adk/templates/.claude/skills/moai-plugin-builder/examples.md +621 -0
- moai_adk/templates/.claude/skills/moai-plugin-builder/migration.md +341 -0
- moai_adk/templates/.claude/skills/moai-plugin-builder/reference.md +463 -0
- moai_adk/templates/.claude/skills/moai-plugin-builder/validation.md +373 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/SKILL.md +275 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/adaptive-mfa.md +233 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/akamai-integration.md +215 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/application-credentials.md +280 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/attack-protection-log-events.md +225 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/attack-protection-overview.md +140 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/bot-detection.md +144 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/breached-password-detection.md +187 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/brute-force-protection.md +189 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/certifications.md +282 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/compliance-overview.md +263 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/continuous-session-protection.md +307 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/customize-mfa.md +178 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/dpop-implementation.md +283 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/fapi-implementation.md +259 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/gdpr-compliance.md +313 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/guardian-configuration.md +269 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/highly-regulated-identity.md +272 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/jwt-fundamentals.md +248 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/mdl-verification.md +211 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/mfa-api-management.md +278 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/mfa-factors.md +226 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/mfa-overview.md +174 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/mtls-sender-constraining.md +316 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/ropg-flow-mfa.md +217 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/security-center.md +325 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/security-guidance.md +277 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/state-parameters.md +178 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/step-up-authentication.md +251 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/suspicious-ip-throttling.md +240 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/tenant-access-control.md +180 -0
- moai_adk/templates/.claude/skills/moai-security-auth0/modules/webauthn-fido.md +235 -0
- moai_adk/templates/.claude/skills/moai-workflow-jit-docs/SKILL.md +449 -0
- moai_adk/templates/.claude/skills/moai-workflow-jit-docs/advanced-patterns.md +379 -0
- moai_adk/templates/.claude/skills/moai-workflow-jit-docs/examples.md +544 -0
- moai_adk/templates/.claude/skills/moai-workflow-jit-docs/optimization.md +286 -0
- moai_adk/templates/.claude/skills/moai-workflow-jit-docs/reference.md +307 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/README.md +190 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/SKILL.md +390 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/__init__.py +520 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/complete_workflow_demo_fixed.py +574 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples/complete_project_setup.py +317 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples/complete_workflow_demo.py +663 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples/config-migration-example.json +190 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples/question-examples.json +175 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples/quick_start.py +196 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/examples.md +547 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/__init__.py +17 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/advanced-patterns.md +158 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/ask_user_integration.py +340 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/batch_questions.py +713 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/config_manager.py +538 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/documentation_manager.py +1336 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/language_initializer.py +730 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/migration_manager.py +608 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/modules/template_optimizer.py +1005 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/reference.md +275 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/schemas/config-schema.json +316 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/schemas/tab_schema.json +1434 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/config-template.json +71 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/product-template.md +44 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/structure-template.md +48 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/doc-templates/tech-template.md +92 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/config-manager-setup.json +109 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/language-initializer.json +228 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/menu-project-config.json +130 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/project-batch-questions.json +97 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/templates/question-templates/spec-workflow-setup.json +150 -0
- moai_adk/templates/.claude/skills/moai-workflow-project/test_integration_simple.py +436 -0
- moai_adk/templates/.claude/skills/moai-workflow-spec/SKILL.md +534 -0
- moai_adk/templates/.claude/skills/moai-workflow-spec/examples.md +900 -0
- moai_adk/templates/.claude/skills/moai-workflow-spec/reference.md +704 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/SKILL.md +377 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/examples.md +552 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/modules/code-templates.md +124 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/modules/feedback-templates.md +100 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/modules/template-optimizer.md +138 -0
- moai_adk/templates/.claude/skills/moai-workflow-templates/reference.md +346 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/LICENSE.txt +202 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/SKILL.md +456 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/advanced-patterns.md +576 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/examples/ai-powered-testing.py +294 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/examples/console_logging.py +35 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/examples/element_discovery.py +40 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/examples/static_html_automation.py +34 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/examples.md +672 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/README.md +220 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/ai-debugging.md +845 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/automated-code-review.md +1416 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/performance-optimization.md +1234 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/smart-refactoring.md +1243 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/modules/tdd-context7.md +1260 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/optimization.md +505 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/reference/playwright-best-practices.md +57 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/reference.md +440 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/scripts/with_server.py +218 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/templates/alfred-integration.md +376 -0
- moai_adk/templates/.claude/skills/moai-workflow-testing/workflows/enterprise-testing-workflow.py +571 -0
- moai_adk/templates/.claude/skills/moai-worktree/SKILL.md +411 -0
- moai_adk/templates/.claude/skills/moai-worktree/examples.md +606 -0
- moai_adk/templates/.claude/skills/moai-worktree/modules/integration-patterns.md +982 -0
- moai_adk/templates/.claude/skills/moai-worktree/modules/parallel-development.md +778 -0
- moai_adk/templates/.claude/skills/moai-worktree/modules/worktree-commands.md +646 -0
- moai_adk/templates/.claude/skills/moai-worktree/modules/worktree-management.md +782 -0
- moai_adk/templates/.claude/skills/moai-worktree/reference.md +357 -0
- moai_adk/templates/.git-hooks/pre-commit +128 -0
- moai_adk/templates/.git-hooks/pre-push +365 -0
- moai_adk/templates/.github/workflows/ci-universal.yml +513 -0
- moai_adk/templates/.github/workflows/security-secrets-check.yml +179 -0
- moai_adk/templates/.github/workflows/spec-issue-sync.yml +337 -0
- moai_adk/templates/.gitignore +222 -0
- moai_adk/templates/.mcp.json +13 -0
- moai_adk/templates/.moai/config/config.yaml +58 -0
- moai_adk/templates/.moai/config/questions/_schema.yaml +174 -0
- moai_adk/templates/.moai/config/questions/tab0-init.yaml +251 -0
- moai_adk/templates/.moai/config/questions/tab1-user.yaml +107 -0
- moai_adk/templates/.moai/config/questions/tab2-project.yaml +79 -0
- moai_adk/templates/.moai/config/questions/tab3-git.yaml +632 -0
- moai_adk/templates/.moai/config/questions/tab4-quality.yaml +182 -0
- moai_adk/templates/.moai/config/questions/tab5-system.yaml +96 -0
- moai_adk/templates/.moai/config/sections/git-strategy.yaml +116 -0
- moai_adk/templates/.moai/config/sections/language.yaml +11 -0
- moai_adk/templates/.moai/config/sections/project.yaml +13 -0
- moai_adk/templates/.moai/config/sections/quality.yaml +17 -0
- moai_adk/templates/.moai/config/sections/system.yaml +24 -0
- moai_adk/templates/.moai/config/sections/user.yaml +5 -0
- moai_adk/templates/.moai/config/statusline-config.yaml +92 -0
- moai_adk/templates/.moai/scripts/setup-glm.py +136 -0
- moai_adk/templates/CLAUDE.md +642 -0
- moai_adk/utils/__init__.py +30 -0
- moai_adk/utils/banner.py +38 -0
- moai_adk/utils/common.py +294 -0
- moai_adk/utils/link_validator.py +241 -0
- moai_adk/utils/logger.py +147 -0
- moai_adk/utils/safe_file_reader.py +206 -0
- moai_adk/utils/timeout.py +160 -0
- moai_adk/utils/toon_utils.py +256 -0
- moai_adk/version.py +22 -0
- moai_adk-0.35.1.dist-info/METADATA +3018 -0
- moai_adk-0.35.1.dist-info/RECORD +502 -0
- moai_adk-0.35.1.dist-info/WHEEL +4 -0
- moai_adk-0.35.1.dist-info/entry_points.txt +3 -0
- moai_adk-0.35.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,1324 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: moai:3-sync
|
|
3
|
+
description: "Synchronize documentation with Phase 0.5 quality verification and finalize PR"
|
|
4
|
+
argument-hint: "Mode target path - Mode: auto (default)|force|status|project, target path: Synchronization target path"
|
|
5
|
+
allowed-tools: Task, AskUserQuestion, TodoWrite
|
|
6
|
+
model: inherit
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Pre-execution Context
|
|
10
|
+
|
|
11
|
+
!git status --porcelain
|
|
12
|
+
!git diff --name-only HEAD
|
|
13
|
+
!git branch --show-current
|
|
14
|
+
!git log --oneline -10
|
|
15
|
+
!find .moai/specs -name "spec.md" -type f 2>/dev/null
|
|
16
|
+
|
|
17
|
+
## Essential Files
|
|
18
|
+
|
|
19
|
+
@.moai/config/config.yaml
|
|
20
|
+
@.moai/specs/
|
|
21
|
+
@README.md
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# MoAI-ADK Step 3: Document Synchronization (+Optional PR Ready)
|
|
26
|
+
|
|
27
|
+
User Interaction Architecture: AskUserQuestion must be used at COMMAND level only. Subagents via Task() are stateless and cannot interact with users. Collect all approvals BEFORE delegating to agents.
|
|
28
|
+
|
|
29
|
+
Batched Design: All AskUserQuestion calls follow batched design principles (1-4 questions per call, max 4 options per question). See CLAUDE.md section "User Interaction Architecture" for details.
|
|
30
|
+
|
|
31
|
+
4-Step Workflow Integration: This command implements Step 4 of Alfred's workflow (Report & Commit with conditional report generation). See CLAUDE.md for full workflow details.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Command Purpose
|
|
36
|
+
|
|
37
|
+
[HARD] This command orchestrates ONLY - delegates all sync work to manager-docs agent
|
|
38
|
+
|
|
39
|
+
Document sync target: $ARGUMENTS
|
|
40
|
+
|
|
41
|
+
Agent Delegation Pattern:
|
|
42
|
+
|
|
43
|
+
Correct Approach [HARD]:
|
|
44
|
+
- Invoke Task() with subagent_type="manager-docs"
|
|
45
|
+
- Pass complete context including changed files and verification results
|
|
46
|
+
- Let manager-docs agent determine implementation strategy
|
|
47
|
+
- WHY: Specialized agent has domain expertise and handles all complexity
|
|
48
|
+
|
|
49
|
+
Forbidden Approach:
|
|
50
|
+
- Direct file manipulation using Edit, Write, Read tools
|
|
51
|
+
- Direct bash execution of document updates
|
|
52
|
+
- WHY: Bypasses quality controls and loses context-specific error handling
|
|
53
|
+
|
|
54
|
+
Standard Workflow Sequence:
|
|
55
|
+
Step 1 (Analysis & Planning) leads to Step 2 (Document Sync via Agent) leads to Step 3 (Git Commit & PR)
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Execution Modes
|
|
60
|
+
|
|
61
|
+
This command supports 4 operational modes:
|
|
62
|
+
|
|
63
|
+
| Mode | Scope | PR Processing | Use Case |
|
|
64
|
+
| ------------------ | ----------------------- | --------------------- | ----------------------------------- |
|
|
65
|
+
| auto (default) | Smart selective sync | PR Ready conversion | Daily development workflow |
|
|
66
|
+
| force | Full project re-sync | Full regeneration | Error recovery, major refactoring |
|
|
67
|
+
| status | Status check only | Report only | Quick health check |
|
|
68
|
+
| project | Integrated project-wide | Project-level updates | Milestone completion, periodic sync |
|
|
69
|
+
|
|
70
|
+
Command usage examples:
|
|
71
|
+
|
|
72
|
+
- `/moai:3-sync` → Auto-sync (PR Ready only)
|
|
73
|
+
- `/moai:3-sync --auto-merge` → PR auto-merge + branch cleanup
|
|
74
|
+
- `/moai:3-sync force` → Force full synchronization
|
|
75
|
+
- `/moai:3-sync status` → Check synchronization status
|
|
76
|
+
- `/moai:3-sync project` → Integrated project synchronization
|
|
77
|
+
- `/moai:3-sync auto src/auth/` → Specific path synchronization
|
|
78
|
+
- `/moai:3-sync --worktree` → Sync in worktree mode (with worktree exit options)
|
|
79
|
+
- `/moai:3-sync --branch` → Sync in branch mode (with branch management options)
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Associated Agents
|
|
84
|
+
|
|
85
|
+
| Agent | Purpose |
|
|
86
|
+
| --------------- | ----------------------------------------------- |
|
|
87
|
+
| manager-docs | Synchronize Living Documents with code changes |
|
|
88
|
+
| manager-quality | Verify project integrity and TRUST 5 compliance |
|
|
89
|
+
| manager-git | Handle Git operations and commit management |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Agent Invocation Patterns (CLAUDE.md Compliance)
|
|
94
|
+
|
|
95
|
+
This command uses agent execution patterns defined in CLAUDE.md (lines 96-120).
|
|
96
|
+
|
|
97
|
+
### Sequential Phase-Based Chaining PASS
|
|
98
|
+
|
|
99
|
+
Command implements sequential chaining through 3 core phases:
|
|
100
|
+
|
|
101
|
+
Phase Flow:
|
|
102
|
+
- Phase 1: Analysis & Planning (manager-docs analyzes changed files and sync scope)
|
|
103
|
+
- Phase 2: Execute Sync (manager-docs updates documentation, manager-quality validates)
|
|
104
|
+
- Phase 3: Git Operations & PR (manager-git creates commits and prepares PR if applicable)
|
|
105
|
+
|
|
106
|
+
Each phase receives outputs from previous phases as context.
|
|
107
|
+
|
|
108
|
+
WHY: Sequential execution ensures documentation consistency and validation
|
|
109
|
+
- Phase 2 requires analysis results from Phase 1 to determine sync scope
|
|
110
|
+
- Phase 3 requires validated documentation from Phase 2 before commit
|
|
111
|
+
- PR creation requires successful commit from Phase 3
|
|
112
|
+
|
|
113
|
+
IMPACT: Skipping phases would create inconsistent documentation or invalid commits
|
|
114
|
+
|
|
115
|
+
### Parallel Execution WARNING
|
|
116
|
+
|
|
117
|
+
Limited parallel execution within Phase 2 for independent documentation files
|
|
118
|
+
|
|
119
|
+
WHY: Some documentation files can be generated simultaneously
|
|
120
|
+
- Multiple markdown files without cross-references can be updated in parallel
|
|
121
|
+
- Index updates and validation must remain sequential
|
|
122
|
+
|
|
123
|
+
IMPACT: Full parallel execution would risk broken cross-references and index inconsistencies
|
|
124
|
+
|
|
125
|
+
### Resumable Agent Support FAIL
|
|
126
|
+
|
|
127
|
+
Not applicable - command typically completes quickly in single execution
|
|
128
|
+
|
|
129
|
+
WHY: Documentation sync is fast operation (usually under 2 minutes)
|
|
130
|
+
- Most sync operations complete in first attempt
|
|
131
|
+
- File system operations are atomic and recoverable
|
|
132
|
+
- No long-running processes requiring checkpoints
|
|
133
|
+
|
|
134
|
+
IMPACT: Resume pattern unnecessary for typical sync workflows
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
Refer to CLAUDE.md "Agent Chaining Patterns" (lines 96-120) for complete pattern architecture.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Execution Philosophy: "Sync → Verify → Commit"
|
|
143
|
+
|
|
144
|
+
`/moai:3-sync` performs documentation synchronization through complete agent delegation:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
User Command: /moai:3-sync [mode] [path]
|
|
148
|
+
↓
|
|
149
|
+
/moai:3-sync Command
|
|
150
|
+
└─ Task(subagent_type="manager-docs" or "manager-quality" or "manager-git")
|
|
151
|
+
├─ Phase 1: Analysis & Planning (manager-docs)
|
|
152
|
+
├─ Phase 2: Execute Sync (manager-docs + manager-quality)
|
|
153
|
+
└─ Phase 3: Git Operations & PR (manager-git)
|
|
154
|
+
↓
|
|
155
|
+
Output: Synchronized docs + commit + PR Ready (conditional)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Key Principle: Zero Direct Tool Usage
|
|
159
|
+
|
|
160
|
+
[HARD] This command uses ONLY Task(), AskUserQuestion(), and TodoWrite():
|
|
161
|
+
|
|
162
|
+
Permitted Tools:
|
|
163
|
+
- Task() for orchestration [HARD]
|
|
164
|
+
- AskUserQuestion() for user interaction AT COMMAND LEVEL ONLY [HARD]
|
|
165
|
+
- WHY: Subagents via Task() are stateless and cannot interact with users
|
|
166
|
+
- CORRECT: Collect approvals before Task() calls, pass choices as parameters
|
|
167
|
+
- TodoWrite() for progress tracking [HARD]
|
|
168
|
+
|
|
169
|
+
Forbidden Tools (All delegated to agents):
|
|
170
|
+
- Read (delegated) - All file reading operations must be performed by specialized agents
|
|
171
|
+
- Write (delegated) - All file writing operations must be performed by specialized agents
|
|
172
|
+
- Edit (delegated) - All file editing operations must be performed by specialized agents
|
|
173
|
+
- Bash (delegated) - All bash execution must be performed by specialized agents
|
|
174
|
+
|
|
175
|
+
WHY: Zero direct tool usage maintains clean separation of concerns. Each tool type has a specialized agent that understands context-specific requirements.
|
|
176
|
+
|
|
177
|
+
IMPACT: Direct tool usage would bypass quality controls, specialized agent expertise, and error recovery mechanisms. Delegation ensures consistent execution patterns.
|
|
178
|
+
|
|
179
|
+
All complexity is handled by specialized agents (manager-docs, manager-quality, manager-git).
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Output Format
|
|
186
|
+
|
|
187
|
+
All command execution outputs must use semantic XML sections for clarity and consistency:
|
|
188
|
+
|
|
189
|
+
XML Structure Format:
|
|
190
|
+
```
|
|
191
|
+
<analysis>Detailed assessment of project state, identified changes, and validation results</analysis>
|
|
192
|
+
<plan>Synchronization strategy including scope, affected documents, and approach rationale</plan>
|
|
193
|
+
<execution>Concrete actions taken: files updated, reports generated, status changes recorded</execution>
|
|
194
|
+
<verification>Quality validation results: TRUST 5 compliance, link integrity, consistency checks</verification>
|
|
195
|
+
<completion>Summary of outcomes, generated reports locations, and next steps for user</completion>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Required Elements:
|
|
199
|
+
- Analysis must detail all findings from project validation and Git analysis
|
|
200
|
+
- Plan must explain strategy choice including WHY and IMPACT of decisions
|
|
201
|
+
- Execution must track all agent actions and file modifications
|
|
202
|
+
- Verification must report all quality gates and their outcomes
|
|
203
|
+
- Completion must guide user toward next meaningful action
|
|
204
|
+
|
|
205
|
+
WHY: XML sections provide machine-parseable structure and enable audit trails. Clear sections ensure user can understand command progress at any point.
|
|
206
|
+
|
|
207
|
+
IMPACT: Unstructured output reduces comprehension and prevents automated processing of results.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## OVERALL WORKFLOW STRUCTURE
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
┌──────────────────────────────────────────────────────────┐
|
|
215
|
+
│ PHASE 1: Analysis & Planning (tag-agent + manager-docs)│
|
|
216
|
+
│ - Verify prerequisites │
|
|
217
|
+
│ - Analyze project status (Git + SPEC) │
|
|
218
|
+
│ - Execute quality verification (Phase 0.5) │
|
|
219
|
+
│ - Request user approval │
|
|
220
|
+
└──────────────────────────────────────────────────────────┘
|
|
221
|
+
↓
|
|
222
|
+
┌───────────────┴───────────────┐
|
|
223
|
+
│ │
|
|
224
|
+
User approves User aborts
|
|
225
|
+
│ │
|
|
226
|
+
↓ ↓
|
|
227
|
+
┌─────────────────────────┐ ┌──────────────────────┐
|
|
228
|
+
│ PHASE 2: Execute Sync │ │ PHASE 4: Graceful │
|
|
229
|
+
│ (manager-docs+quality) │ │ Exit (no changes) │
|
|
230
|
+
│ - Create backup │ └──────────────────────┘
|
|
231
|
+
│ - Sync documents │
|
|
232
|
+
│ - Verify SPECs │
|
|
233
|
+
└─────────────────────────┘
|
|
234
|
+
↓
|
|
235
|
+
┌──────────────────────────────────────────────────────────┐
|
|
236
|
+
│ PHASE 3: Git Operations & PR (manager-git) │
|
|
237
|
+
│ - Commit document changes │
|
|
238
|
+
│ - Transition PR (Team mode) │
|
|
239
|
+
│ - Auto-merge (if requested) │
|
|
240
|
+
│ - Branch cleanup │
|
|
241
|
+
│ - Next steps guidance │
|
|
242
|
+
└──────────────────────────────────────────────────────────┘
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## PHASE 1: Analysis & Planning
|
|
248
|
+
|
|
249
|
+
Goal: Gather project context, verify project status, and get user approval.
|
|
250
|
+
|
|
251
|
+
### Step 1.1: Verify Prerequisites & Load Skills
|
|
252
|
+
|
|
253
|
+
Execute these verification steps:
|
|
254
|
+
|
|
255
|
+
1. [HARD] TUI System Must Be Ready:
|
|
256
|
+
|
|
257
|
+
Requirement: Interactive menus must be available for all user interactions
|
|
258
|
+
WHY: User interaction requires responsive feedback mechanism
|
|
259
|
+
IMPACT: Missing TUI will cause command to fail during user approval phase
|
|
260
|
+
|
|
261
|
+
2. [HARD] MoAI-ADK Structure Must Exist:
|
|
262
|
+
|
|
263
|
+
Requirement: `.moai/` directory must exist in project root
|
|
264
|
+
Requirement: `.claude/` directory must exist in project root
|
|
265
|
+
Failure Action: Print error message with missing directory details and exit immediately
|
|
266
|
+
WHY: These directories contain essential project metadata and configuration
|
|
267
|
+
IMPACT: Missing directories indicates incomplete project initialization
|
|
268
|
+
|
|
269
|
+
3. [HARD] Git Repository Must Be Initialized:
|
|
270
|
+
|
|
271
|
+
Requirement: Project must be inside a Git repository
|
|
272
|
+
Verification: Execute `git rev-parse --is-inside-work-tree` and verify output is "true"
|
|
273
|
+
Failure Action: Print error message and exit immediately
|
|
274
|
+
WHY: Document synchronization requires Git history and commit operations
|
|
275
|
+
IMPACT: Non-Git projects cannot track documentation changes or create commits
|
|
276
|
+
|
|
277
|
+
4. [SOFT] Python Environment Should Be Available:
|
|
278
|
+
|
|
279
|
+
Requirement: Python 3 should be installed and accessible
|
|
280
|
+
Verification: Execute `which python3` and verify command succeeds
|
|
281
|
+
Failure Action: Print warning message but continue with reduced functionality
|
|
282
|
+
WHY: Python environment enables advanced automation and validation
|
|
283
|
+
IMPACT: Missing Python limits automation but does not prevent basic sync operations
|
|
284
|
+
|
|
285
|
+
Result: All hard prerequisites verified. All soft requirements checked. Command may proceed to next step.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
### Step 1.2: Analyze Project Status
|
|
290
|
+
|
|
291
|
+
Gather context for synchronization planning:
|
|
292
|
+
|
|
293
|
+
1. [HARD] Analyze Git Changes:
|
|
294
|
+
|
|
295
|
+
Requirement: Determine all files that have changed since last commit
|
|
296
|
+
Actions:
|
|
297
|
+
- Execute: `git status --porcelain` to identify modified files
|
|
298
|
+
- Execute: `git diff --name-only HEAD` to list changed file paths
|
|
299
|
+
- Categorize: Count Python files, test files, documents, SPEC files separately
|
|
300
|
+
WHY: Git state determines synchronization scope and impact analysis
|
|
301
|
+
IMPACT: Incomplete Git analysis leads to partial synchronization
|
|
302
|
+
|
|
303
|
+
2. [HARD] Read Project Configuration:
|
|
304
|
+
|
|
305
|
+
Requirement: Load essential project settings from configuration file
|
|
306
|
+
Actions:
|
|
307
|
+
- Read: `.moai/config.yaml` file
|
|
308
|
+
- Extract: `git_strategy.mode` value (must be Personal or Team)
|
|
309
|
+
- Extract: `language.conversation_language` value (determines document language)
|
|
310
|
+
- Extract: `git_strategy.spec_git_workflow` value
|
|
311
|
+
WHY: Configuration drives workflow behavior and language output
|
|
312
|
+
IMPACT: Missing configuration values cause workflow misalignment and language errors
|
|
313
|
+
|
|
314
|
+
3. [HARD] Determine Synchronization Mode:
|
|
315
|
+
|
|
316
|
+
Requirement: Parse arguments to establish execution mode
|
|
317
|
+
Actions:
|
|
318
|
+
- Parse $ARGUMENTS for mode value: must be one of auto, force, status, or project
|
|
319
|
+
- If empty: Default to auto mode
|
|
320
|
+
- Parse optional flags: --auto-merge, --skip-pre-check, --skip-quality-check
|
|
321
|
+
- Parse special flags: --worktree, --branch
|
|
322
|
+
WHY: Mode determines scope and processing strategy
|
|
323
|
+
IMPACT: Invalid mode selection produces incorrect synchronization behavior
|
|
324
|
+
|
|
325
|
+
4. [SOFT] Handle Worktree Detection:
|
|
326
|
+
|
|
327
|
+
Requirement: Identify if execution occurs within a Git worktree
|
|
328
|
+
Actions:
|
|
329
|
+
- Execute: `git rev-parse --git-dir` to locate git directory
|
|
330
|
+
- Analyze: Check if git directory path contains `worktrees/` component
|
|
331
|
+
- If in worktree: Extract SPEC ID from current path (format: SPEC-{DOMAIN}-{NUMBER})
|
|
332
|
+
- Alternative: Check worktree registry at `~/worktrees/{PROJECT_NAME}/.moai-worktree-registry.json`
|
|
333
|
+
- Store: `$WORKTREE_MODE=true` and `$CURRENT_SPEC_ID` for later use
|
|
334
|
+
WHY: Worktree context enables specialized cleanup and workflow options
|
|
335
|
+
IMPACT: Missing worktree detection prevents proper exit handling but does not block sync
|
|
336
|
+
|
|
337
|
+
5. [SOFT] Handle Branch Detection:
|
|
338
|
+
|
|
339
|
+
Requirement: Identify if execution occurs on feature branch
|
|
340
|
+
Actions:
|
|
341
|
+
- Check: Is --branch flag present in arguments OR is current branch not main
|
|
342
|
+
- Execute: `git branch --show-current` to get current branch name
|
|
343
|
+
- Store: `$BRANCH_MODE=true` and `$CURRENT_BRANCH` for later use
|
|
344
|
+
WHY: Branch context enables proper merge and cleanup operations
|
|
345
|
+
IMPACT: Missing branch detection reduces workflow automation but does not prevent sync
|
|
346
|
+
|
|
347
|
+
6. [HARD] Handle Status Mode Early Exit:
|
|
348
|
+
|
|
349
|
+
Requirement: For status mode, provide quick health report and exit
|
|
350
|
+
Actions:
|
|
351
|
+
- Check: If mode is status value
|
|
352
|
+
- Report: Current project health assessment
|
|
353
|
+
- Report: Count of changed files
|
|
354
|
+
- Report: Synchronization recommendation
|
|
355
|
+
- If status mode: Execute Phase 0.5 quality verification before reporting
|
|
356
|
+
- Exit: Command completes with success code (no further phases)
|
|
357
|
+
WHY: Status mode serves quick health check without making changes, but still validates project quality
|
|
358
|
+
IMPACT: Skipping quality check in status mode reduces visibility of project health
|
|
359
|
+
|
|
360
|
+
Result: Project context gathered. Synchronization mode established. Ready for quality verification (Phase 0.5).
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
### Step 1.2.5: Phase 0.5 Quality Verification
|
|
365
|
+
|
|
366
|
+
[HARD] Execute quality verification pipeline before document synchronization begins.
|
|
367
|
+
|
|
368
|
+
WHY: Quality checks prevent synchronizing broken states. Early validation catches issues before expensive document updates.
|
|
369
|
+
IMPACT: Skipping quality checks risks propagating issues to documentation.
|
|
370
|
+
|
|
371
|
+
Quality Verification Pipeline:
|
|
372
|
+
|
|
373
|
+
This phase automatically detects the project language and runs appropriate quality tools:
|
|
374
|
+
|
|
375
|
+
```
|
|
376
|
+
Detect Project Language
|
|
377
|
+
↓
|
|
378
|
+
Language-specific tool execution
|
|
379
|
+
├── Test Runner (pytest/jest/go test/cargo test/etc.)
|
|
380
|
+
├── Linter (ruff/eslint/golangci-lint/clippy/etc.)
|
|
381
|
+
└── Type Checker (mypy/tsc/go vet/etc.)
|
|
382
|
+
↓
|
|
383
|
+
code-review invocation (manager-quality)
|
|
384
|
+
↓
|
|
385
|
+
Quality Report
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
#### Task 1.2.5.1: Detect Project Language
|
|
391
|
+
|
|
392
|
+
Automatically detect the primary project language by checking indicator files:
|
|
393
|
+
|
|
394
|
+
Language Detection Rules (check in order, first match wins):
|
|
395
|
+
|
|
396
|
+
1. Python Detection:
|
|
397
|
+
- Indicator files: pyproject.toml, setup.py, requirements.txt, .python-version, Pipfile
|
|
398
|
+
- IF found: Store PROJECT_LANGUAGE as python
|
|
399
|
+
|
|
400
|
+
2. TypeScript/JavaScript Detection:
|
|
401
|
+
- Indicator files: tsconfig.json, package.json (with typescript dependency), .nvmrc
|
|
402
|
+
- IF tsconfig.json exists: Store PROJECT_LANGUAGE as typescript
|
|
403
|
+
- IF package.json exists without tsconfig: Store PROJECT_LANGUAGE as javascript
|
|
404
|
+
|
|
405
|
+
3. Go Detection:
|
|
406
|
+
- Indicator files: go.mod, go.sum
|
|
407
|
+
- IF found: Store PROJECT_LANGUAGE as go
|
|
408
|
+
|
|
409
|
+
4. Rust Detection:
|
|
410
|
+
- Indicator files: Cargo.toml, Cargo.lock
|
|
411
|
+
- IF found: Store PROJECT_LANGUAGE as rust
|
|
412
|
+
|
|
413
|
+
5. Ruby Detection:
|
|
414
|
+
- Indicator files: Gemfile, .ruby-version, Rakefile
|
|
415
|
+
- IF found: Store PROJECT_LANGUAGE as ruby
|
|
416
|
+
|
|
417
|
+
6. Java Detection:
|
|
418
|
+
- Indicator files: pom.xml, build.gradle, build.gradle.kts
|
|
419
|
+
- IF found: Store PROJECT_LANGUAGE as java
|
|
420
|
+
|
|
421
|
+
7. PHP Detection:
|
|
422
|
+
- Indicator files: composer.json, composer.lock
|
|
423
|
+
- IF found: Store PROJECT_LANGUAGE as php
|
|
424
|
+
|
|
425
|
+
8. Kotlin Detection:
|
|
426
|
+
- Indicator files: build.gradle.kts (with kotlin plugin), settings.gradle.kts
|
|
427
|
+
- IF found with kotlin references: Store PROJECT_LANGUAGE as kotlin
|
|
428
|
+
|
|
429
|
+
9. Swift Detection:
|
|
430
|
+
- Indicator files: Package.swift, .xcodeproj, .xcworkspace
|
|
431
|
+
- IF found: Store PROJECT_LANGUAGE as swift
|
|
432
|
+
|
|
433
|
+
10. C#/.NET Detection:
|
|
434
|
+
- Indicator files: .csproj, .sln, .fsproj
|
|
435
|
+
- IF found: Store PROJECT_LANGUAGE as csharp
|
|
436
|
+
|
|
437
|
+
11. C++ Detection:
|
|
438
|
+
- Indicator files: CMakeLists.txt, .cpp, .hpp, Makefile (with C++ content)
|
|
439
|
+
- IF found: Store PROJECT_LANGUAGE as cpp
|
|
440
|
+
|
|
441
|
+
12. Elixir Detection:
|
|
442
|
+
- Indicator files: mix.exs, .exs, .ex
|
|
443
|
+
- IF found: Store PROJECT_LANGUAGE as elixir
|
|
444
|
+
|
|
445
|
+
13. R Detection:
|
|
446
|
+
- Indicator files: DESCRIPTION (R package), .Rproj, renv.lock
|
|
447
|
+
- IF found: Store PROJECT_LANGUAGE as r
|
|
448
|
+
|
|
449
|
+
14. Flutter/Dart Detection:
|
|
450
|
+
- Indicator files: pubspec.yaml, .dart
|
|
451
|
+
- IF found: Store PROJECT_LANGUAGE as flutter
|
|
452
|
+
|
|
453
|
+
15. Scala Detection:
|
|
454
|
+
- Indicator files: build.sbt, .scala, build.sc (mill)
|
|
455
|
+
- IF found: Store PROJECT_LANGUAGE as scala
|
|
456
|
+
|
|
457
|
+
16. Fallback:
|
|
458
|
+
- IF no indicators found: Store PROJECT_LANGUAGE as unknown
|
|
459
|
+
- Skip language-specific tools, proceed directly to code-review
|
|
460
|
+
|
|
461
|
+
Log detection result:
|
|
462
|
+
- Print to user: "Project language detection: [detected_language]"
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
#### Task 1.2.5.2: Execute Language-Specific Test Runner
|
|
467
|
+
|
|
468
|
+
Execute the appropriate test runner based on detected language:
|
|
469
|
+
|
|
470
|
+
Test Runner Configuration by Language:
|
|
471
|
+
|
|
472
|
+
- Python: Execute pytest -v --tb=short or python -m unittest discover
|
|
473
|
+
- TypeScript/JavaScript: Execute npm test or npx vitest run or npx jest
|
|
474
|
+
- Go: Execute go test ./... -v
|
|
475
|
+
- Rust: Execute cargo test
|
|
476
|
+
- Ruby: Execute bundle exec rspec or rake test
|
|
477
|
+
- Java: Execute mvn test or gradle test
|
|
478
|
+
- PHP: Execute vendor/bin/phpunit or composer test
|
|
479
|
+
- Kotlin: Execute gradle test
|
|
480
|
+
- Swift: Execute swift test
|
|
481
|
+
- C#/.NET: Execute dotnet test
|
|
482
|
+
- C++: Execute ctest or catch2 or gtest
|
|
483
|
+
- Elixir: Execute mix test
|
|
484
|
+
- R: Execute testthat or devtools::test()
|
|
485
|
+
- Flutter/Dart: Execute flutter test or dart test
|
|
486
|
+
- Scala: Execute sbt test or mill test
|
|
487
|
+
|
|
488
|
+
Execution Steps:
|
|
489
|
+
|
|
490
|
+
1. Check tool availability:
|
|
491
|
+
- Verify the test runner is installed
|
|
492
|
+
- IF not installed: Print warning "[test runner] not installed - skipping" and proceed to linter
|
|
493
|
+
- IF installed: Continue to execution
|
|
494
|
+
|
|
495
|
+
2. Execute test runner:
|
|
496
|
+
- Run the appropriate command for detected language
|
|
497
|
+
- Capture all output including test results and failures
|
|
498
|
+
|
|
499
|
+
3. Parse test results:
|
|
500
|
+
- Count passed tests
|
|
501
|
+
- Count failed tests
|
|
502
|
+
- Identify failed test names
|
|
503
|
+
|
|
504
|
+
4. Determine test status:
|
|
505
|
+
- IF all tests passed: Store TEST_STATUS as PASS
|
|
506
|
+
- IF any tests failed: Store TEST_STATUS as FAIL
|
|
507
|
+
- IF tool not installed: Store TEST_STATUS as WARN
|
|
508
|
+
|
|
509
|
+
5. IF test failure occurs:
|
|
510
|
+
- Ask user for decision using AskUserQuestion
|
|
511
|
+
- Question: "Test execution result: X tests failed. How would you like to proceed?"
|
|
512
|
+
- Header: "Quality Verification"
|
|
513
|
+
- Options:
|
|
514
|
+
- "Continue" - Ignore test failures and proceed with sync
|
|
515
|
+
- "Abort" - Stop sync and fix tests first
|
|
516
|
+
- IF user chooses "Continue": Set flag and proceed to linter
|
|
517
|
+
- IF user chooses "Abort": Exit command with graceful exit message (Phase 4)
|
|
518
|
+
|
|
519
|
+
---
|
|
520
|
+
|
|
521
|
+
#### Task 1.2.5.3: Execute Language-Specific Linter
|
|
522
|
+
|
|
523
|
+
Execute the appropriate linter based on detected language:
|
|
524
|
+
|
|
525
|
+
Linter Configuration by Language:
|
|
526
|
+
|
|
527
|
+
- Python: Execute ruff check . or flake8 .
|
|
528
|
+
- TypeScript/JavaScript: Execute npx eslint . or npm run lint
|
|
529
|
+
- Go: Execute golangci-lint run or go vet ./...
|
|
530
|
+
- Rust: Execute cargo clippy
|
|
531
|
+
- Ruby: Execute bundle exec rubocop or rubocop
|
|
532
|
+
- Java: Execute mvn checkstyle:check or gradle checkstyleMain
|
|
533
|
+
- PHP: Execute vendor/bin/phpstan analyse or php-cs-fixer fix --dry-run
|
|
534
|
+
- Kotlin: Execute gradle ktlintCheck or detekt
|
|
535
|
+
- Swift: Execute swiftlint
|
|
536
|
+
- C#/.NET: Execute dotnet format --verify-no-changes
|
|
537
|
+
- C++: Execute clang-tidy or cppcheck
|
|
538
|
+
- Elixir: Execute mix credo
|
|
539
|
+
- R: Execute lintr
|
|
540
|
+
- Flutter/Dart: Execute dart analyze
|
|
541
|
+
- Scala: Execute scalafmt --check or scalafix
|
|
542
|
+
|
|
543
|
+
Execution Steps:
|
|
544
|
+
|
|
545
|
+
1. Check tool availability:
|
|
546
|
+
- Verify the linter is installed
|
|
547
|
+
- IF not installed: Print warning "[linter] not installed - skipping" and proceed to type checker
|
|
548
|
+
- IF installed: Continue to execution
|
|
549
|
+
|
|
550
|
+
2. Execute linter:
|
|
551
|
+
- Run the appropriate command for detected language
|
|
552
|
+
- Capture all output including violations found
|
|
553
|
+
|
|
554
|
+
3. Parse linter results:
|
|
555
|
+
- Count total violations
|
|
556
|
+
- Categorize by severity if available
|
|
557
|
+
- Identify files with violations
|
|
558
|
+
|
|
559
|
+
4. Determine linter status:
|
|
560
|
+
- IF no violations: Store LINT_STATUS as PASS
|
|
561
|
+
- IF violations found: Store LINT_STATUS as FAIL
|
|
562
|
+
- IF tool not installed: Store LINT_STATUS as WARN
|
|
563
|
+
|
|
564
|
+
5. Report findings:
|
|
565
|
+
- Print to user: "[linter name] check: [result] - X violations found"
|
|
566
|
+
|
|
567
|
+
---
|
|
568
|
+
|
|
569
|
+
#### Task 1.2.5.4: Execute Language-Specific Type Checker
|
|
570
|
+
|
|
571
|
+
Execute the appropriate type checker based on detected language:
|
|
572
|
+
|
|
573
|
+
Type Checker Configuration by Language:
|
|
574
|
+
|
|
575
|
+
- Python: Execute mypy . or pyright .
|
|
576
|
+
- TypeScript: Execute npx tsc --noEmit
|
|
577
|
+
- JavaScript: Skip (no native type checking) or use TypeScript in check mode
|
|
578
|
+
- Go: Execute go vet ./... (already includes type checking)
|
|
579
|
+
- Rust: Skip (type checking is part of cargo build/test)
|
|
580
|
+
- Ruby: Execute bundle exec steep check or sorbet tc
|
|
581
|
+
- Java: Skip (compilation handles type checking)
|
|
582
|
+
- PHP: Execute vendor/bin/phpstan analyse --level max
|
|
583
|
+
- Kotlin: Skip (compilation handles type checking)
|
|
584
|
+
- Swift: Skip (compilation handles type checking)
|
|
585
|
+
- C#/.NET: Execute dotnet build --no-restore (type check via compilation)
|
|
586
|
+
- C++: Skip (compilation handles type checking)
|
|
587
|
+
- Elixir: Execute mix dialyzer (optional, requires dialyxir dependency)
|
|
588
|
+
- R: Skip (no native type checking)
|
|
589
|
+
- Flutter/Dart: Execute dart analyze (includes type checking)
|
|
590
|
+
- Scala: Skip (compilation handles type checking)
|
|
591
|
+
|
|
592
|
+
Execution Steps:
|
|
593
|
+
|
|
594
|
+
1. Check if type checking is applicable:
|
|
595
|
+
- Some languages include type checking in compilation
|
|
596
|
+
- IF not applicable: Print info "[language] uses compilation for type checking - skipping separate check"
|
|
597
|
+
- IF applicable: Continue to tool check
|
|
598
|
+
|
|
599
|
+
2. Check tool availability:
|
|
600
|
+
- Verify the type checker is installed
|
|
601
|
+
- IF not installed: Print warning "[type checker] not installed - skipping" and proceed to code-review
|
|
602
|
+
- IF installed: Continue to execution
|
|
603
|
+
|
|
604
|
+
3. Execute type checker:
|
|
605
|
+
- Run the appropriate command for detected language
|
|
606
|
+
- Capture all output including type errors
|
|
607
|
+
|
|
608
|
+
4. Parse type checker results:
|
|
609
|
+
- Count total type errors
|
|
610
|
+
- Identify files with type issues
|
|
611
|
+
|
|
612
|
+
5. Determine type checker status:
|
|
613
|
+
- IF no errors: Store TYPE_STATUS as PASS
|
|
614
|
+
- IF errors found: Store TYPE_STATUS as FAIL
|
|
615
|
+
- IF tool not installed or not applicable: Store TYPE_STATUS as SKIP
|
|
616
|
+
|
|
617
|
+
6. Report findings:
|
|
618
|
+
- Print to user: "[type checker] check: [result] - X type errors found"
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
#### Task 1.2.5.5: Invoke manager-quality for Code Review
|
|
623
|
+
|
|
624
|
+
Execute code-review agent regardless of project language:
|
|
625
|
+
|
|
626
|
+
Use the manager-quality subagent to:
|
|
627
|
+
|
|
628
|
+
Perform automated code review and TRUST 5 validation
|
|
629
|
+
|
|
630
|
+
Critical Language Configuration:
|
|
631
|
+
|
|
632
|
+
- Receive instructions in agent_prompt_language from config (default: English)
|
|
633
|
+
- Respond in conversation_language from config (user's preferred language)
|
|
634
|
+
|
|
635
|
+
Task Instructions:
|
|
636
|
+
|
|
637
|
+
1. Execute TRUST 5 quality validation:
|
|
638
|
+
- Test: Verify test coverage is adequate
|
|
639
|
+
- Readable: Check code readability and standards
|
|
640
|
+
- Understandable: Verify code organization and documentation
|
|
641
|
+
- Secure: Check for security issues and best practices
|
|
642
|
+
- Tagged: Verify TAG annotations are present (if applicable)
|
|
643
|
+
|
|
644
|
+
2. Generate quality report:
|
|
645
|
+
- Summary of findings
|
|
646
|
+
- List of issues found (if any)
|
|
647
|
+
- Recommendations for improvements
|
|
648
|
+
|
|
649
|
+
3. Determine overall code review status:
|
|
650
|
+
- IF no issues found: Store CODE_REVIEW_STATUS as PASS
|
|
651
|
+
- IF issues found: Store CODE_REVIEW_STATUS as WARN
|
|
652
|
+
|
|
653
|
+
Store: Response in CODE_REVIEW_RESULTS
|
|
654
|
+
|
|
655
|
+
---
|
|
656
|
+
|
|
657
|
+
#### Task 1.2.5.6: Generate Quality Report
|
|
658
|
+
|
|
659
|
+
After all checks complete, generate comprehensive quality report:
|
|
660
|
+
|
|
661
|
+
1. Create quality report output:
|
|
662
|
+
|
|
663
|
+
```
|
|
664
|
+
Phase 0.5 Quality Verification Results
|
|
665
|
+
=====================================
|
|
666
|
+
|
|
667
|
+
Project Language: [detected_language]
|
|
668
|
+
|
|
669
|
+
Tool Verification Results:
|
|
670
|
+
test-runner: [PASS|FAIL|WARN|SKIP] ([tool_name])
|
|
671
|
+
linter: [PASS|FAIL|WARN|SKIP] ([tool_name])
|
|
672
|
+
type-checker: [PASS|FAIL|WARN|SKIP] ([tool_name])
|
|
673
|
+
code-review: [PASS|WARN]
|
|
674
|
+
|
|
675
|
+
Details:
|
|
676
|
+
- test-runner: [summary]
|
|
677
|
+
- linter: [summary]
|
|
678
|
+
- type-checker: [summary]
|
|
679
|
+
- code-review: [summary]
|
|
680
|
+
|
|
681
|
+
Overall Status: [PASS|WARN]
|
|
682
|
+
|
|
683
|
+
Next Step: Proceeding to document synchronization
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
2. Store report:
|
|
687
|
+
- Save complete report in QUALITY_REPORT
|
|
688
|
+
- Print summary to user
|
|
689
|
+
|
|
690
|
+
3. Determine phase outcome:
|
|
691
|
+
- IF test runner user chose "Abort": Go to PHASE 4 (exit)
|
|
692
|
+
- IF all checks complete: Continue to Step 1.3
|
|
693
|
+
|
|
694
|
+
Result: Quality verification complete. All issues documented. Ready for project status verification.
|
|
695
|
+
|
|
696
|
+
---
|
|
697
|
+
|
|
698
|
+
### Step 1.3: Project Status Verification
|
|
699
|
+
|
|
700
|
+
[HARD] Your task: Verify project status across entire project.
|
|
701
|
+
|
|
702
|
+
[HARD] Required Scope: Scan ALL source files, not just changed files.
|
|
703
|
+
WHY: Partial scans miss issues in unmodified sections. Comprehensive scanning ensures quality gates pass.
|
|
704
|
+
|
|
705
|
+
Verification Requirements:
|
|
706
|
+
- Project integrity assessment (identify broken references, inconsistencies)
|
|
707
|
+
- Complete issues detection with precise locations
|
|
708
|
+
- Resolution recommendations for discovered issues
|
|
709
|
+
|
|
710
|
+
Output Requirements:
|
|
711
|
+
- Complete issue list with file locations and line numbers
|
|
712
|
+
- Project integrity status: Healthy or Issues Detected
|
|
713
|
+
- Severity classification for each issue: Critical, High, Medium, Low
|
|
714
|
+
|
|
715
|
+
Storage:
|
|
716
|
+
- Store complete response in `$PROJECT_VALIDATION_RESULTS`
|
|
717
|
+
- Format must be machine-parseable for downstream agent processing
|
|
718
|
+
|
|
719
|
+
WHY: Complete validation prevents synchronization of broken states. Detailed results enable targeted fixes.
|
|
720
|
+
|
|
721
|
+
---
|
|
722
|
+
|
|
723
|
+
### Step 1.4: Invoke Doc-Syncer for Synchronization Plan
|
|
724
|
+
|
|
725
|
+
Your task: Call manager-docs to analyze Git changes and create synchronization strategy.
|
|
726
|
+
|
|
727
|
+
Use the manager-docs subagent to:
|
|
728
|
+
|
|
729
|
+
Establish a document synchronization plan
|
|
730
|
+
|
|
731
|
+
Critical Language Configuration:
|
|
732
|
+
|
|
733
|
+
- Receive instructions in agent_prompt_language from config (default: English)
|
|
734
|
+
- Respond in conversation_language from config (user's preferred language)
|
|
735
|
+
- Example: If agent_prompt_language="en" and conversation_language="ko", receive English instructions but respond in Korean
|
|
736
|
+
|
|
737
|
+
Task Instructions:
|
|
738
|
+
|
|
739
|
+
- Analyze Git changes and create a synchronization plan
|
|
740
|
+
- Synchronization mode: [auto/force/status/project]
|
|
741
|
+
- Changed files: [from git diff]
|
|
742
|
+
- Project verification results: [from analysis]
|
|
743
|
+
|
|
744
|
+
Required output:
|
|
745
|
+
|
|
746
|
+
1. Summary of documents to update
|
|
747
|
+
2. SPEC documents requiring synchronization
|
|
748
|
+
3. Project improvements needed
|
|
749
|
+
4. Estimated work scope
|
|
750
|
+
|
|
751
|
+
Ensure all document updates align with conversation_language setting.
|
|
752
|
+
|
|
753
|
+
Store: Response in `$SYNC_PLAN`
|
|
754
|
+
|
|
755
|
+
---
|
|
756
|
+
|
|
757
|
+
### Step 1.5: Request User Approval
|
|
758
|
+
|
|
759
|
+
Present synchronization plan and get user decision:
|
|
760
|
+
|
|
761
|
+
1. Display comprehensive plan report:
|
|
762
|
+
|
|
763
|
+
```
|
|
764
|
+
═══════════════════════════════════════════════════════
|
|
765
|
+
Document Synchronization Plan Report
|
|
766
|
+
═══════════════════════════════════════════════════════
|
|
767
|
+
|
|
768
|
+
Project Analysis:
|
|
769
|
+
- Mode: [mode]
|
|
770
|
+
- Scope: [scope]
|
|
771
|
+
- Changed files: [count]
|
|
772
|
+
- Project mode: [Personal/Team]
|
|
773
|
+
|
|
774
|
+
Synchronization Strategy:
|
|
775
|
+
- Living Documents: [list]
|
|
776
|
+
- SPEC documents: [list]
|
|
777
|
+
- Project improvements needed: [count]
|
|
778
|
+
|
|
779
|
+
Project Status:
|
|
780
|
+
- Project integrity: [Healthy / Issues]
|
|
781
|
+
- Project issues: [count]
|
|
782
|
+
- Broken references: [count]
|
|
783
|
+
|
|
784
|
+
═══════════════════════════════════════════════════════
|
|
785
|
+
```
|
|
786
|
+
|
|
787
|
+
2. Ask for user approval using AskUserQuestion:
|
|
788
|
+
|
|
789
|
+
- `question`: "Synchronization plan is ready. How would you like to proceed?"
|
|
790
|
+
- `header`: "Plan Approval"
|
|
791
|
+
- `multiSelect`: false
|
|
792
|
+
- `options`: 4 choices:
|
|
793
|
+
1. "Proceed with Sync" → Execute synchronization
|
|
794
|
+
2. "Request Modifications" → Modify strategy
|
|
795
|
+
3. "Review Details" → See full project results
|
|
796
|
+
4. "Abort" → Cancel (no changes made)
|
|
797
|
+
|
|
798
|
+
3. Process user response:
|
|
799
|
+
- IF "Proceed" → Go to PHASE 2
|
|
800
|
+
- IF "Modifications" → Ask for changes, re-run PHASE 1
|
|
801
|
+
- IF "Review Details" → Show project results, re-ask approval
|
|
802
|
+
- IF "Abort" → Go to PHASE 4 (graceful exit)
|
|
803
|
+
|
|
804
|
+
Result: User decision captured. Command proceeds or exits.
|
|
805
|
+
|
|
806
|
+
---
|
|
807
|
+
|
|
808
|
+
## PHASE 2: Execute Document Synchronization
|
|
809
|
+
|
|
810
|
+
Goal: Synchronize documents with code changes, update SPECs, verify quality.
|
|
811
|
+
|
|
812
|
+
### Step 2.1: Create Safety Backup
|
|
813
|
+
|
|
814
|
+
[HARD] Create safety backup before any modifications begin:
|
|
815
|
+
|
|
816
|
+
[HARD] Backup Creation Must Complete Successfully:
|
|
817
|
+
WHY: Backups enable rollback if synchronization fails or produces unexpected results
|
|
818
|
+
IMPACT: Missing backup eliminates recovery option if sync produces errors
|
|
819
|
+
|
|
820
|
+
1. [HARD] Generate Timestamp for Backup Identity:
|
|
821
|
+
|
|
822
|
+
Requirement: Create unique timestamp identifier for backup
|
|
823
|
+
Action: Execute `date +%Y-%m-%d-%H%M%S` and store result in `$TIMESTAMP`
|
|
824
|
+
WHY: Timestamp enables multiple backups without overwriting previous ones
|
|
825
|
+
|
|
826
|
+
2. [HARD] Create Backup Directory:
|
|
827
|
+
|
|
828
|
+
Requirement: Establish isolated directory for backup files
|
|
829
|
+
Action: Execute `mkdir -p .moai-backups/sync-$TIMESTAMP/`
|
|
830
|
+
WHY: Isolated directory prevents mixing backup versions
|
|
831
|
+
|
|
832
|
+
3. [HARD] Backup All Critical Project Files:
|
|
833
|
+
|
|
834
|
+
Requirement: Copy all essential project files to backup
|
|
835
|
+
Files to backup:
|
|
836
|
+
- README.md (if exists) - Project documentation
|
|
837
|
+
- docs/ directory (if exists) - Additional documentation
|
|
838
|
+
- .moai/specs/ directory - SPEC definitions
|
|
839
|
+
WHY: Backing up all critical files enables complete state restoration
|
|
840
|
+
|
|
841
|
+
4. [HARD] Verify Backup Integrity:
|
|
842
|
+
|
|
843
|
+
Requirement: Confirm backup was created successfully
|
|
844
|
+
Actions:
|
|
845
|
+
- Execute: `ls -la .moai-backups/sync-$TIMESTAMP/`
|
|
846
|
+
- Verify: Backup directory is not empty
|
|
847
|
+
- If empty: Print error message and exit with failure code
|
|
848
|
+
- If complete: Print success message and continue
|
|
849
|
+
WHY: Verification confirms backup is usable for recovery
|
|
850
|
+
|
|
851
|
+
Result: Safety backup created and verified. Ready for synchronization phase.
|
|
852
|
+
|
|
853
|
+
---
|
|
854
|
+
|
|
855
|
+
### Step 2.2: Invoke Doc-Syncer for Document Synchronization
|
|
856
|
+
|
|
857
|
+
Your task: Call manager-docs to execute the approved synchronization plan.
|
|
858
|
+
|
|
859
|
+
Use the manager-docs subagent to:
|
|
860
|
+
|
|
861
|
+
Execute Living Document synchronization
|
|
862
|
+
|
|
863
|
+
Critical Language Configuration:
|
|
864
|
+
|
|
865
|
+
- Receive instructions in agent_prompt_language from config (default: English)
|
|
866
|
+
- Respond in conversation_language from config (user's preferred language)
|
|
867
|
+
- Example: If agent_prompt_language="en" and conversation_language="ko", receive English instructions but respond in Korean
|
|
868
|
+
|
|
869
|
+
Execute the approved synchronization plan:
|
|
870
|
+
|
|
871
|
+
Previous analysis results:
|
|
872
|
+
|
|
873
|
+
- Project verification: [from analysis]
|
|
874
|
+
- Synchronization strategy: [from manager-docs analysis]
|
|
875
|
+
|
|
876
|
+
Task Instructions:
|
|
877
|
+
|
|
878
|
+
1. Living Document synchronization:
|
|
879
|
+
|
|
880
|
+
- Reflect changed code in documentation
|
|
881
|
+
- Auto-generate/update API documentation
|
|
882
|
+
- Update README (if needed)
|
|
883
|
+
- Synchronize Architecture documents
|
|
884
|
+
|
|
885
|
+
2. Project improvements:
|
|
886
|
+
|
|
887
|
+
- Fix project issues (if possible)
|
|
888
|
+
- Restore broken references
|
|
889
|
+
|
|
890
|
+
3. SPEC synchronization:
|
|
891
|
+
|
|
892
|
+
- Ensure SPEC documents match implementation
|
|
893
|
+
- Update EARS statements if needed
|
|
894
|
+
|
|
895
|
+
4. Domain-based documentation:
|
|
896
|
+
|
|
897
|
+
- Detect changed domains (frontend/backend/devops/database/ml/mobile)
|
|
898
|
+
- Generate domain-specific documentation updates
|
|
899
|
+
|
|
900
|
+
5. Generate synchronization report:
|
|
901
|
+
- File location: .moai/reports/sync-report-$TIMESTAMP.md
|
|
902
|
+
- Include: Updated file list, Project improvements, results summary
|
|
903
|
+
|
|
904
|
+
Important: Use conversation_language for all document updates.
|
|
905
|
+
|
|
906
|
+
Execute the plan precisely and report results in detail.
|
|
907
|
+
|
|
908
|
+
Store: Response in `$SYNC_RESULTS`
|
|
909
|
+
|
|
910
|
+
---
|
|
911
|
+
|
|
912
|
+
### Step 2.3: Invoke Quality-Gate for Verification
|
|
913
|
+
|
|
914
|
+
Your task: Call manager-quality to verify synchronization quality.
|
|
915
|
+
|
|
916
|
+
Use the manager-quality subagent to:
|
|
917
|
+
|
|
918
|
+
Verify document synchronization quality
|
|
919
|
+
|
|
920
|
+
Critical Language Configuration:
|
|
921
|
+
|
|
922
|
+
- Receive instructions in agent_prompt_language from config (default: English)
|
|
923
|
+
- Respond in conversation_language from config (user's preferred language)
|
|
924
|
+
- Example: If agent_prompt_language="en" and conversation_language="ko", receive English instructions but respond in Korean
|
|
925
|
+
|
|
926
|
+
Task: Verify that document synchronization meets TRUST 5 principles.
|
|
927
|
+
|
|
928
|
+
Verification checks:
|
|
929
|
+
|
|
930
|
+
1. Test First: Are all project links complete?
|
|
931
|
+
2. Readable: Are documents well-formatted?
|
|
932
|
+
3. Unified: Are all documents consistent?
|
|
933
|
+
4. Secured: Are no credentials exposed?
|
|
934
|
+
5. Trackable: Are all SPECs properly linked?
|
|
935
|
+
|
|
936
|
+
Output: PASS / FAIL with details
|
|
937
|
+
|
|
938
|
+
Result: Quality verification complete.
|
|
939
|
+
|
|
940
|
+
---
|
|
941
|
+
|
|
942
|
+
### Step 2.4: Update SPEC Status to Completed
|
|
943
|
+
|
|
944
|
+
After successful synchronization, update SPEC status to completed:
|
|
945
|
+
|
|
946
|
+
1. Batch update all completed SPECs:
|
|
947
|
+
|
|
948
|
+
```bash
|
|
949
|
+
python3 .claude/hooks/moai/spec_status_hooks.py batch_update
|
|
950
|
+
```
|
|
951
|
+
|
|
952
|
+
2. Verify status updates:
|
|
953
|
+
|
|
954
|
+
- Check results from batch update
|
|
955
|
+
- Record version changes and status transitions
|
|
956
|
+
- Include status changes in sync report
|
|
957
|
+
|
|
958
|
+
3. Handle individual SPEC validation (if needed):
|
|
959
|
+
|
|
960
|
+
```bash
|
|
961
|
+
python3 .claude/hooks/moai/spec_status_hooks.py validate_completion <SPEC_ID>
|
|
962
|
+
python3 .claude/hooks/moai/spec_status_hooks.py status_update <SPEC_ID> --status completed --reason "Documentation synchronized successfully"
|
|
963
|
+
```
|
|
964
|
+
|
|
965
|
+
4. Generate status update summary:
|
|
966
|
+
- Count of SPECs updated to completed
|
|
967
|
+
- List of any failed updates with reasons
|
|
968
|
+
- Version changes for each SPEC
|
|
969
|
+
- Integration with sync report
|
|
970
|
+
|
|
971
|
+
Integration: Status updates are included in the Git commit from Phase 3 with detailed commit message.
|
|
972
|
+
|
|
973
|
+
---
|
|
974
|
+
|
|
975
|
+
## PHASE 3: Git Operations & PR
|
|
976
|
+
|
|
977
|
+
Goal: Commit changes, transition PR (if Team mode), optionally auto-merge.
|
|
978
|
+
|
|
979
|
+
### Step 3.1: Invoke Git-Manager for Commit
|
|
980
|
+
|
|
981
|
+
Your task: Call manager-git to commit all document changes.
|
|
982
|
+
|
|
983
|
+
Use the manager-git subagent to:
|
|
984
|
+
|
|
985
|
+
Commit document synchronization changes to Git
|
|
986
|
+
|
|
987
|
+
Critical Language Configuration:
|
|
988
|
+
|
|
989
|
+
- Receive instructions in agent_prompt_language from config (default: English)
|
|
990
|
+
- Respond in conversation_language from config (user's preferred language)
|
|
991
|
+
- Example: If agent_prompt_language="en" and conversation_language="ko", receive English instructions but respond in Korean
|
|
992
|
+
|
|
993
|
+
Task: Commit document synchronization changes to Git.
|
|
994
|
+
|
|
995
|
+
Commit Scope:
|
|
996
|
+
|
|
997
|
+
- All changed document files
|
|
998
|
+
- .moai/reports/ directory
|
|
999
|
+
- README.md (if changed)
|
|
1000
|
+
- docs/ directory (if changed)
|
|
1001
|
+
|
|
1002
|
+
Commit Message Template:
|
|
1003
|
+
|
|
1004
|
+
```
|
|
1005
|
+
docs: sync documentation with code changes
|
|
1006
|
+
|
|
1007
|
+
Synchronized Living Documents:
|
|
1008
|
+
- [list from synchronization results]
|
|
1009
|
+
|
|
1010
|
+
Project updates:
|
|
1011
|
+
- [count] repairs completed
|
|
1012
|
+
- SPEC index updated
|
|
1013
|
+
|
|
1014
|
+
SPEC synchronization:
|
|
1015
|
+
- [count] SPECs updated
|
|
1016
|
+
|
|
1017
|
+
Domain-specific sync:
|
|
1018
|
+
- [domain list if applicable]
|
|
1019
|
+
|
|
1020
|
+
Generated with Claude Code
|
|
1021
|
+
```
|
|
1022
|
+
|
|
1023
|
+
Important:
|
|
1024
|
+
|
|
1025
|
+
- Bundle all changes into a single commit
|
|
1026
|
+
- Report success after commit
|
|
1027
|
+
|
|
1028
|
+
Execution Order:
|
|
1029
|
+
|
|
1030
|
+
1. git add (changed document files)
|
|
1031
|
+
2. git commit -m (commit message above)
|
|
1032
|
+
3. git log -1 (verify commit)
|
|
1033
|
+
|
|
1034
|
+
Verify:
|
|
1035
|
+
|
|
1036
|
+
- Execute: `git log -1 --oneline`
|
|
1037
|
+
- Print commit info
|
|
1038
|
+
- IF commit failed → Exit with error code
|
|
1039
|
+
|
|
1040
|
+
---
|
|
1041
|
+
|
|
1042
|
+
### Step 3.2: (Optional) PR Ready Transition
|
|
1043
|
+
|
|
1044
|
+
For Team mode projects only:
|
|
1045
|
+
|
|
1046
|
+
1. Check if Team mode:
|
|
1047
|
+
|
|
1048
|
+
- Read: `git_strategy.mode` from config
|
|
1049
|
+
- IF Personal → Skip to next phase
|
|
1050
|
+
|
|
1051
|
+
2. Transition PR to Ready:
|
|
1052
|
+
|
|
1053
|
+
- Use Task tool:
|
|
1054
|
+
- `subagent_type`: "manager-git"
|
|
1055
|
+
- `description`: "Transition PR to Ready for Review"
|
|
1056
|
+
- `prompt`: "Transition PR from Draft to Ready. Execute: `gh pr ready`"
|
|
1057
|
+
|
|
1058
|
+
3. Assign reviewers and labels (if configured)
|
|
1059
|
+
|
|
1060
|
+
---
|
|
1061
|
+
|
|
1062
|
+
### Step 3.3: (Optional) PR Auto-Merge
|
|
1063
|
+
|
|
1064
|
+
If `--auto-merge` flag is set:
|
|
1065
|
+
|
|
1066
|
+
1. Check CI/CD status:
|
|
1067
|
+
|
|
1068
|
+
- Execute: `gh pr checks`
|
|
1069
|
+
- IF failing → Print warning and skip merge
|
|
1070
|
+
|
|
1071
|
+
2. Check merge conflicts:
|
|
1072
|
+
|
|
1073
|
+
- Execute: `gh pr view --json mergeable`
|
|
1074
|
+
- IF conflicts exist → Print warning and skip merge
|
|
1075
|
+
|
|
1076
|
+
3. Execute auto-merge:
|
|
1077
|
+
|
|
1078
|
+
- Execute: `gh pr merge --squash --delete-branch`
|
|
1079
|
+
|
|
1080
|
+
4. Branch cleanup:
|
|
1081
|
+
- Checkout: `git checkout develop`
|
|
1082
|
+
- Pull: `git pull origin develop`
|
|
1083
|
+
- Delete local branch if merge succeeded
|
|
1084
|
+
|
|
1085
|
+
---
|
|
1086
|
+
|
|
1087
|
+
## PHASE 4: Completion & Next Steps
|
|
1088
|
+
|
|
1089
|
+
Goal: Report results and guide user to next action.
|
|
1090
|
+
|
|
1091
|
+
### Step 4.1: Display Completion Report
|
|
1092
|
+
|
|
1093
|
+
Print comprehensive summary:
|
|
1094
|
+
|
|
1095
|
+
```
|
|
1096
|
+
═══════════════════════════════════════════════════════
|
|
1097
|
+
Document Synchronization Complete
|
|
1098
|
+
═══════════════════════════════════════════════════════
|
|
1099
|
+
|
|
1100
|
+
Synchronization Summary:
|
|
1101
|
+
- Mode: [mode]
|
|
1102
|
+
- Scope: [scope]
|
|
1103
|
+
- Files updated: [count]
|
|
1104
|
+
- Files created: [count]
|
|
1105
|
+
- Project improvements: [count]
|
|
1106
|
+
|
|
1107
|
+
Documents Updated:
|
|
1108
|
+
- Living Documents: [list]
|
|
1109
|
+
- SPEC documents: [list]
|
|
1110
|
+
- Domain-specific reports: [count]
|
|
1111
|
+
|
|
1112
|
+
Project Status:
|
|
1113
|
+
- Project integrity: [PASS / WARNING]
|
|
1114
|
+
|
|
1115
|
+
Reports Generated:
|
|
1116
|
+
- Master sync report: .moai/reports/sync-report-$TIMESTAMP.md
|
|
1117
|
+
- Domain reports: [list if any]
|
|
1118
|
+
|
|
1119
|
+
Backup Location:
|
|
1120
|
+
- Safety backup: .moai-backups/sync-$TIMESTAMP/
|
|
1121
|
+
|
|
1122
|
+
═══════════════════════════════════════════════════════
|
|
1123
|
+
```
|
|
1124
|
+
|
|
1125
|
+
---
|
|
1126
|
+
|
|
1127
|
+
### Step 4.2: Handle Worktree/Branch Workflow Options
|
|
1128
|
+
|
|
1129
|
+
If $WORKTREE_MODE is true:
|
|
1130
|
+
|
|
1131
|
+
After sync completion, provide worktree-specific options:
|
|
1132
|
+
|
|
1133
|
+
1. Ask for worktree next action:
|
|
1134
|
+
|
|
1135
|
+
```python
|
|
1136
|
+
AskUserQuestion({
|
|
1137
|
+
"questions": [{
|
|
1138
|
+
"question": f"Worktree synchronization for {CURRENT_SPEC_ID} is complete. What would you like to do?",
|
|
1139
|
+
"header": "Worktree Next Steps",
|
|
1140
|
+
"multiSelect": false,
|
|
1141
|
+
"options": [
|
|
1142
|
+
{
|
|
1143
|
+
"label": "Return to Main Directory",
|
|
1144
|
+
"description": "Exit worktree and return to main project directory"
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
"label": "Continue in Worktree",
|
|
1148
|
+
"description": "Stay in current worktree for continued development"
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
"label": "Switch to Another Worktree",
|
|
1152
|
+
"description": "Navigate to a different SPEC worktree"
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
"label": "Remove This Worktree",
|
|
1156
|
+
"description": "Clean up and remove the current worktree"
|
|
1157
|
+
}
|
|
1158
|
+
]
|
|
1159
|
+
}]
|
|
1160
|
+
})
|
|
1161
|
+
```
|
|
1162
|
+
|
|
1163
|
+
2. Execute user choice:
|
|
1164
|
+
- IF "Return to Main Directory" → Execute: `cd ~/MoAI/MoAI-ADK`
|
|
1165
|
+
- IF "Continue in Worktree" → Stay in current directory
|
|
1166
|
+
- IF "Switch to Another Worktree" → List available worktrees and facilitate switch
|
|
1167
|
+
- IF "Remove This Worktree" → Execute: `moai-worktree remove {CURRENT_SPEC_ID}` then return to main
|
|
1168
|
+
|
|
1169
|
+
If $BRANCH_MODE is true:
|
|
1170
|
+
|
|
1171
|
+
After sync completion, provide branch-specific options:
|
|
1172
|
+
|
|
1173
|
+
1. Ask for branch next action:
|
|
1174
|
+
|
|
1175
|
+
```python
|
|
1176
|
+
AskUserQuestion({
|
|
1177
|
+
"questions": [{
|
|
1178
|
+
"question": f"Branch synchronization for {CURRENT_BRANCH} is complete. What would you like to do?",
|
|
1179
|
+
"header": "Branch Next Steps",
|
|
1180
|
+
"multiSelect": false,
|
|
1181
|
+
"options": [
|
|
1182
|
+
{
|
|
1183
|
+
"label": "Commit and Push Changes",
|
|
1184
|
+
"description": "Commit sync changes and push to remote branch"
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
"label": "Return to Main Branch",
|
|
1188
|
+
"description": "Switch back to main branch without pushing"
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
"label": "Create Pull Request",
|
|
1192
|
+
"description": "Create PR for this branch and return to main"
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
"label": "Continue on Branch",
|
|
1196
|
+
"description": "Stay on current branch for continued development"
|
|
1197
|
+
}
|
|
1198
|
+
]
|
|
1199
|
+
}]
|
|
1200
|
+
})
|
|
1201
|
+
```
|
|
1202
|
+
|
|
1203
|
+
2. Execute user choice:
|
|
1204
|
+
- IF "Commit and Push Changes" → Execute: `git add . && git commit && git push origin {CURRENT_BRANCH}`
|
|
1205
|
+
- IF "Return to Main Branch" → Execute: `git checkout main` (warn about uncommitted changes)
|
|
1206
|
+
- IF "Create Pull Request" → Execute: `gh pr create` then checkout main
|
|
1207
|
+
- IF "Continue on Branch" → Stay on current branch
|
|
1208
|
+
|
|
1209
|
+
### Step 4.3: Standard Next Steps (Non-Worktree/Branch Mode)
|
|
1210
|
+
|
|
1211
|
+
Use AskUserQuestion to guide next steps:
|
|
1212
|
+
|
|
1213
|
+
- `question`: "Documentation synchronization complete. What would you like to do next?"
|
|
1214
|
+
- `header`: "Next Steps"
|
|
1215
|
+
- `multiSelect`: false
|
|
1216
|
+
- `options`: 3-4 choices depending on context:
|
|
1217
|
+
- " Create Next SPEC" → /moai:1-plan
|
|
1218
|
+
- " Start New Session" → /clear for fresh context
|
|
1219
|
+
- "📤 Review PR" (Team mode) → gh pr view --web
|
|
1220
|
+
- " Continue Development" (Personal mode)
|
|
1221
|
+
- " Project Overview" → Review reports and docs
|
|
1222
|
+
|
|
1223
|
+
---
|
|
1224
|
+
|
|
1225
|
+
## Graceful Exit (User Aborts)
|
|
1226
|
+
|
|
1227
|
+
If user chooses to abort in PHASE 1:
|
|
1228
|
+
|
|
1229
|
+
```
|
|
1230
|
+
═══════════════════════════════════════════════════════
|
|
1231
|
+
Synchronization Aborted
|
|
1232
|
+
═══════════════════════════════════════════════════════
|
|
1233
|
+
|
|
1234
|
+
No changes were made to:
|
|
1235
|
+
- Documents
|
|
1236
|
+
- Git history
|
|
1237
|
+
- Branch state
|
|
1238
|
+
|
|
1239
|
+
Your project remains in its current state.
|
|
1240
|
+
|
|
1241
|
+
You can retry synchronization anytime with:
|
|
1242
|
+
/moai:3-sync [mode]
|
|
1243
|
+
|
|
1244
|
+
═══════════════════════════════════════════════════════
|
|
1245
|
+
```
|
|
1246
|
+
|
|
1247
|
+
Exit command with code 0.
|
|
1248
|
+
|
|
1249
|
+
---
|
|
1250
|
+
|
|
1251
|
+
## Quick Reference
|
|
1252
|
+
|
|
1253
|
+
| Scenario | Mode | Entry Point | Key Phases | Expected Outcome |
|
|
1254
|
+
| -------------------- | ------- | --------------------------- | ------------------------------------------------------------- | ------------------------- |
|
|
1255
|
+
| Daily development | auto | `/moai:3-sync` | Phase 0.5 (QV) → Phase 1 → Analysis → Phase 2 → Sync → Phase 3 → Git | PR Ready + docs synced |
|
|
1256
|
+
| Error recovery | force | `/moai:3-sync force` | Phase 0.5 (QV) → Full project re-sync | All docs regenerated |
|
|
1257
|
+
| Quick health check | status | `/moai:3-sync status` | Phase 0.5 (QV) → Status check only | Health report |
|
|
1258
|
+
| Milestone completion | project | `/moai:3-sync project` | Phase 0.5 (QV) → Integrated sync | Project-wide updates |
|
|
1259
|
+
| Auto-merge workflow | auto | `/moai:3-sync --auto-merge` | Phase 0.5 (QV) → PR auto-merge + cleanup | Branch merged and deleted |
|
|
1260
|
+
|
|
1261
|
+
Note: Phase 0.5 = Quality Verification (pytest, ruff, mypy, code-review)
|
|
1262
|
+
|
|
1263
|
+
Associated Agents:
|
|
1264
|
+
|
|
1265
|
+
- `manager-docs` - Living Document synchronization
|
|
1266
|
+
- `manager-quality` - TRUST 5 validation
|
|
1267
|
+
- `manager-git` - Git operations and PR management
|
|
1268
|
+
|
|
1269
|
+
Documentation Outputs:
|
|
1270
|
+
|
|
1271
|
+
- Living Documents: Auto-synchronized with code
|
|
1272
|
+
- SPEC Documents: Updated to match implementation
|
|
1273
|
+
- Reports: `.moai/reports/sync-report-{timestamp}.md`
|
|
1274
|
+
- Backup: `.moai-backups/sync-{timestamp}/` (safety backup)
|
|
1275
|
+
|
|
1276
|
+
Version: 3.4.0 (Full Language Support with Config-Based Coverage)
|
|
1277
|
+
Last Updated: 2025-12-22
|
|
1278
|
+
Architecture: Commands → Agents → Skills (Complete delegation)
|
|
1279
|
+
Supported Languages: Python, TypeScript, JavaScript, Go, Rust, Ruby, Java, PHP, Kotlin, Swift, C#, C++, Elixir, R, Flutter/Dart, Scala
|
|
1280
|
+
Coverage Target: Read from .moai/config/sections/quality.yaml (constitution.test_coverage_target)
|
|
1281
|
+
|
|
1282
|
+
---
|
|
1283
|
+
|
|
1284
|
+
## Final Step: Next Action Selection
|
|
1285
|
+
|
|
1286
|
+
After documentation synchronization completes, use AskUserQuestion tool to guide user to next action:
|
|
1287
|
+
|
|
1288
|
+
```python
|
|
1289
|
+
AskUserQuestion({
|
|
1290
|
+
"questions": [{
|
|
1291
|
+
"question": "Documentation synchronization is complete. What would you like to do next?",
|
|
1292
|
+
"header": "Next Steps",
|
|
1293
|
+
"multiSelect": false,
|
|
1294
|
+
"options": [
|
|
1295
|
+
{
|
|
1296
|
+
"label": "Develop New Feature",
|
|
1297
|
+
"description": "Execute /moai:1-plan to plan new feature"
|
|
1298
|
+
},
|
|
1299
|
+
{
|
|
1300
|
+
"label": "Process PR Merge",
|
|
1301
|
+
"description": "Review and merge Pull Request"
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
"label": "Complete Workflow",
|
|
1305
|
+
"description": "Complete current work and clean up session"
|
|
1306
|
+
}
|
|
1307
|
+
]
|
|
1308
|
+
}]
|
|
1309
|
+
})
|
|
1310
|
+
```
|
|
1311
|
+
|
|
1312
|
+
Important:
|
|
1313
|
+
|
|
1314
|
+
- Use conversation language from config
|
|
1315
|
+
- No emojis in any AskUserQuestion fields
|
|
1316
|
+
- Always provide clear next step options
|
|
1317
|
+
|
|
1318
|
+
## EXECUTION DIRECTIVE
|
|
1319
|
+
|
|
1320
|
+
You must NOW execute the command following the "OVERALL WORKFLOW STRUCTURE" described above.
|
|
1321
|
+
|
|
1322
|
+
1. Start PHASE 1: Analysis & Planning immediately.
|
|
1323
|
+
2. Use the manager-docs subagent (or appropriate subagent for the step).
|
|
1324
|
+
3. Do NOT just describe what you will do. DO IT.
|