| name | quality-fix |
| description | Use this skill when the user asks to fix linting errors, resolve pre-commit hook failures, fix TypeScript errors, fix Biome issues, or when the lefthook pre-commit check is blocking a commit. Trigger phrases: "fix lint errors", "lefthook fails", "pre-commit failed", "biome errors", "ts errors", "run check", "quality check", "npm run check", "validate project". |
Quality Fix
Resolves issues caught by the project's quality gate.
Quality Gate Pipeline
npm run check runs these tools in parallel:
- stylelint — CSS/SCSS linting
- tsc --noEmit — TypeScript type checking
- biome check --write — JS/TS linting + auto-format
- knip --production — dead code and unused exports/deps
- steiger ./src — FSD architectural boundary checks
This same pipeline runs on every git commit via Lefthook.
Step 1: Run the full check
npm run check
Read the output carefully — each tool reports separately.
Step 2: Fix by tool
Biome (TypeScript/JS linting + formatting)
Biome auto-fixes most issues:
npm run lint:fix
npm run lint:fix:unsafe
Common manual fixes:
- Unused import — delete the import line
- Unused variable — delete or prefix with
_ if intentional
any type — replace with a proper type or unknown
- Missing return type — add explicit return type annotation
TypeScript (tsc --noEmit)
npm run ts:check
Common fixes:
- Type mismatch — align types between caller and callee
- Missing property — add to interface or mark optional with
?
- Implicit
any — add explicit type annotation
Stylelint (CSS/SCSS)
npm run lint:style:fix
npm run lint:style
Knip (dead code / unused exports)
npm run knip
Knip reports:
- Unused exports — remove the export or add a consumer
- Unused files — delete the file or import it somewhere
- Unused dependencies — remove from
package.json
Do not suppress Knip errors with ignores unless the export is intentionally part of a public API.
Steiger (FSD boundaries)
npm run lint:fsd
FSD violations to fix:
- Cross-layer import — entity importing from feature → move logic or use a different pattern
- Cross-slice import — one feature directly importing from another feature → extract to shared or use events
See the refactor-fsd skill for refactoring guidance.
CRITICAL MAPPING: Use the right tool for the right error
| Error Type | Tool | What to do |
|---|
| "Forbidden cross-layer import" | Steiger (FSD) | Do NOT use Biome. You must manually move the file using refactor-fsd or change the import pattern. |
| "Unused export" or "Unresolved import" | Knip | Remove the dead code manually. |
| "Type X is not assignable to type Y" | TypeScript | Fix the interface/type manually. |
| "formatting, quotes, or simple unused variables" | Biome | Run npm run lint:fix. |
Common Pre-commit Failure Patterns
| Error | Fix |
|---|
import X is defined but never used | Delete the import |
variable is assigned but never used | Delete or use the variable |
Type 'X' is not assignable to type 'Y' | Fix the type mismatch |
Module '"@entities/foo"' has no exported member | Check index.ts exports |
Forbidden cross-layer import | Move code to the correct layer |
Unused export 'X' | Remove export or add a consumer |
Quick Full Fix Sequence
npm run lint:fix
npm run lint:style:fix
npm run ts:check
npm run check