agentleFS
nrwlnrwl/nx/.agents/skills/update-cnw-templates/SKILL.md

update-cnw-templates

Skill29k starsChanged 9 days agoMITView on GitHub

Migrate create-nx-workspace template repositories to a target Nx version, verify each template, and prepare draft PRs. Use when asked to update or bump the CNW templates.

  • Deletes or force-pushes
  • Installs packages
  • Sends data out
  • Commits and pushes

Trending

More talk lately.about the whole repository

Jan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 5 mentionsApr 2026: 4 mentionsMay 2026: 1 mentionJun 2026: 0 mentionsJul 2026: 1 mentionAug 2026: 0 mentionsSep 2026: 1 mentionOct 2026: 4 mentionsNov 2026: 1 mentionDec 2026: 0 mentions
Jan 2026Jul 2026Dec 2026
Mentions a month of the nrwl/nx repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about nrwl/nx

The biggest 5 of 93 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 93

Talked about on GitHub, YouTube, Stack Overflow, Bluesky and Hacker News (93 times).

On GitHub · 26

21 more on GitHub

On YouTube · 25

20 more on YouTube

On Stack Overflow · 25

20 more on Stack Overflow

On Bluesky · 11

6 more on Bluesky

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Read Codex execution conventions before following this workflow.

    line 6
  2. Very specific:

    All live under nrwl/<name>-template, push target branch main.

    line 29
  3. Very specific:

    Before continuing, check that all the templates are live.

    line 47
  4. Distinctive:

    If you hit 404 report it.

    line 49
  5. Distinctive:

    If this skill runs inside a Polygraph session (the startup banner names a session ID), add every target template repo to the session so …

    line 65
  6. Very specific:

    Add only the live repos you're actually touching.

    line 73
  7. Very specific:

    All template repos are npm (package-lock.json).

    line 79
  8. Very specific:

    Use CI=true to skip prompts.

    line 94
  9. Distinctive:

    If any target fails, revert that repo (git checkout .) and report - never open a red PR.

    line 113
  10. Distinctive:

    Every template's main is a single "Initial commit" (verified across all 12 repos), so keep the branch to one commit (amend, don't stack) …

    line 117

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

Read Codex execution conventions before following this workflow.

Update CNW Templates

Bump every CNW template repo to one target nx version, verify it still builds and still scaffolds, then open a draft PR per repo. Each template is an independent GitHub repo under nrwl/; create-nx-workspace --template nrwl/<repo> clones its main to scaffold a user's workspace. Each repo has a ci.yml that lints, tests, builds, typechecks, and e2es it on PRs - but the consumer path (scaffolding from main via --template) isn't covered there, and a force-push to main skips PR CI entirely (how the react template broke). So verify before you ship.

This skill makes no assumption that the repos are checked out locally. It clones what it needs. Anyone on the team can run it from a fresh machine.

Input

  • Target nx version - e.g. 23.2.0. If omitted, use latest stable: npm view nx@latest version. Verify it exists: npm view nx@<version> version.
  • Repos - one, several, or (default) all live templates. Names may be given with or without the -template suffix.
  • Work dir - where clones land. Default ./tmp/cnw-templates/ (gitignored). Reuse an existing clone if one is already there and clean.

The template repos

All live under nrwl/<name>-template, push target branch main. --template accepts the full nrwl/<repo> form for all of them. Four templates also have a bare shorthand.

Template--template valueShorthand
emptynrwl/empty-templateempty
typescriptnrwl/typescript-templatets
reactnrwl/react-templatereact
angularnrwl/angular-templateangular
react-mfenrwl/react-mfe-template-
nextjsnrwl/nextjs-template-
nestjsnrwl/nestjs-template-
express-apinrwl/express-api-template-
astro-starlightnrwl/astro-starlight-template-
remotionnrwl/remotion-template-
tanstack-startnrwl/tanstack-start-template-
tanstack-ainrwl/tanstack-ai-template-

Before continuing, check that all the templates are live. A repo is live if GET https://api.github.com/repos/nrwl/<name>-template/commits/main returns 200 (a sha). If you hit 404 report it.

This table may change, and the user will tell you which repos to use (defaults to all in the table).

Procedure

1. Resolve version + repo set

