PLANNING.md
Architecture, Design Principles, and Absolute Rules for SuperClaude Framework
This document is read by Claude Code at session start to ensure consistent, high-quality development aligned with project standards.
SuperClaude Framework transforms Claude Code into a structured development platform through:
Core Mission: Enhance AI-assisted development with:
SuperClaude is a Python package with:
SuperClaude Framework v4.3.0
β
βββ Core Package (src/superclaude/)
β βββ pytest_plugin.py # Auto-loaded by pytest
β βββ pm_agent/ # Pre/post implementation patterns
β β βββ confidence.py # Pre-execution confidence check
β β βββ self_check.py # Post-implementation validation
β β βββ reflexion.py # Error learning
β β βββ token_budget.py # Token allocation
β βββ execution/ # Parallel execution
β β βββ parallel.py # WaveβCheckpointβWave
β β βββ reflection.py # Meta-reasoning
β β βββ self_correction.py # Error recovery
β βββ cli/ # Command-line interface
β βββ main.py # superclaude command
β βββ doctor.py # Health checks
β βββ install_skill.py # Skill installation
β
βββ Plugin Source (plugins/superclaude/) # v5.0 - NOT ACTIVE YET
β βββ agents/ # Agent definitions
β βββ commands/ # Command definitions
β βββ hooks/ # Hook configurations
β βββ scripts/ # Shell scripts
β βββ skills/ # Skill implementations
β
βββ Tests (tests/)
β βββ unit/ # Component unit tests
β βββ integration/ # Plugin integration tests
β
βββ Documentation (docs/)
βββ architecture/ # Architecture decisions
βββ developer-guide/ # Development guides
βββ reference/ # API reference
βββ research/ # Research findings
βββ user-guide/ # User documentation
.claude-plugin/ detectionNever guess - always verify with official sources:
Anti-pattern: Implementing based on assumptions or outdated knowledge
Check confidence BEFORE starting work:
ROI: Spend 100-200 tokens on confidence check to save 5,000-50,000 tokens on wrong direction
Use Wave β Checkpoint β Wave pattern:
Wave 1: [Read file1, Read file2, Read file3] (parallel)
β
Checkpoint: Analyze all files together
β
Wave 2: [Edit file1, Edit file2, Edit file3] (parallel)
Benefit: 3.5x faster than sequential execution
When to use:
When NOT to use:
Allocate tokens based on task complexity:
Confidence check ROI: 25-250x token savings
Use SelfCheckProtocol to prevent hallucinations:
The Four Questions:
7 Red Flags:
ALWAYS use UV for Python operations:
uv run pytest # NOT: python -m pytest
uv pip install package # NOT: pip install package
uv run python script.py # NOT: python script.py
Package structure: Use src/ layout
src/superclaude/ for package codetests/ for test codeEntry points: Use pyproject.toml
[project.scripts][project.entry-points.pytest11]All new features MUST have tests
@pytest.mark.unit, @pytest.mark.integrationUse PM Agent patterns in tests:
@pytest.mark.confidence_check
def test_feature(confidence_checker):
context = {...}
assert confidence_checker.assess(context) >= 0.7
@pytest.mark.self_check
def test_implementation(self_check_protocol):
passed, issues = self_check_protocol.validate(impl)
assert passed
Test fixtures: Use conftest.py for shared fixtures
Branch structure:
master: Production-ready codeintegration: Testing ground (not yet created)feature/*, fix/*, docs/*: Feature branchesCommit messages: Use conventional commits
feat: - New featurefix: - Bug fixdocs: - Documentationrefactor: - Code refactoringtest: - Adding testschore: - MaintenanceNever commit:
__pycache__/, *.pyc.venv/, venv/Code documentation:
Project documentation:
Keep docs synchronized:
Version sources of truth:
VERSION file (e.g., 4.3.0)pyproject.toml (e.g., 0.4.0)package.json (should match VERSION)When to bump versions:
Investigation Phase:
Implementation Phase:
git checkout -b feature/feature-nameuv run pytestmake lintmake formatValidation Phase:
Documentation Phase:
Review Phase:
Root Cause Analysis:
Fix Implementation:
Prevention:
Before releasing a new version:
See CONTRIBUTING.md for detailed contribution guidelines.
Key points:
This document is maintained by the SuperClaude development team and should be updated whenever architectural decisions are made.
Last updated: 2025-11-12 (auto-generated during issue #466 fix)