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.