claude-mpm 5.4.14__py3-none-any.whl → 5.4.21__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.
Files changed (30) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/CLAUDE_MPM_TEACHER_OUTPUT_STYLE.md +1 -1
  3. claude_mpm/agents/PM_INSTRUCTIONS.md +127 -21
  4. claude_mpm/cli/chrome_devtools_installer.py +175 -0
  5. claude_mpm/cli/commands/agents.py +0 -31
  6. claude_mpm/cli/commands/skills.py +193 -187
  7. claude_mpm/cli/parsers/agents_parser.py +0 -9
  8. claude_mpm/cli/parsers/auto_configure_parser.py +0 -138
  9. claude_mpm/cli/startup.py +237 -25
  10. claude_mpm/commands/mpm-config.md +1 -2
  11. claude_mpm/commands/mpm-help.md +14 -95
  12. claude_mpm/commands/mpm-organize.md +350 -153
  13. claude_mpm/hooks/claude_hooks/event_handlers.py +5 -0
  14. claude_mpm/scripts/start_activity_logging.py +0 -0
  15. claude_mpm/services/command_deployment_service.py +10 -0
  16. claude_mpm/services/skills/selective_skill_deployer.py +475 -1
  17. claude_mpm/services/skills_deployer.py +62 -6
  18. {claude_mpm-5.4.14.dist-info → claude_mpm-5.4.21.dist-info}/METADATA +1 -1
  19. {claude_mpm-5.4.14.dist-info → claude_mpm-5.4.21.dist-info}/RECORD +23 -28
  20. claude_mpm/cli/commands/agents_detect.py +0 -380
  21. claude_mpm/cli/commands/agents_recommend.py +0 -309
  22. claude_mpm/commands/mpm-agents-auto-configure.md +0 -278
  23. claude_mpm/commands/mpm-agents-detect.md +0 -177
  24. claude_mpm/commands/mpm-agents-list.md +0 -131
  25. claude_mpm/commands/mpm-agents-recommend.md +0 -223
  26. {claude_mpm-5.4.14.dist-info → claude_mpm-5.4.21.dist-info}/WHEEL +0 -0
  27. {claude_mpm-5.4.14.dist-info → claude_mpm-5.4.21.dist-info}/entry_points.txt +0 -0
  28. {claude_mpm-5.4.14.dist-info → claude_mpm-5.4.21.dist-info}/licenses/LICENSE +0 -0
  29. {claude_mpm-5.4.14.dist-info → claude_mpm-5.4.21.dist-info}/licenses/LICENSE-FAQ.md +0 -0
  30. {claude_mpm-5.4.14.dist-info → claude_mpm-5.4.21.dist-info}/top_level.txt +0 -0
