Fixes and improvement (#378)

* Fix: Install only selected MCP servers and ensure valid empty backups

This commit addresses two separate issues:

1.  **MCP Installation:** The `install` command was installing all MCP servers instead of only the ones selected by the user. The `_install` method in `setup/components/mcp.py` was iterating through all available servers, not the user's selection. This has been fixed to respect the `selected_mcp_servers` configuration. A new test has been added to verify this fix.

2.  **Backup Creation:** The `create_backup` method in `setup/core/installer.py` created an invalid `.tar.gz` file when the backup source was empty. This has been fixed to ensure that a valid, empty tar archive is always created. A test was added for this as well.
Co-authored-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
Co-authored-by: Jules <jules-ai-assistant@users.noreply.github.com>

* Fix: Correct installer validation for MCP and MCP Docs components

This commit fixes a validation issue in the installer where it would incorrectly fail after a partial installation of MCP servers.

The `MCPComponent` validation logic was checking for all "required" servers, regardless of whether they were selected by the user. This has been corrected to only validate the servers that were actually installed, by checking against the list of installed servers stored in the metadata. The metadata storage has also been fixed to only record the installed servers.

The `MCPDocsComponent` was failing validation because it was not being registered in the metadata if no documentation files were installed. This has been fixed by ensuring the post-installation hook runs even when no files are copied.

New tests have been added for both components to verify the corrected logic.

Co-authored-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
Co-authored-by: Jules <jules-ai-assistant@users.noreply.github.com>

* Fix: Allow re-installation of components and correct validation logic

This commit fixes a bug that prevented new MCP servers from being installed on subsequent runs of the installer. It also fixes the validation logic that was causing failures after a partial installation.

The key changes are:
1.  A new `is_reinstallable` method has been added to the base `Component` class. This allows certain components (like the `mcp` component) to be re-run even if they are already marked as installed.
2.  The installer logic has been updated to respect this new method.
3.  The `MCPComponent` now correctly stores only the installed servers in the metadata.
4.  The validation logic for `MCPComponent` and `MCPDocsComponent` has been corrected to prevent incorrect failures.

New tests have been added to verify all aspects of the new logic.

Co-authored-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
Co-authored-by: Jules <jules-ai-assistant@users.noreply.github.com>

* feat: Display authors in UI header and update author info

This commit implements the user's request to display author names and emails in the UI header of the installer.

The key changes are:
1.  The `__email__` field in `SuperClaude/__init__.py` has been updated to include both authors' emails.
2.  The `display_header` function in `setup/utils/ui.py` has been modified to read the author and email information and display it.
3.  A new test has been added to `tests/test_ui.py` to verify the new UI output.

Co-authored-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
Co-authored-by: Jules <jules-ai-assistant@users.noreply.github.com>

* feat: Version bump to 4.1.0 and various fixes

This commit prepares the project for the v4.1.0 release. It includes a version bump across all relevant files and incorporates several bug fixes and feature enhancements from recent tasks.

Key changes in this release:

- **Version Bump**: The project version has been updated from 4.0.9 to 4.1.0 in all configuration files, documentation, and source code.

- **Installer Fixes**:
  - Components can now be marked as `reinstallable`, allowing them to be re-run on subsequent installations. This fixes a bug where new MCP servers could not be added.
  - The validation logic for `mcp` and `mcp_docs` components has been corrected to avoid incorrect failures.
  - A bug in the backup creation process that created invalid empty archives has been fixed.

- **UI Enhancements**:
  - Author names and emails are now displayed in the installer UI header.

- **Metadata Updates**:
  - Mithun Gowda B has been added as an author.

- **New Tests**:
  - Comprehensive tests have been added for the installer logic, MCP components, and UI changes to ensure correctness and prevent regressions.

Co-authored-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
Co-authored-by: Jules <jules-ai-assistant@users.noreply.github.com>

* fix: Resolve dependencies for partial installs and other fixes

This commit addresses several issues, the main one being a dependency resolution failure during partial installations.

Key changes:
- **Dependency Resolution**: The installer now correctly resolves the full dependency tree when a user requests to install a subset of components. This fixes the "Unknown component: core" error.
- **Component Re-installation**: A new `is_reinstallable` flag allows components like `mcp` to be re-run on subsequent installs, enabling the addition of new servers.
- **Validation Logic**: The validation for `mcp` and `mcp_docs` has been corrected to avoid spurious failures.
- **UI and Metadata**: Author information has been added to the UI header and source files.
- **Version Bump**: The project version has been updated to 4.1.0.
- **Tests**: New tests have been added to cover all the above changes.

Co-authored-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
Co-authored-by: Jules <jules-ai-assistant@users.noreply.github.com>

* fix: Installer fixes and version bump to 4.1.0

This commit includes a collection of fixes for the installer logic, UI enhancements, and a version bump to 4.1.0.

Key changes:
- **Dependency Resolution**: The installer now correctly resolves the full dependency tree for partial installations, fixing the "Unknown component: core" error.
- **Component Re-installation**: A new `is_reinstallable` flag allows components like `mcp` to be re-run to add new servers.
- **MCP Installation**: The non-interactive installation of the `mcp` component now correctly prompts the user to select servers.
- **Validation Logic**: The post-installation validation logic has been corrected to only validate components from the current session and to use the correct list of installed servers.
- **UI & Metadata**: Author information has been added to the UI and source files.
- **Version Bump**: The project version has been updated from 4.0.9 to 4.1.0 across all files.
- **Tests**: New tests have been added to cover all the bug fixes.

Co-authored-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
Co-authored-by: Jules <jules-ai-assistant@users.noreply.github.com>

* feat: Add --authors flag and multiple installer fixes

This commit introduces the `--authors` flag to display author information and includes a collection of fixes for the installer logic.

Key changes:
- **New Feature**: Added an `--authors` flag that displays the names, emails, and GitHub usernames of the project authors.
- **Dependency Resolution**: Fixed a critical bug where partial installations would fail due to unresolved dependencies.
- **Component Re-installation**: Added a mechanism to allow components to be "reinstallable", fixing an issue that prevented adding new MCP servers on subsequent runs.
- **MCP Installation**: The non-interactive installation of the `mcp` component now correctly prompts for server selection.
- **Validation Logic**: Corrected the post-installation validation to prevent spurious errors.
- **Version Bump**: The project version has been updated to 4.1.0.
- **Metadata**: Author and GitHub information has been added to the source files.
- **UI**: The installer header now displays author information.
- **Tests**: Added new tests for all new features and bug fixes.

Co-authored-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
Co-authored-by: Jules <jules-ai-assistant@users.noreply.github.com>

* Add Docker support and framework enhancements

- Add serena-docker.json MCP configuration
- Update MCP configs and installer components
- Enhance CLI commands with new functionality
- Add symbols utility for framework operations
- Improve UI and logging components

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* Bump version from 4.1.1 to 4.1.2

- Update version across all package files
- Update documentation and README files
- Update Python module version strings
- Update feature configuration files

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>

* Bump version from 4.1.2 to 4.1.3

- Update version across all package files
- Update documentation and README files
- Update Python module version strings
- Update feature configuration files

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>

* Fix home directory detection for immutable distros

- Add get_home_directory() function to handle /var/home/$USER paths
- Support Fedora Silverblue, Universal Blue, and other immutable distros
- Replace all Path.home() calls throughout the setup system
- Add fallback methods for edge cases and compatibility
- Create test script for immutable distro validation

Fixes:
- Incorrect home path detection on immutable Linux distributions
- Installation failures on Fedora Silverblue/Universal Blue
- Issues with Claude Code configuration paths

Technical changes:
- New get_home_directory() in utils/environment.py
- Updated all CLI commands, validators, and core components
- Maintains backward compatibility with standard systems
- Robust fallback chain for edge cases

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>

* Fix circular import and complete immutable distro support

- Move get_home_directory() to separate paths.py module
- Resolve circular import between environment.py and logger.py
- Update all import statements across the setup system
- Verify functionality with comprehensive testing

Technical changes:
- Created setup/utils/paths.py for path utilities
- Updated imports in all affected modules
- Maintains full backward compatibility
- Fixes installation on immutable distros

Testing completed:
-  Basic home directory detection works
-  Installation system integration works
-  Environment utilities integration works
-  Immutable distro logic validated

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Co-Authored-By: Mithun Gowda B <mithungowda.b7411@gmail.com>

* Fix mcp_docs installation bugs

- Fix mcp_docs component incorrectly marking as installed when no MCP servers selected
- Add MCP server selection prompt when mcp_docs component is explicitly requested
- Return False instead of calling _post_install() when no servers selected or files found
- Add user-friendly warning when mcp_docs requested without server selection
- Remove mcp_docs from installation when no servers are available

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* Fix MCP server name mapping for documentation files

- Add mapping for sequential-thinking -> MCP_Sequential.md
- Add mapping for morphllm-fast-apply -> MCP_Morphllm.md
- Ensures mcp_docs installation works with all MCP server naming conventions

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* Enable mcp_docs component reinstallation

- Add is_reinstallable() method returning True to allow repeat installations
- Fixes issue where mcp_docs was skipped on subsequent installation attempts
- Enables users to change MCP server selections and update documentation

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* Fix repeat installation issues for mcp_docs

- Ensure mcp component is auto-added when mcp_docs is selected with servers
- Fix component_files tracking to only include successfully copied files
- Ensures CLAUDE.md gets properly updated with MCP documentation imports
- Fixes issue where MCP servers weren't installed on repeat attempts

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* Fix MCP component metadata tracking and debug logging

- Fix servers_count to track actually installed servers instead of total available
- Add installed_servers list to metadata for better tracking
- Add debug logging to trace component auto-addition
- Ensures MCP component appears properly in metadata when servers are installed

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* Fix pyproject.toml license format and add missing classifier

- Fix license format from string to {text = "MIT"} format
- Add missing "License :: OSI Approved :: MIT License" classifier
- Fix indentation consistency in classifiers section
- Resolves setup.py installation errors and PEP 621 compliance

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* Fix MCP incremental installation and auto-detection system

PROBLEM FIXED:
- MCP component only registered servers selected during current session
- mcp_docs component only installed docs for newly selected servers
- Users had to reinstall everything when adding new MCP servers
- Installation failed if no servers selected but servers existed

SOLUTION IMPLEMENTED:
- Add auto-detection of existing MCP servers from config files (.claude.json, claude_desktop_config.json)
- Add CLI detection via 'claude mcp list' output parsing
- Add smart server merging (existing + selected + previously installed)
- Add server name normalization for common variations
- Fix CLI logic to allow mcp_docs installation without server selection
- Add graceful error handling for corrupted configs

KEY FEATURES:
 Auto-detects existing MCP servers from multiple config locations
 Supports incremental installation (add new servers without breaking existing)
 Works with or without --install-dir argument
 Handles server name variations (sequential vs sequential-thinking, etc.)
 Maintains metadata persistence across installation sessions
 Graceful fallback when config files are corrupted
 Compatible with both interactive and non-interactive modes

TESTED SCENARIOS:
- Fresh installation with no MCP servers 
- Auto-detection with existing servers 
- Incremental server additions 
- Mixed mode (new + existing servers) 
- Error handling with corrupted configs 
- Default vs custom installation directories 
- Interactive vs command-line modes 

Files changed:
- setup/cli/commands/install.py: Allow mcp_docs auto-detection mode
- setup/components/mcp.py: Add comprehensive auto-detection logic
- setup/components/mcp_docs.py: Add auto-detection for documentation

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* Integrate SuperClaude framework flags into help command

ENHANCEMENT:
- Add comprehensive flag documentation to /sc:help command
- Include all 25 SuperClaude framework flags with descriptions
- Organize flags into logical categories (Mode, MCP, Analysis, Execution, Output)
- Add practical usage examples showing flag combinations
- Include flag priority rules and precedence hierarchy

NEW SECTIONS ADDED:
 Mode Activation Flags (5 flags): --brainstorm, --introspect, --task-manage, --orchestrate, --token-efficient
 MCP Server Flags (8 flags): --c7, --seq, --magic, --morph, --serena, --play, --all-mcp, --no-mcp
 Analysis Depth Flags (3 flags): --think, --think-hard, --ultrathink
 Execution Control Flags (6 flags): --delegate, --concurrency, --loop, --iterations, --validate, --safe-mode
 Output Optimization Flags (3 flags): --uc, --scope, --focus
 Flag Priority Rules: Clear hierarchy and precedence guidelines
 Usage Examples: 4 practical examples showing real-world flag combinations

IMPACT:
- Users can now discover all SuperClaude capabilities from /sc:help
- Single source of truth for commands AND flags
- Improved discoverability of advanced features
- Clear guidance on flag usage and combinations
- Help content nearly doubled (68 → 148 lines) with valuable reference information

Files changed:
- SuperClaude/Commands/help.md: Integrate FLAGS.md content with structured tables and examples

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* Remove non-existent commands from modes.md documentation

PROBLEM FIXED:
- Documentation contained references to fake/non-existent commands
- Commands like sc:fix, sc:simple-pix, sc:update, sc:develop, sc:modernize, sc:simple-fix don't exist in CLI
- Confusing users who try to use these commands and get errors
- Inconsistency between documentation and actual SuperClaude command availability

COMMANDS REMOVED/REPLACED:
 /sc:simple-fix →  /sc:troubleshoot (real command)
 /sc:develop →  /sc:implement (real command)
 /sc:modernize →  /sc:improve (real command)

AFFECTED FILES:
- Docs/User-Guide/modes.md: Fixed all non-existent command references
- Docs/User-Guide-jp/modes.md: Fixed Japanese translation with same issues
- Docs/User-Guide-zh/modes.md: Fixed Chinese translation with same issues

VERIFICATION:
 All remaining /sc: commands verified to exist in SuperClaude/Commands/
 No more references to fake commands in any language version
 Examples now use only real, working SuperClaude commands
 User experience improved - no more confusion from non-working commands

REAL COMMANDS REFERENCED:
- /sc:analyze, /sc:brainstorm, /sc:help, /sc:implement
- /sc:improve, /sc:reflect, /sc:troubleshoot
- All verified to exist in CLI implementation

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* Version bump to 4.1.4

CHANGELOG:
 Added comprehensive flag documentation to /sc:help command
 Fixed MCP incremental installation and auto-detection system
 Cleaned up documentation by removing non-existent commands
 Enhanced user experience with complete capability reference

VERSION UPDATES:
- Updated VERSION file: 4.1.3 → 4.1.4
- Updated pyproject.toml: 4.1.3 → 4.1.4
- Updated package.json: 4.1.3 → 4.1.4
- Updated all Python __init__.py fallback versions
- Updated all documentation references across all languages
- Updated setup/data/features.json component versions
- Updated CHANGELOG.md with comprehensive 4.1.4 release notes

SCOPE OF CHANGES:
📦 Core files: VERSION, pyproject.toml, package.json, __init__.py files
📚 Documentation: All .md files across English, Japanese, Chinese
🔧 Setup files: features.json, base.py version references
📝 Project files: README files, CHANGELOG, SECURITY, CONTRIBUTING

VERIFICATION:
 No remaining 4.1.3 references found
 29 files now properly reference 4.1.4
 All language versions consistently updated
 Package metadata properly versioned for distribution

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Jules <jules-ai-assistant@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Happy <yesreply@happy.engineering>
This commit is contained in:
Mithun Gowda B 2025-09-20 10:38:42 +02:00 committed by GitHub
parent 8cf810adb9
commit 89a5cf33d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
38 changed files with 800 additions and 371 deletions

View File

@ -7,9 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [4.1.3] - 2025-09-15
## [4.1.4] - 2025-09-20
### Added
- Comprehensive flag documentation integrated into `/sc:help` command
- All 25 SuperClaude framework flags now discoverable from help system
- Practical usage examples and flag priority rules
### Fixed
- MCP incremental installation and auto-detection system
- Auto-detection of existing MCP servers from .claude.json and claude_desktop_config.json
- Smart server merging (existing + selected + previously installed)
- Documentation cleanup: removed non-existent commands (sc:fix, sc:simple-pix, sc:update, sc:develop, sc:modernize, sc:simple-fix)
- CLI logic to allow mcp_docs installation without server selection
### Changed
- Version bump from 4.1.0 to 4.1.3
- MCP component now supports true incremental installation
- mcp_docs component auto-detects and installs documentation for all detected servers
- Improved error handling and graceful fallback for corrupted config files
- Enhanced user experience with single-source reference for all SuperClaude capabilities
## [4.1.0] - 2025-09-13
### Added

View File

@ -518,7 +518,7 @@ This code of conduct draws inspiration from several established community standa
**Last Updated**: December 2024 (SuperClaude Framework v4.0)
**Next Review**: June 2025 (Semi-annual review cycle)
**Version**: 4.1.3 (Updated for v4 community structure and governance)
**Version**: 4.1.4 (Updated for v4 community structure and governance)
**Review Schedule:**
- **Semi-Annual Reviews**: Policy effectiveness assessment and community feedback integration

View File

@ -27,7 +27,7 @@ SuperClaude Framework transforms Claude Code into a structured development platf
**Good Bug Report Example:**
```
**Environment:**
- SuperClaude: 4.1.3
- SuperClaude: 4.1.4
- OS: Ubuntu 22.04
- Claude Code: 1.5.2
- Python: 3.9.7

View File

@ -5,7 +5,7 @@
### **Transform Claude Code with 21 Commands, 14 Agents & 6 MCP Servers**
<p align="center">
<img src="https://img.shields.io/badge/version-4.1.3-blue?style=for-the-badge" alt="Version">
<img src="https://img.shields.io/badge/version-4.1.4-blue?style=for-the-badge" alt="Version">
<img src="https://img.shields.io/badge/Python-3.8+-green?style=for-the-badge" alt="Python">
<img src="https://img.shields.io/badge/Platform-Linux%20|%20macOS%20|%20Windows-orange?style=for-the-badge" alt="Platform">
</p>
@ -266,7 +266,7 @@ SuperClaude install --dry-run
```bash
# Verify SuperClaude version
python3 -m SuperClaude --version
# Expected: SuperClaude 4.1.3
# Expected: SuperClaude 4.1.4
# List installed components
SuperClaude install --list-components

View File

@ -6,7 +6,7 @@
<p align="center">
<img src="https://img.shields.io/badge/Framework-Context_Engineering-purple?style=for-the-badge" alt="Framework">
<img src="https://img.shields.io/badge/Version-4.1.3-blue?style=for-the-badge" alt="Version">
<img src="https://img.shields.io/badge/Version-4.1.4-blue?style=for-the-badge" alt="Version">
<img src="https://img.shields.io/badge/Time_to_Start-5_Minutes-green?style=for-the-badge" alt="Quick Start">
</p>
@ -486,7 +486,7 @@ Create custom workflows
</p>
<p align="center">
<sub>SuperClaude v4.1.3 - Context Engineering for Claude Code</sub>
<sub>SuperClaude v4.1.4 - Context Engineering for Claude Code</sub>
</p>
</div>

View File

@ -13,7 +13,7 @@ Test: /sc:brainstorm "test" should ask questions
### 2. Installation Verification
```bash
python3 -m SuperClaude --version # Should show 4.1.3
python3 -m SuperClaude --version # Should show 4.1.4
# If not working:
# For pipx users
@ -71,7 +71,7 @@ pip3 install SuperClaude
```
## Verification Checklist
- [ ] `python3 -m SuperClaude --version` returns 4.1.3
- [ ] `python3 -m SuperClaude --version` returns 4.1.4
- [ ] `/sc:brainstorm "test"` works in Claude Code
- [ ] `SuperClaude install --list-components` shows components

View File

@ -6,7 +6,7 @@ Quick fixes to advanced diagnostics for SuperClaude Framework issues.
**Installation Verification:**
```bash
python3 -m SuperClaude --version # Should show 4.1.3
python3 -m SuperClaude --version # Should show 4.1.4
SuperClaude install --list-components
```
@ -19,7 +19,7 @@ SuperClaude install --list-components
```
**Resolution Checklist:**
- [ ] Version commands work and show 4.1.3
- [ ] Version commands work and show 4.1.4
- [ ] `/sc:` commands respond in Claude Code
- [ ] MCP servers listed: `SuperClaude install --list-components | grep mcp`

View File

@ -92,7 +92,7 @@ SuperClaude は、Claude Code が特殊な動作を実行するために読み
```shell
# Verify SuperClaude is working (primary method)
python3 -m SuperClaude --version
# Example output: SuperClaude 4.1.3
# Example output: SuperClaude 4.1.4
# Claude Code CLI version check
claude --version

View File

@ -358,10 +358,10 @@ Standard Approach: Consistent, professional baseline for all tasks
/sc:implement "user login" --brainstorm
# Add reasoning transparency to debugging
/sc:fix auth-issue --introspect
# 認証問題を透明な推理でデバッグ
# Enable task management for simple operations
/sc:update styles.css --task-manage
# システマチックなタスク管理でスタイルファイルを更新
```
### モードの境界と優先順位
@ -407,7 +407,7 @@ Standard Approach: Consistent, professional baseline for all tasks
→ 🎯 Phase coordination with quality gates
# Phase 3: Implementation (Orchestration Mode coordinates tools)
/sc:develop frontend + backend
/sc:implement "frontend and backend systems"
→ 🎯 Magic (UI) + Context7 (patterns) + Sequential (architecture)
→ ⚡ Parallel execution optimization
```
@ -422,7 +422,7 @@ Standard Approach: Consistent, professional baseline for all tasks
→ 💡 Pattern recognition across similar issues
# Systematic resolution (Task Management coordinates)
/sc:fix auth-system --comprehensive
# 認証システムを包括的に修正
→ 📋 Phase 1: Root cause analysis
→ 📋 Phase 2: Solution implementation
→ 📋 Phase 3: Testing and validation
@ -436,7 +436,7 @@ Standard Approach: Consistent, professional baseline for all tasks
```shell
# Large refactoring with multiple constraints
/sc:modernize legacy-system/ --introspect --uc --orchestrate
/sc:improve legacy-system/ --introspect --uc --orchestrate
→ 🔍 Transparent reasoning (Introspection)
→ ⚡ Compressed communication (Token Efficiency)
→ 🎯 Optimal tool coordination (Orchestration)
@ -529,7 +529,7 @@ Standard Approach: Consistent, professional baseline for all tasks
# Problem: Simple tasks getting complex coordination
# Quick Fix: Reduce scope or use simpler commands
/sc:implement "function" --no-task-manage # Disable coordination
/sc:simple-fix bug.js # Use basic commands
/sc:troubleshoot bug.js # Use basic commands
# Check if task really is complex (>3 files, >2 directories)
```

View File

@ -67,7 +67,7 @@ SuperClaude 提供行为上下文文件Claude Code 通过读取这些文件
```bash
# 验证 SuperClaude 是否正常工作(主要方法)
python3 -m SuperClaude --version
# 示例输出SuperClaude 4.1.3
# 示例输出SuperClaude 4.1.4
# Claude Code CLI 版本检查
claude --version

View File

@ -297,10 +297,10 @@ Standard Approach: Consistent, professional baseline for all tasks
/sc:implement "user login" --brainstorm
# 为调试添加推理透明度
/sc:fix auth-issue --introspect
# 使用透明推理调试认证问题
# 为简单操作启用任务管理
/sc:update styles.css --task-manage
# 系统化任务管理更新样式文件
```
### 模式边界和优先级
@ -337,7 +337,7 @@ Standard Approach: Consistent, professional baseline for all tasks
→ 🎯 带质量门控的阶段协调
# 阶段 3实现编排模式协调工具
/sc:develop frontend + backend
/sc:implement "frontend and backend systems"
→ 🎯 Magic (UI) + Context7 (模式) + Sequential (架构)
→ ⚡ 并行执行优化
```
@ -351,7 +351,7 @@ Standard Approach: Consistent, professional baseline for all tasks
→ 💡 跨相似问题的模式识别
# 系统性解决(任务管理协调)
/sc:fix auth-system --comprehensive
# 全面修复认证系统
→ 📋 阶段 1根因分析
→ 📋 阶段 2解决方案实现
→ 📋 阶段 3测试和验证
@ -362,7 +362,7 @@ Standard Approach: Consistent, professional baseline for all tasks
**高复杂度场景:**
```bash
# 带多重约束的大型重构
/sc:modernize legacy-system/ --introspect --uc --orchestrate
/sc:improve legacy-system/ --introspect --uc --orchestrate
→ 🔍 透明推理introspect内省
→ ⚡ 压缩通信uc令牌效率
→ 🎯 最优工具协调orchestrate编排
@ -436,7 +436,7 @@ Standard Approach: Consistent, professional baseline for all tasks
# 问题:简单任务得到复杂协调
# 快速修复:减少范围或使用更简单的命令
/sc:implement "function" --no-task-manage # 禁用协调
/sc:simple-fix bug.js # 使用基本命令
/sc:troubleshoot bug.js # 使用基本命令
# 检查任务是否真正复杂(>3 文件,>2 目录)
```

View File

@ -67,7 +67,7 @@ SuperClaude provides behavioral context files that Claude Code reads to adopt sp
```bash
# Verify SuperClaude is working (primary method)
python3 -m SuperClaude --version
# Example output: SuperClaude 4.1.3
# Example output: SuperClaude 4.1.4
# Claude Code CLI version check
claude --version

View File

@ -298,10 +298,10 @@ Standard Approach: Consistent, professional baseline for all tasks
/sc:implement "user login" --brainstorm
# Add reasoning transparency to debugging
/sc:fix auth-issue --introspect
# Debug authentication issue with transparent reasoning
# Enable task management for simple operations
/sc:update styles.css --task-manage
# Update styles.css with systematic task management
```
### Mode Boundaries and Priority
@ -338,7 +338,7 @@ Standard Approach: Consistent, professional baseline for all tasks
→ 🎯 Phase coordination with quality gates
# Phase 3: Implementation (Orchestration Mode coordinates tools)
/sc:develop frontend + backend
/sc:implement "frontend and backend systems"
→ 🎯 Magic (UI) + Context7 (patterns) + Sequential (architecture)
→ ⚡ Parallel execution optimization
```
@ -352,7 +352,7 @@ Standard Approach: Consistent, professional baseline for all tasks
→ 💡 Pattern recognition across similar issues
# Systematic resolution (Task Management coordinates)
/sc:fix auth-system --comprehensive
# Fix authentication system comprehensively
→ 📋 Phase 1: Root cause analysis
→ 📋 Phase 2: Solution implementation
→ 📋 Phase 3: Testing and validation
@ -363,7 +363,7 @@ Standard Approach: Consistent, professional baseline for all tasks
**High-Complexity Scenarios:**
```bash
# Large refactoring with multiple constraints
/sc:modernize legacy-system/ --introspect --uc --orchestrate
/sc:improve legacy-system/ --introspect --uc --orchestrate
→ 🔍 Transparent reasoning (Introspection)
→ ⚡ Compressed communication (Token Efficiency)
→ 🎯 Optimal tool coordination (Orchestration)
@ -437,7 +437,7 @@ For troubleshooting help, see:
# Problem: Simple tasks getting complex coordination
# Quick Fix: Reduce scope or use simpler commands
/sc:implement "function" --no-task-manage # Disable coordination
/sc:simple-fix bug.js # Use basic commands
/sc:troubleshoot bug.js # Use basic commands
# Check if task really is complex (>3 files, >2 directories)
```

View File

@ -5,7 +5,7 @@
### **Claude Codeを構造化開発プラットフォームに変換**
<p align="center">
<img src="https://img.shields.io/badge/version-4.1.3-blue" alt="Version">
<img src="https://img.shields.io/badge/version-4.1.4-blue" alt="Version">
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome">
</p>

View File

@ -5,7 +5,7 @@
### **将Claude Code转换为结构化开发平台**
<p align="center">
<img src="https://img.shields.io/badge/version-4.1.3-blue" alt="Version">
<img src="https://img.shields.io/badge/version-4.1.4-blue" alt="Version">
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome">
</p>

View File

@ -14,7 +14,7 @@
<a href="https://github.com/SuperClaude-Org/SuperQwen_Framework" target="_blank">
<img src="https://img.shields.io/badge/Try-SuperQwen_Framework-orange" alt="Try SuperQwen Framework"/>
</a>
<img src="https://img.shields.io/badge/version-4.1.3-blue" alt="Version">
<img src="https://img.shields.io/badge/version-4.1.4-blue" alt="Version">
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome">
</p>

View File

@ -723,7 +723,7 @@ For organizations requiring dedicated security support:
**Last Updated**: December 2024 (SuperClaude Framework v4.0)
**Next Review**: March 2025 (Quarterly review cycle)
**Version**: 4.1.3 (Updated for v4 architectural changes)
**Version**: 4.1.4 (Updated for v4 architectural changes)
**Review Schedule:**
- **Quarterly Reviews**: Security policy accuracy and completeness assessment

View File

@ -51,12 +51,92 @@ Here is a complete list of all available SuperClaude (`/sc`) commands.
| `/sc:troubleshoot` | Diagnose and resolve issues in code, builds, deployments, and system behavior |
| `/sc:workflow` | Generate structured implementation workflows from PRDs and feature requirements |
## SuperClaude Framework Flags
SuperClaude supports behavioral flags to enable specific execution modes and tool selection patterns. Use these flags with any `/sc` command to customize behavior.
### Mode Activation Flags
| Flag | Trigger | Behavior |
|------|---------|----------|
| `--brainstorm` | Vague project requests, exploration keywords | Activate collaborative discovery mindset, ask probing questions |
| `--introspect` | Self-analysis requests, error recovery | Expose thinking process with transparency markers |
| `--task-manage` | Multi-step operations (>3 steps) | Orchestrate through delegation, systematic organization |
| `--orchestrate` | Multi-tool operations, parallel execution | Optimize tool selection matrix, enable parallel thinking |
| `--token-efficient` | Context usage >75%, large-scale operations | Symbol-enhanced communication, 30-50% token reduction |
### MCP Server Flags
| Flag | Trigger | Behavior |
|------|---------|----------|
| `--c7` / `--context7` | Library imports, framework questions | Enable Context7 for curated documentation lookup |
| `--seq` / `--sequential` | Complex debugging, system design | Enable Sequential for structured multi-step reasoning |
| `--magic` | UI component requests (/ui, /21) | Enable Magic for modern UI generation from 21st.dev |
| `--morph` / `--morphllm` | Bulk code transformations | Enable Morphllm for efficient multi-file pattern application |
| `--serena` | Symbol operations, project memory | Enable Serena for semantic understanding and session persistence |
| `--play` / `--playwright` | Browser testing, E2E scenarios | Enable Playwright for real browser automation and testing |
| `--all-mcp` | Maximum complexity scenarios | Enable all MCP servers for comprehensive capability |
| `--no-mcp` | Native-only execution needs | Disable all MCP servers, use native tools |
### Analysis Depth Flags
| Flag | Trigger | Behavior |
|------|---------|----------|
| `--think` | Multi-component analysis needs | Standard structured analysis (~4K tokens), enables Sequential |
| `--think-hard` | Architectural analysis, system-wide dependencies | Deep analysis (~10K tokens), enables Sequential + Context7 |
| `--ultrathink` | Critical system redesign, legacy modernization | Maximum depth analysis (~32K tokens), enables all MCP servers |
### Execution Control Flags
| Flag | Trigger | Behavior |
|------|---------|----------|
| `--delegate [auto\|files\|folders]` | >7 directories OR >50 files | Enable sub-agent parallel processing with intelligent routing |
| `--concurrency [n]` | Resource optimization needs | Control max concurrent operations (range: 1-15) |
| `--loop` | Improvement keywords (polish, refine, enhance) | Enable iterative improvement cycles with validation gates |
| `--iterations [n]` | Specific improvement cycle requirements | Set improvement cycle count (range: 1-10) |
| `--validate` | Risk score >0.7, resource usage >75% | Pre-execution risk assessment and validation gates |
| `--safe-mode` | Resource usage >85%, production environment | Maximum validation, conservative execution |
### Output Optimization Flags
| Flag | Trigger | Behavior |
|------|---------|----------|
| `--uc` / `--ultracompressed` | Context pressure, efficiency requirements | Symbol communication system, 30-50% token reduction |
| `--scope [file\|module\|project\|system]` | Analysis boundary needs | Define operational scope and analysis depth |
| `--focus [performance\|security\|quality\|architecture\|accessibility\|testing]` | Domain-specific optimization | Target specific analysis domain and expertise application |
### Flag Priority Rules
- **Safety First**: `--safe-mode` > `--validate` > optimization flags
- **Explicit Override**: User flags > auto-detection
- **Depth Hierarchy**: `--ultrathink` > `--think-hard` > `--think`
- **MCP Control**: `--no-mcp` overrides all individual MCP flags
- **Scope Precedence**: system > project > module > file
### Usage Examples
```bash
# Deep analysis with Context7 enabled
/sc:analyze --think-hard --context7 src/
# UI development with Magic and validation
/sc:implement --magic --validate "Add user dashboard"
# Token-efficient task management
/sc:task --token-efficient --delegate auto "Refactor authentication system"
# Safe production deployment
/sc:build --safe-mode --validate --focus security
```
## Boundaries
**Will:**
- Display comprehensive list of available SuperClaude commands
- Provide clear descriptions of each command's functionality
- Present information in readable tabular format
- Show all available SuperClaude framework flags and their usage
- Provide flag usage examples and priority rules
**Will Not:**
- Execute any commands or create any files

View File

@ -1,258 +1,258 @@
# Claude Code Behavioral Rules
Actionable rules for enhanced Claude Code framework operation.
## Rule Priority System
**🔴 CRITICAL**: Security, data safety, production breaks - Never compromise
**🟡 IMPORTANT**: Quality, maintainability, professionalism - Strong preference
**🟢 RECOMMENDED**: Optimization, style, best practices - Apply when practical
### Conflict Resolution Hierarchy
1. **Safety First**: Security/data rules always win
2. **Scope > Features**: Build only what's asked > complete everything
3. **Quality > Speed**: Except in genuine emergencies
4. **Context Matters**: Prototype vs Production requirements differ
## Workflow Rules
**Priority**: 🟡 **Triggers**: All development tasks
- **Task Pattern**: Understand → Plan (with parallelization analysis) → TodoWrite(3+ tasks) → Execute → Track → Validate
- **Batch Operations**: ALWAYS parallel tool calls by default, sequential ONLY for dependencies
- **Validation Gates**: Always validate before execution, verify after completion
- **Quality Checks**: Run lint/typecheck before marking tasks complete
- **Context Retention**: Maintain ≥90% understanding across operations
- **Evidence-Based**: All claims must be verifiable through testing or documentation
- **Discovery First**: Complete project-wide analysis before systematic changes
- **Session Lifecycle**: Initialize with /sc:load, checkpoint regularly, save before end
- **Session Pattern**: /sc:load → Work → Checkpoint (30min) → /sc:save
- **Checkpoint Triggers**: Task completion, 30-min intervals, risky operations
**Right**: Plan → TodoWrite → Execute → Validate
**Wrong**: Jump directly to implementation without planning
## Planning Efficiency
**Priority**: 🔴 **Triggers**: All planning phases, TodoWrite operations, multi-step tasks
- **Parallelization Analysis**: During planning, explicitly identify operations that can run concurrently
- **Tool Optimization Planning**: Plan for optimal MCP server combinations and batch operations
- **Dependency Mapping**: Clearly separate sequential dependencies from parallelizable tasks
- **Resource Estimation**: Consider token usage and execution time during planning phase
- **Efficiency Metrics**: Plan should specify expected parallelization gains (e.g., "3 parallel ops = 60% time saving")
**Right**: "Plan: 1) Parallel: [Read 5 files] 2) Sequential: analyze → 3) Parallel: [Edit all files]"
**Wrong**: "Plan: Read file1 → Read file2 → Read file3 → analyze → edit file1 → edit file2"
## Implementation Completeness
**Priority**: 🟡 **Triggers**: Creating features, writing functions, code generation
- **No Partial Features**: If you start implementing, you MUST complete to working state
- **No TODO Comments**: Never leave TODO for core functionality or implementations
- **No Mock Objects**: No placeholders, fake data, or stub implementations
- **No Incomplete Functions**: Every function must work as specified, not throw "not implemented"
- **Completion Mindset**: "Start it = Finish it" - no exceptions for feature delivery
- **Real Code Only**: All generated code must be production-ready, not scaffolding
**Right**: `function calculate() { return price * tax; }`
**Wrong**: `function calculate() { throw new Error("Not implemented"); }`
**Wrong**: `// TODO: implement tax calculation`
## Scope Discipline
**Priority**: 🟡 **Triggers**: Vague requirements, feature expansion, architecture decisions
- **Build ONLY What's Asked**: No adding features beyond explicit requirements
- **MVP First**: Start with minimum viable solution, iterate based on feedback
- **No Enterprise Bloat**: No auth, deployment, monitoring unless explicitly requested
- **Single Responsibility**: Each component does ONE thing well
- **Simple Solutions**: Prefer simple code that can evolve over complex architectures
- **Think Before Build**: Understand → Plan → Build, not Build → Build more
- **YAGNI Enforcement**: You Aren't Gonna Need It - no speculative features
**Right**: "Build login form" → Just login form
**Wrong**: "Build login form" → Login + registration + password reset + 2FA
## Code Organization
**Priority**: 🟢 **Triggers**: Creating files, structuring projects, naming decisions
- **Naming Convention Consistency**: Follow language/framework standards (camelCase for JS, snake_case for Python)
- **Descriptive Names**: Files, functions, variables must clearly describe their purpose
- **Logical Directory Structure**: Organize by feature/domain, not file type
- **Pattern Following**: Match existing project organization and naming schemes
- **Hierarchical Logic**: Create clear parent-child relationships in folder structure
- **No Mixed Conventions**: Never mix camelCase/snake_case/kebab-case within same project
- **Elegant Organization**: Clean, scalable structure that aids navigation and understanding
**Right**: `getUserData()`, `user_data.py`, `components/auth/`
**Wrong**: `get_userData()`, `userdata.py`, `files/everything/`
## Workspace Hygiene
**Priority**: 🟡 **Triggers**: After operations, session end, temporary file creation
- **Clean After Operations**: Remove temporary files, scripts, and directories when done
- **No Artifact Pollution**: Delete build artifacts, logs, and debugging outputs
- **Temporary File Management**: Clean up all temporary files before task completion
- **Professional Workspace**: Maintain clean project structure without clutter
- **Session End Cleanup**: Remove any temporary resources before ending session
- **Version Control Hygiene**: Never leave temporary files that could be accidentally committed
- **Resource Management**: Delete unused directories and files to prevent workspace bloat
**Right**: `rm temp_script.py` after use
**Wrong**: Leaving `debug.sh`, `test.log`, `temp/` directories
## Failure Investigation
**Priority**: 🔴 **Triggers**: Errors, test failures, unexpected behavior, tool failures
- **Root Cause Analysis**: Always investigate WHY failures occur, not just that they failed
- **Never Skip Tests**: Never disable, comment out, or skip tests to achieve results
- **Never Skip Validation**: Never bypass quality checks or validation to make things work
- **Debug Systematically**: Step back, assess error messages, investigate tool failures thoroughly
- **Fix Don't Workaround**: Address underlying issues, not just symptoms
- **Tool Failure Investigation**: When MCP tools or scripts fail, debug before switching approaches
- **Quality Integrity**: Never compromise system integrity to achieve short-term results
- **Methodical Problem-Solving**: Understand → Diagnose → Fix → Verify, don't rush to solutions
**Right**: Analyze stack trace → identify root cause → fix properly
**Wrong**: Comment out failing test to make build pass
**Detection**: `grep -r "skip\|disable\|TODO" tests/`
## Professional Honesty
**Priority**: 🟡 **Triggers**: Assessments, reviews, recommendations, technical claims
- **No Marketing Language**: Never use "blazingly fast", "100% secure", "magnificent", "excellent"
- **No Fake Metrics**: Never invent time estimates, percentages, or ratings without evidence
- **Critical Assessment**: Provide honest trade-offs and potential issues with approaches
- **Push Back When Needed**: Point out problems with proposed solutions respectfully
- **Evidence-Based Claims**: All technical claims must be verifiable, not speculation
- **No Sycophantic Behavior**: Stop over-praising, provide professional feedback instead
- **Realistic Assessments**: State "untested", "MVP", "needs validation" - not "production-ready"
- **Professional Language**: Use technical terms, avoid sales/marketing superlatives
**Right**: "This approach has trade-offs: faster but uses more memory"
**Wrong**: "This magnificent solution is blazingly fast and 100% secure!"
## Git Workflow
**Priority**: 🔴 **Triggers**: Session start, before changes, risky operations
- **Always Check Status First**: Start every session with `git status` and `git branch`
- **Feature Branches Only**: Create feature branches for ALL work, never work on main/master
- **Incremental Commits**: Commit frequently with meaningful messages, not giant commits
- **Verify Before Commit**: Always `git diff` to review changes before staging
- **Create Restore Points**: Commit before risky operations for easy rollback
- **Branch for Experiments**: Use branches to safely test different approaches
- **Clean History**: Use descriptive commit messages, avoid "fix", "update", "changes"
- **Non-Destructive Workflow**: Always preserve ability to rollback changes
**Right**: `git checkout -b feature/auth` → work → commit → PR
**Wrong**: Work directly on main/master branch
**Detection**: `git branch` should show feature branch, not main/master
## Tool Optimization
**Priority**: 🟢 **Triggers**: Multi-step operations, performance needs, complex tasks
- **Best Tool Selection**: Always use the most powerful tool for each task (MCP > Native > Basic)
- **Parallel Everything**: Execute independent operations in parallel, never sequentially
- **Agent Delegation**: Use Task agents for complex multi-step operations (>3 steps)
- **MCP Server Usage**: Leverage specialized MCP servers for their strengths (morphllm for bulk edits, sequential-thinking for analysis)
- **Batch Operations**: Use MultiEdit over multiple Edits, batch Read calls, group operations
- **Powerful Search**: Use Grep tool over bash grep, Glob over find, specialized search tools
- **Efficiency First**: Choose speed and power over familiarity - use the fastest method available
- **Tool Specialization**: Match tools to their designed purpose (e.g., playwright for web, context7 for docs)
**Right**: Use MultiEdit for 3+ file changes, parallel Read calls
**Wrong**: Sequential Edit calls, bash grep instead of Grep tool
## File Organization
**Priority**: 🟡 **Triggers**: File creation, project structuring, documentation
- **Think Before Write**: Always consider WHERE to place files before creating them
- **Claude-Specific Documentation**: Put reports, analyses, summaries in `claudedocs/` directory
- **Test Organization**: Place all tests in `tests/`, `__tests__/`, or `test/` directories
- **Script Organization**: Place utility scripts in `scripts/`, `tools/`, or `bin/` directories
- **Check Existing Patterns**: Look for existing test/script directories before creating new ones
- **No Scattered Tests**: Never create test_*.py or *.test.js next to source files
- **No Random Scripts**: Never create debug.sh, script.py, utility.js in random locations
- **Separation of Concerns**: Keep tests, scripts, docs, and source code properly separated
- **Purpose-Based Organization**: Organize files by their intended function and audience
**Right**: `tests/auth.test.js`, `scripts/deploy.sh`, `claudedocs/analysis.md`
**Wrong**: `auth.test.js` next to `auth.js`, `debug.sh` in project root
## Safety Rules
**Priority**: 🔴 **Triggers**: File operations, library usage, codebase changes
- **Framework Respect**: Check package.json/deps before using libraries
- **Pattern Adherence**: Follow existing project conventions and import styles
- **Transaction-Safe**: Prefer batch operations with rollback capability
- **Systematic Changes**: Plan → Execute → Verify for codebase modifications
**Right**: Check dependencies → follow patterns → execute safely
**Wrong**: Ignore existing conventions, make unplanned changes
## Temporal Awareness
**Priority**: 🔴 **Triggers**: Date/time references, version checks, deadline calculations, "latest" keywords
- **Always Verify Current Date**: Check <env> context for "Today's date" before ANY temporal assessment
- **Never Assume From Knowledge Cutoff**: Don't default to January 2025 or knowledge cutoff dates
- **Explicit Time References**: Always state the source of date/time information
- **Version Context**: When discussing "latest" versions, always verify against current date
- **Temporal Calculations**: Base all time math on verified current date, not assumptions
**Right**: "Checking env: Today is 2025-08-15, so the Q3 deadline is..."
**Wrong**: "Since it's January 2025..." (without checking)
**Detection**: Any date reference without prior env verification
## Quick Reference & Decision Trees
### Critical Decision Flows
**🔴 Before Any File Operations**
```
File operation needed?
├─ Writing/Editing? → Read existing first → Understand patterns → Edit
├─ Creating new? → Check existing structure → Place appropriately
└─ Safety check → Absolute paths only → No auto-commit
```
**🟡 Starting New Feature**
```
New feature request?
├─ Scope clear? → No → Brainstorm mode first
├─ >3 steps? → Yes → TodoWrite required
├─ Patterns exist? → Yes → Follow exactly
├─ Tests available? → Yes → Run before starting
└─ Framework deps? → Check package.json first
```
**🟢 Tool Selection Matrix**
```
Task type → Best tool:
├─ Multi-file edits → MultiEdit > individual Edits
├─ Complex analysis → Task agent > native reasoning
├─ Code search → Grep > bash grep
├─ UI components → Magic MCP > manual coding
├─ Documentation → Context7 MCP > web search
└─ Browser testing → Playwright MCP > unit tests
```
### Priority-Based Quick Actions
#### 🔴 CRITICAL (Never Compromise)
- `git status && git branch` before starting
- Read before Write/Edit operations
- Feature branches only, never main/master
- Root cause analysis, never skip validation
- Absolute paths, no auto-commit
#### 🟡 IMPORTANT (Strong Preference)
- TodoWrite for >3 step tasks
- Complete all started implementations
- Build only what's asked (MVP first)
- Professional language (no marketing superlatives)
- Clean workspace (remove temp files)
#### 🟢 RECOMMENDED (Apply When Practical)
- Parallel operations over sequential
- Descriptive naming conventions
- MCP tools over basic alternatives
# Claude Code Behavioral Rules
Actionable rules for enhanced Claude Code framework operation.
## Rule Priority System
**🔴 CRITICAL**: Security, data safety, production breaks - Never compromise
**🟡 IMPORTANT**: Quality, maintainability, professionalism - Strong preference
**🟢 RECOMMENDED**: Optimization, style, best practices - Apply when practical
### Conflict Resolution Hierarchy
1. **Safety First**: Security/data rules always win
2. **Scope > Features**: Build only what's asked > complete everything
3. **Quality > Speed**: Except in genuine emergencies
4. **Context Matters**: Prototype vs Production requirements differ
## Workflow Rules
**Priority**: 🟡 **Triggers**: All development tasks
- **Task Pattern**: Understand → Plan (with parallelization analysis) → TodoWrite(3+ tasks) → Execute → Track → Validate
- **Batch Operations**: ALWAYS parallel tool calls by default, sequential ONLY for dependencies
- **Validation Gates**: Always validate before execution, verify after completion
- **Quality Checks**: Run lint/typecheck before marking tasks complete
- **Context Retention**: Maintain ≥90% understanding across operations
- **Evidence-Based**: All claims must be verifiable through testing or documentation
- **Discovery First**: Complete project-wide analysis before systematic changes
- **Session Lifecycle**: Initialize with /sc:load, checkpoint regularly, save before end
- **Session Pattern**: /sc:load → Work → Checkpoint (30min) → /sc:save
- **Checkpoint Triggers**: Task completion, 30-min intervals, risky operations
**Right**: Plan → TodoWrite → Execute → Validate
**Wrong**: Jump directly to implementation without planning
## Planning Efficiency
**Priority**: 🔴 **Triggers**: All planning phases, TodoWrite operations, multi-step tasks
- **Parallelization Analysis**: During planning, explicitly identify operations that can run concurrently
- **Tool Optimization Planning**: Plan for optimal MCP server combinations and batch operations
- **Dependency Mapping**: Clearly separate sequential dependencies from parallelizable tasks
- **Resource Estimation**: Consider token usage and execution time during planning phase
- **Efficiency Metrics**: Plan should specify expected parallelization gains (e.g., "3 parallel ops = 60% time saving")
**Right**: "Plan: 1) Parallel: [Read 5 files] 2) Sequential: analyze → 3) Parallel: [Edit all files]"
**Wrong**: "Plan: Read file1 → Read file2 → Read file3 → analyze → edit file1 → edit file2"
## Implementation Completeness
**Priority**: 🟡 **Triggers**: Creating features, writing functions, code generation
- **No Partial Features**: If you start implementing, you MUST complete to working state
- **No TODO Comments**: Never leave TODO for core functionality or implementations
- **No Mock Objects**: No placeholders, fake data, or stub implementations
- **No Incomplete Functions**: Every function must work as specified, not throw "not implemented"
- **Completion Mindset**: "Start it = Finish it" - no exceptions for feature delivery
- **Real Code Only**: All generated code must be production-ready, not scaffolding
**Right**: `function calculate() { return price * tax; }`
**Wrong**: `function calculate() { throw new Error("Not implemented"); }`
**Wrong**: `// TODO: implement tax calculation`
## Scope Discipline
**Priority**: 🟡 **Triggers**: Vague requirements, feature expansion, architecture decisions
- **Build ONLY What's Asked**: No adding features beyond explicit requirements
- **MVP First**: Start with minimum viable solution, iterate based on feedback
- **No Enterprise Bloat**: No auth, deployment, monitoring unless explicitly requested
- **Single Responsibility**: Each component does ONE thing well
- **Simple Solutions**: Prefer simple code that can evolve over complex architectures
- **Think Before Build**: Understand → Plan → Build, not Build → Build more
- **YAGNI Enforcement**: You Aren't Gonna Need It - no speculative features
**Right**: "Build login form" → Just login form
**Wrong**: "Build login form" → Login + registration + password reset + 2FA
## Code Organization
**Priority**: 🟢 **Triggers**: Creating files, structuring projects, naming decisions
- **Naming Convention Consistency**: Follow language/framework standards (camelCase for JS, snake_case for Python)
- **Descriptive Names**: Files, functions, variables must clearly describe their purpose
- **Logical Directory Structure**: Organize by feature/domain, not file type
- **Pattern Following**: Match existing project organization and naming schemes
- **Hierarchical Logic**: Create clear parent-child relationships in folder structure
- **No Mixed Conventions**: Never mix camelCase/snake_case/kebab-case within same project
- **Elegant Organization**: Clean, scalable structure that aids navigation and understanding
**Right**: `getUserData()`, `user_data.py`, `components/auth/`
**Wrong**: `get_userData()`, `userdata.py`, `files/everything/`
## Workspace Hygiene
**Priority**: 🟡 **Triggers**: After operations, session end, temporary file creation
- **Clean After Operations**: Remove temporary files, scripts, and directories when done
- **No Artifact Pollution**: Delete build artifacts, logs, and debugging outputs
- **Temporary File Management**: Clean up all temporary files before task completion
- **Professional Workspace**: Maintain clean project structure without clutter
- **Session End Cleanup**: Remove any temporary resources before ending session
- **Version Control Hygiene**: Never leave temporary files that could be accidentally committed
- **Resource Management**: Delete unused directories and files to prevent workspace bloat
**Right**: `rm temp_script.py` after use
**Wrong**: Leaving `debug.sh`, `test.log`, `temp/` directories
## Failure Investigation
**Priority**: 🔴 **Triggers**: Errors, test failures, unexpected behavior, tool failures
- **Root Cause Analysis**: Always investigate WHY failures occur, not just that they failed
- **Never Skip Tests**: Never disable, comment out, or skip tests to achieve results
- **Never Skip Validation**: Never bypass quality checks or validation to make things work
- **Debug Systematically**: Step back, assess error messages, investigate tool failures thoroughly
- **Fix Don't Workaround**: Address underlying issues, not just symptoms
- **Tool Failure Investigation**: When MCP tools or scripts fail, debug before switching approaches
- **Quality Integrity**: Never compromise system integrity to achieve short-term results
- **Methodical Problem-Solving**: Understand → Diagnose → Fix → Verify, don't rush to solutions
**Right**: Analyze stack trace → identify root cause → fix properly
**Wrong**: Comment out failing test to make build pass
**Detection**: `grep -r "skip\|disable\|TODO" tests/`
## Professional Honesty
**Priority**: 🟡 **Triggers**: Assessments, reviews, recommendations, technical claims
- **No Marketing Language**: Never use "blazingly fast", "100% secure", "magnificent", "excellent"
- **No Fake Metrics**: Never invent time estimates, percentages, or ratings without evidence
- **Critical Assessment**: Provide honest trade-offs and potential issues with approaches
- **Push Back When Needed**: Point out problems with proposed solutions respectfully
- **Evidence-Based Claims**: All technical claims must be verifiable, not speculation
- **No Sycophantic Behavior**: Stop over-praising, provide professional feedback instead
- **Realistic Assessments**: State "untested", "MVP", "needs validation" - not "production-ready"
- **Professional Language**: Use technical terms, avoid sales/marketing superlatives
**Right**: "This approach has trade-offs: faster but uses more memory"
**Wrong**: "This magnificent solution is blazingly fast and 100% secure!"
## Git Workflow
**Priority**: 🔴 **Triggers**: Session start, before changes, risky operations
- **Always Check Status First**: Start every session with `git status` and `git branch`
- **Feature Branches Only**: Create feature branches for ALL work, never work on main/master
- **Incremental Commits**: Commit frequently with meaningful messages, not giant commits
- **Verify Before Commit**: Always `git diff` to review changes before staging
- **Create Restore Points**: Commit before risky operations for easy rollback
- **Branch for Experiments**: Use branches to safely test different approaches
- **Clean History**: Use descriptive commit messages, avoid "fix", "update", "changes"
- **Non-Destructive Workflow**: Always preserve ability to rollback changes
**Right**: `git checkout -b feature/auth` → work → commit → PR
**Wrong**: Work directly on main/master branch
**Detection**: `git branch` should show feature branch, not main/master
## Tool Optimization
**Priority**: 🟢 **Triggers**: Multi-step operations, performance needs, complex tasks
- **Best Tool Selection**: Always use the most powerful tool for each task (MCP > Native > Basic)
- **Parallel Everything**: Execute independent operations in parallel, never sequentially
- **Agent Delegation**: Use Task agents for complex multi-step operations (>3 steps)
- **MCP Server Usage**: Leverage specialized MCP servers for their strengths (morphllm for bulk edits, sequential-thinking for analysis)
- **Batch Operations**: Use MultiEdit over multiple Edits, batch Read calls, group operations
- **Powerful Search**: Use Grep tool over bash grep, Glob over find, specialized search tools
- **Efficiency First**: Choose speed and power over familiarity - use the fastest method available
- **Tool Specialization**: Match tools to their designed purpose (e.g., playwright for web, context7 for docs)
**Right**: Use MultiEdit for 3+ file changes, parallel Read calls
**Wrong**: Sequential Edit calls, bash grep instead of Grep tool
## File Organization
**Priority**: 🟡 **Triggers**: File creation, project structuring, documentation
- **Think Before Write**: Always consider WHERE to place files before creating them
- **Claude-Specific Documentation**: Put reports, analyses, summaries in `claudedocs/` directory
- **Test Organization**: Place all tests in `tests/`, `__tests__/`, or `test/` directories
- **Script Organization**: Place utility scripts in `scripts/`, `tools/`, or `bin/` directories
- **Check Existing Patterns**: Look for existing test/script directories before creating new ones
- **No Scattered Tests**: Never create test_*.py or *.test.js next to source files
- **No Random Scripts**: Never create debug.sh, script.py, utility.js in random locations
- **Separation of Concerns**: Keep tests, scripts, docs, and source code properly separated
- **Purpose-Based Organization**: Organize files by their intended function and audience
**Right**: `tests/auth.test.js`, `scripts/deploy.sh`, `claudedocs/analysis.md`
**Wrong**: `auth.test.js` next to `auth.js`, `debug.sh` in project root
## Safety Rules
**Priority**: 🔴 **Triggers**: File operations, library usage, codebase changes
- **Framework Respect**: Check package.json/deps before using libraries
- **Pattern Adherence**: Follow existing project conventions and import styles
- **Transaction-Safe**: Prefer batch operations with rollback capability
- **Systematic Changes**: Plan → Execute → Verify for codebase modifications
**Right**: Check dependencies → follow patterns → execute safely
**Wrong**: Ignore existing conventions, make unplanned changes
## Temporal Awareness
**Priority**: 🔴 **Triggers**: Date/time references, version checks, deadline calculations, "latest" keywords
- **Always Verify Current Date**: Check <env> context for "Today's date" before ANY temporal assessment
- **Never Assume From Knowledge Cutoff**: Don't default to January 2025 or knowledge cutoff dates
- **Explicit Time References**: Always state the source of date/time information
- **Version Context**: When discussing "latest" versions, always verify against current date
- **Temporal Calculations**: Base all time math on verified current date, not assumptions
**Right**: "Checking env: Today is 2025-08-15, so the Q3 deadline is..."
**Wrong**: "Since it's January 2025..." (without checking)
**Detection**: Any date reference without prior env verification
## Quick Reference & Decision Trees
### Critical Decision Flows
**🔴 Before Any File Operations**
```
File operation needed?
├─ Writing/Editing? → Read existing first → Understand patterns → Edit
├─ Creating new? → Check existing structure → Place appropriately
└─ Safety check → Absolute paths only → No auto-commit
```
**🟡 Starting New Feature**
```
New feature request?
├─ Scope clear? → No → Brainstorm mode first
├─ >3 steps? → Yes → TodoWrite required
├─ Patterns exist? → Yes → Follow exactly
├─ Tests available? → Yes → Run before starting
└─ Framework deps? → Check package.json first
```
**🟢 Tool Selection Matrix**
```
Task type → Best tool:
├─ Multi-file edits → MultiEdit > individual Edits
├─ Complex analysis → Task agent > native reasoning
├─ Code search → Grep > bash grep
├─ UI components → Magic MCP > manual coding
├─ Documentation → Context7 MCP > web search
└─ Browser testing → Playwright MCP > unit tests
```
### Priority-Based Quick Actions
#### 🔴 CRITICAL (Never Compromise)
- `git status && git branch` before starting
- Read before Write/Edit operations
- Feature branches only, never main/master
- Root cause analysis, never skip validation
- Absolute paths, no auto-commit
#### 🟡 IMPORTANT (Strong Preference)
- TodoWrite for >3 step tasks
- Complete all started implementations
- Build only what's asked (MVP first)
- Professional language (no marketing superlatives)
- Clean workspace (remove temp files)
#### 🟢 RECOMMENDED (Apply When Practical)
- Parallel operations over sequential
- Descriptive naming conventions
- MCP tools over basic alternatives
- Batch operations when possible

View File

@ -17,7 +17,7 @@ from pathlib import Path
try:
__version__ = (Path(__file__).parent.parent / "VERSION").read_text().strip()
except Exception:
__version__ = "4.1.3" # Fallback
__version__ = "4.1.4" # Fallback
__author__ = "NomenAK, Mithun Gowda B"
__email__ = "anton.knoery@gmail.com, mithungowda.b7411@gmail.com"
__github__ = "NomenAK, mithun50"

View File

@ -1 +1 @@
4.1.3
4.1.4

View File

@ -1,6 +1,6 @@
{
"name": "@bifrost_inc/superclaude",
"version": "4.1.3",
"version": "4.1.4",
"description": "SuperClaude Framework NPM wrapper - Official Node.js wrapper for the Python SuperClaude package. Enhances Claude Code with specialized commands and AI development tools.",
"scripts": {
"postinstall": "node ./bin/install.js",

View File

@ -4,19 +4,20 @@ build-backend = "setuptools.build_meta"
[project]
name = "SuperClaude"
version = "4.1.3"
version = "4.1.4"
authors = [
{name = "NomenAK", email = "anton.knoery@gmail.com"},
{name = "Mithun Gowda B", email = "mithungowda.b7411@gmail.com"}
]
description = "SuperClaude Framework Management Hub - AI-enhanced development framework for Claude Code"
readme = "README.md"
license = "MIT"
license = {text = "MIT"}
requires-python = ">=3.8"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",

View File

@ -8,7 +8,7 @@ from pathlib import Path
try:
__version__ = (Path(__file__).parent.parent / "VERSION").read_text().strip()
except Exception:
__version__ = "4.1.3" # Fallback
__version__ = "4.1.4" # Fallback
__author__ = "NomenAK, Mithun Gowda B"
@ -17,5 +17,8 @@ SETUP_DIR = Path(__file__).parent
PROJECT_ROOT = SETUP_DIR.parent
DATA_DIR = SETUP_DIR / "data"
# Import home directory detection for immutable distros
from .utils.paths import get_home_directory
# Installation target
DEFAULT_INSTALL_DIR = Path.home() / ".claude"
DEFAULT_INSTALL_DIR = get_home_directory() / ".claude"

View File

@ -10,7 +10,7 @@ from pathlib import Path
try:
__version__ = (Path(__file__).parent.parent.parent / "VERSION").read_text().strip()
except Exception:
__version__ = "4.1.3" # Fallback
__version__ = "4.1.4" # Fallback
def get_command_info():

View File

@ -8,6 +8,7 @@ import time
import tarfile
import json
from pathlib import Path
from ...utils.paths import get_home_directory
from datetime import datetime
from typing import List, Optional, Dict, Any, Tuple
import argparse
@ -494,7 +495,7 @@ def run(args: argparse.Namespace) -> int:
operation.setup_operation_logging(args)
logger = get_logger()
# ✅ Inserted validation code
expected_home = Path.home().resolve()
expected_home = get_home_directory().resolve()
actual_dir = args.install_dir.resolve()
if not str(actual_dir).startswith(str(expected_home)):

View File

@ -6,6 +6,7 @@ Refactored from install.py for unified CLI hub
import sys
import time
from pathlib import Path
from ...utils.paths import get_home_directory
from typing import List, Optional, Dict, Any
import argparse
@ -125,16 +126,28 @@ def get_components_to_install(args: argparse.Namespace, registry: ComponentRegis
else:
components = args.components
# If mcp is specified non-interactively, we should still ask which servers to install.
if 'mcp' in components:
# If mcp or mcp_docs is specified non-interactively, we should still ask which servers to install.
if 'mcp' in components or 'mcp_docs' in components:
selected_servers = select_mcp_servers(registry)
if not hasattr(config_manager, '_installation_context'):
config_manager._installation_context = {}
config_manager._installation_context["selected_mcp_servers"] = selected_servers
# If the user selected some servers, but didn't select mcp_docs, add it.
if selected_servers and 'mcp_docs' not in components:
components.append('mcp_docs')
# If the user selected some servers, ensure both mcp and mcp_docs are included
if selected_servers:
if 'mcp' not in components:
components.append('mcp')
logger.debug(f"Auto-added 'mcp' component for selected servers: {selected_servers}")
if 'mcp_docs' not in components:
components.append('mcp_docs')
logger.debug(f"Auto-added 'mcp_docs' component for selected servers: {selected_servers}")
logger.info(f"Final components to install: {components}")
# If mcp_docs was explicitly requested but no servers selected, allow auto-detection
elif not selected_servers and 'mcp_docs' in components:
logger.info("mcp_docs component will auto-detect existing MCP servers")
logger.info("Documentation will be installed for any detected servers")
return components
@ -187,7 +200,7 @@ def select_mcp_servers(registry: ComponentRegistry) -> List[str]:
try:
# Get MCP component to access server list
mcp_instance = registry.get_component_instance("mcp", Path.home() / ".claude")
mcp_instance = registry.get_component_instance("mcp", get_home_directory() / ".claude")
if not mcp_instance or not hasattr(mcp_instance, 'mcp_servers'):
logger.error("Could not access MCP server information")
return []
@ -526,7 +539,7 @@ def run(args: argparse.Namespace) -> int:
operation.setup_operation_logging(args)
logger = get_logger()
# ✅ Enhanced security validation with symlink protection
expected_home = Path.home().resolve()
expected_home = get_home_directory().resolve()
install_dir_original = args.install_dir
install_dir_resolved = args.install_dir.resolve()

View File

@ -6,6 +6,7 @@ Refactored from uninstall.py for unified CLI hub
import sys
import time
from pathlib import Path
from ...utils.paths import get_home_directory
from typing import List, Optional, Dict, Any
import argparse
@ -766,7 +767,7 @@ def run(args: argparse.Namespace) -> int:
operation.setup_operation_logging(args)
logger = get_logger()
# ✅ Inserted validation code
expected_home = Path.home().resolve()
expected_home = get_home_directory().resolve()
actual_dir = args.install_dir.resolve()
if not str(actual_dir).startswith(str(expected_home)):

View File

@ -6,6 +6,7 @@ Refactored from update.py for unified CLI hub
import sys
import time
from pathlib import Path
from ...utils.paths import get_home_directory
from typing import List, Optional, Dict, Any
import argparse
@ -384,7 +385,7 @@ def run(args: argparse.Namespace) -> int:
from setup.cli.base import __version__
# ✅ Inserted validation code
expected_home = Path.home().resolve()
expected_home = get_home_directory().resolve()
actual_dir = args.install_dir.resolve()
if not str(actual_dir).startswith(str(expected_home)):

View File

@ -384,23 +384,147 @@ class MCPComponent(Component):
"""Check if MCP server is already installed"""
try:
result = self._run_command_cross_platform(
["claude", "mcp", "list"],
capture_output=True,
text=True,
["claude", "mcp", "list"],
capture_output=True,
text=True,
timeout=60
)
if result.returncode != 0:
self.logger.warning(f"Could not list MCP servers: {result.stderr}")
return False
# Parse output to check if server is installed
output = result.stdout.lower()
return server_name.lower() in output
except (subprocess.TimeoutExpired, subprocess.SubprocessError) as e:
self.logger.warning(f"Error checking MCP server status: {e}")
return False
def _detect_existing_mcp_servers_from_config(self) -> List[str]:
"""Detect existing MCP servers from Claude Desktop config"""
detected_servers = []
try:
# Try to find Claude Desktop config file
config_paths = [
self.install_dir / "claude_desktop_config.json",
Path.home() / ".claude" / "claude_desktop_config.json",
Path.home() / ".claude.json", # Claude CLI config
Path.home() / "AppData" / "Roaming" / "Claude" / "claude_desktop_config.json", # Windows
Path.home() / "Library" / "Application Support" / "Claude" / "claude_desktop_config.json", # macOS
]
config_file = None
for path in config_paths:
if path.exists():
config_file = path
break
if not config_file:
self.logger.debug("No Claude Desktop config file found")
return detected_servers
import json
with open(config_file, 'r') as f:
config = json.load(f)
# Extract MCP server names from mcpServers section
mcp_servers = config.get("mcpServers", {})
for server_name in mcp_servers.keys():
# Map common name variations to our standard names
normalized_name = self._normalize_server_name(server_name)
if normalized_name and normalized_name in self.mcp_servers:
detected_servers.append(normalized_name)
if detected_servers:
self.logger.info(f"Detected existing MCP servers from config: {detected_servers}")
except Exception as e:
self.logger.warning(f"Could not read Claude Desktop config: {e}")
return detected_servers
def _detect_existing_mcp_servers_from_cli(self) -> List[str]:
"""Detect existing MCP servers from Claude CLI"""
detected_servers = []
try:
result = self._run_command_cross_platform(
["claude", "mcp", "list"],
capture_output=True,
text=True,
timeout=60
)
if result.returncode != 0:
self.logger.debug(f"Could not list MCP servers: {result.stderr}")
return detected_servers
# Parse the output to extract server names
output_lines = result.stdout.strip().split('\n')
for line in output_lines:
line = line.strip().lower()
if line and not line.startswith('#') and not line.startswith('no'):
# Extract server name (usually the first word or before first space/colon)
server_name = line.split()[0] if line.split() else ""
normalized_name = self._normalize_server_name(server_name)
if normalized_name and normalized_name in self.mcp_servers:
detected_servers.append(normalized_name)
if detected_servers:
self.logger.info(f"Detected existing MCP servers from CLI: {detected_servers}")
except Exception as e:
self.logger.warning(f"Could not detect existing MCP servers from CLI: {e}")
return detected_servers
def _normalize_server_name(self, server_name: str) -> Optional[str]:
"""Normalize server name to match our internal naming"""
if not server_name:
return None
server_name = server_name.lower().strip()
# Map common variations to our standard names
name_mappings = {
"context7": "context7",
"sequential-thinking": "sequential-thinking",
"sequential": "sequential-thinking",
"magic": "magic",
"playwright": "playwright",
"serena": "serena",
"morphllm": "morphllm-fast-apply",
"morphllm-fast-apply": "morphllm-fast-apply",
"morph": "morphllm-fast-apply"
}
return name_mappings.get(server_name)
def _merge_server_lists(self, existing_servers: List[str], selected_servers: List[str], previous_servers: List[str]) -> List[str]:
"""Merge existing, selected, and previously installed servers"""
all_servers = set()
# Add all detected servers
all_servers.update(existing_servers)
all_servers.update(selected_servers)
all_servers.update(previous_servers)
# Filter to only include servers we know how to install
valid_servers = [s for s in all_servers if s in self.mcp_servers]
if valid_servers:
self.logger.info(f"Total servers to manage: {valid_servers}")
if existing_servers:
self.logger.info(f" - Existing: {existing_servers}")
if selected_servers:
self.logger.info(f" - Newly selected: {selected_servers}")
if previous_servers:
self.logger.info(f" - Previously installed: {previous_servers}")
return valid_servers
def _install_mcp_server(self, server_info: Dict[str, Any], config: Dict[str, Any]) -> bool:
"""Install a single MCP server"""
@ -506,7 +630,7 @@ class MCPComponent(Component):
return False
def _install(self, config: Dict[str, Any]) -> bool:
"""Install MCP component"""
"""Install MCP component with auto-detection of existing servers"""
self.logger.info("Installing SuperClaude MCP servers...")
# Validate prerequisites
@ -516,35 +640,59 @@ class MCPComponent(Component):
self.logger.error(error)
return False
# Auto-detect existing servers
self.logger.info("Auto-detecting existing MCP servers...")
existing_from_config = self._detect_existing_mcp_servers_from_config()
existing_from_cli = self._detect_existing_mcp_servers_from_cli()
existing_servers = list(set(existing_from_config + existing_from_cli))
# Get selected servers from config
selected_servers = config.get("selected_mcp_servers", [])
if not selected_servers:
self.logger.info("No MCP servers selected for installation.")
# Get previously installed servers from metadata
previous_servers = self.settings_manager.get_metadata_setting("mcp.servers", [])
# Merge all server lists
all_servers = self._merge_server_lists(existing_servers, selected_servers, previous_servers)
if not all_servers:
self.logger.info("No MCP servers detected or selected. Skipping MCP installation.")
# Still run post-install to update metadata
return self._post_install()
self.logger.info(f"Installing selected MCP servers: {', '.join(selected_servers)}")
self.logger.info(f"Managing MCP servers: {', '.join(all_servers)}")
# Install each selected MCP server
# Install/verify each server
installed_count = 0
failed_servers = []
self.installed_servers_in_session = []
verified_servers = []
for server_name in selected_servers:
for server_name in all_servers:
if server_name in self.mcp_servers:
server_info = self.mcp_servers[server_name]
if self._install_mcp_server(server_info, config):
installed_count += 1
self.installed_servers_in_session.append(server_name)
else:
failed_servers.append(server_name)
# Check if this is a required server
if server_info.get("required", False):
self.logger.error(f"Required MCP server {server_name} failed to install")
return False
# Check if already installed and working
if self._check_mcp_server_installed(server_name):
self.logger.info(f"MCP server {server_name} already installed and working")
installed_count += 1
verified_servers.append(server_name)
else:
# Try to install
if self._install_mcp_server(server_info, config):
installed_count += 1
verified_servers.append(server_name)
else:
failed_servers.append(server_name)
# Check if this is a required server
if server_info.get("required", False):
self.logger.error(f"Required MCP server {server_name} failed to install")
return False
else:
self.logger.warning(f"Unknown MCP server '{server_name}' selected for installation.")
self.logger.warning(f"Unknown MCP server '{server_name}' cannot be managed by SuperClaude")
# Update the list of successfully managed servers
self.installed_servers_in_session = verified_servers
# Verify installation
if not config.get("dry_run", False):
@ -556,7 +704,7 @@ class MCPComponent(Component):
text=True,
timeout=60
)
if result.returncode == 0:
self.logger.debug("MCP servers list:")
for line in result.stdout.strip().split('\n'):
@ -564,15 +712,15 @@ class MCPComponent(Component):
self.logger.debug(f" {line.strip()}")
else:
self.logger.warning("Could not verify MCP server installation")
except Exception as e:
self.logger.warning(f"Could not verify MCP installation: {e}")
if failed_servers:
self.logger.warning(f"Some MCP servers failed to install: {failed_servers}")
self.logger.success(f"MCP component partially installed ({installed_count} servers)")
self.logger.success(f"MCP component partially managed ({installed_count} servers)")
else:
self.logger.success(f"MCP component installed successfully ({installed_count} servers)")
self.logger.success(f"MCP component successfully managing ({installed_count} servers)")
return self._post_install()
@ -587,7 +735,8 @@ class MCPComponent(Component):
self.settings_manager.add_component_registration("mcp", {
"version": __version__,
"category": "integration",
"servers_count": len(self.mcp_servers)
"servers_count": len(self.installed_servers_in_session),
"installed_servers": self.installed_servers_in_session
})
self.logger.info("Updated metadata with MCP component registration")

View File

@ -22,11 +22,13 @@ class MCPDocsComponent(Component):
# Map server names to documentation files
self.server_docs_map = {
"context7": "MCP_Context7.md",
"sequential": "MCP_Sequential.md",
"sequential": "MCP_Sequential.md",
"sequential-thinking": "MCP_Sequential.md", # Handle both naming conventions
"magic": "MCP_Magic.md",
"playwright": "MCP_Playwright.md",
"serena": "MCP_Serena.md",
"morphllm": "MCP_Morphllm.md"
"morphllm": "MCP_Morphllm.md",
"morphllm-fast-apply": "MCP_Morphllm.md" # Handle both naming conventions
}
super().__init__(install_dir, Path(""))
@ -39,7 +41,14 @@ class MCPDocsComponent(Component):
"description": "MCP server documentation and usage guides",
"category": "documentation"
}
def is_reinstallable(self) -> bool:
"""
Allow mcp_docs to be reinstalled to handle different server selections.
This enables users to add or change MCP server documentation.
"""
return True
def set_selected_servers(self, selected_servers: List[str]) -> None:
"""Set which MCP servers were selected for documentation installation"""
self.selected_servers = selected_servers
@ -81,19 +90,111 @@ class MCPDocsComponent(Component):
files.append(self.server_docs_map[server_name])
return files
def _detect_existing_mcp_servers_from_config(self) -> List[str]:
"""Detect existing MCP servers from Claude Desktop config"""
detected_servers = []
try:
# Try to find Claude Desktop config file
config_paths = [
self.install_dir / "claude_desktop_config.json",
Path.home() / ".claude" / "claude_desktop_config.json",
Path.home() / ".claude.json", # Claude CLI config
Path.home() / "AppData" / "Roaming" / "Claude" / "claude_desktop_config.json", # Windows
Path.home() / "Library" / "Application Support" / "Claude" / "claude_desktop_config.json", # macOS
]
config_file = None
for path in config_paths:
if path.exists():
config_file = path
break
if not config_file:
self.logger.debug("No Claude Desktop config file found")
return detected_servers
import json
with open(config_file, 'r') as f:
config = json.load(f)
# Extract MCP server names from mcpServers section
mcp_servers = config.get("mcpServers", {})
for server_name in mcp_servers.keys():
# Map common name variations to our doc file names
normalized_name = self._normalize_server_name(server_name)
if normalized_name and normalized_name in self.server_docs_map:
detected_servers.append(normalized_name)
if detected_servers:
self.logger.info(f"Detected existing MCP servers from config: {detected_servers}")
except Exception as e:
self.logger.warning(f"Could not read Claude Desktop config: {e}")
return detected_servers
def _normalize_server_name(self, server_name: str) -> Optional[str]:
"""Normalize server name to match our documentation mapping"""
if not server_name:
return None
server_name = server_name.lower().strip()
# Map common variations to our server_docs_map keys
name_mappings = {
"context7": "context7",
"sequential-thinking": "sequential-thinking",
"sequential": "sequential-thinking",
"magic": "magic",
"playwright": "playwright",
"serena": "serena",
"morphllm": "morphllm",
"morphllm-fast-apply": "morphllm",
"morph": "morphllm"
}
return name_mappings.get(server_name)
def _install(self, config: Dict[str, Any]) -> bool:
"""Install MCP documentation component"""
"""Install MCP documentation component with auto-detection"""
self.logger.info("Installing MCP server documentation...")
# Auto-detect existing servers
self.logger.info("Auto-detecting existing MCP servers for documentation...")
detected_servers = self._detect_existing_mcp_servers_from_config()
# Get selected servers from config
selected_servers = config.get("selected_mcp_servers", [])
self.set_selected_servers(selected_servers)
self.component_files = self._discover_component_files()
if not selected_servers:
self.logger.info("No MCP servers selected - skipping documentation installation")
# Get previously documented servers from metadata
previous_servers = self.settings_manager.get_metadata_setting("components.mcp_docs.servers_documented", [])
# Merge all server lists
all_servers = list(set(detected_servers + selected_servers + previous_servers))
# Filter to only servers we have documentation for
valid_servers = [s for s in all_servers if s in self.server_docs_map]
if not valid_servers:
self.logger.info("No MCP servers detected or selected for documentation installation")
# Still proceed to update metadata
self.set_selected_servers([])
self.component_files = []
return self._post_install()
self.logger.info(f"Installing documentation for MCP servers: {', '.join(valid_servers)}")
if detected_servers:
self.logger.info(f" - Detected from config: {detected_servers}")
if selected_servers:
self.logger.info(f" - Newly selected: {selected_servers}")
if previous_servers:
self.logger.info(f" - Previously documented: {previous_servers}")
# Set the servers for which we'll install documentation
self.set_selected_servers(valid_servers)
self.component_files = self._discover_component_files()
# Validate installation
success, errors = self.validate_prerequisites()
if not success:
@ -106,15 +207,18 @@ class MCPDocsComponent(Component):
if not files_to_install:
self.logger.warning("No MCP documentation files found to install")
return self._post_install()
return False
# Copy documentation files
success_count = 0
successfully_copied_files = []
for source, target in files_to_install:
self.logger.debug(f"Copying {source.name} to {target}")
if self.file_manager.copy_file(source, target):
success_count += 1
successfully_copied_files.append(source.name)
self.logger.debug(f"Successfully copied {source.name}")
else:
self.logger.error(f"Failed to copy {source.name}")
@ -123,7 +227,9 @@ class MCPDocsComponent(Component):
self.logger.error(f"Only {success_count}/{len(files_to_install)} documentation files copied successfully")
return False
self.logger.success(f"MCP documentation installed successfully ({success_count} files for {len(selected_servers)} servers)")
# Update component_files to only include successfully copied files
self.component_files = successfully_copied_files
self.logger.success(f"MCP documentation installed successfully ({success_count} files for {len(valid_servers)} servers)")
return self._post_install()

View File

@ -8,6 +8,7 @@ import shutil
from typing import Tuple, List, Dict, Any, Optional
from pathlib import Path
import re
from ..utils.paths import get_home_directory
# Handle packaging import - if not available, use a simple version comparison
try:
@ -407,7 +408,7 @@ class Validator:
# Check disk space
if "disk_space_mb" in requirements:
success, message = self.check_disk_space(
Path.home(),
get_home_directory(),
requirements["disk_space_mb"]
)
if not success:
@ -504,7 +505,7 @@ class Validator:
# Add disk space info
try:
home_path = Path.home()
home_path = get_home_directory()
stat_result = shutil.disk_usage(home_path)
info["disk_space"] = {
"total_gb": stat_result.total / (1024**3),
@ -620,7 +621,7 @@ class Validator:
diagnostics["recommendations"].append(self.get_installation_help("claude_cli"))
# Check disk space
disk_success, disk_msg = self.check_disk_space(Path.home())
disk_success, disk_msg = self.check_disk_space(get_home_directory())
diagnostics["checks"]["disk_space"] = {
"status": "pass" if disk_success else "fail",
"message": disk_msg

View File

@ -2,7 +2,7 @@
"components": {
"core": {
"name": "core",
"version": "4.1.3",
"version": "4.1.4",
"description": "SuperClaude framework documentation and core files",
"category": "core",
"dependencies": [],
@ -11,7 +11,7 @@
},
"commands": {
"name": "commands",
"version": "4.1.3",
"version": "4.1.4",
"description": "SuperClaude slash command definitions",
"category": "commands",
"dependencies": ["core"],
@ -20,7 +20,7 @@
},
"mcp": {
"name": "mcp",
"version": "4.1.3",
"version": "4.1.4",
"description": "MCP server configuration management via .claude.json",
"category": "integration",
"dependencies": ["core"],
@ -29,7 +29,7 @@
},
"modes": {
"name": "modes",
"version": "4.1.3",
"version": "4.1.4",
"description": "SuperClaude behavioral modes (Brainstorming, Introspection, Task Management, Token Efficiency)",
"category": "modes",
"dependencies": ["core"],
@ -38,7 +38,7 @@
},
"mcp_docs": {
"name": "mcp_docs",
"version": "4.1.3",
"version": "4.1.4",
"description": "MCP server documentation and usage guides",
"category": "documentation",
"dependencies": ["core"],
@ -47,7 +47,7 @@
},
"agents": {
"name": "agents",
"version": "4.1.3",
"version": "4.1.4",
"description": "14 specialized AI agents with domain expertise and intelligent routing",
"category": "agents",
"dependencies": ["core"],

View File

@ -12,12 +12,13 @@ from typing import Dict, Optional
from datetime import datetime
from .ui import display_info, display_success, display_warning, Colors
from .logger import get_logger
from .paths import get_home_directory
def _get_env_tracking_file() -> Path:
"""Get path to environment variable tracking file"""
from .. import DEFAULT_INSTALL_DIR
install_dir = Path.home() / ".claude"
install_dir = get_home_directory() / ".claude"
install_dir.mkdir(exist_ok=True)
return install_dir / "superclaude_env_vars.json"
@ -90,7 +91,7 @@ def detect_shell_config() -> Optional[Path]:
Returns:
Path to the shell configuration file, or None if not found
"""
home = Path.home()
home = get_home_directory()
# Check in order of preference
configs = [
@ -340,7 +341,7 @@ def cleanup_environment_variables(env_vars_to_remove: Dict[str, str], create_res
def _create_restore_script(env_vars: Dict[str, str]) -> Optional[Path]:
"""Create a script to restore environment variables"""
try:
home = Path.home()
home = get_home_directory()
if os.name == 'nt': # Windows
script_path = home / "restore_superclaude_env.bat"
with open(script_path, 'w') as f:
@ -423,7 +424,7 @@ def create_env_file(api_keys: Dict[str, str], env_file_path: Optional[Path] = No
True if .env file was created successfully, False otherwise
"""
if env_file_path is None:
env_file_path = Path.home() / ".env"
env_file_path = get_home_directory() / ".env"
logger = get_logger()

View File

@ -11,6 +11,7 @@ from enum import Enum
from .ui import Colors
from .symbols import symbols
from .paths import get_home_directory
class LogLevel(Enum):
@ -36,7 +37,7 @@ class Logger:
file_level: Minimum level for file output
"""
self.name = name
self.log_dir = log_dir or (Path.home() / ".claude" / "logs")
self.log_dir = log_dir or (get_home_directory() / ".claude" / "logs")
self.console_level = console_level
self.file_level = file_level
self.session_start = datetime.now()

54
setup/utils/paths.py Normal file
View File

@ -0,0 +1,54 @@
"""
Path utilities for SuperClaude installation system
Handles cross-platform path operations and immutable distro support
"""
import os
from pathlib import Path
def get_home_directory() -> Path:
"""
Get the correct home directory path, handling immutable distros.
On immutable distros like Fedora Silverblue/Universal Blue,
the home directory is at /var/home/$USER instead of /home/$USER.
This function properly detects the actual home directory.
Returns:
Path: The actual home directory path
"""
# First try the standard method
try:
home = Path.home()
# Verify the path actually exists and is accessible
if home.exists() and home.is_dir():
return home
except Exception:
pass
# Fallback methods for edge cases and immutable distros
# Method 1: Use $HOME environment variable
home_env = os.environ.get('HOME')
if home_env:
home_path = Path(home_env)
if home_path.exists() and home_path.is_dir():
return home_path
# Method 2: Check for immutable distro patterns
username = os.environ.get('USER') or os.environ.get('USERNAME')
if username:
# Check common immutable distro paths
immutable_paths = [
Path(f'/var/home/{username}'), # Fedora Silverblue/Universal Blue
Path(f'/home/{username}'), # Standard Linux
]
for path in immutable_paths:
if path.exists() and path.is_dir():
return path
# Method 3: Last resort - use the original Path.home() even if it seems wrong
# This ensures we don't crash the installation
return Path.home()

View File

@ -32,6 +32,7 @@ import os
from pathlib import Path
from typing import List, Optional, Tuple, Set
import urllib.parse
from .paths import get_home_directory
class SecurityValidator:
@ -410,7 +411,7 @@ class SecurityValidator:
if is_claude_dir:
try:
home_path = Path.home()
home_path = get_home_directory()
except (RuntimeError, OSError):
# If we can't determine home directory, skip .claude special handling
cls._log_security_decision("WARN", f"Cannot determine home directory for .claude validation: {abs_target}")
@ -432,7 +433,7 @@ class SecurityValidator:
if ':' in abs_target_str and '\\users\\' in abs_target_str:
try:
# Check if target is within the user's actual home directory
home_path = Path.home()
home_path = get_home_directory()
abs_target.relative_to(home_path)
# Path is valid - within user's home directory
except ValueError:

View File

@ -17,13 +17,14 @@ from datetime import datetime, timedelta
from .ui import display_info, display_warning, display_success, Colors
from .logger import get_logger
from .paths import get_home_directory
class UpdateChecker:
"""Handles automatic update checking for SuperClaude"""
PYPI_URL = "https://pypi.org/pypi/SuperClaude/json"
CACHE_FILE = Path.home() / ".claude" / ".update_check"
CACHE_FILE = get_home_directory() / ".claude" / ".update_check"
CHECK_INTERVAL = 86400 # 24 hours in seconds
TIMEOUT = 2 # seconds
@ -162,7 +163,7 @@ class UpdateChecker:
)
if result.returncode == 0:
# Check if it's a user installation
if '--user' in result.stdout or Path.home() in Path(result.stdout):
if '--user' in result.stdout or get_home_directory() in Path(result.stdout):
return 'pip-user'
return 'pip'
except: