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
6 changes: 6 additions & 0 deletions .claude/agents/dev-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@ You are the **Development Agent**, responsible for implementing features,
writing code, and following project patterns and best practices.

## Required Skills

Load before ANY implementation:

- `.claude/skills/scope-guard/SKILL.md` - Scope validation

## CRITICAL: Scope Awareness

### Before ANY Implementation

1. Load scope-guard skill
2. Check current phase from `.claude/state/execution.json`
3. Verify ALL planned files are within phase scope
4. If ANY file belongs to future phase → **STOP IMMEDIATELY**

### Scope Violation Response

If out-of-scope work is detected:

```
⛔ SCOPE VIOLATION DETECTED

Expand All @@ -34,6 +39,7 @@ RESOLUTION: This deliverable is scheduled for Phase {{N}}.
```

### MCP Integration

- Use **Serena** for code analysis before implementation
- Use **Chrome DevTools** for live testing
- Use **Context7** for framework documentation lookup
Expand Down
4 changes: 4 additions & 0 deletions .claude/agents/orchestrator-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ Central coordination agent that manages workflow execution, agent delegation,
and system-wide state across the project lifecycle.

## Required Skills

Before ANY execution, load these skills:

- `.claude/skills/phase-control/SKILL.md` - Phase boundary enforcement
- `.claude/skills/scope-guard/SKILL.md` - Scope violation prevention
- `.claude/skills/checkpoint-manager/SKILL.md` - Checkpoint management

## CRITICAL: Scope Control Rules

### Phase Boundaries (MANDATORY - NO EXCEPTIONS)

1. **NEVER** execute tasks from a phase that hasn't been explicitly authorized
2. **NEVER** auto-generate Phase N+1 plans after completing Phase N
3. **NEVER** continue past a phase boundary without explicit user command
Expand All @@ -22,6 +25,7 @@ Before ANY execution, load these skills:
6. **ALWAYS** load phase-control skill before task execution

### Before EVERY Task

```
1. Check current authorized phase from .claude/state/execution.json
2. Verify task belongs to authorized phase
Expand Down
58 changes: 58 additions & 0 deletions .claude/agents/planner-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,64 @@ Brief description of phase goals
4. **Appropriate Granularity**: Not too broad, not too detailed
5. **Realistic Sequencing**: Account for natural workflow

## Multi-Model Support

The planner agent supports cross-validation with secondary models to get
different perspectives on architecture decisions.

### Configuration

See `.claude/config/models.yml`:

```yaml
agent_overrides:
planner:
primary: 'claude-sonnet-4-20250514'
secondary: 'gemini-2.5-pro'
cross_validate: true
```

### Cross-Validation Process

When cross-validation is enabled:

1. Primary model (Claude) generates the plan
2. Secondary model (Gemini/GPT-4) reviews the plan
3. Differences are highlighted for user review
4. User makes final decisions on conflicts

### When to Use Cross-Validation

**Recommended for:**

- Major architecture decisions
- Database schema design
- API structure planning
- Security-sensitive features

**Optional for:**

- Simple feature planning
- Bug fix planning
- Documentation tasks

### Disabling Cross-Validation

For a single run:

```
/project-planner --no-cross-validate
```

Permanently:

```yaml
# .claude/config/models.yml
agent_overrides:
planner:
cross_validate: false
```

## Communication

Reports to: Orchestrator agent Triggers: dev-agent, test-agent, docs-agent
Expand Down
92 changes: 92 additions & 0 deletions .claude/agents/review-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,95 @@ When complete, report:

### Status: {{Complete}}
```

## Multi-Model Cross-Validation

The review agent supports cross-validation where a secondary model independently
reviews the same code, catching issues that a single model might miss.

### Configuration

See `.claude/config/models.yml`:

```yaml
agent_overrides:
review:
primary: 'claude-sonnet-4-20250514'
secondary: 'gpt-4o'
cross_validate: true
```

### Cross-Validation Process

When enabled:

1. **Primary Review** - Claude reviews the code
2. **Secondary Review** - GPT-4/Gemini independently reviews
3. **Comparison** - Findings are deduplicated and merged
4. **Conflict Highlighting** - Disagreements shown to user

### Output with Cross-Validation

```markdown
## Cross-Validated Review

### Primary (Claude Sonnet 4)

- Found 3 issues
- Security: ✅ Passed
- Accessibility: ⚠️ 1 issue

### Secondary (GPT-4o)

- Found 4 issues
- Security: ⚠️ 1 issue (XSS risk)
- Accessibility: ⚠️ 2 issues

### Merged Findings (deduplicated)

| # | Issue | Found By | Severity |
| --- | -------------------- | -------- | -------- |
| 1 | XSS vulnerability | GPT-4 | Critical |
| 2 | Missing ARIA label | Both | Major |
| 3 | Focus trap missing | GPT-4 | Major |
| 4 | Consider memoization | Claude | Minor |

### Disagreements

- Claude: Security passed
- GPT-4: Found potential XSS → Human review recommended for security concern
```

### When Cross-Validation Triggers

By default:

- **Security-sensitive code** - Always
- **High complexity** - When cyclomatic complexity > 10
- **On request** - When `--cross-validate` flag used

### Requesting Cross-Validation

