Design Interface
Give callers a usable contract that puts coordination and change in a justified
place, with enough detail to implement and verify the choice.
- Ground the decision in representative callers, current behavior, and the
change or testing difficulty that prompted it. Trace the knowledge each caller
repeats and what actually varies. Preserve the project's domain terms and
accepted constraints; mark missing behavior or ownership decisions as open
rather than choosing product policy through a type signature.
- Place responsibilities where their information and consistency requirements
can be satisfied. Hide coordination that callers otherwise repeat, while
leaving necessary caller choices visible. Account for resource ownership,
ordering, failure, cancellation, concurrency, and compatibility where relevant.
A smaller signature can conceal more obligations; fewer methods or more hidden
code does not by itself improve a design.
- Sketch a concrete contract and realistic caller use, including a consequential
failure or lifecycle path. State inputs, results, obligations, and which side
owns side effects and recovery. Compare against the current design or a
materially different alternative using caller burden, change locality, and
required guarantees. Keep the existing boundary when a wrapper or merger adds
indirection or couples responsibilities without demonstrated benefit.
- Choose dependency control from the behavior that must be exercised. A single
production implementation can still need a boundary for time, I/O, lifetime,
or isolation; a second adapter is not a prerequisite. Conversely, a test alone
does not justify exposing internal wiring to every caller. State what can be
verified through the proposed contract and what needs real dependency or
integration evidence. Keep useful existing tests unless their coverage is
demonstrably replaced; a redesign is not blanket authority to delete them.
- Recommend a design with its decisive trade-off, supported guarantees, and any
remaining uncertainty. Return or record the contract at the requested scope.
Distinguish a worked example from executed proof and a proposed interface from
implemented behavior. Stop when representative callers and the material failure
or lifecycle path fit the contract, responsibility and verification ownership
are explicit, and the choice or unresolved blocker is reviewable.
This Skill owns the interface decision. Code discovery stays in tools; ordinary
implementation and behavior-preserving structural edits are separate outcomes.
Domain modeling resolves disputed meaning, critique tests a selected proposal,
and test-first work controls implementation order. Compose only when their
independent outcomes are also requested. Choosing an interface does not require
a glossary, an ADR, multiple agents, or implementation permission beyond the
user's existing scope.
1---2name: design-interface3description: Design a code interface and its responsibility boundary from concrete caller needs. Use when choosing what a module exposes, where coordination belongs, or how callers control dependencies and lifecycle. Do not use for visual UI design, domain terminology alone, critique alone, or implementing a settled feature or refactor without an unresolved interface decision.4license: Apache-2.05---67# Design Interface89Give callers a usable contract that puts coordination and change in a justified10place, with enough detail to implement and verify the choice.11121. Ground the decision in representative callers, current behavior, and the13 change or testing difficulty that prompted it. Trace the knowledge each caller14 repeats and what actually varies. Preserve the project's domain terms and15 accepted constraints; mark missing behavior or ownership decisions as open16 rather than choosing product policy through a type signature.172. Place responsibilities where their information and consistency requirements18 can be satisfied. Hide coordination that callers otherwise repeat, while19 leaving necessary caller choices visible. Account for resource ownership,20 ordering, failure, cancellation, concurrency, and compatibility where relevant.21 A smaller signature can conceal more obligations; fewer methods or more hidden22 code does not by itself improve a design.233. Sketch a concrete contract and realistic caller use, including a consequential24 failure or lifecycle path. State inputs, results, obligations, and which side25 owns side effects and recovery. Compare against the current design or a26 materially different alternative using caller burden, change locality, and27 required guarantees. Keep the existing boundary when a wrapper or merger adds28 indirection or couples responsibilities without demonstrated benefit.294. Choose dependency control from the behavior that must be exercised. A single30 production implementation can still need a boundary for time, I/O, lifetime,31 or isolation; a second adapter is not a prerequisite. Conversely, a test alone32 does not justify exposing internal wiring to every caller. State what can be33 verified through the proposed contract and what needs real dependency or34 integration evidence. Keep useful existing tests unless their coverage is35 demonstrably replaced; a redesign is not blanket authority to delete them.365. Recommend a design with its decisive trade-off, supported guarantees, and any37 remaining uncertainty. Return or record the contract at the requested scope.38 Distinguish a worked example from executed proof and a proposed interface from39 implemented behavior. Stop when representative callers and the material failure40 or lifecycle path fit the contract, responsibility and verification ownership41 are explicit, and the choice or unresolved blocker is reviewable.4243This Skill owns the interface decision. Code discovery stays in tools; ordinary44implementation and behavior-preserving structural edits are separate outcomes.45Domain modeling resolves disputed meaning, critique tests a selected proposal,46and test-first work controls implementation order. Compose only when their47independent outcomes are also requested. Choosing an interface does not require48a glossary, an ADR, multiple agents, or implementation permission beyond the49user's existing scope.