new-enum

Add a Rust forge::AppEnum with wire keys, i18n labels, and TypeScript bindings.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/weiloon1234/Forge-Starter --skill new-enum
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-enum
Source: https://github.com/weiloon1234/Forge-Starter/tree/main/.claude/skills/new-enum
Command: npx skills add https://github.com/weiloon1234/Forge-Starter --skill new-enum

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill standardizes the process of adding a new app-owned enum (forge::AppEnum) so that the Rust code, DB bindings, and TypeScript types stay consistent across the stack, including wire keys and i18n labels.

Core Features & Use Cases

  • Enables a new AppEnum with defined variants that serialize to string keys for DB storage and TS export.
  • Ensures i18n label keys exist for every locale, and regenerates TS bindings via make types.
  • Use cases include adding Priority, TopUpStatus, or OrderStatus enums that cross the Rust/DTO/TS boundaries.

Quick Start

Define the new enum in Rust using #[derive(forge::AppEnum)], add any required #[forge(key = "...")] wire keys, update i18n keys for locales, and run make types to produce the frontend bindings.

Frequently Asked Questions about new-enum

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

FAQPage Schema
How do I create a Rust enum that serializes to TypeScript and database boundaries?

Use the forge::AppEnum derive to create a cross-boundary enum in Rust, defining wire keys for serialization and running make types to generate TS bindings. This standardizes app-owned enums like OrderStatus across DB storage and frontend unions.

What is the process for adding i18n labels to an app-wide enum in Rust?

Adding i18n labels requires defining locale-specific label keys for every variant of your forge::AppEnum. The process ensures that enums crossing Rust and TypeScript boundaries have consistent internationalization labels across all supported locales.

How do I generate TypeScript bindings from a Rust enum using wire keys?

Define your Rust enum with the forge::AppEnum derive and optional wire keys, then run the make types command. This generates TypeScript bindings by exporting the enum variants as string-keyed unions for frontend consumption.

Does forge::AppEnum support custom string keys for database storage?

Yes, forge::AppEnum supports custom string wire keys for database storage. You can assign specific keys to enum variants so they serialize consistently across Rust DTOs, database bindings, and TypeScript frontend unions.

When do I need to use cross-boundary AppEnum types instead of standard Rust enums?

Use cross-boundary AppEnum types when creating app-wide enums like TopUpStatus, Priority, or OrderStatus that must flow through DTOs, database bindings, and frontend TypeScript unions. Standard enums lack this automated cross-stack serialization.

Why are my TypeScript enum bindings out of sync after adding a new Rust variant?

TypeScript bindings fall out of sync when you add a Rust variant without running the make types command. Regenerate the TS bindings and ensure all required i18n label keys exist for every locale to restore consistency.