本文へ移動
cccskills
無料GitHub で公開

type-driven

Use when modeling a domain, encoding a state machine, hardening APIs, making invalid states unrepresentable, or parsing instead of validating. Not for TypeScript: use typescript-best-practices.

インストール方法を見る

含まれるファイル(5)

  • SKILL.md3.9 KB
  • agents/openai.yaml207 B
  • references/examples.md3.0 KB
  • references/formal-tools.md1.0 KB
  • references/patterns.md2.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Type-driven development

Contract

FieldBound contract
TriggerThe work is modeling a domain, encoding a state machine, hardening an API boundary, making invalid states unrepresentable, or parsing instead of validating.
AuthorityReversible local: writes only domain types, public signatures, and affected callers and tests; rollback is version control or undo. No remote mutation.
Side effectRewrites domain types, public signatures, and affected callers and tests to the new algebraic model.
DoneInvalid states are unconstructible, matches are exhaustive, boundaries parse, and no scattered post-hoc validation remains.

Inputs

Required: the domain problem, data model, or API surface to encode. Optional: existing types or callers to refactor.

Refusals

  • Will not add runtime guards to fix a type-design failure: fix the type design.
  • Will not add a wildcard arm to silence a non-exhaustive match: add the missing variant.
  • Will not proceed with type holes or incomplete bodies.
  • Will not use this approach when the language lacks ADTs, sealed hierarchies, or equivalent sum-type support: skip and report.

Procedure

  1. Plan. State the domain in one paragraph. List all valid states, all invalid states, and every operation with its preconditions and postconditions. If any operation is partial, mark it as such. Done when: the domain is stated with valid states, invalid states, and operations listed.
  2. Design types first. For each invalid state, write a type that the compiler prevents. Use ADTs, phantom types, branded types, newtype wrappers, sealed hierarchies, or opaque types, whichever the language supports. Do not write implementation bodies until all types compile. Done when: all types compile and every invalid state is unrepresentable.
  3. Parse at boundaries. For every untrusted input (external data, deserialization, FFI, user input), write a parse constructor that returns the new type. Do not return bool and defer validity to callers. Done when: every untrusted input boundary has a parse function returning the new type.
  4. Exhaustive matching. Encode state machine transitions as exhaustive match/switch/visit on the sum type. Compiler warnings on incomplete arms are failures. Done when: every state-machine transition is an exhaustive match with no wildcard arms.
  5. Verify. Run the language's strict type checker and exhaustiveness check. Fix the type design, not the implementation, when the checker reports an illegal state is representable. Done when: the type checker and exhaustiveness check pass.
  6. Build. Run the full target build. Implement the bodies guided by the types. Done when: the target build passes.

Failure and recovery

Failure classBehavior
Unsupported languageIf the language lacks ADTs, sealed hierarchies, or equivalent sum-type support, skip this approach and report.
Type checker failureBlock. Fix the type design until the invalid state is unrepresentable. Do not add runtime guards.
Non-exhaustive matchCompile-time failure. Add the missing variant to the type, not a wildcard arm.
Invalid state remains representableBlock. The type design is insufficient; iterate until the compiler enforces the invariant.
Type holes remainBlock. Complete all incomplete bodies or remove the holes before proceeding.
Build failsBlock. Resolve implementation errors until the target build passes.

Output

A domain type system where every algebraic constructor is present, every boundary has a parse function returning the new type, every state-machine variant is matched exhaustively, and no runtime validation scattered outside the parse layer remains.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Not for the Rust FFI binding layer: use rust-ffi.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

Use when configuring ADC sampling time, DMA-driven ADC, calibration, or DAC channel setup on bare-metal MCUs. Not for the DMA stream itself: use dma-baremetal.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

af-xdp

無料

Use when creating AF_XDP sockets, configuring UMEM and XSK rings, writing an XDP redirect program, or choosing copy versus zero-copy mode. Not for full kernel bypass: use dpdk.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

Use when a completed session needs an agent-environment retrospective. Not for an engineering retrospective from telemetry: use engineering-retrospective.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

Use when a redacted, trimmed agent transcript must be appended to a GitHub PR or issue body, with human approval and preview. Not for automated or model-initiated insertion.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

agents-md

無料

Use when a repo needs agent setup, AGENTS.md added or made lean, CLAUDE.md audited, or agent instructions scored or pruned. Not for remote, credential, publish, deploy, or irreversible changes.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

OutlineDriven のスキルをすべて見る

このスキルの問題を報告する