Claude Code Plugins

Community-maintained marketplace

Feedback

typescript-functional

@Seeker1911/dotfiles
6
1

TypeScript functional programming. Use for pure functions, immutability, composition. Favors ternaries, switch, map/filter/reduce over imperative code. Concise, declarative patterns.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name typescript-functional
description TypeScript functional programming. Use for pure functions, immutability, composition. Favors ternaries, switch, map/filter/reduce over imperative code. Concise, declarative patterns.

TypeScript Functional Programming

Quick Start

Core principles: Pure functions | Immutability | Composition | Higher-order functions | Declarative over imperative

Prefer: ? : over if | switch over if/else chains | map/filter/reduce over loops | const over let | Expressions over statements

Example

// ❌ Imperative
function processUsers(users: User[]): string[] {
  let result = [];
  for (let i = 0; i < users.length; i++) {
    if (users[i].age >= 18) {
      result.push(users[i].name.toUpperCase());
    }
  }
  return result;
}

// ✅ Functional
const processUsers = (users: User[]): string[] =>
  users
    .filter(user => user.age >= 18)
    .map(user => user.name.toUpperCase());

// ✅ Ternary over if
const getStatus = (age: number): string =>
  age >= 18 ? 'adult' : 'minor';

// ✅ Switch for multiple conditions
const getDiscount = (tier: Tier): number => {
  switch (tier) {
    case 'gold': return 0.2;
    case 'silver': return 0.1;
    case 'bronze': return 0.05;
    default: return 0;
  }
};

Reference Files

Check these before suggesting code:

Notes

  • Avoid mutations: Use spread operators and array methods
  • No let unless absolutely necessary (prefer const)
  • Functions should be small, single-purpose, composable
  • Prefer function expressions over statements
  • Use type inference when possible, explicit types when needed
  • Early returns are acceptable for guard clauses
  • Last verified: 2025-12-03