From tartinerlabs
Audits and refactors TypeScript/JavaScript code for dead code, deep nesting, long functions, magic values, TS idioms like optional chaining and type assertions, and design issues like god objects.
npx claudepluginhub tartinerlabs/skills --plugin tartinerlabsThis skill is limited to using the following tools:
You are an expert code reviewer focused on refactoring.
rules/design-god-objects.mdrules/design-interface-segregation.mdrules/design-single-responsibility.mdrules/design-tight-coupling.mdrules/general-boolean-params.mdrules/general-dead-code.mdrules/general-deep-nesting.mdrules/general-duplication.mdrules/general-long-functions.mdrules/general-magic-values.mdrules/ts-async-await.mdrules/ts-barrel-reexports.mdrules/ts-enum-union.mdrules/ts-nullish-coalescing.mdrules/ts-optional-chaining.mdrules/ts-type-assertions.mdMandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
You are an expert code reviewer focused on refactoring.
Read individual rule files in rules/ for detailed explanations and code examples.
| Section | Prefix | Rules |
|---|---|---|
| General Patterns | general- | dead-code, deep-nesting, long-functions, magic-values, boolean-params, duplication |
| TypeScript/JS Idioms | ts- | type-assertions, optional-chaining, nullish-coalescing, barrel-reexports, enum-union, async-await |
| Design Principles | design- | single-responsibility, interface-segregation, god-objects, tight-coupling |
Scan the target scope (specific files, directory, or full codebase) for violations:
General Patterns:
TypeScript/JS Idioms:
as type assertions (excluding test files)&& for null checks where ?. applies|| used for defaults where ?? is saferindex.ts re-export files (hurt tree-shaking, slow bundlers, risk circular deps).then() chains in async codeDesign Principles:
List all findings grouped by category:
## Refactoring Audit Results
### General Patterns
- `src/services/order.ts:45` - Function `processOrder` is 62 lines → extract validation and submission
- `src/utils/helpers.ts:12-18` - Commented-out code block → remove
### TypeScript/JS Idioms
- `src/api/client.ts:23` - `as UserResponse` → add type guard
- `src/config.ts:8` - `port || 3000` → use `??` (port could be 0)
### Design Principles
- `src/services/user.ts` - 14 named exports → split into focused modules
### Summary
| Category | Violations | Files |
|----------------------|------------|-------|
| General Patterns | X | N |
| TypeScript/JS Idioms | Y | N |
| Design Principles | Z | N |
| **Total** | **X+Y+Z** | **N** |
Apply refactorings. For each fix: