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.
Translate Python programs into equivalent Dafny code, preserving program semantics and ensuring the generated code is well-typed, executable, and verifiable.
$ npx skills add ArabelaTso/Skills-4-SE --skill python-to-dafny-translator -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ArabelaTso/Skills-4-SE python-to-dafny-translator --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/python-to-dafny-translator .claude/skills/python-to-dafny-translator && rm -rf skills-srcUse ~/.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/
Install the "python-to-dafny-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/python-to-dafny-translator into .claude/skills/python-to-dafny-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-to-dafny-translator", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/python-to-dafny-translatorType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ArabelaTso/Skills-4-SE --skill python-to-dafny-translator -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ArabelaTso/Skills-4-SE python-to-dafny-translator --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/python-to-dafny-translator .agents/skills/python-to-dafny-translator && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "python-to-dafny-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/python-to-dafny-translator into .agents/skills/python-to-dafny-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-to-dafny-translator", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill python-to-dafny-translator -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ArabelaTso/Skills-4-SE python-to-dafny-translator --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/python-to-dafny-translator .cursor/skills/python-to-dafny-translator && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "python-to-dafny-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/python-to-dafny-translator into .cursor/skills/python-to-dafny-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-to-dafny-translator", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ArabelaTso/Skills-4-SE.git --path skills/python-to-dafny-translator--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ArabelaTso/Skills-4-SE --skill python-to-dafny-translator -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ArabelaTso/Skills-4-SE python-to-dafny-translator --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/python-to-dafny-translator .gemini/skills/python-to-dafny-translator && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "python-to-dafny-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/python-to-dafny-translator into .gemini/skills/python-to-dafny-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-to-dafny-translator", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ArabelaTso/Skills-4-SE python-to-dafny-translatorInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ArabelaTso/Skills-4-SE --skill python-to-dafny-translator -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/python-to-dafny-translator .github/skills/python-to-dafny-translator && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "python-to-dafny-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/python-to-dafny-translator into .github/skills/python-to-dafny-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-to-dafny-translator", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill python-to-dafny-translator -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ArabelaTso/Skills-4-SE python-to-dafny-translator --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/python-to-dafny-translator .opencode/skills/python-to-dafny-translator && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "python-to-dafny-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/python-to-dafny-translator into .opencode/skills/python-to-dafny-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-to-dafny-translator", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
python-to-dafny-translatorTranslate Python programs into equivalent Dafny code, preserving program semantics and ensuring the generated code is well-typed, executable, and verifiable.
Python To Dafny Translator is an agent skill from ArabelaTso/Skills-4-SE. 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.
Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/translation_patterns.md`).
It sits in Writing & Content, covering Translation. It works with Python. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are dafny, python and bash).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
dafny.orgFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Python To Dafny Translator loads about 3.1k tokens when it runs, and up to ~5.9k if it reads all its reference files. Until then it costs about 95 tokens; SKILL.md has 760 words of instructions outside code blocks.
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.
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.
The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 760 words, ~3,145 tokens.
.claude/skills/python-to-dafny-translator/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Transform Python programs into equivalent Dafny code that preserves the original semantics while adding formal specifications and leveraging Dafny's verification capabilities.
Understand the Python program structure and semantics:
Identify program components:
Understand semantics:
Note translation challenges:
Plan the Dafny equivalent:
Choose appropriate types:
int for integers (arbitrary precision)nat for non-negative integersbool for booleansstring for stringsreal for floating-point (when needed)seq<T> for listsset<T> for setsmap<K, V> for dictionariesarray<T> for mutable arraysDetermine function vs method:
Plan specifications:
requires)ensures)modifies, reads)Follow these translation principles:
Pattern: Pure function
# Python
def add(a, b):
return a + b// Dafny
function add(a: int, b: int): int
{
a + b
}Pattern: Function with specifications
# Python
def max_value(a, b):
"""Returns the maximum of a and b"""
return a if a > b else b// Dafny
function max(a: int, b: int): int
ensures max(a, b) >= a && max(a, b) >= b
ensures max(a, b) == a || max(a, b) == b
{
if a > b then a else b
}Pattern: Method with side effects
# Python
def increment_counter(counter):
counter[0] += 1// Dafny
method incrementCounter(counter: array<int>)
requires counter.Length > 0
modifies counter
ensures counter[0] == old(counter[0]) + 1
{
counter[0] := counter[0] + 1;
}Pattern: If-else
# Python
def abs_value(x):
if x < 0:
return -x
else:
return x// Dafny
function abs(x: int): int
ensures abs(x) >= 0
{
if x < 0 then -x else x
}Pattern: For loop → While loop with invariants
# Python
def sum_array(arr):
total = 0
for i in range(len(arr)):
total += arr[i]
return total// Dafny
method sumArray(arr: array<int>) returns (total: int)
{
total := 0;
var i := 0;
while i < arr.Length
invariant 0 <= i <= arr.Length
invariant total == sum(arr[..i])
{
total := total + arr[i];
i := i + 1;
}
}
function sum(s: seq<int>): int
{
if |s| == 0 then 0 else s[0] + sum(s[1..])
}Pattern: Lists → Sequences
# Python
lst = [1, 2, 3, 4, 5]
first = lst[0]
length = len(lst)// Dafny
var lst: seq<int> := [1, 2, 3, 4, 5];
var first: int := lst[0];
var length: int := |lst|;Pattern: Dictionaries → Maps
# Python
d = {"a": 1, "b": 2}
value = d["a"]// Dafny
var d: map<string, int> := map["a" := 1, "b" := 2];
var value: int := d["a"];Pattern: Simple class
# Python
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def move(self, dx, dy):
self.x += dx
self.y += dy// Dafny
class Point {
var x: int
var y: int
constructor(x: int, y: int)
ensures this.x == x && this.y == y
{
this.x := x;
this.y := y;
}
method move(dx: int, dy: int)
modifies this
ensures x == old(x) + dx
ensures y == old(y) + dy
{
x := x + dx;
y := y + dy;
}
}Enhance the Dafny code with formal specifications:
Preconditions (requires):
requires n >= 0 for factorialPostconditions (ensures):
ensures result >= 0 for absolute valueLoop invariants:
invariant 0 <= i <= n for loop counterFrame conditions:
modifies: What can be modified?reads: What can be read?Ensure the translated code is correct:
Run Dafny verifier:
dafny verify program.dfyFix verification errors:
Test execution:
dafny run program.dfyCompare outputs:
Improve the translated code:
Simplify specifications:
Add documentation:
// Computes the factorial of n
function factorial(n: nat): natOptimize for verification:
For detailed patterns, see translation_patterns.md.
| Python | Dafny |
|---|---|
x = 10 | var x: int := 10; |
def f(x): | function f(x: int): int or method f(x: int) |
return x | x (function) or return x; (method) |
if x > 0: | if x > 0 then or if x > 0 { |
for i in range(n): | while i < n with invariants |
[1, 2, 3] | [1, 2, 3] (seq) |
{1, 2, 3} | {1, 2, 3} (set) |
{"a": 1} | map["a" := 1] |
len(lst) | |lst| |
lst[i] | lst[i] |
class C: | class C { |
None | Use Option<T> datatype |
Python Input:
def factorial(n):
if n <= 1:
return 1
return n * factorial(n - 1)Dafny Output:
function factorial(n: nat): nat
ensures factorial(n) >= 1
{
if n <= 1 then 1
else n * factorial(n - 1)
}Python Input:
def find_max(arr):
if len(arr) == 0:
return None
max_val = arr[0]
for i in range(1, len(arr)):
if arr[i] > max_val:
max_val = arr[i]
return max_valDafny Output:
method findMax(arr: array<int>) returns (maxVal: int)
requires arr.Length > 0
ensures forall k :: 0 <= k < arr.Length ==> maxVal >= arr[k]
ensures exists k :: 0 <= k < arr.Length && maxVal == arr[k]
{
maxVal := arr[0];
var i := 1;
while i < arr.Length
invariant 1 <= i <= arr.Length
invariant forall k :: 0 <= k < i ==> maxVal >= arr[k]
invariant exists k :: 0 <= k < i && maxVal == arr[k]
{
if arr[i] > maxVal {
maxVal := arr[i];
}
i := i + 1;
}
}Python Input:
class BankAccount:
def __init__(self, balance):
self.balance = balance
def deposit(self, amount):
self.balance += amount
def withdraw(self, amount):
if amount <= self.balance:
self.balance -= amount
return True
return FalseDafny Output:
class BankAccount {
var balance: int
constructor(balance: int)
requires balance >= 0
ensures this.balance == balance
{
this.balance := balance;
}
method deposit(amount: int)
requires amount >= 0
modifies this
ensures balance == old(balance) + amount
{
balance := balance + amount;
}
method withdraw(amount: int) returns (success: bool)
requires amount >= 0
modifies this
ensures success ==> balance == old(balance) - amount
ensures !success ==> balance == old(balance)
ensures success <==> amount <= old(balance)
{
if amount <= balance {
balance := balance - amount;
return true;
}
return false;
}
}Python Input:
def binary_search(arr, target):
left, right = 0, len(arr) - 1
while left <= right:
mid = (left + right) // 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
left = mid + 1
else:
right = mid - 1
return -1Dafny Output:
method binarySearch(arr: array<int>, target: int) returns (index: int)
requires forall i, j :: 0 <= i < j < arr.Length ==> arr[i] <= arr[j]
ensures 0 <= index < arr.Length ==> arr[index] == target
ensures index == -1 ==> forall k :: 0 <= k < arr.Length ==> arr[k] != target
{
var left := 0;
var right := arr.Length - 1;
while left <= right
invariant 0 <= left <= arr.Length
invariant -1 <= right < arr.Length
invariant forall k :: 0 <= k < left ==> arr[k] < target
invariant forall k :: right < k < arr.Length ==> arr[k] > target
{
var mid := (left + right) / 2;
if arr[mid] == target {
return mid;
} else if arr[mid] < target {
left := mid + 1;
} else {
right := mid - 1;
}
}
return -1;
}nat for non-negative values, seq for immutable listsNone, Dafny uses Option<T> datatype© ArabelaTso, 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
SKILL.md and 1 other file (references) in skills/python-to-dafny-translator of ArabelaTso/Skills-4-SE.
Open the folder on GitHubat commit 4f38503
Python To Dafny Translator 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Python To Dafny Translator this skillArabelaTso/Skills-4-SE | 253 | — | ~3.1k | Automated safety check: Pass | Apache-2.0 | |
| China Travel Kittczyliu/china-travel-kit | 194 | — | ~1.3k | Automated safety check: Pass | MIT | |
| Technology Searchfreestylefly/wesight | 943 | — | ~3.3k | Automated safety check: Pass | MIT | |
| Translate Popython/python-docs-zh-tw | 284 | — | ~793 | Automated safety check: Pass | Custom licence | |
| Obs Build LogsNuitka/Nuitka | 15k | — | ~849 | Automated safety check: Pass | AGPL-3.0 | |
| Update Gui TranslationsArduPilot/MethodicConfigurator | 163 | — | ~1.5k | Automated safety check: Pass | GPL-3.0 |
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.
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.
python/python-docs-zh-tw
Translates PO file entries from English to Traditional Chinese (zhTW) following project conventions.
Nuitka/Nuitka
Access and diagnose openSUSE Build Service (OBS) package build logs.
ArduPilot/MethodicConfigurator
Update existing GUI translations using AI assistance. An agent skill from ArduPilot/MethodicConfigurator.
python/python-docs-zh-tw
Checks terminology consistency against project glossary and identifies zhCN terms that need conversion to zhTW.
ArabelaTso/Skills-4-SE
Generate prioritized CVE watchlists and actionable security recommendations for repositories.
ArabelaTso/Skills-4-SE
Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).
ArabelaTso/Skills-4-SE
Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.
ArabelaTso/Skills-4-SE
Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.
ArabelaTso/Skills-4-SE
Automatically migrate Spring MVC applications to Spring Boot.
ArabelaTso/Skills-4-SE
Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.
Works with
Categories
Translate Python programs into equivalent Dafny code, preserving program semantics and ensuring the generated code is well-typed, executable, and verifiable. Python To Dafny Translator is an agent skill from ArabelaTso/Skills-4-SE. Translate Python programs into equivalent Dafny code, preserving program semantics and ensuring the generated code is well-typed, executable, and verifiable.
Python To Dafny Translator fits situations like: the user asks to convert Python code to Dafny; port Python programs to Dafny; add formal verification to Python code; create Dafny versions of Python algorithms with specifications.
Run `npx skills add ArabelaTso/Skills-4-SE --skill python-to-dafny-translator -a claude-code`. Or copy the skill folder (skills/python-to-dafny-translator in ArabelaTso/Skills-4-SE) into .claude/skills/python-to-dafny-translator in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ArabelaTso/Skills-4-SE --skill python-to-dafny-translator -a codex`. Or copy the skill folder (skills/python-to-dafny-translator in ArabelaTso/Skills-4-SE) into .agents/skills/python-to-dafny-translator in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill python-to-dafny-translator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-to-dafny-translator, .gemini/skills/python-to-dafny-translator, .github/skills/python-to-dafny-translator and .opencode/skills/python-to-dafny-translator in your project.
SKILL.md names no scripts, command-line tools or credentials: Python To Dafny Translator is instructions for the agent only. Our summary lists: Python 3.
SKILL.md names 1 domain. As links in the text: dafny.org. This is read from the text; nothing was executed.
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.
Python To Dafny Translator 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.
About 3.1k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.7k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Python To Dafny Translator: 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.
ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 151 skills in this directory. The repository was last updated on August 21, 2026.
Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.