leanspec

The spec-coding methodology for AI-assisted development. Use when planning features, creating/refining/implementing/verifying specs, or organising a project. Works with whatever spec backend your team already uses — local markdown, GitHub Issues, Azure DevOps, Jira — by delegating platform-specific details to a LeanSpec adapter.

224 stars

Best use case

leanspec is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

The spec-coding methodology for AI-assisted development. Use when planning features, creating/refining/implementing/verifying specs, or organising a project. Works with whatever spec backend your team already uses — local markdown, GitHub Issues, Azure DevOps, Jira — by delegating platform-specific details to a LeanSpec adapter.

Teams using leanspec should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/leanspec/SKILL.md --create-dirs "https://raw.githubusercontent.com/codervisor/lean-spec/main/skills-repo/.agents/skills/leanspec/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/leanspec/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How leanspec Compares

Feature / AgentleanspecStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

The spec-coding methodology for AI-assisted development. Use when planning features, creating/refining/implementing/verifying specs, or organising a project. Works with whatever spec backend your team already uses — local markdown, GitHub Issues, Azure DevOps, Jira — by delegating platform-specific details to a LeanSpec adapter.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# LeanSpec — Spec Coding Skill

Teach agents **spec coding**: the practice of treating specs as durable
artifacts that drive development, not ephemeral planning notes. LeanSpec
provides the methodology and the `leanspec` CLI; each **adapter** (markdown,
GitHub Issues, ADO, Jira, …) speaks its backend's native language. The skill
is deliberately adapter-agnostic — never hard-code a status value, priority
name, or field key here.

## Start every session with capability discovery

Before reading, writing, or linking any specs, run:

```bash
leanspec capabilities -o json
```

The output is your source of truth. It tells you:

- The active adapter's name (`markdown`, `github`, `ado`, …).
- Which metadata fields exist and their types/enum values.
- Which field plays each **semantic role** (`status`, `priority`, `tags`,
  `assignee`, `due_date`) on this adapter.
- Which link types the backend understands (`parent`, `depends_on`, …).

Use the returned enum values as the only valid vocabulary. If you want to move
a spec into the "working" state, look up the semantic `status` field, pick the
value the adapter calls "work is underway," and send that — don't assume it's
called `in-progress`.

## Core principles

1. **Specs are durable artifacts.** They persist beyond the session, they are
   reviewable, and they link to code. They are not plan-mode scratch pads.
2. **Methodology, not mechanics.** The five phases below apply whether your
   backend is a markdown folder, a GitHub repo, or a Jira project.
3. **Discovery first.** Always read what exists before writing anything new.
4. **Intent before implementation.** Capture *why* first, *how* second.
5. **Verify against reality.** Never trust a status field alone — check code,
   commits, tests, CI.
6. **Use the adapter's vocabulary.** No hard-coded field names or values.

## The five phases

### 1. Discover

Understand the current state of the project before touching anything.

1. Run `leanspec capabilities -o json` (session start).
2. Run `leanspec board` to see the current shape of the project.
3. Run `leanspec search "<keywords>"` to find related items.
4. If a close match exists, consider extending or linking to it rather than
   creating a new item.

### 2. Create

Capture intent as a new, durable artifact.

1. Run `leanspec create <short-name>` with every known field in a single call
   (title, body, semantic fields like status/priority, tags, parent,
   dependencies). Never create an empty item and then patch it.
2. Write the body with:
   - **Overview** — what problem this solves and why it matters.
   - **Requirements** — a checklist of independently verifiable items.
   - **Non-goals** — what's explicitly out of scope.
   - **Acceptance criteria** — measurable definition of done.
3. Link relationships as they emerge. Use the adapter's declared link types
   (typically `parent` for hierarchy and `depends_on` for blockers — confirm
   via `capabilities`).

### 3. Refine

Make the spec implementation-ready before coding starts.

