Per-language probe order for finding test, typecheck, and build commands. The goal is zero guessing: read the manifest, prefer scripts the project already defines, never invent.
- Read manifest files first; only fall back to convention if the manifest is silent.
- If the project defines a script with the name
test,typecheck,lint, orbuild, prefer it. The project's own script encodes its assumptions (env vars, glob patterns, parallelism). - If two managers seem to coexist (e.g. both
package-lock.jsonandpnpm-lock.yaml), ask the user which is canonical. Do not pick by mtime. - If a gate genuinely doesn't exist for this repo (no tests, no typechecker, no build step), confirm with the user before continuing. Skipped gates must be recorded in
slop-applied.md.
Manifest: package.json. Package manager from lockfile:
| Lockfile | Manager | Run prefix |
|---|---|---|
pnpm-lock.yaml |
pnpm | pnpm |
yarn.lock |
yarn | yarn |
bun.lockb |
bun | bun run |
package-lock.json (only) |
npm | npm run |
Resolution order for each gate:
- test:
scripts.test→ elsevitest runifvitestis a dep → elsejestifjestis a dep → else ask. - typecheck:
scripts.typecheck→ elsescripts.tsc→ elsetsc --noEmitiftypescriptis a dep → else none (JS-only project). - build:
scripts.build→ else none (library/script projects often have no build). - lint (informational, not a gate):
scripts.lint→ elseeslint .if eslint configured.
Manifest: pyproject.toml (preferred), else setup.py, else requirements.txt.
Runner detection:
pyproject.tomlwith[tool.poetry]→poetry runpyproject.tomlwith[tool.pdm]→pdm runpyproject.tomlwith[tool.hatch]→hatch runuv.lockpresent →uv run- Else → bare command (assume active venv)
Gate defaults:
- test:
pytest(the overwhelming default). If a[tool.pytest.ini_options]block exists, that's confirmation. - typecheck:
mypy .ifmypy.inior[tool.mypy]present → elsepyrightifpyrightconfig.jsonpresent → else none. - build:
python -m buildif the project is a distributable package (haspyproject.tomlwith[build-system]) → else none (apps and scripts often have no build).
Manifest: Cargo.toml.
- test:
cargo test - typecheck:
cargo check - build:
cargo build
No probing needed; these are universal.
Manifest: go.mod.
- test:
go test ./... - typecheck:
go vet ./...(closest equivalent) - build:
go build ./...
Manifest: Gemfile.
- test:
bundle exec rspecifspec/exists → elsebundle exec rake testiftest/exists → else ask. - typecheck:
bundle exec srb tcif Sorbet is in the Gemfile → else none. - build:
bundle exec rake buildif it's a gem (*.gemspecpresent) → else none.
Manifests: pom.xml (Maven), build.gradle[.kts] (Gradle).
- Maven: test
mvn test, typecheck folded intomvn compile, buildmvn package. - Gradle: test
./gradlew test, typecheck./gradlew compileJava(orcompileKotlin), build./gradlew build.
If the root has both package.json and pyproject.toml (or similar), ask which subtree the audit should cover. Running gates across a whole monorepo is usually wrong — the safety contract wants fast, scoped runs.
Suggested approach: scope to one workspace package or one Python subpackage at a time. The user can run humanize-code multiple times for different scopes.
If no manifest matches: ask the user how they run tests, typecheck, and build for this repo. Record their answers in slop-applied.md under a "Manual gate configuration" heading so the run is reproducible.
If the user confirms a gate genuinely doesn't exist:
- No tests at all → restrict to T1 changes only (per SKILL.md Hard Rule 6).
- No typecheck → proceed; many languages don't have one.
- No build → proceed; many projects don't have one.