Agent skill

Vero Python Pitfalls

by sunblaze-ucb in sunblaze-ucb/vero

Load BEFORE translating any Python item to Lean 4 to avoid known Python→Lean pitfalls.

Apache-2.0Auto-check passedWriting & Content

Install Vero Python Pitfalls

skills CLI
$ npx skills add sunblaze-ucb/vero --skill vero-python-pitfalls -a claude-code

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

GitHub CLI
$ gh skill install sunblaze-ucb/vero vero-python-pitfalls --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/sunblaze-ucb/vero.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/vero-python-pitfalls .claude/skills/vero-python-pitfalls && 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
vero-python-pitfalls
GitHub stars
107
Token cost
~1.7k tokens
SKILL.md length
875 words
Files
1
Skills in repo
16
Repo updated
First seen
Licence
Apache-2.0

At a glance

Load BEFORE translating any Python item to Lean 4 to avoid known Python→Lean pitfalls.

  • Tasks that involve Translation
  • SKILL.md covers Benchmark-quality baseline, Integer division, range(...) semantics and Mutability + aliasing, plus 15 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Vero Python Pitfalls is an agent skill from sunblaze-ucb/vero. Load BEFORE translating any Python item to Lean 4 to avoid known Python→Lean pitfalls. Pair with vero-source-python and vero-lean-pitfalls.

Its SKILL.md is about 1.7k 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 Writing & Content, covering Translation. It works with Python. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Translation

Example prompts

  • “/vero-python-pitfalls”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 0a7325d. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and lean).

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

  • Network

    No URLs in SKILL.md.

    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

Vero Python Pitfalls loads about 1.7k tokens when it runs. Until then it costs about 40 tokens; SKILL.md has 875 words of instructions outside code blocks.

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

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 sunblaze-ucb/vero at commit 0a7325d, republished under its Apache-2.0 licence (© sunblaze-ucb). 875 words, ~1,679 tokens.

