# unlazy

> An agent skill that writes acceptance gates first and checks them with runnable commands before the agent may call work done

- Category: Agents & Automation / Agent Skills & Plugins
- Language: JavaScript
- Licence: MIT
- Repository: https://github.com/Leonxlnx/unlazy
- Canonical page: https://ai-tldr.dev/tools/unlazy/

## In short

unlazy is an open-source agent skill, MIT-licensed and written in JavaScript, that targets a familiar failure: an AI agent that stops halfway through a long task and reports it as finished. It sits in the Agent Skills & Plugins category of the Agents & Automation tools and is open-source, written in JavaScript and licensed MIT.

## Overview

unlazy is an open-source agent skill, MIT-licensed and written in JavaScript, that targets a familiar failure: an AI agent that stops halfway through a long task and reports it as finished. Its README describes it as completion discipline backed by runnable gates — before real work begins, the agent writes an acceptance ledger (`GATES.md`) with one observable outcome per gate, each with a `CHECK:` shell command and an `EXPECT:` pattern. A gate counts as met only when its command exits 0 and the expected text appears in the output, and the agent reports only what that evidence supports.

The core is a `SKILL.md` file that installs into Claude Code, Codex CLI and other agents supported by the skills CLI, plus a set of zero-dependency Node scripts. `gate-check.mjs` parses a ledger, shows each command before running it, asks for explicit approval, records evidence bound to the exact gate definition and can re-run every gate with `--reverify`. `gate-lint.mjs` flags gates that could never fail, and an optional Claude Code Stop hook blocks the session from ending while gates remain unmet. Approval records live outside the repository under `~/.unlazy/approved`, and the README is explicit that approval is consent, not a sandbox.

For larger jobs the skill uses the Depth Tree: the requested task is split at natural component or verification boundaries into leaves, each with its own ledger and file ownership, and branches get integration gates. Ready leaves can be dispatched to parallel agents in recorded launch waves, and the parent re-verifies every returned leaf instead of trusting its report. The project cites research on model laziness and premature completion as motivation, while stating that this research does not prove unlazy produces a fixed improvement.

## What it does

- Acceptance ledger (`GATES.md`) written before work starts, one observable outcome per gate with `CHECK:` and `EXPECT:` lines
- `gate-check.mjs` with `--status` (never executes), `--approve`, `--reverify` and opt-in `--jobs` for parallel checks
- Depth Tree decomposition into leaves and branches, each with its own gates, file ownership and integration checks
- Scoped orchestration under `.unlazy/<scope>/` with leaf states, ownership leases and recorded dispatch waves for parallel agents
- `gate-lint.mjs` catches mechanically weak gates, and abandoned gates surface as a required handoff rather than success
- Optional Claude Code Stop hook that blocks ending the session while gates are unmet; Node 16+ with no runtime dependencies

## Getting started

Commands come from the project's README. The checker and optional hook need Node 16 or newer.

1. Install the skill

   Use the skills CLI; add `-g` for a user-level install or `--all` for every detected agent. Manual installs clone the repo into `~/.claude/skills/unlazy` (Claude Code) or `~/.codex/skills/unlazy` (Codex CLI).

```bash
npx skills add Leonxlnx/unlazy
```

2. Trigger it on a substantial task

   Invoke it as `/unlazy` where slash skills are supported, `$unlazy` in Codex, or with a natural-language trigger. `tree N` asks for a Depth Tree of that depth.

```text
/unlazy tree 5 refactor the payment module and verify every migration path
```

3. Write a gates ledger

   For a solo task, copy `templates/gates-leaf.md` to `GATES.md` and replace every placeholder. Each runnable gate passes only when the command exits 0 and `EXPECT:` matches its output.

```markdown
# Gates: pricing behavior

- [ ] G1: pricing fixtures render the expected tiers
  CHECK: node scripts/verify-pricing.mjs
  EXPECT: pricing verification passed
  EVIDENCE: pending
```

4. Inspect, approve and run the gates

   `--status` only parses the ledger. After reading every command, `--approve` runs it; `--reverify` re-runs all runnable gates, including ones already marked complete.

```bash
node <path-to-skill>/scripts/gate-check.mjs --status GATES.md
node <path-to-skill>/scripts/gate-check.mjs --approve GATES.md
node <path-to-skill>/scripts/gate-check.mjs --reverify GATES.md
```

5. Optionally install the Stop hook

   Only with the user's consent. The default writes `.claude/settings.local.json` and keeps a backup of an existing settings file; `--uninstall` removes it.

```bash
node <path-to-skill>/scripts/install-hooks.mjs
```

## When to use it

- Reach for it when an agent keeps returning long, multi-part tasks half-done but reported as complete
- Reach for it to make done mean a set of commands that passed, not a confident summary
- Reach for it to split a large build or audit across parallel agents with clear file ownership and re-verification
- Reach for it to stop a Claude Code session from ending while acceptance checks are still failing
