scaffold-lean-library

scaffold-lean-library is a skill for Claude Code from cboone/agent-harness-plugins. It costs 128 tokens per session (2,650 once invoked), scanned A, original, MIT.

A project starter for a Lean 4 library, including Lake project setup, optional Mathlib or PFR dependencies, tests, linting, and GitHub Actions checks.

In plain words
What is it for?
Use it to create a Lean repository for proving mathematics in code, including projects based on Mathlib or PFR.
Why use it?
It removes the specialized setup work needed to begin a Lean mathematical formalization or library.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Part of the scaffold-lean-library plugin — 1 skill shipped together

Good fit Use it to create a Lean repository for proving mathematics in code, including projects based on Mathlib or PFR.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cboone/agent-harness-plugins/scaffold-lean-library
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/cboone/agent-harness-plugins/scaffold-lean-library
Any agent
npx skills add cboone/agent-harness-plugins --skill scaffold-lean-library
Clone the repo
git clone --depth 1 https://github.com/cboone/agent-harness-plugins

Made for: Claude Code.

Or install scaffold-lean-library, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for scaffold-lean-library

README.md
[![agentmods](https://agentmods.dev/badge/skills/cboone/agent-harness-plugins/scaffold-lean-library.svg)](https://agentmods.dev/skills/cboone/agent-harness-plugins/scaffold-lean-library)
Your own site
<a href="https://agentmods.dev/skills/cboone/agent-harness-plugins/scaffold-lean-library"><img src="https://agentmods.dev/badge/skills/cboone/agent-harness-plugins/scaffold-lean-library.svg" alt="Measured on agentmods" height="20"></a>
Per session 128 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,650 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00128 $0.02650
Opus 5 $0.00064 $0.01325
Sonnet 5 $0.00026 $0.00530
Haiku 4.5 $0.00013 $0.00265

Measured 3d ago against content hash 2479167f831a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

scaffold-lean-library scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/scaffold-lean-library/skills/scaffold-lean-library/SKILL.md · 249 lines

How it starts

The opening of the file, as written. The whole thing — 249 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Scaffold Lean Library

Generate a Lean 4 library repository with Lake, Mathlib or PFR dependencies, compile-time API regression tests, local Makefile targets, GitHub Actions CI, text linting, and agent instructions.

Workflow

1. Gather Project Information

If the user provided values in the request, use them and do not ask again. Derive safe defaults from context only when they are unambiguous.

Ask for any missing values:

  • Project name: kebab-case repository and Lake package name, for example entropy-inequalities.
  • Short description: one sentence for README, marketplace-style summaries, and agent instructions.
  • Top-level Lean namespace: UpperCamelCase, for example EntropyInequalities. Derive from the project name when the result is readable; ask if acronyms or domain terms make the derivation ambiguous.
  • Lean toolchain version: the exact lean-toolchain content, for example leanprover/lean4:v4.25.0.
  • Dependency family: Mathlib or PFR.
  • Dependency git ref: a Mathlib tag/ref or a PFR git ref.
  • Paper-backed mode: whether to add references/ stubs and Pandoc-academic lint ignores for formalizations tied to papers or transcriptions.
  • GitHub username: for repository URLs.
  • Copyright holder: for LICENSE and source headers.

Detect the GitHub username and full name when possible:

gh api user -q .login
git config user.name

If either command fails or returns an empty value, ask the user.

2. Resolve Dependency Ref

For Mathlib projects:

  1. If the user supplied a dependency ref, use it.

  2. Otherwise, if the Lean toolchain is exactly leanprover/lean4:vX.Y.Z or vX.Y.Z, derive the Mathlib ref vX.Y.Z.

  3. Verify the derived ref exists before using it:

    git ls-remote --tags https://github.com/leanprover-community/mathlib4.git refs/tags/vX.Y.Z
    
  4. If the tag does not exist, or if the Lean toolchain is nightly, a branch, or otherwise not a clean stable version, ask the user for the Mathlib ref.

Read the full file on GitHub · 249 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 249 lines · 128 tokens per session scan A 2479167f831a

Subscribe to this mod's changes

scaffold-lean-library is a skill published in the GitHub repository cboone/agent-harness-plugins (2 stars, last pushed 1mo ago), licensed MIT. It adds 128 tokens to every session and 2,650 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories