install
source · Clone the upstream repo
git clone https://github.com/dlupiak/claude-session-dashboard
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/dlupiak/claude-session-dashboard "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/typescript-rules" ~/.claude/skills/dlupiak-claude-session-dashboard-typescript-rules && rm -rf "$T"
manifest:
.claude/skills/typescript-rules/SKILL.mdsource content
TypeScript Rules
Types
- Never use
— useany
with type guards or explicit typesunknown - Prefer
for object shapes,interface
for unions/intersectionstype - Export types alongside their functions, not from barrel files
- Use
for type-safe object literals:satisfiesconst x = { ... } satisfies Config
Imports
- Use
path alias for imports from@/apps/web/src/ - Group imports: external libs →
→ relative slice imports@/lib/ - Use
imports for type-only:typeimport type { Foo } from './types'
Architecture Boundaries
Vertical slice structure (src/features/<slice>/
)
src/features/<slice>/- Each slice owns its own server functions, queries, components, and types
- No cross-slice imports — shared code goes in
src/lib/
modules must NOT import fromsrc/lib/src/features/
File naming
- Server function files:
*.server.ts - Query/hooks files:
*.queries.ts - Component files: PascalCase (e.g.,
)SessionCard.tsx - Test files:
co-located with source*.test.ts(x)
Error Handling
- Throw typed errors, not strings:
throw new Error('message') - Use discriminated unions for result types:
{ ok: true; data: T } | { ok: false; error: string } - Catch
, narrow withunknowninstanceof
Functions
- Prefer named function declarations over arrow functions for top-level exports
- Use explicit return types on exported functions
- Keep functions small — max ~50 lines
Zod
- Validate all external input (API responses, form data, URL params) with Zod
- Co-locate schemas with server functions, not in separate schema files
- Use
for derived typesz.infer<typeof schema>