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
claude_mpm/cli/startup.py CHANGED
@@ -677,14 +677,21 @@ def sync_remote_skills_on_startup():
677
677
 
678
678
  Workflow:
679
679
  1. Sync all enabled Git sources (download/cache files) - Phase 1 progress bar
680
- 2. Deploy skills to ~/.claude/skills/ with flat structure - Phase 2 progress bar
681
- 3. Log deployment results
680
+ 2. Scan deployed agents for skill requirements save to configuration.yaml
681
+ 3. Resolve which skills to deploy (user_defined vs agent_referenced)
682
+ 4. Deploy resolved skills to ~/.claude/skills/ - Phase 2 progress bar
683
+ 5. Log deployment results with source indication
682
684
  """
683
685
  try:
684
686
  from pathlib import Path
685
687
 
686
688
  from ..config.skill_sources import SkillSourceConfiguration
687
689
  from ..services.skills.git_skill_source_manager import GitSkillSourceManager
690
+ from ..services.skills.selective_skill_deployer import (
691
+ get_required_skills_from_agents,
692
+ get_skills_to_deploy,
693
+ save_agent_skills_to_config,
694
+ )
688
695
  from ..utils.progress import ProgressBar
689
696
 
690
697
  config = SkillSourceConfiguration()
@@ -773,37 +780,37 @@ def sync_remote_skills_on_startup():
773
780
  f"Complete: {downloaded} files downloaded ({total_skill_dirs} skills)"
774
781
  )
775
782
 
776
- # Phase 2: Deploy skills to ~/.claude/skills/
777
- # This flattens nested Git structure (e.g., collaboration/parallel-agents/SKILL.md)
778
- # into flat deployment (e.g., collaboration-dispatching-parallel-agents/SKILL.md)
783
+ # Phase 2: Scan agents and save to configuration.yaml
784
+ # This step populates configuration.yaml with agent-referenced skills
779
785
  if results["synced_count"] > 0:
780
- # Get required skills from deployed agents (selective deployment)
781
- from ..services.skills.selective_skill_deployer import (
782
- get_required_skills_from_agents,
783
- )
784
-
785
786
  agents_dir = Path.cwd() / ".claude" / "agents"
786
- required_skills = get_required_skills_from_agents(agents_dir)
787
+
788
+ # Scan agents for skill requirements
789
+ agent_skills = get_required_skills_from_agents(agents_dir)
790
+
791
+ # Save to project-level configuration.yaml
792
+ project_config_path = Path.cwd() / ".claude-mpm" / "configuration.yaml"
793
+ save_agent_skills_to_config(list(agent_skills), project_config_path)
794
+
795
+ # Phase 3: Resolve which skills to deploy (user_defined or agent_referenced)
796
+ skills_to_deploy, skill_source = get_skills_to_deploy(project_config_path)
787
797
 
788
798
  # Get all skills to determine counts
789
799
  all_skills = manager.get_all_skills()
790
800
  total_skill_count = len(all_skills)
791
801
 
792
- # Determine skill count based on whether we have agent requirements
793
- if required_skills:
794
- # Selective deployment: only skills required by deployed agents
795
- skill_count = len(required_skills)
796
- else:
797
- # No agent requirements found - deploy all skills
798
- skill_count = total_skill_count
802
+ # Determine skill count based on resolution
803
+ skill_count = (
804
+ len(skills_to_deploy) if skills_to_deploy else total_skill_count
805
+ )
799
806
 
800
807
  if skill_count > 0:
801
- # Deploy skills with selective filter (if agent requirements exist)
808
+ # Deploy skills with resolved filter
802
809
  # Deploy to project directory (like agents), not user directory
803
810
  deployment_result = manager.deploy_skills(
804
811
  target_dir=Path.cwd() / ".claude" / "skills",
805
812
  force=False,
806
- skill_filter=required_skills if required_skills else None,
813
+ skill_filter=set(skills_to_deploy) if skills_to_deploy else None,
807
814
  )
808
815
 
809
816
  # Get actual counts from deployment result
@@ -833,27 +840,31 @@ def sync_remote_skills_on_startup():
833
840
  deploy_progress.update(1)
834
841
 
835
842
  # Show total available skills (deployed + already existing)
836
- # Include filtered count if selective deployment was used
843
+ # Include source indication (user_defined vs agent_referenced)
837
844
  # Note: total_skill_count is from the repo, total_available is what's deployed/needed
845
+ source_label = (
846
+ "user override" if skill_source == "user_defined" else "from agents"
847
+ )
848
+
838
849
  if deployed > 0:
839
850
  if filtered > 0:
840
851
  deploy_progress.finish(
841
852
  f"Complete: {deployed} new, {skipped} unchanged "
842
- f"({total_available} required by agents, {filtered} available in repo)"
853
+ f"({total_available} {source_label}, {filtered} available in repo)"
843
854
  )
844
855
  else:
845
856
  deploy_progress.finish(
846
857
  f"Complete: {deployed} new, {skipped} unchanged "
847
- f"({total_available} skills deployed from {total_skill_count} in repo)"
858
+ f"({total_available} skills {source_label} from {total_skill_count} in repo)"
848
859
  )
849
860
  elif filtered > 0:
850
861
  # Skills filtered means agents require fewer skills than available
851
862
  deploy_progress.finish(
852
- f"Agents require no skills ({total_skill_count} available in repo)"
863
+ f"No skills needed ({source_label}, {total_skill_count} available in repo)"
853
864
  )
854
865
  else:
855
866
  deploy_progress.finish(
856
- f"Complete: {total_available} skills deployed for agents "
867
+ f"Complete: {total_available} skills {source_label} "
857
868
  f"({total_skill_count} available in repo)"
858
869
  )
859
870
 
@@ -883,6 +894,202 @@ def sync_remote_skills_on_startup():
883
894
  # Continue execution - skill sync failure shouldn't block startup
884
895
 
885
896
 
897
+ def show_agent_summary():
898
+ """
899
+ Display agent availability summary on startup.
900
+
901
+ WHY: Users should see at a glance how many agents are available and installed
902
+ without having to run /mpm-agents list.
903
+
904
+ DESIGN DECISION: Fast, non-blocking check that counts agents from the deployment
905
+ directory. Shows simple "X installed / Y available" format. Failures are silent
906
+ to avoid blocking startup.
907
+ """
908
+ try:
909
+ from pathlib import Path
910
+
911
+ # Count deployed agents (installed)
912
+ deploy_target = Path.cwd() / ".claude" / "agents"
913
+ installed_count = 0
914
+ if deploy_target.exists():
915
+ # Count .md files, excluding README and other docs
916
+ agent_files = [
917
+ f
918
+ for f in deploy_target.glob("*.md")
919
+ if not f.name.startswith(("README", "INSTRUCTIONS", "."))
920
+ ]
921
+ installed_count = len(agent_files)
922
+
923
+ # Count available agents in cache (from remote sources)
924
+ cache_dir = Path.home() / ".claude-mpm" / "cache" / "remote-agents"
925
+ available_count = 0
926
+ if cache_dir.exists():
927
+ # Use same filtering logic as agent deployment (lines 486-533 in startup.py)
928
+ pm_templates = {
929
+ "base-agent.md",
930
+ "circuit_breakers.md",
931
+ "pm_examples.md",
932
+ "pm_red_flags.md",
933
+ "research_gate_examples.md",
934
+ "response_format.md",
935
+ "ticket_completeness_examples.md",
936
+ "validation_templates.md",
937
+ "git_file_tracking.md",
938
+ }
939
+ doc_files = {
940
+ "readme.md",
941
+ "changelog.md",
942
+ "contributing.md",
943
+ "implementation-summary.md",
944
+ "reorganization-plan.md",
945
+ "auto-deploy-index.md",
946
+ }
947
+
948
+ # Find all markdown files in agents/ directories
949
+ all_md_files = list(cache_dir.rglob("*.md"))
950
+ agent_files = [
951
+ f
952
+ for f in all_md_files
953
+ if (
954
+ "/agents/" in str(f)
955
+ and f.name.lower() not in pm_templates
956
+ and f.name.lower() not in doc_files
957
+ and f.name.lower() != "base-agent.md"
958
+ and not any(
959
+ part in str(f).split("/")
960
+ for part in ["dist", "build", ".cache"]
961
+ )
962
+ )
963
+ ]
964
+ available_count = len(agent_files)
965
+
966
+ # Display summary if we have agents
967
+ if installed_count > 0 or available_count > 0:
968
+ print(
969
+ f"✓ Agents: {installed_count} installed / {available_count} available",
970
+ flush=True,
971
+ )
972
+
973
+ except Exception as e:
974
+ # Silent failure - agent summary is informational only
975
+ from ..core.logger import get_logger
976
+
977
+ logger = get_logger("cli")
978
+ logger.debug(f"Failed to generate agent summary: {e}")
979
+
980
+
981
+ def show_skill_summary():
982
+ """
983
+ Display skill availability summary on startup.
984
+
985
+ WHY: Users should see at a glance how many skills are deployed and available
986
+ from collections, similar to the agent summary.
987
+
988
+ DESIGN DECISION: Fast, non-blocking check that counts skills from deployment
989
+ directory and collection repos. Shows "X installed (Y available)" format.
990
+ Failures are silent to avoid blocking startup.
991
+ """
992
+ try:
993
+ from pathlib import Path
994
+
995
+ # Count deployed skills (installed)
996
+ skills_dir = Path.home() / ".claude" / "skills"
997
+ installed_count = 0
998
+ if skills_dir.exists():
999
+ # Count directories with SKILL.md (excludes collection repos)
1000
+ # Exclude collection directories (obra-superpowers, etc.)
1001
+ skill_dirs = [
1002
+ d
1003
+ for d in skills_dir.iterdir()
1004
+ if d.is_dir()
1005
+ and (d / "SKILL.md").exists()
1006
+ and not (d / ".git").exists() # Exclude collection repos
1007
+ ]
1008
+ installed_count = len(skill_dirs)
1009
+
1010
+ # Count available skills in collections
1011
+ available_count = 0
1012
+ if skills_dir.exists():
1013
+ # Scan all collection directories (those with .git)
1014
+ for collection_dir in skills_dir.iterdir():
1015
+ if (
1016
+ not collection_dir.is_dir()
1017
+ or not (collection_dir / ".git").exists()
1018
+ ):
1019
+ continue
1020
+
1021
+ # Count skill directories in this collection
1022
+ # Skills can be nested in: skills/category/skill-name/SKILL.md
1023
+ # or in flat structure: skill-name/SKILL.md
1024
+ for root, dirs, files in os.walk(collection_dir):
1025
+ if "SKILL.md" in files:
1026
+ # Exclude build artifacts and hidden directories (within the collection)
1027
+ # Get relative path from collection_dir to avoid excluding based on .claude parent
1028
+ root_path = Path(root)
1029
+ relative_parts = root_path.relative_to(collection_dir).parts
1030
+ if not any(
1031
+ part.startswith(".")
1032
+ or part in ["dist", "build", "__pycache__"]
1033
+ for part in relative_parts
1034
+ ):
1035
+ available_count += 1
1036
+
1037
+ # Display summary if we have skills
1038
+ if installed_count > 0 or available_count > 0:
1039
+ print(
1040
+ f"✓ Skills: {installed_count} installed ({available_count} available)",
1041
+ flush=True,
1042
+ )
1043
+
1044
+ except Exception as e:
1045
+ # Silent failure - skill summary is informational only
1046
+ from ..core.logger import get_logger
1047
+
1048
+ logger = get_logger("cli")
1049
+ logger.debug(f"Failed to generate skill summary: {e}")
1050
+
1051
+
1052
+ def auto_install_chrome_devtools_on_startup():
1053
+ """
1054
+ Automatically install chrome-devtools-mcp on startup if enabled.
1055
+
1056
+ WHY: Browser automation capabilities should be available out-of-the-box without
1057
+ manual MCP server configuration. chrome-devtools-mcp provides powerful browser
1058
+ interaction tools for Claude Code.
1059
+
1060
+ DESIGN DECISION: Non-blocking installation that doesn't prevent startup if it fails.
1061
+ Respects user configuration setting (enabled by default). Only installs if not
1062
+ already configured in Claude.
1063
+ """
1064
+ try:
1065
+ # Check if auto-install is disabled in config
1066
+ from ..config.config_loader import ConfigLoader
1067
+
1068
+ config_loader = ConfigLoader()
1069
+ try:
1070
+ config = config_loader.load_main_config()
1071
+ chrome_devtools_config = config.get("chrome_devtools", {})
1072
+ if not chrome_devtools_config.get("auto_install", True):
1073
+ # Auto-install disabled, skip silently
1074
+ return
1075
+ except Exception:
1076
+ # If config loading fails, assume auto-install is enabled (default)
1077
+ pass
1078
+
1079
+ # Import and run chrome-devtools installation
1080
+ from ..cli.chrome_devtools_installer import auto_install_chrome_devtools
1081
+
1082
+ auto_install_chrome_devtools(quiet=False)
1083
+
1084
+ except Exception as e:
1085
+ # Import logger here to avoid circular imports
1086
+ from ..core.logger import get_logger
1087
+
1088
+ logger = get_logger("cli")
1089
+ logger.debug(f"Failed to auto-install chrome-devtools-mcp: {e}")
1090
+ # Continue execution - chrome-devtools installation failure shouldn't block startup
1091
+
1092
+
886
1093
  def run_background_services():
887
1094
  """
