title: Code Review: {{target}}

description:
Multi-lens code review workflow for {{target}}.

## Philosophy
The LLM stays in the loop at every step - this is agent-assisted review, not automated parsing. The agent applies judgment about what's worth filing, how to prioritize, and what context to include.

## Variables
- target: File or directory to review

## Workflow
1. Explore codebase to find candidates (if target is directory)
2. Run lenses via orch consensus for multi-model perspective
3. Analyze findings - LLM synthesizes across lenses and models
4. File issues with judgment - group related, set priorities, add context
5. Summarize for digest

## Lenses Available
- bloat: size, complexity, SRP violations
- smells: readability, naming, control flow
- dead-code: unused, unreachable, obsolete
- redundancy: duplication, YAGNI, parallel systems

status: open

issue_type: epic


title: Run bloat lens on {{target}}

description:
Run bloat review lens via orch:

```bash
orch consensus "$(cat ~/.config/lenses/bloat.md)" flash gemini --file {{target}} --mode open
```

Look for: file size, function length, complexity, SRP violations.
Record findings for later filing.

issue_type: task

depends_on_id: skills-fvc

type: parent-child

created_by: daemon


title: Run smells lens on {{target}}

description:
Run smells review lens via orch:

```bash
orch consensus "$(cat ~/.config/lenses/smells.md)" flash gemini --file {{target}} --mode open
```

Look for: naming issues, control flow smells, data smells, structural issues.
Record findings for later filing.


title: Run dead-code lens on {{target}}

description:
Run dead-code review lens via orch:

```bash
orch consensus "$(cat ~/.config/lenses/dead-code.md)" flash gemini --file {{target}} --mode open
```

Look for: zombie code, unreachable paths, obsolete shims, import cruft.
Record findings for later filing.


title: Run redundancy lens on {{target}}

description:
Run redundancy review lens via orch:

```bash
orch consensus "$(cat ~/.config/lenses/redundancy.md)" flash gemini --file {{target}} --mode open
```

Look for: duplication, parallel systems, YAGNI violations, consolidation opportunities.
Record findings for later filing.


title: Analyze and file findings as beads

description:
Review all lens findings and file actionable items as beads in the TARGET REPO.

## LLM Judgment Required
This is NOT mechanical parsing. The agent should:

1. **Synthesize across lenses** - same issue may appear in bloat + smells
2. **Prioritize by impact** - P2 for blocking issues, P3 for cleanup
3. **Group related findings** - one issue for 'split this file' vs 5 separate issues
4. **Add context** - why it matters, suggested approach, quick-win vs big-refactor
5. **Skip noise** - LOW severity findings unless pattern emerges

## Filing Pattern
```bash
cd <target-repo>
bd create --title="refactor: <clear action>" --type=task --priority=<2|3> --body="<context>

Found by <lens> review."
```

## Key Questions
- Is this worth someone's time to fix?
- Can related findings be grouped into one actionable issue?
- What's the right priority given the codebase context?


title: Summarize review findings

description:
Create summary of code review findings for {{target}}:

- Total findings by severity (HIGH/MED/LOW)
- Top issues by category
- Recommendations for immediate action
- Technical debt assessment

This summary will become the squash digest.


title: Explore {{target}} for review candidates

description:
If {{target}} is a directory, explore to find files worth reviewing.

## For Bloat Lens
- Find files over 300 lines (warning) or 500 lines (critical)
- Find functions over 50 lines
- Identify files with multiple responsibilities

## For Other Lenses
- Sample representative files from different modules
- Prioritize high-traffic code over rarely-used

## Output
List of specific files to run through lenses, prioritized by likely issues.

Skip if {{target}} is already a specific file.