1. Locate files, modules, and APIs referenced in the spec; verify they exist.
2. Find existing patterns to reuse; note concrete paths and function signatures
   in the spec.
3. Validate dependencies are available.
4. Gate: no blocking unknowns; every checklist item is specific and actionable.

### 4. Implement

Execute against the refined spec.

1. Read the spec (`leanspec view <id>`), including parent, children, and
   dependencies.
2. Transition the spec into its "work underway" state via
   `leanspec update <id>` using the adapter's declared status value.
3. Work the checklist in order; stay inside the scope boundaries; document
   decisions and discoveries inside the spec as they happen.
4. If you find out-of-scope work, create a **new** spec and link it rather
   than expanding the current one.

### 5. Verify

Close the loop against reality, not status.

1. Run the project's quality gates (tests, typecheck, lint, build).
2. Re-read the spec's acceptance criteria and tick each one only if you can
   point to the commit, test, or file that proves it.
3. Transition the spec to its adapter-declared "done" state, and append a
   short implementation note.
4. If anything failed, stay in-progress, fix the cause, and re-run.

## Relationship types

Relationships are adapter-declared. Check `capabilities.link_types`. The two
most common shapes:

- **Parent / child** — an umbrella decomposed into child items. A child
  doesn't make sense without its parent; the parent completes when all its
  children do.
- **Depends on** — a blocker. Both items are independent work; one just has
  to ship first.

**Decision flowchart:**

1. Is item B part of item A's scope? → parent/child.
2. Does item B just need item A finished first? → depends-on.
3. Never use both for the same pair.

**Litmus test:** "If item A didn't exist, would item B still make sense?"
**No** → B is A's child. **Yes** → B depends on A.

## Managing evolving work

- **Content changes** — use `leanspec update --content` or edit the item body.
- **Metadata changes** — use the supported `leanspec update` flags
  (`--status`, `--priority`, `--assignee`, `--add-tags`, `--remove-tags`,
  etc.) for adapter-declared fields. Each flag accepts values from the
  adapter's capabilities. The skill never writes raw frontmatter or YAML.
- **Scope creep** — split. Create a sibling spec and link it; update the
  original's non-goals to reference the split.
- **Obsolete work** — transition to the adapter's "closed/archived" state
  rather than deleting; history matters.

## Context economy

- Keep each item under ~2000 tokens. Split if larger.
- Favour bullet lists over prose.
- Use references to external docs rather than copying them.
- Checklists are for actionable items only — plain lists for everything else.

## Best practices — at a glance

- **Never create items manually.** Always use `leanspec create`.
- **Never edit raw metadata.** Use `leanspec update`.
- **Always discover first.** Run `board` / `search` before `create`.
- **Always pass every known field to `create`.** No empty-then-patch.
- **Always verify before closing.** Tests, typecheck, lint, build.
- **Trust the adapter's vocabulary.** Re-run `capabilities` if anything feels
  ambiguous.

## References

- [references/adapters.md](./references/adapters.md) — how adapters work and
  how to write your SOP on top of them.
- [references/workflow.md](./references/workflow.md) — the five-phase workflow
  with examples.
- [references/commands.md](./references/commands.md) — CLI reference.
- [references/best-practices.md](./references/best-practices.md) — detailed
  patterns and anti-patterns.
- [references/examples.md](./references/examples.md) — end-to-end scenarios
  on markdown, GitHub Issues, and Azure DevOps backends.

Related Skills

leanspec-development

224
from codervisor/lean-spec

Development workflows, commands, publishing, CI/CD, changelog management, and contribution guidelines for LeanSpec. Use when contributing code, fixing bugs, setting up dev environment, running tests or linting, working with the monorepo structure, looking up build/dev/test/publish/format/lint commands, preparing releases, publishing to npm, bumping versions, syncing package versions, testing dev builds, troubleshooting npm distribution, updating changelogs, triggering CI/CD workflows, monitoring build status, debugging failed runs, managing artifacts, checking CI before releases, or researching AI agent runners. Triggers include any development, scripting, publishing, CI/CD, changelog, or runner research task in this project.

