Back

Principle Type System Discipline

Marketing & SEO8.3K installs

What it does

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.

Install

npx skills add https://github.com/backnotprop/pstack --skill principle-type-system-discipline

Website

www.skills.sh/backnotprop/pstack/principle-type-system-discipline

Details

From the skill’s SKILL.md or README, by its authors. View the original

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.
See all
  • Marketing & SEO

    Find Reddit threads where people are genuinely asking for what you offer, then draft short, genuinely helpful replies — disclosing your affiliation honestly and naming your product only when it truly answers the question. Two moves: discovery — scan the right subreddits for…

    npx skills add https://github.com/flowkit-labs/skills --skill reddit-automation
    1.3M installs
  • Marketing & SEO

    When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not…

    npx skills add https://github.com/coreyhaines31/marketingskills --skill seo-audit
    249.6K installs
  • Marketing & SEO

    When the user wants to write, rewrite, or improve marketing copy for any page, including homepage, landing pages, pricing pages, feature pages, about pages, or product pages. Also use when the user says "write copy for," "improve this copy," "rewrite this page," "marketing…

    npx skills add https://github.com/coreyhaines31/marketingskills --skill copywriting
    249.5K installs
  • Marketing & SEO

    When the user wants to apply psychological principles, mental models, or behavioral science to marketing. Also use when the user mentions 'psychology,' 'mental models,' 'cognitive bias,' 'persuasion,' 'behavioral science,' 'why people buy,' 'decision-making,' 'consumer…

    npx skills add https://github.com/coreyhaines31/marketingskills --skill marketing-psychology
    173.8K installs

Skills are shared by members and not reviewed by us. Read a skill’s code before you install it.