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.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- applications/AGENTS.mdAGENTS.md
- databases/AGENTS.mdAGENTS.md
- infra/AGENTS.mdAGENTS.md
- packages/AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- tools/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/nx-rules.mdcCursor rule
- frontend-designSkill
- grillingSkill
- improveSkill
- link-workspace-packagesSkill
- monitor-ciSkill
- nx-workspaceSkill
- agents-ralphSkill
- github-commitSkill
- github-pull-requestSkill
- github-squashSkill
- ot-foldersSkill
- ot-loopSkill
- ot-onboardingSkill
- ot-plansSkill
- ot-postgresSkill
- ot-skill-syncSkill
- ot-stackSkill
- ot-worktreeSkill
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
- Very specific: line 31
Every Nx invocation that touches @tools/generators must run with plugin isolation off, or generators will fail in typical agent/CI …
- Very specific: line 80
Use @tools/generators:react-router and the same --subGenerator / flags described for Remix-style apps in those docs, unless --describe …
- Very specific: line 110
Prefer --dry-run where supported before writing files.
- Very specific: line 132
Prefer batching when scaffolding related siblings.
≈ “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.
Files
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 nxand links to AGENT_USAGE paths.
How this fits other skills (no duplication)
| Need | Use |
Local @tools/generators workflow, OT flags, doc paths | This skill |
Read-only workspace: project list, nx show project, graph, affected | nx-workspace (installed skill — invoke by name) |
Execute nx run, affected, run-many after code exists | nx-workspace (installed skill — invoke by name) |
| Plans, Plan-Id / Task-Id, openthrottle-mcp | ot-plans |
| Link workspace packages after new packages | link-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/generatorsAs of that list, registered generators are:
| Generator key | Purpose (high level) |
folders | Folder trees for routes/services |
nestjs | NestJS apps, services, modules, GraphQL services, etc. |
package | New workspace packages |
react | React components/hooks for packages or apps (--destination, --list=destinations) |
react-router | React 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 taggedtechnology:reactis a valid destination, includingpackages/react-router-*. - Inside an application →
react-router --subGenerator=component --application=<app> --folder=<path>, resolved underapplications/<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.
List generators
NX_ISOLATE_PLUGINS=false pnpm nx list @tools/generatorsSchema / required flags
NX_ISOLATE_PLUGINS=false pnpm nx g @tools/generators:<generator> --describeDynamic values (applications, destinations, folders, etc.)
NX_ISOLATE_PLUGINS=false pnpm nx g @tools/generators:<generator> --list=<key> [--application=<app>]- Generate with
--subGenerator=...and required options (see--describe). - 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,ProfilingQueueRunMetricsPrefer 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-routerwith--applicationfrom--list=applications, and--list=componentFolderswhere applicable. - GraphQL / NestJS in
openthrottle-server: oftennestjswith--subGenerator=graphql-serviceor other sub-generators from--describe. - New libs:
packagegenerator, 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
| Document | Path |
| Full agent workflow (Quick Start, API, best practices) | docs/tools/templates/AGENT_USAGE.md |
| Nx isolate-plugins troubleshooting | docs/tools/templates/NX_ISOLATE_PLUGINS.md (referenced from AGENT_USAGE) |
| Generators package overview | tools/generators/README.md |
| Generator source | tools/generators/src/generators/ |
| Code style (component/data boundaries, shape) | docs/monorepo/code-style.md |
| Monorepo entry | AGENTS.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
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
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.

