claude-mpm 4.13.1__py3-none-any.whl → 4.14.0__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/PM_INSTRUCTIONS.md +68 -0
- claude_mpm/cli/__init__.py +10 -0
- claude_mpm/cli/commands/local_deploy.py +536 -0
- claude_mpm/cli/parsers/base_parser.py +7 -0
- claude_mpm/cli/parsers/local_deploy_parser.py +227 -0
- claude_mpm/commands/mpm-agents-detect.md +168 -0
- claude_mpm/commands/mpm-agents-recommend.md +214 -0
- claude_mpm/commands/mpm-agents.md +75 -1
- claude_mpm/commands/mpm-auto-configure.md +217 -0
- claude_mpm/commands/mpm-help.md +160 -0
- claude_mpm/config/model_config.py +428 -0
- claude_mpm/core/interactive_session.py +3 -0
- claude_mpm/services/core/interfaces/__init__.py +74 -2
- claude_mpm/services/core/interfaces/health.py +172 -0
- claude_mpm/services/core/interfaces/model.py +281 -0
- claude_mpm/services/core/interfaces/process.py +372 -0
- claude_mpm/services/core/interfaces/restart.py +307 -0
- claude_mpm/services/core/interfaces/stability.py +260 -0
- claude_mpm/services/core/models/__init__.py +35 -0
- claude_mpm/services/core/models/health.py +189 -0
- claude_mpm/services/core/models/process.py +258 -0
- claude_mpm/services/core/models/restart.py +302 -0
- claude_mpm/services/core/models/stability.py +264 -0
- claude_mpm/services/local_ops/__init__.py +163 -0
- claude_mpm/services/local_ops/crash_detector.py +257 -0
- claude_mpm/services/local_ops/health_checks/__init__.py +28 -0
- claude_mpm/services/local_ops/health_checks/http_check.py +223 -0
- claude_mpm/services/local_ops/health_checks/process_check.py +235 -0
- claude_mpm/services/local_ops/health_checks/resource_check.py +254 -0
- claude_mpm/services/local_ops/health_manager.py +430 -0
- claude_mpm/services/local_ops/log_monitor.py +396 -0
- claude_mpm/services/local_ops/memory_leak_detector.py +294 -0
- claude_mpm/services/local_ops/process_manager.py +595 -0
- claude_mpm/services/local_ops/resource_monitor.py +331 -0
- claude_mpm/services/local_ops/restart_manager.py +401 -0
- claude_mpm/services/local_ops/restart_policy.py +387 -0
- claude_mpm/services/local_ops/state_manager.py +371 -0
- claude_mpm/services/local_ops/unified_manager.py +600 -0
- claude_mpm/services/model/__init__.py +147 -0
- claude_mpm/services/model/base_provider.py +365 -0
- claude_mpm/services/model/claude_provider.py +412 -0
- claude_mpm/services/model/model_router.py +453 -0
- claude_mpm/services/model/ollama_provider.py +415 -0
- {claude_mpm-4.13.1.dist-info → claude_mpm-4.14.0.dist-info}/METADATA +1 -1
- {claude_mpm-4.13.1.dist-info → claude_mpm-4.14.0.dist-info}/RECORD +50 -15
- {claude_mpm-4.13.1.dist-info → claude_mpm-4.14.0.dist-info}/WHEEL +0 -0
- {claude_mpm-4.13.1.dist-info → claude_mpm-4.14.0.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.13.1.dist-info → claude_mpm-4.14.0.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.13.1.dist-info → claude_mpm-4.14.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Local Deploy parser module for claude-mpm CLI.
|
|
3
|
+
|
|
4
|
+
WHY: Provides argument parsing for local deployment management commands.
|
|
5
|
+
Extracted from the monolithic parser.py for better organization.
|
|
6
|
+
|
|
7
|
+
DESIGN DECISION: Supports multiple subcommands (start, stop, restart, status, etc.)
|
|
8
|
+
with command-specific arguments for comprehensive process management.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def add_local_deploy_arguments(subparsers) -> None:
|
|
15
|
+
"""
|
|
16
|
+
Add local-deploy command and its subcommands to the parser.
|
|
17
|
+
|
|
18
|
+
WHY: Provides a comprehensive CLI for managing local development deployments
|
|
19
|
+
with process monitoring, health checks, and auto-restart capabilities.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
subparsers: The subparsers object to add commands to
|
|
23
|
+
"""
|
|
24
|
+
# Main local-deploy command
|
|
25
|
+
local_deploy_parser = subparsers.add_parser(
|
|
26
|
+
"local-deploy",
|
|
27
|
+
help="Manage local development deployments with process monitoring",
|
|
28
|
+
description=(
|
|
29
|
+
"Manage local development deployments with comprehensive process management, "
|
|
30
|
+
"health monitoring, and auto-restart capabilities."
|
|
31
|
+
),
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
# Create subparsers for local-deploy subcommands
|
|
35
|
+
local_deploy_subparsers = local_deploy_parser.add_subparsers(
|
|
36
|
+
dest="local_deploy_command",
|
|
37
|
+
help="Local deployment commands",
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
# ===== START command =====
|
|
41
|
+
start_parser = local_deploy_subparsers.add_parser(
|
|
42
|
+
"start",
|
|
43
|
+
help="Start a new local deployment",
|
|
44
|
+
description="Start a new local deployment with process monitoring and optional auto-restart",
|
|
45
|
+
)
|
|
46
|
+
start_parser.add_argument(
|
|
47
|
+
"--command",
|
|
48
|
+
"-c",
|
|
49
|
+
required=True,
|
|
50
|
+
help="Command to execute (e.g., 'npm run dev' or 'python manage.py runserver')",
|
|
51
|
+
)
|
|
52
|
+
start_parser.add_argument(
|
|
53
|
+
"--working-directory",
|
|
54
|
+
"-d",
|
|
55
|
+
type=Path,
|
|
56
|
+
help="Working directory for the process (default: current directory)",
|
|
57
|
+
)
|
|
58
|
+
start_parser.add_argument(
|
|
59
|
+
"--port",
|
|
60
|
+
"-p",
|
|
61
|
+
type=int,
|
|
62
|
+
help="Port number for the deployment",
|
|
63
|
+
)
|
|
64
|
+
start_parser.add_argument(
|
|
65
|
+
"--auto-find-port",
|
|
66
|
+
action="store_true",
|
|
67
|
+
default=True,
|
|
68
|
+
help="Automatically find alternative port if specified port is unavailable (default: enabled)",
|
|
69
|
+
)
|
|
70
|
+
start_parser.add_argument(
|
|
71
|
+
"--no-auto-find-port",
|
|
72
|
+
action="store_false",
|
|
73
|
+
dest="auto_find_port",
|
|
74
|
+
help="Disable automatic port finding",
|
|
75
|
+
)
|
|
76
|
+
start_parser.add_argument(
|
|
77
|
+
"--auto-restart",
|
|
78
|
+
action="store_true",
|
|
79
|
+
help="Enable automatic restart on crashes",
|
|
80
|
+
)
|
|
81
|
+
start_parser.add_argument(
|
|
82
|
+
"--log-file",
|
|
83
|
+
type=Path,
|
|
84
|
+
help="Path to log file for monitoring error patterns",
|
|
85
|
+
)
|
|
86
|
+
start_parser.add_argument(
|
|
87
|
+
"--env",
|
|
88
|
+
"-e",
|
|
89
|
+
action="append",
|
|
90
|
+
help="Environment variables in KEY=VALUE format (can be specified multiple times)",
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# ===== STOP command =====
|
|
94
|
+
stop_parser = local_deploy_subparsers.add_parser(
|
|
95
|
+
"stop",
|
|
96
|
+
help="Stop a running deployment",
|
|
97
|
+
description="Stop a running deployment with graceful shutdown",
|
|
98
|
+
)
|
|
99
|
+
stop_parser.add_argument(
|
|
100
|
+
"deployment_id",
|
|
101
|
+
help="Deployment ID to stop",
|
|
102
|
+
)
|
|
103
|
+
stop_parser.add_argument(
|
|
104
|
+
"--timeout",
|
|
105
|
+
"-t",
|
|
106
|
+
type=int,
|
|
107
|
+
default=10,
|
|
108
|
+
help="Timeout in seconds for graceful shutdown (default: 10)",
|
|
109
|
+
)
|
|
110
|
+
stop_parser.add_argument(
|
|
111
|
+
"--force",
|
|
112
|
+
"-f",
|
|
113
|
+
action="store_true",
|
|
114
|
+
help="Force kill immediately without graceful shutdown",
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
# ===== RESTART command =====
|
|
118
|
+
restart_parser = local_deploy_subparsers.add_parser(
|
|
119
|
+
"restart",
|
|
120
|
+
help="Restart a deployment",
|
|
121
|
+
description="Restart a deployment with the same configuration",
|
|
122
|
+
)
|
|
123
|
+
restart_parser.add_argument(
|
|
124
|
+
"deployment_id",
|
|
125
|
+
help="Deployment ID to restart",
|
|
126
|
+
)
|
|
127
|
+
restart_parser.add_argument(
|
|
128
|
+
"--timeout",
|
|
129
|
+
"-t",
|
|
130
|
+
type=int,
|
|
131
|
+
default=10,
|
|
132
|
+
help="Timeout in seconds for graceful shutdown (default: 10)",
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
# ===== STATUS command =====
|
|
136
|
+
status_parser = local_deploy_subparsers.add_parser(
|
|
137
|
+
"status",
|
|
138
|
+
help="Show comprehensive deployment status",
|
|
139
|
+
description="Show comprehensive status including process info, health, and restart history",
|
|
140
|
+
)
|
|
141
|
+
status_parser.add_argument(
|
|
142
|
+
"deployment_id",
|
|
143
|
+
help="Deployment ID to check",
|
|
144
|
+
)
|
|
145
|
+
status_parser.add_argument(
|
|
146
|
+
"--json",
|
|
147
|
+
action="store_true",
|
|
148
|
+
help="Output status in JSON format",
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
# ===== HEALTH command =====
|
|
152
|
+
health_parser = local_deploy_subparsers.add_parser(
|
|
153
|
+
"health",
|
|
154
|
+
help="Show health status",
|
|
155
|
+
description="Show health check status including HTTP, process, and resource checks",
|
|
156
|
+
)
|
|
157
|
+
health_parser.add_argument(
|
|
158
|
+
"deployment_id",
|
|
159
|
+
help="Deployment ID to check",
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
# ===== LIST command =====
|
|
163
|
+
list_parser = local_deploy_subparsers.add_parser(
|
|
164
|
+
"list",
|
|
165
|
+
help="List all deployments",
|
|
166
|
+
description="List all local deployments with their status",
|
|
167
|
+
)
|
|
168
|
+
list_parser.add_argument(
|
|
169
|
+
"--status",
|
|
170
|
+
"-s",
|
|
171
|
+
choices=["running", "stopped", "crashed", "stopping"],
|
|
172
|
+
help="Filter deployments by status",
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
# ===== MONITOR command =====
|
|
176
|
+
monitor_parser = local_deploy_subparsers.add_parser(
|
|
177
|
+
"monitor",
|
|
178
|
+
help="Live monitoring dashboard",
|
|
179
|
+
description="Display live monitoring dashboard for a deployment",
|
|
180
|
+
)
|
|
181
|
+
monitor_parser.add_argument(
|
|
182
|
+
"deployment_id",
|
|
183
|
+
help="Deployment ID to monitor",
|
|
184
|
+
)
|
|
185
|
+
monitor_parser.add_argument(
|
|
186
|
+
"--refresh",
|
|
187
|
+
"-r",
|
|
188
|
+
type=int,
|
|
189
|
+
default=2,
|
|
190
|
+
help="Refresh interval in seconds (default: 2)",
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
# ===== HISTORY command =====
|
|
194
|
+
history_parser = local_deploy_subparsers.add_parser(
|
|
195
|
+
"history",
|
|
196
|
+
help="Show restart history",
|
|
197
|
+
description="Show restart history and statistics for a deployment",
|
|
198
|
+
)
|
|
199
|
+
history_parser.add_argument(
|
|
200
|
+
"deployment_id",
|
|
201
|
+
help="Deployment ID to check",
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
# ===== ENABLE-AUTO-RESTART command =====
|
|
205
|
+
enable_auto_restart_parser = local_deploy_subparsers.add_parser(
|
|
206
|
+
"enable-auto-restart",
|
|
207
|
+
help="Enable auto-restart for a deployment",
|
|
208
|
+
description="Enable automatic restart on crashes for a deployment",
|
|
209
|
+
)
|
|
210
|
+
enable_auto_restart_parser.add_argument(
|
|
211
|
+
"deployment_id",
|
|
212
|
+
help="Deployment ID to enable auto-restart for",
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
# ===== DISABLE-AUTO-RESTART command =====
|
|
216
|
+
disable_auto_restart_parser = local_deploy_subparsers.add_parser(
|
|
217
|
+
"disable-auto-restart",
|
|
218
|
+
help="Disable auto-restart for a deployment",
|
|
219
|
+
description="Disable automatic restart on crashes for a deployment",
|
|
220
|
+
)
|
|
221
|
+
disable_auto_restart_parser.add_argument(
|
|
222
|
+
"deployment_id",
|
|
223
|
+
help="Deployment ID to disable auto-restart for",
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
__all__ = ["add_local_deploy_arguments"]
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Detect project toolchain and frameworks
|
|
2
|
+
|
|
3
|
+
Scan your project to detect programming languages, frameworks, tools, and configurations.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/mpm-agents-detect
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
This command scans your project directory to automatically detect:
|
|
14
|
+
- Programming languages and their versions
|
|
15
|
+
- Web frameworks and libraries
|
|
16
|
+
- Testing tools and frameworks
|
|
17
|
+
- Build tools and bundlers
|
|
18
|
+
- Package managers
|
|
19
|
+
- Deployment configurations
|
|
20
|
+
|
|
21
|
+
This is useful for understanding what Claude MPM can detect in your project before running auto-configuration.
|
|
22
|
+
|
|
23
|
+
## Implementation
|
|
24
|
+
|
|
25
|
+
When you run `/mpm-agents-detect`, the PM will execute:
|
|
26
|
+
```bash
|
|
27
|
+
claude-mpm agents detect
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This performs a comprehensive scan of your project looking for:
|
|
31
|
+
- Package manifests (package.json, requirements.txt, Cargo.toml, go.mod, pom.xml)
|
|
32
|
+
- Framework-specific files (next.config.js, fastapi imports, etc.)
|
|
33
|
+
- Test configurations (pytest.ini, jest.config.js, playwright.config.ts)
|
|
34
|
+
- Build configurations (vite.config.js, webpack.config.js, tsconfig.json)
|
|
35
|
+
- Deployment files (Dockerfile, vercel.json, railway.json)
|
|
36
|
+
|
|
37
|
+
## Expected Output
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
🔍 Project Toolchain Detection
|
|
41
|
+
================================
|
|
42
|
+
|
|
43
|
+
Languages:
|
|
44
|
+
✓ Python 3.11.5
|
|
45
|
+
✓ Node.js 20.10.0
|
|
46
|
+
✓ TypeScript 5.3.2
|
|
47
|
+
|
|
48
|
+
Frameworks:
|
|
49
|
+
✓ FastAPI 0.104.0
|
|
50
|
+
✓ React 18.2.0
|
|
51
|
+
✓ Next.js 14.0.4
|
|
52
|
+
|
|
53
|
+
Testing:
|
|
54
|
+
✓ pytest 7.4.3
|
|
55
|
+
✓ Jest 29.7.0
|
|
56
|
+
✓ Playwright 1.40.0
|
|
57
|
+
|
|
58
|
+
Build Tools:
|
|
59
|
+
✓ Vite 5.0.0
|
|
60
|
+
✓ TypeScript Compiler
|
|
61
|
+
|
|
62
|
+
Package Managers:
|
|
63
|
+
✓ poetry (Python)
|
|
64
|
+
✓ npm (Node.js)
|
|
65
|
+
|
|
66
|
+
Deployment:
|
|
67
|
+
✓ Docker (Dockerfile found)
|
|
68
|
+
✓ Vercel (vercel.json found)
|
|
69
|
+
✓ PM2 (ecosystem.config.js found)
|
|
70
|
+
|
|
71
|
+
Configuration Files Detected:
|
|
72
|
+
- pyproject.toml
|
|
73
|
+
- package.json
|
|
74
|
+
- tsconfig.json
|
|
75
|
+
- next.config.js
|
|
76
|
+
- pytest.ini
|
|
77
|
+
- jest.config.js
|
|
78
|
+
- playwright.config.ts
|
|
79
|
+
- Dockerfile
|
|
80
|
+
- vercel.json
|
|
81
|
+
|
|
82
|
+
Summary:
|
|
83
|
+
Full-stack project with Python backend (FastAPI) and
|
|
84
|
+
React/Next.js frontend, comprehensive testing setup,
|
|
85
|
+
and multiple deployment targets.
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## What Gets Detected
|
|
89
|
+
|
|
90
|
+
### Language Detection
|
|
91
|
+
- **Python**: Looks for .py files, requirements.txt, pyproject.toml, setup.py
|
|
92
|
+
- **JavaScript/TypeScript**: Looks for .js/.ts files, package.json, tsconfig.json
|
|
93
|
+
- **Rust**: Looks for Cargo.toml, .rs files
|
|
94
|
+
- **Go**: Looks for go.mod, .go files
|
|
95
|
+
- **Java**: Looks for pom.xml, build.gradle, .java files
|
|
96
|
+
|
|
97
|
+
### Framework Detection
|
|
98
|
+
**Python:**
|
|
99
|
+
- FastAPI (imports, decorator patterns)
|
|
100
|
+
- Flask (imports, app patterns)
|
|
101
|
+
- Django (settings.py, manage.py)
|
|
102
|
+
|
|
103
|
+
**JavaScript/TypeScript:**
|
|
104
|
+
- Next.js (next.config.js, pages/ or app/ directory)
|
|
105
|
+
- React (package.json dependencies, JSX usage)
|
|
106
|
+
- Vue (vue.config.js, .vue files)
|
|
107
|
+
- Express (imports, app patterns)
|
|
108
|
+
- Nest.js (nest-cli.json, decorators)
|
|
109
|
+
|
|
110
|
+
### Testing Detection
|
|
111
|
+
- pytest (pytest.ini, conftest.py)
|
|
112
|
+
- unittest (test_*.py patterns)
|
|
113
|
+
- Jest (jest.config.js)
|
|
114
|
+
- Vitest (vitest.config.js)
|
|
115
|
+
- Playwright (playwright.config.ts)
|
|
116
|
+
- Cypress (cypress.json)
|
|
117
|
+
|
|
118
|
+
### Build Tool Detection
|
|
119
|
+
- Vite (vite.config.js/ts)
|
|
120
|
+
- Webpack (webpack.config.js)
|
|
121
|
+
- Rollup (rollup.config.js)
|
|
122
|
+
- esbuild (esbuild configuration)
|
|
123
|
+
- Turbopack (next.config.js with turbopack)
|
|
124
|
+
|
|
125
|
+
### Deployment Detection
|
|
126
|
+
- Docker (Dockerfile, docker-compose.yml)
|
|
127
|
+
- Vercel (vercel.json, .vercel directory)
|
|
128
|
+
- Railway (railway.json, railway.toml)
|
|
129
|
+
- PM2 (ecosystem.config.js)
|
|
130
|
+
- Kubernetes (k8s/, kubernetes/ directories)
|
|
131
|
+
|
|
132
|
+
## Use Cases
|
|
133
|
+
|
|
134
|
+
1. **Before Auto-Configuration**: Run this to see what will be detected
|
|
135
|
+
2. **Troubleshooting**: Verify that your project setup is being recognized correctly
|
|
136
|
+
3. **Documentation**: Generate a summary of your project's tech stack
|
|
137
|
+
4. **Planning**: Understand what agents might be recommended
|
|
138
|
+
|
|
139
|
+
## Tips
|
|
140
|
+
|
|
141
|
+
1. **Run from project root**: Detection works best from your project's root directory
|
|
142
|
+
2. **Check detection accuracy**: Verify detected versions match your actual setup
|
|
143
|
+
3. **Missing detections**: If something isn't detected, you can still deploy agents manually
|
|
144
|
+
4. **Configuration files**: Detection relies on standard configuration files being present
|
|
145
|
+
|
|
146
|
+
## Common Issues
|
|
147
|
+
|
|
148
|
+
**Nothing detected?**
|
|
149
|
+
- Make sure you're in the project root directory
|
|
150
|
+
- Check that you have standard configuration files (package.json, requirements.txt, etc.)
|
|
151
|
+
- Some projects may need manual agent deployment
|
|
152
|
+
|
|
153
|
+
**Wrong versions detected?**
|
|
154
|
+
- Detection shows what's configured in manifest files
|
|
155
|
+
- Actual runtime versions may differ
|
|
156
|
+
- This doesn't affect agent functionality
|
|
157
|
+
|
|
158
|
+
**Framework not detected?**
|
|
159
|
+
- Some frameworks are harder to detect automatically
|
|
160
|
+
- You can still use auto-configure and manually select agents
|
|
161
|
+
- Or deploy specific agents manually with `/mpm-agents deploy <name>`
|
|
162
|
+
|
|
163
|
+
## Related Commands
|
|
164
|
+
|
|
165
|
+
- `/mpm-agents-recommend` - See agent recommendations based on detection
|
|
166
|
+
- `/mpm-auto-configure` - Automatically configure agents based on detection
|
|
167
|
+
- `/mpm-agents` - Manually manage agents
|
|
168
|
+
- `/mpm-help auto-configure` - Learn about auto-configuration
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Show recommended agents for detected project stack
|
|
2
|
+
|
|
3
|
+
Get intelligent agent recommendations based on your project's detected toolchain.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/mpm-agents-recommend
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
This command analyzes your detected project stack and recommends the most appropriate agents, organized by priority:
|
|
14
|
+
- **Essential agents**: Core agents required for your primary stack
|
|
15
|
+
- **Recommended agents**: Complementary agents for full functionality
|
|
16
|
+
- **Optional agents**: Specialized agents for detected tools
|
|
17
|
+
|
|
18
|
+
Each recommendation includes an explanation of why that agent is suggested.
|
|
19
|
+
|
|
20
|
+
## Implementation
|
|
21
|
+
|
|
22
|
+
When you run `/mpm-agents-recommend`, the PM will execute:
|
|
23
|
+
```bash
|
|
24
|
+
claude-mpm agents recommend
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This runs the detection phase and then applies recommendation rules to suggest the best agents for your specific technology stack.
|
|
28
|
+
|
|
29
|
+
## Expected Output
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
🤖 Agent Recommendations
|
|
33
|
+
=========================
|
|
34
|
+
|
|
35
|
+
Based on detected stack:
|
|
36
|
+
Python 3.11, FastAPI 0.104.0, pytest, Docker, Vercel
|
|
37
|
+
|
|
38
|
+
Essential Agents (Must Have):
|
|
39
|
+
✓ fastapi-engineer
|
|
40
|
+
Reason: FastAPI framework detected - specialized agent for FastAPI development
|
|
41
|
+
Capabilities: FastAPI routes, Pydantic models, async endpoints, dependency injection
|
|
42
|
+
|
|
43
|
+
✓ python-engineer
|
|
44
|
+
Reason: Python project - general Python development support
|
|
45
|
+
Capabilities: Python code, testing, debugging, package management
|
|
46
|
+
|
|
47
|
+
✓ api-qa
|
|
48
|
+
Reason: API testing for FastAPI backend
|
|
49
|
+
Capabilities: API endpoint testing, validation, load testing, contract testing
|
|
50
|
+
|
|
51
|
+
Recommended Agents (Strongly Suggested):
|
|
52
|
+
○ docker-ops
|
|
53
|
+
Reason: Docker configuration detected
|
|
54
|
+
Capabilities: Docker builds, container management, docker-compose orchestration
|
|
55
|
+
|
|
56
|
+
○ vercel-ops
|
|
57
|
+
Reason: Vercel deployment configuration found
|
|
58
|
+
Capabilities: Vercel deployments, serverless functions, domain management
|
|
59
|
+
|
|
60
|
+
○ playwright-qa
|
|
61
|
+
Reason: Comprehensive E2E testing capability
|
|
62
|
+
Capabilities: Browser automation, visual testing, API testing
|
|
63
|
+
|
|
64
|
+
Optional Agents (Nice to Have):
|
|
65
|
+
○ local-ops-agent
|
|
66
|
+
Reason: Local development and PM2 process management
|
|
67
|
+
Capabilities: Local server management, port handling, PM2 operations
|
|
68
|
+
|
|
69
|
+
○ security-agent
|
|
70
|
+
Reason: Security scanning and best practices
|
|
71
|
+
Capabilities: Dependency scanning, code security, auth patterns
|
|
72
|
+
|
|
73
|
+
Summary:
|
|
74
|
+
Recommended: 3 essential + 2 recommended = 5 agents
|
|
75
|
+
Optional: 2 additional agents for enhanced capabilities
|
|
76
|
+
|
|
77
|
+
Total recommended deployment: 5 agents
|
|
78
|
+
Maximum useful deployment: 7 agents
|
|
79
|
+
|
|
80
|
+
Next Steps:
|
|
81
|
+
1. Review recommendations above
|
|
82
|
+
2. Run '/mpm-auto-configure --preview' to see deployment plan
|
|
83
|
+
3. Run '/mpm-auto-configure' to deploy recommended agents
|
|
84
|
+
4. Or deploy individually: '/mpm-agents deploy <agent-name>'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Recommendation Logic
|
|
88
|
+
|
|
89
|
+
### Python Projects
|
|
90
|
+
|
|
91
|
+
**If FastAPI detected:**
|
|
92
|
+
- Essential: fastapi-engineer, python-engineer, api-qa
|
|
93
|
+
- Recommended: docker-ops (if Docker), vercel-ops (if Vercel)
|
|
94
|
+
|
|
95
|
+
**If Flask detected:**
|
|
96
|
+
- Essential: flask-engineer, python-engineer, api-qa
|
|
97
|
+
- Recommended: docker-ops (if Docker)
|
|
98
|
+
|
|
99
|
+
**If Django detected:**
|
|
100
|
+
- Essential: django-engineer, python-engineer, api-qa
|
|
101
|
+
- Recommended: docker-ops (if Docker)
|
|
102
|
+
|
|
103
|
+
**If pytest detected:**
|
|
104
|
+
- Add to recommended: api-qa, playwright-qa
|
|
105
|
+
|
|
106
|
+
### JavaScript/TypeScript Projects
|
|
107
|
+
|
|
108
|
+
**If Next.js detected:**
|
|
109
|
+
- Essential: nextjs-engineer, react-engineer, web-qa
|
|
110
|
+
- Recommended: playwright-qa, vercel-ops (if Vercel)
|
|
111
|
+
|
|
112
|
+
**If React detected (without Next.js):**
|
|
113
|
+
- Essential: react-engineer, web-qa
|
|
114
|
+
- Recommended: playwright-qa
|
|
115
|
+
|
|
116
|
+
**If Vue detected:**
|
|
117
|
+
- Essential: vue-engineer, web-qa
|
|
118
|
+
- Recommended: playwright-qa
|
|
119
|
+
|
|
120
|
+
**If Express detected:**
|
|
121
|
+
- Essential: node-engineer, api-qa
|
|
122
|
+
- Recommended: docker-ops (if Docker)
|
|
123
|
+
|
|
124
|
+
**If Nest.js detected:**
|
|
125
|
+
- Essential: nestjs-engineer, node-engineer, api-qa
|
|
126
|
+
- Recommended: docker-ops (if Docker)
|
|
127
|
+
|
|
128
|
+
### Full-Stack Projects
|
|
129
|
+
|
|
130
|
+
**Python backend + React frontend:**
|
|
131
|
+
- Essential: fastapi-engineer (or flask-engineer), python-engineer, react-engineer, api-qa, web-qa
|
|
132
|
+
- Recommended: playwright-qa, docker-ops, local-ops-agent
|
|
133
|
+
|
|
134
|
+
**Node.js backend + React frontend:**
|
|
135
|
+
- Essential: node-engineer, react-engineer, api-qa, web-qa
|
|
136
|
+
- Recommended: playwright-qa, docker-ops
|
|
137
|
+
|
|
138
|
+
### Testing-Focused Projects
|
|
139
|
+
|
|
140
|
+
**If Playwright detected:**
|
|
141
|
+
- Add to recommended: playwright-qa
|
|
142
|
+
|
|
143
|
+
**If Jest/Vitest detected:**
|
|
144
|
+
- Ensure web-qa or api-qa in recommended
|
|
145
|
+
|
|
146
|
+
### Deployment-Focused Projects
|
|
147
|
+
|
|
148
|
+
**If Vercel detected:**
|
|
149
|
+
- Add to recommended: vercel-ops
|
|
150
|
+
|
|
151
|
+
**If Railway detected:**
|
|
152
|
+
- Add to recommended: railway-ops
|
|
153
|
+
|
|
154
|
+
**If Docker detected:**
|
|
155
|
+
- Add to recommended: docker-ops
|
|
156
|
+
|
|
157
|
+
**If PM2 detected:**
|
|
158
|
+
- Add to recommended: local-ops-agent
|
|
159
|
+
|
|
160
|
+
## Agent Descriptions
|
|
161
|
+
|
|
162
|
+
### Backend Specialists
|
|
163
|
+
- **fastapi-engineer**: FastAPI expert - routes, Pydantic, async, websockets
|
|
164
|
+
- **flask-engineer**: Flask expert - blueprints, extensions, templates
|
|
165
|
+
- **django-engineer**: Django expert - models, views, ORM, admin
|
|
166
|
+
- **node-engineer**: Node.js expert - Express, async, streams
|
|
167
|
+
- **nestjs-engineer**: NestJS expert - modules, decorators, DI
|
|
168
|
+
|
|
169
|
+
### Frontend Specialists
|
|
170
|
+
- **nextjs-engineer**: Next.js expert - app router, server components, SSR
|
|
171
|
+
- **react-engineer**: React expert - hooks, state, components
|
|
172
|
+
- **vue-engineer**: Vue expert - composition API, components
|
|
173
|
+
|
|
174
|
+
### QA Specialists
|
|
175
|
+
- **api-qa**: API testing expert - REST, GraphQL, validation
|
|
176
|
+
- **web-qa**: Web testing expert - fetch, integration, E2E
|
|
177
|
+
- **playwright-qa**: Browser automation expert - UI testing, visual regression
|
|
178
|
+
|
|
179
|
+
### Ops Specialists
|
|
180
|
+
- **docker-ops**: Docker expert - builds, compose, containers
|
|
181
|
+
- **vercel-ops**: Vercel deployment expert - serverless, edge
|
|
182
|
+
- **railway-ops**: Railway deployment expert
|
|
183
|
+
- **local-ops-agent**: Local development expert - PM2, ports, processes
|
|
184
|
+
|
|
185
|
+
## Use Cases
|
|
186
|
+
|
|
187
|
+
1. **Planning**: Understand what agents you should deploy before starting work
|
|
188
|
+
2. **Validation**: Verify that auto-configuration will suggest the right agents
|
|
189
|
+
3. **Learning**: Discover what capabilities are available for your stack
|
|
190
|
+
4. **Optimization**: Find additional agents that could enhance your workflow
|
|
191
|
+
|
|
192
|
+
## Tips
|
|
193
|
+
|
|
194
|
+
1. **Start here**: Run this before `/mpm-auto-configure` to preview recommendations
|
|
195
|
+
2. **Essential vs Optional**: Focus on essential agents first, add others as needed
|
|
196
|
+
3. **Stack-specific**: Recommendations are tailored to YOUR detected stack
|
|
197
|
+
4. **Flexible**: You can always deploy additional agents later or skip some
|
|
198
|
+
5. **Explanations**: Pay attention to the "Reason" for each recommendation
|
|
199
|
+
|
|
200
|
+
## Customizing Recommendations
|
|
201
|
+
|
|
202
|
+
After seeing recommendations, you can:
|
|
203
|
+
1. **Accept all**: Run `/mpm-auto-configure` to deploy all recommended agents
|
|
204
|
+
2. **Pick and choose**: Deploy specific agents with `/mpm-agents deploy <name>`
|
|
205
|
+
3. **Skip optional**: Deploy only essential and recommended agents
|
|
206
|
+
4. **Add more**: Deploy additional agents not in recommendations
|
|
207
|
+
|
|
208
|
+
## Related Commands
|
|
209
|
+
|
|
210
|
+
- `/mpm-agents-detect` - See what was detected in your project
|
|
211
|
+
- `/mpm-auto-configure` - Automatically deploy recommended agents
|
|
212
|
+
- `/mpm-agents deploy <name>` - Deploy specific agents manually
|
|
213
|
+
- `/mpm-agents` - View all available and deployed agents
|
|
214
|
+
- `/mpm-help agents` - Learn more about agent management
|
|
@@ -45,4 +45,78 @@ This will display all deployed agents that are currently available for use.
|
|
|
45
45
|
Alternatively, you can use these variations:
|
|
46
46
|
- `claude-mpm agents list --system` - Show system agents
|
|
47
47
|
- `claude-mpm agents list --by-tier` - Group agents by precedence tier
|
|
48
|
-
- `claude-mpm agents list --all` - Show all agents including undeployed
|
|
48
|
+
- `claude-mpm agents list --all` - Show all agents including undeployed
|
|
49
|
+
|
|
50
|
+
## Auto-Configuration Subcommands (NEW!)
|
|
51
|
+
|
|
52
|
+
### Quick Agent Setup
|
|
53
|
+
|
|
54
|
+
Claude MPM now includes intelligent auto-configuration that detects your project and recommends the right agents:
|
|
55
|
+
|
|
56
|
+
#### `agents detect`
|
|
57
|
+
Scan your project to detect toolchain and frameworks:
|
|
58
|
+
```bash
|
|
59
|
+
claude-mpm agents detect
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Shows detected:
|
|
63
|
+
- Programming languages (Python, Node.js, Rust, Go, etc.)
|
|
64
|
+
- Frameworks (FastAPI, Next.js, React, Express, etc.)
|
|
65
|
+
- Testing tools (pytest, Jest, Playwright, etc.)
|
|
66
|
+
- Build tools and package managers
|
|
67
|
+
- Deployment configurations
|
|
68
|
+
|
|
69
|
+
#### `agents recommend`
|
|
70
|
+
Get agent recommendations based on detected toolchain:
|
|
71
|
+
```bash
|
|
72
|
+
claude-mpm agents recommend
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Shows:
|
|
76
|
+
- Essential agents for your stack
|
|
77
|
+
- Recommended complementary agents
|
|
78
|
+
- Optional specialized agents
|
|
79
|
+
- Rationale for each recommendation
|
|
80
|
+
|
|
81
|
+
#### `auto-configure`
|
|
82
|
+
Automatically detect, recommend, and deploy agents:
|
|
83
|
+
```bash
|
|
84
|
+
claude-mpm auto-configure --preview # See what would be configured
|
|
85
|
+
claude-mpm auto-configure # Interactive configuration
|
|
86
|
+
claude-mpm auto-configure --yes # Auto-apply without prompts
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Example workflow:**
|
|
90
|
+
1. Run `claude-mpm agents detect` to see what's detected
|
|
91
|
+
2. Run `claude-mpm agents recommend` to see suggestions
|
|
92
|
+
3. Run `claude-mpm auto-configure` to apply configuration
|
|
93
|
+
4. Or skip straight to `claude-mpm auto-configure --yes`
|
|
94
|
+
|
|
95
|
+
### Supported Stacks
|
|
96
|
+
|
|
97
|
+
**Python:**
|
|
98
|
+
- FastAPI, Flask, Django → fastapi-engineer, python-engineer
|
|
99
|
+
- pytest, unittest → api-qa, python-qa
|
|
100
|
+
|
|
101
|
+
**JavaScript/TypeScript:**
|
|
102
|
+
- Next.js → nextjs-engineer, react-engineer
|
|
103
|
+
- React, Vue, Svelte → react-engineer, web-qa
|
|
104
|
+
- Express, Nest.js → node-engineer, api-qa
|
|
105
|
+
- Jest, Vitest, Playwright → playwright-qa, web-qa
|
|
106
|
+
|
|
107
|
+
**Full-Stack Projects:**
|
|
108
|
+
Automatically recommends both frontend and backend agents based on your complete stack.
|
|
109
|
+
|
|
110
|
+
**Deployment:**
|
|
111
|
+
- Vercel → vercel-ops
|
|
112
|
+
- Railway → railway-ops
|
|
113
|
+
- Docker → docker-ops
|
|
114
|
+
- PM2 → local-ops-agent
|
|
115
|
+
|
|
116
|
+
## Related Commands
|
|
117
|
+
|
|
118
|
+
For more information on auto-configuration:
|
|
119
|
+
- `/mpm-help auto-configure` - Detailed auto-configuration help
|
|
120
|
+
- `/mpm-agents-detect` - Run detection via slash command
|
|
121
|
+
- `/mpm-agents-recommend` - Show recommendations via slash command
|
|
122
|
+
- `/mpm-auto-configure` - Run auto-configuration via slash command
|