npm view nx@<version> version                 # confirm target exists
# for each requested repo, confirm it's live:
curl -s -o /dev/null -w "%{http_code}" https://api.github.com/repos/nrwl/<name>-template/commits/main

1a. If in a Polygraph session, add the templates to it

If this skill runs inside a Polygraph session (the startup banner names a session ID), add every target template repo to the session so their per-repo PRs link together under one session. The repos are exact owner/repo refs, so add them directly - no discovery:

add_repo(sessionId: "<session-id>", repoIds: ["nrwl/empty-template", "nrwl/react-template", ...])

Add only the live repos you're actually touching. After add_repo, the PRs you open in step 5 join the session automatically - the link is the session, not any cross-reference in the PR bodies. If there's no session, skip this and proceed normally.

2. Clone (or reuse) each repo

All template repos are npm (package-lock.json). Clone over SSH; the working tree must be clean before you touch it.

mkdir -p tmp/cnw-templates && cd tmp/cnw-templates
git clone git@github.com:nrwl/<name>-template.git      # or reuse an existing clean clone
cd <name>-template
git checkout main
git status --porcelain      # MUST be empty; if dirty, skip this repo and report
git fetch origin main && git reset --hard origin/main   # make sure we start from latest origin
grep '"nx"' package.json    # record current version

3. Migrate

Use CI=true to skip prompts.

CI=true npm install                             # node_modules at current version
CI=true npx nx migrate <target-version>         # updates package.json, writes migrations.json
CI=true npm install                             # apply the dep bump
if [ -f migrations.json ]; then
  CI=true npx nx migrate --run-migrations
  rm -f migrations.json
fi

4. Verify

NX_NO_CLOUD=true NX_DAEMON=false CI=true npx nx run-many -t build test lint typecheck --skip-nx-cache
NX_NO_CLOUD=true NX_DAEMON=false CI=true npx nx run-many -t e2e   # where the repo defines it

If any target fails, revert that repo (git checkout .) and report - never open a red PR.

5. Commit + PR (per repo)

Every template's main is a single "Initial commit" (verified across all 12 repos), so keep the branch to one commit (amend, don't stack) and squash-merge the PR.

cd tmp/cnw-templates/<name>-template
git checkout -b update-nx-<target-version>
git add -A
git commit -m "chore(deps): update to nx <target-version>"   # never mention AI/Codex
git push -u origin update-nx-<target-version>
# open a draft PR to main via the GitHub API (token from env/1Password, never hardcode):
curl -s -X POST -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/vnd.github+json" \
  "https://api.github.com/repos/nrwl/<name>-template/pulls" \
  -d '{"title":"chore(deps): update to nx <target-version>","head":"update-nx-<target-version>","base":"main","draft":true,"body":"<per-repo summary: old->new nx, migrations run>"}'

PR body: old -> new nx version, which migrations ran, and the verification result. For a not-yet-created repo (404 in step 1), skip the push - report it as "not created".

6. Sanity check after the PRs land - run-all-templates.sh

run-all-templates.sh (bundled next to this file) runs create-nx-workspace --template nrwl/<repo> for every template and reports pass/fail. It scaffolds from each repo's main, so run it as a follow-up once the template PRs are merged (or after you push to main) - a real end-to-end check that every template still scaffolds for users. It can't see an unpushed branch, so it's a post-merge step, not a pre-merge gate.

# all templates:
CNW_VERSION=<target-version> ./run-all-templates.sh
# a subset:
CNW_VERSION=<target-version> ONLY="empty-template react-template" ./run-all-templates.sh

7. Report

One table across all repos:

| Template        | Previous | Updated | Files | Status         |
| --------------- | -------- | ------- | ----- | -------------- |
| empty-template  | 23.1.0   | 23.2.0  | 2     | PR #NN (draft) |
| nuxt-template   | 23.1.0   | -       | -     | not created    |

Be ready to explain any change - which migration produced it and why.

Notes

  • Always CI=true for nx/npm commands so nothing blocks on a prompt.
  • Never push without confirmation. Open PRs as drafts; the owner reviews and marks ready.
  • Patch bumps are usually just package.json + lockfile (no migrations.json). Minor/major can rewrite source - review the non-dep diff before committing.

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.