v0.x-to-contractkit

Migrate legacy Forge generated code to the contractkit shim-based shape.

4|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/reliant-labs/forge --skill v0-x-to-contractkit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: v0.x-to-contractkit
Source: https://github.com/reliant-labs/forge/tree/main/internal/templates/project/skills/forge/migration/v0.x-to-contractkit
Command: npx skills add https://github.com/reliant-labs/forge --skill v0-x-to-contractkit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill fixes breaking behavioral and structural differences that appear when upgrading older Forge projects (pre-1.5) whose generated mock/middleware/tracing/metrics code used an inline-everything shape instead of the contractkit shim-based shape.

Core Features & Use Cases

  • Detect the generated-code shape: Identify whether your internal generated files still follow the old pre-contractkit structure.
  • Perform deterministic regeneration: Regenerate all generated _gen.go outputs in place so forge upgrade aligns signatures and recording behavior to forge/pkg/contractkit.
  • Handle the manual edge cases: Update any rare user code that depended on moved helper symbols or old wrapper internals.
  • Verify safely before committing: Run build, tests, and lint to ensure the migration preserved behavioral fingerprints like span naming, metric naming, slog attribute keys, and mock not-set error strings.

Quick Start

Run forge upgrade to a 1.5+ release so it regenerates mocks and related generated code into the contractkit shape, then confirm with go test ./... and forge lint.

Frequently Asked Questions about v0.x-to-contractkit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate generated mock and tracing code when upgrading Forge across the 1.4.x to 1.5.x boundary?

Run forge upgrade to a 1.5+ release to deterministically regenerate mocks, middleware, tracing, and metrics code into the contractkit shim-based shape, replacing the old inline-everything structure.

What is the contractkit shim-based shape for generated code in Forge?

The contractkit shim-based shape is the post-1.5 Forge generation layout that aligns signatures and recording behavior to forge/pkg/contractkit, replacing the pre-1.5 inline-everything structure for mocks and metrics.

How do I preserve slog attribute keys and span naming when regenerating code with Forge?

Regenerate _gen.go outputs with forge upgrade to preserve behavioral fingerprints including span naming, metric naming, slog attribute keys, and mock not-set error strings, then verify with go test and forge lint.

Do I need to manually update user code that referenced removed helper symbols after migrating to contractkit shims?

Yes, you must manually update rare user code that depended on moved helper symbols or old wrapper internals after the contractkit migration, as deterministic regeneration only updates the generated files.

Why does my Forge generated mock code break structurally after upgrading to 1.5+?

Generated mock code breaks structurally after a forge upgrade because pre-1.5 projects used an inline-everything shape, which the 1.5+ release replaces with the contractkit shim-based shape, altering signatures and recording behavior.

What are the limitations of migrating legacy codegen to contractkit shims?

The migration does not automatically fix user code referencing removed per-template helper symbols or old wrapper internals, requiring manual updates and subsequent verification through build, tests, and lint to ensure behavioral preservation.