claude-mpm 1.1.0__py3-none-any.whl → 2.0.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.
- claude_mpm/_version.py +3 -2
- claude_mpm/agents/INSTRUCTIONS.md +117 -312
- claude_mpm/agents/agent_loader.py +184 -278
- claude_mpm/agents/base_agent.json +1 -1
- claude_mpm/agents/templates/backup/data_engineer_agent_20250726_234551.json +46 -0
- claude_mpm/agents/templates/{engineer_agent.json → backup/engineer_agent_20250726_234551.json} +1 -1
- claude_mpm/agents/templates/data_engineer.json +107 -0
- claude_mpm/agents/templates/documentation.json +106 -0
- claude_mpm/agents/templates/engineer.json +110 -0
- claude_mpm/agents/templates/ops.json +106 -0
- claude_mpm/agents/templates/qa.json +106 -0
- claude_mpm/agents/templates/research.json +107 -0
- claude_mpm/agents/templates/security.json +105 -0
- claude_mpm/agents/templates/version_control.json +103 -0
- claude_mpm/schemas/agent_schema.json +328 -0
- claude_mpm/validation/agent_validator.py +252 -125
- {claude_mpm-1.1.0.dist-info → claude_mpm-2.0.0.dist-info}/METADATA +100 -26
- {claude_mpm-1.1.0.dist-info → claude_mpm-2.0.0.dist-info}/RECORD +27 -19
- claude_mpm/agents/templates/data_engineer_agent.json +0 -46
- claude_mpm/agents/templates/update-optimized-specialized-agents.json +0 -374
- /claude_mpm/agents/templates/{documentation_agent.json → backup/documentation_agent_20250726_234551.json} +0 -0
- /claude_mpm/agents/templates/{ops_agent.json → backup/ops_agent_20250726_234551.json} +0 -0
- /claude_mpm/agents/templates/{qa_agent.json → backup/qa_agent_20250726_234551.json} +0 -0
- /claude_mpm/agents/templates/{research_agent.json → backup/research_agent_20250726_234551.json} +0 -0
- /claude_mpm/agents/templates/{security_agent.json → backup/security_agent_20250726_234551.json} +0 -0
- /claude_mpm/agents/templates/{version_control_agent.json → backup/version_control_agent_20250726_234551.json} +0 -0
- {claude_mpm-1.1.0.dist-info → claude_mpm-2.0.0.dist-info}/WHEEL +0 -0
- {claude_mpm-1.1.0.dist-info → claude_mpm-2.0.0.dist-info}/entry_points.txt +0 -0
- {claude_mpm-1.1.0.dist-info → claude_mpm-2.0.0.dist-info}/top_level.txt +0 -0
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Agent validation framework
|
|
2
|
+
Agent validation framework using JSON Schema validation.
|
|
3
3
|
|
|
4
|
-
This module provides comprehensive validation for agent configurations
|
|
5
|
-
|
|
4
|
+
This module provides comprehensive validation for agent configurations
|
|
5
|
+
using the standardized JSON schema with direct validation approach.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
+
import json
|
|
8
9
|
import logging
|
|
9
10
|
from pathlib import Path
|
|
10
|
-
from typing import Dict, List,
|
|
11
|
-
import yaml
|
|
11
|
+
from typing import Dict, List, Optional, Any, Tuple
|
|
12
12
|
from dataclasses import dataclass, field
|
|
13
|
+
from datetime import datetime
|
|
14
|
+
import jsonschema
|
|
15
|
+
from jsonschema import validate, ValidationError, Draft7Validator
|
|
13
16
|
|
|
14
17
|
logger = logging.getLogger(__name__)
|
|
15
18
|
|
|
@@ -20,156 +23,280 @@ class ValidationResult:
|
|
|
20
23
|
is_valid: bool
|
|
21
24
|
errors: List[str] = field(default_factory=list)
|
|
22
25
|
warnings: List[str] = field(default_factory=list)
|
|
23
|
-
|
|
24
|
-
applied_overrides: Dict[str, Any] = field(default_factory=dict)
|
|
26
|
+
metadata: Dict[str, Any] = field(default_factory=dict)
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
class AgentValidator:
|
|
28
|
-
"""Validates agent configurations
|
|
30
|
+
"""Validates agent configurations against JSON schema."""
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
self.
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
def __init__(self, schema_path: Optional[Path] = None):
|
|
33
|
+
"""Initialize the validator with the agent schema."""
|
|
34
|
+
if schema_path is None:
|
|
35
|
+
schema_path = Path(__file__).parent.parent / "schemas" / "agent_schema.json"
|
|
36
|
+
|
|
37
|
+
self.schema_path = schema_path
|
|
38
|
+
self.schema = self._load_schema()
|
|
39
|
+
self.validator = Draft7Validator(self.schema)
|
|
38
40
|
|
|
39
|
-
def
|
|
40
|
-
"""Load
|
|
41
|
+
def _load_schema(self) -> Dict[str, Any]:
|
|
42
|
+
"""Load the JSON schema from file."""
|
|
41
43
|
try:
|
|
42
|
-
with open(
|
|
43
|
-
|
|
44
|
-
return data.get('overrides', {})
|
|
44
|
+
with open(self.schema_path, 'r') as f:
|
|
45
|
+
return json.load(f)
|
|
45
46
|
except Exception as e:
|
|
46
|
-
logger.
|
|
47
|
-
|
|
47
|
+
logger.error(f"Failed to load schema from {self.schema_path}: {e}")
|
|
48
|
+
raise
|
|
48
49
|
|
|
49
|
-
def
|
|
50
|
-
"""
|
|
50
|
+
def validate_agent(self, agent_data: Dict[str, Any]) -> ValidationResult:
|
|
51
|
+
"""
|
|
52
|
+
Validate a single agent configuration against the schema.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
agent_data: Agent configuration dictionary
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
ValidationResult with validation status and any errors/warnings
|
|
59
|
+
"""
|
|
51
60
|
result = ValidationResult(is_valid=True)
|
|
52
61
|
|
|
53
|
-
#
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
# Perform JSON schema validation
|
|
63
|
+
try:
|
|
64
|
+
validate(instance=agent_data, schema=self.schema)
|
|
65
|
+
except ValidationError as e:
|
|
66
|
+
result.is_valid = False
|
|
67
|
+
result.errors.append(f"Schema validation error: {e.message}")
|
|
68
|
+
|
|
69
|
+
# Add path information if available
|
|
70
|
+
if e.path:
|
|
71
|
+
path = ".".join(str(p) for p in e.path)
|
|
72
|
+
result.errors.append(f"Error at path: {path}")
|
|
56
73
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
# Additional business rule validations
|
|
75
|
+
if result.is_valid:
|
|
76
|
+
self._validate_business_rules(agent_data, result)
|
|
60
77
|
|
|
61
|
-
#
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
# Validate prompt template
|
|
68
|
-
if 'prompt_template' in config and 'prompt_template' not in locked_fields:
|
|
69
|
-
template_result = self._validate_prompt_template(config['prompt_template'])
|
|
70
|
-
if not template_result[0]:
|
|
71
|
-
result.errors.extend(template_result[1])
|
|
72
|
-
result.is_valid = False
|
|
73
|
-
|
|
74
|
-
# Validate tools if present
|
|
75
|
-
if 'tools' in config:
|
|
76
|
-
tools_result = self._validate_tools(config['tools'])
|
|
77
|
-
if not tools_result[0]:
|
|
78
|
-
result.errors.extend(tools_result[1])
|
|
79
|
-
result.is_valid = False
|
|
78
|
+
# Add metadata
|
|
79
|
+
result.metadata = {
|
|
80
|
+
"validated_at": datetime.utcnow().isoformat(),
|
|
81
|
+
"schema_version": self.schema.get("version", "1.0.0"),
|
|
82
|
+
"agent_id": agent_data.get("id", "unknown")
|
|
83
|
+
}
|
|
80
84
|
|
|
81
85
|
return result
|
|
82
86
|
|
|
83
|
-
def
|
|
84
|
-
"""Apply
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
def _validate_business_rules(self, agent_data: Dict[str, Any], result: ValidationResult) -> None:
|
|
88
|
+
"""Apply additional business rule validations beyond schema."""
|
|
89
|
+
|
|
90
|
+
# Validate resource tier consistency
|
|
91
|
+
resource_tier = agent_data.get("capabilities", {}).get("resource_tier")
|
|
92
|
+
if resource_tier:
|
|
93
|
+
self._validate_resource_tier_limits(agent_data, resource_tier, result)
|
|
94
|
+
|
|
95
|
+
# Validate instruction length (double-check)
|
|
96
|
+
instructions = agent_data.get("instructions", "")
|
|
97
|
+
if len(instructions) > 8000:
|
|
98
|
+
result.errors.append(f"Instructions exceed 8000 character limit: {len(instructions)} characters")
|
|
99
|
+
result.is_valid = False
|
|
87
100
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
skip_validation = override_config.get('skip_validation', False)
|
|
101
|
+
# Validate model compatibility with tools
|
|
102
|
+
self._validate_model_tool_compatibility(agent_data, result)
|
|
91
103
|
|
|
92
|
-
#
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if override_config.get(field, False):
|
|
97
|
-
locked_fields.add(base_field)
|
|
98
|
-
elif field not in ['notes', 'skip_validation']:
|
|
99
|
-
config[field] = value
|
|
104
|
+
# Validate agent ID format (clean IDs without _agent suffix)
|
|
105
|
+
agent_id = agent_data.get("id", "")
|
|
106
|
+
if agent_id.endswith("_agent"):
|
|
107
|
+
result.warnings.append(f"Agent ID '{agent_id}' contains deprecated '_agent' suffix")
|
|
100
108
|
|
|
101
|
-
|
|
109
|
+
# Validate handoff agents exist
|
|
110
|
+
handoff_agents = agent_data.get("interactions", {}).get("handoff_agents", [])
|
|
111
|
+
for handoff_id in handoff_agents:
|
|
112
|
+
if handoff_id == agent_id:
|
|
113
|
+
result.warnings.append(f"Agent '{agent_id}' references itself in handoff_agents")
|
|
102
114
|
|
|
103
|
-
def
|
|
104
|
-
"""Validate
|
|
105
|
-
|
|
115
|
+
def _validate_resource_tier_limits(self, agent_data: Dict[str, Any], tier: str, result: ValidationResult) -> None:
|
|
116
|
+
"""Validate resource limits match the tier constraints."""
|
|
117
|
+
tier_limits = {
|
|
118
|
+
"intensive": {
|
|
119
|
+
"memory_limit": (4096, 8192),
|
|
120
|
+
"cpu_limit": (60, 100),
|
|
121
|
+
"timeout": (600, 3600)
|
|
122
|
+
},
|
|
123
|
+
"standard": {
|
|
124
|
+
"memory_limit": (2048, 4096),
|
|
125
|
+
"cpu_limit": (30, 60),
|
|
126
|
+
"timeout": (300, 1200)
|
|
127
|
+
},
|
|
128
|
+
"lightweight": {
|
|
129
|
+
"memory_limit": (512, 2048),
|
|
130
|
+
"cpu_limit": (10, 30),
|
|
131
|
+
"timeout": (30, 600)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
106
134
|
|
|
107
|
-
if
|
|
108
|
-
|
|
109
|
-
return False, errors
|
|
135
|
+
if tier not in tier_limits:
|
|
136
|
+
return
|
|
110
137
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
missing_placeholders = []
|
|
138
|
+
limits = tier_limits[tier]
|
|
139
|
+
capabilities = agent_data.get("capabilities", {})
|
|
114
140
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
141
|
+
# Check memory limit
|
|
142
|
+
memory = capabilities.get("memory_limit")
|
|
143
|
+
if memory is not None:
|
|
144
|
+
min_mem, max_mem = limits["memory_limit"]
|
|
145
|
+
if not (min_mem <= memory <= max_mem):
|
|
146
|
+
result.warnings.append(
|
|
147
|
+
f"Memory limit {memory}MB outside recommended range "
|
|
148
|
+
f"{min_mem}-{max_mem}MB for tier '{tier}'"
|
|
149
|
+
)
|
|
118
150
|
|
|
119
|
-
|
|
120
|
-
|
|
151
|
+
# Check CPU limit
|
|
152
|
+
cpu = capabilities.get("cpu_limit")
|
|
153
|
+
if cpu is not None:
|
|
154
|
+
min_cpu, max_cpu = limits["cpu_limit"]
|
|
155
|
+
if not (min_cpu <= cpu <= max_cpu):
|
|
156
|
+
result.warnings.append(
|
|
157
|
+
f"CPU limit {cpu}% outside recommended range "
|
|
158
|
+
f"{min_cpu}-{max_cpu}% for tier '{tier}'"
|
|
159
|
+
)
|
|
121
160
|
|
|
122
|
-
|
|
161
|
+
# Check timeout
|
|
162
|
+
timeout = capabilities.get("timeout")
|
|
163
|
+
if timeout is not None:
|
|
164
|
+
min_timeout, max_timeout = limits["timeout"]
|
|
165
|
+
if not (min_timeout <= timeout <= max_timeout):
|
|
166
|
+
result.warnings.append(
|
|
167
|
+
f"Timeout {timeout}s outside recommended range "
|
|
168
|
+
f"{min_timeout}-{max_timeout}s for tier '{tier}'"
|
|
169
|
+
)
|
|
123
170
|
|
|
124
|
-
def
|
|
125
|
-
"""Validate
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if not isinstance(tools, list):
|
|
129
|
-
errors.append("Tools must be a list")
|
|
130
|
-
return False, errors
|
|
171
|
+
def _validate_model_tool_compatibility(self, agent_data: Dict[str, Any], result: ValidationResult) -> None:
|
|
172
|
+
"""Validate that model and tools are compatible."""
|
|
173
|
+
model = agent_data.get("capabilities", {}).get("model", "")
|
|
174
|
+
tools = agent_data.get("capabilities", {}).get("tools", [])
|
|
131
175
|
|
|
132
|
-
#
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
176
|
+
# Haiku models shouldn't use resource-intensive tools
|
|
177
|
+
if "haiku" in model.lower():
|
|
178
|
+
intensive_tools = {"docker", "kubectl", "terraform", "aws", "gcloud", "azure"}
|
|
179
|
+
used_intensive = set(tools) & intensive_tools
|
|
180
|
+
if used_intensive:
|
|
181
|
+
result.warnings.append(
|
|
182
|
+
f"Haiku model '{model}' using resource-intensive tools: {used_intensive}"
|
|
183
|
+
)
|
|
137
184
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
185
|
+
# Network access requirement
|
|
186
|
+
network_tools = {"WebSearch", "WebFetch", "aws", "gcloud", "azure"}
|
|
187
|
+
needs_network = bool(set(tools) & network_tools)
|
|
188
|
+
has_network = agent_data.get("capabilities", {}).get("network_access", False)
|
|
141
189
|
|
|
142
|
-
|
|
190
|
+
if needs_network and not has_network:
|
|
191
|
+
result.warnings.append(
|
|
192
|
+
f"Agent uses network tools {set(tools) & network_tools} but network_access is False"
|
|
193
|
+
)
|
|
143
194
|
|
|
144
|
-
def
|
|
145
|
-
"""Validate an
|
|
146
|
-
result = ValidationResult(is_valid=True)
|
|
147
|
-
|
|
195
|
+
def validate_file(self, file_path: Path) -> ValidationResult:
|
|
196
|
+
"""Validate an agent configuration file."""
|
|
148
197
|
try:
|
|
149
|
-
with open(
|
|
150
|
-
|
|
198
|
+
with open(file_path, 'r') as f:
|
|
199
|
+
agent_data = json.load(f)
|
|
200
|
+
|
|
201
|
+
result = self.validate_agent(agent_data)
|
|
202
|
+
result.metadata["file_path"] = str(file_path)
|
|
203
|
+
return result
|
|
204
|
+
|
|
205
|
+
except json.JSONDecodeError as e:
|
|
206
|
+
result = ValidationResult(is_valid=False)
|
|
207
|
+
result.errors.append(f"Invalid JSON in {file_path}: {e}")
|
|
208
|
+
return result
|
|
151
209
|
except Exception as e:
|
|
152
|
-
result
|
|
153
|
-
result.
|
|
210
|
+
result = ValidationResult(is_valid=False)
|
|
211
|
+
result.errors.append(f"Error reading {file_path}: {e}")
|
|
154
212
|
return result
|
|
213
|
+
|
|
214
|
+
def validate_directory(self, directory: Path) -> Dict[str, ValidationResult]:
|
|
215
|
+
"""Validate all agent files in a directory."""
|
|
216
|
+
results = {}
|
|
217
|
+
|
|
218
|
+
for json_file in directory.glob("*.json"):
|
|
219
|
+
if json_file.name == "agent_schema.json":
|
|
220
|
+
continue
|
|
221
|
+
|
|
222
|
+
logger.info(f"Validating {json_file}")
|
|
223
|
+
results[json_file.name] = self.validate_file(json_file)
|
|
155
224
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
225
|
+
return results
|
|
226
|
+
|
|
227
|
+
def get_schema_info(self) -> Dict[str, Any]:
|
|
228
|
+
"""Get information about the loaded schema."""
|
|
229
|
+
return {
|
|
230
|
+
"schema_path": str(self.schema_path),
|
|
231
|
+
"schema_title": self.schema.get("title", "Unknown"),
|
|
232
|
+
"schema_description": self.schema.get("description", ""),
|
|
233
|
+
"required_fields": self.schema.get("required", []),
|
|
234
|
+
"properties": list(self.schema.get("properties", {}).keys())
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
def validate_agent_migration(old_agent: Dict[str, Any], new_agent: Dict[str, Any]) -> ValidationResult:
|
|
239
|
+
"""
|
|
240
|
+
Validate that a migrated agent maintains compatibility.
|
|
241
|
+
|
|
242
|
+
Args:
|
|
243
|
+
old_agent: Original agent configuration
|
|
244
|
+
new_agent: Migrated agent configuration
|
|
245
|
+
|
|
246
|
+
Returns:
|
|
247
|
+
ValidationResult with migration validation results
|
|
248
|
+
"""
|
|
249
|
+
result = ValidationResult(is_valid=True)
|
|
250
|
+
|
|
251
|
+
# Check that core functionality is preserved
|
|
252
|
+
old_tools = set(old_agent.get("configuration_fields", {}).get("tools", []))
|
|
253
|
+
new_tools = set(new_agent.get("capabilities", {}).get("tools", []))
|
|
254
|
+
|
|
255
|
+
if old_tools != new_tools:
|
|
256
|
+
missing = old_tools - new_tools
|
|
257
|
+
added = new_tools - old_tools
|
|
258
|
+
if missing:
|
|
259
|
+
result.warnings.append(f"Tools removed in migration: {missing}")
|
|
260
|
+
if added:
|
|
261
|
+
result.warnings.append(f"Tools added in migration: {added}")
|
|
262
|
+
|
|
263
|
+
# Check instruction preservation
|
|
264
|
+
old_instructions = old_agent.get("narrative_fields", {}).get("instructions", "")
|
|
265
|
+
new_instructions = new_agent.get("instructions", "")
|
|
266
|
+
|
|
267
|
+
if old_instructions and not new_instructions:
|
|
268
|
+
result.errors.append("Instructions lost in migration")
|
|
269
|
+
result.is_valid = False
|
|
270
|
+
elif len(old_instructions) > len(new_instructions) * 1.1: # Allow 10% reduction
|
|
271
|
+
result.warnings.append("Significant instruction content reduction in migration")
|
|
272
|
+
|
|
273
|
+
return result
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
# Convenience functions
|
|
277
|
+
def validate_agent_file(file_path: Path) -> ValidationResult:
|
|
278
|
+
"""Validate a single agent file."""
|
|
279
|
+
validator = AgentValidator()
|
|
280
|
+
return validator.validate_file(file_path)
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
def validate_all_agents(directory: Path) -> Tuple[int, int, List[str]]:
|
|
284
|
+
"""
|
|
285
|
+
Validate all agents in a directory and return summary.
|
|
286
|
+
|
|
287
|
+
Returns:
|
|
288
|
+
Tuple of (valid_count, invalid_count, error_messages)
|
|
289
|
+
"""
|
|
290
|
+
validator = AgentValidator()
|
|
291
|
+
results = validator.validate_directory(directory)
|
|
292
|
+
|
|
293
|
+
valid_count = sum(1 for r in results.values() if r.is_valid)
|
|
294
|
+
invalid_count = len(results) - valid_count
|
|
295
|
+
|
|
296
|
+
error_messages = []
|
|
297
|
+
for filename, result in results.items():
|
|
298
|
+
if not result.is_valid:
|
|
299
|
+
for error in result.errors:
|
|
300
|
+
error_messages.append(f"{filename}: {error}")
|
|
301
|
+
|
|
302
|
+
return valid_count, invalid_count, error_messages
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: claude-mpm
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: Claude Multi-agent Project Manager - Clean orchestration with ticket management
|
|
5
5
|
Home-page: https://github.com/bobmatnyc/claude-mpm
|
|
6
6
|
Author: Claude MPM Team
|
|
@@ -46,8 +46,104 @@ Dynamic: requires-python
|
|
|
46
46
|
|
|
47
47
|
> **Note**: This project is a fork of [claude-multiagent-pm](https://github.com/kfsone/claude-multiagent-pm), enhanced to integrate with [Claude Code](https://docs.anthropic.com/en/docs/claude-code) v1.0.60+'s native agent system. This integration enables seamless orchestration of Claude Code's built-in agents (research, engineer, qa, documentation, security, ops, version_control, data_engineer) through a unified project management interface.
|
|
48
48
|
|
|
49
|
+
> **⚠️ Version 2.0.0 Breaking Changes**: Agent schema has been standardized. Agent IDs no longer use the `_agent` suffix (e.g., `research_agent` → `research`). See the [migration guide](docs/user/05-migration/schema-standardization-migration.md) for details.
|
|
50
|
+
|
|
49
51
|
A framework for Claude that enables multi-agent workflows and extensible capabilities through a modular architecture.
|
|
50
52
|
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
### Why Interactive Mode?
|
|
56
|
+
**Interactive mode is significantly more performant** than non-interactive commands. It maintains context between requests and avoids the overhead of repeatedly launching Claude, making your development workflow much faster and more efficient.
|
|
57
|
+
|
|
58
|
+
### Installation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Install globally via npm (recommended)
|
|
62
|
+
npm install -g @bobmatnyc/claude-mpm
|
|
63
|
+
|
|
64
|
+
# Or use npx for one-time usage
|
|
65
|
+
npx @bobmatnyc/claude-mpm
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Three Essential Use Cases
|
|
69
|
+
|
|
70
|
+
#### 1. 🔍 **Understand Your Codebase**
|
|
71
|
+
Start with codebase exploration - perfect for onboarding or getting oriented:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Launch interactive mode
|
|
75
|
+
claude-mpm
|
|
76
|
+
|
|
77
|
+
# Then ask:
|
|
78
|
+
> Explain the codebase structure. What are the main components, how do they interact, and what architectural patterns are used?
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### 2. 🚀 **Build a New Project**
|
|
82
|
+
For greenfield development, use detailed, AI-generated prompts for best results:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
claude-mpm
|
|
86
|
+
|
|
87
|
+
# Example detailed prompt (AI-generated prompts work best):
|
|
88
|
+
> Create a modern web application with the following requirements:
|
|
89
|
+
> - Next.js 14 with TypeScript and Tailwind CSS
|
|
90
|
+
> - Authentication using NextAuth.js with GitHub provider
|
|
91
|
+
> - PostgreSQL database with Prisma ORM
|
|
92
|
+
> - User dashboard with CRUD operations for "projects"
|
|
93
|
+
> - API routes following REST conventions
|
|
94
|
+
> - Responsive design with dark/light mode toggle
|
|
95
|
+
> - Form validation using react-hook-form and zod
|
|
96
|
+
> - Include proper error handling and loading states
|
|
97
|
+
> - Set up ESLint, Prettier, and basic testing with Jest
|
|
98
|
+
> - Generate a complete project structure with all necessary files
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### 3. 🔧 **Enhance Existing Code**
|
|
102
|
+
For working on your current codebase, provide rich context:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
claude-mpm
|
|
106
|
+
|
|
107
|
+
# Example detailed enhancement prompt:
|
|
108
|
+
> I need to add real-time notifications to my existing Next.js application. Current tech stack:
|
|
109
|
+
> - Next.js 13 with app router
|
|
110
|
+
> - TypeScript
|
|
111
|
+
> - Tailwind CSS
|
|
112
|
+
> - PostgreSQL with Prisma
|
|
113
|
+
> - User authentication already implemented
|
|
114
|
+
>
|
|
115
|
+
> Requirements:
|
|
116
|
+
> - WebSocket-based real-time notifications
|
|
117
|
+
> - Toast notifications in the UI
|
|
118
|
+
> - Database table to store notification history
|
|
119
|
+
> - Mark as read/unread functionality
|
|
120
|
+
> - Different notification types (info, warning, success, error)
|
|
121
|
+
> - Admin panel to send system-wide notifications
|
|
122
|
+
> - Email fallback for offline users
|
|
123
|
+
>
|
|
124
|
+
> Please analyze my current codebase structure and implement this feature following my existing patterns and conventions.
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 💡 Pro Tips for Better Results
|
|
128
|
+
|
|
129
|
+
1. **Use AI to generate your prompts**: Ask ChatGPT or Claude to help you create detailed, specific prompts for your use case
|
|
130
|
+
2. **Provide context**: Include your tech stack, requirements, and any constraints
|
|
131
|
+
3. **Stay interactive**: Keep the conversation going to refine and iterate on solutions
|
|
132
|
+
4. **Ask for explanations**: Request explanations of architectural decisions and trade-offs
|
|
133
|
+
|
|
134
|
+
### Alternative: Non-Interactive Mode
|
|
135
|
+
For automation or simple one-off tasks:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Quick analysis
|
|
139
|
+
claude-mpm run -i "What testing frameworks are used in this project?" --non-interactive
|
|
140
|
+
|
|
141
|
+
# With subprocess orchestration for complex tasks
|
|
142
|
+
claude-mpm run --subprocess -i "Audit this codebase for security vulnerabilities" --non-interactive
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Note**: Non-interactive mode has higher overhead and is less efficient for multi-step development workflows.
|
|
146
|
+
|
|
51
147
|
|
|
52
148
|
## 📚 Documentation
|
|
53
149
|
|
|
@@ -119,9 +215,9 @@ Claude MPM provides a modular framework for extending Claude's capabilities:
|
|
|
119
215
|
|
|
120
216
|
## Installation
|
|
121
217
|
|
|
122
|
-
###
|
|
218
|
+
### Other Installation Methods
|
|
123
219
|
|
|
124
|
-
####
|
|
220
|
+
#### Using UV (Recommended - Fast)
|
|
125
221
|
UV is a lightning-fast Python package manager written in Rust, offering 10-100x speed improvements over pip.
|
|
126
222
|
|
|
127
223
|
```bash
|
|
@@ -135,7 +231,7 @@ uv pip install claude-mpm
|
|
|
135
231
|
uv pip install git+https://github.com/bobmatnyc/claude-mpm.git
|
|
136
232
|
```
|
|
137
233
|
|
|
138
|
-
####
|
|
234
|
+
#### Using pip (Traditional)
|
|
139
235
|
```bash
|
|
140
236
|
# Install from PyPI
|
|
141
237
|
pip install claude-mpm
|
|
@@ -144,13 +240,6 @@ pip install claude-mpm
|
|
|
144
240
|
pip install git+https://github.com/bobmatnyc/claude-mpm.git
|
|
145
241
|
```
|
|
146
242
|
|
|
147
|
-
#### Option 3: Using npm (Wrapper)
|
|
148
|
-
**Note**: This installs a wrapper that still requires Python. It's provided for convenience but the Python package is the primary distribution method.
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
npm install -g @bobmatnyc/claude-mpm
|
|
152
|
-
```
|
|
153
|
-
|
|
154
243
|
### From Source (Development)
|
|
155
244
|
|
|
156
245
|
```bash
|
|
@@ -218,21 +307,6 @@ Commands:
|
|
|
218
307
|
info Show framework and configuration info
|
|
219
308
|
```
|
|
220
309
|
|
|
221
|
-
## Quick Start
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
# 1. Clone and install
|
|
225
|
-
git clone https://github.com/yourusername/claude-mpm.git
|
|
226
|
-
cd claude-mpm
|
|
227
|
-
./install_dev.sh
|
|
228
|
-
source venv/bin/activate
|
|
229
|
-
|
|
230
|
-
# 2. Run interactive session
|
|
231
|
-
claude-mpm
|
|
232
|
-
|
|
233
|
-
# 3. Or run a single command
|
|
234
|
-
claude-mpm run -i "Explain the codebase structure" --non-interactive
|
|
235
|
-
```
|
|
236
310
|
|
|
237
311
|
|
|
238
312
|
## Architecture
|