Agent skill

Leanspec Pre Push

by codervisor in codervisor/leanspec

Run before pushing code to the lean-spec repo to catch what reviewers and CI will catch later, and confirm the branch has a linked spec issue in a valid state.

MITAuto-check passedDevelopment

Install Leanspec Pre Push

skills CLI
$ npx skills add codervisor/leanspec --skill leanspec-pre-push -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install codervisor/leanspec leanspec-pre-push --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/codervisor/leanspec.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/leanspec-pre-push .claude/skills/leanspec-pre-push && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
leanspec-pre-push
GitHub stars
296
Token cost
~2.5k tokens
SKILL.md length
1,182 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Run before pushing code to the lean-spec repo to catch what reviewers and CI will catch later, and confirm the branch has a linked spec issue in a valid state.

  • Works in 6 steps: Sync main into the branch → Build / typecheck / test → i18n parity check → …
  • Include before push
  • SKILL.md covers Why, Steps, Fast path and What this skill does NOT cover
  • Calls pnpm and git

What it does

Leanspec Pre Push is an agent skill from codervisor/leanspec. Run before pushing code to the lean-spec repo to catch what reviewers and CI will catch later, and confirm the branch has a linked spec issue in a valid state. Reproduces the merge-preview environment, walks through this repo's common merge-conflict patterns, and runs the project's typecheck / clippy / test gates. Triggers include "before push", "ready to push", "pre-push check", "push readiness", "prep for PR", "resolve merge conflict", "merge conflict", "branch has conflicts", "sync with main", or proactively…

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git workflow. It works with Git, pnpm and Rust. The repository describes itself as: Lightweight, flexible Spec-Driven Development (SDD) for modern AI-powered development. The licence is MIT.

When your agent uses it

  • Include before push
  • Resolve merge conflict
  • Branch has conflicts
  • Proactively before any git push on a lean-spec branch

Example prompts

  • “s common merge-conflict patterns, and runs the project”
  • “before push”
  • “ready to push”
  • “/leanspec-pre-push”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Sync main into the branch
  2. Build / typecheck / test
  3. i18n parity check
  4. Spec-issue link check
  5. Provider-impact and i18n evidence check
  6. Push

What it can do on your machine

Read from SKILL.md and the folder at commit ee122d6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Leanspec Pre Push loads about 2.5k tokens when it runs. Until then it costs about 144 tokens; SKILL.md has 1,182 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~144
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from codervisor/leanspec at commit ee122d6, republished under its MIT licence (© codervisor). 1,182 words, ~2,496 tokens.

