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.
In this repository65 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-guard-judge-evalSkill
- applied-data-information-securitySkill
- applied-engineering-disciplinesSkill
- applied-legal-reasoningSkill
- epistemic-discovery-engineSkill
- epistemic-mappingSkill
- hol-metamath-adapterSkill
- isabelle-isar-adapterSkill
- itp-cross-portingSkill
- lean-ai-formalizationSkill
- lean-applied-reasoningSkill
- lean-axiom-closureSkill
- lean-bigraph-modelingSkill
- lean-bisectSkill
- lean-blueprintSkill
- lean-buildSkill
- lean-causal-reasoningSkill
- lean-competitive-mathSkill
- lean-convergence-verificationSkill
- lean-core-onlySkill
- lean-dag-visualizerSkill
- lean-deep-auditSkill
- lean-doc-feedbackSkill
- lean-doc-improvementSkill
- lean-doc-requirementsSkill
- lean-enforcementSkill
- lean-formalization-breakdownSkill
- lean-gatewaySkill
- lean-integration-protocolSkill
- lean-knowledge-formalizationSkill
- lean-math-analysisSkill
- lean-math-discreteSkill
- lean-math-dynamicalSkill
- lean-math-foundationsSkill
- lean-math-optimizationSkill
- lean-math-stochasticSkill
- lean-mweSkill
- lean-nested-learningSkill
- lean-package-researchSkill
- lean-pedagogical-expositionSkill
- lean-proof-refactorSkill
- lean-proof-repairSkill
- lean-proof-reviewSkill
- lean-proofSkill
- lean-prSkill
- lean-quality-engineSkill
- lean-replay-verificationSkill
- lean-reportSkill
- lean-researchSkill
- lean-retroactive-auditSkill
- lean-retro-methodologySkill
- lean-review-councilSkill
- lean-security-formalizationSkill
- lean-setupSkill
- lean-specificationSkill
- lean-tautology-triageSkill
- lean-vendor-substrateSkill
- lean-zettelkastenSkill
- math-product-managementSkill
- The first 60 shown.
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
- Very specific: line 41
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 …
- Very specific: line 44
If upstream module-system visibility (public import or sealed instances) breaks a corpus proof, isolate and repair the proof against …
≈ “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.
Files
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
- 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.
- Dossier before branch: statement inventory, generalization
framing, prior-art check (
#checkthe twins; text search misses@[to_additive]/generated names), and the AI-assistance history. Get operator approval on each PR-body claim before filing. - 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. - PR body conventions (mathlib; the generic PR contract is
Recovery & STOP
- If
gh pr editsilently drops body updates on the GraphQL path, read back the PR body and apply the update viagh api -X PATCH repos/<owner>/<repo>/pulls/<n> -F body=@<body-file>. - If upstream module-system visibility (
public importor sealed instances) breaks a corpus proof, isolate and repair the proof against upstream master via@lean-proofbefore 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-- Completelean-upstream-portingHandbook../lean-gateway/SKILL.md-- Top-level skill router
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
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.

