Skip to content
Agentmart
Submit a tool

typescript-discipline

Design or review TypeScript domain types, parsing boundaries, and type-safety trade-offs.

Skill by draht-dev

IndexedMIT★ 7
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/draht-dev-typescript-discipline

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Design or review TypeScript domain types, parsing boundaries, and type-safety trade-offs. Use when the task concerns type modeling, unsafe assertions, or exhaustive handling.

Use cases: design, productivity, agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/typescript-discipline

What's inside

Skill name
typescript-discipline
Description
Design or review TypeScript domain types, parsing boundaries, and type-safety trade-offs. Use when the task concerns type modeling, unsafe assertions, or exhaustive handling.
License
MIT
Instructions
17 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • patterns.md · references/

SKILL.md (first lines)

# TypeScript Discipline

Use types to express the cases callers must handle, with the least complexity that keeps operations correct.

- Model mutually exclusive states with discriminated unions. Enforce exhaustive handling so adding a variant reveals missing cases.
- Parse external data from `unknown` at the boundary into a named type. Keep business logic typed and avoid repeating already-established validation inside it.
- Prefer constructive representations when they remove invalid combinations. A non-empty tuple proves a head exists; it does not prove an arbitrary numeric index is in bounds.
- Strengthen a type where an operation requires it. An empty list is valid input for a sum; a head operation must require non-empty input or return an optional result.
- Brand primitives when mixing their meanings is a plausible defect. Match the project's brand convention and validate at construction.
- Avoid `any`, unchecked `as`, and non-null assertions. Narrow, validate, or revise the model; isolate and explain an assertion that the compiler cannot express.
- Derive shapes from authoritative schemas and existing types. Use `satisfies` to check a value against a type without a type assertion.
- Type predicates must check their full claim. A named guard is not evidence that its implementation is sound.
- Use named object arguments when they prevent confusion; follow existing APIs and consider allocation-sensitive paths.

See [boundary and totality patterns](./references/patterns.md) for the cases that commonly need care. Follow repository rules on imports and type definitions; consult installed dependency declarations rather than guessing external APIs.

From draht-dev/draht, MIT.

More from draht-dev/draht

Signals

Stars
7
Forks
0
Open issues
2
Last commit (this folder)
Oct 21, 2026 (7 days ago)
Last release
Oct 24, 2026 (5 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from draht-dev

Cite this page

typescript-discipline skill. Agent Mart. https://agentmart.dev/skills/draht-dev-typescript-discipline (last updated 2026-10-24)