CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

python-to-dafny-translator

Translate Python programs into equivalent Dafny code, preserving program semantics and ensuring the generated code is well-typed, executable, and verifiable. Use when the user asks to convert Python code to Dafny, port Python programs to Dafny, add formal verification to Python code, or create Dafny versions of Python algorithms with specifications.

Quality

86%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Quality

Content

81%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

The body is highly actionable and workflow-sound: complete executable Dafny examples, a verify→fix→retest loop, and a real, well-structured reference file. The main weakness is token efficiency — significant overlap between Step 3 patterns, the Quick Reference table, the Examples section, and references/translation_patterns.md, plus some generic guidance Claude doesn't need.

Suggestions

Trim duplication: keep a few representative patterns in Step 3 and the Quick Reference table, and move the four full worked Examples into references/translation_patterns.md (or a dedicated examples file), linking to them instead of inlining all four.

Cut generic analysis prompts like 'What does the program compute? What are the inputs and outputs?' and sections explaining what Claude already knows ('Python is dynamically typed, Dafny is statically typed', the Overview that restates the description).

Replace the prose-only 'Add Specifications' and 'Refine and Optimize' checklists with one concrete before/after example each, since every other section already earns its tokens with executable code.

DimensionReasoningScore

Conciseness

The body is mostly dense, useful translation content, but there is real duplication and generic filler: Step 3 patterns, the Quick Reference table, and four full worked Examples largely restate one another and duplicate the 695-line references/translation_patterns.md, and sections like 'What does the program compute? What are the inputs and outputs?' or 'Python is dynamically typed, Dafny is statically typed' explain what Claude already knows. Not a 2 because the bulk is concrete non-padded guidance; not a 4 because multiple sections (Step 1 semantics prompts, Key Differences, Limitations, the Examples section) could be cut or moved without losing information.

3 / 5

Actionability

Fully executable throughout: complete, syntactically valid Dafny snippets paired with their Python inputs (functions, methods, loops with invariants, classes, binary search), concrete commands 'dafny verify program.dfy' and 'dafny run program.dfy', and a copy-paste Python→Dafny quick-reference table covering the common cases. Matches the 5 anchor exactly.

5 / 5

Workflow Clarity

A clear six-step sequence (Analyze → Design → Translate → Add Specifications → Verify and Test → Refine) with an explicit feedback loop in Step 5: 'Run Dafny verifier' → 'Fix verification errors: add missing invariants, strengthen postconditions, add helper lemmas' → test execution → 'Compare outputs' between original Python and translated Dafny. This matches the 5 anchor's explicit validation steps with error-recovery loops; nothing is missing for a 4.

5 / 5

Progressive Disclosure

Good structure with a clearly signaled, one-level-deep reference: 'For detailed patterns, see [translation_patterns.md](references/translation_patterns.md)' plus a Resources section, and the referenced file exists and is well organized (TOC, per-pattern sections). Not a 5 because a substantial amount of pattern catalog content (Step 3 patterns, Quick Reference, and all four worked Examples) is inlined in SKILL.md where the reference file already covers it, leaving the overview heavier than ideal; well above 3 because navigation is easy and the reference is properly surfaced.

4 / 5

Total

17

/

20

Passed

Description

87%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong description: third-person, concrete about what it does, and equipped with an explicit, multi-phrase 'Use when' clause covering the natural ways a user would request this task. The only improvements are minor: add file extensions (.py/.dfy) and a couple more synonyms to the trigger list.

DimensionReasoningScore

Specificity

Concrete actions are stated: 'Translate Python programs into equivalent Dafny code', 'preserving program semantics', and 'ensuring the generated code is well-typed, executable, and verifiable' — several specific actions with only minor coverage gaps (e.g., specifications/proofs are mentioned only via the when-clause). Not a 5 because the 'what' centers on a single translate action with quality attributes rather than a comprehensive list of distinct capabilities; not a 3 because more than 1-2 concrete actions are explicitly named.

4 / 5

Completeness

Explicitly answers both: what — 'Translate Python programs into equivalent Dafny code, preserving program semantics...' — and when — 'Use when the user asks to convert Python code to Dafny, port Python programs to Dafny, add formal verification to Python code, or create Dafny versions of Python algorithms with specifications.' Matches the 5 anchor's clear what plus concrete trigger phrases; clearly better than the 4 anchor's more-generic when-clause.

5 / 5

Trigger Term Quality

Good natural-phrase coverage: 'convert Python code to Dafny', 'port Python programs to Dafny', 'add formal verification to Python code', 'create Dafny versions of Python algorithms'. Not a 5 because file extensions (.py, .dfy) and a few common phrasings (e.g., 'translate Python to Dafny') are missing; well above 3 because multiple genuine user-voice synonyms are present.

4 / 5

Distinctiveness Conflict Risk

A clear niche (Python-to-Dafny translation) with distinct trigger terms; virtually no other skill would fire on 'port Python to Dafny'. The 'add formal verification to Python code' trigger has only minor theoretical overlap with generic verification topics, keeping it at 5 rather than suggesting any real conflict.

5 / 5

Total

18

/

20

Passed

Validation

93%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 15 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

skill_md_line_count

SKILL.md is long (521 lines); consider splitting into references/ and linking

Warning

Total

15

/

16

Passed

Repository

ArabelaTso/Skills-4-SE

Path

skills/python-to-dafny-translator/SKILL.md

Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.