Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

py2go

Python-to-Go migration skill for Codex with GPT-6 Astra and Claude Code with Claude Opus. Preserves behavior through tested migration slices, with Fiber, pgx, GORM, and slog defaults where the project has not already chosen a stack.

One canonical skill, discovered by both hosts:

.claude/skills/py2go/                             # canonical files; Claude Code
.agents/skills/py2go -> ../../.claude/skills/py2go  # Codex

Both models can plan and implement. The skill follows the selected model and host capabilities; it does not change model settings.

Install with npx skills

The skills CLI supports both hosts:

# List available skills
npx skills add h0rn3t/python2go -l

# Project install for Codex and Claude Code
npx skills add h0rn3t/python2go -s py2go -a codex -a claude-code -y

# Global install
npx skills add h0rn3t/python2go -s py2go -g -a codex -a claude-code -y

# Install this checkout into another project's working directory
npx skills add /absolute/path/to/python2go -s py2go -a codex -a claude-code -y

# Verify and update
npx skills ls -a codex -a claude-code
npx skills update py2go

Use --copy if symlinks are unavailable. The local-path form includes unpushed changes; the GitHub form installs the published revision.

Manual installation

Run these commands from this checkout. If the target already has py2go, update its canonical directory instead of nesting another copy or replacing an unrelated skill.

Project

mkdir -p /path/to/your-project/.claude/skills /path/to/your-project/.agents/skills
cp -R .claude/skills/py2go /path/to/your-project/.claude/skills/
ln -s ../../.claude/skills/py2go /path/to/your-project/.agents/skills/py2go

Personal

mkdir -p ~/.claude/skills ~/.agents/skills
cp -R .claude/skills/py2go ~/.claude/skills/
ln -s ../../.claude/skills/py2go ~/.agents/skills/py2go

Codex supports .agents/skills discovery and symlinked skill folders. Reopen the agent session if the skill is not listed.

Usage

Codex / Astra:

$py2go path/to/python-project
$py2go . --type http --strict-tdd
$py2go . --resume

Claude Code / Opus:

/py2go path/to/python-project
/py2go . --type worker --dry-run
/py2go . --resume

Options are prompt instructions, not executable CLI flags. Supported options: --type cli|tui|http|pipeline|worker|lib|auto, --dry-run, --resume, --strict-tdd, --spec-first FILE, and --strangler.

--dry-run reports a plan without changing files or installing tools. --resume reconstructs progress from the repository and refreshes relevant verification. --strict-tdd requires an observed failing behavior test before implementation, followed by a passing run.

Migration workflow

discover → design → scaffold → translate → validate → cutover → cleanup

Continue through the user's authorized scope, with testable slices and recorded results. A module-only request stays scoped to that module. Planning stops at the plan; production cutover and fallback removal require authorization for those actions.

For project migrations, the skill maintains:

Artifact Purpose
AGENTS.md Shared migration decisions for Codex, preserving existing rules
CLAUDE.md The same migration decisions for Claude Code, preserving host-specific content
MIGRATION.md Ordered slices, acceptance checks, actual test results, blockers, and resume checkpoint
Migration notes Source evidence, IO map, dependency decisions, and fixture provenance

Switching between Astra and Opus uses the same checkpoint. Neither model needs to repeat completed discovery or infer progress from chat history alone. The execution guidance draws on OpenAI's Astra guidance and Anthropic's state-tracking guidance.

Defaults

Target Go 1.27+. HTTP Fiber, DB GORM + pgx, logger slog. Existing project decisions take precedence; record alternatives in the shared migration section.

New HTTP/worker layouts use layered internal/ packages: handler, service, repository, model, schema, and config. Other project types use idiomatic Go layouts without forced layered folders.

References: translation rules, Go baseline, artifacts and handoff, layered architecture.

About

Cursor / Claude Code skill: migrate Python projects to idiomatic Go (Fiber, pgx, GORM, slog by default).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors