/agent-skills:repo-setupfrom agent-skills
Set up a new or existing repository of this user that publishes a library to npm. pnpm workspaces, changesets, tsdown, vitest (Playwright for browser e2e), oxlint and oxfmt, an MIT license, a check workflow and a release workflow with npm trusted publishing (OIDC). Covers the folder layout (packages, examples, benchmarks, docs, website on Vercel), the manual 0.0.0-stage first publish, and GitHub environments for releases with more than one target. Use this skill whenever the user asks to set up, bootstrap, scaffold, initialize or modernize a repo, add CI or a release workflow, or bring an old repo up to their current setup, even if they do not say "repo-setup". Also use it to check an already set up repo for missing property-based, model-based or oracle tests and for implicit state machines.
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
One setup for every npm library repo the user owns. talata and brumate are the reference repos: when a template here and those repos disagree, the newer repo wins, and this skill should be updated.
Use this skill only on repos the user owns (gh repo view --json owner). Repos of an organization, such as solidjs/*, keep their own conventions.
A repo that already matches the setup gets an audit with every line ok. Steps 4 and 5 still apply to it.
packageManager set in the root package.json. A repo with more than one package is a pnpm workspace.e2e/ workspace package. fast-check only in packages that need property, model or oracle tests (step 4).@lxsmnsyc/oxlint-config, and oxfmt.check.yml (lint, format, types and tests on pull requests and on main) and release.yml (changesets, publishing to npm with trusted publishing).
concurrency with cancel-in-progress on pull requests only). Runs on main are never cancelled.docs/** skip both workflows. Roadmaps, debates, proposals and decisions are not build inputs and carry no changesets. The website's docs live in website/ and stay covered.packages/ for the published packagesexamples/ for examplesbenchmarks/ for measurementsdocs/ for roadmaps, debates, proposals and decisions. Nothing in it is a build input.website/, only when the project needs a website. It is the central place for user documentation, and that documentation lives in website/. Build it with brumate or Solid 2.0, and deploy it on Vercel.templates/ holds the files to copy. Replace each <...> placeholder.
| Template | Goes to |
|---|---|
package.json | root package.json (merge into an existing one) |
pnpm-workspace.yaml | root, keep only the folders the repo has |
changeset-config.json | .changeset/config.json |
oxlint.config.ts, oxfmt.config.ts | root |
tsdown.config.ts, vitest.config.ts | each package folder |
LICENSE | root, with the current year |
gitignore | .gitignore |
workflows/check.yml, workflows/release.yml | .github/workflows/ |
workflows/release-extra-target.yml | jobs to add to release.yml for a second target |
vercel.json | website/vercel.json |
The templates hold no tool versions. Install each tool at its latest version, for example pnpm add -Dw @changesets/cli@latest oxlint@latest oxlint-tsgolint@latest oxfmt@latest @lxsmnsyc/oxlint-config@latest typescript@latest, and pnpm add -D tsdown@latest vitest@latest in each package. Set packageManager from npm view pnpm version. For the GitHub Actions versions (actions/checkout, pnpm/action-setup, actions/setup-node, changesets/action), copy the majors from the newest reference repo's workflows. A major on the npm next tag is not the latest: Solid 2.0, for example, is a release candidate, so pin its exact version.
python3 <skill>/scripts/audit.py <repo> # add --offline to skip the npm lookups
It lists each part of the setup as ok, missing, migrate (something else is there) or info. It also says which published packages are not on npm yet. For a new repo, every line is missing. Show the list to the user before editing.
A new repo starts on main. An existing repo gets one setup branch (chore/repo-setup) and one setup pull request through the pr-author skill.
Work through the audit list. For each migrate line, replace the old tool and remove its config and dependencies:
pnpm lint:fix and pnpm format once, in a commit of their own, so the reformat is easy to skip in a review.exports map, and compare the file list of npm pack --dry-run before and after.pnpm install.NPM_TOKEN secret after the first release from CI.benchmark/: rename it to benchmarks/.Then run every check locally: pnpm install, pnpm build, pnpm lint, pnpm format:check, pnpm typecheck, pnpm test. The check workflow runs the same scripts, so a script that is missing locally fails in CI.
Decide for each package, and for each module with real logic, whether it needs generated tests. Read references/testing.md.
Most modules need none, and then the step adds nothing. When one does, install fast-check in that package only and write the tests in its vitest suite. Show the user the decision per module, with the reason, before writing tests. The audit's fast-check line says which packages have it already.
Scan for state spread over several flags or status strings with no list of allowed transitions. Read references/state-machines.md.
python3 <skill>/scripts/scan_states.py <repo>
Read each candidate and drop the false ones. Then check whether the state is stored:
major changeset.Each fix is its own pull request through pr-author, after the setup pull request, with a model test (step 4) that checks the new transitions.
Count the release targets. npm is one. A VS Code extension, a browser extension, or anything published by hand or to another registry is another.
release.yml as it is.environment: npm to the npm publish job, and add a job per extra target from release-extra-target.yml, adapting its steps to that target. Tell the user which environments to create under Settings, Environments, and which secrets each one needs. Packages that are not published to npm go into ignore in .changeset/config.json, or are marked "private": true.npm trusted publishing can only be set up for a package that already exists on npm. For each package the audit reports as not on npm, the skill does not publish. It gives the user these three reminders in order, and waits for the user to finish each one.
1. Publish the placeholder. From the package folder, with version set to 0.0.0-stage:
pnpm build
npm publish --access public --tag stage --otp=<code from your authenticator>
npm view <pkg> dist-tags
The last command shows whether npm also pointed latest at the placeholder. Report what it shows.
2. Set up trusted publishing on npmjs.com. Open the package page, then Settings, then Trusted Publisher, and pick GitHub Actions:
release.yml, the file name onlyOr from the command line, with npm 11.15.0 or later and 2FA on the account:
npm trust github <pkg> --file release.yml --repo <owner>/<repo> --allow-publish
npm trust list <pkg>
Add --env <name> when step 6 added environments. npm trust ignores workspaces, so name each package. A package holds one trust configuration: to change it, find its ID with npm trust list and remove it with npm trust revoke <pkg> --id <id> first.
After the first release from CI works, set Publishing access to "Require two-factor authentication and disallow tokens".
3. Set up GitHub Actions.
permissions: id-token: write. No NPM_TOKEN secret is needed.Then set the package's version to 0.1.0. Do not add a changeset for the first release: changesets publishes any version that is not on npm yet.
Only when the project needs one. Create website/ with brumate or Solid 2.0, as a workspace package that reads its pages from docs/. Copy templates/vercel.json to website/vercel.json, and set outputDirectory to what the framework builds. The template deploys only main. Tell the user to import the repo on Vercel with website as the root directory. Add website to ignore in .changeset/config.json.
Before the first push, check the visibility with gh repo view --json visibility, or with pr-author's ci_guard.py. On a private repo, the new workflows start billed Actions runs, so do not push until the user says so. On a public repo, push the branch and open the setup pull request through pr-author. A new repo pushes main.
After the first release from CI, check the provenance with npm view <pkg>@<version> dist.attestations.
engines or extra oxlint rules. Ask when one conflicts with the setup.references/state-machines.md (opens in a new tab)references/testing.md (opens in a new tab)scripts/audit.py (opens in a new tab)scripts/scan_states.py (opens in a new tab)templates/LICENSE (opens in a new tab)templates/changeset-config.json (opens in a new tab)templates/gitignore (opens in a new tab)templates/oxfmt.config.ts (opens in a new tab)templates/oxlint.config.ts (opens in a new tab)templates/package.json (opens in a new tab)templates/pnpm-workspace.yaml (opens in a new tab)templates/tsdown.config.ts (opens in a new tab)templates/vercel.json (opens in a new tab)templates/vitest.config.ts (opens in a new tab)templates/workflows/check.yml (opens in a new tab)templates/workflows/release-extra-target.yml (opens in a new tab)templates/workflows/release.yml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
17 skills in this plugin
/changesetsWrite the changeset for a change in a repo that releases with changesets (a `.changeset/` folder exists). The bump level follows one question, whether the thing existed before: patch for changed behavior, minor for something new, major only with the maintainer's approval. Use this skill whenever finishing a change, opening a pull request or reviewing one in such a repo, even when nobody asks for a changeset, and when the user asks about bump levels or changelog entries./docs-siteMethod for planning, writing and maintaining a documentation site for a library, CLI, framework, API or app. Splits the site by what the reader needs (learn, do a task, understand, look up) into getting started, guides, concepts and reference, plus examples, troubleshooting, migration and a glossary. Gives each page type a fixed template, including the feature page (what it is, why, how it works, usage, options, limits, related) and the API reference entry. Covers navigation, code examples that run, keeping docs in step with the code, versioned docs and pages agents can read. Includes page templates, a checker script for page structure, links, orphan pages and code fences, and a review checklist. Use this skill whenever writing, restructuring, auditing or reviewing documentation, a docs site, a docs page, a README that has grown into docs, API reference, a getting started page, a migration guide or the docs part of the website/ folder, even if the user does not say "docs site". Load plain-writing with it.npx claudepluginhub lxsmnsyc/agent-skills --plugin agent-skillsOther plugins' skills for the same job