@@ -1,309 +0,0 @@
1
- """
2
- Agents Recommend CLI Command for Claude MPM Framework
3
- ======================================================
4
-
5
- WHY: This module provides a CLI interface for getting agent recommendations
6
- based on project toolchain without deploying anything. Useful for reviewing
7
- recommendations before committing to deployment.
8
-
9
- DESIGN DECISION: Focused on recommendation display with detailed reasoning,
10
- showing users why each agent was recommended. Supports JSON output for
11
- integration with other tools.
12
-
13
- Part of TSK-0054: Auto-Configuration Feature - Phase 5
14
- """
15
-
16
- import json
17
- from pathlib import Path
18
- from typing import Optional
19
-
20
- try:
21
- from rich.console import Console
22
- from rich.panel import Panel
23
- from rich.table import Table
24
-
25
- RICH_AVAILABLE = True
26
- except ImportError:
27
- RICH_AVAILABLE = False
28
-
29
- from ...services.agents.recommender import AgentRecommenderService
30
- from ...services.agents.registry import AgentRegistry
31
- from ...services.project.toolchain_analyzer import ToolchainAnalyzerService
32
- from ..shared import BaseCommand, CommandResult
33
-
34
-
35
- class AgentsRecommendCommand(BaseCommand):
36
- """
37
- Handle agents recommend CLI command.
38
-
39
- This command analyzes the project toolchain and recommends appropriate
40
- agents without deploying them. Shows detailed reasoning for each
41
- recommendation.
42
- """
43
-
44
- def __init__(self):
45
- """Initialize the agents recommend command."""
46
- super().__init__("agents-recommend")
47
- self.console = Console() if RICH_AVAILABLE else None
48
- self._toolchain_analyzer = None
49
- self._agent_recommender = None
50
-
51
- @property
52
- def toolchain_analyzer(self) -> ToolchainAnalyzerService:
53
- """Get toolchain analyzer (lazy loaded)."""
54
- if self._toolchain_analyzer is None:
55
- self._toolchain_analyzer = ToolchainAnalyzerService()
56
- return self._toolchain_analyzer
57
-
58
- @property
59
- def agent_recommender(self) -> AgentRecommenderService:
60
- """Get agent recommender (lazy loaded)."""
61
- if self._agent_recommender is None:
62
- agent_registry = AgentRegistry()
63
- self._agent_recommender = AgentRecommenderService(
64
- agent_registry=agent_registry
65
- )
66
- return self._agent_recommender
67
-
68
- def validate_args(self, args) -> Optional[str]:
69
- """Validate command arguments."""
70
- # Validate project path
71
- project_path = (
72
- Path(args.project_path)
73
- if hasattr(args, "project_path") and args.project_path
74
- else Path.cwd()
75
- )
76
- if not project_path.exists():
77
- return f"Project path does not exist: {project_path}"
78
-
79
- # Validate min_confidence range
80
- if hasattr(args, "min_confidence") and args.min_confidence:
81
- if not 0.0 <= args.min_confidence <= 1.0:
82
- return "min_confidence must be between 0.0 and 1.0"
83
-
84
- return None
85
-
86
- def run(self, args) -> CommandResult:
87
- """
88
- Execute agents recommend command.
89
-
90
- Returns:
91
- CommandResult with success status and exit code
92
- """
93
- try:
94
- # Setup logging
95
- self.setup_logging(args)
96
-
97
- # Validate arguments
98
- error = self.validate_args(args)
99
- if error:
100
- return CommandResult.error_result(error)
101
-
102
- # Get configuration options
103
- project_path = (
104
- Path(args.project_path)
105
- if hasattr(args, "project_path") and args.project_path
106
- else Path.cwd()
107
- )
108
- min_confidence = (
109
- args.min_confidence
110
- if hasattr(args, "min_confidence") and args.min_confidence
111
- else 0.8
112
- )
113
- json_output = args.json if hasattr(args, "json") and args.json else False
114
- show_reasoning = (
115
- args.show_reasoning
116
- if hasattr(args, "show_reasoning") and args.show_reasoning
117
- else True
118
- )
119
-
120
- # Analyze toolchain
121
- if self.console and not json_output:
122
- with self.console.status("[bold green]Analyzing project toolchain..."):
123
- analysis = self.toolchain_analyzer.analyze_project(
124
- str(project_path)
125
- )
126
- else:
127
- analysis = self.toolchain_analyzer.analyze_project(str(project_path))
128
-
129
- # Get recommendations
130
- if self.console and not json_output:
131
- with self.console.status(
132
- "[bold green]Generating agent recommendations..."
133
- ):
134
- recommendations = self.agent_recommender.recommend_agents(
135
- analysis, min_confidence
136
- )
137
- else:
138
- recommendations = self.agent_recommender.recommend_agents(
139
- analysis, min_confidence
140
- )
141
-
142
- # Output results
143
- if json_output:
144
- return self._output_json(recommendations, analysis)
145
- return self._display_results(recommendations, analysis, show_reasoning)
146
-
147
- except KeyboardInterrupt:
148
- if self.console:
149
- self.console.print("\n\n❌ Operation cancelled by user")
150
- else:
151
- print("\n\nOperation cancelled by user")
152
- return CommandResult.error_result("Operation cancelled", exit_code=130)
153
-
154
- except Exception as e:
155
- self.logger.exception("Agent recommendation failed")
156
- error_msg = f"Agent recommendation failed: {e!s}"
157
- if self.console:
158
- self.console.print(f"\n❌ {error_msg}")
159
- else:
160
- print(f"\n{error_msg}")
161
- return CommandResult.error_result(error_msg)
162
-
163
- def _display_results(
164
- self, recommendations, analysis, show_reasoning: bool
165
- ) -> CommandResult:
166
- """Display agent recommendations with Rich formatting."""
167
- if not self.console:
168
- return self._display_results_plain(
169
- recommendations, analysis, show_reasoning
170
- )
171
-
172
- # Display header
173
- self.console.print("\n🤖 Agent Recommendations", style="bold blue")
174
- self.console.print(f"Project: {analysis.project_path}\n")
175
-
176
- # Display quick summary
177
- if recommendations:
178
- summary_text = (
179
- f"Found {len(recommendations)} recommended agent(s) "
180
- f"for your project based on detected toolchain."
181
- )
182
- panel = Panel(summary_text, border_style="green")
183
- self.console.print(panel)
184
- else:
185
- panel = Panel(
186
- "No agents recommended for this project.\n"
187
- "Try lowering the confidence threshold with --min-confidence",
188
- border_style="yellow",
189
- )
190
- self.console.print(panel)
191
- return CommandResult.success_result()
192
-
193
- # Display recommendations table
194
- self.console.print("\n📋 Recommended Agents:", style="bold green")
195
- table = Table(show_header=True, header_style="bold")
196
- table.add_column("Agent ID", style="cyan")
197
- table.add_column("Confidence", style="green")
198
- table.add_column("Priority", style="yellow")
199
- if show_reasoning:
200
- table.add_column("Reasoning", style="dim", no_wrap=False)
201
-
202
- for rec in recommendations:
203
- confidence_pct = int(rec.confidence * 100)
204
- bar = "█" * (confidence_pct // 10) + "░" * (10 - confidence_pct // 10)
205
- confidence_str = f"{bar} {confidence_pct}%"
206
-
207
- if show_reasoning:
208
- table.add_row(
209
- rec.agent_id,
210
- confidence_str,
211
- str(rec.priority),
212
- rec.reasoning,
213
- )
214
- else:
215
- table.add_row(rec.agent_id, confidence_str, str(rec.priority))
216
-
217
- self.console.print(table)
218
-
219
- # Display match details if reasoning enabled
220
- if show_reasoning:
221
- self.console.print("\n🔍 Match Details:", style="bold blue")
222
- for rec in recommendations:
223
- self.console.print(f"\n[bold cyan]{rec.agent_id}[/bold cyan]")
224
- self.console.print(f" Confidence: {int(rec.confidence * 100)}%")
225
- self.console.print(f" Priority: {rec.priority}")
226
- self.console.print(f" Reasoning: {rec.reasoning}")
227
-
228
- if rec.matched_capabilities:
229
- self.console.print(" Matched capabilities:", style="green")
230
- for cap in rec.matched_capabilities[:5]:
231
- self.console.print(f" • {cap}", style="dim")
232
- if len(rec.matched_capabilities) > 5:
233
- remaining = len(rec.matched_capabilities) - 5
234
- self.console.print(f" ... and {remaining} more", style="dim")
235
-
236
- # Display next steps
237
- self.console.print("\n💡 Next Steps:", style="bold yellow")
238
- self.console.print(" 1. Review the recommendations and their reasoning")
239
- self.console.print(
240
- " 2. Deploy agents with: [bold]claude-mpm auto-configure[/bold]"
241
- )
242
- self.console.print(
243
- " 3. Or preview deployment with: [bold]claude-mpm auto-configure --preview[/bold]"
244
- )
245
-
246
- return CommandResult.success_result()
247
-
248
- def _display_results_plain(
249
- self, recommendations, analysis, show_reasoning: bool
250
- ) -> CommandResult:
251
- """Display results in plain text (fallback)."""
252
- print("\n🤖 Agent Recommendations")
253
- print(f"Project: {analysis.project_path}\n")
254
-
255
- if not recommendations:
256
- print("No agents recommended for this project.")
257
- print("Try lowering the confidence threshold with --min-confidence")
258
- return CommandResult.success_result()
259
-
260
- print(f"Found {len(recommendations)} recommended agent(s) for your project:\n")
261
-
262
- for rec in recommendations:
263
- confidence_pct = int(rec.confidence * 100)
264
- print(f"• {rec.agent_id} ({confidence_pct}% confidence)")
265
-
266
- if show_reasoning:
267
- print(f" Priority: {rec.priority}")
268
- print(f" Reasoning: {rec.reasoning}")
269
-
270
- if rec.matched_capabilities:
271
- print(" Matched capabilities:")
272
- for cap in rec.matched_capabilities[:5]:
273
- print(f" - {cap}")
274
- if len(rec.matched_capabilities) > 5:
275
- remaining = len(rec.matched_capabilities) - 5
276
- print(f" ... and {remaining} more")
277
- print()
278
-
279
- print("\nNext Steps:")
280
- print(" 1. Review the recommendations and their reasoning")
281
- print(" 2. Deploy agents with: claude-mpm auto-configure")
282
- print(" 3. Or preview deployment with: claude-mpm auto-configure --preview")
283
-
284
- return CommandResult.success_result()
285
-
286
- def _output_json(self, recommendations, analysis) -> CommandResult:
287
- """Output recommendations as JSON."""
288
- output = {
289
- "project_path": analysis.project_path,
290
- "recommendations": [
291
- {
292
- "agent_id": rec.agent_id,
293
- "confidence": rec.confidence,
294
- "priority": rec.priority,
295
- "reasoning": rec.reasoning,
296
- "matched_capabilities": rec.matched_capabilities,
297
- "requirements": rec.requirements,
298
- }
299
- for rec in recommendations
300
- ],
301
- "toolchain_summary": {
302
- "languages": len(analysis.languages),
303
- "frameworks": len(analysis.frameworks),
304
- "deployment_targets": len(analysis.deployment_targets),
305
- },
306
- }
307
-
308
- print(json.dumps(output, indent=2))
309
- return CommandResult.success_result(data=output)
@@ -1,278 +0,0 @@
1
- ---
2
- namespace: mpm/agents
3
- command: auto-configure
4
- aliases: [mpm-agents-auto-configure]
5
- migration_target: /mpm/agents:auto-configure
6
- category: agents
7
- deprecated_aliases: [mpm-auto-configure]
8
- description: Automatically detect project toolchain and configure appropriate agents
9
- ---
10
- # Automatically configure agents based on project detection
11
-
12
- Automatically detect your project's toolchain and configure the most appropriate agents.
13
-
14
- ## Usage
15
-
16
- ```
17
- /mpm-auto-configure [options]
18
- ```
19
-
20
- ## Description
21
-
22
- This command provides intelligent auto-configuration that:
23
- 1. Scans your project to detect programming languages, frameworks, and tools
24
- 2. Recommends the most appropriate agents for your stack
25
- 3. Optionally deploys the recommended agents with confirmation
26
-
27
- This is the fastest way to get started with Claude MPM in any project!
28
-
29
- ## Options
30
-
31
- - `--preview` - Show what would be configured without making any changes
32
- - `--yes` - Automatically apply recommendations without prompting
33
- - `--force` - Force reconfiguration even if agents are already deployed
34
-
35
- ## Implementation
36
-
37
- When you run `/mpm-auto-configure`, the PM will:
38
-
39
- 1. **Detect Your Stack**:
40
- - Scan for package.json, requirements.txt, Cargo.toml, go.mod, etc.
41
- - Identify frameworks (FastAPI, Next.js, React, Express, etc.)
42
- - Detect testing tools (pytest, Jest, Playwright, etc.)
43
- - Find build tools and deployment configurations
44
-
45
- 2. **Recommend Agents**:
46
- - **Essential agents**: Required for your primary stack
47
- - **Recommended agents**: Complementary agents for full functionality
48
- - **Optional agents**: Specialized agents for detected tools
49
-
50
- 3. **Deploy Agents** (with confirmation):
51
- - Show what will be deployed
52
- - Request confirmation (unless --yes is used)
53
- - Deploy agents to your project
54
- - Verify deployment success
55
-
56
- ## Examples
57
-
58
- ### Preview Mode (Recommended First Step)
59
- ```
60
- /mpm-auto-configure --preview
61
- ```
62
- Shows what would be configured without making changes. Great for understanding recommendations before applying.
63
-
64
- ### Interactive Configuration
65
- ```
66
- /mpm-auto-configure
67
- ```
68
- Detect, recommend, and prompt for confirmation before deploying.
69
-
70
- ### Automatic Configuration
71
- ```
72
- /mpm-auto-configure --yes
73
- ```
74
- Automatically apply all recommendations without prompting. Best for quick setup.
75
-
76
- ### Force Reconfiguration
77
- ```
78
- /mpm-auto-configure --force
79
- ```
80
- Reconfigure agents even if some are already deployed. Useful for stack changes.
81
-
82
- ## Expected Output
83
-
84
- ```
85
- 🤖 Auto-Configuration for Claude MPM
86
- =====================================
87
-
88
- Step 1: Detecting Project Stack
89
- --------------------------------
90
- ✓ Detected Python 3.11
91
- ✓ Detected FastAPI 0.104.0
92
- ✓ Detected pytest 7.4.0
93
- ✓ Detected Docker configuration
94
- ✓ Detected Vercel deployment
95
-
96
- Step 2: Agent Recommendations
97
- ------------------------------
98
- Essential Agents (3):
99
- ✓ fastapi-engineer - FastAPI framework detected
100
- ✓ python-engineer - Python project support
101
- ✓ api-qa - API testing and validation
102
-
103
- Recommended Agents (2):
104
- ○ docker-ops - Docker configuration found
105
- ○ vercel-ops - Vercel deployment detected
106
-
107
- Optional Agents (1):
108
- ○ playwright-qa - Browser testing capability
109
-
110
- Step 3: Deploy Agents
111
- ---------------------
112
- Deploy 5 agents? (y/n): y
113
-
114
- Deploying agents...
115
- ✓ fastapi-engineer deployed
116
- ✓ python-engineer deployed
117
- ✓ api-qa deployed
118
- ✓ docker-ops deployed
119
- ✓ vercel-ops deployed
120
-
121
- 🎉 Auto-configuration complete!
122
- 5 agents deployed successfully.
123
-
124
- Next steps:
125
- - Run /mpm-agents to see your deployed agents
126
- - Start working with specialized agents for your stack
127
- - Use /mpm-help for more information
128
- ```
129
-
130
- ## What Gets Detected
131
-
132
- ### Languages
133
- - Python (CPython, PyPy)
134
- - JavaScript/TypeScript (Node.js, Deno, Bun)
135
- - Rust
136
- - Go
137
- - Java
138
-
139
- ### Python Frameworks
140
- - FastAPI
141
- - Flask
142
- - Django
143
- - Starlette
144
- - Pyramid
145
-
146
- ### JavaScript/TypeScript Frameworks
147
- - Next.js
148
- - React
149
- - Vue
150
- - Svelte
151
- - Angular
152
- - Express
153
- - Nest.js
154
- - Fastify
155
-
156
- ### Testing Tools
157
- - pytest (Python)
158
- - unittest (Python)
159
- - Jest (JavaScript)
160
- - Vitest (JavaScript)
161
- - Playwright (Browser)
162
- - Cypress (Browser)
163
-
164
- ### Build Tools
165
- - Vite
166
- - Webpack
167
- - Rollup
168
- - esbuild
169
- - Turbopack
170
-
171
- ### Deployment Platforms
172
- - Vercel
173
- - Railway
174
- - Docker
175
- - PM2
176
- - Kubernetes
177
-
178
- ## Agent Mapping Examples
179
-
180
- ### Python + FastAPI
181
- **Essential:**
182
- - fastapi-engineer
183
- - python-engineer
184
- - api-qa
185
-
186
- **Recommended:**
187
- - docker-ops (if Docker detected)
188
- - vercel-ops (if Vercel detected)
189
-
190
- ### Next.js + React
191
- **Essential:**
192
- - nextjs-engineer
193
- - react-engineer
194
- - web-qa
195
-
196
- **Recommended:**
197
- - playwright-qa (if Playwright detected)
198
- - vercel-ops (if Vercel detected)
199
-
200
- ### Full-Stack (FastAPI + React)
201
- **Essential:**
202
- - fastapi-engineer
203
- - python-engineer
204
- - react-engineer
205
- - api-qa
206
- - web-qa
207
-
208
- **Recommended:**
209
- - playwright-qa
210
- - docker-ops
211
- - local-ops-agent
212
-
213
- ## Default Configuration Fallback
214
-
215
- When auto-configuration cannot detect your project's toolchain (e.g., a new or uncommon language/framework), it automatically falls back to a sensible set of default general-purpose agents instead of leaving your project unconfigured.
216
-
217
- ### When Defaults are Applied
218
-
219
- Default agents are deployed when:
220
- - Primary language is detected as "Unknown"
221
- - No specific framework or toolchain can be identified
222
- - No agent recommendations can be generated from detected technologies
223
-
224
- ### Default Agents
225
-
226
- The following general-purpose agents are recommended with moderate confidence (0.7):
227
-
228
- - **engineer**: General-purpose engineer for code implementation
229
- - **research**: Code exploration and analysis
230
- - **qa**: Testing and quality assurance
231
- - **ops**: Infrastructure and deployment operations
232
- - **documentation**: Documentation and technical writing
233
-
234
- All default recommendations will be marked with `is_default: True` in the metadata.
235
-
236
- ### Disabling Default Fallback
237
-
238
- To disable the default configuration fallback, edit `.claude-mpm/config/agent_capabilities.yaml`:
239
-
240
- ```yaml
241
- default_configuration:
242
- enabled: false # Disable default fallback
243
- ```
244
-
245
- When disabled, auto-configuration will recommend zero agents if the toolchain cannot be detected.
246
-
247
- ### Customizing Defaults
248
-
249
- You can customize which agents are deployed by default by editing the `default_configuration.agents` section in `.claude-mpm/config/agent_capabilities.yaml`:
250
-
251
- ```yaml
252
- default_configuration:
253
- enabled: true
254
- min_confidence: 0.7 # Confidence score for default recommendations
255
- agents:
256
- - agent_id: engineer
257
- reasoning: "General-purpose engineer for code implementation"
258
- priority: 1
259
- - agent_id: research
260
- reasoning: "Code exploration and analysis"
261
- priority: 2
262
- # Add or remove agents as needed
263
- ```
264
-
265
- ## Tips
266
-
267
- 1. **Start with preview**: Always run with `--preview` first to see recommendations
268
- 2. **Review carefully**: Check that detected stack matches your project
269
- 3. **Customize later**: You can always deploy/remove agents manually after auto-config
270
- 4. **Re-run after changes**: Run again with `--force` if you add new frameworks
271
- 5. **Complementary commands**: Use `/mpm-agents-detect` and `/mpm-agents-recommend` for more details
272
-
273
- ## Related Commands
274
-
275
- - `/mpm-agents-detect` - Just show detected toolchain
276
- - `/mpm-agents-recommend` - Show recommendations without deploying
277
- - `/mpm-agents` - Manage agents manually
278
- - `/mpm-help agents` - Learn about manual agent management