本文へ移動
cccskills
無料GitHub で公開

typescript-skills

Shared TypeScript best practices for Designer and Electron subsystems.

インストール方法を見る

含まれるファイル(5)

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

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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

SubsystemFrameworkBuildKey Libraries
designerReact 18ViteTanStack Query, Radix UI, axios, react-router-dom
electron-appElectron 28electron-viteelectron-updater, axios

Configuration

Both projects use strict TypeScript:

{
  "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

Quick Reference

React Component Pattern

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

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

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

Checklist Summary

CategoryCriticalHighMediumLow
Typing3421
Patterns2332
Testing2321
Security4210

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

CLI best practices for LlamaFarm. Covers Cobra, Bubbletea, Lipgloss patterns for Go CLI development.

日本語の概要は準備中です。原文の説明を表示しています。

llama-farm/llamafarm8362026年6月10日 更新

Comprehensive code review for diffs. Analyzes changed code for security vulnerabilities, anti-patterns, and quality issues. Auto-detects domain (frontend/backend) from file paths.

日本語の概要は準備中です。原文の説明を表示しています。

llama-farm/llamafarm8362026年6月10日 更新

Commit changes, push to GitHub, and open a PR. Includes quality checks (security, patterns, simplification). Use --quick to skip checks.

日本語の概要は準備中です。原文の説明を表示しています。

llama-farm/llamafarm8362026年6月10日 更新

Best practices for the Common utilities package in LlamaFarm. Covers HuggingFace Hub integration, GGUF model management, and shared utilities.

日本語の概要は準備中です。原文の説明を表示しています。

llama-farm/llamafarm8362026年6月10日 更新

Configuration module patterns for LlamaFarm. Covers Pydantic v2 models, JSONSchema generation, YAML processing, and validation.

日本語の概要は準備中です。原文の説明を表示しています。

llama-farm/llamafarm8362026年6月10日 更新

Designer subsystem patterns for LlamaFarm. Covers React 18, TanStack Query, TailwindCSS, and Radix UI.

日本語の概要は準備中です。原文の説明を表示しています。

llama-farm/llamafarm8362026年6月10日 更新

llama-farm のスキルをすべて見る

このスキルの問題を報告する