# Lean Review

CocoLean diff-scoped over-engineering audit, scans uncommitted git diff and applies...

- Repository: https://github.com/Snowflake-Labs/cocoplus (727 stars)
- Category: Git and review
- License: MIT
- Last updated: 2026-10-04
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Snowflake-Labs/cocoplus --skill lean-review -g -a claude-code -y`
Codex: `npx skills add Snowflake-Labs/cocoplus --skill lean-review -g -a codex -y`
Cursor: `npx skills add Snowflake-Labs/cocoplus --skill lean-review -g -a cursor -y`
Gemini CLI: `npx skills add Snowflake-Labs/cocoplus --skill lean-review -g -a gemini-cli -y`

## Description

CocoLean diff-scoped over-engineering audit, scans uncommitted git diff and applies five classification tags (delete/stdlib/native/yagni/shrink) to identify unnecessary surface area before commit.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

## Objective

You are executing `$lean review`, a diff-scoped over-engineering audit. Scan the uncommitted git diff and apply five CocoLean classification tags to each introduced construct. The audit is scoped to the current diff only, not the entire codebase. Feedback must be actionable at the moment of highest receptivity: before the commit.

Before proceeding, verify that `.cocoplus/` exists. If not, output: "CocoPlus is not initialized. Run `$pod init` first." Then stop.

## Step 1, Run Deterministic Diff Scanner

```
invoke cocolean/lean-review-engine
```

The script reads `git diff` (unstaged and staged changes), applies AST-level pattern matching, and outputs a JSON finding list. Read the JSON output.

If no uncommitted changes exist, output: "No uncommitted changes found. `$lean review` operates on the current diff, stage or modify files first." Then stop.

## Step 2, Classify Findings by Tag

Apply the five CocoLean classification tags in severity order:

**Tier 1, Existence-level (surface first):**

- **`delete`**, Code with no callers, no tests, and no declared future use in `spec.md` or `discuss.md`. It should not exist yet. Severity: `blocking` if it touches a trust boundary; `important` otherwise.

- **`yagni`**, Abstractions, configuration flags, extension points, or generalization layers added speculatively for requirements not in the current spec. "You Aren't Gonna Need It." Severity: `nit` if no security risk; `important` if it expands the attack surface or adds untested code paths.

**Tier 2, Correctness-level (surface second):**

- **`stdlib`**, Logic that reimplements functionality already present in Snowflake built-in functions or standard SQL. Include the specific replacement construct in the finding. Severity: `important`.

The rest: https://github.com/Snowflake-Labs/cocoplus/blob/HEAD/.cortex/skills/cocolean/lean-review/SKILL.md
