agentsclimarketplace

Py2go

Skill vanducng/skills/skills/py2go

Migrate Python projects to idiomatic Go end-to-end. Branches into 6 project-type playbooks (CLI, TUI, HTTP backend, data pipeline, async worker, library) with the right stack defaults (Gin, pgx, sqlc, slog, etc.) and pinned library versions. Default strategy: LLM module-by-module rewrite with golden-file parity tests; --strangler for live-traffic gradual cutover; --spec-first for OpenAPI/proto-driven regeneration. Use when porting a Python codebase to Go, when scaffolding a Go rewrite of a Python service, or when generating CLAUDE.md/MIGRATION.md for an AI-driven migration.From its SKILL.md

Install
npx -y skills add vanducng/skills --skill py2go

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.9 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

py2go

End-to-end Python → Go migration. Discover the source, lock the design, scaffold the Go module, translate file-by-file with TDD, validate behavioral parity against real data, cut over, then sweep dead code.

The skill is opinionated. It enforces idiomatic Go output over Python-shaped Go, rejects dead toolchains (Grumpy/py2go transpilers), defaults to sqlc over GORM, defaults to pgx over lib/pq, defaults to Gin for HTTP, prefers stdlib slog over zap/zerolog, and treats real-data parity validation as non-optional.

When to load which reference

TaskOpen
Decide which Python pattern maps to which Go idiomreferences/translation-rules.md
Pick the right Go stack per project type(playbooks - extend as needed)
Configure strangler-fig gateway / traffic shadow(extend as needed)
Drive from an existing OpenAPI/proto spec(extend as needed)

The 7 phases

discover → design → scaffold → translate → validate → cutover → cleanup
  1. Discover - two-pass: 7 discovery prompts individually → synthesize to notes/
  2. Design - emit CLAUDE.md (translation rules) + MIGRATION.md (ordered file map + checkboxes)
  3. Scaffold - go mod init, layout, lint (golangci-lint), CI, Makefile, smoke target
  4. Translate - per-file loop: Python source → Go test first → Go impl → go build && vet && test -race && lint → commit
  5. Validate - golden-file parity on real production data + integration tests + dead-code sweep
  6. Cutover - hard cutover (default) or strangler-fig (--strangler)
  7. Cleanup - orphan sweep, dependency audit, retro

Project-type playbooks (auto-detected in discover)

TypeDetected fromGo stack
CLIClick/Typer imports, entry_points console_scriptsCobra + Viper + lipgloss
TUITextual / Rich.live / prompt_toolkitBubble Tea + Bubbles + Lipgloss
HTTPFastAPI/Flask/Django/StarletteGin (default) / chi / Echo / Fiber
Pipelinepandas/polars/Airflow/Prefect/Dagsterstreaming []T + channels; qframe; STOP if NumPy/SciPy heavy
WorkerCelery/RQ/Dramatiq/Arq/Taskiqasynq (Redis) or river (Postgres)
Library__init__.py exportspkg/ layout with forced public-API decision

Hard guardrails (skill enforces)

  1. No 1:1 syntax port - Go function signatures must not mirror Python verbatim across >50% of lines.
  2. TDD-or-bust under --strict-tdd - Go test mtime must precede Go impl mtime per commit.
  3. No lib/pq - use pgx/v5. lib/pq is in maintenance mode.
  4. No golang/mock - use go.uber.org/mock (Google archived original).
  5. No GORM by default - sqlc is default; GORM requires explicit --orm=gorm flag.
  6. No panic for business errors - return errors.
  7. No blind internal/ - design phase must produce an explicit public-API decision.
  8. No synthetic-only validation - validate phase refuses to mark complete without a real-data fixture path.
  9. NumPy/SciPy refusal - if discovery detects them load-bearing, STOP with gRPC-wrap recommendation instead.

Cross-refs into the rest of the skill ecosystem

  • gostack - Sam Berthe's Go libraries (lo, oops, do, mo, slog, hot, ro). See references/translation-rules.md for where each library is the right answer.
  • vd:cook - once a plan + MIGRATION.md is in place, drive execution phase-by-phase
  • vd:debug - for the on-call story oops/slog enables in the migrated service
  • vd:ship - for the final cutover commit + PR

Versions snapshot (verified 2026-05-23)

Locked defaults - change requires explicit flag.

ConcernPinned defaultCite
HTTP frameworkgin v1.xGo Survey 2025: 48% adoption
Postgres driverpgx/v5lib/pq in maintenance
DB accesssqlc2× faster than GORM on 15k-row reads
Migrationsgolang-migrateMulti-DB, CI-friendly
ConfigviperCobra ecosystem alignment
Loggerlog/slog (stdlib)Survey 2025 default for new code
Validationgo-playground/validatorDefault with Gin
Mockinggo.uber.org/mockGoogle archived golang/mock
OpenAPI codegenoapi-codegenSupports Gin/chi/Fiber
Queueasynq (Redis) or river (Postgres)Celery-shaped or PG-native
Cacheristretto or gostack@hotSee gostack/hot
Authgolang-jwt/v5 + argon2OWASP 2025 recommendation
ObservabilityOpenTelemetry + PrometheusIndustry standard
Build/releasegoreleaser + koContainer without Dockerfile

Adding a new project-type playbook

  1. Detect signal in discover phase (imports, file conventions)
  2. Drop references/playbook-<type>.md with the canonical Go stack for that shape
  3. Add a row to the "Project-type playbooks" table above
  4. Update translation rules where the playbook diverges from defaults

What ships with it: 1 file

16.5 KB alongside SKILL.md

references/

Keep looking

Skills are one crate of 326,149. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.