principle-type-system-discipline

principle-type-system-discipline is a skill for Claude Code, Cursor from backnotprop/pstack. It costs 53 tokens per session (313 once invoked), scanned A, a copy of principle-type-system-discipline, MIT.

A set of rules for designing types and function interfaces in statically typed programming languages. It focuses on representing valid states clearly so the compiler can catch invalid combinations.

In plain words
What is it for?
Use it when designing data models, reviewing function signatures, handling external data, or writing typed code in languages such as TypeScript, Rust, Kotlin, or Swift.
Why use it?
It reduces runtime errors caused by missing cases, mismatched values, and contradictory optional fields.

Skill for Claude CodeCursor

Written for Claude Code and Cursor: disable-model-invocation in frontmatter, but also shipped in a Cursor plugin.

Part of the pstack plugin — 61 skills, 2 agents shipped together

Good fit Use it when designing data models, reviewing function signatures, handling external data, or writing typed code in languages such as TypeScript, Rust, Kotlin, or Swift.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/backnotprop/pstack/principle-type-system-discipline
About the project

pstack is a collection of plain Agent Skills and engineering principles that guide AI-assisted software development across coding agents such as Claude Code, Codex, Pi, Cursor, and OpenCode. It is for developers who want reusable practices for tasks including testing, technical writing, debugging, review, and coordinating agent work. The catalogue entries are the project's skills, agents, and plugin.

backnotprop/pstack · 2,800 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add backnotprop/pstack --skill principle-type-system-discipline
Clone the repo
git clone --depth 1 https://github.com/backnotprop/pstack

Made for: Claude Code, Cursor.

Or install pstack, the plugin that ships this one along with the rest of its 61 skills, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for principle-type-system-discipline

README.md
[![agentmods](https://agentmods.dev/badge/skills/backnotprop/pstack/principle-type-system-discipline/github.svg)](https://agentmods.dev/skills/backnotprop/pstack/principle-type-system-discipline)
Your own site
<a href="https://agentmods.dev/skills/backnotprop/pstack/principle-type-system-discipline"><img src="https://agentmods.dev/badge/skills/backnotprop/pstack/principle-type-system-discipline/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for principle-type-system-discipline

Your own site · 80×15
<a href="https://agentmods.dev/skills/backnotprop/pstack/principle-type-system-discipline"><img src="https://agentmods.dev/badge/skills/backnotprop/pstack/principle-type-system-discipline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 313 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 20 Oct 2026
  • Snyk pass 20 Oct 2026
How audits are shown
Origin 94% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00053 $0.00313
Opus 5.5 $0.00021 $0.00125
Sonnet 5.5 $0.00011 $0.00063
Haiku 4.5 $0.00005 $0.00031

Measured 6d ago against content hash 5cdaf79785e3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

principle-type-system-discipline scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

94% identical to principle-type-system-discipline — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/principle-type-system-discipline/SKILL.md · 14 lines

What it actually says

Type 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. UserId and OrderId are 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.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago Changed · -5 lines · -7 tokens per session 5cdaf79785e3
  2. 13d ago Changed · -13 lines 2e492cef34bb
  3. 1mo ago Changed c83da8031ffb
  4. 1mo ago First seen · 32 lines · 60 tokens per session scan A 662ed1ad53fb

Subscribe to this mod's changes

principle-type-system-discipline is a skill published in the GitHub repository backnotprop/pstack (2,800 stars, last pushed today), licensed MIT. It adds 53 tokens to every session and 313 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 94% identical to principle-type-system-discipline, differing in 2 lines, and is treated as a copy.

Related

Other skills, from other repositories

email-domain-security

Rigorous, defensible email-spoofability verdict and SPF supply-chain risk analysis computed from published DNS alone. Deepens the record-level SPF/DMARC/DKIM/BIMI/MTA-STS/DNSSEC fetch recipes in the offensive-osint arsenal (§16.14) with the reasoning that section doesn't do: a priority-ordered composite verdict for…

elementalsouls/Claude-OSINT · 362 tokens

exposure-risk-quantification

FAIR-aligned exposure quantification: turns a pile of recon findings into a defensible 0-100 + A-F org risk score (Likelihood x Impact, three ownership-aware factors: exposure/threat/impact), an ownership + proof demotion cap so unproven or weakly-owned findings can't inflate the number, a $-denominated FAIR…

elementalsouls/Claude-OSINT · 235 tokens

osint-methodology

Comprehensive OSINT methodology for external red-team operations and authorized attack-surface assessments. Covers the 6-stage recon pipeline (seed → asset expansion → enrichment → exposure analysis → convergence → operator-armed active validation) with connector-resilience and stage-vs-gating discipline, asset-graph…

elementalsouls/Claude-OSINT · 150 tokens

osint-autopilot

End-to-end external OSINT engagement autopilot. Run the FULL osint-methodology pipeline to completion in ONE go for an authorized domain — engagement folder, Stages 1-5 (seed, expansion, enrichment, exposure, convergence), multi-agent per-host content+JS fan-out, headline verification, auto-generated findings, and a…

elementalsouls/Claude-OSINT · 129 tokens

awareness

AI situational awareness — internal threat detection for hallucination risk, scope creep, and context degradation. Maps Cooper color codes to reasoning states and OODA loop to real-time decisions. Use during any task where reasoning quality matters, when operating in unfamiliar territory, after detecting early warning…

pjt222/agent-almanac · 82 tokens

collect-preserve-specimens

Collect and preserve insect specimens following museum-grade standards including legal compliance, collection methods, humane dispatch, dry pinning, wet preservation, labeling, storage, and curation. Covers permit requirements, protected species regulations, sweep nets, beating trays, pitfall traps, light traps…

pjt222/agent-almanac · 139 tokens