claude-mpm 1.0.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 +4 -2
- claude_mpm/agents/INSTRUCTIONS.md +117 -312
- claude_mpm/agents/__init__.py +2 -2
- claude_mpm/agents/agent-template.yaml +83 -0
- claude_mpm/agents/agent_loader.py +192 -310
- claude_mpm/agents/base_agent.json +1 -1
- claude_mpm/agents/base_agent_loader.py +10 -15
- 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/cli.py +41 -47
- claude_mpm/cli_enhancements.py +297 -0
- claude_mpm/core/factories.py +1 -46
- claude_mpm/core/service_registry.py +0 -8
- claude_mpm/core/simple_runner.py +43 -0
- claude_mpm/generators/__init__.py +5 -0
- claude_mpm/generators/agent_profile_generator.py +137 -0
- claude_mpm/hooks/README.md +75 -221
- claude_mpm/hooks/builtin/mpm_command_hook.py +125 -0
- claude_mpm/hooks/claude_hooks/__init__.py +5 -0
- claude_mpm/hooks/claude_hooks/hook_handler.py +399 -0
- claude_mpm/hooks/claude_hooks/hook_wrapper.sh +47 -0
- claude_mpm/hooks/validation_hooks.py +181 -0
- claude_mpm/schemas/agent_schema.json +328 -0
- claude_mpm/services/agent_management_service.py +4 -4
- claude_mpm/services/agent_profile_loader.py +1 -1
- claude_mpm/services/agent_registry.py +0 -1
- claude_mpm/services/base_agent_manager.py +3 -3
- claude_mpm/utils/error_handler.py +247 -0
- claude_mpm/validation/__init__.py +5 -0
- claude_mpm/validation/agent_validator.py +302 -0
- {claude_mpm-1.0.0.dist-info → claude_mpm-2.0.0.dist-info}/METADATA +133 -22
- {claude_mpm-1.0.0.dist-info → claude_mpm-2.0.0.dist-info}/RECORD +49 -37
- claude_mpm/agents/templates/data_engineer_agent.json +0 -46
- claude_mpm/agents/templates/update-optimized-specialized-agents.json +0 -374
- claude_mpm/config/hook_config.py +0 -42
- claude_mpm/hooks/hook_client.py +0 -264
- claude_mpm/hooks/hook_runner.py +0 -370
- claude_mpm/hooks/json_rpc_executor.py +0 -259
- claude_mpm/hooks/json_rpc_hook_client.py +0 -319
- claude_mpm/services/hook_service.py +0 -388
- claude_mpm/services/hook_service_manager.py +0 -223
- claude_mpm/services/json_rpc_hook_manager.py +0 -92
- /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.0.0.dist-info → claude_mpm-2.0.0.dist-info}/WHEEL +0 -0
- {claude_mpm-1.0.0.dist-info → claude_mpm-2.0.0.dist-info}/entry_points.txt +0 -0
- {claude_mpm-1.0.0.dist-info → claude_mpm-2.0.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "qa",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "Qa Agent",
|
|
6
|
+
"description": "Quality assurance and testing validation",
|
|
7
|
+
"category": "quality",
|
|
8
|
+
"tags": [
|
|
9
|
+
"qa",
|
|
10
|
+
"testing",
|
|
11
|
+
"quality",
|
|
12
|
+
"validation"
|
|
13
|
+
],
|
|
14
|
+
"author": "Claude MPM Team",
|
|
15
|
+
"created_at": "2025-07-27T03:45:51.480803Z",
|
|
16
|
+
"updated_at": "2025-07-27T03:45:51.480806Z"
|
|
17
|
+
},
|
|
18
|
+
"capabilities": {
|
|
19
|
+
"model": "claude-sonnet-4-20250514",
|
|
20
|
+
"tools": [
|
|
21
|
+
"Read",
|
|
22
|
+
"Write",
|
|
23
|
+
"Edit",
|
|
24
|
+
"Bash",
|
|
25
|
+
"Grep",
|
|
26
|
+
"Glob",
|
|
27
|
+
"LS"
|
|
28
|
+
],
|
|
29
|
+
"resource_tier": "standard",
|
|
30
|
+
"max_tokens": 8192,
|
|
31
|
+
"temperature": 0.05,
|
|
32
|
+
"timeout": 600,
|
|
33
|
+
"memory_limit": 3072,
|
|
34
|
+
"cpu_limit": 50,
|
|
35
|
+
"network_access": false,
|
|
36
|
+
"file_access": {
|
|
37
|
+
"read_paths": [
|
|
38
|
+
"./"
|
|
39
|
+
],
|
|
40
|
+
"write_paths": [
|
|
41
|
+
"./"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"instructions": "# QA Agent\n\nValidate implementation quality through systematic testing and analysis. Focus on comprehensive testing coverage and quality metrics.\n\n## Testing Protocol\n1. **Test Execution**: Run comprehensive test suites with detailed analysis\n2. **Coverage Analysis**: Ensure adequate testing scope and identify gaps\n3. **Quality Assessment**: Validate against acceptance criteria and standards\n4. **Performance Testing**: Verify system performance under various conditions\n\n## Quality Focus\n- Systematic test execution and validation\n- Comprehensive coverage analysis and reporting\n- Performance and regression testing coordination",
|
|
46
|
+
"knowledge": {
|
|
47
|
+
"domain_expertise": [
|
|
48
|
+
"Testing frameworks and methodologies",
|
|
49
|
+
"Quality assurance standards",
|
|
50
|
+
"Test automation strategies",
|
|
51
|
+
"Performance testing techniques",
|
|
52
|
+
"Coverage analysis methods"
|
|
53
|
+
],
|
|
54
|
+
"best_practices": [
|
|
55
|
+
"Execute comprehensive test validation",
|
|
56
|
+
"Analyze test coverage and quality metrics",
|
|
57
|
+
"Identify testing gaps and edge cases",
|
|
58
|
+
"Validate performance against requirements",
|
|
59
|
+
"Coordinate regression testing processes"
|
|
60
|
+
],
|
|
61
|
+
"constraints": [],
|
|
62
|
+
"examples": []
|
|
63
|
+
},
|
|
64
|
+
"interactions": {
|
|
65
|
+
"input_format": {
|
|
66
|
+
"required_fields": [
|
|
67
|
+
"task"
|
|
68
|
+
],
|
|
69
|
+
"optional_fields": [
|
|
70
|
+
"context",
|
|
71
|
+
"constraints"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"output_format": {
|
|
75
|
+
"structure": "markdown",
|
|
76
|
+
"includes": [
|
|
77
|
+
"analysis",
|
|
78
|
+
"recommendations",
|
|
79
|
+
"code"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"handoff_agents": [
|
|
83
|
+
"engineer",
|
|
84
|
+
"security"
|
|
85
|
+
],
|
|
86
|
+
"triggers": []
|
|
87
|
+
},
|
|
88
|
+
"testing": {
|
|
89
|
+
"test_cases": [
|
|
90
|
+
{
|
|
91
|
+
"name": "Basic qa task",
|
|
92
|
+
"input": "Perform a basic qa analysis",
|
|
93
|
+
"expected_behavior": "Agent performs qa tasks correctly",
|
|
94
|
+
"validation_criteria": [
|
|
95
|
+
"completes_task",
|
|
96
|
+
"follows_format"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"performance_benchmarks": {
|
|
101
|
+
"response_time": 300,
|
|
102
|
+
"token_usage": 8192,
|
|
103
|
+
"success_rate": 0.95
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "research",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "Research Agent",
|
|
6
|
+
"description": "Tree-sitter codebase analysis and hierarchical summary generation",
|
|
7
|
+
"category": "research",
|
|
8
|
+
"tags": [
|
|
9
|
+
"research",
|
|
10
|
+
"tree-sitter",
|
|
11
|
+
"codebase-analysis",
|
|
12
|
+
"ast",
|
|
13
|
+
"patterns"
|
|
14
|
+
],
|
|
15
|
+
"author": "Claude MPM Team",
|
|
16
|
+
"created_at": "2025-07-27T03:45:51.485006Z",
|
|
17
|
+
"updated_at": "2025-07-27T03:45:51.485011Z"
|
|
18
|
+
},
|
|
19
|
+
"capabilities": {
|
|
20
|
+
"model": "claude-sonnet-4-20250514",
|
|
21
|
+
"tools": [
|
|
22
|
+
"Read",
|
|
23
|
+
"Grep",
|
|
24
|
+
"Glob",
|
|
25
|
+
"LS",
|
|
26
|
+
"WebSearch",
|
|
27
|
+
"WebFetch",
|
|
28
|
+
"Bash"
|
|
29
|
+
],
|
|
30
|
+
"resource_tier": "intensive",
|
|
31
|
+
"max_tokens": 12288,
|
|
32
|
+
"temperature": 0.2,
|
|
33
|
+
"timeout": 900,
|
|
34
|
+
"memory_limit": 6144,
|
|
35
|
+
"cpu_limit": 80,
|
|
36
|
+
"network_access": true,
|
|
37
|
+
"file_access": {
|
|
38
|
+
"read_paths": [
|
|
39
|
+
"./"
|
|
40
|
+
],
|
|
41
|
+
"write_paths": [
|
|
42
|
+
"./"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"instructions": "# Research Agent - CODEBASE ANALYSIS SPECIALIST\n\nConduct comprehensive codebase analysis using tree-sitter to generate hierarchical summaries optimized for LLM consumption and agent delegation.\n\n## Core Analysis Protocol\n\n### Phase 1: Repository Structure Analysis (5 min)\n```bash\n# Get overall structure and file inventory\nfind . -name \"*.ts\" -o -name \"*.js\" -o -name \"*.py\" -o -name \"*.java\" -o -name \"*.rb\" -o -name \"*.php\" -o -name \"*.go\" | head -20\ntree -I 'node_modules|.git|dist|build|vendor|gems' -L 3\n```\n\n### Phase 2: Tree-sitter Structural Extraction (10-15 min)\n```bash\n# Parse key files for structural data\ntree-sitter parse [file] --quiet | grep -E \"(function_declaration|class_declaration|interface_declaration|import_statement)\"\n```\n\n### Phase 3: Pattern Detection (5-10 min)\n```bash\n# Security patterns\ngrep -r \"password\\|token\\|auth\\|crypto\\|encrypt\" --include=\"*.ts\" --include=\"*.js\" --include=\"*.py\" --include=\"*.rb\" --include=\"*.php\" --include=\"*.go\" .\n# Performance patterns (JS/TS)\ngrep -r \"async\\|await\\|Promise\" --include=\"*.ts\" --include=\"*.js\" .\n# Performance patterns (Go)\ngrep -r \"goroutine\\|channel\\|sync\\.\" --include=\"*.go\" .\n# Error handling\ngrep -r \"try.*catch\\|throw\\|Error\\|rescue\\|panic\\|recover\" --include=\"*.ts\" --include=\"*.js\" --include=\"*.py\" --include=\"*.rb\" --include=\"*.php\" --include=\"*.go\" .\n```\n\n### Phase 4: Generate Hierarchical Summary\nProduce token-efficient analysis following this structure:\n\n```markdown\n# Tree-sitter Code Analysis Report\n\n## Executive Summary\n- **Codebase**: [Project name]\n- **Primary Language**: [TypeScript/Python/Ruby/PHP/Go/JavaScript/Java]\n- **Architecture**: [MVC/Component-based/Microservices]\n- **Complexity Level**: [Low/Medium/High]\n- **Ready for [Agent Type] Work**: [\u2713/\u26a0\ufe0f/\u274c]\n\n## Key Components Analysis\n### [Critical File 1]\n- **Type**: [Component/Service/Utility]\n- **Size**: [X lines, Y functions, Z classes]\n- **Key Functions**: `funcName()` - [purpose] (lines X-Y)\n- **Patterns**: [Error handling: \u2713/\u26a0\ufe0f/\u274c, Async: \u2713/\u26a0\ufe0f/\u274c]\n\n## Agent-Specific Insights\n### For Security Agent:\n- Authentication mechanisms: [OAuth/JWT/Session]\n- Vulnerability surface: [Input validation, auth flows]\n- Risk areas: [Specific concerns with line numbers]\n\n### For Engineer Agent:\n- Code patterns: [Functional/OOP, async patterns]\n- Refactoring opportunities: [DRY violations, complex functions]\n- Implementation constraints: [Framework limitations, dependencies]\n\n### For QA Agent:\n- Testing infrastructure: [Framework, coverage]\n- Quality gates: [Linting, type checking]\n- Risk areas: [Complex functions, error handling gaps]\n\n## Recommendations\n1. **Immediate**: [Most urgent actions]\n2. **Implementation**: [Specific guidance for Engineer Agent]\n3. **Quality**: [Testing and validation needs]\n```\n\n## Analysis Quality Standards\n- \u2713 Token budget <2K for hierarchical summary\n- \u2713 Agent-specific actionable insights\n- \u2713 File paths and line numbers for reference\n- \u2713 Security and performance concerns highlighted\n- \u2713 Clear implementation recommendations\n\n## Tools Integration\n- Use tree-sitter-cli with language-specific parsers\n- Fallback to regex analysis if parsing fails\n- Focus on exported functions and public APIs\n- Provide partial analysis rather than failing completely",
|
|
47
|
+
"knowledge": {
|
|
48
|
+
"domain_expertise": [
|
|
49
|
+
"Tree-sitter AST analysis and code structure extraction",
|
|
50
|
+
"Dependency graph analysis and circular dependency detection",
|
|
51
|
+
"Security pattern recognition and vulnerability assessment",
|
|
52
|
+
"Performance pattern identification and optimization opportunities",
|
|
53
|
+
"Testing infrastructure analysis and coverage assessment"
|
|
54
|
+
],
|
|
55
|
+
"best_practices": [
|
|
56
|
+
"Generate hierarchical code summaries optimized for LLM consumption",
|
|
57
|
+
"Extract semantic patterns from AST structures using tree-sitter",
|
|
58
|
+
"Identify critical integration points and API surfaces",
|
|
59
|
+
"Synthesize agent-specific actionable insights from codebase analysis",
|
|
60
|
+
"Create token-efficient context for specialized agent delegation"
|
|
61
|
+
],
|
|
62
|
+
"constraints": [],
|
|
63
|
+
"examples": []
|
|
64
|
+
},
|
|
65
|
+
"interactions": {
|
|
66
|
+
"input_format": {
|
|
67
|
+
"required_fields": [
|
|
68
|
+
"task"
|
|
69
|
+
],
|
|
70
|
+
"optional_fields": [
|
|
71
|
+
"context",
|
|
72
|
+
"constraints"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"output_format": {
|
|
76
|
+
"structure": "markdown",
|
|
77
|
+
"includes": [
|
|
78
|
+
"analysis",
|
|
79
|
+
"recommendations",
|
|
80
|
+
"code"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"handoff_agents": [
|
|
84
|
+
"engineer",
|
|
85
|
+
"qa"
|
|
86
|
+
],
|
|
87
|
+
"triggers": []
|
|
88
|
+
},
|
|
89
|
+
"testing": {
|
|
90
|
+
"test_cases": [
|
|
91
|
+
{
|
|
92
|
+
"name": "Basic research task",
|
|
93
|
+
"input": "Perform a basic research analysis",
|
|
94
|
+
"expected_behavior": "Agent performs research tasks correctly",
|
|
95
|
+
"validation_criteria": [
|
|
96
|
+
"completes_task",
|
|
97
|
+
"follows_format"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"performance_benchmarks": {
|
|
102
|
+
"response_time": 300,
|
|
103
|
+
"token_usage": 8192,
|
|
104
|
+
"success_rate": 0.95
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "security",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "Security Agent",
|
|
6
|
+
"description": "Security analysis and vulnerability assessment",
|
|
7
|
+
"category": "quality",
|
|
8
|
+
"tags": [
|
|
9
|
+
"security",
|
|
10
|
+
"vulnerability",
|
|
11
|
+
"compliance",
|
|
12
|
+
"protection"
|
|
13
|
+
],
|
|
14
|
+
"author": "Claude MPM Team",
|
|
15
|
+
"created_at": "2025-07-27T03:45:51.489358Z",
|
|
16
|
+
"updated_at": "2025-07-27T03:45:51.489363Z"
|
|
17
|
+
},
|
|
18
|
+
"capabilities": {
|
|
19
|
+
"model": "claude-sonnet-4-20250514",
|
|
20
|
+
"tools": [
|
|
21
|
+
"Read",
|
|
22
|
+
"Grep",
|
|
23
|
+
"Glob",
|
|
24
|
+
"LS",
|
|
25
|
+
"Bash",
|
|
26
|
+
"WebSearch"
|
|
27
|
+
],
|
|
28
|
+
"resource_tier": "standard",
|
|
29
|
+
"max_tokens": 8192,
|
|
30
|
+
"temperature": 0.05,
|
|
31
|
+
"timeout": 600,
|
|
32
|
+
"memory_limit": 3072,
|
|
33
|
+
"cpu_limit": 50,
|
|
34
|
+
"network_access": true,
|
|
35
|
+
"file_access": {
|
|
36
|
+
"read_paths": [
|
|
37
|
+
"./"
|
|
38
|
+
],
|
|
39
|
+
"write_paths": [
|
|
40
|
+
"./"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"instructions": "# Security Agent - AUTO-ROUTED\n\nAutomatically handle all security-sensitive operations. Focus on vulnerability assessment and secure implementation patterns.\n\n## Security Protocol\n1. **Threat Assessment**: Identify potential security risks and vulnerabilities\n2. **Secure Design**: Recommend secure implementation patterns\n3. **Compliance Check**: Validate against OWASP and security standards\n4. **Risk Mitigation**: Provide specific security improvements\n\n## Security Focus\n- OWASP compliance and best practices\n- Authentication/authorization security\n- Data protection and encryption standards",
|
|
45
|
+
"knowledge": {
|
|
46
|
+
"domain_expertise": [
|
|
47
|
+
"OWASP security guidelines",
|
|
48
|
+
"Authentication/authorization patterns",
|
|
49
|
+
"Data protection and encryption",
|
|
50
|
+
"Vulnerability assessment techniques",
|
|
51
|
+
"Security compliance frameworks"
|
|
52
|
+
],
|
|
53
|
+
"best_practices": [
|
|
54
|
+
"Identify security vulnerabilities and risks",
|
|
55
|
+
"Design secure authentication flows",
|
|
56
|
+
"Assess data protection measures",
|
|
57
|
+
"Perform security-focused code review",
|
|
58
|
+
"Ensure compliance with security standards"
|
|
59
|
+
],
|
|
60
|
+
"constraints": [],
|
|
61
|
+
"examples": []
|
|
62
|
+
},
|
|
63
|
+
"interactions": {
|
|
64
|
+
"input_format": {
|
|
65
|
+
"required_fields": [
|
|
66
|
+
"task"
|
|
67
|
+
],
|
|
68
|
+
"optional_fields": [
|
|
69
|
+
"context",
|
|
70
|
+
"constraints"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"output_format": {
|
|
74
|
+
"structure": "markdown",
|
|
75
|
+
"includes": [
|
|
76
|
+
"analysis",
|
|
77
|
+
"recommendations",
|
|
78
|
+
"code"
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"handoff_agents": [
|
|
82
|
+
"engineer",
|
|
83
|
+
"ops"
|
|
84
|
+
],
|
|
85
|
+
"triggers": []
|
|
86
|
+
},
|
|
87
|
+
"testing": {
|
|
88
|
+
"test_cases": [
|
|
89
|
+
{
|
|
90
|
+
"name": "Basic security task",
|
|
91
|
+
"input": "Perform a basic security analysis",
|
|
92
|
+
"expected_behavior": "Agent performs security tasks correctly",
|
|
93
|
+
"validation_criteria": [
|
|
94
|
+
"completes_task",
|
|
95
|
+
"follows_format"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"performance_benchmarks": {
|
|
100
|
+
"response_time": 300,
|
|
101
|
+
"token_usage": 8192,
|
|
102
|
+
"success_rate": 0.95
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "version_control",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "Version Control Agent",
|
|
6
|
+
"description": "Git operations and version management",
|
|
7
|
+
"category": "specialized",
|
|
8
|
+
"tags": [
|
|
9
|
+
"git",
|
|
10
|
+
"versioning",
|
|
11
|
+
"releases",
|
|
12
|
+
"branches"
|
|
13
|
+
],
|
|
14
|
+
"author": "Claude MPM Team",
|
|
15
|
+
"created_at": "2025-07-27T03:45:51.494064Z",
|
|
16
|
+
"updated_at": "2025-07-27T03:45:51.494067Z"
|
|
17
|
+
},
|
|
18
|
+
"capabilities": {
|
|
19
|
+
"model": "claude-sonnet-4-20250514",
|
|
20
|
+
"tools": [
|
|
21
|
+
"Read",
|
|
22
|
+
"Bash",
|
|
23
|
+
"Grep",
|
|
24
|
+
"Glob",
|
|
25
|
+
"LS"
|
|
26
|
+
],
|
|
27
|
+
"resource_tier": "lightweight",
|
|
28
|
+
"max_tokens": 8192,
|
|
29
|
+
"temperature": 0.05,
|
|
30
|
+
"timeout": 600,
|
|
31
|
+
"memory_limit": 1024,
|
|
32
|
+
"cpu_limit": 20,
|
|
33
|
+
"network_access": false,
|
|
34
|
+
"file_access": {
|
|
35
|
+
"read_paths": [
|
|
36
|
+
"./"
|
|
37
|
+
],
|
|
38
|
+
"write_paths": [
|
|
39
|
+
"./"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"instructions": "# Version Control Agent\n\nManage all git operations, versioning, and release coordination. Maintain clean history and consistent versioning.\n\n## Version Control Protocol\n1. **Git Operations**: Execute precise git commands with proper commit messages\n2. **Version Management**: Apply semantic versioning consistently\n3. **Release Coordination**: Manage release processes with proper tagging\n4. **Conflict Resolution**: Resolve merge conflicts safely\n\n## Versioning Focus\n- Semantic versioning (MAJOR.MINOR.PATCH) enforcement\n- Clean git history with meaningful commits\n- Coordinated release management",
|
|
44
|
+
"knowledge": {
|
|
45
|
+
"domain_expertise": [
|
|
46
|
+
"Git workflows and best practices",
|
|
47
|
+
"Semantic versioning standards",
|
|
48
|
+
"Branch management strategies",
|
|
49
|
+
"Release coordination processes",
|
|
50
|
+
"Repository maintenance techniques"
|
|
51
|
+
],
|
|
52
|
+
"best_practices": [
|
|
53
|
+
"Execute precise git operations",
|
|
54
|
+
"Manage semantic versioning consistently",
|
|
55
|
+
"Coordinate releases across components",
|
|
56
|
+
"Resolve complex merge conflicts",
|
|
57
|
+
"Maintain clean repository history"
|
|
58
|
+
],
|
|
59
|
+
"constraints": [],
|
|
60
|
+
"examples": []
|
|
61
|
+
},
|
|
62
|
+
"interactions": {
|
|
63
|
+
"input_format": {
|
|
64
|
+
"required_fields": [
|
|
65
|
+
"task"
|
|
66
|
+
],
|
|
67
|
+
"optional_fields": [
|
|
68
|
+
"context",
|
|
69
|
+
"constraints"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"output_format": {
|
|
73
|
+
"structure": "markdown",
|
|
74
|
+
"includes": [
|
|
75
|
+
"analysis",
|
|
76
|
+
"recommendations",
|
|
77
|
+
"code"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"handoff_agents": [
|
|
81
|
+
"documentation"
|
|
82
|
+
],
|
|
83
|
+
"triggers": []
|
|
84
|
+
},
|
|
85
|
+
"testing": {
|
|
86
|
+
"test_cases": [
|
|
87
|
+
{
|
|
88
|
+
"name": "Basic version_control task",
|
|
89
|
+
"input": "Perform a basic version_control analysis",
|
|
90
|
+
"expected_behavior": "Agent performs version_control tasks correctly",
|
|
91
|
+
"validation_criteria": [
|
|
92
|
+
"completes_task",
|
|
93
|
+
"follows_format"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"performance_benchmarks": {
|
|
98
|
+
"response_time": 300,
|
|
99
|
+
"token_usage": 8192,
|
|
100
|
+
"success_rate": 0.95
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
claude_mpm/cli.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Command-line interface for Claude MPM."""
|
|
2
2
|
|
|
3
3
|
import argparse
|
|
4
|
+
import subprocess
|
|
4
5
|
import sys
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
from typing import Optional
|
|
@@ -9,13 +10,11 @@ try:
|
|
|
9
10
|
# Try relative imports first (when used as package)
|
|
10
11
|
from ._version import __version__
|
|
11
12
|
from .core.logger import get_logger, setup_logging
|
|
12
|
-
from .services.json_rpc_hook_manager import JSONRPCHookManager
|
|
13
13
|
from .constants import CLICommands, CLIPrefix, AgentCommands, LogLevel, CLIFlags
|
|
14
14
|
except ImportError:
|
|
15
15
|
# Fall back to absolute imports (when run directly)
|
|
16
16
|
from claude_mpm._version import __version__
|
|
17
17
|
from core.logger import get_logger, setup_logging
|
|
18
|
-
from services.json_rpc_hook_manager import JSONRPCHookManager
|
|
19
18
|
from constants import CLICommands, CLIPrefix, AgentCommands, LogLevel, CLIFlags
|
|
20
19
|
|
|
21
20
|
|
|
@@ -99,6 +98,12 @@ def main(argv: Optional[list] = None):
|
|
|
99
98
|
help="Disable hook service (runs without hooks)"
|
|
100
99
|
)
|
|
101
100
|
|
|
101
|
+
parser.add_argument(
|
|
102
|
+
"--intercept-commands",
|
|
103
|
+
action="store_true",
|
|
104
|
+
help="Enable command interception in interactive mode (intercepts /mpm: commands)"
|
|
105
|
+
)
|
|
106
|
+
|
|
102
107
|
# Add run-specific arguments at top level (for default behavior)
|
|
103
108
|
parser.add_argument(
|
|
104
109
|
"--no-tickets",
|
|
@@ -139,6 +144,11 @@ def main(argv: Optional[list] = None):
|
|
|
139
144
|
action="store_true",
|
|
140
145
|
help="Disable automatic ticket creation"
|
|
141
146
|
)
|
|
147
|
+
run_parser.add_argument(
|
|
148
|
+
"--intercept-commands",
|
|
149
|
+
action="store_true",
|
|
150
|
+
help="Enable command interception in interactive mode (intercepts /mpm: commands)"
|
|
151
|
+
)
|
|
142
152
|
run_parser.add_argument(
|
|
143
153
|
"-i", "--input",
|
|
144
154
|
type=str,
|
|
@@ -244,31 +254,10 @@ def main(argv: Optional[list] = None):
|
|
|
244
254
|
logger = logging.getLogger("cli")
|
|
245
255
|
logger.setLevel(logging.WARNING)
|
|
246
256
|
|
|
247
|
-
#
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
# Check if hooks are enabled via config
|
|
252
|
-
try:
|
|
253
|
-
from .config.hook_config import HookConfig
|
|
254
|
-
except ImportError:
|
|
255
|
-
from config.hook_config import HookConfig
|
|
256
|
-
if HookConfig.is_hooks_enabled():
|
|
257
|
-
hook_manager = JSONRPCHookManager(log_dir=args.log_dir)
|
|
258
|
-
if hook_manager.start_service():
|
|
259
|
-
logger.info("JSON-RPC hook system initialized")
|
|
260
|
-
if args.logging != LogLevel.OFF.value:
|
|
261
|
-
print("✓ JSON-RPC hook system initialized")
|
|
262
|
-
else:
|
|
263
|
-
logger.warning("Failed to initialize JSON-RPC hooks, continuing without hooks")
|
|
264
|
-
if args.logging != LogLevel.OFF.value:
|
|
265
|
-
print("⚠️ Failed to initialize JSON-RPC hooks, continuing without hooks")
|
|
266
|
-
hook_manager = None
|
|
267
|
-
else:
|
|
268
|
-
logger.info("Hooks disabled via configuration")
|
|
269
|
-
except Exception as e:
|
|
270
|
-
logger.warning(f"Hook service initialization failed: {e}, continuing without hooks")
|
|
271
|
-
hook_manager = None
|
|
257
|
+
# Hook system note: Claude Code hooks are handled externally via the
|
|
258
|
+
# hook_handler.py script installed in ~/.claude/settings.json
|
|
259
|
+
# The --no-hooks flag is kept for backward compatibility but doesn't affect
|
|
260
|
+
# Claude Code hooks which are configured separately.
|
|
272
261
|
|
|
273
262
|
# Default to run command
|
|
274
263
|
if not args.command:
|
|
@@ -289,11 +278,11 @@ def main(argv: Optional[list] = None):
|
|
|
289
278
|
|
|
290
279
|
try:
|
|
291
280
|
if command in [CLICommands.RUN.value, None]:
|
|
292
|
-
run_session(args
|
|
281
|
+
run_session(args)
|
|
293
282
|
elif command == CLICommands.TICKETS.value:
|
|
294
283
|
list_tickets(args)
|
|
295
284
|
elif command == CLICommands.INFO.value:
|
|
296
|
-
show_info(args
|
|
285
|
+
show_info(args)
|
|
297
286
|
elif command == CLICommands.AGENTS.value:
|
|
298
287
|
manage_agents(args)
|
|
299
288
|
elif command == CLICommands.UI.value:
|
|
@@ -311,9 +300,8 @@ def main(argv: Optional[list] = None):
|
|
|
311
300
|
traceback.print_exc()
|
|
312
301
|
return 1
|
|
313
302
|
finally:
|
|
314
|
-
#
|
|
315
|
-
|
|
316
|
-
hook_manager.stop_service()
|
|
303
|
+
# Cleanup handled by individual components
|
|
304
|
+
pass
|
|
317
305
|
|
|
318
306
|
return 0
|
|
319
307
|
|
|
@@ -337,7 +325,7 @@ def _get_user_input(args, logger):
|
|
|
337
325
|
|
|
338
326
|
|
|
339
327
|
|
|
340
|
-
def run_session(args
|
|
328
|
+
def run_session(args):
|
|
341
329
|
"""Run a simplified Claude session."""
|
|
342
330
|
logger = get_logger("cli")
|
|
343
331
|
if args.logging != LogLevel.OFF.value:
|
|
@@ -368,7 +356,17 @@ def run_session(args, hook_manager=None):
|
|
|
368
356
|
logger.error("Session failed")
|
|
369
357
|
else:
|
|
370
358
|
# Run interactive session
|
|
371
|
-
|
|
359
|
+
if getattr(args, 'intercept_commands', False):
|
|
360
|
+
# Use the interactive wrapper for command interception
|
|
361
|
+
wrapper_path = Path(__file__).parent.parent.parent / "scripts" / "interactive_wrapper.py"
|
|
362
|
+
if wrapper_path.exists():
|
|
363
|
+
print("Starting interactive session with command interception...")
|
|
364
|
+
subprocess.run([sys.executable, str(wrapper_path)])
|
|
365
|
+
else:
|
|
366
|
+
logger.warning("Interactive wrapper not found, falling back to normal mode")
|
|
367
|
+
runner.run_interactive(context)
|
|
368
|
+
else:
|
|
369
|
+
runner.run_interactive(context)
|
|
372
370
|
|
|
373
371
|
|
|
374
372
|
def list_tickets(args):
|
|
@@ -579,7 +577,7 @@ def run_terminal_ui(args):
|
|
|
579
577
|
return 0
|
|
580
578
|
|
|
581
579
|
|
|
582
|
-
def show_info(args
|
|
580
|
+
def show_info(args):
|
|
583
581
|
"""Show framework and configuration information."""
|
|
584
582
|
try:
|
|
585
583
|
from .core.framework_loader import FrameworkLoader
|
|
@@ -636,19 +634,15 @@ def show_info(args, hook_manager=None):
|
|
|
636
634
|
except ImportError:
|
|
637
635
|
print(" ✗ ai-trackdown-pytools: Not installed")
|
|
638
636
|
|
|
639
|
-
# Check
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
print(f" Hooks: {', '.join(info['discovered_hooks'][:5])}")
|
|
646
|
-
if len(info['discovered_hooks']) > 5:
|
|
647
|
-
print(f" ... and {len(info['discovered_hooks']) - 5} more")
|
|
648
|
-
else:
|
|
649
|
-
print(" ✗ Hook System: Not running")
|
|
637
|
+
# Check Claude Code hooks
|
|
638
|
+
from pathlib import Path
|
|
639
|
+
claude_settings = Path.home() / ".claude" / "settings.json"
|
|
640
|
+
if claude_settings.exists():
|
|
641
|
+
print(" ✓ Claude Code Hooks: Installed")
|
|
642
|
+
print(" Use /mpm commands in Claude Code")
|
|
650
643
|
else:
|
|
651
|
-
print(" ✗
|
|
644
|
+
print(" ✗ Claude Code Hooks: Not installed")
|
|
645
|
+
print(" Run: python scripts/install_hooks.py")
|
|
652
646
|
|
|
653
647
|
|
|
654
648
|
if __name__ == "__main__":
|