agentleFS
TangleMLTangleML/tangle-ui/.claude/skills/typescript-standards/SKILL.md

typescript-standards

Skill104 starsChanged 3 days agoApache-2.0View on GitHub

TypeScript coding standards for this project. Use when writing TypeScript code, defining types, or working with type safety.

We split this skill into the rules it gives an agent

10 rules. 0 are common, 2 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use strict TypeScript with proper typing

    line 10
  2. Very specific:

    Prefer explicit types over any (only use any when absolutely necessary)

    line 11
  3. Very specific:

    Use interface for object shapes, type for unions/primitives

    line 12
  4. Very specific:

    Follow existing patterns for type definitions in src/types/

    line 13
  5. Very specific:

    Don't use type assertions (as) unless absolutely necessary.

    line 17
  6. Very specific:

    Use the generated API client in src/api/

    line 36
  7. Very specific:

    Prefer domain types: Use types from src/utils/componentSpec.ts, src/types/, etc.

    line 37
  8. Very specific:

    Use generated API types: Only use src/api/types.gen.ts when directly interfacing with APIs or when domain types don't exist

    line 38
  9. Very specific:

    Follow existing service patterns in src/services/

    line 39
  10. Distinctive:

    Use proper error handling with try/catch

    line 40

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

TypeScript Standards

Core Rules

  • Use strict TypeScript with proper typing
  • Prefer explicit types over any (only use any when absolutely necessary)
  • Use interface for object shapes, type for unions/primitives
  • Follow existing patterns for type definitions in src/types/

Avoid Unsafe Type Casting

Don't use type assertions (as) unless absolutely necessary. Instead prefer:

  • Type guards and runtime validation
  • Proper typing from the source
  • Union types and type narrowing
  • Schema validation libraries (e.g., zod) for external data
// Bad
const something: string = myjson as string;

// Good - use type guards or validate the data
function isString(value: unknown): value is string {
  return typeof value === "string";
}

API & Data Types

  • Use the generated API client in src/api/
  • Prefer domain types: Use types from src/utils/componentSpec.ts, src/types/, etc. for core business logic
  • Use generated API types: Only use src/api/types.gen.ts when directly interfacing with APIs or when domain types don't exist
  • Follow existing service patterns in src/services/
  • Use proper error handling with try/catch

Naming Conventions

  • Components: PascalCase
  • Files: PascalCase for components, camelCase for utilities
  • Variables/functions: camelCase
  • Constants: SCREAMING_SNAKE_CASE
  • Types/Interfaces: PascalCase
  • Directories: Follow the existing convention in the surrounding directory. The codebase uses both camelCase and PascalCase for folders — match what's already there

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.