# Lenses

Focused prompts for multi-perspective code analysis.

## Philosophy

Each lens examines code through one specific concern. Multiply lenses × models for diverse perspectives.

## Usage

**Single lens, multiple models:**
```bash
orch consensus "$(cat ~/.config/lenses/code/bloat.md)" flash gemini gpt --file src/target.py
```

**Pipe file content:**
```bash
cat src/target.py | orch consensus "$(cat ~/.config/lenses/code/smells.md)" flash gemini
```

**Convergent review (multiple passes):**
```bash
for lens in bloat smells dead-code; do
  echo "=== $lens ==="
  orch chat "$(cat ~/.config/lenses/code/$lens.md)" --model gemini --file src/target.py
done
```

## Available Lenses

| Lens | Focus |
|------|-------|
| `bloat.md` | File size, function length, complexity metrics |
| `smells.md` | Code smells, readability, naming issues |
| `dead-code.md` | Unused exports, zombie code, unreachable paths |
| `redundancy.md` | Duplicate systems, YAGNI, consolidation opportunities |
| `security.md` | Injection, auth gaps, secrets, crypto misuse |
| `error-handling.md` | Swallowed errors, missing handling, failure modes |
| `coupling.md` | Tight coupling, circular deps, layer violations |
| `boundaries.md` | Layer violations, dependency direction, domain cohesion |
| `evolvability.md` | Hard-coded policies, missing seams, change amplification |

## Planned Lenses

- `coverage.md` - Test gaps, untested critical paths
- `perf.md` - Bottlenecks, N+1 queries

## Output Convention

All lenses output findings in a consistent format:
```
[TAG] <severity:HIGH|MED|LOW> <file:line>
Issue: <description>
Suggest: <action>
```

This enables parsing and automated beads creation.
