ed3dai/ed3d-plugins/howto-code-in-typescript
Claude Code and agent skill by ed3dai/ed3d-plugins
- community
Checking that the SKILL.md file is still in the repository.
Use when writing TypeScript code, reviewing TS implementations, or making decisions about type declarations, function styles, or naming conventions - comprehensive house style covering type vs interface rules, function declarations, FCIS integration, immutability patterns, and type safety enforcement
Install
npx vskill@latest install ed3dai/ed3d-plugins/howto-code-in-typescriptSKILL.md
TypeScript House Style
Overview
Comprehensive TypeScript coding standards emphasizing type safety, immutability, and integration with Functional Core, Imperative Shell (FCIS) pattern.
Core principles:
- Types as documentation and constraints
- Immutability by default prevents bugs
- Explicit over implicit (especially in function signatures)
- Functional Core returns Results, Imperative Shell may throw
- Configuration over decoration/magic
Quick Self-Check (Use Under Pressure)
When under deadline pressure or focused on other concerns (performance, accuracy, features), STOP and verify:
- [ ] Using
Array<T>notT[] - [ ] Using
typenotinterface(unless class contract) - [ ] Using math.js for money/currencies/complex math
- [ ] Parameters are
readonlyorReadonly<T> - [ ] Using
unknownnotany - [ ] Using
nullfor absent values (notundefined) - [ ] Using function declarations (not const arrow) for top-level functions
- [ ] Using named exports (not default exports)
- [ ] Using
===not== - [ ] Using
.sort((a, b) => a - b)for numeric arrays - [ ] Using
parseInt(x, 10)with explicit radix
Why this matters: Under pressure, you'll default to muscle memory. These checks catch the most common violations.
Type Declarations
Type vs Interface
Always use `type` except for class contracts.
Rationale: Types compose better with unions and intersections, support mapped types, and avoid declaration merging surprises. Interfaces are only for defining what a class must implement.
IMPORTANT: Even when under deadline pressure, even when focused on other concerns (financial accuracy, performance optimization, bug fixes), take 2 seconds to ask: "Is this a class contract?" If no, use type. Don't default to interface out of habit.
Naming Conventions
Type Suffixes
| Suffix | Usage | Example | |
|---|---|---|---|
FooOptions | Function parameter objects (3+ args or any optional) | ProcessUserOptions | |
FooConfig | Persistent configuration from storage | DatabaseConfig | |
FooResult | Discriminated union return types | ValidationResult | |
FooFn | Function/callback types | TransformFn<T> | |
FooProps | React component props | ButtonProps | |
FooState | State objects (component/application) | AppState |
General Casing
| Element | Convention | Example | |
|---|---|---|---|
| Variables & functions | camelCase | userName, getUser() | |
| Types & classes | PascalCase | UserData, UserService | |
| Constants | UPPER_CASE | MAX_RETRY_COUNT, API_ENDPOINT | |
| Files | kebab-case | user-service.ts, process-order.ts |
Boolean Naming
Use is/has/can/should/will prefixes. Avoid negative names.
Type Suffix Details
FooOptions - Parameter Objects
Use for functions with 3+ arguments OR any optional arguments.
FooResult - Discriminated Unions
Always use discriminated unions for Result types. Integrate with neverthrow.
Rule: Functional Core functions should return Result<T, E> types. Imperative Shell functions may throw exceptions for HTTP errors and similar.
Functions
Declaration Style
Use `function` declarations for top-level functions. Use arrow functions for inline callbacks.
Rationale: Function declarations are hoisted and more visible. Arrow functions capture lexical this and are concise for callbacks.
Const Arrow Functions
Use `const foo = () => {}` declarations only for stable references.
Parameter Objects
Use parameter objects for 3+ arguments OR any optional arguments.
Async Functions
Always explicitly type Promise returns. Avoid async void.
Prefer async/await over `.then()` chains.
When to Use Async
Be selective with async. Not everything needs to be async. Sync code is simpler to reason about and debug.
Use async for:
- Network requests, database operations, file I/O
- Operations that benefit from concurrent execution (Promise.all)
- External service calls
Stay sync for:
- Pure calculations and transformations
- Simple data structure operations
- Code that doesn't touch external systems
Why this matters: Async adds complexity—error propagation, cleanup, and stack traces become harder to follow. Keep the async boundary as close to the I/O as possible.
Classes
When to Use Classes
Prefer functions over classes, EXCEPT for dependency injection patterns.
Class Structure
Use constructor injection into private readonly fields.
The 'this' Keyword
Use `this` only in class methods. Avoid elsewhere.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/ed3d-house-style/skills/howto-code-in-typescript/SKILL.md
Popularity
- Repository stars
- 249
- Repository forks
- 32
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 30 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ed3dai/ed3d-plugins/howto-code-in-typescript)