v0.x-to-authz-lib

Migrate legacy generated authorizers to delegate decisions to forge/pkg/authz.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill fixes duplicated, inline per-service authorization decision logic by migrating legacy generated authorizers so their decision-making lives in the shared, tested forge/pkg/authz library.

Core Features & Use Cases

  • Detect legacy vs new generated authorizer shape by verifying whether your handlers’ authorizer_gen.go contains the older ~110-line struct-based logic or the newer ~35-line shim.
  • Regenerate deterministic shim code so every service’s authorizer_gen.go delegates to forge/pkg/authz while preserving the expected public API (NewGeneratedAuthorizer / Can / CanAccess).
  • Handle manual edge cases when user code references GeneratedAuthorizer by value, relies on private symbols, or needs custom Decider behavior.

Use case: you run forge upgrade and need to move from the inline matching template to the authz library-driven shim, ensuring empty-procedure and unknown-procedure deny behavior remains correct.

Quick Start

Run forge generate to rewrite handlers/*/authorizer_gen.go into the forge/pkg/authz shim shape, then build and test to confirm compatibility.

Frequently Asked Questions about v0.x-to-authz-lib

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

FAQPage Schema
How do I migrate generated authorizers to the forge/pkg/authz library in Go?

Migrate generated authorizers by running forge generate to rewrite handlers/*/authorizer_gen.go into a shim that delegates authorization decisions to forge/pkg/authz, then build and test to confirm compatibility.

When do I need to migrate inline authorization logic to forge/pkg/authz?

You need to migrate inline authorization logic when a forge upgrade crosses the version introducing forge/pkg/authz, typically 1.7.x to 1.8.x, and your handlers use the legacy authorizer_gen.go template output.

How do I check if my Go service uses the legacy generated authorizer or the new authz shim?

Check your generated authorizer shape by inspecting authorizer_gen.go for the older ~110-line struct-based logic or the newer ~35-line shim that delegates to forge/pkg/authz.

Can I use forge generate to update custom authorizer.go files or Decider integrations?

forge generate rewrites deterministic authorizer_gen.go shim code, but you must manually update custom authorizer.go files or Decider integrations that reference GeneratedAuthorizer by value or rely on private symbols.

Does migrating to forge/pkg/authz preserve the public API for GeneratedAuthorizer?

Migrating to forge/pkg/authz preserves the expected public API, including NewGeneratedAuthorizer, Can, and CanAccess, while ensuring empty-procedure and unknown-procedure deny behavior remains correct.