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,488 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Skills command implementation for claude-mpm.
|
|
3
|
+
|
|
4
|
+
WHY: This module provides CLI commands for managing Claude Code skills,
|
|
5
|
+
exposing SkillsService functionality for skill discovery, deployment, validation,
|
|
6
|
+
updates, and configuration.
|
|
7
|
+
|
|
8
|
+
DESIGN DECISIONS:
|
|
9
|
+
- Use BaseCommand pattern for consistency with other CLI commands
|
|
10
|
+
- Rich output formatting for user-friendly display
|
|
11
|
+
- Graceful error handling with informative messages
|
|
12
|
+
- Support for verbose output and structured formats
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
import subprocess
|
|
17
|
+
from typing import Optional
|
|
18
|
+
|
|
19
|
+
from rich.console import Console
|
|
20
|
+
from rich.markdown import Markdown
|
|
21
|
+
from rich.panel import Panel
|
|
22
|
+
|
|
23
|
+
from ...constants import SkillsCommands
|
|
24
|
+
from ...skills.skills_service import SkillsService
|
|
25
|
+
from ..shared import BaseCommand, CommandResult
|
|
26
|
+
|
|
27
|
+
console = Console()
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class SkillsManagementCommand(BaseCommand):
|
|
31
|
+
"""Skills management command for Claude Code skills."""
|
|
32
|
+
|
|
33
|
+
def __init__(self):
|
|
34
|
+
super().__init__("skills")
|
|
35
|
+
self._skills_service = None
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def skills_service(self) -> SkillsService:
|
|
39
|
+
"""Get skills service instance (lazy loaded)."""
|
|
40
|
+
if self._skills_service is None:
|
|
41
|
+
self._skills_service = SkillsService()
|
|
42
|
+
return self._skills_service
|
|
43
|
+
|
|
44
|
+
def validate_args(self, args) -> Optional[str]:
|
|
45
|
+
"""Validate command arguments."""
|
|
46
|
+
# Most skills commands are optional, basic validation
|
|
47
|
+
if hasattr(args, "skills_command") and args.skills_command:
|
|
48
|
+
if args.skills_command == SkillsCommands.VALIDATE.value:
|
|
49
|
+
if not hasattr(args, "skill_name") or not args.skill_name:
|
|
50
|
+
return "Validate command requires a skill name"
|
|
51
|
+
elif args.skills_command == SkillsCommands.INFO.value:
|
|
52
|
+
if not hasattr(args, "skill_name") or not args.skill_name:
|
|
53
|
+
return "Info command requires a skill name"
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
def run(self, args) -> CommandResult:
|
|
57
|
+
"""Execute the skills command."""
|
|
58
|
+
try:
|
|
59
|
+
# Handle default case (no subcommand) - show list
|
|
60
|
+
if not hasattr(args, "skills_command") or not args.skills_command:
|
|
61
|
+
return self._list_skills(args)
|
|
62
|
+
|
|
63
|
+
# Route to appropriate subcommand
|
|
64
|
+
command_map = {
|
|
65
|
+
SkillsCommands.LIST.value: self._list_skills,
|
|
66
|
+
SkillsCommands.DEPLOY.value: self._deploy_skills,
|
|
67
|
+
SkillsCommands.VALIDATE.value: self._validate_skill,
|
|
68
|
+
SkillsCommands.UPDATE.value: self._update_skills,
|
|
69
|
+
SkillsCommands.INFO.value: self._show_skill_info,
|
|
70
|
+
SkillsCommands.CONFIG.value: self._manage_config,
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
handler = command_map.get(args.skills_command)
|
|
74
|
+
if handler:
|
|
75
|
+
return handler(args)
|
|
76
|
+
return CommandResult(
|
|
77
|
+
success=False,
|
|
78
|
+
message=f"Unknown skills command: {args.skills_command}",
|
|
79
|
+
exit_code=1,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
except Exception as e:
|
|
83
|
+
self.logger.error(f"Skills command failed: {e}")
|
|
84
|
+
if hasattr(args, "debug") and args.debug:
|
|
85
|
+
import traceback
|
|
86
|
+
|
|
87
|
+
traceback.print_exc()
|
|
88
|
+
return CommandResult(
|
|
89
|
+
success=False, message=f"Skills command failed: {e}", exit_code=1
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
def _list_skills(self, args) -> CommandResult:
|
|
93
|
+
"""List available skills."""
|
|
94
|
+
try:
|
|
95
|
+
# Get skills based on filter
|
|
96
|
+
if hasattr(args, "agent") and args.agent:
|
|
97
|
+
skills = self.skills_service.get_skills_for_agent(args.agent)
|
|
98
|
+
console.print(
|
|
99
|
+
f"\n[bold cyan]Skills for agent '{args.agent}':[/bold cyan]\n"
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
if not skills:
|
|
103
|
+
console.print(
|
|
104
|
+
f"[yellow]No skills found for agent '{args.agent}'[/yellow]"
|
|
105
|
+
)
|
|
106
|
+
return CommandResult(success=True, exit_code=0)
|
|
107
|
+
|
|
108
|
+
for skill_name in skills:
|
|
109
|
+
# Get skill metadata
|
|
110
|
+
skill_info = self._get_skill_metadata(skill_name)
|
|
111
|
+
if skill_info:
|
|
112
|
+
console.print(f" [green]•[/green] {skill_name}")
|
|
113
|
+
if (
|
|
114
|
+
hasattr(args, "verbose")
|
|
115
|
+
and args.verbose
|
|
116
|
+
and skill_info.get("description")
|
|
117
|
+
):
|
|
118
|
+
console.print(f" {skill_info['description']}")
|
|
119
|
+
else:
|
|
120
|
+
console.print(f" [green]•[/green] {skill_name}")
|
|
121
|
+
|
|
122
|
+
else:
|
|
123
|
+
# Discover all bundled skills
|
|
124
|
+
skills = self.skills_service.discover_bundled_skills()
|
|
125
|
+
|
|
126
|
+
# Filter by category if specified
|
|
127
|
+
if hasattr(args, "category") and args.category:
|
|
128
|
+
skills = [s for s in skills if s.get("category") == args.category]
|
|
129
|
+
console.print(
|
|
130
|
+
f"\n[bold cyan]Skills in category '{args.category}':[/bold cyan]\n"
|
|
131
|
+
)
|
|
132
|
+
else:
|
|
133
|
+
console.print("\n[bold cyan]Available Skills:[/bold cyan]\n")
|
|
134
|
+
|
|
135
|
+
if not skills:
|
|
136
|
+
console.print("[yellow]No skills found[/yellow]")
|
|
137
|
+
return CommandResult(success=True, exit_code=0)
|
|
138
|
+
|
|
139
|
+
# Group by category
|
|
140
|
+
by_category = {}
|
|
141
|
+
for skill in skills:
|
|
142
|
+
category = skill.get("category", "uncategorized")
|
|
143
|
+
if category not in by_category:
|
|
144
|
+
by_category[category] = []
|
|
145
|
+
by_category[category].append(skill)
|
|
146
|
+
|
|
147
|
+
# Display by category
|
|
148
|
+
for category, category_skills in sorted(by_category.items()):
|
|
149
|
+
console.print(f"[bold yellow]{category}[/bold yellow]")
|
|
150
|
+
for skill in sorted(
|
|
151
|
+
category_skills, key=lambda s: s.get("name", "")
|
|
152
|
+
):
|
|
153
|
+
name = skill.get("name", "unknown")
|
|
154
|
+
console.print(f" [green]•[/green] {name}")
|
|
155
|
+
|
|
156
|
+
if hasattr(args, "verbose") and args.verbose:
|
|
157
|
+
metadata = skill.get("metadata", {})
|
|
158
|
+
if desc := metadata.get("description"):
|
|
159
|
+
console.print(f" {desc}")
|
|
160
|
+
if version := metadata.get("version"):
|
|
161
|
+
console.print(f" [dim]Version: {version}[/dim]")
|
|
162
|
+
console.print()
|
|
163
|
+
|
|
164
|
+
return CommandResult(success=True, exit_code=0)
|
|
165
|
+
|
|
166
|
+
except Exception as e:
|
|
167
|
+
console.print(f"[red]Error listing skills: {e}[/red]")
|
|
168
|
+
return CommandResult(success=False, message=str(e), exit_code=1)
|
|
169
|
+
|
|
170
|
+
def _deploy_skills(self, args) -> CommandResult:
|
|
171
|
+
"""Deploy bundled skills to project."""
|
|
172
|
+
try:
|
|
173
|
+
force = getattr(args, "force", False)
|
|
174
|
+
specific_skills = getattr(args, "skills", None)
|
|
175
|
+
|
|
176
|
+
console.print("\n[bold cyan]Deploying skills...[/bold cyan]\n")
|
|
177
|
+
|
|
178
|
+
result = self.skills_service.deploy_bundled_skills(
|
|
179
|
+
force=force, skill_names=specific_skills
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
# Display results
|
|
183
|
+
if result["deployed"]:
|
|
184
|
+
console.print(
|
|
185
|
+
f"[green]✓ Deployed {len(result['deployed'])} skill(s):[/green]"
|
|
186
|
+
)
|
|
187
|
+
for skill in result["deployed"]:
|
|
188
|
+
console.print(f" • {skill}")
|
|
189
|
+
console.print()
|
|
190
|
+
|
|
191
|
+
if result["skipped"]:
|
|
192
|
+
console.print(
|
|
193
|
+
f"[yellow]⊘ Skipped {len(result['skipped'])} skill(s) (already deployed):[/yellow]"
|
|
194
|
+
)
|
|
195
|
+
for skill in result["skipped"]:
|
|
196
|
+
console.print(f" • {skill}")
|
|
197
|
+
console.print("[dim]Use --force to redeploy[/dim]\n")
|
|
198
|
+
|
|
199
|
+
if result["errors"]:
|
|
200
|
+
console.print(
|
|
201
|
+
f"[red]✗ Failed to deploy {len(result['errors'])} skill(s):[/red]"
|
|
202
|
+
)
|
|
203
|
+
for skill, error in result["errors"].items():
|
|
204
|
+
console.print(f" • {skill}: {error}")
|
|
205
|
+
console.print()
|
|
206
|
+
|
|
207
|
+
# Summary
|
|
208
|
+
total = (
|
|
209
|
+
len(result["deployed"]) + len(result["skipped"]) + len(result["errors"])
|
|
210
|
+
)
|
|
211
|
+
console.print(
|
|
212
|
+
f"[bold]Summary:[/bold] {len(result['deployed'])} deployed, "
|
|
213
|
+
f"{len(result['skipped'])} skipped, {len(result['errors'])} errors "
|
|
214
|
+
f"(Total: {total})\n"
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
# Exit with error if any deployments failed
|
|
218
|
+
exit_code = 1 if result["errors"] else 0
|
|
219
|
+
return CommandResult(success=not result["errors"], exit_code=exit_code)
|
|
220
|
+
|
|
221
|
+
except Exception as e:
|
|
222
|
+
console.print(f"[red]Error deploying skills: {e}[/red]")
|
|
223
|
+
return CommandResult(success=False, message=str(e), exit_code=1)
|
|
224
|
+
|
|
225
|
+
def _validate_skill(self, args) -> CommandResult:
|
|
226
|
+
"""Validate skill structure and metadata."""
|
|
227
|
+
try:
|
|
228
|
+
skill_name = args.skill_name
|
|
229
|
+
strict = getattr(args, "strict", False)
|
|
230
|
+
|
|
231
|
+
console.print(
|
|
232
|
+
f"\n[bold cyan]Validating skill '{skill_name}'...[/bold cyan]\n"
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
result = self.skills_service.validate_skill(skill_name)
|
|
236
|
+
|
|
237
|
+
if result["valid"]:
|
|
238
|
+
console.print(f"[green]✓ {skill_name} is valid[/green]\n")
|
|
239
|
+
|
|
240
|
+
if result.get("warnings"):
|
|
241
|
+
console.print(
|
|
242
|
+
f"[yellow]Warnings ({len(result['warnings'])}):[/yellow]"
|
|
243
|
+
)
|
|
244
|
+
for warning in result["warnings"]:
|
|
245
|
+
console.print(f" • {warning}")
|
|
246
|
+
console.print()
|
|
247
|
+
|
|
248
|
+
# Treat warnings as errors in strict mode
|
|
249
|
+
if strict:
|
|
250
|
+
console.print(
|
|
251
|
+
"[red]Strict mode: treating warnings as errors[/red]"
|
|
252
|
+
)
|
|
253
|
+
return CommandResult(success=False, exit_code=1)
|
|
254
|
+
|
|
255
|
+
return CommandResult(success=True, exit_code=0)
|
|
256
|
+
console.print(f"[red]✗ {skill_name} has validation errors:[/red]")
|
|
257
|
+
for error in result.get("errors", []):
|
|
258
|
+
console.print(f" • {error}")
|
|
259
|
+
console.print()
|
|
260
|
+
|
|
261
|
+
if result.get("warnings"):
|
|
262
|
+
console.print("[yellow]Warnings:[/yellow]")
|
|
263
|
+
for warning in result["warnings"]:
|
|
264
|
+
console.print(f" • {warning}")
|
|
265
|
+
console.print()
|
|
266
|
+
|
|
267
|
+
return CommandResult(success=False, exit_code=1)
|
|
268
|
+
|
|
269
|
+
except Exception as e:
|
|
270
|
+
console.print(f"[red]Error validating skill: {e}[/red]")
|
|
271
|
+
return CommandResult(success=False, message=str(e), exit_code=1)
|
|
272
|
+
|
|
273
|
+
def _update_skills(self, args) -> CommandResult:
|
|
274
|
+
"""Check for and install skill updates."""
|
|
275
|
+
try:
|
|
276
|
+
skill_names = getattr(args, "skill_names", [])
|
|
277
|
+
check_only = getattr(args, "check_only", False)
|
|
278
|
+
force = getattr(args, "force", False)
|
|
279
|
+
|
|
280
|
+
action = "Checking" if check_only else "Updating"
|
|
281
|
+
console.print(f"\n[bold cyan]{action} skills...[/bold cyan]\n")
|
|
282
|
+
|
|
283
|
+
result = self.skills_service.check_for_updates(skill_names)
|
|
284
|
+
|
|
285
|
+
if not result.get("updates_available"):
|
|
286
|
+
console.print("[green]All skills are up to date[/green]\n")
|
|
287
|
+
return CommandResult(success=True, exit_code=0)
|
|
288
|
+
|
|
289
|
+
# Display available updates
|
|
290
|
+
console.print(
|
|
291
|
+
f"[yellow]Updates available for {len(result['updates_available'])} skill(s):[/yellow]"
|
|
292
|
+
)
|
|
293
|
+
for update_info in result["updates_available"]:
|
|
294
|
+
skill_name = update_info["skill"]
|
|
295
|
+
current = update_info["current_version"]
|
|
296
|
+
latest = update_info["latest_version"]
|
|
297
|
+
console.print(f" • {skill_name}: {current} → {latest}")
|
|
298
|
+
console.print()
|
|
299
|
+
|
|
300
|
+
if check_only:
|
|
301
|
+
console.print(
|
|
302
|
+
"[dim]Run without --check-only to install updates[/dim]\n"
|
|
303
|
+
)
|
|
304
|
+
return CommandResult(success=True, exit_code=0)
|
|
305
|
+
|
|
306
|
+
# Install updates
|
|
307
|
+
console.print("[bold cyan]Installing updates...[/bold cyan]\n")
|
|
308
|
+
install_result = self.skills_service.install_updates(
|
|
309
|
+
result["updates_available"], force=force
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
if install_result["updated"]:
|
|
313
|
+
console.print(
|
|
314
|
+
f"[green]✓ Updated {len(install_result['updated'])} skill(s)[/green]\n"
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
if install_result.get("errors"):
|
|
318
|
+
console.print(
|
|
319
|
+
f"[red]✗ Failed to update {len(install_result['errors'])} skill(s)[/red]"
|
|
320
|
+
)
|
|
321
|
+
for skill, error in install_result["errors"].items():
|
|
322
|
+
console.print(f" • {skill}: {error}")
|
|
323
|
+
console.print()
|
|
324
|
+
|
|
325
|
+
exit_code = 1 if install_result.get("errors") else 0
|
|
326
|
+
return CommandResult(
|
|
327
|
+
success=not install_result.get("errors"), exit_code=exit_code
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
except Exception as e:
|
|
331
|
+
console.print(f"[red]Error updating skills: {e}[/red]")
|
|
332
|
+
return CommandResult(success=False, message=str(e), exit_code=1)
|
|
333
|
+
|
|
334
|
+
def _show_skill_info(self, args) -> CommandResult:
|
|
335
|
+
"""Show detailed skill information."""
|
|
336
|
+
try:
|
|
337
|
+
skill_name = args.skill_name
|
|
338
|
+
show_content = getattr(args, "show_content", False)
|
|
339
|
+
|
|
340
|
+
skill_info = self._get_skill_metadata(skill_name)
|
|
341
|
+
|
|
342
|
+
if not skill_info:
|
|
343
|
+
console.print(f"[red]Skill '{skill_name}' not found[/red]")
|
|
344
|
+
return CommandResult(success=False, exit_code=1)
|
|
345
|
+
|
|
346
|
+
# Display skill info in a panel
|
|
347
|
+
info_text = f"[bold cyan]{skill_name}[/bold cyan]\n\n"
|
|
348
|
+
|
|
349
|
+
if desc := skill_info.get("description"):
|
|
350
|
+
info_text += f"{desc}\n\n"
|
|
351
|
+
|
|
352
|
+
if category := skill_info.get("category"):
|
|
353
|
+
info_text += f"[bold]Category:[/bold] {category}\n"
|
|
354
|
+
|
|
355
|
+
if version := skill_info.get("version"):
|
|
356
|
+
info_text += f"[bold]Version:[/bold] {version}\n"
|
|
357
|
+
|
|
358
|
+
if source := skill_info.get("source"):
|
|
359
|
+
info_text += f"[bold]Source:[/bold] {source}\n"
|
|
360
|
+
|
|
361
|
+
# Show agents using this skill
|
|
362
|
+
agents_using = self.skills_service.get_agents_for_skill(skill_name)
|
|
363
|
+
if agents_using:
|
|
364
|
+
info_text += (
|
|
365
|
+
f"\n[bold]Used by agents:[/bold] {', '.join(agents_using)}\n"
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
console.print(
|
|
369
|
+
Panel(info_text, title="Skill Information", border_style="cyan")
|
|
370
|
+
)
|
|
371
|
+
|
|
372
|
+
# Show content if requested
|
|
373
|
+
if show_content:
|
|
374
|
+
skill_path = self.skills_service.get_skill_path(skill_name)
|
|
375
|
+
skill_md = skill_path / "SKILL.md"
|
|
376
|
+
|
|
377
|
+
if skill_md.exists():
|
|
378
|
+
console.print("\n[bold cyan]Skill Content:[/bold cyan]\n")
|
|
379
|
+
content = skill_md.read_text()
|
|
380
|
+
console.print(Markdown(content))
|
|
381
|
+
else:
|
|
382
|
+
console.print(
|
|
383
|
+
f"\n[yellow]SKILL.md not found at {skill_md}[/yellow]"
|
|
384
|
+
)
|
|
385
|
+
|
|
386
|
+
return CommandResult(success=True, exit_code=0)
|
|
387
|
+
|
|
388
|
+
except Exception as e:
|
|
389
|
+
console.print(f"[red]Error showing skill info: {e}[/red]")
|
|
390
|
+
return CommandResult(success=False, message=str(e), exit_code=1)
|
|
391
|
+
|
|
392
|
+
def _manage_config(self, args) -> CommandResult:
|
|
393
|
+
"""View or edit skills configuration."""
|
|
394
|
+
try:
|
|
395
|
+
scope = getattr(args, "scope", "project")
|
|
396
|
+
edit = getattr(args, "edit", False)
|
|
397
|
+
show_path = getattr(args, "path", False)
|
|
398
|
+
|
|
399
|
+
config_path = self.skills_service.get_config_path(scope)
|
|
400
|
+
|
|
401
|
+
if show_path:
|
|
402
|
+
console.print(
|
|
403
|
+
f"\n[cyan]Configuration path ({scope}):[/cyan] {config_path}\n"
|
|
404
|
+
)
|
|
405
|
+
return CommandResult(success=True, exit_code=0)
|
|
406
|
+
|
|
407
|
+
if not config_path.exists():
|
|
408
|
+
console.print(
|
|
409
|
+
f"\n[yellow]Configuration file does not exist: {config_path}[/yellow]"
|
|
410
|
+
)
|
|
411
|
+
console.print("[dim]Would you like to create it? (y/n):[/dim] ", end="")
|
|
412
|
+
|
|
413
|
+
if input().lower() == "y":
|
|
414
|
+
self.skills_service.create_default_config(scope)
|
|
415
|
+
console.print(
|
|
416
|
+
f"[green]Created default configuration at {config_path}[/green]\n"
|
|
417
|
+
)
|
|
418
|
+
else:
|
|
419
|
+
return CommandResult(success=False, exit_code=1)
|
|
420
|
+
|
|
421
|
+
if edit:
|
|
422
|
+
# Open in editor
|
|
423
|
+
editor = os.environ.get("EDITOR", "nano")
|
|
424
|
+
try:
|
|
425
|
+
subprocess.run([editor, str(config_path)], check=True)
|
|
426
|
+
console.print(
|
|
427
|
+
f"\n[green]Configuration saved to {config_path}[/green]\n"
|
|
428
|
+
)
|
|
429
|
+
return CommandResult(success=True, exit_code=0)
|
|
430
|
+
except subprocess.CalledProcessError as e:
|
|
431
|
+
console.print(f"[red]Error opening editor: {e}[/red]")
|
|
432
|
+
return CommandResult(success=False, exit_code=1)
|
|
433
|
+
else:
|
|
434
|
+
# Display config
|
|
435
|
+
console.print(
|
|
436
|
+
f"\n[bold cyan]Skills Configuration ({scope}):[/bold cyan]\n"
|
|
437
|
+
)
|
|
438
|
+
console.print(f"[dim]Path: {config_path}[/dim]\n")
|
|
439
|
+
|
|
440
|
+
import yaml
|
|
441
|
+
|
|
442
|
+
config = yaml.safe_load(config_path.read_text())
|
|
443
|
+
console.print(yaml.dump(config, default_flow_style=False))
|
|
444
|
+
|
|
445
|
+
return CommandResult(success=True, exit_code=0)
|
|
446
|
+
|
|
447
|
+
except Exception as e:
|
|
448
|
+
console.print(f"[red]Error managing configuration: {e}[/red]")
|
|
449
|
+
return CommandResult(success=False, message=str(e), exit_code=1)
|
|
450
|
+
|
|
451
|
+
def _get_skill_metadata(self, skill_name: str) -> Optional[dict]:
|
|
452
|
+
"""Get skill metadata from SKILL.md file."""
|
|
453
|
+
try:
|
|
454
|
+
skill_path = self.skills_service.get_skill_path(skill_name)
|
|
455
|
+
skill_md = skill_path / "SKILL.md"
|
|
456
|
+
|
|
457
|
+
if not skill_md.exists():
|
|
458
|
+
return None
|
|
459
|
+
|
|
460
|
+
# Parse SKILL.md metadata
|
|
461
|
+
content = skill_md.read_text()
|
|
462
|
+
return self.skills_service.parse_skill_metadata(content)
|
|
463
|
+
|
|
464
|
+
except Exception:
|
|
465
|
+
return None
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
def manage_skills(args) -> int:
|
|
469
|
+
"""
|
|
470
|
+
Main entry point for skills command.
|
|
471
|
+
|
|
472
|
+
Args:
|
|
473
|
+
args: Parsed command-line arguments
|
|
474
|
+
|
|
475
|
+
Returns:
|
|
476
|
+
Exit code (0 for success, non-zero for failure)
|
|
477
|
+
"""
|
|
478
|
+
command = SkillsManagementCommand()
|
|
479
|
+
|
|
480
|
+
# Validate arguments
|
|
481
|
+
error = command.validate_args(args)
|
|
482
|
+
if error:
|
|
483
|
+
console.print(f"[red]Error: {error}[/red]")
|
|
484
|
+
return 1
|
|
485
|
+
|
|
486
|
+
# Run command
|
|
487
|
+
result = command.run(args)
|
|
488
|
+
return result.exit_code
|
claude_mpm/cli/executor.py
CHANGED
|
@@ -26,6 +26,7 @@ from .commands import (
|
|
|
26
26
|
)
|
|
27
27
|
from .commands.analyze_code import manage_analyze_code
|
|
28
28
|
from .commands.dashboard import manage_dashboard
|
|
29
|
+
from .commands.skills import manage_skills
|
|
29
30
|
from .commands.upgrade import upgrade
|
|
30
31
|
|
|
31
32
|
|
|
@@ -164,6 +165,7 @@ def execute_command(command: str, args) -> int:
|
|
|
164
165
|
CLICommands.MCP.value: manage_mcp,
|
|
165
166
|
CLICommands.DOCTOR.value: run_doctor,
|
|
166
167
|
CLICommands.UPGRADE.value: upgrade,
|
|
168
|
+
CLICommands.SKILLS.value: manage_skills,
|
|
167
169
|
"debug": manage_debug, # Add debug command
|
|
168
170
|
"mpm-init": None, # Will be handled separately with lazy import
|
|
169
171
|
}
|
|
@@ -403,6 +403,13 @@ def create_parser(
|
|
|
403
403
|
except ImportError:
|
|
404
404
|
pass
|
|
405
405
|
|
|
406
|
+
try:
|
|
407
|
+
from .skills_parser import add_skills_subparser
|
|
408
|
+
|
|
409
|
+
add_skills_subparser(subparsers)
|
|
410
|
+
except ImportError:
|
|
411
|
+
pass
|
|
412
|
+
|
|
406
413
|
try:
|
|
407
414
|
from .config_parser import add_config_subparser
|
|
408
415
|
|
|
@@ -265,5 +265,47 @@ def add_mpm_init_subparser(subparsers: Any) -> None:
|
|
|
265
265
|
help="Path to project directory (default: current directory)",
|
|
266
266
|
)
|
|
267
267
|
|
|
268
|
+
# Pause subcommand - Create session pause documents
|
|
269
|
+
pause_parser = subcommands.add_parser(
|
|
270
|
+
"pause",
|
|
271
|
+
help="Pause current session and save state",
|
|
272
|
+
description="Create session pause documents for later resume. Captures git context, "
|
|
273
|
+
"conversation state, todos, and working directory state.\n\n"
|
|
274
|
+
"Creates three file formats:\n"
|
|
275
|
+
" - JSON: Machine-readable structured data\n"
|
|
276
|
+
" - YAML: Human-readable configuration style\n"
|
|
277
|
+
" - Markdown: Full documentation format",
|
|
278
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
279
|
+
epilog="Examples:\n"
|
|
280
|
+
" claude-mpm mpm-init pause # Basic pause\n"
|
|
281
|
+
" claude-mpm mpm-init pause -m 'End of day' # With message\n"
|
|
282
|
+
" claude-mpm mpm-init pause --no-commit # Skip git commit\n"
|
|
283
|
+
" claude-mpm mpm-init pause --export session.json # Export copy",
|
|
284
|
+
)
|
|
285
|
+
pause_parser.add_argument(
|
|
286
|
+
"--message",
|
|
287
|
+
"-m",
|
|
288
|
+
type=str,
|
|
289
|
+
default=None,
|
|
290
|
+
help="Optional message describing pause reason or context",
|
|
291
|
+
)
|
|
292
|
+
pause_parser.add_argument(
|
|
293
|
+
"--no-commit",
|
|
294
|
+
action="store_true",
|
|
295
|
+
help="Skip git commit of session state",
|
|
296
|
+
)
|
|
297
|
+
pause_parser.add_argument(
|
|
298
|
+
"--export",
|
|
299
|
+
type=str,
|
|
300
|
+
default=None,
|
|
301
|
+
help="Export session state to custom location",
|
|
302
|
+
)
|
|
303
|
+
pause_parser.add_argument(
|
|
304
|
+
"project_path",
|
|
305
|
+
nargs="?",
|
|
306
|
+
default=".",
|
|
307
|
+
help="Path to project directory (default: current directory)",
|
|
308
|
+
)
|
|
309
|
+
|
|
268
310
|
# Set the command handler
|
|
269
311
|
mpm_init_parser.set_defaults(command="mpm-init")
|