Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,39 @@ jobs:
run: python benchmarks/run_benchmarks.py --suite smoke
continue-on-error: true

# ============================================
# Generated Implementation Validation
# ============================================
generated-validation:
name: Generated Validation
needs: quality
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[test]"

- name: Validate generated implementations
run: python -m SuperClaude.Quality.generated_validator --fail-on-errors

- name: Run generated validation tests
env:
PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1"
run: |
pytest tests/quality/test_generated_validator.py \
tests/telemetry/test_evidence_store.py \
-v --tb=short

# ============================================
# CI Summary - Aggregate status
# ============================================
Expand Down
78 changes: 78 additions & 0 deletions CLAUDE_CORE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# SuperClaude Core Principles

This document defines the core operational principles for the SuperClaude framework.

## Identity

You are operating with the SuperClaude framework, an intelligent orchestration layer for Claude Code that provides:
- **131 specialized agents** for domain-specific tasks
- **13 commands** via `/sc:` prefix for structured workflows
- **Multi-model consensus** via PAL MCP integration
- **Quality-driven execution** with deterministic safety grounding

## Core Capabilities

### Agent System
- Automatic agent selection based on task context
- 17 core agents + 114 extended agents across 10 categories
- Delegation with circular detection and max depth limits
- Parallel execution where dependencies allow

### Command System
Commands follow the `/sc:command` syntax:
- `/sc:implement` - Code implementation with guardrails
- `/sc:test` - Test execution with coverage tracking
- `/sc:analyze` - Static analysis and risk assessment
- `/sc:design` - Architecture and system design
- `/sc:document` - Documentation generation

### Quality System
- 9-dimension quality scoring (correctness, completeness, security, etc.)
- Deterministic signal grounding prevents score inflation
- Agentic loop with HARD_MAX_ITERATIONS = 5
- Oscillation and stagnation detection

### MCP Integrations
- **PAL MCP**: consensus, thinkdeep, codereview, debug, planner
- **Rube MCP**: 500+ app integrations
- **LinkUp**: Web search for current information

## Operational Guidelines

### Before Starting Work
1. Understand the full context of the request
2. Identify which agent(s) are best suited for the task
3. Plan the approach before executing

### During Execution
1. Use TodoWrite for complex multi-step tasks
2. Validate assumptions before making changes
3. Test changes when applicable
4. Document significant decisions

### After Completion
1. Verify the output meets requirements
2. Run quality checks if available
3. Summarize what was done

## Safety Boundaries

### Hard Limits
- HARD_MAX_ITERATIONS = 5 (agentic loop ceiling)
- max_delegation_depth = 5 (agent delegation)
- Never bypass security checks

### Deterministic Caps
- Security critical issues → max 30% quality score
- >50% test failures → max 40% quality score
- Build failures → max 45% quality score

## Mode-Specific Behavior

The framework supports behavioral modes that adjust operation:

| Mode | Trigger | Behavior |
|------|---------|----------|
| Normal | default | Balanced verbosity, standard flow |
| Task Management | complex tasks | TodoWrite tracking, hierarchical breakdown |
| Token Efficiency | `--uc` flag | Compressed symbols, minimal verbosity |
250 changes: 220 additions & 30 deletions Docs/User-Guide/commands.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,219 @@
# Command Catalogue

The table below summarises the `/sc:*` commands available in the current build
and the artefacts they generate.

| Command | Purpose | Key Artefacts |
| -------------------- | -------------------------------------------------- | ------------- |
| `/sc:implement` | Plan and apply code changes with guardrails | `SuperClaude/Implementation/`, metrics, optional diff |
| `/sc:test` | Run project tests with flag translation | Test logs, metrics, exit status |
| `/sc:workflow` | Expand a PRD/spec into actionable steps | Markdown plan under `SuperClaude/Implementation/` |
| `/sc:business-panel` | Generate stakeholder-facing status reports | Markdown artefact + telemetry entry |
| `/sc:analyze` | Perform static analysis and risk assessment | Risk summary, metrics |
| `/sc:improve` | Refine existing modules (e.g., readability passes) | Updated files + plan summary |
| `/sc:document` | Generate summaries, guides, or inline documentation | Markdown/MDX artefact under `SuperClaude/Implementation/` |
| *Use `SuperClaude backup --restore`* | Restore workspace backups generated by the installer CLI | Snapshot written to `.claude/` |

