agentleFS
OpenThrottleOpenThrottle/monorepo/skills/ot-generators/SKILL.md

ot-generators

Skill2 starsChanged 2 months agoApache-2.0View on GitHub

Scaffolding OpenThrottle code with @tools/generators. USE WHEN adding an app, package, React Router component or route, or NestJS service — always before hand-writing one — or when hitting "Unable to resolve @tools/generators" or "Cannot find generator". Every command needs NX_ISOLATE_PLUGINS=false. Defer graph, targets and task running to nx-workspace.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every Nx invocation that touches @tools/generators must run with plugin isolation off, or generators will fail in typical agent/CI …

    line 31
  2. Very specific:

    Use @tools/generators:react-router and the same --subGenerator / flags described for Remix-style apps in those docs, unless --describe …

    line 80
  3. Very specific:

    Prefer --dry-run where supported before writing files.

    line 110
  4. Very specific:

    Prefer batching when scaffolding related siblings.

    line 132

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

OpenThrottle generators and Nx conventions

When to read this skill

  • You are about to create or scaffold code in this repo (components, routes, NestJS services, packages, folder trees).
  • Nx errors with Unable to resolve @tools/generators:... or Cannot find generator (often a wrong generator name — see Registered names).
  • You need the OT-specific command pattern: NX_ISOLATE_PLUGINS=false + pnpm nx and links to AGENT_USAGE paths.

How this fits other skills (no duplication)

NeedUse
Local @tools/generators workflow, OT flags, doc pathsThis skill
Read-only workspace: project list, nx show project, graph, affectednx-workspace (installed skill — invoke by name)
Execute nx run, affected, run-many after code existsnx-workspace (installed skill — invoke by name)
Plans, Plan-Id / Task-Id, openthrottle-mcpot-plans
Link workspace packages after new packageslink-workspace-packages (installed skill — invoke by name)

Non-negotiable: NX_ISOLATE_PLUGINS=false

Every Nx invocation that touches @tools/generators must run with plugin isolation off, or generators will fail in typical agent/CI environments.

Prefix each command:

NX_ISOLATE_PLUGINS=false pnpm nx <subcommand> ...

This repo standardizes on pnpm and nx via pnpm nx (see AGENTS.md). Do not omit the prefix.

Registered generator names

Source of truth: tools/generators/generators.json — confirm anytime with:

NX_ISOLATE_PLUGINS=false pnpm nx list @tools/generators

As of that list, registered generators are:

Generator keyPurpose (high level)
foldersFolder trees for routes/services
nestjsNestJS apps, services, modules, GraphQL services, etc.
packageNew workspace packages
reactReact components/hooks for packages or apps (--destination, --list=destinations)
react-routerReact Router app artifacts: components, routes, hooks, utils (--application, --list=applications, etc.)

Which one scaffolds a component

This is the one distinction agents get wrong, so it is stated here once and referenced everywhere else in this skill:

  • In a package → react --subGenerator=component --destination=<project>. Any project tagged technology:react is a valid destination, including packages/react-router-*.
  • Inside an application → react-router --subGenerator=component --application=<app> --folder=<path>, resolved under applications/<app>/app/routing.

react-router does not scaffold into packages/ — passing a package to --application is the wrong generator, not an unsupported target. react handles app-local components too, so when in doubt it is the safer of the two. Full matrix: docs/tools/templates/AGENT_USAGE.md.

Docs vs reality: remix vs react-router

Some documentation (including sections of docs/tools/templates/AGENT_USAGE.md) still shows @tools/generators:remix. That name is not registered; Nx will error:

Unable to resolve @tools/generators:remix / Cannot find generator 'remix'.

Use @tools/generators:react-router and the same --subGenerator / flags described for Remix-style apps in those docs, unless --describe shows otherwise.

Discovery workflow (mandatory order)

Non-negotiable: check for a generator before writing ANY new code, component, hook, service or file by hand. Step 1 is not a formality — picking the wrong generator is the mistake that actually happens, which is why discovery precedes generation.

  1. List generators

    NX_ISOLATE_PLUGINS=false pnpm nx list @tools/generators
  2. Schema / required flags

    NX_ISOLATE_PLUGINS=false pnpm nx g @tools/generators:<generator> --describe
  3. Dynamic values (applications, destinations, folders, etc.)

    NX_ISOLATE_PLUGINS=false pnpm nx g @tools/generators:<generator> --list=<key> [--application=<app>]
  4. Generate with --subGenerator=... and required options (see --describe).
  5. Only then hand-edit for business logic.

Prefer --dry-run where supported before writing files.

If no generator fits, say so explicitly before writing custom code. Silently hand-writing what a generator would have scaffolded is how files drift out of the primitive shape the ot-folders rules and the component ESLint rule then reject.

Batch generation (--name comma-separated)

Most @tools/generators sub-generators accept multiple names in one invocation via comma-separated --name values (spaces after commas are fine: A, B, C).

Confirm support: --describe JSON includes "description": "Comma-separated names supported." on the name option when batching works (e.g. react, react-router component/route/form/modal/table; react hook/util). Some generators (e.g. NestJS application) use a single slug—always read --describe for the generator you chose.

Example — four package components in one command (note react + --destination, per Which one scaffolds a component):

NX_ISOLATE_PLUGINS=false pnpm nx g @tools/generators:react \
  --subGenerator=component \
  --destination=@openthrottle/react-router-profiling \
  --folder=components \
  --name=ProfilingServerMetrics,ProfilingQueueMetrics,ProfilingTaskRunMetrics,ProfilingQueueRunMetrics

Prefer batching when scaffolding related siblings; split only when names need different --folder, --destination, or sub-generators.

Typical OpenThrottle entrypoints

Exact flags change over time; always use --describe and --list for the generator you chose.

  • Components: see Which one scaffolds a component above — the package-vs-application split is the only place this is stated.
  • Application routes: react-router with --application from --list=applications, and --list=componentFolders where applicable.
  • GraphQL / NestJS in openthrottle-server: often nestjs with --subGenerator=graphql-service or other sub-generators from --describe.
  • New libs: package generator, then wire deps via link-workspace-packages if needed.

Per-generator markdown deep-dives live under docs/tools/templates/ (e.g. react.md, nestjs.md, folders.md) as linked from the canonical guide below.

Canonical documentation paths

DocumentPath
Full agent workflow (Quick Start, API, best practices)docs/tools/templates/AGENT_USAGE.md
Nx isolate-plugins troubleshootingdocs/tools/templates/NX_ISOLATE_PLUGINS.md (referenced from AGENT_USAGE)
Generators package overviewtools/generators/README.md
Generator sourcetools/generators/src/generators/
Code style (component/data boundaries, shape)docs/monorepo/code-style.md
Monorepo entryAGENTS.md (Generators / Nx sections)

OpenThrottle and commits

Scaffolding is unrelated to OT tool calls, but if work is tracked under a plan/task, follow ot-plans: conventional commits with Plan-Id / Task-Id in the footer; the work ledger records itself when the PR opens (settle_plan_run with headSha / prNumber), so there is no post-merge step to remember.

Cross-links

  • nx-workspace — installed skill, not authored under skills/; invoke it by name.
  • ot-plans

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.