100x is a skill by a former Cursor engineer that turns prompts into formally verified, production-ready code
Pin the whole tree under the Cursor SDK, and say what the allow rule does not limit
Dead Internet9c38424227cf
diff --git a/docs/install.md b/docs/install.mdindex dce40e2..f6efbf4 100644--- a/docs/install.md+++ b/docs/install.md@@ -29,13 +29,13 @@ Run it again any time. It reports `unchanged` for what is already right. It neveEach release has one file, `100x-engineer-skill-<version>.tgz`. This page names the SHA-256 of the current one, so you can check it before npm runs anything from it. No clone is needed.- Version: `0.1.1`-- SHA-256: `5875cfd8e41eec802e40633173df22e2c8f8fd980db3e54275bb47c00d972241`+- SHA-256: `1a745ddade5db30a413baafe8dc7e1ef91bc9b8c4486d8be220b047013257118`On macOS and Linux:```bashcurl -fsSLO https://github.com/DeadInternetStudios/100x-engineer-skill/releases/download/v0.1.1/100x-engineer-skill-0.1.1.tgz &&-echo "5875cfd8e41eec802e40633173df22e2c8f8fd980db3e54275bb47c00d972241 100x-engineer-skill-0.1.1.tgz" | shasum -a 256 -c - &&+echo "1a745ddade5db30a413baafe8dc7e1ef91bc9b8c4486d8be220b047013257118 100x-engineer-skill-0.1.1.tgz" | shasum -a 256 -c - &&npm install -g ./100x-engineer-skill-0.1.1.tgz &&100x install```@@ -46,12 +46,12 @@ On Windows, in PowerShell:```powershellcurl.exe -fsSLO https://github.com/DeadInternetStudios/100x-engineer-skill/releases/download/v0.1.1/100x-engineer-skill-0.1.1.tgz-if ((Get-FileHash .\100x-engineer-skill-0.1.1.tgz -Algorithm SHA256).Hash -eq '5875cfd8e41eec802e40633173df22e2c8f8fd980db3e54275bb47c00d972241') { npm install -g .\100x-engineer-skill-0.1.1.tgz; if ($LASTEXITCODE -eq 0) { 100x install } } else { Write-Error 'The checksum does not match. Nothing was installed.' }+if ((Get-FileHash .\100x-engineer-skill-0.1.1.tgz -Algorithm SHA256).Hash -eq '1a745ddade5db30a413baafe8dc7e1ef91bc9b8c4486d8be220b047013257118') { npm install -g .\100x-engineer-skill-0.1.1.tgz; if ($LASTEXITCODE -eq 0) { 100x install } } else { Write-Error 'The checksum does not match. Nothing was installed.' }```The install line puts the tool on your PATH, with the skills inside the package. `100x install` does what the installer above does, from there. To update, install the newer release the same way, with the checksum this page names for it, then run `100x install` again. `npm update -g` does not look for releases, because the package came from a file.-What 100x downloads later is pinned too. `100x browsers` installs Playwright 1.65.1 and `100x helper setup` installs `@cursor/sdk` 1.4.2. The tool holds both versions and the npm integrity hash (SHA-512) of each package. It installs with package scripts off (`--ignore-scripts`), so nothing from a package runs during the install, and checks the hash right after. Only then does it run a browser download or the helper. On a mismatch it deletes the package from `node_modules`, from the prefix's `package.json` and from both lockfiles, so a later install cannot bring it back, and stops. The browser build is the one that Playwright version names.+What 100x downloads later is pinned too. `100x browsers` installs Playwright 1.65.1 and `100x helper setup` installs `@cursor/sdk` 1.4.2. The tool holds an exact version and the npm integrity hash (SHA-512) for every package in both: Playwright and playwright-core, and the SDK with its dependencies, its zod peer and the platform package for your machine. It asks npm for each of them by exact name, so a range that the SDK publishes cannot pick a newer release. It installs with package scripts off (`--ignore-scripts`), so nothing from a package runs during the install, and checks every hash right after. Only then does it run a browser download or the helper. On a mismatch it deletes the package from `node_modules`, from the prefix's `package.json` and from both lockfiles, so a later install cannot bring it back, and stops. The browser build is the one that Playwright version names.### On Windowsdiff --git a/lib/commands/browsers.mjs b/lib/commands/browsers.mjsindex dd30ffb..a609c9a 100644--- a/lib/commands/browsers.mjs+++ b/lib/commands/browsers.mjs@@ -5,7 +5,7 @@ import { CliError } from '../errors.mjs';import { globalDir } from '../paths.mjs';import { runProgram } from '../proc.mjs';import { chromiumBuilds, resolvePlaywright } from '../playwright.mjs';-import { PINS, pinned, verifyPinned } from '../pins.mjs';+import { INSTALLS, PINS, pinned, verifyPinned } from '../pins.mjs';const usage = `100x browsers [--check]@@ -43,8 +43,8 @@ export default {}fs.mkdirSync(globalDir(), { recursive: true });console.log(`Installing Playwright ${PINS.playwright.version} into ${globalDir()}. This takes a minute or two, and the output is kept unless it fails.`);- install('Installing Playwright', 'npm', ['install', '--prefix', globalDir(), '--no-audit', '--no-fund', '--ignore-scripts', '--save-exact', pinned('playwright'), pinned('playwright-core')]);- verifyPinned(globalDir(), ['playwright', 'playwright-core']);+ install('Installing Playwright', 'npm', ['install', '--prefix', globalDir(), '--no-audit', '--no-fund', '--ignore-scripts', '--save-exact', ...INSTALLS.playwright.map(pinned)]);+ verifyPinned(globalDir(), INSTALLS.playwright);console.log(`Installing the Chromium build that Playwright ${PINS.playwright.version} names. The download is large.`);install('Installing Chromium', path.join(globalDir(), 'node_modules', '.bin', process.platform === 'win32' ? 'playwright.cmd' : 'playwright'), ['install', 'chromium']);console.log('installed Playwright and Chromium into', globalDir());diff --git a/lib/commands/helper.mjs b/lib/commands/helper.mjsindex 80a86b6..2726cd1 100644--- a/lib/commands/helper.mjs+++ b/lib/commands/helper.mjs@@ -6,7 +6,7 @@ import * as cfg from '../config.mjs';import { chooseModel, describeModel, modelWords, refuseOutsideLock, requireSdk, resolveSdk, runHelper, SDK_PACKAGE, SDK_VERSION, sdkFailure } from '../cursor-sdk.mjs';import { globalDir } from '../paths.mjs';import { findProjectRoot } from '../paths.mjs';-import { pinned, verifyPinned } from '../pins.mjs';+import { INSTALLS, pinned, verifyPinned } from '../pins.mjs';import { writeReceipt } from '../receipt.mjs';import { refuseWhenSolo } from '../solo.mjs';import { recordHelper, refuseWhenSpent, spendLine } from '../spend.mjs';@@ -166,9 +166,9 @@ export default {if (there) return console.log(`already available, ${SDK_PACKAGE} ${there.version}${there.version === SDK_VERSION ? '' : `, not the ${SDK_VERSION} this was tested with`}.`);fs.mkdirSync(globalDir(), { recursive: true });console.log(`Installing ${SDK_PACKAGE}@${SDK_VERSION} into ${globalDir()}.`);- install(`Installing ${SDK_PACKAGE}`, 'npm', ['install', '--prefix', globalDir(), '--no-audit', '--no-fund', '--ignore-scripts', '--save-exact', pinned(SDK_PACKAGE)]);- verifyPinned(globalDir(), [SDK_PACKAGE]);- console.log(`installed ${SDK_PACKAGE}@${SDK_VERSION} into ${globalDir()}, and its hash matches the one pinned in 100x. Run \`100x helper login\` next.`);+ install(`Installing ${SDK_PACKAGE}`, 'npm', ['install', '--prefix', globalDir(), '--no-audit', '--no-fund', '--ignore-scripts', '--save-exact', ...INSTALLS.sdk.map(pinned)]);+ const checked = verifyPinned(globalDir(), [SDK_PACKAGE]);+ console.log(`installed ${SDK_PACKAGE}@${SDK_VERSION} into ${globalDir()}. It and the ${checked.length - 1} packages it needs match the hashes pinned in 100x. Run \`100x helper login\` next.`);return undefined;}if (action === 'login') return login(values);diff --git a/lib/pins.mjs b/lib/pins.mjsindex 627aa5c..995730f 100644--- a/lib/pins.mjs+++ b/lib/pins.mjs@@ -4,17 +4,39 @@ import { CliError } from './errors.mjs';// Everything 100x downloads and runs on a machine other than its own code: an exact version, and the SHA-512 integrity hash of that version's tarball as npm// publishes it. The hashes were checked against the downloaded tarballs, not only against the registry's own record. A new version is a change to this file.-// Playwright pins playwright-core to its own version, and playwright-core names the Chromium build, so the browser follows the pin. Neither package has an install-// script. @cursor/sdk has none either, and its own dependencies are the ranges it publishes, checked by npm against the registry.+// Playwright pins playwright-core to its own version, and playwright-core names the Chromium build, so the browser follows the pin.+// Both trees are here in full: Playwright with playwright-core, and the SDK with its dependencies, its zod peer and its five platform packages. Each platform package+// carries an `rg` executable, and npm installs the one that fits the machine. No package in either tree has an install script, and 100x installs with scripts off.+// To change a pin, install the roots into an empty folder with `npm install --ignore-scripts --save-exact`, copy the version and integrity of every package in the+// package-lock.json it writes, and download each tarball to hash it yourself.export const PINS = Object.freeze({+ '@bufbuild/protobuf': { version: '1.10.0', integrity: 'sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==' },+ '@connectrpc/connect': { version: '1.7.0', integrity: 'sha512-iNKdJRi69YP3mq6AePRT8F/HrxWCewrhxnLMNm0vpqXAR8biwzRtO6Hjx80C6UvtKJ5sFmffQT7I4Baecz389w==' },+ '@connectrpc/connect-web': { version: '1.7.0', integrity: 'sha512-qyP0YOnUPRWwCc/VfsoydMJvkb7EyUPr2q9sHgBuJzbADjiqck1gKH5V5ZPzPhTLBvmz5UvG+wiZ5sMRQHU1MQ==' },'@cursor/sdk': { version: '1.4.2', integrity: 'sha512-IMeIZtLvVX5w6rOS34bfBQt2b/WsMm+6lLU6vdlia0E6RuuXup+aVXyJrzvVAfnI7pK8bPPc7Gx1dvxy7ci+1Q==' },+ '@cursor/sdk-darwin-arm64': { version: '1.4.2', integrity: 'sha512-avM3SHrUOesNn6+8BCqcK1RbqmynWpjQt2mAajzBhjDK6k8HD6akpKjiZ1ufrL/dD09g9NVVtUSmYJmOYP5pXQ==' },+ '@cursor/sdk-darwin-x64': { version: '1.4.2', integrity: 'sha512-o2H4MtiLLRxSRuxJJoDzosRYE6gvMyEyrGfg8xN+0DQ3x1rgcZ+8q7wX/+ZRE6UYyW/eh6ryNTaY+sVFcQkY0A==' },+ '@cursor/sdk-linux-arm64': { version: '1.4.2', integrity: 'sha512-NQxAPiaUabDuM0UwgiFHYX2L8MW8bnX07eEMHpCbJrdBsWBHClTUhMfK0p+BXwzxZjDuA92MzN0bxvjToGPH7Q==' },+ '@cursor/sdk-linux-x64': { version: '1.4.2', integrity: 'sha512-9R9iG0sndf63Z9YlLWm1c7ve6McriP2OW71O2wkWleWn1BfYCxAXMY5Qi+OWLBLVNtwmClGUzaOiY873SxG41A==' },+ '@cursor/sdk-win32-x64': { version: '1.4.2', integrity: 'sha512-JBLJWDAAJOJFJrYZlYWnWWoyS7Eh9AZWXSOm/A7LX5wrGgeRJipIT2Y7yHbYJ2HgZQEletaywEkPpxPRJPdW5w==' },+ '@statsig/client-core': { version: '3.31.0', integrity: 'sha512-SuxQD6TmVszPG7FoMKwTk/uyBuVFk7XnxI3T/E0uyb7PL7GNjONtfsoh+NqBBVUJVse0CUeSFfgJPoZy1ZOslQ==' },+ '@statsig/js-client': { version: '3.31.0', integrity: 'sha512-LFa5E0LjT6sTfZv3sNGoyRLSZ1078+agdgOA+Vm1ecjG+KbSOfBLTW7hMwimrJ29slRwbYDzbtKaPJo/R37N2g==' },playwright: { version: '1.65.1', integrity: 'sha512-vJ1FuoOrNwOKHUIVEvSt3jT1L+wjjDpwhwIstKtfvTh8XIG4FG4bIFuvNdMxi81LGfAhUgUZleVFaOLY4RIUUw==' },'playwright-core': { version: '1.65.1', integrity: 'sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw==' },+ zod: { version: '4.6.7', integrity: 'sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==' },});// The argument for `npm install`: the package at its pinned version.export const pinned = (name) => `${name}@${PINS[name].version}`;+// What `npm install` is asked for, by name and at its pinned version. The SDK publishes ranges for some of its dependencies (`^1.6.1`, and `^3.25.0 || ^4.0.0` for+// its zod peer), so asking for the SDK alone would let npm pick a newer release than the one pinned here. The platform packages are left out on purpose: asked for by+// name they fail on every machine they do not fit, and npm installs the one that fits from the exact version the SDK lists. verifyPinned checks that one too.+export const INSTALLS = Object.freeze({+ playwright: ['playwright', 'playwright-core'],+ sdk: ['@cursor/sdk', '@bufbuild/protobuf', '@connectrpc/connect', '@connectrpc/connect-web', '@statsig/client-core', '@statsig/js-client', 'zod'],+});+const folderOf = (prefix, name) => path.join(prefix, 'node_modules', ...name.split('/'));const readJson = (file) => {@@ -52,20 +74,40 @@ function forget(prefix, names) {}}-// After `npm install --prefix <prefix> --ignore-scripts`, npm's own record of what it put in node_modules names each package's version and integrity hash. Every name-// given must be there with the pinned version and hash, in every record npm kept for it (a home folder behind a symbolic link makes npm write the same package under a-// longer key), and the folder on disk must say the pinned version. The install runs no package script, so nothing from a package that does not match has run yet.-// When one does not match, every name given is forgotten, so the package is never loaded or reinstalled, and the error says which one. A missing record fails too:-// the check does not pass on silence.+// The names a package asks npm for. A dependency that is optional, or a peer, and is not installed is not a gap: npm leaves out the platform packages that do not+// fit the machine. One that is installed is checked like the rest, and a required one that is missing is a failure.+const asked = (manifest) => ({+ required: Object.keys(manifest?.dependencies ?? {}),+ optional: [...Object.keys(manifest?.optionalDependencies ?? {}), ...Object.keys(manifest?.peerDependencies ?? {})],+});++// After `npm install --prefix <prefix> --ignore-scripts`, npm's own record of what it put in node_modules names each package's version and integrity hash. The+// names given and everything installed beneath them (their dependencies, their optional dependencies and their peers) must each be a package 100x pins, with the+// pinned version and hash, in every record npm kept for it (a home folder behind a symbolic link makes npm write the same package under a longer key), and the+// folder on disk must say the pinned version. The install runs no package script, so nothing from a package that does not match has run yet. When one does not+// match, all of them are forgotten, so none is loaded or reinstalled, and the error says which one. A missing record fails too: the check does not pass on silence.+// It returns the names it checked.export function verifyPinned(prefix, names) {const packages = readJson(path.join(prefix, 'node_modules', '.package-lock.json'))?.packages ?? {};- for (const name of names) {- const pin = PINS[name];+ const reached = new Map();+ const queue = names.map((name) => ({ name, optional: false }));+ while (queue.length) {+ const { name, optional } = queue.shift();+ if (reached.has(name)) continue;const records = Object.entries(packages).filter(([key]) => isPackageKey(key, name)).map(([, record]) => record);const onDisk = readJson(path.join(folderOf(prefix, name), 'package.json'));- if (records.length && records.every((r) => r.version === pin.version && r.integrity === pin.integrity) && onDisk?.version === pin.version) continue;- forget(prefix, names);+ if (optional && !records.length && !onDisk) continue;+ reached.set(name, { records, onDisk });+ const { required, optional: optionalNames } = asked(onDisk);+ queue.push(...required.map((dep) => ({ name: dep, optional: false })), ...optionalNames.map((dep) => ({ name: dep, optional: true })));+ }+ for (const [name, { records, onDisk }] of reached) {+ const pin = PINS[name];+ if (pin && records.length && records.every((r) => r.version === pin.version && r.integrity === pin.integrity) && onDisk?.version === pin.version) continue;+ forget(prefix, [...reached.keys()]);+ if (!pin) throw new CliError(`${name} is not a package 100x pins, so it was not trusted. It was removed, and nothing was run.`);const saw = records.length ? records.map((r) => `version ${r.version} with hash ${r.integrity ?? 'none'}`).join(' and ') : 'no record of it';throw new CliError(`${name} does not match what 100x pins (${pin.version}, ${pin.integrity}). npm wrote ${saw}${onDisk?.version === pin.version ? '' : `, and the folder says ${onDisk?.version ?? 'nothing'}`}. It was removed, and nothing was run.`);}+ return [...reached.keys()];}diff --git a/plugins/100x/README.md b/plugins/100x/README.mdindex 5cea161..5fe0b3d 100644--- a/plugins/100x/README.md+++ b/plugins/100x/README.md@@ -13,7 +13,7 @@ You need Claude Code, Node.js 22 or newer, and git. The skills also load in Clau```bashcurl -fsSLO https://github.com/DeadInternetStudios/100x-engineer-skill/releases/download/v0.1.1/100x-engineer-skill-0.1.1.tgz &&- echo "5875cfd8e41eec802e40633173df22e2c8f8fd980db3e54275bb47c00d972241 100x-engineer-skill-0.1.1.tgz" | shasum -a 256 -c - &&+ echo "1a745ddade5db30a413baafe8dc7e1ef91bc9b8c4486d8be220b047013257118 100x-engineer-skill-0.1.1.tgz" | shasum -a 256 -c - &&npm install -g ./100x-engineer-skill-0.1.1.tgz &&100x install```@@ -61,9 +61,9 @@ Only these reach the network, and only when you ask for them:- `100x browsers` downloads Playwright 1.65.1 and the Chromium build it names into `~/.100x`, from npm and Playwright's download servers. The version is fixed in the tool, and so is the npm integrity hash (SHA-512) of each package. The tool installs with package scripts off, so nothing from a package runs during the install. It checks the hash right after, and before it runs the browser download. If it differs, the tool deletes the package, including its entries in the prefix's manifest and lockfiles, and stops.- The live-data template `fresh-data-check.mjs` makes one GET request to the URL you give it, to read a timestamp. It sends no headers or body of yours, reads no credentials and runs only against the source your brief names.- A run deploys a **preview** when your project already has a deploy setup (Vercel, Netlify, Cloudflare Pages, Firebase or Fly). It uses the login that is already on your machine and never the production flag, unless your brief says "deploy to production" in words. It does not create accounts or paste tokens.-- On Cursor only, `100x helper setup`, `login` and `run` install `@cursor/sdk` 1.4.2 from npm, pinned the same way, and start helpers on your own Cursor account. You sign in once in the browser, or set `CURSOR_API_KEY` yourself. 100x never prints the key. The helper's task and what it reads go to Cursor. Claude Code users never need these.+- On Cursor only, `100x helper setup`, `login` and `run` install `@cursor/sdk` 1.4.2 from npm, with every package it needs pinned the same way, and start helpers on your own Cursor account. You sign in once in the browser, or set `CURSOR_API_KEY` yourself. 100x never prints the key. The helper's task and what it reads go to Cursor. Claude Code users never need these.-One setting is off until you turn it on. `review.command` lets you start the judge as a shell command, set only in your global config, and only when you ask for it. The example for Claude in `skills/100x/references/apps.md` runs `claude -p` with an allow rule (`--allowedTools`) that names what the judge may do: read the project, edit files under `.100x/`, run `100x shots` and `100x text lint`, run a few read-only `git` commands, and run the project's `npm test`, `npm run build` and `npm run lint`. Those three run the project's own scripts with your permissions, and a script can write outside `.100x/`, so use the command judge only on a project you wrote. The rule adds approvals to the ones in your own Claude settings, so a broader rule there still applies. With none, Claude refuses everything else, including the rest of `100x`. No example starts an app with its approvals off. The plugin never writes that setting itself, and it never changes Claude's permission settings.+One setting is off until you turn it on. `review.command` lets you start the judge as a shell command, set only in your global config, and only when you ask for it. The example for Claude in `skills/100x/references/apps.md` runs `claude -p` with an allow rule (`--allowedTools`) that names what the judge may do: read the project, edit files under `.100x/`, run `100x shots` and `100x text lint`, run a few read-only `git` commands, and run the project's `npm test`, `npm run build` and `npm run lint`. Those three run the project's own scripts with your permissions, and a script can write outside `.100x/`, so use the command judge only on a project you wrote. `Edit(.100x/**)` limits the judge's file tools, not these commands. The rule adds approvals to the ones in your own Claude settings, so a broader rule there still applies. With none, Claude refuses everything else, including the rest of `100x`. No example starts an app with its approvals off. The plugin never writes that setting itself, and it never changes Claude's permission settings.The `100x` tool has no analytics and no server of its own.diff --git a/plugins/100x/skills/100x/references/apps.md b/plugins/100x/skills/100x/references/apps.mdindex a18d1e8..fc63e0a 100644--- a/plugins/100x/skills/100x/references/apps.md+++ b/plugins/100x/skills/100x/references/apps.md@@ -48,9 +48,9 @@ Write the command and the model together. `100x config set review.command '<comm### claude-Flags read from `claude --help`, and run against `claude` 2.1.332 with `--setting-sources project`. It wrote a file under `.100x/` and refused one outside it. It ran 8 commands the rule names (`git status`, `git diff`, `git log`, `npm test`, `npm run build`, `100x text lint`, `100x shots`) and refused 8 it does not (`git push`, `git commit`, `100x doctor`, `100x install`, `100x browsers`, `npm run deploy`, `npm run build-and-ship`, `rm -rf`). A hook in the owner's own settings that rewrites shell commands can make a command miss its rule, and then the judge is refused it. No review has come back yet. The task goes before `--allowedTools`, which takes every word after it as a tool. With project settings only, `Edit(path)` rules limit where it writes, and they cover every tool that writes a file. The rule names the two `100x` tools the judge's task offers, `shots` and `text lint`, and nothing else of `100x`: `install`, `browsers`, `helper` and `upstream` write outside the project or use the network, so they are refused. It allows `npm run` for `build` and `lint` only, because any other project script can deploy. Those scripts and `npm test` still run the project's own code with the owner's permissions, and a script can write outside `.100x/`, so the limit on edits does not cover what they do.+Flags read from `claude --help`, and run against `claude` 2.1.332 with `--setting-sources project`. It wrote a file under `.100x/` and refused one outside it. It ran 8 commands the rule names (`git status`, `git diff`, `git log`, `npm test`, `npm run build`, `100x text lint`, `100x shots`) and refused 8 it does not (`git push`, `git commit`, `100x doctor`, `100x install`, `100x browsers`, `npm run deploy`, `npm run build-and-ship`, `rm -rf`). A hook in the owner's own settings that rewrites shell commands can make a command miss its rule, and then the judge is refused it. No review has come back yet. The task goes before `--allowedTools`, which takes every word after it as a tool. With `--setting-sources project`, `Edit(path)` rules limit where its file tools write. The rule names the two `100x` tools the judge's task offers, `shots` and `text lint`, and nothing else of `100x`: `install`, `browsers`, `helper` and `upstream` write outside the project or use the network, so they are refused. It allows `npm run` for `build` and `lint` only, because any other project script can deploy. The Bash commands the rule allows are not limited to `.100x/`. `git diff --output=<file>` writes where it is told, and `npm test` and the two scripts run the project's own code with the owner's permissions, which can write anywhere the owner can.-The rules add approvals to the ones in the owner's own settings. They do not take any away. To make the limits hold whatever those settings say, add `--setting-sources project` after the task. That also drops the owner's own hooks and deny rules for the judge, so add it only when the owner wants a judge with nothing but this rule.+The rules add approvals to the ones in the owner's own settings. They do not take any away. To keep the owner's user-level settings out of the judge, add `--setting-sources project` after the task. That also drops the owner's own hooks and deny rules for the judge, so add it only when the owner wants a judge with nothing but this rule. The project's own `.claude/settings.json` still loads, so the limits hold only when that file adds no allow rule broader than the listed commands.```shclaude -p "$X100_TASK" ${X100_MODEL:+--model "$X100_MODEL"} ${X100_EFFORT:+--effort "$X100_EFFORT"} --allowedTools "Read,Glob,Grep,Edit(.100x/**),Bash(100x shots *),Bash(100x text lint *),Bash(git status *),Bash(git diff *),Bash(git log *),Bash(npm test *),Bash(npm run build *),Bash(npm run lint *)"diff --git a/skills/100x/references/apps.md b/skills/100x/references/apps.mdindex a18d1e8..fc63e0a 100644--- a/skills/100x/references/apps.md+++ b/skills/100x/references/apps.md@@ -48,9 +48,9 @@ Write the command and the model together. `100x config set review.command '<comm### claude-Flags read from `claude --help`, and run against `claude` 2.1.332 with `--setting-sources project`. It wrote a file under `.100x/` and refused one outside it. It ran 8 commands the rule names (`git status`, `git diff`, `git log`, `npm test`, `npm run build`, `100x text lint`, `100x shots`) and refused 8 it does not (`git push`, `git commit`, `100x doctor`, `100x install`, `100x browsers`, `npm run deploy`, `npm run build-and-ship`, `rm -rf`). A hook in the owner's own settings that rewrites shell commands can make a command miss its rule, and then the judge is refused it. No review has come back yet. The task goes before `--allowedTools`, which takes every word after it as a tool. With project settings only, `Edit(path)` rules limit where it writes, and they cover every tool that writes a file. The rule names the two `100x` tools the judge's task offers, `shots` and `text lint`, and nothing else of `100x`: `install`, `browsers`, `helper` and `upstream` write outside the project or use the network, so they are refused. It allows `npm run` for `build` and `lint` only, because any other project script can deploy. Those scripts and `npm test` still run the project's own code with the owner's permissions, and a script can write outside `.100x/`, so the limit on edits does not cover what they do.+Flags read from `claude --help`, and run against `claude` 2.1.332 with `--setting-sources project`. It wrote a file under `.100x/` and refused one outside it. It ran 8 commands the rule names (`git status`, `git diff`, `git log`, `npm test`, `npm run build`, `100x text lint`, `100x shots`) and refused 8 it does not (`git push`, `git commit`, `100x doctor`, `100x install`, `100x browsers`, `npm run deploy`, `npm run build-and-ship`, `rm -rf`). A hook in the owner's own settings that rewrites shell commands can make a command miss its rule, and then the judge is refused it. No review has come back yet. The task goes before `--allowedTools`, which takes every word after it as a tool. With `--setting-sources project`, `Edit(path)` rules limit where its file tools write. The rule names the two `100x` tools the judge's task offers, `shots` and `text lint`, and nothing else of `100x`: `install`, `browsers`, `helper` and `upstream` write outside the project or use the network, so they are refused. It allows `npm run` for `build` and `lint` only, because any other project script can deploy. The Bash commands the rule allows are not limited to `.100x/`. `git diff --output=<file>` writes where it is told, and `npm test` and the two scripts run the project's own code with the owner's permissions, which can write anywhere the owner can.-The rules add approvals to the ones in the owner's own settings. They do not take any away. To make the limits hold whatever those settings say, add `--setting-sources project` after the task. That also drops the owner's own hooks and deny rules for the judge, so add it only when the owner wants a judge with nothing but this rule.+The rules add approvals to the ones in the owner's own settings. They do not take any away. To keep the owner's user-level settings out of the judge, add `--setting-sources project` after the task. That also drops the owner's own hooks and deny rules for the judge, so add it only when the owner wants a judge with nothing but this rule. The project's own `.claude/settings.json` still loads, so the limits hold only when that file adds no allow rule broader than the listed commands.```shclaude -p "$X100_TASK" ${X100_MODEL:+--model "$X100_MODEL"} ${X100_EFFORT:+--effort "$X100_EFFORT"} --allowedTools "Read,Glob,Grep,Edit(.100x/**),Bash(100x shots *),Bash(100x text lint *),Bash(git status *),Bash(git diff *),Bash(git log *),Bash(npm test *),Bash(npm run build *),Bash(npm run lint *)"diff --git a/test/browsers.test.mjs b/test/browsers.test.mjsindex d7a034f..0dd3aa3 100644--- a/test/browsers.test.mjs+++ b/test/browsers.test.mjs@@ -3,7 +3,7 @@ import fs from 'node:fs';import path from 'node:path';import test from 'node:test';import { chromiumBuilds, resolvePlaywright } from '../lib/playwright.mjs';-import { PINS } from '../lib/pins.mjs';+import { INSTALLS, PINS } from '../lib/pins.mjs';import { cli, sandbox } from './helpers.mjs';import { fakeBin } from './helpers.mjs';@@ -41,11 +41,12 @@ fs.writeFileSync(${JSON.stringify(path.join(box.dir, 'npm-args.json'))}, JSON.stconst pins = ${JSON.stringify(PINS)};const hash = ${JSON.stringify(hash)};const packages = {};-for (const arg of args.filter((a) => /^@?[a-z][a-z0-9/-]*@\\d/.test(a))) {+const named = args.filter((a) => /^@?[a-z][a-z0-9/-]*@\\d/.test(a));+for (const arg of named) {const name = arg.slice(0, arg.lastIndexOf('@'));const folder = path.join(prefix, 'node_modules', ...name.split('/'));fs.mkdirSync(folder, { recursive: true });- fs.writeFileSync(path.join(folder, 'package.json'), JSON.stringify({ name, version: arg.slice(arg.lastIndexOf('@') + 1) }));+ fs.writeFileSync(path.join(folder, 'package.json'), JSON.stringify({ name, version: arg.slice(arg.lastIndexOf('@') + 1), ...(name === '@cursor/sdk' ? { dependencies: Object.fromEntries(named.map((n) => n.slice(0, n.lastIndexOf('@'))).filter((n) => n !== name).map((n) => [n, '*'])) } : {}) }));packages['node_modules/' + name] = { version: arg.slice(arg.lastIndexOf('@') + 1), integrity: hash[name] ?? pins[name]?.integrity };}fs.mkdirSync(path.join(prefix, 'node_modules'), { recursive: true });@@ -98,9 +99,10 @@ test('helper setup asks npm for the pinned SDK version, checks its hash, and sayconst result = cli(['helper', 'setup'], { cwd: box.project, env: { ...fakeInstallers(box), X100_CURSOR_SDK_FROM: '' } });assert.equal(result.code, 0, result.err);const args = JSON.parse(fs.readFileSync(path.join(box.dir, 'npm-args.json'), 'utf8'));- assert.ok(args.includes(`@cursor/sdk@${PINS['@cursor/sdk'].version}`) && args.includes('--save-exact'), args.join(' '));- assert.ok(args.includes('--ignore-scripts'), 'no package script runs before the hash is checked');- assert.match(result.out, /its hash matches the one pinned in 100x/);+ assert.ok(args.includes('--save-exact') && args.includes('--ignore-scripts'), args.join(' '));+ for (const name of INSTALLS.sdk) assert.ok(args.includes(`${name}@${PINS[name].version}`), `${name} is asked for at its pinned version, so a range the SDK publishes cannot pick another`);+ assert.ok(!args.some((a) => a.startsWith('@cursor/sdk-')), 'the platform packages come from the SDK, and are checked after');+ assert.match(result.out, new RegExp(`It and the ${INSTALLS.sdk.length - 1} packages it needs match the hashes pinned in 100x`));box.cleanup();});@@ -124,3 +126,16 @@ test('a failed install shows the end of what the installer said', () => {assert.doesNotMatch(result.err, /\|progress\| 0% of/, 'only the last lines are shown');box.cleanup();});++test('helper setup refuses an SDK whose dependency has another hash, forgets the whole install and leaves Playwright alone', () => {+ const box = sandbox();+ const env = fakeInstallers(box, { hash: { zod: `sha512-${'D'.repeat(86)}==` } });+ assert.equal(cli(['browsers'], { cwd: box.project, env }).code, 0);+ const result = cli(['helper', 'setup'], { cwd: box.project, env: { ...env, X100_CURSOR_SDK_FROM: '' } });+ assert.equal(result.code, 1);+ assert.match(result.err, /zod does not match what 100x pins/);+ const modules = path.join(box.home, '.100x', 'node_modules');+ for (const name of ['@cursor/sdk', 'zod', '@statsig/js-client']) assert.ok(!fs.existsSync(path.join(modules, ...name.split('/'))), `${name} is gone`);+ assert.ok(fs.existsSync(path.join(modules, 'playwright')), 'Playwright, checked and fine, stays');+ box.cleanup();+});diff --git a/test/pins.test.mjs b/test/pins.test.mjsindex 8390874..b6c87d8 100644--- a/test/pins.test.mjs+++ b/test/pins.test.mjs@@ -3,16 +3,16 @@ import fs from 'node:fs';import os from 'node:os';import path from 'node:path';import test from 'node:test';-import { PINS, pinned, verifyPinned } from '../lib/pins.mjs';+import { INSTALLS, PINS, pinned, verifyPinned } from '../lib/pins.mjs';// What `npm install --prefix <dir>` leaves: each package's folder with its package.json, and the hidden record that names its version and integrity hash.-export function fakeInstall(prefix, names, { hash = {}, version = {}, keyPrefix = '', skipRecord = [], skipFolder = [], saved = false } = {}) {+export function fakeInstall(prefix, names, { hash = {}, version = {}, keyPrefix = '', skipRecord = [], skipFolder = [], saved = false, deps = {} } = {}) {const packages = {};for (const name of names) {const folder = path.join(prefix, 'node_modules', ...name.split('/'));if (!skipFolder.includes(name)) {fs.mkdirSync(folder, { recursive: true });- fs.writeFileSync(path.join(folder, 'package.json'), JSON.stringify({ name, version: version[name] ?? PINS[name].version }));+ fs.writeFileSync(path.join(folder, 'package.json'), JSON.stringify({ name, version: version[name] ?? PINS[name].version, ...deps[name] }));}if (!skipRecord.includes(name)) packages[`${keyPrefix}node_modules/${name}`] = { version: version[name] ?? PINS[name].version, integrity: hash[name] ?? PINS[name].integrity };}@@ -93,7 +93,7 @@ test('npm writes a longer key when the home folder is behind a symbolic link, an// there, and loaded without a check. The names have to leave those files too, and the packages that were not rejected have to stay in them.test('a rejected package is forgotten by the prefix manifest and both lockfiles, so npm cannot reinstall it, and the other packages stay', () => {const dir = tmp();- fakeInstall(dir, NAMES, { saved: true, hash: { playwright: `sha512-${'A'.repeat(86)}==` } });+ fakeInstall(dir, ['@cursor/sdk', 'playwright', 'playwright-core'], { saved: true, hash: { playwright: `sha512-${'A'.repeat(86)}==` } });assert.throws(() => verifyPinned(dir, ['playwright', 'playwright-core']), (error) => /^playwright does not match/.test(error.message));const read = (...parts) => JSON.parse(fs.readFileSync(path.join(dir, ...parts), 'utf8'));assert.deepEqual(Object.keys(read('package.json').dependencies), ['@cursor/sdk'], 'the manifest keeps only the SDK');@@ -116,3 +116,58 @@ test('a lockfile that cannot be read is deleted when a package is rejected, andassert.deepEqual(JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf8')).dependencies, {});fs.rmSync(dir, { recursive: true });});++// The SDK publishes ranges for some dependencies, ships its executables in five platform packages, and asks for a zod peer. All of it runs on the owner's machine, so+// the check covers the whole tree under the package it was asked for, not only that package.+const sdkTree = {+ '@cursor/sdk': {+ dependencies: { '@bufbuild/protobuf': '1.10.0', '@statsig/js-client': '3.31.0' },+ optionalDependencies: Object.fromEntries(Object.keys(PINS).filter((n) => n.startsWith('@cursor/sdk-')).map((n) => [n, '1.4.2'])),+ peerDependencies: { zod: '^3.25.0 || ^4.0.0' },+ },+ '@statsig/js-client': { dependencies: { '@statsig/client-core': '3.31.0' } },+};+const SDK_NAMES = ['@cursor/sdk', '@bufbuild/protobuf', '@statsig/js-client', '@statsig/client-core', 'zod', '@cursor/sdk-darwin-arm64'];++test('the whole tree under the SDK is checked: its dependencies, its peer and the one platform package that npm installed for this machine', () => {+ const dir = tmp();+ fakeInstall(dir, SDK_NAMES, { deps: sdkTree });+ assert.deepEqual(verifyPinned(dir, ['@cursor/sdk']).sort(), [...SDK_NAMES].sort(), 'the four platform packages that were not installed are not a gap');+ fs.rmSync(dir, { recursive: true });+});++test('a bad hash anywhere in the SDK tree refuses the SDK, and the whole tree is forgotten together', () => {+ for (const bad of ['@statsig/client-core', 'zod', '@cursor/sdk-darwin-arm64', '@bufbuild/protobuf']) {+ const dir = tmp();+ fakeInstall(dir, [...SDK_NAMES, 'playwright'], { deps: sdkTree, saved: true, hash: { [bad]: `sha512-${'E'.repeat(86)}==` } });+ assert.throws(() => verifyPinned(dir, ['@cursor/sdk']), (error) => error.message.startsWith(`${bad} does not match what 100x pins`), bad);+ for (const name of SDK_NAMES) assert.ok(!fs.existsSync(path.join(dir, 'node_modules', ...name.split('/'))), `${name} is gone after ${bad} failed`);+ assert.ok(fs.existsSync(path.join(dir, 'node_modules', 'playwright')), 'a package outside the tree stays');+ const manifest = JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf8')).dependencies;+ assert.deepEqual(Object.keys(manifest), ['playwright'], `the manifest keeps only what was not refused (${bad})`);+ fs.rmSync(dir, { recursive: true });+ }+});++test('a package the SDK needs that 100x does not pin, and a required one that is missing, are both refused', () => {+ const stranger = tmp();+ fakeInstall(stranger, ['@cursor/sdk', 'zod'], { deps: { '@cursor/sdk': { dependencies: { 'left-pad': '1.3.0' } } } });+ fs.mkdirSync(path.join(stranger, 'node_modules', 'left-pad'), { recursive: true });+ fs.writeFileSync(path.join(stranger, 'node_modules', 'left-pad', 'package.json'), JSON.stringify({ name: 'left-pad', version: '1.3.0' }));+ assert.throws(() => verifyPinned(stranger, ['@cursor/sdk']), (error) => /^left-pad is not a package 100x pins/.test(error.message));+ assert.ok(!fs.existsSync(path.join(stranger, 'node_modules', '@cursor', 'sdk')), 'and the SDK that wanted it is gone');+ fs.rmSync(stranger, { recursive: true });+ const missing = tmp();+ fakeInstall(missing, ['@cursor/sdk'], { deps: { '@cursor/sdk': { dependencies: { zod: '^4' } } } });+ assert.throws(() => verifyPinned(missing, ['@cursor/sdk']), (error) => /^zod does not match what 100x pins.*no record of it/.test(error.message));+ fs.rmSync(missing, { recursive: true });+});++test('the install lists and the pin table agree: nothing is pinned that no install can reach, and every asked-for package is pinned', () => {+ const platform = Object.keys(PINS).filter((name) => name.startsWith('@cursor/sdk-'));+ assert.equal(platform.length, 5, 'five platform packages');+ assert.deepEqual([...INSTALLS.playwright, ...INSTALLS.sdk, ...platform].sort(), Object.keys(PINS).sort());+ for (const name of [...INSTALLS.playwright, ...INSTALLS.sdk]) assert.ok(PINS[name], `${name} is pinned`);+ for (const name of platform) assert.ok(!INSTALLS.sdk.includes(name), `${name} is not asked for by name, because it fails on a machine it does not fit`);+ assert.deepEqual(new Set(platform.map((name) => PINS[name].version)), new Set([PINS['@cursor/sdk'].version]), 'the platform packages are the SDK version');+});