/godmode:typefrom godmode
Audits TypeScript type safety, configures strict compiler flags, and adds runtime schema validation (Zod/Valibot/Yup) at API boundaries.
Ships in godmode. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
/godmode:type, "type safety", "TypeScript strict"any is widespread# Count any/unknown usage
grep -rn ": any" --include="*.ts" --include="*.tsx" \
src/ | wc -l
grep -rn "as any" --include="*.ts" --include="*.tsx" \
src/ | wc -l
grep -rn "@ts-ignore" --include="*.ts" \
--include="*.tsx" src/ | wc -l
# Check tsconfig strictness
grep -A20 '"compilerOptions"' tsconfig.json \
| grep -E "strict|noImplicit|noUnchecked"
TYPE SAFETY AUDIT:
| Metric | Value |
|------------------|---------------|
| Strict mode | ON/OFF/PARTIAL |
| `any` count | {N} explicit |
| `as any` casts | {N} |
| @ts-ignore | {N} suppressed |
| Runtime validation| YES/NO |
| Schema library | Zod/Yup/none |
| Safety Score | {N}/100 |
| Grade | A/B/C/D/F |
Score thresholds:
90-100 = A (strict, zero any, schemas)
80-89 = B (strict, few any, some schemas)
60-79 = C (partial strict, moderate any)
40-59 = D (no strict, many any)
0-39 = F (widespread any, no validation)
// tsconfig.json — Maximum type safety
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"exactOptionalPropertyTypes": true
}
}
Phase 1 (Week 1-2): Foundation
noImplicitAny + strictNullChecks
+ noImplicitReturns + useUnknownInCatchVariables
Phase 2 (Week 3-4): Functions
strictFunctionTypes + strictBindCallApply
Phase 3 (Week 5-6): Full strict
"strict": true + noUncheckedIndexedAccess
Phase 4 (Week 7-8): Schemas
Add Zod at API boundaries
IF enabling flag produces >200 errors:
enable one flag at a time, fix, commit, next
| Library | Size | Best For |
|---------|--------|----------------------|
| Zod | ~13KB | TypeScript-first, API |
| Valibot | ~1KB | Bundle-conscious |
| Yup | ~15KB | React forms, Formik |
IF TypeScript project + API validation: Zod
IF bundle size critical (<5KB budget): Valibot
IF existing Yup codebase: keep Yup
WHEN tRPC or React Hook Form: Zod (ecosystem)
// Validate API requests with Zod middleware
import { z, ZodSchema } from 'zod';
export function validate<T>(schema: ZodSchema<T>) {
return (req, res, next) => {
const result = schema.safeParse(req.body);
if (!result.success) {
return res.status(400).json({
errors: result.error.flatten()
});
}
req.body = result.data;
next();
};
}
VALIDATION BOUNDARIES:
API request handler: VALIDATE (Zod middleware)
External API response: VALIDATE (parse response)
Database read: VALIDATE (if schema can drift)
Environment variables: VALIDATE (at startup)
Service layer: TRUST types (no re-validation)
Internal functions: TRUST types
1. Write Zod schemas for domain entities
2. Infer types: type User = z.infer<typeof UserSchema>
3. Build logic using inferred types
4. Test with schema-generated data
NEVER write types and schemas separately.
Derive TypeScript type from Zod schema always.
// Make illegal states unrepresentable
type Order =
| { status: 'draft'; items: Item[] }
| { status: 'submitted'; items: Item[];
submittedAt: Date }
| { status: 'shipped'; items: Item[];
trackingNumber: string };
// TypeScript narrows on status check
as casts to silence errors.any. Use unknown instead.ls tsconfig.json tsconfig.*.json 2>/dev/null
grep -c ": any\|as any" --include="*.ts" -r src/
grep -E "zod|yup|joi|valibot" package.json 2>/dev/null
Log to .godmode/type-results.tsv:
phase\taction\tany_before\tany_after\terrors_fixed\tscore\tstatus
Print: Type: score {before} -> {after}/100. any: {N} -> {N}. Strict: {status}. Schemas: {N}.
KEEP if: tsc passes AND tests pass
AND any count decreased
DISCARD if: tsc errors increase OR tests fail
OR auto-fix changed runtime behavior
STOP when:
- strict: true enabled
- any count at zero (or reduction plan)
- Runtime validation at all API boundaries
- Score >= 80/100
- User requests stop
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
135 skills in this plugin
/a11yAccessibility. WCAG 2.1 AA/AAA, a11y audit, color contrast, keyboard navigation, screen reader, Axe, Pa11y, Lighthouse./agentAI agent development. ReAct/plan-and-execute/multi-agent architectures, tool design, memory systems, guardrails, orchestration (LangChain, LlamaIndex, CrewAI, AutoGen)./analyticsProduct analytics implementation — event tracking, funnel analysis, A/B testing, Segment/Amplitude/Mixpanel/PostHog, privacy-compliant instrumentation./angularAngular architecture. NgRx, Signals, RxJS, standalone components, lazy loading, dependency injection, Jasmine, Jest./apiAPI design and specification. REST, GraphQL, gRPC, OpenAPI, design an API, create API spec, validate my API, endpoint./apidocsAPI documentation. OpenAPI, Swagger, Redoc, contract-first development, spec-first, code-first, interactive docs.Other plugins' skills for the same job