Skip to content
Back to skills

Typescript Skills

ASecurity

Shared TypeScript best practices for Designer and Electron subsystems.

  • 838 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 20, 2026
ai-agentstypescriptgoreacttestingapifrontendsecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 20, 2026

npx -y skills add llama-farm/llamafarm --skill typescript-skills --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Typescript Skills?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Typescript Skills
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/llama-farm-typescript-skills/badge)](https://www.skillsdirectory.com/skills/llama-farm-typescript-skills)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: typescript-skills
description: Shared TypeScript best practices for Designer and Electron subsystems.
allowed-tools: Read, Grep, Glob
user-invocable: false
---

# TypeScript Skills for LlamaFarm

Shared TypeScript best practices for Designer (React) and Electron App subsystems.

## Overview

This skill covers idiomatic TypeScript patterns for LlamaFarm's frontend applications:
- **designer/**: React 18 + TanStack Query + TailwindCSS + Radix UI
- **electron-app/**: Electron 28 + Electron Vite

## Tech Stack

| Subsystem | Framework | Build | Key Libraries |
|-----------|-----------|-------|---------------|
| designer | React 18 | Vite | TanStack Query, Radix UI, axios, react-router-dom |
| electron-app | Electron 28 | electron-vite | electron-updater, axios |

## Configuration

Both projects use strict TypeScript:
```json
{
  "strict": true,
  "noUnusedLocals": true,
  "noUnusedParameters": true,
  "noFallthroughCasesInSwitch": true
}
```

## Core Principles

1. **Strict mode always** - Never use `any` without explicit justification
2. **Prefer interfaces** - Use `interface` for object shapes, `type` for unions/intersections
3. **Explicit return types** - Always type public function returns
4. **Immutability** - Use `readonly` and `as const` where applicable
5. **Null safety** - Handle null/undefined explicitly, avoid non-null assertions

## Related Documents

- [patterns.md](./patterns.md) - Idiomatic TypeScript patterns
- [typing.md](./typing.md) - Strict typing, generics, utility types
- [testing.md](./testing.md) - Vitest and testing patterns
- [security.md](./security.md) - XSS prevention, input validation

## Quick Reference

### React Component Pattern
```tsx
interface Props {
  readonly title: string
  readonly onAction?: () => void
}

function MyComponent({ title, onAction }: Props): JSX.Element {
  return <button onClick={onAction}>{title}</button>
}
```

### TanStack Query Hook Pattern
```typescript
export const projectKeys = {
  all: ['projects'] as const,
  lists: () => [...projectKeys.all, 'list'] as const,
  detail: (id: string) => [...projectKeys.all, 'detail', id] as const,
}

export function useProject(id: string) {
  return useQuery({
    queryKey: projectKeys.detail(id),
    queryFn: () => fetchProject(id),
    enabled: !!id,
  })
}
```

### Error Class Pattern
```typescript
export class ApiError extends Error {
  constructor(
    message: string,
    public readonly status: number,
    public readonly response?: unknown
  ) {
    super(message)
    this.name = 'ApiError'
  }
}
```

## Checklist Summary

| Category | Critical | High | Medium | Low |
|----------|----------|------|--------|-----|
| Typing | 3 | 4 | 2 | 1 |
| Patterns | 2 | 3 | 3 | 2 |
| Testing | 2 | 3 | 2 | 1 |
| Security | 4 | 2 | 1 | 0 |

Files in this skill

  • SKILL.md2.7 KB
  • patterns.md7.9 KB
  • security.md8.8 KB
  • testing.md8.8 KB
  • typing.md8.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.