update-cnw-templates

Migrates create-nx-workspace template repos to a target nx version and opens draft PRs.

29.3k|3.0k|Updated Aug 11, 2017
One-click install
npx skills add https://github.com/nrwl/nx --skill update-cnw-templates
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: update-cnw-templates
Source: https://github.com/nrwl/nx/tree/main/.claude/skills/update-cnw-templates
Command: npx skills add https://github.com/nrwl/nx --skill update-cnw-templates

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Keeping the nrwl create-nx-workspace template repos (empty, react, angular, nextjs, etc.) in sync with each new nx release is a repetitive, error-prone chore: each repo must be cloned, migrated, verified, and PR'd individually, and a broken template silently breaks scaffolding for end users.

Core Features & Use Cases

  • Bulk migration: Clones any or all of the 12 nrwl template repos, runs nx migrate to a target version, applies migrations, and bumps dependencies.
  • Verification before shipping: Runs build, test, lint, typecheck, and e2e targets per repo, reverting and reporting any repo that fails instead of opening a broken PR.
  • Draft PR automation: Opens one single-commit draft PR per repo via the GitHub API, with optional Polygraph session linking.
  • Post-merge sanity check: The bundled run-all-templates.sh script runs create-nx-workspace --template against every template's main branch to confirm end-to-end scaffolding still works.
  • Use Case: After nx 23.2.0 ships, ask the agent to "update the CNW templates to 23.2.0" and receive a report table of draft PRs, one per live template repo.

Quick Start

Ask the agent to update the CNW templates to a specific nx version, for example: update the CNW templates to nx 23.2.0.

Frequently Asked Questions about update-cnw-templates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update the create-nx-workspace templates to a new nx version?

Provide a target nx version (e.g. 23.2.0) and the skill clones each nrwl template repo, runs nx migrate, applies migrations, verifies build/test/lint/e2e, and opens a draft PR per repo. If no version is given, it uses the latest stable nx from npm.

Which template repos does the CNW template update cover?

It covers 12 repos under nrwl: empty, typescript, react, angular, react-mfe, nextjs, nestjs, express-api, astro-starlight, remotion, tanstack-start, and tanstack-ai templates. You can target one, several, or all of them, and it checks each repo is live via the GitHub API first.

Does the skill require the template repos to be checked out locally?

No. It clones the repos it needs over SSH into a work directory (default ./tmp/cnw-templates/) and reuses an existing clone only if the working tree is clean. Anyone can run it from a fresh machine.

What happens if a template fails verification during migration?

If any build, test, lint, typecheck, or e2e target fails, the repo is reverted with git checkout and reported as failed. The skill never opens a PR for a repo that does not pass verification.

How do I verify the templates still scaffold after the PRs are merged?

Run the bundled run-all-templates.sh script with CNW_VERSION set to the target version. It runs create-nx-workspace --template for every repo against its main branch and reports pass/fail per template.

Can the skill push directly to main on the template repos?

No. It never pushes without confirmation and always opens draft PRs against main, keeping each branch to a single commit for squash-merging. A repo owner reviews and marks the PRs ready.