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.
npx skills add ArabelaTso/Skills-4-SE --skill python-to-lean4-translatorgit clone --depth 1 https://github.com/ArabelaTso/Skills-4-SEWrote 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.
[](https://agentmods.dev/skills/arabelatso/skills-4-se/python-to-lean4-translator)<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/python-to-lean4-translator"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/python-to-lean4-translator/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/python-to-lean4-translator"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/python-to-lean4-translator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00087 | $0.02225 |
| Opus 5 | $0.00044 | $0.01112 |
| Sonnet 5 | $0.00017 | $0.00445 |
| Haiku 4.5 | $0.00009 | $0.00222 |
Grade A, and why
python-to-lean4-translator 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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 326 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python to Lean4 Translator
Translate Python programs into equivalent, executable Lean4 code while preserving program semantics and ensuring type safety.
Overview
This skill provides systematic guidance for translating Python code to Lean4, handling type inference, function translations, data structures, control flow, and ensuring well-typed, executable output.
Translation Workflow
Python Input → Analyze Structure → Map Types → Translate Constructs → Verify → Output Lean4
├─ Identify types and signatures
├─ Map Python constructs to Lean4 equivalents
├─ Handle type conversions
├─ Ensure totality and termination
└─ Validate executability
Core Translation Principles
1. Type Safety First
Lean4 is strongly typed. Every translation must:
- Infer or specify explicit types for all variables
- Ensure type consistency across operations
- Handle Python's dynamic typing by choosing appropriate Lean4 types
- Use
Optionfor nullable values,Exceptfor error handling
2. Preserve Semantics
The translated code must maintain the same computational behavior, preserve function input-output relationships, keep the same algorithmic complexity, and handle edge cases equivalently.
3. Ensure Executability
Generated Lean4 code must compile without errors, be executable (use #eval to verify), terminate (prove termination for recursive functions), and follow Lean4 syntax and conventions.
Type Mapping Reference
Basic Types
| Python Type | Lean4 Type | Notes |
|---|---|---|
int |
Int or Nat |
Use Nat for non-negative integers |
float |
Float |
Lean4's floating point type |
bool |
Bool |
Direct mapping |
str |
String |
Direct mapping |
None |
Option α |
Use none for None, some x for values |
list |
List α |
Homogeneous lists |
tuple |
Product types α × β or custom structure |
|
dict |
Std.HashMap or List (α × β) |
Requires import |
set |
Std.HashSet or List α |
Requires import |
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 8d ago First seen · 326 lines · 87 tokens per session scan A 36c47dfec24a
python-to-lean4-translator is a skill published in the GitHub repository ArabelaTso/Skills-4-SE (252 stars, last pushed 21d ago), licensed Apache-2.0. It adds 87 tokens to every session and 2,225 once invoked, about $0.0004 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.
Other skills, from other repositories
astropy
Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.
cobrapy
Constraint-based metabolic modeling (COBRA). FBA, FVA, gene knockouts, flux sampling, SBML models, for systems biology and metabolic engineering analysis.
matlab
Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.
bioservices
Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use…
pennylane
Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum neural networks, and integration with…
scientific-visualization
Create publication figures with matplotlib/seaborn/plotly. Multi-panel layouts, error bars, significance markers, colorblind-safe, export PDF/EPS/TIFF, for journal-ready scientific plots.