agentleFS
fpindejfpindej/netrock/.claude/skills/gen-types/SKILL.md

gen-types

Skill234 starsChanged 3 months agoMITView on GitHub

Regenerate frontend API types from the backend OpenAPI spec

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check what changed - look for renamed/removed schemas (breaking) vs added schemas (safe)

    line 20
  2. Very specific:

    Update type aliases in src/frontend/src/lib/types/index.ts if schemas changed

    line 22
  3. Distinctive:

    If errors: the backend made a breaking API change - fix all frontend consumers

    line 28
  4. Very specific:

    Commit v1.d.ts with the backend changes that caused the regeneration

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Regenerates frontend API types from the backend OpenAPI spec.

Recently changed backend files: !git diff --name-only HEAD~3 -- src/backend/ 2>/dev/null | grep -E '\.(cs)$' | head -20 || echo "(no recent backend changes)"

Steps

  1. Try generating types:
    cd src/frontend && pnpm run api:generate
  2. If generation fails: fix the cause, never the output - v1.d.ts is generated and must never be hand-edited (CLAUDE.md hard rule). Typical causes: backend does not build (dotnet build src/backend/MyProject.slnx), or the OpenAPI spec export step failed - read the generator error. If you cannot fix the cause, stop and report the blocker instead of shipping hand-written types.
  3. Check what changed - look for renamed/removed schemas (breaking) vs added schemas (safe)
  4. Update type aliases in src/frontend/src/lib/types/index.ts if schemas changed
  5. Fix type errors:
    cd src/frontend && pnpm run check
    If errors: the backend made a breaking API change - fix all frontend consumers
  6. Format: cd src/frontend && pnpm run format
  7. Commit v1.d.ts with the backend changes that caused the regeneration

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.