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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Configuration management for MoAI-ADK."""
|
|
2
|
+
|
|
3
|
+
from moai_adk.core.config.migration import (
|
|
4
|
+
get_conversation_language,
|
|
5
|
+
get_conversation_language_name,
|
|
6
|
+
get_report_generation_config,
|
|
7
|
+
get_spec_git_workflow,
|
|
8
|
+
migrate_config_schema_v0_17_0,
|
|
9
|
+
migrate_config_to_nested_structure,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"migrate_config_to_nested_structure",
|
|
14
|
+
"migrate_config_schema_v0_17_0",
|
|
15
|
+
"get_conversation_language",
|
|
16
|
+
"get_conversation_language_name",
|
|
17
|
+
"get_report_generation_config",
|
|
18
|
+
"get_spec_git_workflow",
|
|
19
|
+
]
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# @CODE:LANG-FIX-001:MIGRATION | SPEC: .moai/specs/SPEC-LANG-FIX-001/spec.md
|
|
2
|
+
"""Configuration migration utilities for legacy flat config structure.
|
|
3
|
+
|
|
4
|
+
Supports migration from legacy flat config.json structure to new nested language structure.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def migrate_config_to_nested_structure(config: dict[str, Any]) -> dict[str, Any]:
|
|
11
|
+
"""Migrate legacy flat config to nested language structure.
|
|
12
|
+
|
|
13
|
+
This function handles the transition from legacy flat config:
|
|
14
|
+
"conversation_language": "ko"
|
|
15
|
+
"locale": "ko"
|
|
16
|
+
|
|
17
|
+
To new nested structure:
|
|
18
|
+
"language": {
|
|
19
|
+
"conversation_language": "ko",
|
|
20
|
+
"conversation_language_name": "íęĩė´"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
config: Configuration dictionary that may have legacy structure.
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
Configuration dictionary with nested language structure.
|
|
28
|
+
"""
|
|
29
|
+
# If config already has nested language structure, return as-is
|
|
30
|
+
if "language" in config and isinstance(config["language"], dict):
|
|
31
|
+
return config
|
|
32
|
+
|
|
33
|
+
# If config has legacy flat structure, migrate it
|
|
34
|
+
if "conversation_language" in config and "language" not in config:
|
|
35
|
+
# Extract conversation language from legacy location
|
|
36
|
+
conversation_language = config.pop("conversation_language", "en")
|
|
37
|
+
config.pop("locale", None) # Remove legacy locale field
|
|
38
|
+
|
|
39
|
+
# Map language codes to language names
|
|
40
|
+
language_names = {
|
|
41
|
+
"en": "English",
|
|
42
|
+
"ko": "íęĩė´",
|
|
43
|
+
"ja": "æĨæŦčĒ",
|
|
44
|
+
"zh": "䏿",
|
|
45
|
+
"es": "EspaÃąol",
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
language_name = language_names.get(conversation_language, "English")
|
|
49
|
+
|
|
50
|
+
# Create new nested language structure
|
|
51
|
+
config["language"] = {
|
|
52
|
+
"conversation_language": conversation_language,
|
|
53
|
+
"conversation_language_name": language_name,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return config
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def get_conversation_language(config: dict[str, Any]) -> str:
|
|
60
|
+
"""Get conversation language from config with fallback handling.
|
|
61
|
+
|
|
62
|
+
Handles both legacy flat and new nested config structures.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
config: Configuration dictionary.
|
|
66
|
+
|
|
67
|
+
Returns:
|
|
68
|
+
Language code (e.g., "ko", "en", "ja").
|
|
69
|
+
"""
|
|
70
|
+
# First, try to get from nested structure (new format)
|
|
71
|
+
language_config = config.get("language", {})
|
|
72
|
+
if isinstance(language_config, dict):
|
|
73
|
+
result = language_config.get("conversation_language")
|
|
74
|
+
if result:
|
|
75
|
+
return result
|
|
76
|
+
|
|
77
|
+
# Fall back to legacy flat structure
|
|
78
|
+
result = config.get("conversation_language")
|
|
79
|
+
if result:
|
|
80
|
+
return result
|
|
81
|
+
|
|
82
|
+
# Default to English
|
|
83
|
+
return "en"
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def get_conversation_language_name(config: dict[str, Any]) -> str:
|
|
87
|
+
"""Get conversation language name from config with fallback handling.
|
|
88
|
+
|
|
89
|
+
Handles both legacy flat and new nested config structures.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
config: Configuration dictionary.
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
Language name (e.g., "íęĩė´", "English").
|
|
96
|
+
"""
|
|
97
|
+
# First, try to get from nested structure (new format)
|
|
98
|
+
language_config = config.get("language", {})
|
|
99
|
+
if isinstance(language_config, dict):
|
|
100
|
+
result = language_config.get("conversation_language_name")
|
|
101
|
+
if result:
|
|
102
|
+
return result
|
|
103
|
+
|
|
104
|
+
# If we have the language code, try to map it
|
|
105
|
+
language_code = get_conversation_language(config)
|
|
106
|
+
language_names = {
|
|
107
|
+
"en": "English",
|
|
108
|
+
"ko": "íęĩė´",
|
|
109
|
+
"ja": "æĨæŦčĒ",
|
|
110
|
+
"zh": "䏿",
|
|
111
|
+
"es": "EspaÃąol",
|
|
112
|
+
}
|
|
113
|
+
return language_names.get(language_code, "English")
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def migrate_config_schema_v0_17_0(config: dict[str, Any]) -> dict[str, Any]:
|
|
117
|
+
"""Migrate config schema for v0.16.0 â v0.17.0 (report generation feature).
|
|
118
|
+
|
|
119
|
+
Adds new sections:
|
|
120
|
+
- report_generation: Control automatic report generation
|
|
121
|
+
- Enhanced github: auto_delete_branches, spec_git_workflow settings
|
|
122
|
+
|
|
123
|
+
This function is backward-compatible and safe for existing configs.
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
config: Configuration dictionary (may be v0.16.0 or earlier).
|
|
127
|
+
|
|
128
|
+
Returns:
|
|
129
|
+
Configuration dictionary with v0.17.0 schema.
|
|
130
|
+
"""
|
|
131
|
+
# 1. Add report_generation section if missing (defaults to enabled=true, auto_create=false)
|
|
132
|
+
if "report_generation" not in config:
|
|
133
|
+
config["report_generation"] = {
|
|
134
|
+
"enabled": True,
|
|
135
|
+
"auto_create": False,
|
|
136
|
+
"warn_user": True,
|
|
137
|
+
"user_choice": "Minimal",
|
|
138
|
+
"configured_at": None, # Will be set when user configures
|
|
139
|
+
"allowed_locations": [
|
|
140
|
+
".moai/docs/",
|
|
141
|
+
".moai/reports/",
|
|
142
|
+
".moai/analysis/",
|
|
143
|
+
".moai/specs/SPEC-*/",
|
|
144
|
+
],
|
|
145
|
+
"notes": (
|
|
146
|
+
"Control automatic report generation. 'enabled': turn on/off, "
|
|
147
|
+
"'auto_create': full (true) vs minimal (false) reports. "
|
|
148
|
+
"Helps reduce token usage."
|
|
149
|
+
),
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
# 2. Enhance github section with new fields
|
|
153
|
+
if "github" not in config:
|
|
154
|
+
config["github"] = {}
|
|
155
|
+
|
|
156
|
+
github_config = config["github"]
|
|
157
|
+
|
|
158
|
+
# Add auto_delete_branches settings if missing
|
|
159
|
+
if "auto_delete_branches" not in github_config:
|
|
160
|
+
github_config["auto_delete_branches"] = None
|
|
161
|
+
github_config["auto_delete_branches_checked"] = False
|
|
162
|
+
github_config["auto_delete_branches_rationale"] = "Not configured"
|
|
163
|
+
|
|
164
|
+
# Add spec_git_workflow settings if missing
|
|
165
|
+
if "spec_git_workflow" not in github_config:
|
|
166
|
+
github_config["spec_git_workflow"] = "per_spec"
|
|
167
|
+
github_config["spec_git_workflow_configured"] = False
|
|
168
|
+
github_config["spec_git_workflow_rationale"] = (
|
|
169
|
+
"Ask per SPEC (flexible, user controls each workflow)"
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
# Add notes for new fields if missing
|
|
173
|
+
if "notes_new_fields" not in github_config:
|
|
174
|
+
github_config["notes_new_fields"] = (
|
|
175
|
+
"auto_delete_branches: whether to auto-delete feature branches after merge. "
|
|
176
|
+
"spec_git_workflow: 'feature_branch' (auto), 'develop_direct' (direct), "
|
|
177
|
+
"'per_spec' (ask per SPEC)"
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
return config
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def get_report_generation_config(config: dict[str, Any]) -> dict[str, Any]:
|
|
184
|
+
"""Get report generation configuration with safe defaults.
|
|
185
|
+
|
|
186
|
+
Args:
|
|
187
|
+
config: Configuration dictionary.
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
Report generation configuration with defaults.
|
|
191
|
+
"""
|
|
192
|
+
default_config = {
|
|
193
|
+
"enabled": True,
|
|
194
|
+
"auto_create": False,
|
|
195
|
+
"warn_user": True,
|
|
196
|
+
"user_choice": "Minimal",
|
|
197
|
+
"configured_at": None,
|
|
198
|
+
"allowed_locations": [
|
|
199
|
+
".moai/docs/",
|
|
200
|
+
".moai/reports/",
|
|
201
|
+
".moai/analysis/",
|
|
202
|
+
".moai/specs/SPEC-*/",
|
|
203
|
+
],
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
report_gen = config.get("report_generation", {})
|
|
207
|
+
if isinstance(report_gen, dict):
|
|
208
|
+
# Merge with defaults to ensure all keys exist
|
|
209
|
+
return {**default_config, **report_gen}
|
|
210
|
+
|
|
211
|
+
return default_config
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def get_spec_git_workflow(config: dict[str, Any]) -> str:
|
|
215
|
+
"""Get SPEC git workflow setting with safe default.
|
|
216
|
+
|
|
217
|
+
Options:
|
|
218
|
+
- 'per_spec': Ask per SPEC (flexible, user controls)
|
|
219
|
+
- 'feature_branch': Auto-create branch for each SPEC
|
|
220
|
+
- 'develop_direct': Direct commits to develop
|
|
221
|
+
|
|
222
|
+
Args:
|
|
223
|
+
config: Configuration dictionary.
|
|
224
|
+
|
|
225
|
+
Returns:
|
|
226
|
+
Workflow setting string.
|
|
227
|
+
"""
|
|
228
|
+
github_config = config.get("github", {})
|
|
229
|
+
if isinstance(github_config, dict):
|
|
230
|
+
workflow = github_config.get("spec_git_workflow")
|
|
231
|
+
if workflow in ["per_spec", "feature_branch", "develop_direct"]:
|
|
232
|
+
return workflow
|
|
233
|
+
|
|
234
|
+
# Default: per_spec (ask user)
|
|
235
|
+
return "per_spec"
|
moai_adk/core/git/__init__.py
CHANGED
moai_adk/core/git/branch.py
CHANGED
moai_adk/core/git/commit.py
CHANGED
moai_adk/core/git/manager.py
CHANGED
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"""
|
|
2
|
+
GitHub Issue Creator for MoAI-ADK quick issue reporting.
|
|
3
|
+
|
|
4
|
+
Enables users to quickly create GitHub Issues with standardized templates
|
|
5
|
+
using `/alfred:9-feedback` interactive dialog.
|
|
6
|
+
|
|
7
|
+
@TAG:ISSUE-CREATOR-001 - GitHub issue creation system
|
|
8
|
+
@TAG:QUICK-REPORTING-001 - Quick issue reporting functionality
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import subprocess
|
|
12
|
+
from dataclasses import dataclass
|
|
13
|
+
from enum import Enum
|
|
14
|
+
from typing import Any, Dict, List, Optional
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class IssueType(Enum):
|
|
18
|
+
"""Supported GitHub issue types."""
|
|
19
|
+
BUG = "bug"
|
|
20
|
+
FEATURE = "feature"
|
|
21
|
+
IMPROVEMENT = "improvement"
|
|
22
|
+
QUESTION = "question"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class IssuePriority(Enum):
|
|
26
|
+
"""Issue priority levels."""
|
|
27
|
+
CRITICAL = "critical"
|
|
28
|
+
HIGH = "high"
|
|
29
|
+
MEDIUM = "medium"
|
|
30
|
+
LOW = "low"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@dataclass
|
|
34
|
+
class IssueConfig:
|
|
35
|
+
"""Configuration for issue creation."""
|
|
36
|
+
issue_type: IssueType
|
|
37
|
+
title: str
|
|
38
|
+
description: str
|
|
39
|
+
priority: IssuePriority = IssuePriority.MEDIUM
|
|
40
|
+
category: Optional[str] = None
|
|
41
|
+
assignees: Optional[List[str]] = None
|
|
42
|
+
custom_labels: Optional[List[str]] = None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class GitHubIssueCreator:
|
|
46
|
+
"""
|
|
47
|
+
Creates GitHub Issues using the `gh` CLI.
|
|
48
|
+
|
|
49
|
+
Supports:
|
|
50
|
+
- Multiple issue types (bug, feature, improvement, question)
|
|
51
|
+
- Priority levels and categories
|
|
52
|
+
- Standard templates for each type
|
|
53
|
+
- Label automation
|
|
54
|
+
- Priority emoji indicators
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
# Label mapping for issue types
|
|
58
|
+
LABEL_MAP = {
|
|
59
|
+
IssueType.BUG: ["bug", "reported"],
|
|
60
|
+
IssueType.FEATURE: ["feature-request", "enhancement"],
|
|
61
|
+
IssueType.IMPROVEMENT: ["improvement", "enhancement"],
|
|
62
|
+
IssueType.QUESTION: ["question", "help wanted"], # Fixed: "help-wanted" â "help wanted" (GitHub standard)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
# Priority emoji
|
|
66
|
+
PRIORITY_EMOJI = {
|
|
67
|
+
IssuePriority.CRITICAL: "đ´",
|
|
68
|
+
IssuePriority.HIGH: "đ ",
|
|
69
|
+
IssuePriority.MEDIUM: "đĄ",
|
|
70
|
+
IssuePriority.LOW: "đĸ",
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
# Issue type emoji
|
|
74
|
+
TYPE_EMOJI = {
|
|
75
|
+
IssueType.BUG: "đ",
|
|
76
|
+
IssueType.FEATURE: "â¨",
|
|
77
|
+
IssueType.IMPROVEMENT: "âĄ",
|
|
78
|
+
IssueType.QUESTION: "â",
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
def __init__(self, github_token: Optional[str] = None):
|
|
82
|
+
"""
|
|
83
|
+
Initialize the GitHub Issue Creator.
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
github_token: GitHub API token. If not provided, uses GITHUB_TOKEN env var.
|
|
87
|
+
"""
|
|
88
|
+
self.github_token = github_token
|
|
89
|
+
self._check_gh_cli()
|
|
90
|
+
|
|
91
|
+
def _check_gh_cli(self) -> None:
|
|
92
|
+
"""
|
|
93
|
+
Check if `gh` CLI is installed and accessible.
|
|
94
|
+
|
|
95
|
+
Raises:
|
|
96
|
+
RuntimeError: If `gh` CLI is not found or not authenticated.
|
|
97
|
+
"""
|
|
98
|
+
try:
|
|
99
|
+
result = subprocess.run(
|
|
100
|
+
["gh", "auth", "status"],
|
|
101
|
+
capture_output=True,
|
|
102
|
+
text=True,
|
|
103
|
+
timeout=5
|
|
104
|
+
)
|
|
105
|
+
if result.returncode != 0:
|
|
106
|
+
raise RuntimeError(
|
|
107
|
+
"GitHub CLI (gh) is not authenticated. "
|
|
108
|
+
"Run `gh auth login` to authenticate."
|
|
109
|
+
)
|
|
110
|
+
except FileNotFoundError:
|
|
111
|
+
raise RuntimeError(
|
|
112
|
+
"GitHub CLI (gh) is not installed. "
|
|
113
|
+
"Please install it: https://cli.github.com"
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
def create_issue(self, config: IssueConfig) -> Dict[str, Any]:
|
|
117
|
+
"""
|
|
118
|
+
Create a GitHub issue with the given configuration.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
config: Issue configuration
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
Dictionary containing issue creation result:
|
|
125
|
+
{
|
|
126
|
+
"success": bool,
|
|
127
|
+
"issue_number": int,
|
|
128
|
+
"issue_url": str,
|
|
129
|
+
"message": str
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
Raises:
|
|
133
|
+
RuntimeError: If issue creation fails
|
|
134
|
+
"""
|
|
135
|
+
# Build title with emoji and priority
|
|
136
|
+
emoji = self.TYPE_EMOJI.get(config.issue_type, "đ")
|
|
137
|
+
priority_emoji = self.PRIORITY_EMOJI.get(config.priority, "")
|
|
138
|
+
full_title = f"{emoji} [{config.issue_type.value.upper()}] {config.title}"
|
|
139
|
+
if priority_emoji:
|
|
140
|
+
full_title = f"{priority_emoji} {full_title}"
|
|
141
|
+
|
|
142
|
+
# Build body with template
|
|
143
|
+
body = self._build_body(config)
|
|
144
|
+
|
|
145
|
+
# Collect labels
|
|
146
|
+
labels = self.LABEL_MAP.get(config.issue_type, []).copy()
|
|
147
|
+
if config.priority:
|
|
148
|
+
labels.append(config.priority.value) # Fixed: removed "priority-" prefix (use direct label names)
|
|
149
|
+
if config.category:
|
|
150
|
+
labels.append(f"category-{config.category.lower().replace(' ', '-')}")
|
|
151
|
+
if config.custom_labels:
|
|
152
|
+
labels.extend(config.custom_labels)
|
|
153
|
+
|
|
154
|
+
# Build gh command
|
|
155
|
+
gh_command = [
|
|
156
|
+
"gh", "issue", "create",
|
|
157
|
+
"--title", full_title,
|
|
158
|
+
"--body", body,
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
# Add labels
|
|
162
|
+
if labels:
|
|
163
|
+
gh_command.extend(["--label", ",".join(set(labels))])
|
|
164
|
+
|
|
165
|
+
# Add assignees if provided
|
|
166
|
+
if config.assignees:
|
|
167
|
+
gh_command.extend(["--assignee", ",".join(config.assignees)])
|
|
168
|
+
|
|
169
|
+
try:
|
|
170
|
+
result = subprocess.run(
|
|
171
|
+
gh_command,
|
|
172
|
+
capture_output=True,
|
|
173
|
+
text=True,
|
|
174
|
+
timeout=30
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
if result.returncode != 0:
|
|
178
|
+
error_msg = result.stderr or result.stdout
|
|
179
|
+
raise RuntimeError(f"Failed to create GitHub issue: {error_msg}")
|
|
180
|
+
|
|
181
|
+
# Parse issue URL from output
|
|
182
|
+
issue_url = result.stdout.strip()
|
|
183
|
+
issue_number = self._extract_issue_number(issue_url)
|
|
184
|
+
|
|
185
|
+
return {
|
|
186
|
+
"success": True,
|
|
187
|
+
"issue_number": issue_number,
|
|
188
|
+
"issue_url": issue_url,
|
|
189
|
+
"message": f"â
GitHub Issue #{issue_number} created successfully",
|
|
190
|
+
"title": full_title,
|
|
191
|
+
"labels": labels,
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
except subprocess.TimeoutExpired:
|
|
195
|
+
raise RuntimeError("GitHub issue creation timed out")
|
|
196
|
+
except Exception as e:
|
|
197
|
+
raise RuntimeError(f"Error creating GitHub issue: {e}")
|
|
198
|
+
|
|
199
|
+
def _build_body(self, config: IssueConfig) -> str:
|
|
200
|
+
"""
|
|
201
|
+
Build the issue body based on issue type.
|
|
202
|
+
|
|
203
|
+
Args:
|
|
204
|
+
config: Issue configuration
|
|
205
|
+
|
|
206
|
+
Returns:
|
|
207
|
+
Formatted issue body
|
|
208
|
+
"""
|
|
209
|
+
body = config.description
|
|
210
|
+
|
|
211
|
+
# Add metadata footer
|
|
212
|
+
footer = "\n\n---\n\n"
|
|
213
|
+
footer += f"**Type**: {config.issue_type.value} \n"
|
|
214
|
+
footer += f"**Priority**: {config.priority.value} \n"
|
|
215
|
+
if config.category:
|
|
216
|
+
footer += f"**Category**: {config.category} \n"
|
|
217
|
+
footer += "**Created via**: `/alfred:9-feedback`"
|
|
218
|
+
|
|
219
|
+
return body + footer
|
|
220
|
+
|
|
221
|
+
@staticmethod
|
|
222
|
+
def _extract_issue_number(url: str) -> int:
|
|
223
|
+
"""
|
|
224
|
+
Extract issue number from GitHub URL.
|
|
225
|
+
|
|
226
|
+
Args:
|
|
227
|
+
url: GitHub issue URL
|
|
228
|
+
|
|
229
|
+
Returns:
|
|
230
|
+
Issue number
|
|
231
|
+
|
|
232
|
+
Raises:
|
|
233
|
+
ValueError: If unable to extract issue number
|
|
234
|
+
"""
|
|
235
|
+
try:
|
|
236
|
+
# URL format: https://github.com/owner/repo/issues/123
|
|
237
|
+
return int(url.strip().split("/")[-1])
|
|
238
|
+
except (ValueError, IndexError):
|
|
239
|
+
raise ValueError(f"Unable to extract issue number from URL: {url}")
|
|
240
|
+
|
|
241
|
+
def format_result(self, result: Dict[str, Any]) -> str:
|
|
242
|
+
"""
|
|
243
|
+
Format the issue creation result for display.
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
result: Issue creation result
|
|
247
|
+
|
|
248
|
+
Returns:
|
|
249
|
+
Formatted result string
|
|
250
|
+
"""
|
|
251
|
+
if result["success"]:
|
|
252
|
+
output = f"{result['message']}\n"
|
|
253
|
+
output += f"đ Title: {result['title']}\n"
|
|
254
|
+
output += f"đ URL: {result['issue_url']}\n"
|
|
255
|
+
if result.get("labels"):
|
|
256
|
+
output += f"đˇī¸ Labels: {', '.join(result['labels'])}\n"
|
|
257
|
+
return output
|
|
258
|
+
else:
|
|
259
|
+
return f"â Failed to create issue: {result.get('message', 'Unknown error')}"
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
class IssueCreatorFactory:
|
|
263
|
+
"""
|
|
264
|
+
Factory for creating issue creators with predefined configurations.
|
|
265
|
+
"""
|
|
266
|
+
|
|
267
|
+
@staticmethod
|
|
268
|
+
def create_bug_issue(title: str, description: str, priority: IssuePriority = IssuePriority.HIGH) -> IssueConfig:
|
|
269
|
+
"""Create a bug report issue configuration."""
|
|
270
|
+
return IssueConfig(
|
|
271
|
+
issue_type=IssueType.BUG,
|
|
272
|
+
title=title,
|
|
273
|
+
description=description,
|
|
274
|
+
priority=priority,
|
|
275
|
+
category="Bug Report",
|
|
276
|
+
)
|
|
277
|
+
|
|
278
|
+
@staticmethod
|
|
279
|
+
def create_feature_issue(
|
|
280
|
+
title: str, description: str, priority: IssuePriority = IssuePriority.MEDIUM
|
|
281
|
+
) -> IssueConfig:
|
|
282
|
+
"""Create a feature request issue configuration."""
|
|
283
|
+
return IssueConfig(
|
|
284
|
+
issue_type=IssueType.FEATURE,
|
|
285
|
+
title=title,
|
|
286
|
+
description=description,
|
|
287
|
+
priority=priority,
|
|
288
|
+
category="Feature Request",
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
@staticmethod
|
|
292
|
+
def create_improvement_issue(
|
|
293
|
+
title: str, description: str, priority: IssuePriority = IssuePriority.MEDIUM
|
|
294
|
+
) -> IssueConfig:
|
|
295
|
+
"""Create an improvement issue configuration."""
|
|
296
|
+
return IssueConfig(
|
|
297
|
+
issue_type=IssueType.IMPROVEMENT,
|
|
298
|
+
title=title,
|
|
299
|
+
description=description,
|
|
300
|
+
priority=priority,
|
|
301
|
+
category="Improvement",
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
@staticmethod
|
|
305
|
+
def create_question_issue(title: str, description: str, priority: IssuePriority = IssuePriority.LOW) -> IssueConfig:
|
|
306
|
+
"""Create a question/discussion issue configuration."""
|
|
307
|
+
return IssueConfig(
|
|
308
|
+
issue_type=IssueType.QUESTION,
|
|
309
|
+
title=title,
|
|
310
|
+
description=description,
|
|
311
|
+
priority=priority,
|
|
312
|
+
category="Question",
|
|
313
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# MCP Setup - Simplified version for automatic template copying
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from rich.console import Console
|
|
7
|
+
|
|
8
|
+
console = Console()
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class MCPSetupManager:
|
|
12
|
+
"""Simplified MCP Setup Manager - copies template configuration"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, project_path: Path):
|
|
15
|
+
self.project_path = project_path
|
|
16
|
+
|
|
17
|
+
def copy_template_mcp_config(self) -> bool:
|
|
18
|
+
"""Copy MCP configuration from package template"""
|
|
19
|
+
try:
|
|
20
|
+
# Get the package template path
|
|
21
|
+
import moai_adk
|
|
22
|
+
package_path = Path(moai_adk.__file__).parent
|
|
23
|
+
template_mcp_path = package_path / "templates" / ".mcp.json"
|
|
24
|
+
|
|
25
|
+
if template_mcp_path.exists():
|
|
26
|
+
# Copy template to project
|
|
27
|
+
project_mcp_path = self.project_path / ".mcp.json"
|
|
28
|
+
|
|
29
|
+
# Read template
|
|
30
|
+
with open(template_mcp_path, 'r') as f:
|
|
31
|
+
mcp_config = json.load(f)
|
|
32
|
+
|
|
33
|
+
# Write to project
|
|
34
|
+
with open(project_mcp_path, 'w') as f:
|
|
35
|
+
json.dump(mcp_config, f, indent=2)
|
|
36
|
+
|
|
37
|
+
server_names = list(mcp_config.get('mcpServers', {}).keys())
|
|
38
|
+
console.print("â
MCP configuration copied from template")
|
|
39
|
+
console.print(f"đ Configured servers: {', '.join(server_names)}")
|
|
40
|
+
return True
|
|
41
|
+
else:
|
|
42
|
+
console.print("â Template MCP configuration not found")
|
|
43
|
+
return False
|
|
44
|
+
|
|
45
|
+
except Exception as e:
|
|
46
|
+
console.print(f"â Failed to copy MCP configuration: {e}")
|
|
47
|
+
return False
|
|
48
|
+
|
|
49
|
+
def setup_mcp_servers(self, selected_servers: list[str]) -> bool:
|
|
50
|
+
"""Complete MCP server setup process - simplified template copy"""
|
|
51
|
+
if not selected_servers:
|
|
52
|
+
console.print("âšī¸ No MCP servers selected")
|
|
53
|
+
return True
|
|
54
|
+
|
|
55
|
+
console.print("đ§ Setting up MCP servers...")
|
|
56
|
+
return self.copy_template_mcp_config()
|