Download SKILL.mdSave it as .claude/skills/vero-python-pitfalls/SKILL.md (or your agent's skills folder).
name
vero-python-pitfalls
description
Load BEFORE translating any Python item to Lean 4 to avoid known Python→Lean pitfalls. Pair with vero-source-python and vero-lean-pitfalls.

Python → Lean 4 — Known Pitfalls

Benchmark-quality baseline

The Lean benchmark is allowed to be smaller than the Python repo, but it must not silently change the selected APIs' observable semantics. Before compressing scaffold/context, confirm that the LLM still has enough information to reconstruct:

  • success and failure paths;
  • mutation/aliasing effects that become input-output relations in Lean;
  • boundary behavior for empty inputs, malformed inputs, overflow, and exceptional cases;
  • cross-API laws such as encode/decode or push/pop round trips.

If a source behavior is intentionally omitted, record it as a curation decision instead of leaving a weak spec that makes the omission invisible.

Integer division

Python a // b is floor division (rounds toward −∞). Lean's Int.div// is truncated (rounds toward 0). They differ for negatives.

PythonLean (preserve floor)
a // bInt.fdiv a b
a % bInt.fmod a b

If the Python source only ever uses non-negative operands, Int.div is fine — but document the assumption.

range(...) semantics

Python range(a, b) is [a, a+1, ..., b-1]. Use List.range' (start, length) — not List.range (which is [0, ..., n-1]).

python
range(2, 5)   # [2, 3, 4]

→

lean
List.range' 2 3   -- [2, 3, 4]; length = b - a

For descending or step-N ranges, write a recursive helper.

Mutability + aliasing

Python lists / dicts are mutable. Lean has no in-place mutation in the pure subset. The curator-given translation:

  • lst.append(x) → lst ++ [x] (new list)
  • dct[k] = v → dct.insert k v returning a new map
  • Python's reliance on identity (lst is other_lst) cannot be expressed; flag with @review human.

If the Python code relies on mutating a parameter and reading the mutation in the caller, the spec almost certainly needs reformulation as input → output. Discuss with the curator.

For buffer-writing APIs, do not replace "writes prefix and preserves suffix" with "returns some new list" unless the spec explicitly captures the old buffer, written length, prefix, suffix, and failure unchanged behavior. This is the same failure mode as Json's SerializeInto contract drift.

None vs Option

Python's None is the only inhabitant of NoneType. Lean's none : Option α requires the type α to be inferred or annotated. Translation:

python
def lookup(k: int) -> int | None:
    return self.dict.get(k)

→

lean
def lookup (k : Int) (s : State) : Option Int := s.dict.find? k

Avoid Option Unit for "side-effect succeeded?" — use Bool or a dedicated Result enum.

Float

Lean's Float is IEEE 754 double, same as Python's. But: Float does not have decidable equality and arithmetic isn't pure (NaN, ±0). Heavily prefer Int if the Python contract allows integer reasoning.

If a spec must talk about Float, name the floating-point assumption explicitly in spec_helper_* and flag with @review human.

String iteration

Python for c in s iterates Unicode code points. Lean's String API has String.toList : String → List Char — use that, not String.length for character counts (which counts UTF-8 bytes in some configurations).

dict ordering

Python 3.7+ guarantees insertion order on dict. Lean's Std.HashMap does not. If insertion order is observable in the spec, translate to AssocList Key Value (preserves order, less efficient — but specs care more).

Recursion depth

Python tolerates moderate recursion via tail-call-stack tricks; Lean prefers partial def or a structurally-decreasing recursive definition. Long-running iterative algorithms in Python often need refactoring as Nat.rec / List.foldl in Lean.

print / input / file I/O

These APIs have no place in the benchmark. Skip them and add an @review human annotation in the manifest noting the omission. If a spec actually depends on a side effect (rare in benchmark code), discuss with the curator.

Show full SKILL.md (347 more words)Show less

Exceptions

Python raise ValueError(...) becomes one of:

  • Option α returning none on the error path,
  • Except String α returning Except.error msg,
  • if not_valid then panic! "msg" else … (avoid — panic! is unsafe),

Always prefer Option / Except for total functions. If the function signature already has a clear "failure" value (e.g., negative for "not found"), reuse that rather than introducing a new wrapper.

Specs must constrain both sides when the source distinguishes success and failure. A success-only postcondition can be vacuous for an implementation that rejects too often.

Built-in len

Python len(lst) is lst.length in Lean for List / String. For dict, the equivalent depends on the chosen Lean type:

PythonAssocListStd.HashMap
len(d)d.keys.lengthd.size

Mutable defaults

Python's def f(x=[]) mutable-default pitfall does not exist in Lean (default args are re-evaluated). Don't translate guard logic that exists only to defend against this.

Class methods + self

Python class Foo: def bar(self, x): … translates to a free function def Foo.bar (self : Foo) (x : T) : U, with self as the first parameter. Manifest API name is Foo.bar (or bar if the class is the package's primary type).

__init__ / construction

Python __init__ is the constructor. Lean's structure Foo already gives you Foo.mk (anonymous constructor). Translate __init__ body that does work beyond field-assignment as a separate def Foo.init (...) : Foo.

Decorators

Most decorators (@property, @cached_property, @staticmethod, @classmethod) lose meaning in Lean. Translate the underlying function and document with @review human if the decorator semantics matter.

Generators

def gen(): yield x; yield y translates to def gen : List T := [x, y] for finite generators. Infinite generators need a different model (lazy list, stream) — flag with @review human.

Typing module

typing.List, typing.Dict, etc. are erased — use the Lean equivalent of the parameterized type. typing.Any is a curator-level red flag — usually means the function body has multiple shapes; translate each shape as a separate Lean function or use a tagged union.

*args / **kwargs

Variadic args translate to a List T parameter. Keyword args translate to explicit named parameters in Lean. If the Python signature is genuinely dynamic, flag as @review human — the spec probably needs a different shape.

© sunblaze-ucb, Apache-2.0. 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 .claude/skills/vero-python-pitfalls of sunblaze-ucb/vero.

Open the folder on GitHubat commit 0a7325d

Compare with similar skills

Vero Python Pitfalls 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.

Vero Python Pitfalls compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Vero Python Pitfalls this skillsunblaze-ucb/vero107—~1.7kAutomated safety check: PassApache-2.0
China Travel Kittczyliu/china-travel-kit194—~1.3kAutomated safety check: PassMIT
Technology Searchfreestylefly/wesight943—~3.3kAutomated safety check: PassMIT
Translate Popython/python-docs-zh-tw284—~793Automated safety check: PassCustom licence
Obs Build LogsNuitka/Nuitka15k—~849Automated safety check: PassAGPL-3.0
Update Gui TranslationsArduPilot/MethodicConfigurator163—~1.5kAutomated safety check: PassGPL-3.0

Similar skills

  • China Travel Kit

    tczyliu/china-travel-kit

    Research and plan first-time independent trips in China with bilingual, source-aware city data and official live-check entry points.

    194 GitHub stars~1.3k tokensUpdated 1 mo ago
    Writing & ContentAuto-check passed
  • Technology Search

    freestylefly/wesight

    Search tech blogs, developer forums, and IT media (TechCrunch, Hacker News, 36氪, etc.) for software and hardware industry updates with heat ranking and EN↔CN translation.

    943 GitHub stars~3.3k tokensUpdated 6 days ago
    Writing & ContentAuto-check passed
  • Translate Po

    python/python-docs-zh-tw

    Official

    Translates PO file entries from English to Traditional Chinese (zhTW) following project conventions.

    284 GitHub stars~793 tokensUpdated 2 days ago
    Writing & ContentAuto-check passed
  • Obs Build Logs

    Nuitka/Nuitka

    Access and diagnose openSUSE Build Service (OBS) package build logs.

    15k GitHub stars~849 tokensUpdated today
    Writing & ContentAuto-check passed
  • Update Gui Translations

    ArduPilot/MethodicConfigurator

    Update existing GUI translations using AI assistance. An agent skill from ArduPilot/MethodicConfigurator.

    163 GitHub stars~1.5k tokensUpdated today
    Writing & ContentAuto-check passed
  • Check Terminology

    python/python-docs-zh-tw

    Official

    Checks terminology consistency against project glossary and identifies zhCN terms that need conversion to zhTW.

    284 GitHub stars~705 tokensUpdated 2 days ago
    Writing & ContentAuto-check passed

More from sunblaze-ucb/vero

All 16 skills in this repo
  • Vero Discover

    sunblaze-ucb/vero

    A skill your agent uses when scanning a verified source repo (Dafny, Verus, or Coq) to classify every item and produce per-file discovery markdown for human curation.

    107 GitHub stars~3.9k tokensUpdated 1 mo ago
    Auto-check: notes
  • Vero Translate

    sunblaze-ucb/vero

    A skill your agent uses when translating selected verified items from Dafny/Verus/Coq into a compilable Lean 4 benchmark.

    107 GitHub stars~4.9k tokensUpdated 1 mo ago
    Auto-check: notes
  • Vero Coq Pitfalls

    sunblaze-ucb/vero

    Load BEFORE translating any Coq item to Lean 4 to avoid known Coq→Lean pitfalls.

    107 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check: notes
  • Vero Dafny Pitfalls

    sunblaze-ucb/vero

    Load BEFORE translating any Dafny item to Lean 4 to avoid known Dafny→Lean pitfalls.

    107 GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check: notes
  • Vero Lean Pitfalls

    sunblaze-ucb/vero

    Load BEFORE writing any Lean 4 translation to avoid common Lean pitfalls (universes, coercions, type-class resolution, notation).

    107 GitHub stars~1.4k tokensUpdated 1 mo ago
    Auto-check: notes
  • Vero Plan

    sunblaze-ucb/vero

    Use after vero-select to write a detailed translation plan as .vero/plan.json — the authoritative contract the TRANSLATE stage executes.

    107 GitHub stars~3.6k tokensUpdated 1 mo ago
    Auto-check: notes

Works with

Questions about Vero Python Pitfalls

What does Vero Python Pitfalls do?

Load BEFORE translating any Python item to Lean 4 to avoid known Python→Lean pitfalls. Vero Python Pitfalls is an agent skill from sunblaze-ucb/vero. Load BEFORE translating any Python item to Lean 4 to avoid known Python→Lean pitfalls.

When should I use Vero Python Pitfalls?

Vero Python Pitfalls fits situations like: tasks that involve Translation.

How do I install Vero Python Pitfalls in Claude Code?

Run `npx skills add sunblaze-ucb/vero --skill vero-python-pitfalls -a claude-code`. Or copy the skill folder (.claude/skills/vero-python-pitfalls in sunblaze-ucb/vero) into .claude/skills/vero-python-pitfalls in your project. Claude Code loads it when a task matches its description.

How do I install Vero Python Pitfalls in Codex?

Run `npx skills add sunblaze-ucb/vero --skill vero-python-pitfalls -a codex`. Or copy the skill folder (.claude/skills/vero-python-pitfalls in sunblaze-ucb/vero) into .agents/skills/vero-python-pitfalls in your project. Codex loads it when a task matches its description.

Can I use Vero Python Pitfalls 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 sunblaze-ucb/vero --skill vero-python-pitfalls -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/vero-python-pitfalls, .gemini/skills/vero-python-pitfalls, .github/skills/vero-python-pitfalls and .opencode/skills/vero-python-pitfalls in your project.

What does Vero Python Pitfalls need to run?

SKILL.md names no scripts, command-line tools or credentials: Vero Python Pitfalls is instructions for the agent only. Our summary lists: Python 3.

Does Vero Python Pitfalls access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Vero Python Pitfalls 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 Vero Python Pitfalls use?

Vero Python Pitfalls is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Vero Python Pitfalls use?

About 1.7k tokens (SKILL.md is roughly 6.7k 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 Vero Python Pitfalls?

Skills that share tags, products or a category with Vero Python Pitfalls: China Travel Kit (tczyliu/china-travel-kit, 194 stars), Technology Search (freestylefly/wesight, 943 stars), Translate Po (python/python-docs-zh-tw, 284 stars) and Obs Build Logs (Nuitka/Nuitka, 15k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Vero Python Pitfalls?

sunblaze-ucb (a GitHub organization) maintains it in sunblaze-ucb/vero, which has 107 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on August 17, 2026.

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