add-api-route
Add a new JobPilot API route or module the standard way - contracts schema, controller, service, response schema, optional web hook. Use for "add an endpoint",…
Add knip to a TypeScript project and use it to remove dead exports, collapse pass-through barrels, and narrow every export to what another file actually imports. Trigger on "add knip", "set up knip", "find dead code", "remove unused exports", "clean up barrel files", "get rid of
$ npx -y skills add suxrobGM/jobpilot --skill knip-cleanup --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/knip-cleanupContext preview
The summary Claude sees to decide when to auto-load this skill.
Add knip to a TypeScript project and use it to remove dead exports, collapse pass-through barrels, and narrow every export to what another file actually imports. Trigger on "add knip", "set up knip", "find dead code", "remove unused exports", "clean up barrel files", "get rid of
name: knip-cleanup description: Add knip to a TypeScript project and use it to remove dead exports, collapse pass-through barrels, and narrow every export to what another file actually imports. Trigger on "add knip", "set up knip", "find dead code", "remove unused exports", "clean up barrel files", "get rid of export *", "why is this exported". metadata: version: "1.0"
Four phases, each one committed and verified on its own. Later phases depend on earlier ones: every deletion exposes another layer of dead code, so knip is re-run between them rather than once at the start.
Do not start at phase 3. A knip baseline full of false positives will delete something real.
If the user also reports line-ending churn on every format, check before changing anything:
git ls-files --eol | awk '{print $1, $2}' | sort | uniq -c | sort -rn | head
<formatter> --check . # biome check . / prettier --check .`i/lf w/lf` across the board with a clean formatter run means the tracked tree is already normalized and the churn is in **newly created** files. The fix is prevention, not renormalizing: `.editorconfig` with `end_of_line = lf`, the editor's own EOL setting (`"files.eol": "\n"` for VS Code), and `git config core.autocrlf false` locally. Renormalizing a tree that is already LF produces a huge no-op diff and fixes nothing.
Install knip at the **repo root**, one config, one script. In a monorepo never give each package its own config: a per-workspace run cannot see that another workspace imports the symbol, so every shared export reads as dead.
{
"$schema": "https://unpkg.com/knip@<major>/schema.json",
"tags": ["-knipignore"],
"workspaces": {
"packages/lib": {
"entry": ["src/index.ts", "src/**/*.test.ts"],
"project": ["src/**/*.ts"],
"includeEntryExports": true,
"ignoreExportsUsedInFile": true
}
}
}Then iterate until the report contains **only real findings**. Expect these, in this order:
`--outfile`, `--entry`, `bun build`, `esbuild`. A second binary built from `src/worker.ts` is invisible to knip and its whole dependency tree reports as unused.
loader. Disable that plugin (`"prisma": false`) rather than faking the variable.
`"./utils/*": "./src/utils/*.ts"` makes *every file* an entry, and knip then reports nothing at all for that package. Verify by adding a deliberately unused export and confirming knip sees it — silence is the failure mode here, so it will not announce itself.
go in `ignoreDependencies`. Check each one is genuinely reached before ignoring it.
drift guard has no runtime caller by design. Tag it `@knipignore` (with `"tags": ["-knipignore"]` in the config) and say in a comment what it guards. Deleting it silently removes a check.
Commit the config and the script separately from any deletion.
Pure subtraction, no import churn, so it lands cleanly and reviews easily.
Cross-check every finding against a repo-wide grep before deleting. `files=1 refs=1` (the declaration is the only occurrence) is safe. More than that needs a look, and the reasons split into four:
| What grep shows | What it means | What to do | | --- | --- | --- | | Only the declaration | Truly dead | Delete | | A same-named declaration in another workspace | Duplicate, this copy is dead | Delete this one | | Hits only in a barrel's re-export line | The forwarding line is dead, not the symbol | Handle in phase 3 | | Hits in a comment | Not a reference | Delete |
Then delete, and **re-run knip after deleting**: removing a function usually orphans the data tables and helper types it used, which were invisible while it existed.
Two traps when automating the deletion:
(`export const x = new Builder().use(a).derive(b)`) — the balance returns to zero mid-chain. Verify with a lint run and hand-edit the mangled file rather than tuning the heuristic.
(`biome check --write --unsafe`, `eslint --fix`) on the touched files, then read what it could not fix.
State the rule before writing any code, because it decides the size of the diff. A barrel stays only when **it aggregates more than one file and has more than one importer outside its own directory**. Everything else is indirection: `export *`, single-file forwarders, and barrels with one caller.
Classify first and show the counts — the split is usually lopsided and tells you where the real work is. In one monorepo it was 168 barrels: 74 `export *`, 75 named, 18 with real code; after the rule, all 45 survivors were frontend component aggregators and the backend kept none.
Two barrels must never be deleted:
`"./utils": "./src/utils/index.ts"` breaks every consumer, and **typecheck inside that package still passes** — the break only shows up in the packages that import it. `export *` is defensible in exactly this position, since the subpath is the unit of API.
at the concrete files first, then drop the c
An AI agent that applies to jobs for you, on the Claude or Codex subscription you already have.
Repo: suxrobGM/jobpilot
Add a new JobPilot API route or module the standard way - contracts schema, controller, service, response schema, optional web hook. Use for "add an endpoint",…
Review and clean up the given file(s)/folder(s)/module(s): rate organization, find dead code, duplication, coupling, over-engineering, deep nesting, structural…
Create and apply a Prisma migration safely against the remote (tunneled) PostgreSQL. Use for schema changes - "create a migration", "apply migrations", "add a…
Bump the unified JobPilot version (host + plugin), update the changelog, commit, and tag a new release
Rebuild the .NET terminal host, restart it, and wait for /healthz. Use after any C# change under apps/terminal, or when asked to "restart the terminal host".
Migrate a React @tanstack/react-form codebase from the prop-drilled `useForm` + erased-form-type pattern to the official `createFormHook` composition API…