mcpField
C
codegen

codegen

github.com/cartridge-ggDevelopment8040 installsUpdated 7w ago
Repository

About codegen

codegen is a skill for regenerating GraphQL types from the API schema used by @cartridge/keychain. It specifies the project command and follow-up checks for generated files, TypeScript errors, and tests.

Key features

  1. 01Regenerate GraphQL types from schema
  2. 02Run code generation with pnpm
  3. 03Verify generated TypeScript files
  4. 04Check API-related TypeScript errors
  5. 05Run tests after generation

Use cases

  1. 01Updating types after an API schema change
  2. 02Refreshing types after GraphQL query edits
  3. 03Investigating type errors in API calls

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/cartridge-gg/controller --skill codegen

After installing, type/codegenin Claude Code to confirm it loaded.

Details

From the project README

GraphQL Codegen Skill

Regenerate GraphQL types from API schema.

Usage

Run when:

  • API schema has changed
  • GraphQL queries/mutations added or modified
  • Type errors in API calls

Steps

  1. Run pnpm --filter @cartridge/keychain codegen
  2. Verify generated types in packages/keychain/src/utils/api/graphql.ts
  3. Check for any TypeScript errors in files using the API
  4. Run pnpm test to ensure tests still pass

Configuration

Notes

  • Codegen is also triggered automatically during pnpm build
  • Generated files should not be manually edited
  • Commit generated changes with schema updates

Comments

Markdown supported