888
1095
  Initialize all background services on startup.
@@ -905,6 +1112,7 @@ def run_background_services():
905
1112
  verify_mcp_gateway_startup()
906
1113
  check_for_updates_async()
907
1114
  sync_remote_agents_on_startup() # Sync agents from remote sources
1115
+ show_agent_summary() # Display agent counts after deployment
908
1116
 
909
1117
  # Skills deployment order (precedence: remote > bundled)
910
1118
  # 1. Deploy bundled skills first (base layer from package)
@@ -914,9 +1122,13 @@ def run_background_services():
914
1122
  deploy_bundled_skills() # Base layer: package-bundled skills
915
1123
  sync_remote_skills_on_startup() # Override layer: Git-based skills (takes precedence)
916
1124
  discover_and_link_runtime_skills() # Discovery: user-added skills
1125
+ show_skill_summary() # Display skill counts after deployment
917
1126
 
918
1127
  deploy_output_style_on_startup()
919
1128
 
1129
+ # Auto-install chrome-devtools-mcp for browser automation
1130
+ auto_install_chrome_devtools_on_startup()
1131
+
920
1132
 
921
1133
  def setup_mcp_server_logging(args):
922
1134
  """
@@ -262,5 +262,4 @@ default_configuration:
262
262
  - `/mpm-doctor`: Diagnose configuration issues
263
263
  - `/mpm-init`: Initialize project configuration
264
264
  - `/mpm-agents`: Manually manage agents
265
- - `/mpm-agents-detect`: View detected toolchain only
266
- - `/mpm-agents-recommend`: Show recommendations only
265
+ - `/mpm-configure`: Unified configuration interface (includes toolchain detection and recommendations)
@@ -78,14 +78,8 @@ Available Commands:
78
78
  /mpm-agents [list|deploy|remove] [name]
79
79
  Manage agent deployment
80
80
 
81
- /mpm-auto-configure [--preview] [--yes]
82
- 🤖 NEW! Automatically configure agents based on your project
83
-
84
- /mpm-agents-detect
85
- 🤖 NEW! Detect project toolchain and frameworks
86
-
87
- /mpm-agents-recommend
88
- 🤖 NEW! Show recommended agents for your project
81
+ /mpm-configure
82
+ 🤖 Unified configuration interface for agents, skills, and project settings
89
83
 
90
84
  /mpm-config [validate|view|status]
91
85
  Manage configuration settings
@@ -184,99 +178,24 @@ Automatically detects your project's toolchain and frameworks, then recommends a
184
178
  - **Full-stack**: Combination of backend + frontend agents
185
179
  - **Testing**: playwright-qa, api-qa based on detected test tools
186
180
 
187
- ### /mpm-agents-detect - Toolchain Detection
181
+ ## Quick Start with Configuration
188
182
 
189
- **Description:**
190
- Scans your project to detect programming languages, frameworks, tools, and configuration files.
183
+ For new projects or first-time setup, use the unified `/mpm-configure` command which provides:
184
+ - Toolchain detection
185
+ - Agent recommendations
186
+ - Skills management
187
+ - Auto-configuration
191
188
 
192
189
  **Usage:**
193
190
  ```
194
- /mpm-agents-detect
195
- ```
196
-
197
- **Output:**
198
- - Detected languages and versions
199
- - Frameworks and their configurations
200
- - Testing tools and test frameworks
201
- - Build tools and bundlers
202
- - Package managers
203
- - Deployment configurations
204
-
205
- **Example:**
191
+ /mpm-configure
206
192
  ```
207
- /mpm-agents-detect
208
-
209
- Detected Project Stack:
210
- ======================
211
- Languages: Python 3.11, Node.js 20.x
212
- Frameworks: FastAPI 0.104.0, React 18.2.0
213
- Testing: pytest, Playwright
214
- Build: Vite 5.0.0
215
- Package Manager: poetry, npm
216
- Deployment: Docker, Vercel
217
- ```
218
-
219
- ### /mpm-agents-recommend - Agent Recommendations
220
-
221
- **Description:**
222
- Based on detected toolchain, shows which agents are recommended for your project with explanations.
223
-
224
- **Usage:**
225
- ```
226
- /mpm-agents-recommend
227
- ```
228
-
229
- **Output:**
230
- - Recommended agents with rationale
231
- - Agent capabilities and when to use them
232
- - Suggested deployment order
233
- - Complementary agent combinations
234
193
 
235
- **Example:**
236
- ```
237
- /mpm-agents-recommend
238
-
239
- Recommended Agents for Your Project:
240
- ===================================
241
-
242
- Essential Agents:
243
- ✓ fastapi-engineer - Detected FastAPI framework
244
- ✓ python-engineer - Python 3.11 project
245
- ✓ api-qa - API testing and validation
246
-
247
- Recommended Agents:
248
- ○ react-engineer - React frontend detected
249
- ○ web-qa - Web UI testing
250
- ○ playwright-qa - Playwright tests found
251
-
252
- Optional Agents:
253
- ○ docker-ops - Docker configuration found
254
- ○ vercel-ops - Vercel deployment detected
255
- ```
256
-
257
- ## Quick Start with Auto-Configuration
258
-
259
- For new projects or first-time setup:
260
-
261
- 1. **Preview what would be configured:**
262
- ```
263
- /mpm-auto-configure --preview
264
- ```
265
-
266
- 2. **Review recommendations:**
267
- ```
268
- /mpm-agents-recommend
269
- ```
270
-
271
- 3. **Apply configuration:**
272
- ```
273
- /mpm-auto-configure
274
- ```
275
-
276
- Or skip straight to auto-apply:
277
- ```
278
- /mpm-auto-configure --yes
279
- ```
194
+ The interactive menu will guide you through:
195
+ 1. Detecting your project's toolchain
196
+ 2. Viewing recommended agents
197
+ 3. Deploying agents and skills
198
+ 4. Managing configuration settings
280
199
 
281
200
  ## Supported Technology Stacks
282
201