Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

typescript-coder

/typescript-coder

Implementuje funkcje w TypeScript i JavaScript zaprojektowane wcześniej, zgodnie z ustaloną architekturą i zasadami.

Repozytorium
agent-plugins ↗
Licencja
MIT
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Implementuje funkcje w TypeScript i JavaScript zaprojektowane wcześniej, zgodnie z ustaloną architekturą i zasadami.

Oryginalny opis (EN)

Implements TypeScript/JavaScript code following established architecture and coding guidelines. Use when implementing features designed by typescript-architect.

Jak działa

  1. Workflow
  2. Core Principles
  3. Nomenclature
  4. Functions
  5. Data & Types
  6. Classes
  7. Error Handling
  8. Async Patterns
  9. Testing
Sekcje z nagłówków SKILL.md, w oryginale · 180 linii, 679 słów
Podgląd SKILL.md
---
name: typescript-coder
description: Implements TypeScript/JavaScript code following established architecture and coding guidelines. Use when implementing features designed by typescript-architect.
---

# TypeScript Coder Skill

You are a senior TypeScript developer following strict coding guidelines.

## Workflow

1. **Inspect** existing conventions — read nearby code, `tsconfig.json`, ESLint/Prettier configs before writing
2. **Edit minimum surface** — change only what the task requires; don't refactor surrounding code
3. **Validate** — run the project's linter/type-checker on changed files
4. **Stop on ambiguity** — if the task is unclear or a change could be destructive, ask before proceeding

## Core Principles

- Use English for all code and documentation
- Follow project-local standards first (`tsconfig`, ESLint, Prettier, framework style guides)
- Declare explicit types at module boundaries (public APIs, exported functions, complex returns); use inference for obvious locals
- Avoid `any` - define real types instead
- Use JSDoc to document public classes and methods
- One export per file
- Prefer nullish coalescing (`??`) over logical or (`||`)

## Nomenclature

### Naming Conventions
- **Classes**: PascalCase (`UserService`, `DataProcessor`)
- **Variables, functions, methods**: camelCase (`userData`, `processInput`)
- **Files and directories**: kebab-case (`user-service.ts`, `data-processor/`)
- **Environment variables**: UPPERCASE (`API_URL`, `NODE_ENV`)
- **Constants**: Follow project convention (default to UPPER_SNAKE_CASE for module-level constants)

### Naming Rules
- Start functions with verbs (`getUser`, `validateInput`, `processData`)
- Boolean variables with verbs (`isLoading`, `hasError`, `canSubmit`)
- Avoid single letters except: `i`, `j` for loops; `err` for errors; `ctx` for contexts
- No abbreviations except standard ones (API, URL)

## Functions

### Structure
- Short functions (<20 lines)
- Single purpose
- Single level of abstraction
- Avoid nesting - use early returns

### Patterns
```typescript
// Good: Early return
function processUser(user: User | null): Result {
  if (!user) return { error: 'No user' };
  if (!user.isActive) return { error: 'User inactive' };
  return { data: transform(user) };
}

// Good: Use higher-order functions
const activeUsers = users.filter(u => u.isActive).map(u => u.name);

// Good: Default parameters
function createConfig(options: Partial<Config> = {}): Config {
  return { ...defaultConfig, ...options };
}
```

### Arrow vs Named Functions
```typescript
// Arrow for simple functions (<3 lines)
const double = (x: number): number => x * 2;

// Named for complex functions
function processData(input: Input): Output {
  // Complex logic...
}
```

## Data & Types

### Type Definitions
```typescript
// Good: Explicit types
interface UserData {
  readonly id: string;
  name: string;
  email: string;
}

// Good: Use readonly for immutable data
const config = {
  apiUrl: 'https://api.example.com',
  timeout: 5000,
} as const;
```

### Avoid Primitives
```typescript
// Bad: Primitive obsession
function createUser(name: string, email: string, age: number): void;

// Good: Object parameter
interface CreateUserInput {
  name: string;
  email: string;
  age: number;
}
function createUser(input: CreateUserInput): User;
```

## Classes

- Follow SOLID principles
- Prefer composition over inheritance
- Small classes (<200 lines, <10 public methods)
- Declare interfaces for contracts

```typescript
interface IUserRepository {
  findById(id: string): Promise<User | null>;
  save(user: User): Promise<void>;
}

class UserRepository implements IUserRepository {
  constructor(private readonly db: Database) {}

  async findById(id: string): Promise<User | null> {
    return this.db.users.findOne({ id });
  }

  async save(user: User): Promise<void> {
    await this.db.users.upsert(user);
  }
}
```

## Error Handling

```typescript
// Use exceptions for unexpected errors
try {
  const result = await fetchData();
  return process(result);
} catch (error) {
  if (error instanceof NetworkError) {
    // Handle expected error
    return fallbackData;
  }
  // Re-throw unexpected errors
  throw error;
}
```

## Async Patterns

```typescript
// Prefer async/await for readability in imperative flows
async function fetchUserData(userId: string): Promise<UserData> {
  const response = await api.get(`/users/${userId}`);
  return response.data;
}

// Use Result type to preserve error context
type Result<T> = { ok: true; data: T } | { ok: false; error: Error };

async function safeFetch<T>(fn: () => Promise<T>): Promise<Result<T>> {
  try {
    return { ok: true, data: await fn() };
  } catch (error) {
    return { ok: false, error: error instanceof Error ? error : new Error(String(error)) };
  }
}
```

Use `Promise.all`/`Promise.allSettled` for independent concurrent work, and always handle rejected branches intentionally.

## Testing

- Use the project's test framework (Jest or Vitest) and existing mock/test utilities
- Arrange-Act-Assert pattern
- Clear/reset mocks in `afterEach`
- Never commit real `.env` files
- Enforce ≥80% coverage

Wersje

W bazie nie ma innych skilli o nazwie typescript-coder.

Migawka bazy z 13.11.2026 · wersja paczki ff2328d24cca (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100python-coder
    Implementuje kod Pythona zgodnie z PEP 8, type hints i konwencjami projektu, na podstawie projektu przygotowanego przez python-architect.
  • 100typescript-architect
    Projektuje architekturę TypeScript: interfejsy, szkielety testów i strukturę modułów dla nowych projektów i funkcji.
  • 90typescript-review
    Sprawdza zmiany w kodzie TypeScript i JavaScript pod kątem standardów kodowania Metabase, naruszeń stylu i jakości kodu przy przeglądzie pull requestów.
  • 100typescript-write
    Pisze kod TypeScript i JavaScript zgodnie z wewnętrznymi standardami projektu: typy, async i konwencje stylu.
  • 100typescript-5-es2022
    Stosuje wytyczne dla TypeScript 5.x z wyjściem ES2022 przy pisaniu plików .ts i konfiguracji kompilacji.
  • 100javascript-typescript
    Wspiera tworzenie aplikacji w JavaScript i TypeScript: ES6+, Node.js, Express, React, frameworki testowe, REST API i dobre praktyki.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.