moai-adk 0.4.5__py3-none-any.whl → 0.20.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 +1 -1
- moai_adk/__main__.py +74 -1
- moai_adk/cli/commands/__init__.py +1 -1
- moai_adk/cli/commands/analyze.py +119 -0
- moai_adk/cli/commands/backup.py +25 -1
- moai_adk/cli/commands/doctor.py +31 -5
- moai_adk/cli/commands/improve_user_experience.py +307 -0
- moai_adk/cli/commands/init.py +111 -10
- moai_adk/cli/commands/status.py +33 -3
- moai_adk/cli/commands/update.py +921 -130
- moai_adk/cli/commands/validate_links.py +120 -0
- moai_adk/cli/prompts/init_prompts.py +22 -87
- moai_adk/core/analysis/__init__.py +9 -0
- moai_adk/core/analysis/session_analyzer.py +388 -0
- moai_adk/core/analysis/tag_chain_analyzer.py +344 -0
- moai_adk/core/analysis/tag_chain_repair.py +879 -0
- moai_adk/core/config/__init__.py +19 -0
- moai_adk/core/config/migration.py +235 -0
- moai_adk/core/git/__init__.py +1 -1
- moai_adk/core/git/branch.py +1 -1
- moai_adk/core/git/commit.py +1 -1
- moai_adk/core/git/manager.py +1 -1
- moai_adk/core/issue_creator.py +313 -0
- moai_adk/core/mcp/setup.py +56 -0
- moai_adk/core/mcp/setup_old.py +296 -0
- moai_adk/core/project/backup_utils.py +1 -1
- moai_adk/core/project/checker.py +2 -2
- moai_adk/core/project/detector.py +211 -12
- moai_adk/core/project/initializer.py +85 -15
- moai_adk/core/project/phase_executor.py +76 -13
- moai_adk/core/project/validator.py +13 -13
- moai_adk/core/quality/__init__.py +1 -1
- moai_adk/core/quality/trust_checker.py +1 -1
- moai_adk/core/quality/validators/__init__.py +1 -1
- moai_adk/core/quality/validators/base_validator.py +1 -1
- moai_adk/core/tags/__init__.py +86 -0
- moai_adk/core/tags/auto_corrector.py +693 -0
- moai_adk/core/tags/ci_validator.py +463 -0
- moai_adk/core/tags/cli.py +283 -0
- moai_adk/core/tags/generator.py +109 -0
- moai_adk/core/tags/inserter.py +99 -0
- moai_adk/core/tags/mapper.py +126 -0
- moai_adk/core/tags/parser.py +76 -0
- moai_adk/core/tags/policy_validator.py +580 -0
- moai_adk/core/tags/pre_commit_validator.py +421 -0
- moai_adk/core/tags/reporter.py +956 -0
- moai_adk/core/tags/rollback_manager.py +525 -0
- moai_adk/core/tags/tags.py +149 -0
- moai_adk/core/tags/validator.py +897 -0
- moai_adk/core/template/__init__.py +1 -1
- moai_adk/core/template/backup.py +1 -1
- moai_adk/core/template/merger.py +50 -1
- moai_adk/core/template/processor.py +119 -13
- moai_adk/core/template_engine.py +268 -0
- moai_adk/templates/.claude/agents/alfred/backend-expert.md +348 -0
- moai_adk/templates/.claude/agents/alfred/cc-manager.md +209 -944
- moai_adk/templates/.claude/agents/alfred/database-expert.md +352 -0
- moai_adk/templates/.claude/agents/alfred/debug-helper.md +34 -5
- moai_adk/templates/.claude/agents/alfred/devops-expert.md +464 -0
- moai_adk/templates/.claude/agents/alfred/doc-syncer.md +38 -8
- moai_adk/templates/.claude/agents/alfred/format-expert.md +469 -0
- moai_adk/templates/.claude/agents/alfred/frontend-expert.md +357 -0
- moai_adk/templates/.claude/agents/alfred/git-manager.md +128 -9
- moai_adk/templates/.claude/agents/alfred/implementation-planner.md +104 -6
- moai_adk/templates/.claude/agents/alfred/project-manager.md +88 -16
- moai_adk/templates/.claude/agents/alfred/quality-gate.md +36 -9
- moai_adk/templates/.claude/agents/alfred/security-expert.md +270 -0
- moai_adk/templates/.claude/agents/alfred/skill-factory.md +865 -0
- moai_adk/templates/.claude/agents/alfred/spec-builder.md +214 -43
- moai_adk/templates/.claude/agents/alfred/tag-agent.md +111 -9
- moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +309 -160
- moai_adk/templates/.claude/agents/alfred/trust-checker.md +36 -7
- moai_adk/templates/.claude/agents/alfred/ui-ux-expert.md +605 -0
- moai_adk/templates/.claude/commands/alfred/0-project.md +393 -966
- moai_adk/templates/.claude/commands/alfred/1-plan.md +651 -367
- moai_adk/templates/.claude/commands/alfred/2-run.md +388 -241
- moai_adk/templates/.claude/commands/alfred/3-sync.md +1921 -410
- moai_adk/templates/.claude/commands/alfred/9-feedback.md +153 -0
- moai_adk/templates/.claude/commands/alfred/release-new.md +3604 -0
- moai_adk/templates/.claude/hooks/alfred/core/project.py +484 -20
- moai_adk/templates/.claude/hooks/alfred/core/timeout.py +136 -0
- moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +108 -0
- moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +198 -0
- moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +14 -6
- moai_adk/templates/.claude/hooks/alfred/post_tool__enable_streaming_ui.py +50 -0
- moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +93 -0
- moai_adk/templates/.claude/hooks/alfred/post_tool__tag_auto_corrector.py +407 -0
- moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +99 -0
- moai_adk/templates/.claude/hooks/alfred/pre_tool__realtime_tag_monitor.py +335 -0
- moai_adk/templates/.claude/hooks/alfred/pre_tool__tag_policy_validator.py +325 -0
- moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +93 -0
- moai_adk/templates/.claude/hooks/alfred/session_start__auto_cleanup.py +580 -0
- moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +298 -0
- moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +170 -0
- moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/checkpoint.py +3 -3
- moai_adk/templates/.claude/hooks/alfred/{core → shared/core}/context.py +5 -5
- moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +749 -0
- moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +230 -0
- moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +198 -0
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py +21 -0
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/daily_analysis.py +351 -0
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +154 -0
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +174 -0
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +87 -0
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +61 -0
- moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +111 -0
- moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +1 -0
- moai_adk/templates/.claude/hooks/alfred/utils/hook_config.py +94 -0
- moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +161 -0
- moai_adk/templates/.claude/output-styles/alfred/alfred-moai-adk-beginner.md +267 -0
- moai_adk/templates/.claude/output-styles/alfred/keating-personal-tutor.md +440 -0
- moai_adk/templates/.claude/output-styles/alfred/r2d2-agentic-coding.md +583 -0
- moai_adk/templates/.claude/settings.json +96 -14
- moai_adk/templates/.claude/skills/moai-alfred-agent-guide/SKILL.md +70 -0
- moai_adk/templates/.claude/skills/moai-alfred-agent-guide/examples.md +62 -0
- moai_adk/templates/.claude/skills/moai-alfred-agent-guide/reference.md +242 -0
- moai_adk/templates/.claude/skills/moai-alfred-ask-user-questions/SKILL.md +237 -0
- moai_adk/templates/.claude/skills/moai-alfred-ask-user-questions/examples.md +871 -0
- moai_adk/templates/.claude/skills/moai-alfred-ask-user-questions/reference.md +653 -0
- moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/README.md +162 -0
- moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/SKILL.md +227 -0
- moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/examples.md +354 -0
- moai_adk/templates/.claude/skills/moai-alfred-clone-pattern/reference.md +158 -0
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +179 -79
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/examples.md +117 -0
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/scripts/pre-review-check.sh +62 -0
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/SKILL.md +132 -0
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/examples.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/reference.md +444 -0
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/SKILL.md +62 -0
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/examples.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/reference.md +405 -0
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/SKILL.md +51 -0
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/examples.md +355 -0
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/reference.md +239 -0
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/SKILL.md +323 -0
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/examples.md +286 -0
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/reference.md +126 -0
- moai_adk/templates/.claude/skills/moai-alfred-issue-labels/SKILL.md +229 -0
- moai_adk/templates/.claude/skills/moai-alfred-issue-labels/examples.md +4 -0
- moai_adk/templates/.claude/skills/moai-alfred-issue-labels/reference.md +150 -0
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +87 -73
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-personas/README.md +42 -0
- moai_adk/templates/.claude/skills/moai-alfred-personas/SKILL.md +429 -0
- moai_adk/templates/.claude/skills/moai-alfred-personas/examples.md +520 -0
- moai_adk/templates/.claude/skills/moai-alfred-personas/reference.md +405 -0
- moai_adk/templates/.claude/skills/moai-alfred-practices/SKILL.md +89 -0
- moai_adk/templates/.claude/skills/moai-alfred-practices/examples.md +122 -0
- moai_adk/templates/.claude/skills/moai-alfred-practices/reference.md +369 -0
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/SKILL.md +508 -0
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/examples.md +481 -0
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/reference.md +100 -0
- moai_adk/templates/.claude/skills/moai-alfred-rules/SKILL.md +77 -0
- moai_adk/templates/.claude/skills/moai-alfred-rules/examples.md +265 -0
- moai_adk/templates/.claude/skills/moai-alfred-rules/reference.md +539 -0
- moai_adk/templates/.claude/skills/moai-alfred-session-state/SKILL.md +320 -0
- moai_adk/templates/.claude/skills/moai-alfred-session-state/examples.md +4 -0
- moai_adk/templates/.claude/skills/moai-alfred-session-state/reference.md +84 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/README.md +137 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/SKILL.md +219 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples/validate-spec.sh +161 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples.md +541 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/reference.md +622 -0
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/SKILL.md +19 -0
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/examples.md +4 -0
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/reference.md +211 -0
- moai_adk/templates/.claude/skills/moai-alfred-workflow/SKILL.md +288 -0
- moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +269 -0
- moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +32 -0
- moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +298 -0
- moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +26 -0
- moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +307 -0
- moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +21 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +252 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +19 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +19 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +24 -0
- moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +199 -0
- moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +39 -0
- moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +316 -0
- moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +18 -0
- moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +263 -0
- moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +30 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/CHECKLIST.md +482 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/EXAMPLES.md +303 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/INTERACTIVE-DISCOVERY.md +524 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/METADATA.md +477 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/PARALLEL-ANALYSIS-REPORT.md +429 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/PYTHON-VERSION-MATRIX.md +391 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-FACTORY-WORKFLOW.md +431 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-UPDATE-ADVISOR.md +577 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL.md +273 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/STEP-BY-STEP-GUIDE.md +466 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/STRUCTURE.md +583 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/WEB-RESEARCH.md +526 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/reference.md +608 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/generate-structure.sh +328 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/validate-skill.sh +312 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/SKILL_TEMPLATE.md +245 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/examples-template.md +285 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/reference-template.md +278 -0
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/scripts-template.sh +303 -0
- moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +291 -0
- moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +15 -0
- moai_adk/templates/.claude/skills/moai-change-logger/SKILL.md +563 -0
- moai_adk/templates/.claude/skills/moai-design-systems/SKILL.md +802 -0
- moai_adk/templates/.claude/skills/moai-design-systems/examples.md +1238 -0
- moai_adk/templates/.claude/skills/moai-design-systems/reference.md +673 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +234 -43
- moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +1633 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +660 -0
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +97 -69
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +97 -72
- moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-domain-database/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-database/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +102 -73
- moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +97 -73
- moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +97 -67
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +97 -79
- moai_adk/templates/.claude/skills/moai-domain-security/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-security/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -71
- moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +265 -64
- moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +1064 -0
- moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +1047 -0
- moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +87 -78
- moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +87 -70
- moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +87 -86
- moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +80 -62
- moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +207 -50
- moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +90 -71
- moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +78 -58
- moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +78 -51
- moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-trust/.!11330!examples.md +0 -0
- moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +253 -32
- moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
- moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +1099 -0
- moai_adk/templates/.claude/skills/moai-jit-docs-enhanced/SKILL.md +460 -0
- moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-c/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-c/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +98 -76
- moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +2358 -70
- moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +2962 -68
- moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +1898 -70
- moai_adk/templates/.claude/skills/moai-lang-go/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-go/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +1465 -68
- moai_adk/templates/.claude/skills/moai-lang-java/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-java/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +2364 -66
- moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +32 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +1630 -69
- moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +89 -61
- moai_adk/templates/.claude/skills/moai-lang-php/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-php/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +735 -66
- moai_adk/templates/.claude/skills/moai-lang-python/examples.md +624 -0
- moai_adk/templates/.claude/skills/moai-lang-python/reference.md +316 -0
- moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +97 -73
- moai_adk/templates/.claude/skills/moai-lang-r/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-r/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +98 -73
- moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +1834 -70
- moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +99 -74
- moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +1959 -69
- moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-template/SKILL.md +348 -0
- moai_adk/templates/.claude/skills/moai-lang-template/VARIABLES.md +98 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +1230 -66
- moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +34 -0
- moai_adk/templates/.claude/skills/moai-learning-optimizer/SKILL.md +575 -0
- moai_adk/templates/.claude/skills/moai-project-batch-questions/README.md +50 -0
- moai_adk/templates/.claude/skills/moai-project-batch-questions/SKILL.md +304 -0
- moai_adk/templates/.claude/skills/moai-project-batch-questions/examples.md +417 -0
- moai_adk/templates/.claude/skills/moai-project-batch-questions/reference.md +704 -0
- moai_adk/templates/.claude/skills/moai-project-config-manager/README.md +87 -0
- moai_adk/templates/.claude/skills/moai-project-config-manager/SKILL.md +552 -0
- moai_adk/templates/.claude/skills/moai-project-config-manager/examples.md +1109 -0
- moai_adk/templates/.claude/skills/moai-project-config-manager/reference.md +514 -0
- moai_adk/templates/.claude/skills/moai-project-config-manager/validate.py +106 -0
- moai_adk/templates/.claude/skills/moai-project-documentation/README.md +11 -0
- moai_adk/templates/.claude/skills/moai-project-documentation/SKILL.md +622 -0
- moai_adk/templates/.claude/skills/moai-project-documentation/examples.md +20 -0
- moai_adk/templates/.claude/skills/moai-project-documentation/reference.md +12 -0
- moai_adk/templates/.claude/skills/moai-project-language-initializer/README.md +152 -0
- moai_adk/templates/.claude/skills/moai-project-language-initializer/SKILL.md +285 -0
- moai_adk/templates/.claude/skills/moai-project-language-initializer/examples.md +333 -0
- moai_adk/templates/.claude/skills/moai-project-language-initializer/reference.md +386 -0
- moai_adk/templates/.claude/skills/moai-project-template-optimizer/README.md +49 -0
- moai_adk/templates/.claude/skills/moai-project-template-optimizer/SKILL.md +319 -0
- moai_adk/templates/.claude/skills/moai-project-template-optimizer/examples.md +58 -0
- moai_adk/templates/.claude/skills/moai-project-template-optimizer/reference.md +123 -0
- moai_adk/templates/.claude/skills/moai-session-info/SKILL.md +314 -0
- moai_adk/templates/.claude/skills/moai-streaming-ui/SKILL.md +552 -0
- moai_adk/templates/.claude/skills/moai-tag-policy-validator/SKILL.md +570 -0
- moai_adk/templates/.git-hooks/pre-commit +66 -0
- moai_adk/templates/.git-hooks/pre-push +255 -0
- moai_adk/templates/.github/workflows/c-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/cpp-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/csharp-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/dart-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/go-tag-validation.yml +130 -0
- moai_adk/templates/.github/workflows/java-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/javascript-tag-validation.yml +135 -0
- moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/moai-gitflow.yml +166 -3
- moai_adk/templates/.github/workflows/moai-release-create.yml +100 -0
- moai_adk/templates/.github/workflows/moai-release-pipeline.yml +188 -0
- moai_adk/templates/.github/workflows/php-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/python-tag-validation.yml +118 -0
- moai_adk/templates/.github/workflows/release.yml +118 -0
- moai_adk/templates/.github/workflows/ruby-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/rust-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/shell-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/spec-issue-sync.yml +338 -0
- moai_adk/templates/.github/workflows/swift-tag-validation.yml +11 -0
- moai_adk/templates/.github/workflows/tag-report.yml +269 -0
- moai_adk/templates/.github/workflows/tag-validation.yml +186 -0
- moai_adk/templates/.github/workflows/typescript-tag-validation.yml +154 -0
- moai_adk/templates/.mcp.json +31 -0
- moai_adk/templates/.moai/config.json +80 -7
- moai_adk/templates/CLAUDE.md +562 -546
- moai_adk/utils/banner.py +5 -5
- moai_adk/utils/common.py +294 -0
- moai_adk/utils/link_validator.py +235 -0
- moai_adk/utils/logger.py +8 -8
- moai_adk/utils/user_experience.py +451 -0
- moai_adk-0.20.1.dist-info/METADATA +233 -0
- moai_adk-0.20.1.dist-info/RECORD +404 -0
- moai_adk/templates/.claude/hooks/alfred/README.md +0 -230
- moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +0 -156
- moai_adk/templates/.claude/hooks/alfred/core/__init__.py +0 -85
- moai_adk/templates/.claude/hooks/alfred/handlers/notification.py +0 -25
- moai_adk/templates/.claude/hooks/alfred/handlers/session.py +0 -92
- moai_adk/templates/.claude/hooks/alfred/handlers/tool.py +0 -70
- moai_adk/templates/.claude/hooks/alfred/handlers/user.py +0 -41
- moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +0 -636
- moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +0 -692
- moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +0 -470
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +0 -103
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +0 -103
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +0 -95
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +0 -105
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +0 -97
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +0 -97
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +0 -90
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +0 -99
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +0 -87
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +0 -62
- moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +0 -94
- moai_adk/templates/.claude/skills/moai-claude-code/examples.md +0 -513
- moai_adk/templates/.claude/skills/moai-claude-code/reference.md +0 -433
- moai_adk/templates/.claude/skills/moai-claude-code/templates/agent-full.md +0 -332
- moai_adk/templates/.claude/skills/moai-claude-code/templates/command-full.md +0 -384
- moai_adk/templates/.claude/skills/moai-claude-code/templates/plugin-full.json +0 -363
- moai_adk/templates/.claude/skills/moai-claude-code/templates/settings-full.json +0 -595
- moai_adk/templates/.claude/skills/moai-claude-code/templates/skill-full.md +0 -496
- moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +0 -100
- moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +0 -99
- moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +0 -100
- moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +0 -98
- moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +0 -98
- moai_adk/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -69
- moai_adk/templates/.moai/memory/development-guide.md +0 -344
- moai_adk/templates/.moai/memory/gitflow-protection-policy.md +0 -220
- moai_adk/templates/.moai/memory/spec-metadata.md +0 -356
- moai_adk/templates/.moai/project/product.md +0 -161
- moai_adk/templates/.moai/project/structure.md +0 -156
- moai_adk/templates/.moai/project/tech.md +0 -227
- moai_adk/templates/__init__.py +0 -2
- moai_adk-0.4.5.dist-info/METADATA +0 -369
- moai_adk-0.4.5.dist-info/RECORD +0 -152
- {moai_adk-0.4.5.dist-info → moai_adk-0.20.1.dist-info}/WHEEL +0 -0
- {moai_adk-0.4.5.dist-info → moai_adk-0.20.1.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.4.5.dist-info → moai_adk-0.20.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: alfred:3-sync
|
|
3
|
-
description:
|
|
4
|
-
argument-hint:
|
|
3
|
+
description: "Synchronize documentation and finalize PR"
|
|
4
|
+
argument-hint: 'Mode target path - Mode: auto (default)|force|status|project, target
|
|
5
|
+
path: Synchronization target path'
|
|
5
6
|
allowed-tools:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
- Read
|
|
8
|
+
- Write
|
|
9
|
+
- Edit
|
|
10
|
+
- MultiEdit
|
|
11
|
+
- Bash(git:*)
|
|
12
|
+
- Bash(gh:*)
|
|
13
|
+
- Bash(python3:*)
|
|
14
|
+
- Task
|
|
15
|
+
- Grep
|
|
16
|
+
- Glob
|
|
17
|
+
- TodoWrite
|
|
17
18
|
---
|
|
18
19
|
|
|
19
20
|
# 📚 MoAI-ADK Step 3: Document Synchronization (+Optional PR Ready)
|
|
20
|
-
> Interactive prompts rely on `Skill("moai-alfred-tui-survey")` so AskUserQuestion renders TUI selection menus for user surveys and approvals.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
> **Note**: Interactive prompts use `AskUserQuestion tool (documented in moai-alfred-ask-user-questions skill)` for TUI selection menus. The skill is loaded on-demand when user interaction is required.
|
|
23
|
+
>
|
|
24
|
+
> **Batched Design**: All AskUserQuestion calls follow batched design principles (1-4 questions per call) to minimize user interaction turns. See CLAUDE.md section "Alfred Command Completion Pattern" for details.
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
<!-- @CODE:ALF-WORKFLOW-003:CMD-SYNC -->
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
Skill("moai-alfred-tui-survey")
|
|
28
|
-
```
|
|
28
|
+
**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.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
---
|
|
31
31
|
|
|
32
32
|
## 🎯 Command Purpose
|
|
33
33
|
|
|
@@ -35,29 +35,35 @@ Synchronize code changes to Living Documents and verify @TAG system to ensure co
|
|
|
35
35
|
|
|
36
36
|
**Document sync to**: $ARGUMENTS
|
|
37
37
|
|
|
38
|
-
> **Standard
|
|
38
|
+
> **Standard workflow**: STEP 1 (Analysis & Planning) → User Approval → STEP 2 (Document Sync) → STEP 3 (Git Commit & PR)
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 📋 Execution Modes
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
This command supports **4 operational modes**:
|
|
41
45
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
| Mode | Scope | PR Processing | Use Case |
|
|
47
|
+
|------|-------|---------------|----------|
|
|
48
|
+
| **auto** (default) | Smart selective sync | PR Ready conversion | Daily development workflow |
|
|
49
|
+
| **force** | Full project re-sync | Full regeneration | Error recovery, major refactoring |
|
|
50
|
+
| **status** | Status check only | Report only | Quick health check |
|
|
51
|
+
| **project** | Integrated project-wide | Project-level updates | Milestone completion, periodic sync |
|
|
45
52
|
|
|
46
|
-
**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
3
|
|
53
|
+
**Command usage examples**:
|
|
54
|
+
- `/alfred:3-sync` → Auto-sync (PR Ready only)
|
|
55
|
+
- `/alfred:3-sync --auto-merge` → PR auto-merge + branch cleanup
|
|
56
|
+
- `/alfred:3-sync force` → Force full synchronization
|
|
57
|
+
- `/alfred:3-sync status` → Check synchronization status
|
|
58
|
+
- `/alfred:3-sync project` → Integrated project synchronization
|
|
59
|
+
- `/alfred:3-sync auto src/auth/` → Specific path synchronization
|
|
50
60
|
|
|
51
|
-
|
|
52
|
-
4. **Document Synchronization**: Living Document updates and TAG integrity guaranteed (IF user selects "Proceed")
|
|
53
|
-
5. **Git operations**: Commit and PR state transitions via git-manager (IF user selects "Proceed")
|
|
54
|
-
- OR abort workflow (IF user selects "Abort")
|
|
55
|
-
- OR revise plan (IF user selects "Modify")
|
|
61
|
+
---
|
|
56
62
|
|
|
57
63
|
## 🧠 Associated Skills & Agents
|
|
58
64
|
|
|
59
65
|
| Agent | Core Skill | Purpose |
|
|
60
|
-
|
|
|
66
|
+
| ------------ | ------------------------------ | ------------------------------ |
|
|
61
67
|
| tag-agent | `moai-alfred-tag-scanning` | Verify TAG system integrity |
|
|
62
68
|
| quality-gate | `moai-alfred-trust-validation` | Check code quality before sync |
|
|
63
69
|
| doc-syncer | `moai-alfred-tag-scanning` | Synchronize Living Documents |
|
|
@@ -65,521 +71,2026 @@ Synchronize code changes to Living Documents and verify @TAG system to ensure co
|
|
|
65
71
|
|
|
66
72
|
**Note**: TUI Survey Skill is loaded once at Phase 0 and reused throughout all user interactions.
|
|
67
73
|
|
|
68
|
-
|
|
74
|
+
---
|
|
69
75
|
|
|
70
|
-
|
|
71
|
-
- **Primary**: doc-syncer (📖 Technical Writer) - Dedicated to document synchronization
|
|
72
|
-
- **Secondary**: git-manager (🚀 Release Engineer) - Dedicated to Git commits/PR
|
|
76
|
+
## 🚀 OVERALL WORKFLOW STRUCTURE
|
|
73
77
|
|
|
74
|
-
|
|
78
|
+
```
|
|
79
|
+
┌──────────────────────────────────────────────────────────┐
|
|
80
|
+
│ STEP 0: Load Skills (IMMEDIATE) │
|
|
81
|
+
│ → Load moai-alfred-ask-user-questions Skill │
|
|
82
|
+
│ → Enable TUI menu rendering │
|
|
83
|
+
└──────────────────────────────────────────────────────────┘
|
|
84
|
+
↓
|
|
85
|
+
┌──────────────────────────────────────────────────────────┐
|
|
86
|
+
│ STEP 1: Analysis & Planning │
|
|
87
|
+
│ STEP 1.1: Verify prerequisites │
|
|
88
|
+
│ STEP 1.2: Analyze project status (Git + TAG) │
|
|
89
|
+
│ STEP 1.3: Determine sync scope (mode-specific) │
|
|
90
|
+
│ STEP 1.4: (Optional) TAG chain navigation │
|
|
91
|
+
│ STEP 1.5: Create synchronization plan │
|
|
92
|
+
│ STEP 1.6: Request user approval (AskUserQuestion) │
|
|
93
|
+
└──────────────────────────────────────────────────────────┘
|
|
94
|
+
↓
|
|
95
|
+
┌───────────────┴───────────────┐
|
|
96
|
+
│ │
|
|
97
|
+
User chooses User chooses
|
|
98
|
+
"Proceed" "Abort/Modify"
|
|
99
|
+
│ │
|
|
100
|
+
↓ ↓
|
|
101
|
+
┌─────────────────────────┐ ┌──────────────────────┐
|
|
102
|
+
│ STEP 2: Execute Sync │ │ STEP 4: Graceful Exit│
|
|
103
|
+
│ STEP 2.1: Safety backup│ │ → Display abort msg │
|
|
104
|
+
│ STEP 2.2: Living Doc │ │ → OR re-analyze │
|
|
105
|
+
│ STEP 2.3: TAG update │ └──────────────────────┘
|
|
106
|
+
│ STEP 2.4: SPEC sync │
|
|
107
|
+
│ STEP 2.5: Domain sync │
|
|
108
|
+
│ STEP 2.6: Completion │
|
|
109
|
+
└─────────────────────────┘
|
|
110
|
+
↓
|
|
111
|
+
┌──────────────────────────────────────────────────────────┐
|
|
112
|
+
│ STEP 3: Git Operations & PR │
|
|
113
|
+
│ STEP 3.1: Commit document changes (git-manager) │
|
|
114
|
+
│ STEP 3.2: (Optional) PR Ready transition │
|
|
115
|
+
│ STEP 3.3: (Optional) PR auto-merge (--auto-merge flag) │
|
|
116
|
+
│ STEP 3.4: (Optional) Branch cleanup │
|
|
117
|
+
│ STEP 3.5: Display completion report │
|
|
118
|
+
└──────────────────────────────────────────────────────────┘
|
|
119
|
+
```
|
|
75
120
|
|
|
76
|
-
|
|
77
|
-
- `/alfred:3-sync` - Auto-sync (PR Ready only)
|
|
78
|
-
- `/alfred:3-sync --auto-merge` - PR auto-merge + branch cleanup
|
|
79
|
-
- `/alfred:3-sync force` - Force full synchronization
|
|
80
|
-
- `/alfred:3-sync status` - Check synchronization status
|
|
81
|
-
- `/alfred:3-sync project` - Integrated project synchronization
|
|
121
|
+
---
|
|
82
122
|
|
|
83
|
-
|
|
123
|
+
## 🔧 STEP 0: Load Skills (IMMEDIATE)
|
|
84
124
|
|
|
85
|
-
**
|
|
86
|
-
1. Document synchronization complete
|
|
87
|
-
2. Switch to PR Ready
|
|
88
|
-
3. Check CI/CD status
|
|
89
|
-
4. PR automatic merge (squash)
|
|
90
|
-
5. Develop checkout and synchronization
|
|
91
|
-
6. Organizing local feature branches
|
|
92
|
-
7. **Ready for next task** ✅
|
|
125
|
+
**Your task**: Load the TUI Survey Skill at the very beginning to enable interactive menus.
|
|
93
126
|
|
|
94
|
-
**
|
|
127
|
+
**Steps**:
|
|
95
128
|
|
|
96
|
-
**
|
|
129
|
+
1. **Load the skill immediately**:
|
|
130
|
+
```
|
|
131
|
+
Invoke Skill: moai-alfred-ask-user-questions
|
|
132
|
+
```
|
|
97
133
|
|
|
98
|
-
|
|
134
|
+
2. **Why this matters**:
|
|
135
|
+
- This skill provides TUI menu rendering capabilities
|
|
136
|
+
- Must be loaded BEFORE any user interaction
|
|
137
|
+
- Used in STEP 1.6, STEP 2.6, and STEP 3.5
|
|
99
138
|
|
|
100
|
-
|
|
139
|
+
**Result**: TUI menu system ready for all subsequent user interactions.
|
|
101
140
|
|
|
102
|
-
**
|
|
141
|
+
**Next step**: Go to STEP 1.1
|
|
103
142
|
|
|
104
|
-
|
|
143
|
+
---
|
|
105
144
|
|
|
106
|
-
|
|
145
|
+
## 📊 STEP 1: Analysis & Planning
|
|
107
146
|
|
|
108
|
-
|
|
109
|
-
Invoking the Task tool (Explore agent):
|
|
110
|
-
- subagent_type: "Explore"
|
|
111
|
-
- description: "Scan entire TAG system"
|
|
112
|
-
- prompt: "Please scan @TAG system throughout the project:
|
|
113
|
-
- @SPEC TAG location (.moai/specs/)
|
|
114
|
-
- @TEST TAG location (tests/)
|
|
115
|
-
- @CODE TAG location (src/)
|
|
116
|
-
- @DOC TAG location (docs/)
|
|
117
|
-
- Detect orphan TAGs and broken references
|
|
118
|
-
Thoroughness level: very thorough"
|
|
119
|
-
```
|
|
147
|
+
### STEP 1.1: Verify Prerequisites
|
|
120
148
|
|
|
121
|
-
**
|
|
122
|
-
- ✅ Large projects (100+ files)
|
|
123
|
-
- ✅ When TAG chain integrity verification is required
|
|
124
|
-
- ✅ Changes across multiple SPECs
|
|
125
|
-
- ❌ Simple changes to a single SPEC
|
|
149
|
+
**Your task**: Check that all required components exist before starting synchronization analysis.
|
|
126
150
|
|
|
127
|
-
|
|
151
|
+
**Steps**:
|
|
128
152
|
|
|
129
|
-
|
|
153
|
+
1. **Check MoAI-ADK project structure**:
|
|
154
|
+
- Directory to check: `.moai/` and `.claude/`
|
|
155
|
+
- IF `.moai/` does NOT exist → Print error and exit:
|
|
156
|
+
```
|
|
157
|
+
❌ Error: Not a MoAI-ADK project
|
|
130
158
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
- prompt: "Please verify the integrity of the entire TAG chain.
|
|
136
|
-
Please verify the integrity of @SPEC, @TEST, @CODE, @DOC TAGs
|
|
137
|
-
and orphan TAGs.
|
|
138
|
-
(Optional) Explore results: $EXPLORE_RESULTS"
|
|
139
|
-
|
|
140
|
-
2. doc-syncer call (synchronization plan):
|
|
141
|
-
- subagent_type: "doc-syncer"
|
|
142
|
-
- description: "Establish a document synchronization plan"
|
|
143
|
-
- prompt: "Please analyze Git changes and establish a document synchronization plan.
|
|
144
|
-
$ARGUMENTS
|
|
145
|
-
(Optional) TAG validation results: $TAG_VALIDATION_RESULTS"
|
|
146
|
-
```
|
|
159
|
+
This command requires MoAI-ADK structure:
|
|
160
|
+
- .moai/config.json (project configuration)
|
|
161
|
+
- .moai/specs/ (SPEC documents)
|
|
162
|
+
- .claude/ (Claude Code configuration)
|
|
147
163
|
|
|
148
|
-
|
|
164
|
+
Run `/alfred:0-project init` to initialize a project.
|
|
165
|
+
```
|
|
149
166
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
167
|
+
2. **Check Git repository status**:
|
|
168
|
+
- Execute: `git rev-parse --is-inside-work-tree`
|
|
169
|
+
- IF NOT a Git repository → Print error and exit:
|
|
170
|
+
```
|
|
171
|
+
❌ Error: Not a Git repository
|
|
155
172
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
- PR status transition possibility (team mode)
|
|
173
|
+
This command requires Git version control.
|
|
174
|
+
Initialize with: git init
|
|
175
|
+
```
|
|
160
176
|
|
|
161
|
-
3. **
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
177
|
+
3. **Verify Python environment** (for TAG verification):
|
|
178
|
+
- Execute: `which python3`
|
|
179
|
+
- IF python3 NOT found → Print warning (non-fatal):
|
|
180
|
+
```
|
|
181
|
+
⚠️ Warning: Python3 not found
|
|
165
182
|
|
|
166
|
-
|
|
183
|
+
TAG verification scripts may not run.
|
|
184
|
+
Synchronization will continue with limited TAG checks.
|
|
185
|
+
```
|
|
167
186
|
|
|
168
|
-
|
|
187
|
+
4. **Print prerequisites status**:
|
|
188
|
+
```
|
|
189
|
+
✅ Prerequisites verified:
|
|
190
|
+
- MoAI-ADK structure: OK
|
|
191
|
+
- Git repository: OK
|
|
192
|
+
- Python environment: OK (or WARNING)
|
|
193
|
+
```
|
|
169
194
|
|
|
170
|
-
**
|
|
171
|
-
- **Phase 3**: In-depth verification after completion of TDD implementation (test coverage, code quality, security)
|
|
172
|
-
- **Phase 1**: Quick scan before synchronization (file corruption, critical issues only)
|
|
195
|
+
**Result**: All prerequisites validated. Ready for analysis.
|
|
173
196
|
|
|
174
|
-
**
|
|
197
|
+
**Next step**: Go to STEP 1.2
|
|
175
198
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
### STEP 1.2: Analyze Project Status
|
|
202
|
+
|
|
203
|
+
**Your task**: Gather Git changes and project metadata to determine synchronization scope.
|
|
204
|
+
|
|
205
|
+
**Steps**:
|
|
206
|
+
|
|
207
|
+
1. **Check Git status**:
|
|
208
|
+
- Execute: `git status --porcelain`
|
|
209
|
+
- Store result in variable: `$GIT_STATUS`
|
|
210
|
+
|
|
211
|
+
2. **Get list of changed files**:
|
|
212
|
+
- Execute: `git diff --name-only HEAD`
|
|
213
|
+
- Store result in variable: `$CHANGED_FILES`
|
|
214
|
+
|
|
215
|
+
3. **Count changes by type**:
|
|
216
|
+
- Python files changed: Count files matching `*.py` in `$CHANGED_FILES`
|
|
217
|
+
- Test files changed: Count files in `tests/` directory
|
|
218
|
+
- Document files changed: Count files matching `*.md` in `$CHANGED_FILES`
|
|
219
|
+
- SPEC files changed: Count files in `.moai/specs/` directory
|
|
220
|
+
|
|
221
|
+
4. **Read project configuration**:
|
|
222
|
+
- Read file: `.moai/config.json`
|
|
223
|
+
- Extract values:
|
|
224
|
+
- `git_strategy.mode` → Store as `$PROJECT_MODE` (Personal/Team)
|
|
225
|
+
- `git_strategy.spec_git_workflow` → Store as `$WORKFLOW` (feature_branch/develop_direct)
|
|
226
|
+
- `language.conversation_language` → Store as `$LANG`
|
|
181
227
|
|
|
182
|
-
**
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
- **TAG chain**: Verify changed TAG integrity
|
|
228
|
+
5. **Determine if changes are code-heavy or document-heavy**:
|
|
229
|
+
- IF Python files changed > 50 lines → `$CHANGE_TYPE = "code-heavy"`
|
|
230
|
+
- ELSE IF document files changed > 10 lines → `$CHANGE_TYPE = "doc-heavy"`
|
|
231
|
+
- ELSE → `$CHANGE_TYPE = "mixed"`
|
|
187
232
|
|
|
188
|
-
**
|
|
189
|
-
|
|
233
|
+
6. **Print analysis summary**:
|
|
234
|
+
```
|
|
235
|
+
📊 Project Status Analysis
|
|
190
236
|
|
|
191
|
-
|
|
237
|
+
Git Status:
|
|
238
|
+
- Changed files: [count from $CHANGED_FILES]
|
|
239
|
+
- Python files: [count]
|
|
240
|
+
- Test files: [count]
|
|
241
|
+
- Documents: [count]
|
|
242
|
+
- SPEC files: [count]
|
|
192
243
|
|
|
193
|
-
|
|
244
|
+
Project Configuration:
|
|
245
|
+
- Mode: $PROJECT_MODE (Personal/Team)
|
|
246
|
+
- Workflow: $WORKFLOW
|
|
247
|
+
- Language: $LANG
|
|
248
|
+
- Change type: $CHANGE_TYPE
|
|
249
|
+
```
|
|
194
250
|
|
|
195
|
-
|
|
251
|
+
**Result**: Project status analyzed and stored in variables.
|
|
196
252
|
|
|
197
|
-
|
|
198
|
-
- Critical issue found: Synchronization stopped, correction recommended
|
|
199
|
-
- User selection: “Retry after modification” or “Force proceed”
|
|
253
|
+
**Next step**: Go to STEP 1.3
|
|
200
254
|
|
|
201
|
-
|
|
202
|
-
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
### STEP 1.3: Determine Sync Scope (Mode-Specific)
|
|
258
|
+
|
|
259
|
+
**Your task**: Determine which files and documents need synchronization based on the selected mode.
|
|
260
|
+
|
|
261
|
+
**Steps**:
|
|
262
|
+
|
|
263
|
+
1. **Read mode from $ARGUMENTS**:
|
|
264
|
+
- Parse first argument: `$1` → Store as `$MODE`
|
|
265
|
+
- IF `$MODE` is empty → Set `$MODE = "auto"`
|
|
266
|
+
- Valid modes: `auto`, `force`, `status`, `project`
|
|
267
|
+
|
|
268
|
+
2. **IF mode is "status"**:
|
|
269
|
+
- **Your task**: Perform quick status check only (no synchronization)
|
|
270
|
+
- Execute: `python3 .moai/scripts/tag_scanner.py --status-only`
|
|
271
|
+
- Read file: `.moai/reports/sync-report-latest.md` (if exists)
|
|
272
|
+
- Print status:
|
|
273
|
+
```
|
|
274
|
+
📊 Synchronization Status
|
|
275
|
+
|
|
276
|
+
Last sync: [date from sync-report-latest.md]
|
|
277
|
+
|
|
278
|
+
TAG System Health:
|
|
279
|
+
- @SPEC TAGs: [count] found
|
|
280
|
+
- @CODE TAGs: [count] found
|
|
281
|
+
- @TEST TAGs: [count] found
|
|
282
|
+
- @DOC TAGs: [count] found
|
|
283
|
+
- Orphan TAGs: [count] (if any)
|
|
284
|
+
|
|
285
|
+
Git Status:
|
|
286
|
+
- Changed files since last sync: [count]
|
|
287
|
+
- Uncommitted changes: [yes/no]
|
|
288
|
+
|
|
289
|
+
Recommendation: [Sync needed / Up to date]
|
|
290
|
+
```
|
|
291
|
+
- **STOP HERE** → Exit command (status mode complete)
|
|
292
|
+
|
|
293
|
+
3. **IF mode is "force"**:
|
|
294
|
+
- **Your task**: Force full re-synchronization of all documents
|
|
295
|
+
- Set scope variables:
|
|
296
|
+
- `$SYNC_SCOPE = "full"`
|
|
297
|
+
- `$TARGET_DIRS = "src/ tests/ docs/ .moai/specs/"`
|
|
298
|
+
- `$REGENERATE_ALL = true`
|
|
299
|
+
- Print:
|
|
300
|
+
```
|
|
301
|
+
🔄 Force Mode Activated
|
|
302
|
+
|
|
303
|
+
Synchronization scope: FULL PROJECT
|
|
304
|
+
- All source files will be scanned
|
|
305
|
+
- All documents will be regenerated
|
|
306
|
+
- All TAG chains will be re-verified
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
4. **IF mode is "project"**:
|
|
310
|
+
- **Your task**: Project-wide integrated synchronization
|
|
311
|
+
- Set scope variables:
|
|
312
|
+
- `$SYNC_SCOPE = "project"`
|
|
313
|
+
- `$TARGET_DIRS = "src/ tests/ docs/ .moai/specs/ README.md"`
|
|
314
|
+
- `$UPDATE_PROJECT_DOCS = true`
|
|
315
|
+
- Print:
|
|
316
|
+
```
|
|
317
|
+
🏢 Project Mode Activated
|
|
318
|
+
|
|
319
|
+
Synchronization scope: INTEGRATED PROJECT
|
|
320
|
+
- README.md will be updated (full feature list)
|
|
321
|
+
- docs/architecture.md will be updated
|
|
322
|
+
- docs/api/ will be unified
|
|
323
|
+
- .moai/indexes/ will be rebuilt
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
5. **IF mode is "auto"** (default):
|
|
327
|
+
- **Your task**: Smart selective synchronization based on Git changes
|
|
328
|
+
- Set scope variables:
|
|
329
|
+
- `$SYNC_SCOPE = "selective"`
|
|
330
|
+
- `$TARGET_DIRS = [directories from $CHANGED_FILES]`
|
|
331
|
+
- `$UPDATE_PROJECT_DOCS = false`
|
|
332
|
+
- Determine selective scope:
|
|
333
|
+
- IF `$CHANGE_TYPE = "code-heavy"` → Include `src/`, `tests/`, related SPEC
|
|
334
|
+
- IF `$CHANGE_TYPE = "doc-heavy"` → Include `docs/`, `.moai/specs/`
|
|
335
|
+
- IF `$CHANGE_TYPE = "mixed"` → Include all changed directories
|
|
336
|
+
- Print:
|
|
337
|
+
```
|
|
338
|
+
🎯 Auto Mode Activated
|
|
339
|
+
|
|
340
|
+
Synchronization scope: SELECTIVE
|
|
341
|
+
- Target directories: $TARGET_DIRS
|
|
342
|
+
- Changed files: [count]
|
|
343
|
+
- Estimated sync time: [based on change count]
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
6. **Parse additional flags from $ARGUMENTS**:
|
|
347
|
+
- Search for `--auto-merge` flag → Set `$AUTO_MERGE = true` (default: false)
|
|
348
|
+
- Search for `--skip-pre-check` flag → Set `$SKIP_PRE_CHECK = true` (default: false)
|
|
349
|
+
- Search for `--skip-quality-check` flag → Set `$SKIP_QUALITY_CHECK = true` (default: false)
|
|
350
|
+
|
|
351
|
+
**Result**: Synchronization scope determined and stored in variables.
|
|
352
|
+
|
|
353
|
+
**Next step**:
|
|
354
|
+
- IF mode was "status" → EXIT (already completed)
|
|
355
|
+
- ELSE → Go to STEP 1.4
|
|
203
356
|
|
|
204
357
|
---
|
|
205
358
|
|
|
206
|
-
###
|
|
359
|
+
### STEP 1.4: (Optional) TAG Chain Navigation
|
|
360
|
+
|
|
361
|
+
**Your task**: Optionally perform comprehensive TAG chain exploration for large projects.
|
|
362
|
+
|
|
363
|
+
**Decision point**:
|
|
364
|
+
|
|
365
|
+
1. **Determine if TAG exploration is needed**:
|
|
366
|
+
- IF `$MODE = "force"` OR `$MODE = "project"` → TAG exploration REQUIRED
|
|
367
|
+
- ELSE IF changed files > 100 → TAG exploration RECOMMENDED
|
|
368
|
+
- ELSE IF `$SYNC_SCOPE = "selective"` → SKIP exploration (go to STEP 1.5)
|
|
369
|
+
|
|
370
|
+
2. **IF TAG exploration is REQUIRED or RECOMMENDED**:
|
|
371
|
+
- Print:
|
|
372
|
+
```
|
|
373
|
+
🔍 TAG Chain Navigation
|
|
374
|
+
|
|
375
|
+
Performing comprehensive TAG system scan...
|
|
376
|
+
This may take a few moments for large projects.
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
3. **Invoke Explore agent for TAG scanning**:
|
|
380
|
+
- **Your task**: Call the Explore agent to scan entire TAG system
|
|
381
|
+
- Use Task tool:
|
|
382
|
+
- `subagent_type`: "Explore"
|
|
383
|
+
- `description`: "Scan entire TAG system across project"
|
|
384
|
+
- `prompt`:
|
|
385
|
+
```
|
|
386
|
+
Please scan the entire @TAG system across the project:
|
|
387
|
+
|
|
388
|
+
Scan scope:
|
|
389
|
+
- @SPEC TAG locations (.moai/specs/)
|
|
390
|
+
- @TEST TAG locations (tests/)
|
|
391
|
+
- @CODE TAG locations (src/)
|
|
392
|
+
- @DOC TAG locations (docs/)
|
|
393
|
+
|
|
394
|
+
Validation items:
|
|
395
|
+
- Detect orphan TAGs
|
|
396
|
+
- Detect broken references
|
|
397
|
+
- Detect duplicate TAGs
|
|
398
|
+
|
|
399
|
+
Thoroughness level: very thorough
|
|
400
|
+
|
|
401
|
+
Output format:
|
|
402
|
+
- Complete TAG inventory list
|
|
403
|
+
- List of problematic TAGs (with locations)
|
|
404
|
+
- Recommended fixes
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
4. **Store Explore agent results**:
|
|
408
|
+
- Read response from Explore agent
|
|
409
|
+
- Store in variable: `$EXPLORE_RESULTS`
|
|
410
|
+
- Print summary:
|
|
411
|
+
```
|
|
412
|
+
✅ TAG exploration complete
|
|
413
|
+
|
|
414
|
+
TAG inventory:
|
|
415
|
+
- @SPEC TAGs found: [count]
|
|
416
|
+
- @CODE TAGs found: [count]
|
|
417
|
+
- @TEST TAGs found: [count]
|
|
418
|
+
- @DOC TAGs found: [count]
|
|
419
|
+
|
|
420
|
+
Issues detected:
|
|
421
|
+
- Orphan TAGs: [count]
|
|
422
|
+
- Broken references: [count]
|
|
423
|
+
- Duplicate TAGs: [count]
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
5. **IF TAG exploration was SKIPPED**:
|
|
427
|
+
- Set `$EXPLORE_RESULTS = null`
|
|
428
|
+
- Print:
|
|
429
|
+
```
|
|
430
|
+
⏩ TAG exploration skipped (not needed for selective sync)
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
**Result**: TAG chain exploration completed (or skipped). Results stored in `$EXPLORE_RESULTS`.
|
|
434
|
+
|
|
435
|
+
**Next step**: Go to STEP 1.5
|
|
436
|
+
|
|
437
|
+
---
|
|
207
438
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
439
|
+
### STEP 1.5: Create Synchronization Plan
|
|
440
|
+
|
|
441
|
+
**Your task**: Call tag-agent and doc-syncer to verify TAG integrity and establish a detailed synchronization plan.
|
|
442
|
+
|
|
443
|
+
**This phase runs TWO agents sequentially**:
|
|
444
|
+
|
|
445
|
+
1. **Tag-agent call (TAG verification across ENTIRE PROJECT)**:
|
|
446
|
+
|
|
447
|
+
- **Your task**: Invoke tag-agent to verify TAG system integrity
|
|
448
|
+
- Use Task tool:
|
|
449
|
+
- `subagent_type`: "tag-agent"
|
|
450
|
+
- `description`: "Verify TAG system across entire project"
|
|
451
|
+
- `prompt`:
|
|
452
|
+
```
|
|
453
|
+
Please perform comprehensive @TAG system verification across the entire project.
|
|
454
|
+
|
|
455
|
+
**Required Scope**: Scan ALL source files, not just changed files.
|
|
456
|
+
|
|
457
|
+
**Verification Items**:
|
|
458
|
+
1. @SPEC TAGs in .moai/specs/ directory
|
|
459
|
+
2. @TEST TAGs in tests/ directory
|
|
460
|
+
3. @CODE TAGs in src/ directory
|
|
461
|
+
4. @DOC TAGs in docs/ directory
|
|
462
|
+
|
|
463
|
+
**Orphan Detection** (Required):
|
|
464
|
+
- Detect @CODE TAGs with no matching @SPEC
|
|
465
|
+
- Detect @SPEC TAGs with no matching @CODE
|
|
466
|
+
- Detect @TEST TAGs with no matching @SPEC
|
|
467
|
+
- Detect @DOC TAGs with no matching @SPEC/@CODE
|
|
468
|
+
|
|
469
|
+
**Output Format**:
|
|
470
|
+
- Provide complete list of orphan TAGs with locations
|
|
471
|
+
- TAG chain integrity assessment (Healthy / Issues Detected)
|
|
472
|
+
|
|
473
|
+
(Optional) Exploration results: $EXPLORE_RESULTS
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
- **Wait for tag-agent response**
|
|
477
|
+
- Store response in variable: `$TAG_VALIDATION_RESULTS`
|
|
478
|
+
- Print summary:
|
|
479
|
+
```
|
|
480
|
+
✅ TAG verification complete
|
|
481
|
+
|
|
482
|
+
TAG chain integrity: [Healthy / Issues Detected]
|
|
483
|
+
|
|
484
|
+
Issues found (if any):
|
|
485
|
+
- Orphan @CODE TAGs: [list]
|
|
486
|
+
- Orphan @SPEC TAGs: [list]
|
|
487
|
+
- Broken references: [list]
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
2. **Doc-syncer call (synchronization plan establishment)**:
|
|
491
|
+
|
|
492
|
+
- **Your task**: Invoke doc-syncer to analyze Git changes and create sync plan
|
|
493
|
+
- Use Task tool:
|
|
494
|
+
- `subagent_type`: "doc-syncer"
|
|
495
|
+
- `description`: "Establish a document synchronization plan"
|
|
496
|
+
- `prompt`:
|
|
497
|
+
```
|
|
498
|
+
You are the doc-syncer agent.
|
|
499
|
+
|
|
500
|
+
Language settings:
|
|
501
|
+
- conversation_language: $LANG
|
|
502
|
+
- language_name: [Korean/English/Japanese based on $LANG]
|
|
503
|
+
|
|
504
|
+
Important instructions:
|
|
505
|
+
Document updates must respect the conversation language:
|
|
506
|
+
- User-facing docs (README, guides): $LANG
|
|
507
|
+
- SPEC documents (spec.md, plan.md, acceptance.md): $LANG
|
|
508
|
+
- Code comments: $LANG (except technical keywords)
|
|
509
|
+
- Technical docs and YAML frontmatter: English
|
|
510
|
+
|
|
511
|
+
Skill invocations:
|
|
512
|
+
Use explicit Skill() calls as needed:
|
|
513
|
+
- Skill("moai-foundation-tags") - TAG chain validation
|
|
514
|
+
- Skill("moai-foundation-trust") - Quality gate inspection
|
|
515
|
+
- Skill("moai-alfred-tag-scanning") - TAG inventory update
|
|
516
|
+
|
|
517
|
+
Tasks:
|
|
518
|
+
Analyze Git changes and establish document synchronization plan.
|
|
519
|
+
Ensure all document updates align with conversation language settings.
|
|
520
|
+
|
|
521
|
+
Synchronization mode: $MODE
|
|
522
|
+
Synchronization scope: $SYNC_SCOPE
|
|
523
|
+
Target directories: $TARGET_DIRS
|
|
524
|
+
Changed files: $CHANGED_FILES
|
|
525
|
+
|
|
526
|
+
(Required) TAG verification results: $TAG_VALIDATION_RESULTS
|
|
527
|
+
(Optional) Exploration results: $EXPLORE_RESULTS
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
- **Wait for doc-syncer response**
|
|
531
|
+
- Store response in variable: `$SYNC_PLAN`
|
|
532
|
+
- Print summary:
|
|
533
|
+
```
|
|
534
|
+
📋 Synchronization Plan Created
|
|
535
|
+
|
|
536
|
+
Documents to update:
|
|
537
|
+
- Living Documents: [list]
|
|
538
|
+
- SPEC documents: [list]
|
|
539
|
+
- TAG indexes: [list]
|
|
540
|
+
|
|
541
|
+
Estimated work:
|
|
542
|
+
- Files to update: [count]
|
|
543
|
+
- New files to create: [count]
|
|
544
|
+
- TAG repairs needed: [count]
|
|
545
|
+
- Estimated time: [based on change count]
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
**Result**: TAG validation results and synchronization plan stored in variables.
|
|
549
|
+
|
|
550
|
+
**Next step**: Go to STEP 1.6
|
|
212
551
|
|
|
213
552
|
---
|
|
214
553
|
|
|
215
|
-
|
|
554
|
+
### STEP 1.6: Request User Approval
|
|
555
|
+
|
|
556
|
+
**Your task**: Present the synchronization plan to the user and request approval to proceed.
|
|
557
|
+
|
|
558
|
+
**Steps**:
|
|
559
|
+
|
|
560
|
+
1. **Display comprehensive plan report**:
|
|
561
|
+
```
|
|
562
|
+
═══════════════════════════════════════════════════════
|
|
563
|
+
📚 Document Synchronization Plan Report
|
|
564
|
+
═══════════════════════════════════════════════════════
|
|
565
|
+
|
|
566
|
+
📊 Project Analysis:
|
|
567
|
+
- Mode: $MODE
|
|
568
|
+
- Scope: $SYNC_SCOPE
|
|
569
|
+
- Changed files: [count from $CHANGED_FILES]
|
|
570
|
+
- Project mode: $PROJECT_MODE (Personal/Team)
|
|
571
|
+
|
|
572
|
+
🎯 Synchronization Strategy:
|
|
573
|
+
- Living Documents to update: [list from $SYNC_PLAN]
|
|
574
|
+
- SPEC documents to sync: [list]
|
|
575
|
+
- TAG repairs needed: [count from $TAG_VALIDATION_RESULTS]
|
|
576
|
+
- Domain-specific sync: [if applicable]
|
|
577
|
+
|
|
578
|
+
⚠️ TAG System Status:
|
|
579
|
+
- TAG chain integrity: [Healthy / Issues Detected]
|
|
580
|
+
- Orphan TAGs: [count]
|
|
581
|
+
- Broken references: [count]
|
|
582
|
+
|
|
583
|
+
✅ Expected Deliverables:
|
|
584
|
+
- sync-report.md: Summary of synchronization results
|
|
585
|
+
- tags.db: Updated TAG index
|
|
586
|
+
- Living Documents: [list]
|
|
587
|
+
- PR Status: [if Team mode: Draft → Ready transition]
|
|
588
|
+
|
|
589
|
+
═══════════════════════════════════════════════════════
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
2. **Ask user for approval using AskUserQuestion**:
|
|
593
|
+
- **Your task**: Use the AskUserQuestion tool to gather user decision
|
|
594
|
+
- Tool call:
|
|
595
|
+
- `questions`: Array with 1 question
|
|
596
|
+
- Question details:
|
|
597
|
+
- `question`: "Synchronization plan is ready. How would you like to proceed?"
|
|
598
|
+
- `header`: "Plan Approval"
|
|
599
|
+
- `multiSelect`: false
|
|
600
|
+
- `options`: Array with 4 choices:
|
|
601
|
+
1. Label: "✅ Proceed with Sync", Description: "Execute document synchronization as planned"
|
|
602
|
+
2. Label: "🔄 Request Modifications", Description: "Specify changes to the synchronization strategy"
|
|
603
|
+
3. Label: "🔍 Review Details", Description: "Re-examine TAG validation results and changes"
|
|
604
|
+
4. Label: "❌ Abort", Description: "Cancel synchronization, keep current state"
|
|
605
|
+
|
|
606
|
+
3. **Wait for user response**:
|
|
607
|
+
- Store response in variable: `$USER_DECISION`
|
|
608
|
+
- Read value from: `$USER_DECISION["0"]` (first question answer)
|
|
609
|
+
|
|
610
|
+
4. **Process user response**:
|
|
611
|
+
|
|
612
|
+
**IF user chose "✅ Proceed with Sync"**:
|
|
613
|
+
- Print:
|
|
614
|
+
```
|
|
615
|
+
✅ User approved synchronization plan
|
|
616
|
+
|
|
617
|
+
Proceeding to document synchronization...
|
|
618
|
+
```
|
|
619
|
+
- **Next step**: Go to STEP 2.1
|
|
620
|
+
|
|
621
|
+
**IF user chose "🔄 Request Modifications"**:
|
|
622
|
+
- Print:
|
|
623
|
+
```
|
|
624
|
+
🔄 User requested modifications to plan
|
|
625
|
+
|
|
626
|
+
Please specify what changes you'd like to the synchronization strategy:
|
|
627
|
+
```
|
|
628
|
+
- Wait for user input (freeform text)
|
|
629
|
+
- Store input in variable: `$MODIFICATION_REQUEST`
|
|
630
|
+
- Print:
|
|
631
|
+
```
|
|
632
|
+
Re-analyzing with requested modifications...
|
|
633
|
+
```
|
|
634
|
+
- **Next step**: Go back to STEP 1.5 (re-create plan with modifications)
|
|
635
|
+
|
|
636
|
+
**IF user chose "🔍 Review Details"**:
|
|
637
|
+
- Print detailed TAG validation results:
|
|
638
|
+
```
|
|
639
|
+
🔍 Detailed TAG Validation Results
|
|
640
|
+
|
|
641
|
+
$TAG_VALIDATION_RESULTS (full output)
|
|
642
|
+
|
|
643
|
+
Detailed synchronization plan:
|
|
644
|
+
|
|
645
|
+
$SYNC_PLAN (full output)
|
|
646
|
+
```
|
|
647
|
+
- After displaying details, re-present the approval question
|
|
648
|
+
- **Next step**: Go back to STEP 1.6 (re-ask approval)
|
|
649
|
+
|
|
650
|
+
**IF user chose "❌ Abort"**:
|
|
651
|
+
- Print:
|
|
652
|
+
```
|
|
653
|
+
❌ Synchronization aborted by user
|
|
654
|
+
|
|
655
|
+
No changes were made to documents or Git history.
|
|
656
|
+
Current branch state maintained.
|
|
657
|
+
```
|
|
658
|
+
- **Next step**: Go to STEP 4 (Graceful Exit)
|
|
659
|
+
|
|
660
|
+
**Result**: User decision captured. Command proceeds or exits based on choice.
|
|
661
|
+
|
|
662
|
+
**Next step**: Based on user decision (see above)
|
|
216
663
|
|
|
217
|
-
|
|
664
|
+
---
|
|
665
|
+
|
|
666
|
+
## 🚀 STEP 2: Execute Document Synchronization
|
|
218
667
|
|
|
219
|
-
###
|
|
668
|
+
### STEP 2.1: Create Safety Backup
|
|
220
669
|
|
|
221
|
-
|
|
670
|
+
**Your task**: Create a safety backup of current document state before making any changes.
|
|
222
671
|
|
|
223
|
-
**
|
|
224
|
-
- SPEC with status `draft`
|
|
225
|
-
- RED → GREEN → REFACTOR commit exists
|
|
226
|
-
- @TEST and @CODE TAG exist
|
|
672
|
+
**Steps**:
|
|
227
673
|
|
|
228
|
-
**
|
|
229
|
-
-
|
|
230
|
-
-
|
|
231
|
-
-
|
|
674
|
+
1. **Create backup directory with timestamp**:
|
|
675
|
+
- Generate timestamp: `date +%Y-%m-%d-%H%M%S` → Store as `$TIMESTAMP`
|
|
676
|
+
- Create directory: `.moai-backups/sync-$TIMESTAMP/`
|
|
677
|
+
- Execute: `mkdir -p .moai-backups/sync-$TIMESTAMP/`
|
|
232
678
|
|
|
233
|
-
**
|
|
679
|
+
2. **Copy current documents to backup**:
|
|
680
|
+
- Copy README.md: `cp README.md .moai-backups/sync-$TIMESTAMP/` (if exists)
|
|
681
|
+
- Copy docs/: `cp -r docs/ .moai-backups/sync-$TIMESTAMP/` (if exists)
|
|
682
|
+
- Copy .moai/specs/: `cp -r .moai/specs/ .moai-backups/sync-$TIMESTAMP/`
|
|
683
|
+
- Copy .moai/indexes/: `cp -r .moai/indexes/ .moai-backups/sync-$TIMESTAMP/` (if exists)
|
|
234
684
|
|
|
235
|
-
|
|
685
|
+
3. **Verify backup creation**:
|
|
686
|
+
- Execute: `ls -la .moai-backups/sync-$TIMESTAMP/`
|
|
687
|
+
- IF backup directory is empty → Print error and exit:
|
|
688
|
+
```
|
|
689
|
+
❌ Error: Backup creation failed
|
|
236
690
|
|
|
237
|
-
|
|
691
|
+
Unable to create safety backup at:
|
|
692
|
+
.moai-backups/sync-$TIMESTAMP/
|
|
238
693
|
|
|
239
|
-
|
|
694
|
+
Synchronization aborted to prevent data loss.
|
|
695
|
+
```
|
|
696
|
+
- ELSE → Print success:
|
|
697
|
+
```
|
|
698
|
+
💾 Safety backup created
|
|
240
699
|
|
|
241
|
-
|
|
242
|
-
|
|
700
|
+
Backup location: .moai-backups/sync-$TIMESTAMP/
|
|
701
|
+
Files backed up: [count]
|
|
243
702
|
|
|
244
|
-
|
|
703
|
+
You can restore from this backup if needed.
|
|
704
|
+
```
|
|
245
705
|
|
|
246
|
-
|
|
706
|
+
**Result**: Safety backup created. Safe to proceed with document modifications.
|
|
247
707
|
|
|
248
|
-
|
|
708
|
+
**Next step**: Go to STEP 2.2
|
|
249
709
|
|
|
250
|
-
|
|
710
|
+
---
|
|
251
711
|
|
|
252
|
-
|
|
712
|
+
### STEP 2.2: Synchronize Living Documents
|
|
253
713
|
|
|
254
|
-
-
|
|
255
|
-
- [ ] **Document consistency**: Need for code-to-document synchronization
|
|
256
|
-
- [ ] **TAG system**: @TAG scheme verification and broken links
|
|
257
|
-
- [ ] **Sync scope**: Full vs partial vs specific path synchronization
|
|
714
|
+
**Your task**: Call doc-syncer agent to perform Living Document synchronization and TAG updates.
|
|
258
715
|
|
|
259
|
-
|
|
716
|
+
**Steps**:
|
|
260
717
|
|
|
261
|
-
|
|
718
|
+
1. **Invoke doc-syncer agent for synchronization execution**:
|
|
719
|
+
- **Your task**: Call doc-syncer to execute the approved synchronization plan
|
|
720
|
+
- Use Task tool:
|
|
721
|
+
- `subagent_type`: "doc-syncer"
|
|
722
|
+
- `description`: "Execute Living Document synchronization"
|
|
723
|
+
- `prompt`:
|
|
724
|
+
```
|
|
725
|
+
You are the doc-syncer agent.
|
|
262
726
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
| **Personal** | Local document synchronization | checkpoint only | Focus on personal work |
|
|
266
|
-
| **Team** | Full Sync + TAG | PR Ready conversion | Collaboration support |
|
|
267
|
-
| **Auto** | Intelligent automatic selection | Decisions by situation | Optimal strategy |
|
|
268
|
-
| **Force** | Force full sync | Full regeneration | For error recovery |
|
|
727
|
+
Language settings:
|
|
728
|
+
- conversation_language: $LANG
|
|
269
729
|
|
|
270
|
-
|
|
730
|
+
**Execute Approved Synchronization Plan**:
|
|
271
731
|
|
|
272
|
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
732
|
+
Previous analysis results:
|
|
733
|
+
- TAG verification results: $TAG_VALIDATION_RESULTS
|
|
734
|
+
- Synchronization plan: $SYNC_PLAN
|
|
735
|
+
- Exploration results: $EXPLORE_RESULTS (if available)
|
|
276
736
|
|
|
277
|
-
|
|
737
|
+
**Task Instructions**:
|
|
278
738
|
|
|
279
|
-
|
|
739
|
+
1. Living Document synchronization:
|
|
740
|
+
- Reflect changed code in documentation
|
|
741
|
+
- Auto-generate/update API documentation
|
|
742
|
+
- Update README (if needed)
|
|
743
|
+
- Synchronize Architecture documents
|
|
280
744
|
|
|
281
|
-
|
|
282
|
-
|
|
745
|
+
2. @TAG system updates:
|
|
746
|
+
- Update TAG index (.moai/indexes/tags.db)
|
|
747
|
+
- Repair orphan TAGs (if possible)
|
|
748
|
+
- Restore broken references
|
|
283
749
|
|
|
284
|
-
|
|
285
|
-
-
|
|
286
|
-
-
|
|
287
|
-
-
|
|
750
|
+
3. Document-code consistency verification:
|
|
751
|
+
- Verify SPEC ↔ CODE synchronization
|
|
752
|
+
- Verify TEST ↔ CODE matching
|
|
753
|
+
- Verify DOC ↔ CODE references
|
|
288
754
|
|
|
289
|
-
|
|
290
|
-
-
|
|
291
|
-
-
|
|
292
|
-
- **PR Handling**: [Maintain/Switch Ready/Create New PR]
|
|
755
|
+
4. Generate synchronization report:
|
|
756
|
+
- File location: .moai/reports/sync-report-$TIMESTAMP.md
|
|
757
|
+
- Include content: Updated file list, TAG repair history, remaining issues
|
|
293
758
|
|
|
294
|
-
|
|
295
|
-
- **Potential conflicts**: [Possible document conflicts]
|
|
296
|
-
- **TAG issues**: [Broken links, duplicate TAGs]
|
|
297
|
-
- **Performance impact**: [Estimated time for large synchronization]
|
|
759
|
+
**Important**: Use conversation_language($LANG) for all document creation/modification.
|
|
298
760
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
-
|
|
761
|
+
Execute the approved plan precisely and report results in detail.
|
|
762
|
+
```
|
|
763
|
+
|
|
764
|
+
2. **Wait for doc-syncer completion**:
|
|
765
|
+
- Monitor doc-syncer agent execution
|
|
766
|
+
- Store results in variable: `$SYNC_RESULTS`
|
|
767
|
+
|
|
768
|
+
3. **Verify synchronization results**:
|
|
769
|
+
- Read file: `.moai/reports/sync-report-$TIMESTAMP.md`
|
|
770
|
+
- IF file does NOT exist → Print error:
|
|
771
|
+
```
|
|
772
|
+
⚠️ Warning: Sync report not generated
|
|
773
|
+
|
|
774
|
+
doc-syncer may have encountered an issue.
|
|
775
|
+
Checking for partial sync results...
|
|
776
|
+
```
|
|
777
|
+
- ELSE → Print success:
|
|
778
|
+
```
|
|
779
|
+
✅ Living Document synchronization complete
|
|
780
|
+
|
|
781
|
+
Sync report: .moai/reports/sync-report-$TIMESTAMP.md
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
4. **Print synchronization summary**:
|
|
785
|
+
```
|
|
786
|
+
📚 Synchronization Results:
|
|
787
|
+
|
|
788
|
+
Documents updated:
|
|
789
|
+
- [list from $SYNC_RESULTS]
|
|
790
|
+
|
|
791
|
+
TAG repairs:
|
|
792
|
+
- [count] orphan TAGs fixed
|
|
793
|
+
- [count] broken references repaired
|
|
794
|
+
|
|
795
|
+
New files created:
|
|
796
|
+
- [list]
|
|
797
|
+
|
|
798
|
+
Sync report: .moai/reports/sync-report-$TIMESTAMP.md
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
**Result**: Living Documents synchronized. TAG system updated.
|
|
802
|
+
|
|
803
|
+
**Next step**: Go to STEP 2.3
|
|
304
804
|
|
|
305
805
|
---
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
806
|
+
|
|
807
|
+
### STEP 2.3: Update TAG Index
|
|
808
|
+
|
|
809
|
+
**Your task**: Update the TAG traceability index to reflect current state.
|
|
810
|
+
|
|
811
|
+
**Steps**:
|
|
812
|
+
|
|
813
|
+
1. **Check if TAG scanner script exists**:
|
|
814
|
+
- Check file: `.moai/scripts/tag_scanner.py`
|
|
815
|
+
- IF file does NOT exist → Print warning and skip:
|
|
816
|
+
```
|
|
817
|
+
⚠️ Warning: TAG scanner script not found
|
|
818
|
+
|
|
819
|
+
Skipping TAG index update.
|
|
820
|
+
TAG verification was performed by doc-syncer agent.
|
|
821
|
+
```
|
|
822
|
+
- IF file exists → Proceed to next step
|
|
823
|
+
|
|
824
|
+
2. **Run TAG scanner to update index**:
|
|
825
|
+
- Execute: `python3 .moai/scripts/tag_scanner.py --update-index`
|
|
826
|
+
- Store exit code in variable: `$TAG_SCANNER_EXIT`
|
|
827
|
+
|
|
828
|
+
3. **Verify TAG scanner success**:
|
|
829
|
+
- IF `$TAG_SCANNER_EXIT != 0` → Print warning:
|
|
830
|
+
```
|
|
831
|
+
⚠️ Warning: TAG scanner encountered issues
|
|
832
|
+
|
|
833
|
+
Exit code: $TAG_SCANNER_EXIT
|
|
834
|
+
|
|
835
|
+
TAG index may be incomplete. Check:
|
|
836
|
+
.moai/logs/tag-scanner.log
|
|
837
|
+
```
|
|
838
|
+
- ELSE → Print success:
|
|
839
|
+
```
|
|
840
|
+
✅ TAG index updated
|
|
841
|
+
|
|
842
|
+
Index location: .moai/indexes/tags.db
|
|
843
|
+
```
|
|
844
|
+
|
|
845
|
+
4. **Verify TAG chain integrity**:
|
|
846
|
+
- Execute: `rg '@TAG' -n src/ tests/` (direct code scan)
|
|
847
|
+
- Store output in variable: `$TAG_SCAN_OUTPUT`
|
|
848
|
+
- Count TAGs by type:
|
|
849
|
+
- `@SPEC` TAGs: Count lines matching `@SPEC`
|
|
850
|
+
- `@CODE` TAGs: Count lines matching `@CODE`
|
|
851
|
+
- `@TEST` TAGs: Count lines matching `@TEST`
|
|
852
|
+
- `@DOC` TAGs: Count lines matching `@DOC`
|
|
853
|
+
- Print:
|
|
854
|
+
```
|
|
855
|
+
🔗 TAG Chain Verification:
|
|
856
|
+
- @SPEC TAGs: [count]
|
|
857
|
+
- @CODE TAGs: [count]
|
|
858
|
+
- @TEST TAGs: [count]
|
|
859
|
+
- @DOC TAGs: [count]
|
|
860
|
+
|
|
861
|
+
TAG chain integrity: [PASS / ISSUES]
|
|
862
|
+
```
|
|
863
|
+
|
|
864
|
+
**Result**: TAG index updated and verified.
|
|
865
|
+
|
|
866
|
+
**Next step**: Go to STEP 2.4
|
|
309
867
|
|
|
310
868
|
---
|
|
311
869
|
|
|
312
|
-
|
|
870
|
+
### STEP 2.4: SPEC Document Synchronization (CRITICAL)
|
|
871
|
+
|
|
872
|
+
**Your task**: Ensure that SPEC documents are updated to match code changes.
|
|
873
|
+
|
|
874
|
+
**Important note**: This step is CRITICAL. Any code changes MUST be reflected in SPEC documents to maintain specification alignment.
|
|
875
|
+
|
|
876
|
+
**Steps**:
|
|
877
|
+
|
|
878
|
+
1. **Analyze Git diff for functional changes**:
|
|
879
|
+
- Execute: `git diff HEAD --unified=3`
|
|
880
|
+
- Store output in variable: `$GIT_DIFF`
|
|
881
|
+
- Identify functional impacts:
|
|
882
|
+
- Function signature changes (parameters, return values)
|
|
883
|
+
- Behavior changes (logic flow, edge cases)
|
|
884
|
+
- Performance characteristics (latency, throughput)
|
|
885
|
+
- External dependencies (new APIs, services)
|
|
886
|
+
|
|
887
|
+
2. **Determine which SPECs need updates**:
|
|
888
|
+
- Parse changed files from `$CHANGED_FILES`
|
|
889
|
+
- For each changed file in `src/`:
|
|
890
|
+
- Search for `@CODE:SPEC-{ID}` TAG in file
|
|
891
|
+
- Extract SPEC ID
|
|
892
|
+
- Add to list: `$SPECS_TO_UPDATE`
|
|
893
|
+
- Print:
|
|
894
|
+
```
|
|
895
|
+
📋 SPEC Documents Requiring Synchronization:
|
|
896
|
+
|
|
897
|
+
$SPECS_TO_UPDATE (list of SPEC IDs)
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
3. **For each SPEC in $SPECS_TO_UPDATE**:
|
|
901
|
+
|
|
902
|
+
a. **Read current SPEC documents**:
|
|
903
|
+
- Read file: `.moai/specs/SPEC-{ID}/spec.md`
|
|
904
|
+
- Read file: `.moai/specs/SPEC-{ID}/plan.md`
|
|
905
|
+
- Read file: `.moai/specs/SPEC-{ID}/acceptance.md`
|
|
906
|
+
|
|
907
|
+
b. **Compare SPEC requirements with actual code implementation**:
|
|
908
|
+
- **Your task**: Verify each SPEC requirement matches code behavior
|
|
909
|
+
- Check:
|
|
910
|
+
- Do EARS statements match function signatures?
|
|
911
|
+
- Are acceptance criteria still valid?
|
|
912
|
+
- Were edge cases discovered during implementation?
|
|
913
|
+
- Did implementation strategy change from plan.md?
|
|
914
|
+
|
|
915
|
+
c. **Identify spec-to-code divergence**:
|
|
916
|
+
- IF divergence detected → Mark for update
|
|
917
|
+
- Store divergence details in variable: `$SPEC_DIVERGENCE`
|
|
918
|
+
|
|
919
|
+
d. **Update SPEC documents to match implementation**:
|
|
920
|
+
- **IF spec.md needs update**:
|
|
921
|
+
- Update EARS statements to match actual code behavior
|
|
922
|
+
- Add edge cases discovered during implementation
|
|
923
|
+
- Update @CODE TAG references if files moved
|
|
924
|
+
- **IF acceptance.md needs update**:
|
|
925
|
+
- Add new test cases for edge cases
|
|
926
|
+
- Update acceptance criteria for behavior changes
|
|
927
|
+
- Link with @TEST TAGs from test files
|
|
928
|
+
- **IF plan.md needs update**:
|
|
929
|
+
- Document implementation changes
|
|
930
|
+
- Explain deviations from original plan
|
|
931
|
+
- Update technical approach if changed
|
|
932
|
+
|
|
933
|
+
e. **Update SPEC metadata if implementation is complete**:
|
|
934
|
+
- Check if SPEC status is `draft`
|
|
935
|
+
- Check if RED → GREEN → REFACTOR commits exist
|
|
936
|
+
- Check if @TEST and @CODE TAGs exist
|
|
937
|
+
- **IF all conditions met**:
|
|
938
|
+
- Update: `status: draft` → `status: completed`
|
|
939
|
+
- Update: `version: 0.0.x` → `version: 0.1.0`
|
|
940
|
+
- Add HISTORY section with completion date
|
|
941
|
+
|
|
942
|
+
4. **Verify SPEC-Code alignment**:
|
|
943
|
+
- For each updated SPEC:
|
|
944
|
+
- **Verify**: All EARS statements match implementation
|
|
945
|
+
- **Verify**: Acceptance criteria valid for current code
|
|
946
|
+
- **Verify**: @CODE/@TEST TAGs point to correct locations
|
|
947
|
+
- **Verify**: No spec-code divergence remains
|
|
948
|
+
|
|
949
|
+
5. **Print SPEC synchronization results**:
|
|
950
|
+
```
|
|
951
|
+
✅ SPEC Document Synchronization Complete
|
|
952
|
+
|
|
953
|
+
SPECs updated: [count]
|
|
954
|
+
|
|
955
|
+
Details:
|
|
956
|
+
- SPEC-001: spec.md, acceptance.md updated (edge case added)
|
|
957
|
+
- SPEC-002: plan.md updated (implementation approach changed)
|
|
958
|
+
- SPEC-003: Status → completed (v0.1.0)
|
|
959
|
+
|
|
960
|
+
SPEC-Code alignment: VERIFIED
|
|
961
|
+
```
|
|
962
|
+
|
|
963
|
+
6. **IF no SPECs required updates**:
|
|
964
|
+
- Print:
|
|
965
|
+
```
|
|
966
|
+
ℹ️ No SPEC updates needed
|
|
967
|
+
|
|
968
|
+
All SPEC documents are aligned with current code.
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
**Result**: SPEC documents synchronized with code. Specification alignment maintained.
|
|
972
|
+
|
|
973
|
+
**Next step**: Go to STEP 2.5
|
|
974
|
+
|
|
975
|
+
---
|
|
313
976
|
|
|
314
|
-
|
|
977
|
+
### STEP 2.5: Domain-Based Sync Routing (Automatic)
|
|
978
|
+
|
|
979
|
+
**Your task**: Route documentation sync to domain-specific experts based on changed file patterns.
|
|
980
|
+
|
|
981
|
+
**Steps**:
|
|
982
|
+
|
|
983
|
+
1. **Detect domains from changed files**:
|
|
984
|
+
- Read variable: `$CHANGED_FILES`
|
|
985
|
+
- Initialize empty array: `$DETECTED_DOMAINS`
|
|
986
|
+
|
|
987
|
+
2. **Check for Frontend changes**:
|
|
988
|
+
- Search `$CHANGED_FILES` for patterns:
|
|
989
|
+
- `*.tsx`, `*.jsx`, `*.vue`
|
|
990
|
+
- `src/components/*`, `src/pages/*`
|
|
991
|
+
- IF any match found → Add "frontend" to `$DETECTED_DOMAINS`
|
|
992
|
+
|
|
993
|
+
3. **Check for Backend changes**:
|
|
994
|
+
- Search `$CHANGED_FILES` for patterns:
|
|
995
|
+
- `src/api/*`, `src/models/*`, `src/routes/*`, `src/services/*`
|
|
996
|
+
- IF any match found → Add "backend" to `$DETECTED_DOMAINS`
|
|
997
|
+
|
|
998
|
+
4. **Check for DevOps changes**:
|
|
999
|
+
- Search `$CHANGED_FILES` for patterns:
|
|
1000
|
+
- `Dockerfile`, `docker-compose.yml`
|
|
1001
|
+
- `.github/workflows/*`, `terraform/*`, `k8s/*`
|
|
1002
|
+
- IF any match found → Add "devops" to `$DETECTED_DOMAINS`
|
|
1003
|
+
|
|
1004
|
+
5. **Check for Database changes**:
|
|
1005
|
+
- Search `$CHANGED_FILES` for patterns:
|
|
1006
|
+
- `src/database/*`, `migrations/*`, `*.sql`, `schema/*`
|
|
1007
|
+
- IF any match found → Add "database" to `$DETECTED_DOMAINS`
|
|
1008
|
+
|
|
1009
|
+
6. **Check for Data Science changes**:
|
|
1010
|
+
- Search `$CHANGED_FILES` for patterns:
|
|
1011
|
+
- `notebooks/*`, `src/pipelines/*`, `*.ipynb`, `src/models/ml/*`
|
|
1012
|
+
- IF any match found → Add "datascience" to `$DETECTED_DOMAINS`
|
|
1013
|
+
|
|
1014
|
+
7. **Check for Mobile changes**:
|
|
1015
|
+
- Search `$CHANGED_FILES` for patterns:
|
|
1016
|
+
- `src/mobile/*`, `ios/*`, `android/*`, `*.swift`, `*.kt`
|
|
1017
|
+
- IF any match found → Add "mobile" to `$DETECTED_DOMAINS`
|
|
1018
|
+
|
|
1019
|
+
8. **IF no domains detected**:
|
|
1020
|
+
- Print:
|
|
1021
|
+
```
|
|
1022
|
+
ℹ️ No domain-specific sync needed
|
|
1023
|
+
|
|
1024
|
+
Using standard sync templates.
|
|
1025
|
+
```
|
|
1026
|
+
- **Skip to STEP 2.6**
|
|
1027
|
+
|
|
1028
|
+
9. **IF domains detected**:
|
|
1029
|
+
- Print:
|
|
1030
|
+
```
|
|
1031
|
+
🎯 Domain-specific sync routing activated
|
|
1032
|
+
|
|
1033
|
+
Detected domains: $DETECTED_DOMAINS
|
|
1034
|
+
|
|
1035
|
+
Generating domain-specific documentation...
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
10. **For each domain in $DETECTED_DOMAINS**:
|
|
1039
|
+
|
|
1040
|
+
**IF domain is "frontend"**:
|
|
1041
|
+
- Invoke Explore agent:
|
|
1042
|
+
- `subagent_type`: "Explore"
|
|
1043
|
+
- `prompt`:
|
|
1044
|
+
```
|
|
1045
|
+
Act as frontend-expert. Provide sync documentation.
|
|
1046
|
+
|
|
1047
|
+
Changed Files: [list frontend files from $CHANGED_FILES]
|
|
1048
|
+
|
|
1049
|
+
Provide frontend-specific documentation:
|
|
1050
|
+
1. Component documentation updates
|
|
1051
|
+
2. Storybook story generation (if applicable)
|
|
1052
|
+
3. UI architecture diagram updates
|
|
1053
|
+
4. Accessibility compliance notes
|
|
1054
|
+
5. Component prop documentation
|
|
1055
|
+
|
|
1056
|
+
Output format: Markdown document
|
|
1057
|
+
Save to: .moai/reports/sync-frontend-$TIMESTAMP.md
|
|
1058
|
+
```
|
|
1059
|
+
|
|
1060
|
+
**IF domain is "backend"**:
|
|
1061
|
+
- Invoke Explore agent:
|
|
1062
|
+
- `subagent_type`: "Explore"
|
|
1063
|
+
- `prompt`:
|
|
1064
|
+
```
|
|
1065
|
+
Act as backend-expert. Provide sync documentation.
|
|
1066
|
+
|
|
1067
|
+
Changed Files: [list backend files from $CHANGED_FILES]
|
|
1068
|
+
|
|
1069
|
+
Provide backend-specific documentation:
|
|
1070
|
+
1. OpenAPI spec generation/updates
|
|
1071
|
+
2. Schema documentation updates
|
|
1072
|
+
3. Error handling documentation
|
|
1073
|
+
4. API endpoint examples
|
|
1074
|
+
5. Performance characteristics
|
|
1075
|
+
|
|
1076
|
+
Output format: Markdown document
|
|
1077
|
+
Save to: .moai/reports/sync-backend-$TIMESTAMP.md
|
|
1078
|
+
```
|
|
1079
|
+
|
|
1080
|
+
**IF domain is "devops"**:
|
|
1081
|
+
- Invoke Explore agent:
|
|
1082
|
+
- `subagent_type`: "Explore"
|
|
1083
|
+
- `prompt`:
|
|
1084
|
+
```
|
|
1085
|
+
Act as devops-expert. Provide sync documentation.
|
|
1086
|
+
|
|
1087
|
+
Changed Files: [list devops files from $CHANGED_FILES]
|
|
1088
|
+
|
|
1089
|
+
Provide DevOps-specific documentation:
|
|
1090
|
+
1. Deployment documentation updates
|
|
1091
|
+
2. CI/CD pipeline changes
|
|
1092
|
+
3. Infrastructure diagrams
|
|
1093
|
+
4. Configuration management notes
|
|
1094
|
+
5. Monitoring/alerting setup
|
|
1095
|
+
|
|
1096
|
+
Output format: Markdown document
|
|
1097
|
+
Save to: .moai/reports/sync-devops-$TIMESTAMP.md
|
|
1098
|
+
```
|
|
1099
|
+
|
|
1100
|
+
**IF domain is "database"**:
|
|
1101
|
+
- Invoke Explore agent:
|
|
1102
|
+
- `subagent_type`: "Explore"
|
|
1103
|
+
- `prompt`:
|
|
1104
|
+
```
|
|
1105
|
+
Act as database-expert. Provide sync documentation.
|
|
1106
|
+
|
|
1107
|
+
Changed Files: [list database files from $CHANGED_FILES]
|
|
1108
|
+
|
|
1109
|
+
Provide database-specific documentation:
|
|
1110
|
+
1. Schema documentation updates
|
|
1111
|
+
2. Migration logs
|
|
1112
|
+
3. Query optimization notes
|
|
1113
|
+
4. Index strategies
|
|
1114
|
+
5. Data integrity constraints
|
|
1115
|
+
|
|
1116
|
+
Output format: Markdown document
|
|
1117
|
+
Save to: .moai/reports/sync-database-$TIMESTAMP.md
|
|
1118
|
+
```
|
|
1119
|
+
|
|
1120
|
+
**IF domain is "datascience"**:
|
|
1121
|
+
- Invoke Explore agent:
|
|
1122
|
+
- `subagent_type`: "Explore"
|
|
1123
|
+
- `prompt`:
|
|
1124
|
+
```
|
|
1125
|
+
Act as datascience-expert. Provide sync documentation.
|
|
1126
|
+
|
|
1127
|
+
Changed Files: [list data science files from $CHANGED_FILES]
|
|
1128
|
+
|
|
1129
|
+
Provide data science-specific documentation:
|
|
1130
|
+
1. Pipeline documentation
|
|
1131
|
+
2. Model cards (for ML models)
|
|
1132
|
+
3. Data validation rules
|
|
1133
|
+
4. Feature engineering notes
|
|
1134
|
+
5. Experiment tracking
|
|
1135
|
+
|
|
1136
|
+
Output format: Markdown document
|
|
1137
|
+
Save to: .moai/reports/sync-datascience-$TIMESTAMP.md
|
|
1138
|
+
```
|
|
1139
|
+
|
|
1140
|
+
**IF domain is "mobile"**:
|
|
1141
|
+
- Invoke Explore agent:
|
|
1142
|
+
- `subagent_type`: "Explore"
|
|
1143
|
+
- `prompt`:
|
|
1144
|
+
```
|
|
1145
|
+
Act as mobile-expert. Provide sync documentation.
|
|
1146
|
+
|
|
1147
|
+
Changed Files: [list mobile files from $CHANGED_FILES]
|
|
1148
|
+
|
|
1149
|
+
Provide mobile-specific documentation:
|
|
1150
|
+
1. Platform-specific documentation (iOS/Android)
|
|
1151
|
+
2. App lifecycle documentation
|
|
1152
|
+
3. Native module documentation
|
|
1153
|
+
4. Push notification setup
|
|
1154
|
+
5. Deep linking configuration
|
|
1155
|
+
|
|
1156
|
+
Output format: Markdown document
|
|
1157
|
+
Save to: .moai/reports/sync-mobile-$TIMESTAMP.md
|
|
1158
|
+
```
|
|
1159
|
+
|
|
1160
|
+
11. **Wait for all domain-specific sync agents to complete**:
|
|
1161
|
+
- Monitor each Explore agent execution
|
|
1162
|
+
- Store results in array: `$DOMAIN_SYNC_RESULTS`
|
|
1163
|
+
|
|
1164
|
+
12. **Create combined sync report**:
|
|
1165
|
+
- **Your task**: Consolidate all domain-specific reports into master report
|
|
1166
|
+
- Read all domain-specific report files
|
|
1167
|
+
- Write combined report to: `.moai/reports/sync-report-$TIMESTAMP.md`
|
|
1168
|
+
- Include sections:
|
|
1169
|
+
- Changed Files Summary
|
|
1170
|
+
- Domain-Specific Sync Results (with links to detailed reports)
|
|
1171
|
+
- @TAG Verification
|
|
1172
|
+
- Next Steps
|
|
1173
|
+
|
|
1174
|
+
13. **Print domain sync summary**:
|
|
1175
|
+
```
|
|
1176
|
+
✅ Domain-specific sync complete
|
|
1177
|
+
|
|
1178
|
+
Domains processed:
|
|
1179
|
+
- Frontend: [count] files → sync-frontend-$TIMESTAMP.md
|
|
1180
|
+
- Backend: [count] files → sync-backend-$TIMESTAMP.md
|
|
1181
|
+
- DevOps: [count] files → sync-devops-$TIMESTAMP.md
|
|
1182
|
+
|
|
1183
|
+
Combined report: sync-report-$TIMESTAMP.md
|
|
1184
|
+
```
|
|
1185
|
+
|
|
1186
|
+
**Result**: Domain-specific documentation generated. Combined sync report created.
|
|
1187
|
+
|
|
1188
|
+
**Next step**: Go to STEP 2.6
|
|
315
1189
|
|
|
316
|
-
|
|
1190
|
+
---
|
|
317
1191
|
|
|
318
|
-
|
|
319
|
-
2. **TAG System Verification**: @TAG System Integrity Verification
|
|
320
|
-
3. **Index Update**: Traceability Matrix Update
|
|
321
|
-
4. **Create Report**: Create a summary of synchronization results
|
|
1192
|
+
### STEP 2.6: Display Synchronization Completion Report
|
|
322
1193
|
|
|
323
|
-
|
|
1194
|
+
**Your task**: Present comprehensive synchronization results to the user.
|
|
324
1195
|
|
|
325
|
-
|
|
326
|
-
- **Step 2**: The `git-manager` agent is dedicated to all Git commits, PR state transitions, and synchronization.
|
|
327
|
-
- **Single Responsibility Principle**: doc-syncer only performs document tasks, and git-manager only performs Git tasks.
|
|
328
|
-
- **Sequential execution**: Executes in the order doc-syncer → git-manager to maintain clear dependencies.
|
|
329
|
-
- **No inter-agent calls**: Each agent does not directly call other agents, and executes commands. Runs sequentially in levels only.
|
|
1196
|
+
**Steps**:
|
|
330
1197
|
|
|
331
|
-
|
|
1198
|
+
1. **Read synchronization results**:
|
|
1199
|
+
- Read file: `.moai/reports/sync-report-$TIMESTAMP.md`
|
|
1200
|
+
- Store content in variable: `$SYNC_REPORT_CONTENT`
|
|
332
1201
|
|
|
333
|
-
|
|
1202
|
+
2. **Calculate synchronization metrics**:
|
|
1203
|
+
- Count updated files from `$SYNC_RESULTS`
|
|
1204
|
+
- Count TAG repairs from `$TAG_VALIDATION_RESULTS`
|
|
1205
|
+
- Count domain-specific reports from `$DETECTED_DOMAINS`
|
|
334
1206
|
|
|
335
|
-
|
|
1207
|
+
3. **Print comprehensive completion report**:
|
|
1208
|
+
```
|
|
1209
|
+
═══════════════════════════════════════════════════════
|
|
1210
|
+
✅ Document Synchronization Complete
|
|
1211
|
+
═══════════════════════════════════════════════════════
|
|
336
1212
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
Task 2 (sonnet): Analyze document structure
|
|
344
|
-
├── Detect project type
|
|
345
|
-
├── Collect TAG list
|
|
346
|
-
└── Determine synchronization scope
|
|
347
|
-
```
|
|
1213
|
+
📊 Synchronization Summary:
|
|
1214
|
+
- Mode: $MODE
|
|
1215
|
+
- Scope: $SYNC_SCOPE
|
|
1216
|
+
- Files updated: [count]
|
|
1217
|
+
- Files created: [count]
|
|
1218
|
+
- TAG repairs: [count]
|
|
348
1219
|
|
|
349
|
-
|
|
1220
|
+
📚 Documents Updated:
|
|
1221
|
+
- Living Documents: [list]
|
|
1222
|
+
- SPEC documents: [list]
|
|
1223
|
+
- Domain-specific reports: [count]
|
|
350
1224
|
|
|
351
|
-
|
|
1225
|
+
🔗 TAG System Status:
|
|
1226
|
+
- @SPEC TAGs: [count]
|
|
1227
|
+
- @CODE TAGs: [count]
|
|
1228
|
+
- @TEST TAGs: [count]
|
|
1229
|
+
- @DOC TAGs: [count]
|
|
1230
|
+
- TAG chain integrity: [PASS / WARNING]
|
|
352
1231
|
|
|
353
|
-
|
|
354
|
-
-
|
|
355
|
-
-
|
|
356
|
-
- TAG traceability matrix update
|
|
357
|
-
|
|
358
|
-
### Phase 3: Git task processing (sequential execution)
|
|
359
|
-
|
|
360
|
-
Final processing by the `git-manager` agent (haiku):
|
|
361
|
-
|
|
362
|
-
- Commit document changes
|
|
363
|
-
- Apply synchronization strategy for each mode
|
|
364
|
-
- Switch PR Ready in Team mode
|
|
365
|
-
- Automatically assign reviewers (using gh CLI)
|
|
366
|
-
|
|
367
|
-
### Phase 4: PR merge and branch cleanup (optional)
|
|
368
|
-
|
|
369
|
-
Additional processing by `git-manager` when using the `--auto-merge` flag:
|
|
370
|
-
|
|
371
|
-
**Team mode (GitFlow)**:
|
|
372
|
-
1. Check PR status (CI/CD pass check)
|
|
373
|
-
2. PR automatic merge (to develop branch)
|
|
374
|
-
3. Delete remote feature branch
|
|
375
|
-
4. Local develop checkout and synchronization
|
|
376
|
-
5. Organizing local feature branches
|
|
377
|
-
6. Notification that the next task is ready
|
|
1232
|
+
📄 Reports Generated:
|
|
1233
|
+
- Master sync report: .moai/reports/sync-report-$TIMESTAMP.md
|
|
1234
|
+
- Domain reports: [list if any]
|
|
378
1235
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
2. Delete feature branch
|
|
382
|
-
3. Check out the base branch
|
|
383
|
-
4. Notification that the next task is ready
|
|
1236
|
+
💾 Backup Location:
|
|
1237
|
+
- Safety backup: .moai-backups/sync-$TIMESTAMP/
|
|
384
1238
|
|
|
385
|
-
|
|
1239
|
+
═══════════════════════════════════════════════════════
|
|
1240
|
+
```
|
|
386
1241
|
|
|
387
|
-
|
|
1242
|
+
4. **IF TAG issues remain**:
|
|
1243
|
+
- Print warning:
|
|
1244
|
+
```
|
|
1245
|
+
⚠️ Remaining TAG Issues:
|
|
388
1246
|
|
|
389
|
-
|
|
390
|
-
-
|
|
391
|
-
-
|
|
392
|
-
- `--auto-merge`: Enable PR automatic merge and branch cleanup (Team mode)
|
|
393
|
-
- `--skip-pre-check`: Skip pre-quality check
|
|
394
|
-
- `--skip-quality-check`: Skip final quality check
|
|
1247
|
+
The following issues could not be automatically resolved:
|
|
1248
|
+
- Orphan @CODE TAGs: [list]
|
|
1249
|
+
- Broken references: [list]
|
|
395
1250
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
- `/alfred:3-sync --auto-merge` - PR automatic merge + branch cleanup (Team mode recommended)
|
|
399
|
-
- `/alfred:3-sync force` - Force full synchronization
|
|
400
|
-
- `/alfred:3-sync status` - Check synchronization status
|
|
401
|
-
- `/alfred:3-sync project` - Integrated project synchronization
|
|
402
|
-
- `/alfred:3-sync auto src/auth/` - Specific path Synchronization
|
|
403
|
-
- `/alfred:3-sync --auto-merge --skip-pre-check` - Fast merge
|
|
1251
|
+
Manual review recommended.
|
|
1252
|
+
```
|
|
404
1253
|
|
|
405
|
-
|
|
1254
|
+
5. **Print next step guidance**:
|
|
1255
|
+
```
|
|
1256
|
+
🚀 Next Steps:
|
|
406
1257
|
|
|
407
|
-
|
|
1258
|
+
1. Review sync report: .moai/reports/sync-report-$TIMESTAMP.md
|
|
1259
|
+
2. Commit changes: Git operations will be handled next
|
|
1260
|
+
3. PR handling: [if Team mode] Ready for PR transition
|
|
1261
|
+
```
|
|
408
1262
|
|
|
409
|
-
|
|
410
|
-
- @TAG system verification and update
|
|
411
|
-
- Automatic creation/update of API document
|
|
412
|
-
- README and architecture document synchronization
|
|
413
|
-
- Verification of document-code consistency
|
|
1263
|
+
**Result**: User informed of synchronization results. Ready for Git operations.
|
|
414
1264
|
|
|
415
|
-
|
|
1265
|
+
**Next step**: Go to STEP 3.1
|
|
416
1266
|
|
|
417
|
-
|
|
418
|
-
- Apply synchronization strategy for each mode
|
|
419
|
-
- PR status transition (Draft → Ready)
|
|
420
|
-
- **PR auto merge** (when --auto-merge flag)
|
|
421
|
-
- Check CI/CD status
|
|
422
|
-
- Conflict verification
|
|
423
|
-
- Execute Squash merge
|
|
424
|
-
- Remote branch deletion
|
|
425
|
-
- **Branch cleanup and conversion**
|
|
426
|
-
- Local develop checkout
|
|
427
|
-
- Remote synchronization (git pull)
|
|
428
|
-
- Local feature branch deletion
|
|
429
|
-
- Automatic assignment and labeling of reviewers
|
|
430
|
-
- GitHub CLI integration and remote synchronization
|
|
1267
|
+
---
|
|
431
1268
|
|
|
432
|
-
|
|
1269
|
+
## 🔧 STEP 3: Git Operations & PR
|
|
433
1270
|
|
|
434
|
-
|
|
435
|
-
- The README, in-depth documentation, and PR body are organized manually according to the checklist.
|
|
1271
|
+
### STEP 3.1: Commit Document Changes
|
|
436
1272
|
|
|
437
|
-
|
|
1273
|
+
**Your task**: Call git-manager agent to commit all document changes with proper commit message.
|
|
438
1274
|
|
|
439
|
-
|
|
440
|
-
- Optionally perform PR Ready conversion and labeling only when gh CLI is set
|
|
441
|
-
- Fully automated when using **--auto-merge flag**:
|
|
442
|
-
1. Document synchronization complete.
|
|
443
|
-
2. git push origin feature/SPEC-{ID}
|
|
444
|
-
3. gh pr ready {PR_NUMBER}
|
|
445
|
-
4. Check CI/CD status (gh pr checks)
|
|
446
|
-
5. gh pr merge --squash --delete-branch
|
|
447
|
-
6. git checkout develop && git pull origin develop
|
|
448
|
-
7. Notification that the next task is ready
|
|
1275
|
+
**Steps**:
|
|
449
1276
|
|
|
450
|
-
**
|
|
1277
|
+
1. **Prepare commit summary**:
|
|
1278
|
+
- Read variable: `$SYNC_RESULTS`
|
|
1279
|
+
- Create summary text:
|
|
1280
|
+
```
|
|
1281
|
+
docs: sync documentation with code changes
|
|
451
1282
|
|
|
452
|
-
|
|
453
|
-
-
|
|
454
|
-
- After merge: automatically checkout `develop`
|
|
455
|
-
- Next `/alfred:1-plan` automatically starts in `develop`
|
|
1283
|
+
Synchronized Living Documents:
|
|
1284
|
+
- [list from $SYNC_RESULTS]
|
|
456
1285
|
|
|
457
|
-
|
|
1286
|
+
TAG system updates:
|
|
1287
|
+
- [TAG repair count] repairs
|
|
1288
|
+
- TAG index updated
|
|
458
1289
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
3. TAG chain verification → `rg '@TAG' -n src/ tests/` (scan code directly)
|
|
1290
|
+
SPEC synchronization:
|
|
1291
|
+
- [SPEC update count] SPECs updated
|
|
462
1292
|
|
|
463
|
-
|
|
1293
|
+
Domain-specific sync:
|
|
1294
|
+
- [domain list if applicable]
|
|
464
1295
|
|
|
465
|
-
|
|
1296
|
+
🤖 Generated with Claude Code
|
|
466
1297
|
|
|
467
|
-
-
|
|
468
|
-
|
|
469
|
-
-
|
|
1298
|
+
Co-Authored-By: 🦄 Alfred@MoAI
|
|
1299
|
+
```
|
|
1300
|
+
- Store in variable: `$COMMIT_MESSAGE`
|
|
470
1301
|
|
|
471
|
-
|
|
1302
|
+
2. **Invoke git-manager agent for commit**:
|
|
1303
|
+
- **Your task**: Call git-manager to commit document changes
|
|
1304
|
+
- Use Task tool:
|
|
1305
|
+
- `subagent_type`: "git-manager"
|
|
1306
|
+
- `description`: "Commit document synchronization changes"
|
|
1307
|
+
- `prompt`:
|
|
1308
|
+
```
|
|
1309
|
+
You are the git-manager agent.
|
|
472
1310
|
|
|
473
|
-
|
|
1311
|
+
**Task**: Commit document synchronization changes to Git.
|
|
474
1312
|
|
|
475
|
-
|
|
1313
|
+
**Commit Scope**:
|
|
1314
|
+
- All changed document files
|
|
1315
|
+
- .moai/reports/ directory
|
|
1316
|
+
- .moai/indexes/ directory (if changed)
|
|
1317
|
+
- README.md (if changed)
|
|
1318
|
+
- docs/ directory (if changed)
|
|
476
1319
|
|
|
477
|
-
|
|
1320
|
+
**Commit Message**:
|
|
1321
|
+
$COMMIT_MESSAGE
|
|
478
1322
|
|
|
479
|
-
|
|
1323
|
+
**Important**:
|
|
1324
|
+
- Pass commit message in HEREDOC format
|
|
1325
|
+
- Bundle all changes into a single commit
|
|
1326
|
+
- Report success after commit
|
|
480
1327
|
|
|
481
|
-
|
|
482
|
-
|
|
1328
|
+
**Execution Order**:
|
|
1329
|
+
1. git add (changed document files)
|
|
1330
|
+
2. git commit -m (HEREDOC)
|
|
1331
|
+
3. git log -1 (verify commit)
|
|
1332
|
+
```
|
|
483
1333
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
├── Duplicate TAG: X
|
|
487
|
-
└── Orphan TAG: X
|
|
1334
|
+
3. **Wait for git-manager response**:
|
|
1335
|
+
- Store response in variable: `$GIT_COMMIT_RESULT`
|
|
488
1336
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
```
|
|
1337
|
+
4. **Verify commit success**:
|
|
1338
|
+
- Execute: `git log -1 --oneline`
|
|
1339
|
+
- Store output in variable: `$LAST_COMMIT`
|
|
1340
|
+
- Print:
|
|
1341
|
+
```
|
|
1342
|
+
✅ Document changes committed
|
|
494
1343
|
|
|
495
|
-
|
|
1344
|
+
Commit: $LAST_COMMIT
|
|
1345
|
+
```
|
|
496
1346
|
|
|
497
|
-
|
|
1347
|
+
5. **IF commit failed**:
|
|
1348
|
+
- Print error:
|
|
1349
|
+
```
|
|
1350
|
+
❌ Error: Git commit failed
|
|
498
1351
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
🔄 MoAI-ADK 3-step workflow completion:
|
|
502
|
-
✅ /alfred:1-plan → Create EARS specification (feature/SPEC-{ID} branch)
|
|
503
|
-
✅ /alfred:2-run → TDD implementation
|
|
504
|
-
✅ /alfred:3-sync → Document synchronization + PR Ready
|
|
505
|
-
|
|
506
|
-
⏳ Next steps: PR review and manual merge required
|
|
507
|
-
> gh pr view (check PR)
|
|
508
|
-
> gh pr merge --squash (merge after review)
|
|
509
|
-
```
|
|
1352
|
+
git-manager reported an issue.
|
|
1353
|
+
Check git status and resolve conflicts if any.
|
|
510
1354
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
🎉 Automatic switch to develop branch done!
|
|
519
|
-
📍 You are here: develop (ready for next work)
|
|
520
|
-
> /alfred:1-plan "Describe next feature" # Create new branch in develop
|
|
521
|
-
```
|
|
1355
|
+
You can retry commit manually:
|
|
1356
|
+
git add .moai/reports/ docs/ README.md
|
|
1357
|
+
git commit -m "docs: sync documentation"
|
|
1358
|
+
```
|
|
1359
|
+
- **STOP HERE** → Exit with error code
|
|
1360
|
+
|
|
1361
|
+
**Result**: Document changes committed to Git history.
|
|
522
1362
|
|
|
523
|
-
|
|
1363
|
+
**Next step**: Go to STEP 3.2
|
|
524
1364
|
|
|
525
|
-
|
|
526
|
-
- When the implementation of multiple SPECs has been completed and the entire project documentation needs to be updated
|
|
527
|
-
- When periodic synchronization of the entire document in Personal mode is required.
|
|
1365
|
+
---
|
|
528
1366
|
|
|
529
|
-
|
|
530
|
-
- **Personal/Team mode**: Synchronize only specific SPEC-related documents
|
|
531
|
-
- **Project mode**: Synchronize README, architecture documentation, and entire API documentation
|
|
1367
|
+
### STEP 3.2: (Optional) PR Ready Transition
|
|
532
1368
|
|
|
533
|
-
**
|
|
534
|
-
- README.md (updated complete feature list)
|
|
535
|
-
- docs/architecture.md (updated system design)
|
|
536
|
-
- docs/api/ (unified API documentation)
|
|
537
|
-
- .moai/indexes/ (rebuilt full TAG index)
|
|
1369
|
+
**Your task**: Transition PR from Draft to Ready for Review (Team mode only).
|
|
538
1370
|
|
|
539
|
-
|
|
540
|
-
🏢 Integrated branch sync complete!
|
|
1371
|
+
**Decision point**:
|
|
541
1372
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
1373
|
+
1. **Check if PR transition is needed**:
|
|
1374
|
+
- Read variable: `$PROJECT_MODE`
|
|
1375
|
+
- IF `$PROJECT_MODE != "Team"` → Skip this step:
|
|
1376
|
+
```
|
|
1377
|
+
ℹ️ PR transition skipped (Personal mode)
|
|
1378
|
+
```
|
|
1379
|
+
- **Next step**: Go to STEP 3.5 (skip auto-merge)
|
|
547
1380
|
|
|
548
|
-
|
|
549
|
-
|
|
1381
|
+
2. **IF Team mode**:
|
|
1382
|
+
- Continue to PR transition
|
|
1383
|
+
|
|
1384
|
+
3. **Check if gh CLI is available**:
|
|
1385
|
+
- Execute: `which gh`
|
|
1386
|
+
- IF gh NOT found → Print warning and skip:
|
|
1387
|
+
```
|
|
1388
|
+
⚠️ Warning: GitHub CLI (gh) not found
|
|
1389
|
+
|
|
1390
|
+
PR transition skipped.
|
|
1391
|
+
To enable PR features, install gh CLI:
|
|
1392
|
+
https://cli.github.com/
|
|
1393
|
+
```
|
|
1394
|
+
- **Next step**: Go to STEP 3.5
|
|
1395
|
+
|
|
1396
|
+
4. **Get current PR number**:
|
|
1397
|
+
- Execute: `gh pr view --json number -q '.number'`
|
|
1398
|
+
- Store result in variable: `$PR_NUMBER`
|
|
1399
|
+
- IF command fails → Print info and skip:
|
|
1400
|
+
```
|
|
1401
|
+
ℹ️ No PR found for current branch
|
|
1402
|
+
|
|
1403
|
+
Skipping PR transition.
|
|
1404
|
+
You can create a PR manually with: gh pr create
|
|
1405
|
+
```
|
|
1406
|
+
- **Next step**: Go to STEP 3.5
|
|
1407
|
+
|
|
1408
|
+
5. **Get current PR status**:
|
|
1409
|
+
- Execute: `gh pr view $PR_NUMBER --json isDraft -q '.isDraft'`
|
|
1410
|
+
- Store result in variable: `$IS_DRAFT`
|
|
1411
|
+
|
|
1412
|
+
6. **IF PR is already Ready** (`$IS_DRAFT = false`):
|
|
1413
|
+
- Print:
|
|
1414
|
+
```
|
|
1415
|
+
ℹ️ PR already in Ready state
|
|
1416
|
+
|
|
1417
|
+
PR #$PR_NUMBER: Ready for Review
|
|
1418
|
+
```
|
|
1419
|
+
- **Next step**: Go to STEP 3.3 (check auto-merge)
|
|
1420
|
+
|
|
1421
|
+
7. **IF PR is Draft** (`$IS_DRAFT = true`):
|
|
1422
|
+
- Transition PR to Ready:
|
|
1423
|
+
- Execute: `gh pr ready $PR_NUMBER`
|
|
1424
|
+
- Store exit code in variable: `$PR_READY_EXIT`
|
|
1425
|
+
|
|
1426
|
+
8. **Verify PR transition success**:
|
|
1427
|
+
- IF `$PR_READY_EXIT != 0` → Print error:
|
|
1428
|
+
```
|
|
1429
|
+
❌ Error: PR transition failed
|
|
1430
|
+
|
|
1431
|
+
Unable to transition PR #$PR_NUMBER to Ready.
|
|
1432
|
+
Check PR status manually: gh pr view $PR_NUMBER
|
|
1433
|
+
```
|
|
1434
|
+
- ELSE → Print success:
|
|
1435
|
+
```
|
|
1436
|
+
✅ PR transitioned to Ready for Review
|
|
1437
|
+
|
|
1438
|
+
PR #$PR_NUMBER: Ready for Review
|
|
1439
|
+
|
|
1440
|
+
View PR: gh pr view $PR_NUMBER --web
|
|
1441
|
+
```
|
|
1442
|
+
|
|
1443
|
+
9. **Assign reviewers** (if configured):
|
|
1444
|
+
- Read `.moai/config.json` → Extract `github.reviewers`
|
|
1445
|
+
- IF reviewers configured:
|
|
1446
|
+
- Execute: `gh pr edit $PR_NUMBER --add-reviewer [reviewer-list]`
|
|
1447
|
+
|
|
1448
|
+
10. **Add labels** (if configured):
|
|
1449
|
+
- Read `.moai/config.json` → Extract `github.pr_labels`
|
|
1450
|
+
- IF labels configured:
|
|
1451
|
+
- Execute: `gh pr edit $PR_NUMBER --add-label [label-list]`
|
|
1452
|
+
|
|
1453
|
+
**Result**: PR transitioned to Ready for Review (Team mode only).
|
|
1454
|
+
|
|
1455
|
+
**Next step**: Go to STEP 3.3
|
|
1456
|
+
|
|
1457
|
+
---
|
|
1458
|
+
|
|
1459
|
+
### STEP 3.3: (Optional) PR Auto-Merge
|
|
1460
|
+
|
|
1461
|
+
**Your task**: Automatically merge PR and clean up branch (if --auto-merge flag is set).
|
|
1462
|
+
|
|
1463
|
+
**Decision point**:
|
|
1464
|
+
|
|
1465
|
+
1. **Check if auto-merge is requested**:
|
|
1466
|
+
- Read variable: `$AUTO_MERGE`
|
|
1467
|
+
- IF `$AUTO_MERGE = false` → Skip this step:
|
|
1468
|
+
```
|
|
1469
|
+
ℹ️ Auto-merge not requested
|
|
1470
|
+
|
|
1471
|
+
PR is Ready for manual review and merge.
|
|
1472
|
+
```
|
|
1473
|
+
- **Next step**: Go to STEP 3.5
|
|
1474
|
+
|
|
1475
|
+
2. **IF auto-merge requested** (`$AUTO_MERGE = true`):
|
|
1476
|
+
- Print:
|
|
1477
|
+
```
|
|
1478
|
+
🤖 Auto-merge activated
|
|
1479
|
+
|
|
1480
|
+
Checking PR status and CI/CD...
|
|
1481
|
+
```
|
|
1482
|
+
|
|
1483
|
+
3. **Check CI/CD status**:
|
|
1484
|
+
- Execute: `gh pr checks $PR_NUMBER`
|
|
1485
|
+
- Store exit code in variable: `$CI_STATUS`
|
|
1486
|
+
- IF `$CI_STATUS != 0` → Print error and abort:
|
|
1487
|
+
```
|
|
1488
|
+
❌ Error: CI/CD checks not passing
|
|
1489
|
+
|
|
1490
|
+
Cannot auto-merge PR #$PR_NUMBER
|
|
1491
|
+
|
|
1492
|
+
Check CI/CD status: gh pr checks $PR_NUMBER
|
|
1493
|
+
|
|
1494
|
+
Please wait for checks to pass or merge manually.
|
|
1495
|
+
```
|
|
1496
|
+
- **STOP HERE** → Go to STEP 3.5
|
|
1497
|
+
|
|
1498
|
+
4. **Check for merge conflicts**:
|
|
1499
|
+
- Execute: `gh pr view $PR_NUMBER --json mergeable -q '.mergeable'`
|
|
1500
|
+
- Store result in variable: `$MERGEABLE`
|
|
1501
|
+
- IF `$MERGEABLE != "MERGEABLE"` → Print error and abort:
|
|
1502
|
+
```
|
|
1503
|
+
❌ Error: PR has merge conflicts
|
|
1504
|
+
|
|
1505
|
+
Cannot auto-merge PR #$PR_NUMBER
|
|
1506
|
+
|
|
1507
|
+
Resolve conflicts manually:
|
|
1508
|
+
git fetch origin develop
|
|
1509
|
+
git merge origin/develop
|
|
1510
|
+
```
|
|
1511
|
+
- **STOP HERE** → Go to STEP 3.5
|
|
1512
|
+
|
|
1513
|
+
5. **Execute auto-merge**:
|
|
1514
|
+
- Print:
|
|
1515
|
+
```
|
|
1516
|
+
🚀 Merging PR #$PR_NUMBER...
|
|
1517
|
+
```
|
|
1518
|
+
- Execute: `gh pr merge $PR_NUMBER --squash --delete-branch`
|
|
1519
|
+
- Store exit code in variable: `$MERGE_EXIT`
|
|
1520
|
+
|
|
1521
|
+
6. **Verify merge success**:
|
|
1522
|
+
- IF `$MERGE_EXIT != 0` → Print error:
|
|
1523
|
+
```
|
|
1524
|
+
❌ Error: PR merge failed
|
|
1525
|
+
|
|
1526
|
+
Auto-merge encountered an issue.
|
|
1527
|
+
Merge manually: gh pr merge $PR_NUMBER --squash
|
|
1528
|
+
```
|
|
1529
|
+
- ELSE → Print success:
|
|
1530
|
+
```
|
|
1531
|
+
✅ PR merged successfully
|
|
1532
|
+
|
|
1533
|
+
PR #$PR_NUMBER: Merged to develop
|
|
1534
|
+
Remote feature branch: Deleted
|
|
1535
|
+
```
|
|
1536
|
+
|
|
1537
|
+
**Result**: PR merged and remote branch deleted (if auto-merge succeeded).
|
|
1538
|
+
|
|
1539
|
+
**Next step**: Go to STEP 3.4
|
|
1540
|
+
|
|
1541
|
+
---
|
|
1542
|
+
|
|
1543
|
+
### STEP 3.4: (Optional) Branch Cleanup
|
|
1544
|
+
|
|
1545
|
+
**Your task**: Clean up local branches and checkout develop branch (if auto-merge succeeded).
|
|
1546
|
+
|
|
1547
|
+
**Decision point**:
|
|
1548
|
+
|
|
1549
|
+
1. **Check if branch cleanup is needed**:
|
|
1550
|
+
- Read variable: `$MERGE_EXIT`
|
|
1551
|
+
- IF `$MERGE_EXIT != 0` OR `$AUTO_MERGE = false` → Skip cleanup:
|
|
1552
|
+
```
|
|
1553
|
+
ℹ️ Branch cleanup skipped
|
|
1554
|
+
```
|
|
1555
|
+
- **Next step**: Go to STEP 3.5
|
|
1556
|
+
|
|
1557
|
+
2. **IF merge succeeded**:
|
|
1558
|
+
- Continue to branch cleanup
|
|
1559
|
+
|
|
1560
|
+
3. **Get current branch name**:
|
|
1561
|
+
- Execute: `git rev-parse --abbrev-ref HEAD`
|
|
1562
|
+
- Store result in variable: `$CURRENT_BRANCH`
|
|
1563
|
+
|
|
1564
|
+
4. **Checkout develop branch**:
|
|
1565
|
+
- Execute: `git checkout develop`
|
|
1566
|
+
- Store exit code in variable: `$CHECKOUT_EXIT`
|
|
1567
|
+
- IF `$CHECKOUT_EXIT != 0` → Print error:
|
|
1568
|
+
```
|
|
1569
|
+
⚠️ Warning: Could not checkout develop
|
|
1570
|
+
|
|
1571
|
+
Staying on current branch: $CURRENT_BRANCH
|
|
1572
|
+
```
|
|
1573
|
+
- ELSE → Print:
|
|
1574
|
+
```
|
|
1575
|
+
✅ Checked out develop branch
|
|
1576
|
+
```
|
|
1577
|
+
|
|
1578
|
+
5. **Synchronize with remote**:
|
|
1579
|
+
- Execute: `git pull origin develop`
|
|
1580
|
+
- Print:
|
|
1581
|
+
```
|
|
1582
|
+
✅ Develop branch synchronized with remote
|
|
1583
|
+
```
|
|
1584
|
+
|
|
1585
|
+
6. **Delete local feature branch**:
|
|
1586
|
+
- Execute: `git branch -d $CURRENT_BRANCH`
|
|
1587
|
+
- Store exit code in variable: `$DELETE_EXIT`
|
|
1588
|
+
- IF `$DELETE_EXIT != 0` → Print warning:
|
|
1589
|
+
```
|
|
1590
|
+
⚠️ Warning: Could not delete local branch
|
|
1591
|
+
|
|
1592
|
+
Branch: $CURRENT_BRANCH
|
|
1593
|
+
|
|
1594
|
+
Delete manually if needed: git branch -D $CURRENT_BRANCH
|
|
1595
|
+
```
|
|
1596
|
+
- ELSE → Print:
|
|
1597
|
+
```
|
|
1598
|
+
✅ Local feature branch deleted
|
|
1599
|
+
|
|
1600
|
+
Branch: $CURRENT_BRANCH
|
|
1601
|
+
```
|
|
550
1602
|
|
|
551
|
-
|
|
1603
|
+
7. **Check for auto-delete-branches config**:
|
|
1604
|
+
- Read `.moai/config.json` → Extract `github.auto_delete_branches`
|
|
1605
|
+
- IF configured as `true`:
|
|
1606
|
+
- Print:
|
|
1607
|
+
```
|
|
1608
|
+
ℹ️ Remote branch already deleted by auto-merge
|
|
1609
|
+
```
|
|
552
1610
|
|
|
553
|
-
**
|
|
1611
|
+
8. **Print branch cleanup summary**:
|
|
1612
|
+
```
|
|
1613
|
+
🧹 Branch Cleanup Complete
|
|
554
1614
|
|
|
555
|
-
-
|
|
556
|
-
-
|
|
557
|
-
-
|
|
1615
|
+
- Current branch: develop
|
|
1616
|
+
- Deleted local branch: $CURRENT_BRANCH
|
|
1617
|
+
- Remote branch: Deleted
|
|
558
1618
|
|
|
559
|
-
|
|
1619
|
+
🎉 Ready for next feature!
|
|
560
1620
|
|
|
1621
|
+
Start next work with: /alfred:1-plan "feature description"
|
|
1622
|
+
```
|
|
1623
|
+
|
|
1624
|
+
**Result**: Branches cleaned up. Repository ready for next development cycle.
|
|
1625
|
+
|
|
1626
|
+
**Next step**: Go to STEP 3.5
|
|
1627
|
+
|
|
1628
|
+
---
|
|
1629
|
+
|
|
1630
|
+
### STEP 3.5: Display Completion Report & Next Steps
|
|
1631
|
+
|
|
1632
|
+
**Your task**: Present final completion report and ask user what to do next.
|
|
1633
|
+
|
|
1634
|
+
**Steps**:
|
|
1635
|
+
|
|
1636
|
+
1. **Determine workflow completion status**:
|
|
1637
|
+
- Read variables: `$PROJECT_MODE`, `$AUTO_MERGE`, `$MERGE_EXIT`
|
|
1638
|
+
- Determine completion type:
|
|
1639
|
+
- IF `$AUTO_MERGE = true` AND `$MERGE_EXIT = 0` → Status: "Full Auto-Merge Complete"
|
|
1640
|
+
- ELSE IF `$PROJECT_MODE = "Team"` → Status: "PR Ready for Review"
|
|
1641
|
+
- ELSE → Status: "Personal Mode Checkpoint"
|
|
1642
|
+
|
|
1643
|
+
2. **Print final completion report**:
|
|
1644
|
+
|
|
1645
|
+
**IF Full Auto-Merge Complete**:
|
|
1646
|
+
```
|
|
1647
|
+
═══════════════════════════════════════════════════════
|
|
1648
|
+
🎉 MoAI-ADK Workflow Complete (Full Auto-Merge)
|
|
1649
|
+
═══════════════════════════════════════════════════════
|
|
1650
|
+
|
|
1651
|
+
✅ Completed Steps:
|
|
1652
|
+
1. Document synchronization
|
|
1653
|
+
2. TAG system verification
|
|
1654
|
+
3. Git commit
|
|
1655
|
+
4. PR merge to develop
|
|
1656
|
+
5. Branch cleanup
|
|
1657
|
+
|
|
1658
|
+
📍 Current Status:
|
|
1659
|
+
- Branch: develop
|
|
1660
|
+
- PR #$PR_NUMBER: Merged
|
|
1661
|
+
- Local feature branch: Deleted
|
|
1662
|
+
- Remote feature branch: Deleted
|
|
1663
|
+
|
|
1664
|
+
🚀 Ready for next feature!
|
|
1665
|
+
|
|
1666
|
+
═══════════════════════════════════════════════════════
|
|
1667
|
+
```
|
|
1668
|
+
|
|
1669
|
+
**IF PR Ready for Review**:
|
|
1670
|
+
```
|
|
1671
|
+
═══════════════════════════════════════════════════════
|
|
1672
|
+
✅ MoAI-ADK Workflow Complete (PR Ready)
|
|
1673
|
+
═══════════════════════════════════════════════════════
|
|
1674
|
+
|
|
1675
|
+
✅ Completed Steps:
|
|
1676
|
+
1. Document synchronization
|
|
1677
|
+
2. TAG system verification
|
|
1678
|
+
3. Git commit
|
|
1679
|
+
4. PR transition to Ready
|
|
1680
|
+
|
|
1681
|
+
📍 Current Status:
|
|
1682
|
+
- PR #$PR_NUMBER: Ready for Review
|
|
1683
|
+
- Branch: $CURRENT_BRANCH
|
|
1684
|
+
|
|
1685
|
+
⏳ Next Steps:
|
|
1686
|
+
- Review PR: gh pr view $PR_NUMBER --web
|
|
1687
|
+
- Merge after approval: gh pr merge $PR_NUMBER --squash
|
|
1688
|
+
|
|
1689
|
+
═══════════════════════════════════════════════════════
|
|
1690
|
+
```
|
|
1691
|
+
|
|
1692
|
+
**IF Personal Mode**:
|
|
1693
|
+
```
|
|
1694
|
+
═══════════════════════════════════════════════════════
|
|
1695
|
+
✅ Document Synchronization Complete (Personal Mode)
|
|
1696
|
+
═══════════════════════════════════════════════════════
|
|
1697
|
+
|
|
1698
|
+
✅ Completed Steps:
|
|
1699
|
+
1. Document synchronization
|
|
1700
|
+
2. TAG system verification
|
|
1701
|
+
3. Git commit (checkpoint)
|
|
1702
|
+
|
|
1703
|
+
📍 Current Status:
|
|
1704
|
+
- Branch: $CURRENT_BRANCH
|
|
1705
|
+
- Changes committed locally
|
|
1706
|
+
|
|
1707
|
+
💡 Personal mode workflow:
|
|
1708
|
+
- Continue development on current branch
|
|
1709
|
+
- OR merge to main manually when ready
|
|
1710
|
+
|
|
1711
|
+
═══════════════════════════════════════════════════════
|
|
1712
|
+
```
|
|
1713
|
+
|
|
1714
|
+
3. **Ask user for next action using AskUserQuestion**:
|
|
1715
|
+
- **Your task**: Use the AskUserQuestion tool to gather user's next step
|
|
1716
|
+
- Tool call:
|
|
1717
|
+
- `questions`: Array with 1 question
|
|
1718
|
+
- Question details:
|
|
1719
|
+
- `question`: "Documentation synchronization complete. What would you like to do next?"
|
|
1720
|
+
- `header`: "Next Steps"
|
|
1721
|
+
- `multiSelect`: false
|
|
1722
|
+
- `options`: Array with 3 choices (context-dependent):
|
|
1723
|
+
|
|
1724
|
+
**IF auto-merge completed**:
|
|
1725
|
+
1. Label: "📋 Create Next SPEC", Description: "Start new feature planning with /alfred:1-plan"
|
|
1726
|
+
2. Label: "🔄 Start New Session", Description: "Execute /clear for fresh session (recommended for performance)"
|
|
1727
|
+
3. Label: "🎯 Project Overview", Description: "Review project status and documentation"
|
|
1728
|
+
|
|
1729
|
+
**IF PR Ready (not auto-merged)**:
|
|
1730
|
+
1. Label: "📋 Create Next SPEC", Description: "Start new feature planning with /alfred:1-plan"
|
|
1731
|
+
2. Label: "📤 Review PR", Description: "View PR and prepare for manual merge"
|
|
1732
|
+
3. Label: "🔄 Start New Session", Description: "Execute /clear for fresh session (recommended for performance)"
|
|
1733
|
+
|
|
1734
|
+
**IF Personal Mode**:
|
|
1735
|
+
1. Label: "📋 Create Next SPEC", Description: "Start new feature planning with /alfred:1-plan"
|
|
1736
|
+
2. Label: "🔧 Continue Development", Description: "Keep working on current branch"
|
|
1737
|
+
3. Label: "🔄 Start New Session", Description: "Execute /clear for fresh session (recommended for performance)"
|
|
1738
|
+
|
|
1739
|
+
4. **Wait for user response**:
|
|
1740
|
+
- Store response in variable: `$NEXT_ACTION`
|
|
1741
|
+
- Read value from: `$NEXT_ACTION["0"]`
|
|
1742
|
+
|
|
1743
|
+
5. **Process user response**:
|
|
1744
|
+
|
|
1745
|
+
**IF user chose "📋 Create Next SPEC"**:
|
|
1746
|
+
- Print:
|
|
1747
|
+
```
|
|
1748
|
+
🚀 Ready to start next feature
|
|
1749
|
+
|
|
1750
|
+
Use: /alfred:1-plan "feature description"
|
|
1751
|
+
|
|
1752
|
+
This will create a new SPEC and start a new development cycle.
|
|
1753
|
+
```
|
|
1754
|
+
|
|
1755
|
+
**IF user chose "🔄 Start New Session"**:
|
|
1756
|
+
- Print:
|
|
1757
|
+
```
|
|
1758
|
+
🔄 Starting fresh session
|
|
1759
|
+
|
|
1760
|
+
Recommendation: Use /clear or /new command to reset context.
|
|
1761
|
+
|
|
1762
|
+
This improves performance for the next development cycle.
|
|
1763
|
+
```
|
|
1764
|
+
|
|
1765
|
+
**IF user chose "📤 Review PR"** (Team mode):
|
|
1766
|
+
- Print:
|
|
1767
|
+
```
|
|
1768
|
+
📤 Opening PR for review
|
|
1769
|
+
|
|
1770
|
+
PR #$PR_NUMBER: Ready for Review
|
|
1771
|
+
|
|
1772
|
+
View in browser: gh pr view $PR_NUMBER --web
|
|
1773
|
+
|
|
1774
|
+
After approval, merge with: gh pr merge $PR_NUMBER --squash
|
|
1775
|
+
```
|
|
1776
|
+
|
|
1777
|
+
**IF user chose "🔧 Continue Development"** (Personal mode):
|
|
1778
|
+
- Print:
|
|
1779
|
+
```
|
|
1780
|
+
🔧 Continuing development
|
|
1781
|
+
|
|
1782
|
+
Current branch: $CURRENT_BRANCH
|
|
1783
|
+
|
|
1784
|
+
Your changes are committed. Continue implementing features.
|
|
1785
|
+
```
|
|
1786
|
+
|
|
1787
|
+
**IF user chose "🎯 Project Overview"**:
|
|
1788
|
+
- Print:
|
|
1789
|
+
```
|
|
1790
|
+
🎯 Project Overview
|
|
1791
|
+
|
|
1792
|
+
Sync reports: .moai/reports/
|
|
1793
|
+
SPEC documents: .moai/specs/
|
|
1794
|
+
TAG index: .moai/indexes/tags.db
|
|
1795
|
+
|
|
1796
|
+
Quick status check: /alfred:3-sync status
|
|
1797
|
+
```
|
|
1798
|
+
|
|
1799
|
+
6. **Print final message**:
|
|
1800
|
+
```
|
|
1801
|
+
✨ Thank you for using MoAI-ADK!
|
|
1802
|
+
|
|
1803
|
+
For more information:
|
|
1804
|
+
- Skill("moai-alfred-dev-guide")
|
|
1805
|
+
- CLAUDE.md in project root
|
|
1806
|
+
```
|
|
1807
|
+
|
|
1808
|
+
**Result**: User informed of completion. Next action suggested.
|
|
1809
|
+
|
|
1810
|
+
**Next step**: Command complete. Exit.
|
|
1811
|
+
|
|
1812
|
+
---
|
|
1813
|
+
|
|
1814
|
+
## 🚨 STEP 4: Graceful Exit (User Aborted or Modified)
|
|
1815
|
+
|
|
1816
|
+
**Your task**: Handle user abortion or modification requests gracefully.
|
|
1817
|
+
|
|
1818
|
+
**This step is reached when**:
|
|
1819
|
+
- User chose "❌ Abort" in STEP 1.6
|
|
1820
|
+
- User chose "🔄 Request Modifications" in STEP 1.6
|
|
1821
|
+
|
|
1822
|
+
**Steps**:
|
|
1823
|
+
|
|
1824
|
+
1. **Read user decision**:
|
|
1825
|
+
- Read variable: `$USER_DECISION["0"]`
|
|
1826
|
+
|
|
1827
|
+
2. **IF user chose "❌ Abort"**:
|
|
1828
|
+
- Print abort message:
|
|
1829
|
+
```
|
|
1830
|
+
═══════════════════════════════════════════════════════
|
|
1831
|
+
❌ Synchronization Aborted
|
|
1832
|
+
═══════════════════════════════════════════════════════
|
|
1833
|
+
|
|
1834
|
+
No changes were made to:
|
|
1835
|
+
- Documents
|
|
1836
|
+
- Git history
|
|
1837
|
+
- Branch state
|
|
1838
|
+
|
|
1839
|
+
Your project remains in its current state.
|
|
1840
|
+
|
|
1841
|
+
You can retry synchronization anytime with:
|
|
1842
|
+
/alfred:3-sync [mode]
|
|
1843
|
+
|
|
1844
|
+
═══════════════════════════════════════════════════════
|
|
1845
|
+
```
|
|
1846
|
+
- **Exit command** with exit code 0
|
|
1847
|
+
|
|
1848
|
+
3. **IF user chose "🔄 Request Modifications"**:
|
|
1849
|
+
- Print:
|
|
1850
|
+
```
|
|
1851
|
+
🔄 Re-analyzing with modifications...
|
|
1852
|
+
```
|
|
1853
|
+
- **Go back to STEP 1.5** with `$MODIFICATION_REQUEST` applied
|
|
1854
|
+
|
|
1855
|
+
**Result**: Command exits gracefully or re-runs analysis.
|
|
1856
|
+
|
|
1857
|
+
**Next step**: Exit or STEP 1.5
|
|
1858
|
+
|
|
1859
|
+
---
|
|
1860
|
+
|
|
1861
|
+
## 📚 Mode-Specific Execution Summary
|
|
1862
|
+
|
|
1863
|
+
### Auto Mode (default)
|
|
1864
|
+
|
|
1865
|
+
**Command**: `/alfred:3-sync` or `/alfred:3-sync auto`
|
|
1866
|
+
|
|
1867
|
+
**Behavior**:
|
|
1868
|
+
- Smart selective synchronization based on Git changes
|
|
1869
|
+
- Only changed files and related documents are updated
|
|
1870
|
+
- Quick execution for daily workflow
|
|
1871
|
+
- PR Ready transition in Team mode
|
|
1872
|
+
|
|
1873
|
+
**Best for**: Daily development workflow
|
|
1874
|
+
|
|
1875
|
+
---
|
|
1876
|
+
|
|
1877
|
+
### Force Mode
|
|
1878
|
+
|
|
1879
|
+
**Command**: `/alfred:3-sync force`
|
|
1880
|
+
|
|
1881
|
+
**Behavior**:
|
|
1882
|
+
- Full project re-synchronization
|
|
1883
|
+
- All documents regenerated
|
|
1884
|
+
- All TAG chains re-verified
|
|
1885
|
+
- Longer execution time
|
|
1886
|
+
|
|
1887
|
+
**Best for**: Error recovery, major refactoring, periodic full sync
|
|
1888
|
+
|
|
1889
|
+
---
|
|
1890
|
+
|
|
1891
|
+
### Status Mode
|
|
1892
|
+
|
|
1893
|
+
**Command**: `/alfred:3-sync status`
|
|
1894
|
+
|
|
1895
|
+
**Behavior**:
|
|
1896
|
+
- Quick status check only
|
|
1897
|
+
- No synchronization performed
|
|
1898
|
+
- Reports TAG system health
|
|
1899
|
+
- Lists changed files since last sync
|
|
1900
|
+
|
|
1901
|
+
**Best for**: Quick health check before starting work
|
|
1902
|
+
|
|
1903
|
+
---
|
|
1904
|
+
|
|
1905
|
+
### Project Mode
|
|
1906
|
+
|
|
1907
|
+
**Command**: `/alfred:3-sync project`
|
|
1908
|
+
|
|
1909
|
+
**Behavior**:
|
|
1910
|
+
- Integrated project-wide synchronization
|
|
1911
|
+
- README.md updated with full feature list
|
|
1912
|
+
- docs/architecture.md updated
|
|
1913
|
+
- docs/api/ unified
|
|
1914
|
+
- .moai/indexes/ rebuilt
|
|
1915
|
+
|
|
1916
|
+
**Best for**: Milestone completion, periodic integrated sync
|
|
1917
|
+
|
|
1918
|
+
---
|
|
1919
|
+
|
|
1920
|
+
## 🏗️ Agent Collaboration Architecture
|
|
1921
|
+
|
|
1922
|
+
### Separation of Concerns
|
|
1923
|
+
|
|
1924
|
+
**doc-syncer Agent** (STEP 2):
|
|
1925
|
+
- Living Document synchronization
|
|
1926
|
+
- @TAG system updates
|
|
1927
|
+
- SPEC-Code alignment
|
|
1928
|
+
- Domain-specific routing
|
|
1929
|
+
- Sync report generation
|
|
1930
|
+
|
|
1931
|
+
**git-manager Agent** (STEP 3):
|
|
1932
|
+
- Git commit operations
|
|
1933
|
+
- PR status transitions
|
|
1934
|
+
- PR auto-merge (if requested)
|
|
1935
|
+
- Branch cleanup
|
|
1936
|
+
- GitHub CLI integration
|
|
1937
|
+
|
|
1938
|
+
**Single Responsibility Principle**:
|
|
1939
|
+
- doc-syncer does NOT touch Git
|
|
1940
|
+
- git-manager does NOT touch documents
|
|
1941
|
+
- Clear handoff between STEP 2 and STEP 3
|
|
1942
|
+
|
|
1943
|
+
---
|
|
1944
|
+
|
|
1945
|
+
## 🔗 TAG System Verification
|
|
1946
|
+
|
|
1947
|
+
### Direct Code Scanning
|
|
1948
|
+
|
|
1949
|
+
**Method**: `rg '@TAG' -n src/ tests/`
|
|
1950
|
+
|
|
1951
|
+
**Why**: Direct code scanning ensures accurate TAG counting without relying on index files.
|
|
1952
|
+
|
|
1953
|
+
**Verification points**:
|
|
1954
|
+
- @SPEC TAG locations (.moai/specs/)
|
|
1955
|
+
- @TEST TAG locations (tests/)
|
|
1956
|
+
- @CODE TAG locations (src/)
|
|
1957
|
+
- @DOC TAG locations (docs/)
|
|
1958
|
+
|
|
1959
|
+
**Integrity checks**:
|
|
1960
|
+
- Orphan @CODE TAGs (no matching @SPEC)
|
|
1961
|
+
- Orphan @SPEC TAGs (no matching @CODE)
|
|
1962
|
+
- Broken references
|
|
1963
|
+
- Duplicate TAGs
|
|
1964
|
+
|
|
1965
|
+
---
|
|
1966
|
+
|
|
1967
|
+
## 🎯 Integration with MoAI-ADK Workflow
|
|
1968
|
+
|
|
1969
|
+
### 4-Step Workflow Position
|
|
1970
|
+
|
|
1971
|
+
This command is **STEP 4** (Report & Commit):
|
|
1972
|
+
|
|
1973
|
+
1. **/alfred:1-plan** → SPEC creation
|
|
1974
|
+
2. **/alfred:2-run** → TDD implementation
|
|
1975
|
+
3. **/alfred:3-sync** → **Document sync + PR (this command)**
|
|
1976
|
+
4. Cycle complete → Start new SPEC
|
|
1977
|
+
|
|
1978
|
+
### Conditional Report Generation
|
|
1979
|
+
|
|
1980
|
+
**Follows CLAUDE.md guidance**:
|
|
1981
|
+
- Reports generated ONLY when explicitly requested
|
|
1982
|
+
- Sync report is REQUIRED (always generated)
|
|
1983
|
+
- Domain-specific reports OPTIONAL (only if domains detected)
|
|
1984
|
+
|
|
1985
|
+
---
|
|
1986
|
+
|
|
1987
|
+
## ⚙️ Environment Dependencies
|
|
1988
|
+
|
|
1989
|
+
**Required**:
|
|
1990
|
+
- Git repository
|
|
561
1991
|
- MoAI-ADK project structure (.moai/, .claude/)
|
|
562
|
-
-
|
|
563
|
-
- Compliance with TRUST 5 principles
|
|
1992
|
+
- Python3 (for TAG verification scripts)
|
|
564
1993
|
|
|
565
|
-
**
|
|
1994
|
+
**Optional**:
|
|
1995
|
+
- gh CLI (for GitHub PR integration)
|
|
1996
|
+
- Domain-specific experts (for domain routing)
|
|
566
1997
|
|
|
567
|
-
|
|
568
|
-
-
|
|
569
|
-
-
|
|
1998
|
+
**Graceful degradation**:
|
|
1999
|
+
- Works without gh CLI (skips PR features)
|
|
2000
|
+
- Works without Python3 (limited TAG checks)
|
|
2001
|
+
- Works without domain experts (uses generic templates)
|
|
570
2002
|
|
|
571
2003
|
---
|
|
572
2004
|
|
|
573
|
-
##
|
|
2005
|
+
## 🎓 Best Practices
|
|
2006
|
+
|
|
2007
|
+
### When to Use Each Mode
|
|
2008
|
+
|
|
2009
|
+
**Use auto mode** (default):
|
|
2010
|
+
- Daily development workflow
|
|
2011
|
+
- Single SPEC implementation complete
|
|
2012
|
+
- Quick sync after code changes
|
|
2013
|
+
|
|
2014
|
+
**Use force mode**:
|
|
2015
|
+
- After major refactoring
|
|
2016
|
+
- Error recovery (TAG system broken)
|
|
2017
|
+
- Periodic full re-sync (weekly/monthly)
|
|
2018
|
+
|
|
2019
|
+
**Use status mode**:
|
|
2020
|
+
- Before starting work (health check)
|
|
2021
|
+
- Quick overview of sync needs
|
|
2022
|
+
- No changes to files
|
|
2023
|
+
|
|
2024
|
+
**Use project mode**:
|
|
2025
|
+
- Milestone completion
|
|
2026
|
+
- Release preparation
|
|
2027
|
+
- Integrated documentation update
|
|
2028
|
+
|
|
2029
|
+
### Performance Tips
|
|
2030
|
+
|
|
2031
|
+
**Use --auto-merge for fast iteration**:
|
|
2032
|
+
- Automatically merges PR
|
|
2033
|
+
- Cleans up branches
|
|
2034
|
+
- Returns to develop
|
|
2035
|
+
- Ready for next /alfred:1-plan immediately
|
|
2036
|
+
|
|
2037
|
+
**Start new session after sync**:
|
|
2038
|
+
- Use /clear or /new command
|
|
2039
|
+
- Reduces context size
|
|
2040
|
+
- Improves performance for next cycle
|
|
2041
|
+
|
|
2042
|
+
---
|
|
2043
|
+
|
|
2044
|
+
## 🔍 Troubleshooting
|
|
2045
|
+
|
|
2046
|
+
### TAG Verification Issues
|
|
2047
|
+
|
|
2048
|
+
**Problem**: Orphan TAGs detected
|
|
2049
|
+
|
|
2050
|
+
**Solution**:
|
|
2051
|
+
1. Review sync report: `.moai/reports/sync-report-latest.md`
|
|
2052
|
+
2. Manually fix orphan TAGs in code
|
|
2053
|
+
3. Re-run: `/alfred:3-sync force`
|
|
2054
|
+
|
|
2055
|
+
### PR Transition Failed
|
|
2056
|
+
|
|
2057
|
+
**Problem**: gh CLI error
|
|
2058
|
+
|
|
2059
|
+
**Solution**:
|
|
2060
|
+
1. Check gh authentication: `gh auth status`
|
|
2061
|
+
2. Verify PR exists: `gh pr view`
|
|
2062
|
+
3. Manual transition: `gh pr ready [PR_NUMBER]`
|
|
2063
|
+
|
|
2064
|
+
### Merge Conflicts
|
|
2065
|
+
|
|
2066
|
+
**Problem**: Cannot auto-merge due to conflicts
|
|
2067
|
+
|
|
2068
|
+
**Solution**:
|
|
2069
|
+
1. Fetch latest: `git fetch origin develop`
|
|
2070
|
+
2. Merge develop: `git merge origin/develop`
|
|
2071
|
+
3. Resolve conflicts
|
|
2072
|
+
4. Re-run: `/alfred:3-sync`
|
|
2073
|
+
|
|
2074
|
+
---
|
|
574
2075
|
|
|
575
|
-
|
|
2076
|
+
## 📖 Related Documentation
|
|
576
2077
|
|
|
577
|
-
|
|
2078
|
+
**Skills**:
|
|
2079
|
+
- `Skill("moai-alfred-tag-scanning")` - TAG system details
|
|
2080
|
+
- `Skill("moai-alfred-git-workflow")` - Git operations
|
|
2081
|
+
- `Skill("moai-alfred-trust-validation")` - Quality gates
|
|
2082
|
+
- `Skill("moai-alfred-ask-user-questions")` - TUI interactions
|
|
578
2083
|
|
|
579
|
-
**
|
|
2084
|
+
**Workflows**:
|
|
2085
|
+
- CLAUDE.md - Alfred 4-step workflow
|
|
2086
|
+
- `.moai/docs/workflows/alfred-3-sync.md` - Detailed workflow
|
|
580
2087
|
|
|
581
|
-
**
|
|
2088
|
+
**Configuration**:
|
|
2089
|
+
- `.moai/config.json` - Project settings
|
|
2090
|
+
- `.claude/settings.json` - Claude Code settings
|
|
582
2091
|
|
|
583
2092
|
---
|
|
584
2093
|
|
|
585
|
-
**
|
|
2094
|
+
**Version**: 3.0.0 (Fully Imperative)
|
|
2095
|
+
**Last Updated**: 2025-01-04
|
|
2096
|
+
**Pattern**: Pure command-driven, zero Python pseudo-code, step-by-step execution flow
|