watch-ci

224
from codervisor/lean-spec

Watch GitHub Actions CI status for the current commit until completion. Use after pushing changes to monitor build results.

parallel-worktrees

224
from codervisor/lean-spec

Run multiple AI coding agent sessions in parallel using git worktrees — each agent isolated in its own worktree, working on a separate branch. Use this skill whenever the user wants to: run two or more AI agents simultaneously on different features or bugs, set up isolated agent workspaces in the same repo, push parallel branches to GitHub and open/update PRs, coordinate between concurrent agent sessions, or clean up after merging. Triggers on: "parallel agents", "multiple agent sessions", "git worktree", "run agents in parallel", "work on two things at once", "isolated agent workspace", "spin up another agent", or any request involving simultaneous AI-assisted development streams.

github-integration

224
from codervisor/lean-spec

Enable the GitHub CLI (`gh`) in Claude Code cloud sessions and GitHub Copilot coding agent environments. Use this skill when: (1) setting up a project so cloud AI agents can use `gh` for PRs, issues, and releases, (2) configuring setup scripts or SessionStart hooks for `gh` installation, (3) adding `copilot-setup-steps.yml` for GitHub Copilot agents, (4) troubleshooting `gh` auth failures in cloud sessions, or (5) configuring `GH_TOKEN` for headless environments. Triggers on: "enable gh", "github integration", "Claude Code cloud setup", "copilot setup steps", "gh auth in cloud", "gh not working in cloud", "setup script", or any request involving GitHub CLI access from cloud-based AI coding agents.

agent-browser

224
from codervisor/lean-spec

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

workspace-surface-audit

144923
from affaan-m/everything-claude-code

Audit the active repo, MCP servers, plugins, connectors, env surfaces, and harness setup, then recommend the highest-value ECC-native skills, hooks, agents, and operator workflows. Use when the user wants help setting up Claude Code or understanding what capabilities are actually available in their environment.

DevelopmentClaude

ui-demo

144923
from affaan-m/everything-claude-code

Record polished UI demo videos using Playwright. Use when the user asks to create a demo, walkthrough, screen recording, or tutorial video of a web application. Produces WebM videos with visible cursor, natural pacing, and professional feel.

Developer ToolsClaude

token-budget-advisor

144923
from affaan-m/everything-claude-code

Offers the user an informed choice about how much response depth to consume before answering. Use this skill when the user explicitly wants to control response length, depth, or token budget. TRIGGER when: "token budget", "token count", "token usage", "token limit", "response length", "answer depth", "short version", "brief answer", "detailed answer", "exhaustive answer", "respuesta corta vs larga", "cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión corta", "quiero controlar cuánto usas", or clear variants where the user is explicitly asking to control answer size or depth. DO NOT TRIGGER when: user has already specified a level in the current session (maintain it), the request is clearly a one-word answer, or "token" refers to auth/session/payment tokens rather than response size.

Productivity & Content CreationClaude

skill-comply

144923
from affaan-m/everything-claude-code

Visualize whether skills, rules, and agent definitions are actually followed — auto-generates scenarios at 3 prompt strictness levels, runs agents, classifies behavioral sequences, and reports compliance rates with full tool call timelines

DevelopmentClaude

santa-method

144923
from affaan-m/everything-claude-code

Multi-agent adversarial verification with convergence loop. Two independent review agents must both pass before output ships.

Quality AssuranceClaude

safety-guard

144923
from affaan-m/everything-claude-code

Use this skill to prevent destructive operations when working on production systems or running agents autonomously.

DevelopmentClaude

repo-scan

144923
from affaan-m/everything-claude-code

Cross-stack source code asset audit — classifies every file, detects embedded third-party libraries, and delivers actionable four-level verdicts per module with interactive HTML reports.

DevelopmentClaude