principle-type-system-discipline
Skill0 starsChanged 27 days agoMITView on GitHub
Use in statically typed code to make illegal states unrepresentable, distinguish semantic primitives, parse external data at boundaries, exhaust variants, and derive types from authoritative schemas.
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 43 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use the type checker as a proof assistant.
- Distinctive: line 14
Model variants explicitly: Prefer sum types, discriminated unions, sealed classes, or enums with payloads over bags of booleans and …
- Distinctive: line 19
Distinguish semantic primitives: Use branded, opaque, newtype, value-class, or phantom types when two strings or numbers must not be …
- Distinctive: line 35
Do same-primitive arguments represent different concepts?
“Common” is measured: kept by at least 6 in 10 of the 43 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.
Files
Type system discipline
Use the type checker as a proof assistant. Model invariants so invalid states cannot be constructed, rather than spreading runtime guards through the system.
Patterns
- Model variants explicitly. Prefer sum types, discriminated unions, sealed classes, or enums with payloads over bags of booleans and optional fields.
- Construct valid values. A non-empty list is a head plus a tail. A valid range is a start plus a validated non-negative duration. Use an opaque or branded duration so raw negative numbers cannot construct the illegal case.
- Distinguish semantic primitives. Use branded, opaque, newtype, value-class, or phantom types when two strings or numbers must not be interchangeable.
- Parse at boundaries. JSON, RPC, IPC, CLI args, configuration, environment values, and database rows are untyped until validated into the domain model.
- Do not lie to the compiler. Replace casts and unchecked assertions with validation, narrowing, or a better model.
- Exhaust every variant. Configure matching so a new case fails compilation at each incomplete consumer.
- Derive from the authority. Generate or infer types from protocol, OpenAPI, GraphQL, database, and design-token schemas instead of duplicating shapes.
- Strengthen only where partiality appears. Extra precision is valuable when it removes a crash or assertion, not when it only adds ceremony.
Review questions
- Can contradictory field combinations compile?
- Do same-primitive arguments represent different concepts?
- Where did each cast,
any, non-null assertion, or unsafe operation originate? - Will a newly added variant identify every unhandled match at compile time?
- Is this type duplicating a shape another artifact owns?
- Does the stronger type make an operation total, or only more elaborate?
Pair this with principle-boundary-discipline to place parsing and validation.
Other versions44 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 44
- backnotprop/pstack★ 3.3ksame name
- jtaroreh/agystack★ 128same name
- uzairansaruzi/p3-stack★ 126same name
- dsebban/skills★ 71same name
- Scino/fstack★ 18same name
- TheOnlyFusionCube/potetos-for-everyone★ 18same name
- creedants/pstack-t3★ 17same name
- mariusflorescu/pstack-t3★ 13same name
- adjohn/pstack★ 9same name
- kkgogogo17/pi-pstack★ 9same name
34 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use setup-pstack, poteto-help and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
bnemaSkillsetup-pstack
Configure which Pi models pstack uses per role. Detects available provider/model specs and writes pstack's user configuration. Use for /setup-pstack, "configure pstack models", or changing pstack model choices.
Also in 25 projects that use this
ianclearySkillpoteto-help
Guides users through pstack setup, /poteto-mode, and picking the skill, playbook, or principle for a task. Type /poteto-help with a question.
Also in 13 projects that use this
JoshueOsunaSkillPoteto Mode
poteto's agent style for concise, detailed responses, deliberate subagents, unslopped prose, simple code, and verified work. Use for poteto, /poteto-mode, or requests to work in this style.
Also in 4 projects that use this
In this repository60 other files it gives its agents.
- architectSkill
- arenaSkill
- automate-meSkill
- benchmark-checklistSkill
- blast-radiusSkill
- broSkill
- codebase-designSkill
- correctSkill
- create-formal-verification-skillSkill
- create-verification-skillSkill
- diagnosing-bugsSkill
- figure-it-outSkill
- howSkill
- interrogateSkill
- in-your-own-wordsSkill
- ketchupSkill
- ketchup-videoSkill
- maintain-formal-verification-skillSkill
- maintain-verification-skillSkill
- make-bot-uiSkill
- meta-modeSkill
- mstack-helpSkill
- no-commentsSkill
- principle-attack-the-premiseSkill
- principle-boundary-disciplineSkill
- principle-build-the-leverSkill
- principle-encode-lessons-in-structureSkill
- principle-exhaust-the-design-spaceSkill
- principle-experience-firstSkill
- principle-explain-the-numberSkill
- principle-fix-root-causesSkill
- principle-foundational-thinkingSkill
- principle-guard-the-context-windowSkill
- principle-laziness-protocolSkill
- principle-make-operations-idempotentSkill
- principle-migrate-callers-then-delete-legacy-apisSkill
- principle-minimize-reader-loadSkill
- principle-model-the-domainSkill
- principle-never-block-on-the-humanSkill
- principle-outcome-oriented-executionSkill
- principle-prove-it-worksSkill
- principle-redesign-from-first-principlesSkill
- principle-separate-before-serializing-shared-stateSkill
- principle-sequence-verifiable-unitsSkill
- principle-subtract-before-you-addSkill
- principle-test-behavior-not-implementationSkill
- recallSkill
- reflectSkill
- setup-mstackSkill
- sharpenSkill
- show-me-your-workSkill
- statechartSkill
- swarmSkill
- tddSkill
- teachSkill
- technical-writingSkill
- typescript-best-practicesSkill
- unslopSkill
- whySkill
- writing-for-agentsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

