claude-mpm 4.15.6__py3-none-any.whl → 4.21.3__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 claude-mpm might be problematic. Click here for more details.
- claude_mpm/VERSION +1 -1
- claude_mpm/agents/BASE_ENGINEER.md +286 -0
- claude_mpm/agents/BASE_PM.md +272 -23
- claude_mpm/agents/PM_INSTRUCTIONS.md +49 -0
- claude_mpm/agents/agent_loader.py +4 -4
- claude_mpm/agents/templates/engineer.json +5 -1
- claude_mpm/agents/templates/php-engineer.json +10 -4
- claude_mpm/agents/templates/python_engineer.json +8 -3
- claude_mpm/agents/templates/rust_engineer.json +12 -7
- claude_mpm/agents/templates/svelte-engineer.json +225 -0
- claude_mpm/cli/commands/__init__.py +2 -0
- claude_mpm/cli/commands/mpm_init/__init__.py +73 -0
- claude_mpm/cli/commands/mpm_init/core.py +525 -0
- claude_mpm/cli/commands/mpm_init/display.py +341 -0
- claude_mpm/cli/commands/mpm_init/git_activity.py +427 -0
- claude_mpm/cli/commands/mpm_init/modes.py +397 -0
- claude_mpm/cli/commands/mpm_init/prompts.py +442 -0
- claude_mpm/cli/commands/mpm_init_cli.py +396 -0
- claude_mpm/cli/commands/mpm_init_handler.py +67 -1
- claude_mpm/cli/commands/skills.py +488 -0
- claude_mpm/cli/executor.py +2 -0
- claude_mpm/cli/parsers/base_parser.py +7 -0
- claude_mpm/cli/parsers/mpm_init_parser.py +42 -0
- claude_mpm/cli/parsers/skills_parser.py +137 -0
- claude_mpm/cli/startup.py +57 -0
- claude_mpm/commands/mpm-auto-configure.md +52 -0
- claude_mpm/commands/mpm-help.md +6 -0
- claude_mpm/commands/mpm-init.md +112 -6
- claude_mpm/commands/mpm-resume.md +372 -0
- claude_mpm/commands/mpm-version.md +113 -0
- claude_mpm/commands/mpm.md +2 -0
- claude_mpm/config/agent_config.py +2 -2
- claude_mpm/constants.py +12 -0
- claude_mpm/core/config.py +42 -0
- claude_mpm/core/factories.py +1 -1
- claude_mpm/core/interfaces.py +56 -1
- claude_mpm/core/optimized_agent_loader.py +3 -3
- claude_mpm/hooks/__init__.py +8 -0
- claude_mpm/hooks/claude_hooks/response_tracking.py +35 -1
- claude_mpm/hooks/session_resume_hook.py +121 -0
- claude_mpm/models/resume_log.py +340 -0
- claude_mpm/services/agents/auto_config_manager.py +1 -1
- claude_mpm/services/agents/deployment/agent_configuration_manager.py +1 -1
- claude_mpm/services/agents/deployment/agent_record_service.py +1 -1
- claude_mpm/services/agents/deployment/agent_validator.py +17 -1
- claude_mpm/services/agents/deployment/async_agent_deployment.py +1 -1
- claude_mpm/services/agents/deployment/local_template_deployment.py +1 -1
- claude_mpm/services/agents/local_template_manager.py +1 -1
- claude_mpm/services/agents/recommender.py +47 -0
- claude_mpm/services/cli/resume_service.py +617 -0
- claude_mpm/services/cli/session_manager.py +87 -0
- claude_mpm/services/cli/session_pause_manager.py +504 -0
- claude_mpm/services/cli/session_resume_helper.py +372 -0
- claude_mpm/services/core/base.py +26 -11
- claude_mpm/services/core/interfaces.py +56 -1
- claude_mpm/services/core/models/agent_config.py +3 -0
- claude_mpm/services/core/models/process.py +4 -0
- claude_mpm/services/core/path_resolver.py +1 -1
- claude_mpm/services/diagnostics/models.py +21 -0
- claude_mpm/services/event_bus/relay.py +23 -7
- claude_mpm/services/infrastructure/resume_log_generator.py +439 -0
- claude_mpm/services/local_ops/__init__.py +2 -0
- claude_mpm/services/mcp_config_manager.py +7 -131
- claude_mpm/services/mcp_gateway/auto_configure.py +31 -25
- claude_mpm/services/mcp_gateway/core/process_pool.py +19 -10
- claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +26 -21
- claude_mpm/services/memory/failure_tracker.py +19 -4
- claude_mpm/services/session_manager.py +205 -1
- claude_mpm/services/unified/deployment_strategies/local.py +1 -1
- claude_mpm/services/version_service.py +104 -1
- claude_mpm/skills/__init__.py +21 -0
- claude_mpm/skills/agent_skills_injector.py +324 -0
- claude_mpm/skills/bundled/LICENSE_ATTRIBUTIONS.md +79 -0
- claude_mpm/skills/bundled/api-documentation.md +393 -0
- claude_mpm/skills/bundled/async-testing.md +571 -0
- claude_mpm/skills/bundled/code-review.md +143 -0
- claude_mpm/skills/bundled/collaboration/brainstorming/SKILL.md +79 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/SKILL.md +178 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/agent-prompts.md +577 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/coordination-patterns.md +467 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/examples.md +537 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/troubleshooting.md +730 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/SKILL.md +112 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/references/code-reviewer-template.md +146 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/references/review-examples.md +412 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/SKILL.md +81 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/references/best-practices.md +362 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/references/plan-structure-templates.md +312 -0
- claude_mpm/skills/bundled/database-migration.md +199 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/SKILL.md +152 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/advanced-techniques.md +668 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/examples.md +587 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/integration.md +438 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/tracing-techniques.md +391 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/CREATION-LOG.md +119 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/SKILL.md +148 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/anti-patterns.md +483 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/examples.md +452 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/troubleshooting.md +449 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/workflow.md +411 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-academic.md +14 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-1.md +58 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-2.md +68 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-3.md +69 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/SKILL.md +131 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/gate-function.md +325 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/integration-and-workflows.md +490 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/red-flags-and-failures.md +425 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/verification-patterns.md +499 -0
- claude_mpm/skills/bundled/docker-containerization.md +194 -0
- claude_mpm/skills/bundled/express-local-dev.md +1429 -0
- claude_mpm/skills/bundled/fastapi-local-dev.md +1199 -0
- claude_mpm/skills/bundled/git-workflow.md +414 -0
- claude_mpm/skills/bundled/imagemagick.md +204 -0
- claude_mpm/skills/bundled/json-data-handling.md +223 -0
- claude_mpm/skills/bundled/main/artifacts-builder/SKILL.md +86 -0
- claude_mpm/skills/bundled/main/internal-comms/SKILL.md +43 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/3p-updates.md +47 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/company-newsletter.md +65 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/faq-answers.md +30 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/general-comms.md +16 -0
- claude_mpm/skills/bundled/main/mcp-builder/SKILL.md +160 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/design_principles.md +412 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/evaluation.md +602 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/mcp_best_practices.md +915 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/node_mcp_server.md +916 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/python_mcp_server.md +752 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/workflow.md +1237 -0
- claude_mpm/skills/bundled/main/mcp-builder/scripts/connections.py +157 -0
- claude_mpm/skills/bundled/main/mcp-builder/scripts/evaluation.py +425 -0
- claude_mpm/skills/bundled/main/skill-creator/SKILL.md +189 -0
- claude_mpm/skills/bundled/main/skill-creator/references/best-practices.md +500 -0
- claude_mpm/skills/bundled/main/skill-creator/references/creation-workflow.md +464 -0
- claude_mpm/skills/bundled/main/skill-creator/references/examples.md +619 -0
- claude_mpm/skills/bundled/main/skill-creator/references/progressive-disclosure.md +437 -0
- claude_mpm/skills/bundled/main/skill-creator/references/skill-structure.md +231 -0
- claude_mpm/skills/bundled/main/skill-creator/scripts/init_skill.py +303 -0
- claude_mpm/skills/bundled/main/skill-creator/scripts/package_skill.py +113 -0
- claude_mpm/skills/bundled/main/skill-creator/scripts/quick_validate.py +72 -0
- claude_mpm/skills/bundled/nextjs-local-dev.md +807 -0
- claude_mpm/skills/bundled/pdf.md +141 -0
- claude_mpm/skills/bundled/performance-profiling.md +567 -0
- claude_mpm/skills/bundled/php/espocrm-development/SKILL.md +170 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/architecture.md +602 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/common-tasks.md +821 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/development-workflow.md +742 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/frontend-customization.md +726 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/hooks-and-services.md +764 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/testing-debugging.md +831 -0
- claude_mpm/skills/bundled/refactoring-patterns.md +180 -0
- claude_mpm/skills/bundled/rust/desktop-applications/SKILL.md +226 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/architecture-patterns.md +901 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/native-gui-frameworks.md +901 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/platform-integration.md +775 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/state-management.md +937 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/tauri-framework.md +770 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/testing-deployment.md +961 -0
- claude_mpm/skills/bundled/security-scanning.md +327 -0
- claude_mpm/skills/bundled/systematic-debugging.md +473 -0
- claude_mpm/skills/bundled/test-driven-development.md +378 -0
- claude_mpm/skills/bundled/testing/condition-based-waiting/SKILL.md +119 -0
- claude_mpm/skills/bundled/testing/condition-based-waiting/references/patterns-and-implementation.md +253 -0
- claude_mpm/skills/bundled/testing/test-driven-development/SKILL.md +145 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/anti-patterns.md +543 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/examples.md +741 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/integration.md +470 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/philosophy.md +458 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/workflow.md +639 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/SKILL.md +140 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/completeness-anti-patterns.md +572 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/core-anti-patterns.md +411 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/detection-guide.md +569 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/tdd-connection.md +695 -0
- claude_mpm/skills/bundled/testing/webapp-testing/SKILL.md +184 -0
- claude_mpm/skills/bundled/testing/webapp-testing/decision-tree.md +459 -0
- claude_mpm/skills/bundled/testing/webapp-testing/examples/console_logging.py +35 -0
- claude_mpm/skills/bundled/testing/webapp-testing/examples/element_discovery.py +44 -0
- claude_mpm/skills/bundled/testing/webapp-testing/examples/static_html_automation.py +34 -0
- claude_mpm/skills/bundled/testing/webapp-testing/playwright-patterns.md +479 -0
- claude_mpm/skills/bundled/testing/webapp-testing/reconnaissance-pattern.md +687 -0
- claude_mpm/skills/bundled/testing/webapp-testing/scripts/with_server.py +129 -0
- claude_mpm/skills/bundled/testing/webapp-testing/server-management.md +758 -0
- claude_mpm/skills/bundled/testing/webapp-testing/troubleshooting.md +868 -0
- claude_mpm/skills/bundled/vite-local-dev.md +1061 -0
- claude_mpm/skills/bundled/web-performance-optimization.md +2305 -0
- claude_mpm/skills/bundled/xlsx.md +157 -0
- claude_mpm/skills/registry.py +97 -9
- claude_mpm/skills/skills_registry.py +348 -0
- claude_mpm/skills/skills_service.py +739 -0
- claude_mpm/tools/code_tree_analyzer/__init__.py +45 -0
- claude_mpm/tools/code_tree_analyzer/analysis.py +299 -0
- claude_mpm/tools/code_tree_analyzer/cache.py +131 -0
- claude_mpm/tools/code_tree_analyzer/core.py +380 -0
- claude_mpm/tools/code_tree_analyzer/discovery.py +403 -0
- claude_mpm/tools/code_tree_analyzer/events.py +168 -0
- claude_mpm/tools/code_tree_analyzer/gitignore.py +308 -0
- claude_mpm/tools/code_tree_analyzer/models.py +39 -0
- claude_mpm/tools/code_tree_analyzer/multilang_analyzer.py +224 -0
- claude_mpm/tools/code_tree_analyzer/python_analyzer.py +284 -0
- claude_mpm/utils/agent_dependency_loader.py +2 -2
- {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/METADATA +211 -33
- {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/RECORD +206 -64
- claude_mpm/agents/INSTRUCTIONS_OLD_DEPRECATED.md +0 -602
- claude_mpm/cli/commands/mpm_init.py +0 -2008
- claude_mpm/tools/code_tree_analyzer.py +0 -1825
- {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/WHEEL +0 -0
- {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
"""Operation mode handlers (review, dry-run, quick-update).
|
|
2
|
+
|
|
3
|
+
This module provides handlers for different execution modes:
|
|
4
|
+
- Review mode: Display proposed changes without execution
|
|
5
|
+
- Dry-run mode: Simulate execution without making changes
|
|
6
|
+
- Quick-update mode: Fast incremental updates
|
|
7
|
+
- Prompt update action: Interactive prompt for update decisions
|
|
8
|
+
- Handle update post-processing: Post-update summary and archiving
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from typing import Any, Dict, Optional
|
|
13
|
+
|
|
14
|
+
from rich.console import Console
|
|
15
|
+
from rich.progress import Progress, SpinnerColumn, TextColumn
|
|
16
|
+
from rich.prompt import Prompt
|
|
17
|
+
|
|
18
|
+
from claude_mpm.core.enums import OperationResult
|
|
19
|
+
from claude_mpm.services.project.archive_manager import ArchiveManager
|
|
20
|
+
from claude_mpm.services.project.documentation_manager import DocumentationManager
|
|
21
|
+
from claude_mpm.services.project.enhanced_analyzer import EnhancedProjectAnalyzer
|
|
22
|
+
from claude_mpm.services.project.project_organizer import ProjectOrganizer
|
|
23
|
+
from claude_mpm.utils.display_helper import DisplayHelper
|
|
24
|
+
|
|
25
|
+
# Import display and git_activity functions from sibling modules
|
|
26
|
+
from . import display, git_activity
|
|
27
|
+
|
|
28
|
+
__all__ = [
|
|
29
|
+
"handle_update_post_processing",
|
|
30
|
+
"prompt_update_action",
|
|
31
|
+
"run_dry_run_mode",
|
|
32
|
+
"run_quick_update_mode",
|
|
33
|
+
"run_review_mode",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def prompt_update_action(console: Console) -> str:
|
|
38
|
+
"""
|
|
39
|
+
Prompt user for update action when CLAUDE.md already exists.
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
console: Rich Console instance for displaying prompts
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
Action string: "update", "recreate", "review", or "cancel"
|
|
46
|
+
"""
|
|
47
|
+
console.print("\n[bold]How would you like to proceed?[/bold]\n")
|
|
48
|
+
|
|
49
|
+
choices = {
|
|
50
|
+
"1": ("update", "Update existing CLAUDE.md (preserves custom content)"),
|
|
51
|
+
"2": ("recreate", "Recreate CLAUDE.md from scratch"),
|
|
52
|
+
"3": ("review", "Review project state without changes"),
|
|
53
|
+
"4": ("cancel", "Cancel operation"),
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
for key, (_, desc) in choices.items():
|
|
57
|
+
console.print(f" [{key}] {desc}")
|
|
58
|
+
|
|
59
|
+
choice = Prompt.ask("\nSelect option", choices=list(choices.keys()), default="1")
|
|
60
|
+
return choices[choice][0]
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def run_review_mode(
|
|
64
|
+
console: Console,
|
|
65
|
+
display_helper: DisplayHelper,
|
|
66
|
+
organizer: ProjectOrganizer,
|
|
67
|
+
doc_manager: DocumentationManager,
|
|
68
|
+
analyzer: EnhancedProjectAnalyzer,
|
|
69
|
+
) -> Dict[str, Any]:
|
|
70
|
+
"""
|
|
71
|
+
Run review mode to analyze project without changes.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
console: Rich Console instance for output
|
|
75
|
+
display_helper: DisplayHelper for formatted displays
|
|
76
|
+
organizer: ProjectOrganizer service instance
|
|
77
|
+
doc_manager: DocumentationManager service instance
|
|
78
|
+
analyzer: EnhancedProjectAnalyzer service instance
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
Dict containing review results with status, mode, and analysis data
|
|
82
|
+
"""
|
|
83
|
+
console.print("\n[bold cyan]🔍 Project Review Mode[/bold cyan]\n")
|
|
84
|
+
|
|
85
|
+
with Progress(
|
|
86
|
+
SpinnerColumn(),
|
|
87
|
+
TextColumn("[progress.description]{task.description}"),
|
|
88
|
+
console=console,
|
|
89
|
+
) as progress:
|
|
90
|
+
# Analyze project structure
|
|
91
|
+
task = progress.add_task("[cyan]Analyzing project structure...", total=None)
|
|
92
|
+
structure_report = organizer.verify_structure()
|
|
93
|
+
progress.update(task, description="[green]✓ Structure analysis complete")
|
|
94
|
+
|
|
95
|
+
# Analyze documentation
|
|
96
|
+
task = progress.add_task("[cyan]Analyzing documentation...", total=None)
|
|
97
|
+
doc_analysis = doc_manager.analyze_existing_content()
|
|
98
|
+
progress.update(task, description="[green]✓ Documentation analysis complete")
|
|
99
|
+
|
|
100
|
+
# Analyze git history
|
|
101
|
+
if analyzer.is_git_repo:
|
|
102
|
+
task = progress.add_task("[cyan]Analyzing git history...", total=None)
|
|
103
|
+
git_analysis = analyzer.analyze_git_history()
|
|
104
|
+
progress.update(task, description="[green]✓ Git analysis complete")
|
|
105
|
+
else:
|
|
106
|
+
git_analysis = None
|
|
107
|
+
|
|
108
|
+
# Detect project state
|
|
109
|
+
task = progress.add_task("[cyan]Detecting project state...", total=None)
|
|
110
|
+
project_state = analyzer.detect_project_state()
|
|
111
|
+
progress.update(task, description="[green]✓ State detection complete")
|
|
112
|
+
|
|
113
|
+
# Display comprehensive report
|
|
114
|
+
display.display_review_report(
|
|
115
|
+
display_helper,
|
|
116
|
+
console,
|
|
117
|
+
structure_report,
|
|
118
|
+
doc_analysis,
|
|
119
|
+
git_analysis,
|
|
120
|
+
project_state,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
"status": OperationResult.SUCCESS,
|
|
125
|
+
"mode": "review",
|
|
126
|
+
"structure_report": structure_report,
|
|
127
|
+
"documentation_analysis": doc_analysis,
|
|
128
|
+
"git_analysis": git_analysis,
|
|
129
|
+
"project_state": project_state,
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def run_quick_update_mode(
|
|
134
|
+
console: Console,
|
|
135
|
+
display_helper: DisplayHelper,
|
|
136
|
+
project_path: Path,
|
|
137
|
+
analyzer: EnhancedProjectAnalyzer,
|
|
138
|
+
doc_manager: DocumentationManager,
|
|
139
|
+
archive_manager: ArchiveManager,
|
|
140
|
+
days: int = 30,
|
|
141
|
+
non_interactive: bool = False,
|
|
142
|
+
export: Optional[str] = None,
|
|
143
|
+
) -> Dict[str, Any]:
|
|
144
|
+
"""
|
|
145
|
+
Run quick update mode - lightweight update based on recent git activity.
|
|
146
|
+
|
|
147
|
+
Args:
|
|
148
|
+
console: Rich Console instance for output
|
|
149
|
+
display_helper: DisplayHelper for formatted displays
|
|
150
|
+
project_path: Path to the project directory
|
|
151
|
+
analyzer: EnhancedProjectAnalyzer service instance
|
|
152
|
+
doc_manager: DocumentationManager service instance
|
|
153
|
+
archive_manager: ArchiveManager service instance
|
|
154
|
+
days: Number of days of git history to analyze
|
|
155
|
+
non_interactive: If True, display report only without prompting
|
|
156
|
+
export: Path to export report (or "auto" for default location)
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
Dict containing quick update results with status, mode, and activity report
|
|
160
|
+
"""
|
|
161
|
+
console.print("\n[bold cyan]⚡ Quick Update Mode[/bold cyan]\n")
|
|
162
|
+
console.print(
|
|
163
|
+
f"[dim]Analyzing recent git activity ({days} days) for lightweight documentation update...[/dim]\n"
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
if not analyzer.is_git_repo:
|
|
167
|
+
console.print(
|
|
168
|
+
"[yellow]⚠️ Not a git repository. Quick update requires git.[/yellow]"
|
|
169
|
+
)
|
|
170
|
+
console.print(
|
|
171
|
+
"[dim]Tip: Use `/mpm-init --review` for non-git projects.[/dim]\n"
|
|
172
|
+
)
|
|
173
|
+
return {
|
|
174
|
+
"status": OperationResult.ERROR,
|
|
175
|
+
"message": "Quick update requires a git repository",
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
claude_md = project_path / "CLAUDE.md"
|
|
179
|
+
if not claude_md.exists():
|
|
180
|
+
console.print(
|
|
181
|
+
"[yellow]⚠️ CLAUDE.md not found. Quick update requires existing documentation.[/yellow]"
|
|
182
|
+
)
|
|
183
|
+
console.print(
|
|
184
|
+
"[dim]Tip: Use `/mpm-init` to create initial documentation.[/dim]\n"
|
|
185
|
+
)
|
|
186
|
+
return {
|
|
187
|
+
"status": OperationResult.ERROR,
|
|
188
|
+
"message": "Quick update requires existing CLAUDE.md",
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
with Progress(
|
|
192
|
+
SpinnerColumn(),
|
|
193
|
+
TextColumn("[progress.description]{task.description}"),
|
|
194
|
+
console=console,
|
|
195
|
+
) as progress:
|
|
196
|
+
# Analyze git history
|
|
197
|
+
task = progress.add_task(
|
|
198
|
+
f"[cyan]Analyzing git history ({days} days)...", total=None
|
|
199
|
+
)
|
|
200
|
+
git_analysis = analyzer.analyze_git_history(days_back=days)
|
|
201
|
+
progress.update(task, description="[green]✓ Git analysis complete")
|
|
202
|
+
|
|
203
|
+
# Analyze current documentation
|
|
204
|
+
task = progress.add_task("[cyan]Checking documentation status...", total=None)
|
|
205
|
+
doc_analysis = doc_manager.analyze_existing_content()
|
|
206
|
+
progress.update(task, description="[green]✓ Documentation analyzed")
|
|
207
|
+
|
|
208
|
+
# Generate activity report
|
|
209
|
+
activity_report = git_activity.generate_activity_report(
|
|
210
|
+
git_analysis, doc_analysis, days
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
# Display the report
|
|
214
|
+
display.display_activity_report(display_helper, activity_report)
|
|
215
|
+
|
|
216
|
+
# Export report if requested
|
|
217
|
+
if export:
|
|
218
|
+
export_path = git_activity.export_activity_report(
|
|
219
|
+
project_path, activity_report, export
|
|
220
|
+
)
|
|
221
|
+
console.print(f"\n[green]✅ Report exported to: {export_path}[/green]")
|
|
222
|
+
|
|
223
|
+
# Handle non-interactive mode
|
|
224
|
+
if non_interactive:
|
|
225
|
+
console.print(
|
|
226
|
+
"\n[cyan]ℹ️ Non-interactive mode: Report displayed, no changes made.[/cyan]"
|
|
227
|
+
)
|
|
228
|
+
return {
|
|
229
|
+
"status": OperationResult.SUCCESS,
|
|
230
|
+
"mode": "quick_update",
|
|
231
|
+
"activity_report": activity_report,
|
|
232
|
+
"changes_made": False,
|
|
233
|
+
"non_interactive": True,
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
# Offer to append activity notes to CLAUDE.md
|
|
237
|
+
console.print("\n[bold]Update Options:[/bold]")
|
|
238
|
+
console.print(" [1] Append activity summary to CLAUDE.md")
|
|
239
|
+
console.print(" [2] Display report only (no changes)")
|
|
240
|
+
console.print(" [3] Cancel")
|
|
241
|
+
|
|
242
|
+
choice = Prompt.ask("\nSelect option", choices=["1", "2", "3"], default="2")
|
|
243
|
+
|
|
244
|
+
if choice == "1":
|
|
245
|
+
# Append activity notes
|
|
246
|
+
git_activity.append_activity_notes(claude_md, activity_report)
|
|
247
|
+
console.print("\n[green]✅ Activity notes appended to CLAUDE.md[/green]")
|
|
248
|
+
|
|
249
|
+
# Archive the update
|
|
250
|
+
archive_manager.auto_archive_before_update(
|
|
251
|
+
claude_md, update_reason="Quick update - recent activity summary"
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
return {
|
|
255
|
+
"status": OperationResult.SUCCESS,
|
|
256
|
+
"mode": "quick_update",
|
|
257
|
+
"activity_report": activity_report,
|
|
258
|
+
"changes_made": True,
|
|
259
|
+
}
|
|
260
|
+
if choice == "2":
|
|
261
|
+
console.print("\n[cyan]Report generated - no changes made[/cyan]")
|
|
262
|
+
return {
|
|
263
|
+
"status": OperationResult.SUCCESS,
|
|
264
|
+
"mode": "quick_update",
|
|
265
|
+
"activity_report": activity_report,
|
|
266
|
+
"changes_made": False,
|
|
267
|
+
}
|
|
268
|
+
console.print("\n[yellow]Quick update cancelled[/yellow]")
|
|
269
|
+
return {
|
|
270
|
+
"status": OperationResult.CANCELLED,
|
|
271
|
+
"message": "Quick update cancelled",
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
def run_dry_run_mode(
|
|
276
|
+
console: Console,
|
|
277
|
+
organizer: ProjectOrganizer,
|
|
278
|
+
doc_manager: DocumentationManager,
|
|
279
|
+
organize_files: bool,
|
|
280
|
+
has_existing: bool,
|
|
281
|
+
) -> Dict[str, Any]:
|
|
282
|
+
"""
|
|
283
|
+
Run dry-run mode to show what would be done without making changes.
|
|
284
|
+
|
|
285
|
+
Args:
|
|
286
|
+
console: Rich Console instance for output
|
|
287
|
+
organizer: ProjectOrganizer service instance
|
|
288
|
+
doc_manager: DocumentationManager service instance
|
|
289
|
+
organize_files: Whether file organization would be performed
|
|
290
|
+
has_existing: Whether CLAUDE.md already exists
|
|
291
|
+
|
|
292
|
+
Returns:
|
|
293
|
+
Dict containing dry-run results with status, mode, and planned actions
|
|
294
|
+
"""
|
|
295
|
+
console.print("\n[bold cyan]🔍 Dry Run Mode - Preview Changes[/bold cyan]\n")
|
|
296
|
+
|
|
297
|
+
actions_planned = []
|
|
298
|
+
|
|
299
|
+
# Check what organization would do
|
|
300
|
+
if organize_files:
|
|
301
|
+
console.print("[bold]📁 File Organization Analysis:[/bold]")
|
|
302
|
+
|
|
303
|
+
# Get structure validation without making changes
|
|
304
|
+
validation = organizer.validate_structure()
|
|
305
|
+
if validation.get("issues"):
|
|
306
|
+
console.print(" [yellow]Files that would be organized:[/yellow]")
|
|
307
|
+
for issue in validation["issues"][:10]:
|
|
308
|
+
actions_planned.append(
|
|
309
|
+
f"Organize: {issue.get('description', 'Unknown')}"
|
|
310
|
+
)
|
|
311
|
+
console.print(f" • {issue.get('description', 'Unknown')}")
|
|
312
|
+
else:
|
|
313
|
+
console.print(" ✅ Project structure is already well-organized")
|
|
314
|
+
|
|
315
|
+
# Check what documentation updates would occur
|
|
316
|
+
if has_existing:
|
|
317
|
+
console.print("\n[bold]📚 Documentation Updates:[/bold]")
|
|
318
|
+
doc_analysis = doc_manager.analyze_existing_content()
|
|
319
|
+
|
|
320
|
+
if not doc_analysis.get("has_priority_markers"):
|
|
321
|
+
actions_planned.append("Add priority markers (🔴🟡🟢⚪)")
|
|
322
|
+
console.print(" • Add priority markers (🔴🟡🟢⚪)")
|
|
323
|
+
|
|
324
|
+
if doc_analysis.get("outdated_patterns"):
|
|
325
|
+
actions_planned.append("Update outdated patterns")
|
|
326
|
+
console.print(" • Update outdated patterns")
|
|
327
|
+
|
|
328
|
+
if not doc_analysis.get("has_priority_index"):
|
|
329
|
+
actions_planned.append("Add priority index section")
|
|
330
|
+
console.print(" • Add priority index section")
|
|
331
|
+
|
|
332
|
+
# Archive would be created
|
|
333
|
+
actions_planned.append("Archive current CLAUDE.md to docs/_archive/")
|
|
334
|
+
console.print(" • Archive current CLAUDE.md to docs/_archive/")
|
|
335
|
+
else:
|
|
336
|
+
console.print("\n[bold]📚 Documentation Creation:[/bold]")
|
|
337
|
+
actions_planned.append("Create new CLAUDE.md with priority structure")
|
|
338
|
+
console.print(" • Create new CLAUDE.md with priority structure")
|
|
339
|
+
|
|
340
|
+
# General improvements
|
|
341
|
+
console.print("\n[bold]🔧 General Improvements:[/bold]")
|
|
342
|
+
actions_planned.extend(
|
|
343
|
+
[
|
|
344
|
+
"Update/create .gitignore if needed",
|
|
345
|
+
"Verify project structure compliance",
|
|
346
|
+
"Add memory system initialization",
|
|
347
|
+
"Set up single-path workflows",
|
|
348
|
+
]
|
|
349
|
+
)
|
|
350
|
+
for action in actions_planned[-4:]:
|
|
351
|
+
console.print(f" • {action}")
|
|
352
|
+
|
|
353
|
+
console.print(
|
|
354
|
+
f"\n[bold cyan]Summary: {len(actions_planned)} actions would be performed[/bold cyan]"
|
|
355
|
+
)
|
|
356
|
+
console.print("\n[dim]Run without --dry-run to execute these changes.[/dim]\n")
|
|
357
|
+
|
|
358
|
+
return {
|
|
359
|
+
"status": OperationResult.SUCCESS,
|
|
360
|
+
"mode": "dry_run",
|
|
361
|
+
"actions_planned": actions_planned,
|
|
362
|
+
"message": "Dry run completed - no changes made",
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
def handle_update_post_processing(
|
|
367
|
+
console: Console,
|
|
368
|
+
project_path: Path,
|
|
369
|
+
doc_manager: DocumentationManager,
|
|
370
|
+
archive_manager: ArchiveManager,
|
|
371
|
+
) -> None:
|
|
372
|
+
"""
|
|
373
|
+
Handle post-processing after successful update.
|
|
374
|
+
|
|
375
|
+
Generates and displays update summary comparing with archived version.
|
|
376
|
+
|
|
377
|
+
Args:
|
|
378
|
+
console: Rich Console instance for output
|
|
379
|
+
project_path: Path to the project directory
|
|
380
|
+
doc_manager: DocumentationManager service instance
|
|
381
|
+
archive_manager: ArchiveManager service instance
|
|
382
|
+
"""
|
|
383
|
+
# Generate update report
|
|
384
|
+
if doc_manager.has_existing_documentation():
|
|
385
|
+
latest_archive = archive_manager.get_latest_archive("CLAUDE.md")
|
|
386
|
+
if latest_archive:
|
|
387
|
+
comparison = archive_manager.compare_with_archive(
|
|
388
|
+
project_path / "CLAUDE.md", latest_archive.name
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
if not comparison.get("identical"):
|
|
392
|
+
console.print("\n[bold cyan]📊 Update Summary[/bold cyan]")
|
|
393
|
+
console.print(f" Lines changed: {comparison.get('lines_added', 0):+d}")
|
|
394
|
+
console.print(
|
|
395
|
+
f" Size change: {comparison.get('size_change', 0):+,} characters"
|
|
396
|
+
)
|
|
397
|
+
console.print(f" Previous version: {latest_archive.name}")
|