Agent skill

Vero Dafny Pitfalls

by sunblaze-ucb in sunblaze-ucb/vero

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

Apache-2.0Auto-check: notesWriting & Content

Install Vero Dafny Pitfalls

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

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

GitHub CLI
$ gh skill install sunblaze-ucb/vero vero-dafny-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-dafny-pitfalls .claude/skills/vero-dafny-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-dafny-pitfalls
GitHub stars
107
Token cost
~1.2k tokens
SKILL.md length
310 words
Files
1
Skills in repo
16
Repo updated
First seen
Licence
Apache-2.0

At a glance

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

  • Works in 10 steps: ghost vs Compiled Code → method vs function → seq → List T → …
  • Tasks that involve Translation
  • SKILL.md covers 1. ghost vs Compiled Code, 2. method vs function, 3. seq → List T and 4. map, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

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

Its SKILL.md is about 1.2k 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. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Translation

Example prompts

  • “/vero-dafny-pitfalls”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Grep, Glob

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. ghost vs Compiled Code
  2. method vs function
  3. seq → List T
  4. map
  5. decreases → termination_by
  6. multiset and set
  7. ensures with Multiple Return Values
  8. Dafny Traits and Classes
  9. forall/exists Quantifiers
  10. Dafny's := vs Lean's :=

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 these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Grep
    • Glob

    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 lean and dafny).

    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 Dafny Pitfalls loads about 1.2k tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 310 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Grep, Glob

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). 310 words, ~1,162 tokens.

