100x is a skill by a former Cursor engineer that turns prompts into formally verified, production-ready code
Install without package scripts, forget a rejected package everywhere, and state what the allow rule covers
Dead Internet378ece333983
diff --git a/README.md b/README.mdindex eb0d442..1a25316 100644--- a/README.md+++ b/README.md@@ -313,24 +313,11 @@ You need Claude Code, Cursor or Codex, and Node.js 22 or newer.**1. Install the tool and the skills**-The tool comes from a release pinned to one version, and you check its checksum before anything runs. The checksum, and the commands for Windows, are in [docs/install.md](docs/install.md#install-a-pinned-release).+The tool comes from a release pinned to one version and one SHA-256. The commands that download it, check the checksum and only then install it are in [Install a pinned release](docs/install.md#install-a-pinned-release), for macOS, Linux and Windows. Run them. The last one, `100x install`, links the skills into your agent.-Choose one:+This page holds no install commands of its own. It is part of the release file, so it cannot carry that file's checksum, and a copy of the commands here would run without the check.-**npm**--```bash-curl -fsSLO https://github.com/DeadInternetStudios/100x-engineer-skill/releases/download/v0.1.1/100x-engineer-skill-0.1.1.tgz-shasum -a 256 100x-engineer-skill-0.1.1.tgz-npm install -g ./100x-engineer-skill-0.1.1.tgz-100x install-```--The `shasum` line must print the checksum in [docs/install.md](docs/install.md#install-a-pinned-release). If it prints another, stop.--**skills.sh**--Run the first three lines above, check the checksum the same way, then:+To get the skills through skills.sh, install the tool with those commands first, then run:```bashnpx skills add DeadInternetStudios/100x-engineer-skill --skill '*' -gdiff --git a/docs/install.md b/docs/install.mdindex 83732c3..dce40e2 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: `c7132d2898a4cd890cf1a73c564bc8e5005de2e894a3e6359e0f800e75af5401`+- SHA-256: `5875cfd8e41eec802e40633173df22e2c8f8fd980db3e54275bb47c00d972241`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 "c7132d2898a4cd890cf1a73c564bc8e5005de2e894a3e6359e0f800e75af5401 100x-engineer-skill-0.1.1.tgz" | shasum -a 256 -c - &&+echo "5875cfd8e41eec802e40633173df22e2c8f8fd980db3e54275bb47c00d972241 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 'c7132d2898a4cd890cf1a73c564bc8e5005de2e894a3e6359e0f800e75af5401') { npm install -g .\100x-engineer-skill-0.1.1.tgz; 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 '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.' }```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 checks the hash right after the install, before it runs a browser download or the helper. On a mismatch it deletes what it installed 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 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.### On Windowsdiff --git a/lib/commands/browsers.mjs b/lib/commands/browsers.mjsindex 5c0e344..dd30ffb 100644--- a/lib/commands/browsers.mjs+++ b/lib/commands/browsers.mjs@@ -43,7 +43,7 @@ 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', '--save-exact', pinned('playwright'), pinned('playwright-core')]);+ 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']);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']);diff --git a/lib/commands/helper.mjs b/lib/commands/helper.mjsindex d232f95..80a86b6 100644--- a/lib/commands/helper.mjs+++ b/lib/commands/helper.mjs@@ -166,7 +166,7 @@ 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', '--save-exact', pinned(SDK_PACKAGE)]);+ 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.`);return undefined;diff --git a/lib/pins.mjs b/lib/pins.mjsindex 43bdb48..627aa5c 100644--- a/lib/pins.mjs+++ b/lib/pins.mjs@@ -25,18 +25,46 @@ const readJson = (file) => {}};-// After `npm install --prefix <prefix>`, 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. When one does not, nothing the install wrote for these names stays, so a package that does not match is never-// loaded, and the error says which one. A missing record fails too: the check does not pass on silence.+const DEPENDENCY_SECTIONS = ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies'];+const isPackageKey = (key, name) => key === `node_modules/${name}` || key.endsWith(`/node_modules/${name}`);++// npm rebuilds node_modules from the prefix's package.json and the two lockfiles. A rejected package left in any of them comes back, from the saved lockfile+// entry, the next time something runs `npm install --prefix` in the same prefix. So the names go from the folder, the manifest and the lockfiles together.+// A lockfile that cannot be read is deleted: npm writes it again from package.json.+function forget(prefix, names) {+ for (const gone of names) fs.rmSync(folderOf(prefix, gone), { recursive: true, force: true });+ const manifest = path.join(prefix, 'package.json');+ const saved = readJson(manifest);+ if (saved) {+ for (const section of DEPENDENCY_SECTIONS) for (const gone of names) delete saved[section]?.[gone];+ fs.writeFileSync(manifest, `${JSON.stringify(saved, null, 2)}\n`);+ }+ for (const file of [path.join(prefix, 'package-lock.json'), path.join(prefix, 'node_modules', '.package-lock.json')]) {+ const lock = readJson(file);+ if (!lock) {+ fs.rmSync(file, { force: true });+ continue;+ }+ for (const key of Object.keys(lock.packages ?? {})) if (names.some((gone) => isPackageKey(key, gone))) delete lock.packages[key];+ for (const section of DEPENDENCY_SECTIONS) for (const gone of names) delete lock.packages?.['']?.[section]?.[gone];+ for (const gone of names) delete lock.dependencies?.[gone];+ fs.writeFileSync(file, `${JSON.stringify(lock, null, 2)}\n`);+ }+}++// 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.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 records = Object.entries(packages).filter(([key]) => key === `node_modules/${name}` || key.endsWith(`/node_modules/${name}`)).map(([, record]) => record);+ 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;- for (const gone of names) fs.rmSync(folderOf(prefix, gone), { recursive: true, force: true });+ forget(prefix, names);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.`);}diff --git a/plugins/100x/README.md b/plugins/100x/README.mdindex da9f113..5cea161 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 "c7132d2898a4cd890cf1a73c564bc8e5005de2e894a3e6359e0f800e75af5401 100x-engineer-skill-0.1.1.tgz" | shasum -a 256 -c - &&+ echo "5875cfd8e41eec802e40633173df22e2c8f8fd980db3e54275bb47c00d972241 100x-engineer-skill-0.1.1.tgz" | shasum -a 256 -c - &&npm install -g ./100x-engineer-skill-0.1.1.tgz &&100x install```@@ -58,12 +58,12 @@ What the skills tell Claude to do, all on your computer:Only these reach the network, and only when you ask for them:- Your model host sees the brief and the files Claude reads, as in any Claude session.-- `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 checks the hash after the install and before it runs the browser download. If it differs, the tool deletes what it installed and stops.+- `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.-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`. 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. 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 7f28cfa..a18d1e8 100644--- a/plugins/100x/skills/100x/references/apps.md+++ b/plugins/100x/skills/100x/references/apps.md@@ -42,13 +42,15 @@ Either way the log holds the start and the task id, so a resumed thread knows on## The judge as a command-When `review.command` is set, `100x review-run` starts it in the background. It is set only in the global config, because a shell command in a project file would run for anyone who opens that project. The command reads its settings from environment variables. `X100_MODEL`, `X100_EFFORT`, `X100_TASK`, plus `X100_OPT_<ID>` for every other option. Empty ones are left out by the `${VAR:+...}` form below. The judge runs unattended, so nothing can answer an approval prompt. No template starts an app with its approvals off. Each one names the commands the judge may run in an allow rule, and the app refuses everything else. The judge reads the project, writes its findings and screenshots under `.100x/`, runs `100x`, and starts the project with its own run command. Add that run command to the allow rule when it is not `npm run` or `npm test`. The judge still runs the owner's project code with the owner's permissions on the owner's machine. Use it on projects the owner wrote. For a project the owner cloned or was sent, judge through the app's own subagent tool instead, because that project's files are part of what the judge reads.+When `review.command` is set, `100x review-run` starts it in the background. It is set only in the global config, because a shell command in a project file would run for anyone who opens that project. The command reads its settings from environment variables. `X100_MODEL`, `X100_EFFORT`, `X100_TASK`, plus `X100_OPT_<ID>` for every other option. Empty ones are left out by the `${VAR:+...}` form below. The judge runs unattended, so nothing can answer an approval prompt. No template starts an app with its approvals off. Each one names the commands the judge may run in an allow rule, and, when the owner's own settings add no broader allow rule, the app refuses everything else. The judge reads the project, writes its findings and screenshots under `.100x/`, runs `100x shots` and `100x text lint`, and starts the project with its own run command. The rule covers only the test, build and lint scripts, so add the project's run command to it, spelled out: `Bash(npm run dev *)` for `npm run dev`. The judge still runs the owner's project code with the owner's permissions on the owner's machine. Use it on projects the owner wrote. For a project the owner cloned or was sent, judge through the app's own subagent tool instead, because that project's files are part of what the judge reads.Write the command and the model together. `100x config set review.command '<command>' --global` and `100x config role review --model <id> [--option effort=<level>] --global`. A command wins over the app's own subagent tool, so a person who uses two apps clears it in one of them with `100x config unset review.command --global`.### claude-Flags read from `claude --help`, and run against `claude` 2.1.332. With project settings only, 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. 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 stay out of reach. It allows `npm run` for `build` and `lint` only, because any other project script can deploy.+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.++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.```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 7f28cfa..a18d1e8 100644--- a/skills/100x/references/apps.md+++ b/skills/100x/references/apps.md@@ -42,13 +42,15 @@ Either way the log holds the start and the task id, so a resumed thread knows on## The judge as a command-When `review.command` is set, `100x review-run` starts it in the background. It is set only in the global config, because a shell command in a project file would run for anyone who opens that project. The command reads its settings from environment variables. `X100_MODEL`, `X100_EFFORT`, `X100_TASK`, plus `X100_OPT_<ID>` for every other option. Empty ones are left out by the `${VAR:+...}` form below. The judge runs unattended, so nothing can answer an approval prompt. No template starts an app with its approvals off. Each one names the commands the judge may run in an allow rule, and the app refuses everything else. The judge reads the project, writes its findings and screenshots under `.100x/`, runs `100x`, and starts the project with its own run command. Add that run command to the allow rule when it is not `npm run` or `npm test`. The judge still runs the owner's project code with the owner's permissions on the owner's machine. Use it on projects the owner wrote. For a project the owner cloned or was sent, judge through the app's own subagent tool instead, because that project's files are part of what the judge reads.+When `review.command` is set, `100x review-run` starts it in the background. It is set only in the global config, because a shell command in a project file would run for anyone who opens that project. The command reads its settings from environment variables. `X100_MODEL`, `X100_EFFORT`, `X100_TASK`, plus `X100_OPT_<ID>` for every other option. Empty ones are left out by the `${VAR:+...}` form below. The judge runs unattended, so nothing can answer an approval prompt. No template starts an app with its approvals off. Each one names the commands the judge may run in an allow rule, and, when the owner's own settings add no broader allow rule, the app refuses everything else. The judge reads the project, writes its findings and screenshots under `.100x/`, runs `100x shots` and `100x text lint`, and starts the project with its own run command. The rule covers only the test, build and lint scripts, so add the project's run command to it, spelled out: `Bash(npm run dev *)` for `npm run dev`. The judge still runs the owner's project code with the owner's permissions on the owner's machine. Use it on projects the owner wrote. For a project the owner cloned or was sent, judge through the app's own subagent tool instead, because that project's files are part of what the judge reads.Write the command and the model together. `100x config set review.command '<command>' --global` and `100x config role review --model <id> [--option effort=<level>] --global`. A command wins over the app's own subagent tool, so a person who uses two apps clears it in one of them with `100x config unset review.command --global`.### claude-Flags read from `claude --help`, and run against `claude` 2.1.332. With project settings only, 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. 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 stay out of reach. It allows `npm run` for `build` and `lint` only, because any other project script can deploy.+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.++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.```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 f3a2790..d7a034f 100644--- a/test/browsers.test.mjs+++ b/test/browsers.test.mjs@@ -78,6 +78,7 @@ test('browsers asks npm for the pinned version of Playwright and its core, neverconst args = JSON.parse(fs.readFileSync(path.join(box.dir, 'npm-args.json'), 'utf8'));assert.ok(args.includes(`playwright@${PINS.playwright.version}`) && args.includes(`playwright-core@${PINS['playwright-core'].version}`), args.join(' '));assert.ok(args.includes('--save-exact'));+ assert.ok(args.includes('--ignore-scripts'), 'no package script runs before the hash is checked');assert.ok(!args.includes('playwright'), 'a bare package name would take whatever is newest');box.cleanup();});@@ -98,6 +99,7 @@ test('helper setup asks npm for the pinned SDK version, checks its hash, and sayassert.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/);box.cleanup();});diff --git a/test/install-pin.test.mjs b/test/install-pin.test.mjsindex 9e3706c..db2f41b 100644--- a/test/install-pin.test.mjs+++ b/test/install-pin.test.mjs@@ -37,15 +37,26 @@ test('the plugin README and the install page carry the same checksum, in the shaassert.equal(read(INSTALL_PAGE).split(plugin[0]).length - 1, 3, 'the page lists it once, then uses it in the shell command and in the PowerShell command');});-test('the root README cannot hold the checksum of a tarball it is packed into, so it sends the reader to the install page', () => {+// The root README is inside the release file, so it cannot carry that file's checksum. A copy of the commands without it would run without the check, which a reader+// who pastes the whole block cannot tell apart from the real thing. So the README holds no command that fetches or installs the tool, and links to the one that does.+test('the root README holds no command that downloads or installs the tool, and links to the install page that does the check', () => {const readme = read('README.md');assert.deepEqual(readme.match(SHA256) ?? [], [], 'no 64-hex string in the packed README');- assert.ok(readme.includes(URL), 'it downloads the pinned release');- assert.ok(readme.includes(`shasum -a 256 ${FILE}`), 'it prints the checksum for the reader to compare');+ assert.doesNotMatch(readme, /\bcurl\b|npm (install|i|add) -g|releases\/download/, 'no download or global install in the README');assert.ok(readme.includes('docs/install.md#install-a-pinned-release'), 'it links to the page that has the checksum');assert.match(read(INSTALL_PAGE), /^### Install a pinned release$/m, 'and that link lands on a heading');});+test('the install page does not go on to install when the checksum or npm fails', () => {+ const page = read(INSTALL_PAGE);+ const bash = page.split('\n').filter((line) => line.includes(FILE) || line.startsWith('100x install'));+ const chain = bash.slice(0, 4);+ assert.deepEqual(chain.map((line) => line.trimEnd().endsWith('&&') || line === '100x install'), [true, true, true, true], 'every shell line stops the chain when it fails');+ const powershell = page.split('\n').find((line) => line.startsWith('if ((Get-FileHash'));+ assert.ok(powershell?.includes('if ($LASTEXITCODE -eq 0) { 100x install }'), 'PowerShell runs 100x install only after npm exits 0');+ assert.ok(page.includes('`--ignore-scripts`'), 'the page says the pinned installs run no package script');+});+test('no step in the plugin folder or the install docs installs code from a branch, a bare name or a latest tag', () => {const under = (dir) => listFiles(path.join(ROOT, dir)).map((rel) => `${dir}/${rel}`);const files = [...under(PLUGIN_DIR), ...under('skills'), 'README.md', INSTALL_PAGE];diff --git a/test/pins.test.mjs b/test/pins.test.mjsindex 4b2fd73..8390874 100644--- a/test/pins.test.mjs+++ b/test/pins.test.mjs@@ -6,7 +6,7 @@ import test from 'node:test';import { 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 = [] } = {}) {+export function fakeInstall(prefix, names, { hash = {}, version = {}, keyPrefix = '', skipRecord = [], skipFolder = [], saved = false } = {}) {const packages = {};for (const name of names) {const folder = path.join(prefix, 'node_modules', ...name.split('/'));@@ -18,6 +18,11 @@ export function fakeInstall(prefix, names, { hash = {}, version = {}, keyPrefix}fs.mkdirSync(path.join(prefix, 'node_modules'), { recursive: true });fs.writeFileSync(path.join(prefix, 'node_modules', '.package-lock.json'), JSON.stringify({ name: 'x', lockfileVersion: 3, packages }));+ if (!saved) return;+ // With `--save-exact`, npm also writes the packages into the prefix's own package.json and package-lock.json, and later installs rebuild from those.+ const dependencies = Object.fromEntries(names.map((name) => [name, PINS[name].version]));+ fs.writeFileSync(path.join(prefix, 'package.json'), JSON.stringify({ name: 'x', private: true, dependencies }));+ fs.writeFileSync(path.join(prefix, 'package-lock.json'), JSON.stringify({ name: 'x', lockfileVersion: 3, packages: { '': { name: 'x', dependencies }, ...packages } }));}const NAMES = Object.keys(PINS);@@ -83,3 +88,31 @@ test('npm writes a longer key when the home folder is behind a symbolic link, anassert.throws(() => verifyPinned(bad, ['playwright']), /does not match what 100x pins/);fs.rmSync(bad, { recursive: true });});++// npm rebuilds node_modules from the prefix's own package.json and lockfiles, so a rejected package that stays in them is reinstalled by the next `npm install --prefix`+// 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)}==` } });+ 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');+ for (const lock of [read('package-lock.json'), read('node_modules', '.package-lock.json')]) {+ assert.deepEqual(Object.keys(lock.packages).filter(Boolean), ['node_modules/@cursor/sdk'], 'a lockfile keeps only the SDK');+ assert.deepEqual(Object.keys(lock.packages['']?.dependencies ?? { '@cursor/sdk': 1 }), ['@cursor/sdk'], 'and the root entry lists only the SDK');+ }+ assert.ok(fs.existsSync(path.join(dir, 'node_modules', '@cursor', 'sdk', 'package.json')), 'the SDK folder stays');+ fs.rmSync(dir, { recursive: true });+});++test('a lockfile that cannot be read is deleted when a package is rejected, and one that lists the package under a longer key is cleaned too', () => {+ const dir = tmp();+ fakeInstall(dir, ['playwright', 'playwright-core'], { saved: true, keyPrefix: '../../../private/var/x/', hash: { 'playwright-core': `sha512-${'C'.repeat(86)}==` } });+ fs.writeFileSync(path.join(dir, 'package-lock.json'), '{ not json');+ assert.throws(() => verifyPinned(dir, ['playwright', 'playwright-core']), (error) => /^playwright-core does not match/.test(error.message));+ assert.ok(!fs.existsSync(path.join(dir, 'package-lock.json')), 'the broken lockfile is gone, and npm writes a new one from the manifest');+ const hidden = JSON.parse(fs.readFileSync(path.join(dir, 'node_modules', '.package-lock.json'), 'utf8'));+ assert.deepEqual(Object.keys(hidden.packages), [], 'the longer keys are removed too');+ assert.deepEqual(JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf8')).dependencies, {});+ fs.rmSync(dir, { recursive: true });+});