agentleFS
NVIDIAKnown publisherNVIDIA/nvcf/src/uis/nvcf-ui/.agents/skills/codegen/SKILL.md

codegen

Skill272 starsChanged 8 days agoApache-2.0View on GitHub

Run and manage the Orval code generation pipeline for API hooks, TypeScript models, and MSW mocks in nvcf-ui. Use when editing an OpenAPI spec, running task generate, adding or changing MSW scenarios, troubleshooting generated code, or when generated hooks are missing or out of date.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Commit regenerated output in the same change as the spec.

    line 26

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code generation

task generate runs Orval, which reads the three OpenAPI specs in spec/ and generates React Query hooks, TypeScript models, and MSW handler factories into ui/src/generated/. It then adds license headers to the output.

Specs:

  • spec/control-plane-openapi.yaml: the UI shim and BFF API
  • spec/nvcf-openapi.yaml: the NVCF Cloud Functions v2 API
  • spec/sis-openapi.yaml: the cluster API

Rules

  • Edit the specs in spec/. Never edit ui/src/generated/.
  • Commit regenerated output in the same change as the spec. No CI job checks generated output for drift today, so a stale diff is caught only in review.
  • Orval config is ui/orval.config.ts, with one shared output block spread across all three specs. Customize generation there.
  • Hook names follow Orval's convention: useGetFunctions, useGetFunctionsSuspense, getGetFunctionsQueryOptions. The double "Get" is expected.

What gets generated

  • React Query hooks, including suspense variants.
  • Query options factories, used in route loaders.
  • TypeScript models in ui/src/generated/model/. Zod output is off; add a separate client: "zod" target if runtime validation is needed.
  • MSW handler factories and response mock generators.

Mocks and scenarios

The default mock baseline is a seeded in-memory store in ui/src/mocks/store/, not the raw generated handlers. It builds one dataset keyed by account ncaId, so list and detail views agree on IDs.

Scenarios live in ui/src/mocks/scenarios/<feature>/<name>.ts and export handlers. They layer over the store (first match wins). Activate them with task ui:dev MOCK=true SCENARIO=functions:empty-list (comma-separated for several). Write scenarios for states that change the view, such as an empty list, an error, or a status that changes available actions.

Fix mock realism at the source: the mock.properties overrides in ui/orval.config.ts, then task generate.

Validate

  1. Run task generate.
  2. Run task lint:fix.
  3. Run task verify.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.