principle-type-system-discipline
- Use it when:
- Designing types, reviewing a signature, or writing code in any statically typed language.
- It does:
- Brands primitives like UserId and OrderId so they can't be swapped, parses external data into typed models at boundaries, and derives types from the schema that owns the shape.
- Aims for:
- A compiler that rejects impossible states, swapped primitives and unhandled variants, and errors and special cases defined out of existence rather than handled.
- Runs:
- Only when you call it.
Skill 10 of 14 in the pstack bundle, after principle-boundary-discipline and before principle-fix-root-causes.
TL;DR
One of pstack's principle skills, in Cursor's plugin repo, for any typed language: a branded intersection in TypeScript, a newtype elsewhere. A branded value is validated once, when it's created, and trusted downstream. RPC payloads, JSON, IPC messages, CLI arguments, config files, environment variables and database rows count as untyped until a parse function turns them into the typed model. When a protocol buffer, OpenAPI spec, GraphQL schema, database migration or design-token file owns a shape, the type comes from it instead of a hand-written copy. For where validation goes it points to pstack's boundary-discipline principle, and for TypeScript syntax to its typescript-best-practices skill.
Summarizes the skill at 8ecfb19.
npx skills add https://github.com/cursor/plugins --skill principle-type-system-discipline skills.sh pageSource on GitHubAll skills from cursor/plugins
- Total Downloads
- 5,300 on skills.sh, Nov 9, 2026
- Repo stars
- 15,776 cursor/plugins
- First seen
- May 24, 2026 on skills.sh
Weekly values
| Week to | Installs |
|---|---|
| Sep 21 | 307 |
| Sep 28 | 344 |
| Oct 5 | 411 |
| Oct 12 | 334 |
| Oct 19 | 461 |
| Oct 26 | 498 |
| Nov 2 | 385 |
| Nov 9 | 334 |
| Category |
Test-first work, implementation from specs, git hygiene and scope control. Everything for building software: planning, coding, debugging, design, frameworks, cloud, agents and skills. |
|---|---|
| Type |
Knowledge and rules the agent applies while it works: best practices, design principles, API references. |
| Effect |
Adds no side effects of its own. It shapes how the agent thinks, writes or reviews. Guidelines and routers are always effect:none, even when the task they support edits code. |
| Needs |
Instructions only. Works in any agent that supports skills. |
| Publisher |
Everyone else. Unverified vendor claims default to community. |
| Topics |
SKILL.md
From cursor/plugins at 8ecfb19. Checked daily, last changed Nov 6, 2026.
Frontmatter
name: principle-type-system-discipline
description: "Apply when designing types, reviewing a function signature, or writing code in any statically-typed language. Make illegal states unrepresentable, brand semantic primitives, parse external data at boundaries, exhaust variants, derive from authoritative schemas."
disable-model-invocation: trueType System Discipline
Make the compiler reject impossible states, mismatched primitives, and unhandled variants. Prefer defining errors and special cases out of existence over proliferating handlers. For TypeScript syntax, see the typescript-best-practices skill.
- Brand semantic primitives.
UserIdandOrderIdare strings underneath but should not be interchangeable. Give each its own type, such as a branded intersection in TypeScript or a newtype elsewhere. Validate once at creation, trust the type downstream. If two arguments share a primitive type but mean different things, brand them. - External data is untyped until parsed. RPC payloads, JSON, IPC messages, CLI args, config files, environment variables, database rows. Have a parse function at every boundary that turns unstructured input into the typed model. The boundary-discipline principle skill says where to put validation.
- Derive types from authoritative schemas. When a protocol buffer, OpenAPI spec, GraphQL schema, database migration, design-token file, or another file owns a shape, derive from it instead of hand-rolling a parallel type. See the encode-lessons-in-structure principle skill.