principle-type-system-discipline
/principle-type-system-discipline
Projektuje typy tak, by nielegalnych stanów nie dało się zapisać, parsuje dane zewnętrzne na granicach, wyczerpuje warianty i wyprowadza typy z autorytatywnych schematów.
- Autor
- workerstack ↗
- Repozytorium
- clients ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 10.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 10.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Projektuje typy tak, by nielegalnych stanów nie dało się zapisać, parsuje dane zewnętrzne na granicach, wyczerpuje warianty i wyprowadza typy z autorytatywnych schematów.
Oryginalny opis (EN)
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. Use for /principle-type-system-discipline.
Jak działa
SKILL.md bez nagłówków drugiego poziomu · 10 linii, 167 słów
Podgląd SKILL.md
--- 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. Use for /principle-type-system-discipline." --- # 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 `/typescript-best-practices`. Slash `/principle-type-system-discipline` only. Not a session flag. - **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. `/principle-boundary-discipline` 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 `/principle-encode-lessons-in-structure`.
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · workerstack/clients | 86 | MIT |
| requie/endostack | 90 | MIT |
| chmonitor/chmonitor | 86 | GPL-3.0 |
| asarelcastellanos/claude-workbench | 86 | MIT |
| xinhi6716/axiom-atropos | 86 | MIT |
| lgarceau768/agent-principles | 86 | MIT |
| robansuini/pstack-codex | 86 | MIT |
| koolamusic/claudefiles | 86 | MIT |
| Sup-Film/pstack-omp-lean | 86 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki 183170903a54 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100parse-dont-validate
Stosuje zasadę projektowania opartą na typach: zamienia dane niestrukturalne w typy strukturalne na granicach systemu, tak by stany niedozwolone były niereprezentowalne, przy walidacji, typach danych i obsłudze błędów. - 86principle-boundary-discipline
Skupia walidację na granicach systemu (CLI, konfiguracja, sieć, zewnętrzne API), wewnętrznym typom ufa, a logikę biznesową trzyma w czystych funkcjach. - 90principle-boundary-discipline
Skupia walidację i obsługę błędów na granicach systemu: CLI, konfiguracja, sieć i zewnętrzne API, a logikę biznesową zostawia w czystych funkcjach. - 90design
Projektuje API, schematy, typy i automaty stanów tak, by błędne użycie nie dawało się wyrazić: typy brandowane, unie dyskryminowane, typestate i parse-don't-validate. - 86principle-boundary-discipline
Skupia walidację i obsługę błędów na granicach systemu: CLI, konfiguracji, sieci i API, a logikę trzyma w czystych funkcjach. - 86principle-boundary-discipline
Skupia walidację na granicach systemu (CLI, konfiguracja, sieć, zewnętrzne API), wewnętrznym typom ufa, a logikę biznesową trzyma w czystych funkcjach.