designing-public-interfaces
Skill10 starsChanged 44 days agoMITView on GitHub
Guides design of this SDK's public API surface. Use when adding, renaming, removing or reshaping any exported identifier in any module published as end-user, consumer-facing interface - whether that module be existing or new to the published surface area. Includes functional options, domain client accessors, error model, sentinel errors, error struct types, exported fields, the accessor pattern, constructor signatures and naming policy.
In this repository7 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
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 23
Before writing one, state who outside the module calls it and why.
- Distinctive: line 24
If the answer is another package of our own, it is not public API.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
The following documents will be helpful:
| Document | For |
standard.md | The canonical definition of "what good looks like" including authoritative guidance on encapsulation, immutability, API stability, third-party dependencies, idiomatic design, goroutines, channels, context, functional options pattern (FOP), background work ownership (close/shutdown requirements), mockability, error hygiene, logging, observability, zero values, documentation and examples. Frozen: consult it, never edit it (see DEVELOPMENT.md). |
decisions.md | Deep dive commentaries with both What and Why defined for key architectural decisions that shape the structure of this codebase, including how we design our public APIs such as our error model, doc-comment syntax, the HTTP customization seam (HTTPClient) and shared modules. |
DEVELOPMENT.md | Includes a comprehensive section on Naming. |
We must aim for consistency so patterns that already exist in this codebase should be considered for similarity and thus applicability for any new API design.
The interior counterpart of this skill is designing-internal-boundaries, which governs how the types behind the exported surface keep their contracts compiler-enforced.
A new or changed convention should also trigger the recording-decisions skill.
When not to add public API
An exported identifier is added only when an SDK user needs to call it directly. Before writing one, state who outside the module calls it and why. If the answer is another package of our own, it is not public API.
Reaching for an exported identifier to bridge a gap between two of our own packages means the shared thing belongs in a new internal package, or should be lifted into a common module.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