```bash
# Single file
/review --cross-validate src/auth.ts

# Always for security
# Configure in models.yml:
cross_validation:
triggers:
review:
on_security: true
```

### Disabling Cross-Validation

```bash
# Single run
/review --no-cross-validate src/utils.ts

# Permanently - edit models.yml
agent_overrides:
review:
cross_validate: false
```
14 changes: 13 additions & 1 deletion .claude/commands/phase-approve.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# /phase-approve - Authorize Next Phase

## Purpose
Explicitly authorizes execution of the next phase. This is the ONLY way to advance beyond the current phase.

Explicitly authorizes execution of the next phase. This is the ONLY way to
advance beyond the current phase.

## Trigger

```
/phase-approve <phase_number>
```

## Arguments

- `phase_number` (required): The phase number to authorize (e.g., 2)

## Process

### Step 1: Validate Request

1. Check that previous phase is complete
2. Check that requested phase is next in sequence
3. Verify no unresolved scope violations

### Step 2: Confirm with User

```
╔══════════════════════════════════════════════════════════════╗
║ 📋 PHASE AUTHORIZATION REQUEST ║
Expand Down Expand Up @@ -46,7 +52,9 @@ Type "APPROVE" to authorize Phase {{N}}, or "CANCEL" to abort.
```

### Step 3: Update State

If approved, update `.claude/state/execution.json`:

```json
{
"authorized_phases": [1, 2],
Expand All @@ -56,6 +64,7 @@ If approved, update `.claude/state/execution.json`:
```

### Step 4: Confirm Authorization

```
╔══════════════════════════════════════════════════════════════╗
║ ✓ PHASE {{N}} AUTHORIZED ║
Expand All @@ -71,12 +80,14 @@ If approved, update `.claude/state/execution.json`:
## Validation Rules

### Cannot Approve If:

- Previous phase is not complete
- Unresolved scope violations exist
- Pending checkpoints require approval
- Skipping phases (e.g., approving Phase 3 when Phase 2 not done)

### Error Messages

```
⛔ CANNOT AUTHORIZE PHASE {{N}}

Expand All @@ -87,6 +98,7 @@ Complete Phase {{N-1}} first, then try again.
```

## Example Usage

```bash
# After completing Phase 1
/phase-approve 2
Expand Down
19 changes: 11 additions & 8 deletions .claude/commands/status.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# /status - Execution Status Command

## Purpose

Displays current execution state, phase progress, and next steps.

## Trigger

Run `/status` at any time to see project state.

## Output Format
Expand Down Expand Up @@ -50,21 +52,22 @@ Run `/status` at any time to see project state.
## Data Sources

Read from:

1. `.claude/state/execution.json` - Execution state
2. `.claude/tasks/phase-{{N}}-tasks.md` - Task progress
3. `.claude/config.yml` - Configuration
4. MCP server status check

## Status Values

| Status | Meaning |
|--------|---------|
| `not_started` | Phase planning not yet run |
| `planning` | Running /project-planner or /task-planner |
| `in_progress` | Tasks being executed |
| `awaiting_approval` | At checkpoint, waiting for user |
| `complete` | Phase finished |
| `blocked` | Execution halted due to error/violation |
| Status | Meaning |
| ------------------- | ----------------------------------------- |
| `not_started` | Phase planning not yet run |
| `planning` | Running /project-planner or /task-planner |
| `in_progress` | Tasks being executed |
| `awaiting_approval` | At checkpoint, waiting for user |
| `complete` | Phase finished |
| `blocked` | Execution halted due to error/violation |

## Next Steps Logic

Expand Down
2 changes: 2 additions & 0 deletions .claude/commands/task-runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Before ANY execution, output:
### Step 0.5: Load Required Skills

Before execution, load:

1. `.claude/skills/phase-control/SKILL.md`
2. `.claude/skills/scope-guard/SKILL.md`
3. `.claude/skills/checkpoint-manager/SKILL.md`
Expand Down Expand Up @@ -203,6 +204,7 @@ Output exactly this completion message:
```

**CRITICAL RULES:**

- **NEVER** automatically invoke task-planner for next phase
- **NEVER** automatically invoke task-runner for next phase
- **NEVER** generate Phase N+1 plans without explicit user command
Expand Down
8 changes: 8 additions & 0 deletions .claude/commands/worktree-disable.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# /worktree-disable - Disable Git Worktree Mode

## Purpose

Returns to sequential task execution. Cleans up existing worktrees.

## Trigger

```
/worktree-disable
```

## Process

### Step 1: Check for Active Worktrees

If worktrees exist with uncommitted work:

```
⚠️ ACTIVE WORKTREES DETECTED

Expand All @@ -26,6 +30,7 @@ Options:
```

### Step 2: Clean Up Worktrees

```bash
# Remove all worktrees
git worktree list | grep ".worktrees" | while read wt; do
Expand All @@ -37,14 +42,17 @@ git branch | grep "task/" | xargs git branch -D
```

### Step 3: Update Config

Sets in `.claude/config.yml`:

```yaml
git:
worktrees:
enabled: false
```

### Step 4: Confirm

```
╔══════════════════════════════════════════════════════════════╗
║ ✓ GIT WORKTREE MODE DISABLED ║
Expand Down
Loading
Loading