Agent skill
lang-typescript
This skill should be used when the user asks to "write TypeScript", "debug TypeScript", "create a SolidJS component", "configure TanStack Start", "validate data with Valibot", or mentions .ts/.tsx files. Covers TypeScript 5.9+, SolidJS, and TanStack patterns.
Install this agent skill to your Project
npx add-skill https://github.com/joncrangle/.dotfiles/tree/main/dot_config/opencode/skills/lang-typescript
SKILL.md
<skill_doc> <trigger_keywords>
Trigger Keywords
Activate this skill when the user mentions any of:
File Extensions: .ts, .tsx, .mts, .cts
TypeScript Core: TypeScript, tsc, tsconfig, type inference, generics, satisfies, decorators, type guard, discriminated union, conditional types, mapped types, template literal types, infer keyword
SolidJS: SolidJS, Solid.js, createSignal, createStore, createMemo, createEffect, createResource, <For>, <Show>, <Switch>, <Match>, <Index>, onMount, onCleanup, fine-grained reactivity
TanStack: TanStack Start, TanStack Router, createFileRoute, createServerFn, useLoaderData, file-based routing, server functions, Vinxi
Validation: Valibot, v.object, v.string, v.pipe, v.safeParse, schema validation, type-safe validation
Testing: Vitest, Solid Testing Library, Playwright, @testing-library/solid, renderToString </trigger_keywords>
⛔ Forbidden Patterns
- NO
any: Strictly forbidden. Useunknownif type is truly not known yet, or define a proper type/interface. - NO
@ts-ignore: Do not suppress errors. Fix them. Use@ts-expect-errorONLY if testing error cases explicitly. - NO
!(Non-null Assertion): Avoidval!. Use optional chaining?.or nullish coalescing??. - NO
enum: Prefer union types (type Status = 'active' | 'inactive') or const objects. Enums add runtime overhead and behave unexpectedly. - NO Default Exports: Prefer named exports to ensure consistent naming across the project and better tree-shaking.
🤖 Agent Tool Strategy
- Discovery: Check for
justfilefirst. If it exists, usejust -lto list recipes and preferjustcommands over language-specific CLIs (npm, cargo, poetry, etc.). Then, readtsconfig.jsonto understand compiler options (strictness, paths, target). - Linting: Check
eslint.config.jsor.eslintrcto align with project style. - Type Checking: Use
tsc --noEmitto verify type safety after changes if a build script isn't available. - Testing: Run tests via
bun testorvitestto ensure no regressions. - File Operations: When creating files, ensure the extension matches the content (
.tsxfor JSX,.tsfor logic).
Quick Reference (30 seconds)
TypeScript 5.9+ Development Specialist - Modern TypeScript with SolidJS, TanStack Start, and type-safe API patterns.
Auto-Triggers: .ts, .tsx, .mts, .cts files, TypeScript configurations, SolidJS/TanStack Start projects
Core Stack:
- TypeScript 5.9: Deferred module evaluation, decorators, satisfies operator
- SolidJS: Fine-grained reactivity, signals, stores
- TanStack Start: Full-stack framework with file-based routing, server functions
- Valibot: Tree-shakable schema validation
- Testing: Vitest, Solid Testing Library, Playwright
Implementation Guide (5 minutes)
See patterns.md for detailed implementation patterns covering:
- TypeScript 5.9 Key Features (Satisfies, Deferred Modules, Decorators)
- SolidJS Patterns (Signals, Stores, Memos, Resources)
- TanStack Start Patterns (Routes, Server Functions)
- Valibot Schema Patterns
- Advanced State Management
Quick Troubleshooting
TypeScript Errors:
bun run typecheck # Type check only
bunx tsc --generateTrace ./trace # Performance trace
SolidJS/TanStack Start Issues:
bun run dev # Development mode
bun run build # Check for build errors
rm -rf .vinxi .output && bun run dev # Clear cache
Type Safety:
// Exhaustive check
function assertNever(x: never): never { throw new Error(`Unexpected: ${x}`); }
// Type guard
function isUser(v: unknown): v is User {
return typeof v === "object" && v !== null && "id" in v;
}
- patterns.md - Implementation patterns (SolidJS, TanStack, Valibot)
- reference.md - Complete API reference, Context7 library mappings, advanced type patterns
- examples.md - Production-ready code examples, full-stack patterns, testing templates
Context7 Integration
// TypeScript - mcp__context7__get_library_docs("/microsoft/TypeScript", "decorators satisfies", 1)
// SolidJS - mcp__context7__get_library_docs("/solidjs/solid", "createSignal createStore", 1)
// TanStack Start - mcp__context7__get_library_docs("/tanstack/start", "server-functions routing", 1)
// TanStack Router - mcp__context7__get_library_docs("/tanstack/router", "file-based-routing loaders", 1)
// Valibot - mcp__context7__get_library_docs("/fabian-hiller/valibot", "schema validation pipe", 1)
Works Well With
moai-domain-frontend- UI components, styling patternsmoai-domain-backend- API design, database integrationmoai-workflow-testing- Testing strategies and patternsmoai-foundation-quality- Code quality standardsmoai-essentials-debug- Debugging TypeScript applications
Quick Troubleshooting
TypeScript Errors:
bun run typecheck # Type check only
bunx tsc --generateTrace ./trace # Performance trace
SolidJS/TanStack Start Issues:
bun run dev # Development mode
bun run build # Check for build errors
rm -rf .vinxi .output && bun run dev # Clear cache
Type Safety:
// Exhaustive check
function assertNever(x: never): never { throw new Error(`Unexpected: ${x}`); }
// Type guard
function isUser(v: unknown): v is User {
return typeof v === "object" && v !== null && "id" in v;
}
</skill_doc>
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
lang-javascript
This skill should be used when the user asks to "write JavaScript", "debug a Node.js/Bun app", "create a Hono server", "configure Biome", "run tests with bun test", or mentions .js/.mjs files. Covers ES2024+, Bun, and Hono patterns.
opentui
Comprehensive OpenTUI skill for building terminal user interfaces. Covers the core imperative API, React reconciler, and Solid reconciler. Use for any TUI development task including components, layout, keyboard handling, animations, and testing.
vitest
Specialist in Vitest, a blazing fast unit test framework powered by Vite. Focuses on Jest compatibility, in-source testing, and native ESM support.
PreventionPatterns
Known bug patterns and their fixes to prevent regression.
just-cli
This skill should be used when the user asks to "create a justfile", "write just recipes", "configure just settings", "add just modules", "use just attributes", "set up task automation", mentions justfile, just command runner, or task automation with just.
lang-go
Go 1.23+ development specialist covering Chi, GORM, and concurrent programming patterns. Use when building high-performance microservices, CLI tools, or cloud-native applications.
Didn't find tool you were looking for?