Strict TypeScript configuration with all safety flags enabled. Use when initializing TypeScript projects or enforcing type safety.
Provides a complete, strict TypeScript configuration with all safety flags enabled. Use when initializing TypeScript projects or enforcing maximum type safety with zero tolerance for `any` types.
/plugin marketplace add IvanTorresEdge/molcajete.ai/plugin install js@Molcajete.aiThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill defines the strictest possible TypeScript configuration for maximum type safety.
Use this skill when:
ZERO TOLERANCE FOR any TYPES - Every value must have an explicit, meaningful type.
{
"compilerOptions": {
// Language & Environment
"target": "ES2022",
"lib": ["ES2022"],
"module": "ESNext",
"moduleResolution": "bundler",
// Emit
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "./dist",
"removeComments": false,
"importHelpers": true,
// Interop Constraints
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
// Type Checking - ALL STRICT FLAGS
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictBindCallApply": true,
"strictPropertyInitialization": true,
"noImplicitThis": true,
"useUnknownInCatchVariables": true,
"alwaysStrict": true,
// Additional Checks
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"exactOptionalPropertyTypes": true,
// Completeness
"skipLibCheck": false,
"skipDefaultLibCheck": false
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "**/*.test.ts"]
}
any typethis expressions with implied any typeunknown (not any)T | undefined{
"scripts": {
"type-check": "tsc --noEmit",
"type-check:watch": "tsc --noEmit --watch",
"build": "tsc",
"clean": "rm -rf dist"
}
}
BAD:
function process(data: any) { // ❌
return data.value;
}
GOOD:
function isValidData(value: unknown): value is { value: string } {
return (
typeof value === 'object' &&
value !== null &&
'value' in value &&
typeof (value as Record<string, unknown>).value === 'string'
);
}
function process(data: unknown): string {
if (!isValidData(data)) {
throw new Error('Invalid data');
}
return data.value;
}
With noUncheckedIndexedAccess: true, array access returns T | undefined:
const numbers: number[] = [1, 2, 3];
// ❌ Type error - value is number | undefined
const first: number = numbers[0];
// ✅ Explicit check
const first = numbers[0];
if (first !== undefined) {
console.log(first.toFixed(2));
}
// ✅ Using optional chaining
console.log(numbers[0]?.toFixed(2));
// ✅ Using assertion (only if guaranteed)
const firstAsserted = numbers[0]!;
// ❌ Implicit null
let name: string = null; // Error with strictNullChecks
// ✅ Explicit null
let name: string | null = null;
// ✅ Narrowing
if (name !== null) {
console.log(name.toUpperCase());
}
// ✅ Optional chaining
console.log(name?.toUpperCase());
// ✅ Nullish coalescing
const displayName = name ?? 'Anonymous';
With useUnknownInCatchVariables: true:
// ❌ Old way (error is `any`)
try {
riskyOperation();
} catch (error) {
console.log(error.message); // Unsafe
}
// ✅ New way (error is `unknown`)
try {
riskyOperation();
} catch (error) {
if (error instanceof Error) {
console.log(error.message);
} else {
console.log('Unknown error:', error);
}
}
// ❌ Missing return type
function calculate(x: number) {
return x * 2;
}
// ✅ Explicit return type
function calculate(x: number): number {
return x * 2;
}
// ✅ Async function
async function fetchData(id: string): Promise<Data> {
const response = await fetch(`/api/data/${id}`);
return response.json() as Promise<Data>;
}
Add TypeScript ESLint rules to enforce strict typing:
// eslint.config.ts
import tseslint from 'typescript-eslint';
export default tseslint.config(
...tseslint.configs.strictTypeChecked,
{
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unsafe-assignment': 'error',
'@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-return': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'error',
},
},
);
strict: true// @ts-expect-error with justification for unavoidable casesany types (explicit or implicit)// @ts-ignore without justificationunknown instead of any for truly unknown typesany typesThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.