Download SKILL.mdSave it as .claude/skills/vero-dafny-pitfalls/SKILL.md (or your agent's skills folder).
name
vero-dafny-pitfalls
description
Load BEFORE translating any Dafny item to Lean 4 to avoid known Dafny→Lean pitfalls. Pair with vero-source-dafny and vero-lean-pitfalls.
allowed-tools
Read, Write, Edit, Bash, Grep, Glob

Dafny → Lean 4 Translation Pitfalls

Issues specific to translating Dafny to Lean 4.

1. ghost vs Compiled Code

Problem: Dafny ghost variables/functions exist only for verification. In Lean, there's no ghost keyword — use noncomputable for functions that can't be computed, or keep them as pure spec defs.

Dafny:

dafny
ghost function SeqSum(s: seq<int>): int

Lean:

lean
-- If used only in specs/proofs:
def seqSum (s : List Int) : Int := s.foldl (· + ·) 0

-- If it references opaque types:
noncomputable def seqSum (s : List Int) : Int := s.foldl (· + ·) 0

Key: Ghost functions that are pure and have clear definitions should have their body GIVEN. Do not leave sorry in curated Impl/Spec files; use an explicit opaque plus trusted axiom only when the source item is intentionally trusted or external.

2. method vs function

Dafny distinction:

DafnySemanticsLean translation
functionPure, can appear in specsdef f := body (give body if simple)
methodImperative, may mutatedef f := <translated reference impl> with code markers
ghost methodProof-only imperativeusually drop, or convert stated property into a spec_*
lemmaProofbenchmark obligation def spec_* (impl : RepoImpl) : Prop, no markers
predicateSpec vocabularydef f : ... → Prop := ..., no markers unless it is selected as an API

3. seq<T> → List T

Problem: Dafny seq<T> is an immutable sequence. Map to List T.

Common operations:

lean
-- seq<T> operations → List equivalents
-- |s|          → s.length
-- s[i]         → s.get ⟨i, h⟩  (with bound proof)
-- s[i..j]      → s.drop i |>.take (j - i)
-- s + t        → s ++ t
-- s[i := v]    → s.set ⟨i, h⟩ v
-- [v] + s      → v :: s
-- s == t       → s = t

4. map<K,V>

Dafny maps:

dafny
var m: map<string, int>;
m[key]           // lookup (partial)
m[key := value]  // update
key in m         // membership

Lean:

lean
-- For computation: use Std.HashMap
-- For proofs: use a function K → Option V

-- If the map is used in computable code:
def MyMap (K V : Type) := Std.HashMap K V

-- If only in specs:
def MyMap (K V : Type) := K → Option V

5. decreases → termination_by

Dafny:

dafny
function Fib(n: nat): nat
  decreases n

Lean:

lean
def fib : Nat → Nat
  | 0 => 0
  | 1 => 1
  | n + 2 => fib (n + 1) + fib n
termination_by n => n

For API reference implementations, add termination_by / decreasing_by when Lean cannot infer termination. The downstream LLM-facing scaffold may replace marker bodies with sorry, but the curated source should build with the real body.

6. multiset and set

Dafny multiset<T>: Use List T and reason about permutations, or Multiset T from Mathlib if available.

Dafny set<T>: Use Finset T for finite sets, or Set T for mathematical sets in proofs.

7. ensures with Multiple Return Values

Dafny:

dafny
method Divide(a: int, b: int) returns (q: int, r: int)
  requires b > 0
  ensures a == q * b + r
  ensures 0 <= r < b

Lean: Use a product type:

lean
def divide (a b : Int) : Int × Int :=
  (a / b, a % b)

def divide_spec (a b : Int) : Prop :=
  b > 0 →
  let (q, r) := divide a b
  a = q * b + r ∧ 0 ≤ r ∧ r < b

8. Dafny Traits and Classes

Dafny:

dafny
trait Comparable {
  function CompareTo(other: Comparable): int
}
class MyType extends Comparable { ... }

Lean: Use type classes:

lean
class Comparable (α : Type) where
  compareTo : α → α → Int

structure MyType where
  ...
  deriving Inhabited

instance : Comparable MyType where
  compareTo _a _b := 0  -- replace with the translated Dafny body

9. forall/exists Quantifiers

Dafny:

dafny
forall i :: 0 <= i < |s| ==> s[i] > 0
exists i :: 0 <= i < |s| && s[i] == target

Lean:

lean
∀ i, i < s.length → s.get ⟨i, by omega⟩ > 0
∃ i, ∃ (h : i < s.length), s.get ⟨i, h⟩ = target

10. Dafny's := vs Lean's :=

Problem: In Dafny, := is assignment (mutable). In Lean, := is definition (immutable). Translate Dafny method bodies that use := as state-passing:

Dafny:

dafny
method Push(s: Stack, v: int) returns (s': Stack) {
  s' := Cons(v, s);
}

Lean:

lean
def push (s : Stack) (v : Int) : Stack :=
  Stack.cons v s

© 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-dafny-pitfalls of sunblaze-ucb/vero.

Open the folder on GitHubat commit 0a7325d

Compare with similar skills

Vero Dafny 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 Dafny Pitfalls compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Vero Dafny Pitfalls this skillsunblaze-ucb/vero107—~1.2kAutomated safety check: NotesApache-2.0
Translation Diff ExportDevolutions/UniGetUI26k—~1.1kAutomated safety check: PassMIT
Sync Translationssymfony/symfony31k—~1.9kAutomated safety check: PassMIT
Translation Diff ImportDevolutions/UniGetUI26k—~750Automated safety check: PassMIT
Translation Diff TranslateDevolutions/UniGetUI26k—~934Automated safety check: PassMIT
Generate Translationspayloadcms/payload45k—~1.1kAutomated safety check: PassMIT

Similar skills

  • Translation Diff Export

    Devolutions/UniGetUI

    Compares UniGetUI JSON locale files against English, identifies untranslated or source-changed keys, and generates patch, reference, and handoff files for a target language.

    26k GitHub stars~1.1k tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Sync Translations

    symfony/symfony

    Synchronize translation catalogs across maintained Symfony branches: find messages that newer branches added to the English catalogs but that are still missing from the oldest maintained branch…

    31k GitHub stars~1.9k tokensUpdated today
    Writing & ContentAuto-check passed
  • Translation Diff Import

    Devolutions/UniGetUI

    Merges translated key-value pairs from a UniGetUI JSON localization patch back into the full language file and validates the merged result.

    26k GitHub stars~750 tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Translation Diff Translate

    Devolutions/UniGetUI

    Translates a sparse UniGetUI JSON language patch, writes completed entries into the working copy, preserves placeholders and terminology, and prepares the patch for merge-back.

    26k GitHub stars~934 tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Generate Translations

    payloadcms/payload

    A skill your agent uses when new translation keys are added to packages to generate new translations strings

    45k GitHub stars~1.1k tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Drives long-form fiction, scripts, storyboards, interactive films and long-document translation through InkOS, with every change made by a typed action.

    10k GitHub starsUsed in 1 repo~1.1k tokens
    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 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
  • Vero Python Pitfalls

    sunblaze-ucb/vero

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

    107 GitHub stars~1.7k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Vero Dafny Pitfalls

What does Vero Dafny Pitfalls do?

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

When should I use Vero Dafny Pitfalls?

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

How do I install Vero Dafny Pitfalls in Claude Code?

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

How do I install Vero Dafny Pitfalls in Codex?

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

Can I use Vero Dafny 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-dafny-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-dafny-pitfalls, .gemini/skills/vero-dafny-pitfalls, .github/skills/vero-dafny-pitfalls and .opencode/skills/vero-dafny-pitfalls in your project.

What does Vero Dafny Pitfalls need to run?

SKILL.md names no scripts, command-line tools or credentials: Vero Dafny Pitfalls is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Grep, Glob.

Does Vero Dafny 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 Dafny Pitfalls safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Vero Dafny Pitfalls use?

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

About 1.2k tokens (SKILL.md is roughly 4.6k 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 Dafny Pitfalls?

Skills that share tags, products or a category with Vero Dafny Pitfalls: Translation Diff Export (Devolutions/UniGetUI, 26k stars), Sync Translations (symfony/symfony, 31k stars), Translation Diff Import (Devolutions/UniGetUI, 26k stars) and Translation Diff Translate (Devolutions/UniGetUI, 26k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Vero Dafny 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.