typescript

Enforces TypeScript style, naming conventions, Arktype patterns, and test organization for coding tasks.

35|4|Updated Dec 18, 2024
One-click install
npx skills add https://github.com/wellcrafted-dev/wellcrafted --skill typescript-wellcrafted-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/wellcrafted-dev/wellcrafted/tree/main/.claude/skills/typescript
Command: npx skills add https://github.com/wellcrafted-dev/wellcrafted --skill typescript-wellcrafted-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces best practices in TypeScript development, ensuring code clarity, maintainability, and robustness through consistent styling, naming, and architectural patterns.

Core Features & Use Cases

  • Code Style Enforcement: Adheres to specific rules for type vs interface, readonly usage, acronym casing, and import paths.
  • Architectural Patterns: Guides on using switch statements, record lookups, and co-locating types.
  • Test Organization: Standardizes test file placement and naming conventions.
  • Arktype & Branded Types: Provides guidelines for optional properties in Arktype and the use of branded type constructors.
  • Use Case: Refactor a legacy JavaScript codebase to TypeScript, ensuring all new code follows these established guidelines for consistency and developer onboarding.

Quick Start

Apply the typescript skill to refactor the provided JavaScript code snippet into idiomatic TypeScript.

Frequently Asked Questions about typescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the best practices for organizing TypeScript types and tests?

TypeScript best practices involve co-locating types with their implementation and standardizing test file placement with consistent naming conventions. This approach enforces code clarity, maintainability, and robustness through consistent architectural patterns.

How do I decide between using type and interface in TypeScript?

Choosing between type and interface in TypeScript depends on specific code style enforcement rules. This skill dictates strict adherence to choosing one over the other to ensure code consistency and maintainability across your codebase.

How should I handle acronym casing and naming conventions in TypeScript?

Handling acronym casing in TypeScript requires following specific naming conventions for variables and functions. Enforcing these rules ensures that identifiers remain consistent and readable across large codebases.

What is the best way to define optional properties using Arktype in TypeScript?

Defining optional properties using Arktype in TypeScript requires following specific schema guidelines. This skill provides established patterns for structuring Arktype schemas and using branded type constructors for robust type safety.

Can I use this approach to refactor legacy JavaScript into idiomatic TypeScript?

Refactoring legacy JavaScript into idiomatic TypeScript is a primary use case for this approach. It ensures all newly migrated code follows established guidelines for styling, naming, and architectural patterns for smoother developer onboarding.

When should I use readonly and switch statements in TypeScript architecture?

Using readonly and switch statements in TypeScript architecture depends on specific structural rules. You should apply readonly usage to enforce immutability and use switch statements or record lookups to guide complex logical branching.