agentleFS
r-irber-irbe/proof-skills/skills/lean-upstream-porting/SKILL.md

lean-upstream-porting

Skill3 starsChanged 24 days agoApache-2.0View on GitHub

USE FOR: porting corpus lemmas or modules to mathlib/stdlib upstream: branch hygiene, PR body conventions. DO NOT USE FOR: the generic PR mechanics (open/label/bors/maintainer-merge - use @lean-pr). TRIGGERS: upstream, mathlib PR, port lemma, PR body, AI disclosure.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If gh pr edit silently drops body updates on the GraphQL path, read back the PR body and apply the update via gh api -X PATCH …

    line 41
  2. Very specific:

    If upstream module-system visibility (public import or sealed instances) breaks a corpus proof, isolate and repair the proof against …

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Upstream Porting (corpus lemma -> mathlib PR)

Port a proven result to upstream with its history, conventions, and review surface intact.

Routing

  • USE FOR: preparing, filing, and maintaining upstream PRs from a proven corpus.
  • DO NOT USE FOR: the mathematics itself; in-corpus refactors.

Workflow

  1. Route the artifact first. Math lemmas go to the math library (mathlib); methodologies, rubrics, and scanner tooling go to the skills repo. Never send methodology to mathlib or library code to the skills repo.
  2. Dossier before branch: statement inventory, generalization framing, prior-art check (#check the twins; text search misses @[to_additive]/generated names), and the AI-assistance history. Get operator approval on each PR-body claim before filing.
  3. Branch hygiene: one branch per independent PR, built against current master, 0 errors/0 warnings; never force-push shared branches; stack with depends on: lines only when semantics require it.
  4. PR body conventions (mathlib; the generic PR contract is

Recovery & STOP

  • If gh pr edit silently drops body updates on the GraphQL path, read back the PR body and apply the update via gh api -X PATCH repos/<owner>/<repo>/pulls/<n> -F body=@<body-file>.
  • If upstream module-system visibility (public import or sealed instances) breaks a corpus proof, isolate and repair the proof against upstream master via @lean-proof before updating the PR.

Handoffs

  • Predecessors: lean-proof (the proof is kernel-clean), lean-proof-refactor (the port is the slimmed form).
  • Successors: lean-research (prior-art/citation sweeps), lean-proof (review fixes).

Detailed reference

Full encyclopedic reference, decision trees, and lookup tables live in references/lean-upstream-porting-handbook.md .

See also

  • ../../references/lean-upstream-porting-handbook.md -- Complete lean-upstream-porting Handbook
  • ../lean-gateway/SKILL.md -- Top-level skill router

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.