> Legacy commands `/sc:save` and `/sc:load` are archived. `/sc:document` replaces
> the old `/sc:reflect` workflow for capturing follow-up notes. Use the
> the top-level `SuperClaude backup` command for snapshot/restore workflows
> until a new `/sc:` persistence interface is introduced.
The table below summarizes all 13 `/sc:*` commands available in SuperClaude v6.0.0.

## Complete Command Reference

| Command | Purpose | Key Artefacts |
|---------|---------|---------------|
| `/sc:analyze` | Perform static analysis and risk assessment | Risk summary, metrics, findings |
| `/sc:brainstorm` | Creative ideation and exploration | Ideas list, concept map |
| `/sc:build` | Project building and compilation | Build logs, artifacts |
| `/sc:design` | Architecture and system design | Diagrams, ADRs, design docs |
| `/sc:document` | Generate summaries, guides, or documentation | Markdown/MDX under `SuperClaude/Implementation/` |
| `/sc:estimate` | Effort and resource estimation | Breakdown, risk assessment |
| `/sc:explain` | Code/concept explanation | Detailed explanations |
| `/sc:git` | Git operations (commit, PR, branch) | Commits, PRs, branches |
| `/sc:implement` | Plan and apply code changes with guardrails | `SuperClaude/Implementation/`, metrics, diffs |
| `/sc:improve` | Refine existing modules (refactoring) | Updated files, plan summary |
| `/sc:index` | Search and indexing operations | Index data, search results |
| `/sc:test` | Run project tests with coverage | Test logs, metrics, exit status |
| `/sc:workflow` | Expand PRD/spec into actionable steps | Markdown plan under `SuperClaude/Implementation/` |

## Command Details

### `/sc:analyze`
Perform deep code analysis including complexity metrics, dependency analysis, and risk assessment.

**Flags:**
- `--deep`: Enable comprehensive analysis
- `--risk`: Focus on risk assessment
- `--dependencies`: Analyze dependency graph
- `--complexity`: Calculate complexity metrics
- `--agent <name>`: Use specific analysis agent

**Example:**
```bash
/sc:analyze --deep --risk src/auth/
```

### `/sc:brainstorm`
Creative ideation mode for exploring solutions and generating ideas.

**Flags:**
- `--divergent`: Maximize idea generation
- `--converge`: Focus on best options
- `--constraints <list>`: Apply constraints

**Example:**
```bash
/sc:brainstorm --divergent "API authentication approaches"
```

### `/sc:build`
Build and compile the project with configurable targets.

**Flags:**
- `--target <name>`: Specify build target
- `--optimize`: Enable optimizations
- `--clean`: Clean build (remove artifacts first)

**Example:**
```bash
/sc:build --optimize --target production
```

### `/sc:design`
Architecture and system design with optional diagram generation.

**Flags:**
- `--diagram`: Generate architecture diagram
- `--adr`: Create Architecture Decision Record
- `--constraints`: Document system constraints
- `--consensus`: Multi-model design review

**Example:**
```bash
/sc:design --diagram --adr "Microservices architecture"
```

### `/sc:document`
Generate documentation including API docs, READMEs, and inline comments.

**Flags:**
- `--api`: Generate API documentation
- `--readme`: Generate/update README
- `--inline`: Add inline code comments
- `--format <type>`: Output format (markdown, mdx, rst)

**Example:**
```bash
/sc:document --api --readme src/
```

### `/sc:estimate`
Estimate effort, resources, and timeline for tasks.

**Flags:**
- `--breakdown`: Provide detailed breakdown
- `--risk`: Include risk assessment
- `--confidence`: Show confidence intervals

**Example:**
```bash
/sc:estimate --breakdown --risk "Implement OAuth2"
```

### `/sc:explain`
Generate detailed explanations of code or concepts.

**Flags:**
- `--depth <1-3>`: Explanation depth
- `--audience <level>`: Target audience (beginner, intermediate, expert)

**Example:**
```bash
/sc:explain --depth 3 src/complex_algorithm.py
```

### `/sc:git`
Git operations including commits and pull requests.

**Flags:**
- `--commit`: Create commit
- `--pr`: Create pull request
- `--branch <name>`: Specify branch

**Example:**
```bash
/sc:git --commit --pr "Add user authentication"
```

### `/sc:implement`
Core implementation command with quality guardrails.

**Flags:**
- `--agent <name>`: Use specific agent
- `--persona <name>`: Alternative to --agent
- `--loop [n]`: Enable iterative improvement (max 5)
- `--pal-review`: Request PAL code review
- `--with-tests`: Auto-generate tests
- `--safe`: Enable strict guardrails
- `--orchestrate`: Multi-agent orchestration
- `--strategy <type>`: Orchestration strategy

**Example:**
```bash
/sc:implement --loop 3 --pal-review --with-tests "Add rate limiting"
```

### `/sc:improve`
Refine and improve existing code modules.

**Flags:**
- `--refactor`: Focus on refactoring
- `--optimize`: Focus on optimization
- `--readability`: Improve readability

**Example:**
```bash
/sc:improve --refactor --readability src/legacy_module.py
```

### `/sc:index`
Build and query codebase indexes.

**Flags:**
- `--rebuild`: Force rebuild index
- `--query <term>`: Search the index

**Example:**
```bash
/sc:index --rebuild src/
/sc:index --query "authentication"
```

### `/sc:test`
Run tests with coverage and reporting.

**Flags:**
- `--coverage`: Enable coverage measurement
- `--watch`: Watch mode for continuous testing
- `--framework <name>`: Specify test framework
- `--markers <expr>`: Pytest marker expression
- `--fail-fast`: Stop on first failure

**Example:**
```bash
/sc:test --coverage --framework pytest tests/
```

### `/sc:workflow`
Multi-step workflow orchestration.

**Flags:**
- `--steps`: Define workflow steps
- `--parallel`: Enable parallel execution
- `--checkpoint`: Save state at checkpoints

**Example:**
```bash
/sc:workflow --steps "analyze,implement,test,document"
```

## Flags Common to Most Commands

- `--think <1-3>`: Controls reasoning depth and consensus quorum selection.
- `--consensus`: Forces multi-model votes regardless of command defaults.
- `--fast-codex`: Routes implementation work through the lean Codex persona
(requires live API keys and the `codex` CLI on your PATH).
- `--safe`: Disables risky modes such as fast-codex and enforces stricter
guardrails.
- `--delegate <agent>`: Pin execution to a specific agent.
- `--loop`: Allow iterative agent hand-offs until success criteria are met.
- `--pal-review`: Request PAL code review after changes are applied.
| Flag | Short | Description |
|------|-------|-------------|
| `--think <1-3>` | `-t` | Controls reasoning depth |
| `--consensus` | `-c` | Force multi-model consensus |
| `--safe` | `-s` | Enable strict guardrails |
| `--delegate <agent>` | `-d` | Pin to specific agent |
| `--loop [n]` | `-l` | Enable iterative improvement |
| `--pal-review` | | Request PAL code review |
| `--verbose` | `-v` | Enable detailed output |
| `--quiet` | `-q` | Minimize output |
| `--uc` | | Ultra-compressed (token efficient) |

## PAL Review Integration

Expand All @@ -44,12 +228,18 @@ tool `mcp__pal__codereview` after the Python executor completes.
4. Review feedback is incorporated before task completion

**Example:**
```
```bash
/sc:implement refactor auth module --pal-review
```

This pattern enables the full Plan→Act→Review→Refine loop while respecting
the architecture where MCP tools are invoked at the conversation level.
## Quality-Driven Execution

Commands that modify code integrate with the quality pipeline:

1. **Validation Stages**: syntax, security, style, tests, type_check, performance
2. **Deterministic Scoring**: Real tool output (pytest, ruff, bandit, mypy)
3. **Iterative Improvement**: `--loop` continues until quality threshold met
4. **Hard Limits**: HARD_MAX_ITERATIONS = 5 cannot be exceeded

See the individual command modules under `SuperClaude/Commands/` for extended
options and YAML front matter describing required context.
Loading
Loading