legion-simplify

Reviews branch diffs for structural code quality issues and records a validated per-file quality gate.

3|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/runlegion/legion --skill legion-simplify-runlegion
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: legion-simplify
Source: https://github.com/runlegion/legion/tree/main/plugin/skills/legion-simplify
Command: npx skills add https://github.com/runlegion/legion --skill legion-simplify-runlegion

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Self-review of code changes often becomes a rubber stamp: reviewers type "clean" without reading the diff, and structural issues like duplicate logic or stringly-typed state slip into pull requests. This Skill forces an articulated, per-file review of the branch diff and validates that articulation before a PR can be opened. ## Core Features & Use Cases - Diff-driven structural review: Inspects git diff main...HEAD for duplicate logic, unnecessary abstraction, stringly-typed state, error swallowing, copy-paste variations, and similar issues. - Validated articulation gate: Requires a markdown file with one substantive, locator-anchored entry per changed file; legion quality-gate check refuses boilerplate, missing coverage, or entries without file:line evidence. - Findings ledger and PR gating: Structured JSON findings are tracked as PENDING until resolved by a later commit, dispositioned, or batch-acked, and legion pr create only proceeds when a clean gate exists for the current HEAD. - Use Case: Before opening a pull request on a feature branch, run the review to produce a per-file articulation, fix any findings, and record a clean gate so the PR creation command verifies the branch was actually reviewed. ## Quick Start Ask the agent to run the legion-simplify review on the current branch diff and record the quality gate before creating the pull request.

Frequently Asked Questions about legion-simplify

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review a branch diff for code quality before opening a PR?

Run the legion-simplify review on `git diff main...HEAD`, write a markdown articulation with one entry per changed file, then record it with `legion quality-gate check`. A clean recorded gate lets `legion pr create` proceed.

What code quality issues does a diff review check for?

The review checks for duplicate logic, unnecessary abstraction, stringly-typed state, hand-rolled helpers duplicating std utilities, unnecessary parameters, copy-paste variations, error swallowing, and change-narrating comments. Style preferences and pre-existing issues outside the diff are explicitly not flagged.

Why was my quality gate refused even though I wrote entries for each file?

Refusals happen when a changed file lacks an entry, an entry is under roughly 12 words, or the prose cites no within-file locator such as a file:line, line number, symbol, or Evidence line. Headings must also match git's reported paths byte-for-byte.

Can I record a clean verdict while reporting findings in the same call?

No. Passing `--findings-json` together with `--result clean` is refused. A clean verdict also requires that no prior HIGH/MED finding on the branch is still pending and no prior LOW finding remains un-acked.

How are recorded findings resolved on a branch?

Findings auto-resolve when a later commit touches the flagged file, or you can disposition one with `finding-disposition` and a reason, or batch-ack LOW findings with `finding-ack`. Use `finding-list` to see pending finding IDs for the branch.

What are the limitations of the quality gate validator?

The validator checks structure only: file coverage, minimum word count, and the presence of a locator. It cannot judge whether the reasoning is correct, so a plausible-sounding but wrong verdict can still pass; review quality remains the reviewer's responsibility.