Pnpm workspace filter
Skill samelie/claude-plugin-pnpm/skills/pnpm-workspace-filter
Run lint, types, test, or knip on changed pnpm workspace packages and fix errors. Triggers: lint, eslint, lint:fix, formatting, unused imports, types, typecheck, type error, tsc, test, vitest, jest, test failure, knip, unused exports, unused dependencies, dead code.From its SKILL.md
npx -y skills add samelie/claude-plugin-pnpm --skill pnpm-workspace-filterAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.2 KB, as published. Nobody here has run it
pnpm-workspace-filter
Run a pnpm script on changed workspace packages and fix errors.
Package Resolution
git diff --name-only HEAD+--cached+git ls-files --others --exclude-standard- For each changed file, walk up to nearest
package.json - Read the
namefield from each uniquepackage.json - Run the target command for each
- If no changed files and no args provided, ask user which package
Commands
| Target | Script | Command |
|---|---|---|
lint | lint:fix | pnpm -F "<name>" lint:fix |
types | types | pnpm -F "<name>" types |
test | test | pnpm -F "<name>" test |
knip | knip | pnpm -F "<name>" knip |
Determine target from user input or caller context. Default to lint if ambiguous.
Fix Strategy: lint
- Remove unused imports/variables/code entirely — no dead code
- Fix root cause >
eslint-disablecomments - Import ordering: built-in > external > internal > parent > sibling > index > object > type
- Sort members alphabetically within groups
- Prefix genuinely-needed-but-unused params with
_ - Never suppress warnings without clear justification
Fix Strategy: types
- Root-cause first — understand data flow before touching types
- Never
any(useunknownonly if truly necessary) - Avoid
ascasts; use type guards + discriminated unions - Use utility types:
Partial,Pick,Omit,Record - Functional TS: no classes, no enums ->
as constPOJOs, union types - Don't create redundant/duplicate types; find existing ones first
- No
@ts-ignore/@ts-expect-errorwithout explanation
Fix Strategy: test
- Understand failure root cause before fixing
- Fix the implementation, not the test (unless test expectation is wrong)
- Never weaken assertions to make tests pass
- Never add mock/stub data outside test files
- If test is outdated/wrong, fix the test but document why
Fix Strategy: knip
Pre-Fix Step
BEFORE any fixes, read the workspace's knip.config.ts (understand existing ignores).
Fixing
- Categorize each finding: real unused vs false positive
- Real unused -> delete exports, files, dependencies entirely
- False positive -> add to
ignoreDependencies/ignore/ignoreUnresolvedwith WHY comment in knip config - Common FP patterns: build tool entries (unbuild/tsup), CLI deps, framework globals (
vitest/globals), Prisma/codegen, platform-conditional code, monorepo internal deps - If many FPs -> likely misconfigured entry points; check framework detectors
- Never ignore without justification comment
Iteration
Run -> fix -> re-run until clean (0 errors / green tests).
Critical Rules
- Never add eslint-disable / @ts-ignore without justification
- Investigate before deleting
- No
any, no classes (types target) - No weakened assertions, no stubs in non-test code (test target)
- Leave changes uncommitted for caller to review