Download SKILL.mdSave it as .claude/skills/leanspec-pre-push/SKILL.md (or your agent's skills folder).
name
leanspec-pre-push
description
Run before pushing code to the lean-spec repo to catch what reviewers and CI will catch later, and confirm the branch has a linked spec issue in a valid state. Reproduces the merge-preview environment, walks through this repo's common merge-conflict patterns, and runs the project's typecheck / clippy / test gates. Triggers include "before push", "ready to push", "pre-push check", "push readiness", "prep for PR", "resolve merge conflict", "merge conflict", "branch has conflicts", "sync with main", or proactively before any git push on a lean-spec branch.
metadata.internal
true

leanspec-pre-push

Mechanical checklist that catches the reviewer / CI failures this repo has actually had, plus a spec-link check that enforces the SDD loop locally.

This is lean-spec's analogue of onsager-pre-push / duhem-pre-push. The discipline is the same; the toolchain checks are lean-spec's (pnpm + cargo). The repo-specific patterns below come from this monorepo's structure (TypeScript packages, Rust crates, i18n locale files, schemas).

Why

CI on pull_request checks out a merge of origin/main + the PR branch, not the branch alone. Local pnpm typecheck without that merge is insufficient.

The spec-link step enforces "no PR without a spec or a trivial label" at push time, before the PR is open — so the author sees the problem locally instead of hearing about it from a reviewer.

Steps

Run all of these from the repo root.

1. Sync main into the branch
bash
git fetch origin main
git merge origin/main --no-edit

Resolve conflicts locally, before push — never on the PR "Resolve conflicts" web editor (it bypasses any local validation). If the merge aborts cleanly, skip to step 2.

Resolving conflicts
  1. Inventory what conflicted:

    bash
    git status --short                   # U* lines = unresolved paths
    git diff --name-only --diff-filter=U
  2. Work by pattern, not by file. A single logical conflict often spans several files. Match what you see against the patterns below before touching conflict markers — the right fix is often "take main's version and re-apply your change on top", not a line-by-line merge.

  3. Resolve, then stage each resolved path with git add <path>. Re-run git status until no U* entries remain.

  4. Verify before committing the merge. Run pnpm typecheck && pnpm pre-push. Run pnpm test for the affected packages. If the merge touched Rust, also run pnpm build:rust and pnpm test:rust.

  5. Only then:

    bash
    git commit --no-edit                 # default "Merge branch 'main' ..." message
  6. If you get lost, bail and retry:

    bash
    git merge --abort

    This restores pre-merge state. Never git reset --hard or git checkout -- without confirming nothing is staged you care about — the merge carries uncommitted resolutions.

    Prefer merge over rebase for syncing main here: the branch is likely already pushed, rebase rewrites history, and force-push is a destructive action.

Common collision patterns to watch for
  • CHANGELOG.md: both branches added entries under the same [Unreleased] heading. Both should land — concatenate alphabetically by category (Added, Changed, Fixed, …).
  • package.json version field: never resolve by hand. Run pnpm sync-versions to re-derive from the root version. See leanspec-development "Publishing & Releases".
  • pnpm-lock.yaml: never hand-edit. After resolving the source package.json conflicts, run pnpm install to regenerate the lockfile, then git add pnpm-lock.yaml.
  • Cargo.lock: never hand-edit. After resolving Rust Cargo.toml conflicts, run pnpm build:rust and let cargo regenerate.
  • locales/en.json and locales/zh-CN.json: both branches added i18n keys. Both should land; verify each new key exists in both files. If one branch added a key only to en and the other added only to zh-CN, that's a process bug — fix the missing parity before committing the merge.
  • schemas/*.json: JSON schema files. Both branches added fields. Merge by key; verify the schema still validates by running the validator (when wired) or pnpm typecheck to confirm the generated TypeScript types still compile.
  • Generated packages/**/dist/: don't merge. Delete the conflict and rerun pnpm build.
  • specs/ legacy directory: don't author new files here post-migration. If a conflict exists in specs/ because both branches added a new specs/NNN-slug/, the correct fix is usually to delete both new directories and migrate them to GitHub issues via issue-spec. If they pre-date migration, take both arms.
2. Build / typecheck / test

Run, in order:

bash
pnpm typecheck             # mandatory before marking work complete
pnpm pre-push              # typecheck + clippy
pnpm test                  # full Vitest suite
pnpm format:rust:check     # if Rust changed
pnpm test:rust             # if Rust changed

If the change touches the desktop bundle (packages/desktop/), also run pnpm dev:desktop smoke check.

Treat any warning as a blocker. Do not #[allow(dead_code)], #[allow(unused)], or @ts-ignore your way past it; fix the root cause. Rust clippy is -D warnings — warnings are errors.

3. i18n parity check

If the diff touches user-visible strings:

  1. Locale files live under locales/en.json and locales/zh-CN.json (and any per-package equivalents — see I18N.md).
  2. For every key added in en.json, confirm the same key exists in zh-CN.json. Translation can be a placeholder + a // TODO(i18n) comment, but the key must exist — CI will fail if zh-CN is missing keys.
  3. If you added a new locale file, add it to whatever locale-loader registers them.
Show full SKILL.md (533 more words)Show less

Before pushing, confirm this branch corresponds to a known spec issue (or is explicitly trivial). This is the local enforcement of the SDD loop's spec-link rule.

  1. Find the spec issue. Search open issues with the spec label on codervisor/leanspec:

    mcp__github__list_issues  repo=codervisor/leanspec  labels=[spec]  state=open

    Or read your commit messages (git log origin/main..HEAD) for a #N reference.

    If you can't find one, stop and create one via issue-spec (or triage whether this is truly trivial).

  2. Confirm any open questions on the spec are resolved. If the spec's ### Open questions subsection still has unanswered items, stop and resolve them in the issue thread first — the design isn't pinned yet.

  3. Draft the PR body linking line so you can paste it in:

    • Closes #N if this PR delivers the full spec.
    • Part of #N if it's one slice of a multi-PR spec.
    • Fixes #N for a defect referenced by a bug spec.

    Also draft a ## Delivers subsection listing the exact Plan items you tick with this PR.

  4. Scan the branch's commit messages for implicit issue references (advisory, not blocking):

    bash
    git log --format='%s%n%b' origin/main..HEAD | grep -oE '#[0-9]+' | sort -u

    For each #N returned, decide deliberately:

    • PR delivers that issue's acceptance → add Closes #N to the body. Multi-issue Closes lines are fine (Closes #27, Closes #30, Closes #33). Auto-close doesn't fire for issues that are only mentioned in commit subjects — without an explicit Closes line, those issues stay open after merge.
    • PR only touches that issue → use Refs #N so it cross-links without claiming closure.
    • False positive (issue number inside a code identifier, commit hash, etc.) → ignore.
  5. If this is genuinely trivial (typo, doc-only, one-line obvious fix), skip the spec-link substeps above and plan to apply the trivial label to the PR immediately after mcp__github__create_pull_request.

5. Provider-impact and i18n evidence check

If the spec issue this PR closes is labeled provider-impact:

  • Confirm ## Provider impact is filled in on the spec.
  • Confirm the PR body mirrors the relevant subset.
  • If Breaking change? yes on the spec, confirm a CHANGELOG entry is staged for this PR under the next [Unreleased] heading. See leanspec-development "Changelog".

If the spec issue is labeled i18n:

  • Confirm both locales/en.json and locales/zh-CN.json (and any per-package locale files) contain the new keys.
6. Push
bash
git push -u origin <branch>

Retry up to 4 times with exponential backoff (2s, 4s, 8s, 16s) on transient network errors. Never use --force on main or long-lived branches without explicit ask.

After push, open the PR with the spec-link line in its body (or apply the trivial label). The spec issue stays open until the PR closes it — no status labels to flip.

Fast path

If nothing under tracked source paths changed (e.g. docs-only edits):

  • Step 2 reduces to pnpm typecheck if any docs touch typed config; otherwise it's a no-op.
  • Step 1 (sync main) is not skippable — main may have moved.
  • Step 4 (spec-link) is not skippable for non-trivial PRs.

What this skill does NOT cover

© codervisor, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/leanspec-pre-push of codervisor/leanspec.

Open the folder on GitHubat commit ee122d6

Compare with similar skills

Leanspec Pre Push next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Leanspec Pre Push compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Leanspec Pre Push this skillcodervisor/leanspec296—~2.5kAutomated safety check: PassMIT
Worktrunk Release Workflowmax-sixty/worktrunk8.9k—~6.9kAutomated safety check: PassCustom licence
BrDicklesworthstone/beads_rust1.1k—~2.7kAutomated safety check: PassMIT
ZCF Release AutomationUfoMiao/zcf6.1k—~3.4kAutomated safety check: PassMIT
Review And Fix PRpnpm/pnpm37k—~796Automated safety check: PassMIT
Guarded Git Commit and Pushjerrywu001/cc-sessions-viewer394—~603Automated safety check: NotesMIT

Similar skills

  • Worktrunk Release Workflow

    max-sixty/worktrunk

    Walks a maintainer through cutting a Worktrunk release: sync the release branch, pass two test gates, review the changes, then publish.

    8.9k GitHub stars~6.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Br

    Dicklesworthstone/beads_rust

    Official skill for beadsrust (br), a local-first, dependency-aware issue tracker for AI agents.

    1.1k GitHub stars~2.7k tokensUpdated today
    DevelopmentAuto-check passed
  • Automates a version release with changesets: analyzes code changes, writes a bilingual CHANGELOG, bumps the version and commits through a release branch and pull request.

    6.1k GitHub stars~3.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Review and fix an existing pnpm pull request, rebase it, commit and push fixes, then follow CI and review to completion.

    37k GitHub stars~796 tokensUpdated today
    DevelopmentAuto-check passed
  • Guarded Git Commit and Push

    jerrywu001/cc-sessions-viewer

    Commits and pushes only on an explicit request, pulling first, running the project's CI checks locally, and stopping cold on any conflict or failure.

    394 GitHub stars~603 tokensUpdated today
    DevelopmentAuto-check: notes
  • Stax Dev

    cesarferreira/stax

    Development harness for the stax Rust CLI project. An agent skill from cesarferreira/stax.

    128 GitHub stars~987 tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from codervisor/leanspec

  • Leanspec

    codervisor/leanspec

    The spec-coding methodology for AI-assisted development. An agent skill from codervisor/leanspec.

    296 GitHub stars~1.8k tokensUpdated 4 mo ago
    Auto-check passed
  • Leanspec Development

    codervisor/leanspec

    Development workflows, commands, publishing, CI/CD, changelog management, and contribution guidelines for LeanSpec.

    296 GitHub stars~2.5k tokensUpdated 4 mo ago
    Auto-check passed
  • Leanspec Dev Process

    codervisor/leanspec

    The end-to-end spec-issue-driven dev loop for lean-spec — spec → branch → implement → PR → merge → closure.

    296 GitHub stars~3.3k tokensUpdated 4 mo ago
    Auto-check passed
  • Leanspec PR Lifecycle

    codervisor/leanspec

    Manage a lean-spec PR after it's been pushed — spec-issue linking, CI triage, review-comment discipline, merge-conflict recovery on open PRs, webhook subscription, and CHANGELOG follow-through on…

    296 GitHub stars~3.3k tokensUpdated 4 mo ago
    Auto-check passed
  • Watch CI

    codervisor/leanspec

    Watch GitHub Actions CI status for the current commit until completion.

    296 GitHub stars~724 tokensUpdated 4 mo ago
    Auto-check: notes

Works with

Categories

Questions about Leanspec Pre Push

What does Leanspec Pre Push do?

Run before pushing code to the lean-spec repo to catch what reviewers and CI will catch later, and confirm the branch has a linked spec issue in a valid state. Leanspec Pre Push is an agent skill from codervisor/leanspec. Run before pushing code to the lean-spec repo to catch what reviewers and CI will catch later, and confirm the branch has a linked spec issue in a valid state.

When should I use Leanspec Pre Push?

Leanspec Pre Push fits situations like: include before push; resolve merge conflict; branch has conflicts; proactively before any git push on a lean-spec branch.

How do I install Leanspec Pre Push in Claude Code?

Run `npx skills add codervisor/leanspec --skill leanspec-pre-push -a claude-code`. Or copy the skill folder (.agents/skills/leanspec-pre-push in codervisor/leanspec) into .claude/skills/leanspec-pre-push in your project. Claude Code loads it when a task matches its description.

How do I install Leanspec Pre Push in Codex?

Run `npx skills add codervisor/leanspec --skill leanspec-pre-push -a codex`. Or copy the skill folder (.agents/skills/leanspec-pre-push in codervisor/leanspec) into .agents/skills/leanspec-pre-push in your project. Codex loads it when a task matches its description.

Can I use Leanspec Pre Push in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add codervisor/leanspec --skill leanspec-pre-push -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/leanspec-pre-push, .gemini/skills/leanspec-pre-push, .github/skills/leanspec-pre-push and .opencode/skills/leanspec-pre-push in your project.

What does Leanspec Pre Push need to run?

Going by SKILL.md and its folder, Leanspec Pre Push needs the command-line tools its instructions call (pnpm and git).

Does Leanspec Pre Push access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Leanspec Pre Push safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Leanspec Pre Push use?

Leanspec Pre Push is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Leanspec Pre Push use?

About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Leanspec Pre Push?

Skills that share tags, products or a category with Leanspec Pre Push: Worktrunk Release Workflow (max-sixty/worktrunk, 8.9k stars), Br (Dicklesworthstone/beads_rust, 1.1k stars), ZCF Release Automation (UfoMiao/zcf, 6.1k stars) and Review And Fix PR (pnpm/pnpm, 37k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Leanspec Pre Push?

codervisor (a GitHub organization) maintains it in codervisor/leanspec, which has 296 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on May 20, 2026.

Source: codervisor/leanspec on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.