Automates quality checks (typecheck, lint, tests, build) and blocks commits that don't pass. Use before any commit to validate code quality.
This skill automates quality checks:
bun run typecheck
# or
bunx tsc --noEmit
bun run lint
# or
bunx eslint . --ext .ts,.tsx
bun run build
bun run test
# or
bunx vitest run
bun run test:e2e
# or
bunx playwright test
bun run typecheck && bun run lint && bun run test && bun run test:e2e && bun run build
1. TYPECHECK → If fail: STOP and list errors
↓
2. LINT → If fail: STOP and list errors
↓
3. UNIT TESTS → If fail: STOP and list failures
↓
4. E2E TESTS → If fail: STOP and list failures
↓
5. BUILD → If fail: STOP and list errors
↓
RESULT: ✅ APPROVED or ❌ REJECTED
// ERROR
const value: string = 123;
// FIX
const value: number = 123;
// ERROR
const name = user.name.toUpperCase();
// FIX
const name = user?.name?.toUpperCase() ?? '';
// ERROR
const age = user.age; // age doesn't exist
// FIX
interface User {
name: string;
age?: number;
}
// ERROR
function parse(data: any) {}
// FIX
function parse(data: unknown) {}
// ERROR
const unused = 'value';
// FIX - remove or prefix with _
const _unused = 'value';
// ERROR
useEffect(() => {
fetchData(userId);
}, []); // missing userId
// FIX
useEffect(() => {
fetchData(userId);
}, [userId]);
## QUALITY GATE - APPROVED
### Checks Executed
| Check | Status | Time |
| ---------- | ------------- | ----- |
| TypeScript | ✅ Pass | 3.2s |
| ESLint | ✅ Pass | 5.1s |
| Unit Tests | ✅ 42/42 Pass | 8.3s |
| E2E Tests | ✅ 15/15 Pass | 45.2s |
| Build | ✅ Pass | 32.1s |
**STATUS: APPROVED** - Ready to commit
## QUALITY GATE - REJECTED
### Checks Executed
| Check | Status |
| ---------- | ----------- |
| TypeScript | ❌ 3 errors |
### TypeScript Errors
#### Error 1: server/routers/example.ts:45
Type 'string | undefined' is not assignable to type 'string'.
**Suggested fix:**
```typescript
const name: string = input.name ?? "";
STATUS: REJECTED - Fix 3 errors before commit
---
## Quick Checks
### Fast Check (typecheck + lint only)
```bash
bun run typecheck && bun run lint
bun run typecheck && bun run lint && bun run test && bun run test:e2e && bun run build
git diff --name-only | grep -E "\.(ts|tsx)$" | xargs bunx eslint
bun run typecheck passes?bun run lint passes?bun run test passes?bun run test:e2e passes?bun run build passes?any in code?{
"scripts": {
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"test": "vitest run",
"test:watch": "vitest",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"test:all": "bun run typecheck && bun run lint && bun run test && bun run test:e2e",
"build": "next build"
}
}
For automated quality checks:
# Run all quality gates
bash .claude/skills/quality-gate/scripts/check-all.sh