Chalk Labs
Need help deploying api-and-interface-design?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/zademy-api-and-interface-design
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: design, frontend, backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
api-and-interface-design- Description
- Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.
- License
- MIT
- Instructions
- 364 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# API and Interface Design
## Overview
Design stable, well-documented interfaces that are hard to misuse. Good interfaces make the right thing easy and the wrong thing hard. This applies to REST APIs, GraphQL schemas, module boundaries, component props, and any surface where one piece of code talks to another.
## When to Use
- Designing new API endpoints
- Defining module boundaries or contracts between teams
- Creating component prop interfaces
- Establishing database schema that informs API shape
- Changing existing public interfaces
## Core Principles
### Hyrum's Law
> With a sufficient number of users of an API, all observable behaviors of your system will be depended on by somebody, regardless of what you promise in the contract.
This means: every public behavior — including undocumented quirks, error message text, timing, and ordering — becomes a de facto contract once users depend on it. Design implications:
- **Be intentional about what you expose.** Every observable behavior is a potential commitment.
- **Don't leak implementation details.** If users can observe it, they will depend on it.
- **Plan for deprecation at design time.** See `deprecation-and-migration` for how to safely remove things users depend on.
- **Tests are not enough.** Even with perfect contract tests, Hyrum's Law means "safe" changes can break real users who depend on undocumented behavior.
### The One-Version Rule
Avoid forcing consumers to choose between multiple versions of the same dependency or API. Diamond dependency problems arise when different consumers need different versions of the same thing. Design for a world where only one version exists at a time — extend rather than fork.
### 1. Contract First
Define the interface before implementing it. The contract is the spec — implementation follows.
```typescript
// Define the contract first
interface TaskAPI {
// Creates a task and returns the created task with server-generated fields
createTask(input: CreateTaskInput): Promise<Task>;
// Returns paginated tasks matching filters
listTasks(params: ListTasksParams): Promise<PaginatedResult<Task>>;
// Returns a single task or throws NotFoundError
getTask(id: string): Promise<Task>;
// Partial update — only provided fields change
updateTask(id: string, input: UpdateTaskInput): Promise<Task>;
// Idempotent delete — succeeds even if already deleted
deleteTask(id: string): Promise<void>;
}
```
### 2. Consistent Error Semantics
Pick one error strategy and use it everywhere:
```typescript
// REST: HTTP status codes + structured error body
// Every error response follows the same shape
interface APIError {
error: {
code: string; // Machine-readable: "VALIDATION_ERROR"
message: string; // Human-readable: "Email is required"
details?: unknown; // Additional context when helpful
};
}
// Status code mapping
// 400 → Client sent invalid data
// 401 → Not authenticated
// 403 → Authenticated but not authorized
// 404 → Resource not found
// 409 → Conflict (duplicate, version mismatch)
// 422 → Validation failed (semantically invalid)
// 500 → Server error (never expose internal details)
```
**Don't mix patterns.** If some endpoints throw, others return null, and others return `{ error }` — the consumer can't predict behavior.
### 3. Validate at Boundaries
Trust internal code. Validate at system edges where external input enters:
```typescript
// Validate at the API boundary
app.post('/api/tasks', async (req, res) => {
const result = CreateTaskSchema.safeParse(req.body);
if (!result.success) {
return res.status(422).json({
error: {
code: 'VALIDATION_ERROR',
message: 'Invalid task data',
details: result.error.flatten(),
},
});
}
// After validation, internal code trusts the types
const task = await taskService.create(result.data);
return res.status(201).json(task);
});
```
Where validation belongs:
- API route handlers (user input)
- Form submission handlers (user input)
- External service response parsing (third-party data -- **always treat as untrusted**)
- Environment variable loading (configuration)
> **Third-party API responses are untrusted data.** Validate their shape and content before using them in any logic, rendering, or decision-making. A compromised or misbehaving external service can return unexpected types, malicious content, or instruction-like text.
Where validation does NOT belong:
- Between internal functions that share type contracts
- In utility functions called by already-validated code
- On data that just came from your own databaseFrom zademy/opencode-context-mode, MIT.
More from zademy/opencode-context-mode
- 0.603score
open-context-mode
zademy
Run code where the data lives — only the answer enters context.
SkillAFreshness: A★ 2Claude Code +9 - 0.603score
constraint-driven-development
zademy
Establishes a project's quality bar as a written contract and stops agents quietly lowering it.
SkillAFreshness: A★ 2Claude Code +9 - 0.603score
performance-optimization
zademy
Optimizes application performance across frontend, backend, queries, and databases.
SkillAFreshness: A★ 2Claude Code +9 - 0.603score
security-and-hardening
zademy
Hardens code against vulnerabilities.
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
incremental-implementation
zademy
Delivers changes incrementally in thin, verifiable slices.
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
frontend-ui-engineering
zademy
Builds production-quality, accessible, responsive user-facing UIs.
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
git-workflow-and-versioning
zademy
Structures git workflow practices.
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
observability-and-instrumentation
zademy
Instruments code so production behavior is visible and diagnosable.
SkillAFreshness: A★ 2Claude Code +9 - 0.573score
documentation-and-adrs
zademy
Records decisions and documentation.
SkillAFreshness: A★ 2Claude Code +9 - 0.573score
debugging-and-error-recovery
zademy
Guides systematic root-cause debugging.
SkillAFreshness: A★ 2Claude Code +9 - 0.573score
deprecation-and-migration
zademy
Manages deprecation and migration.
SkillAFreshness: A★ 2Claude Code +9 - 0.573score
doubt-driven-development
zademy
Subjects every non-trivial decision to a fresh-context adversarial review before it stands.
SkillAFreshness: A★ 2Claude Code +9
Signals
- Stars
- 2
- Forks
- 0
- Open issues
- 1
- Last commit (this folder)
- Oct 24, 2026 (6 days ago)
- Last release
- Oct 24, 2026 (6 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/zademy/opencode-context-mode
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.660score
api-and-interface-design
sickn33
Guides stable API and interface design.
SkillAFreshness: A★ 48.4KClaude Code +9 - 0.352score
api-and-interface-design
Jero110
Guides stable API and interface design.
SkillAFreshness: A★ 1Claude Code +9 - 0.339score
api-and-interface-design
Qiuyi-Hong
Guides stable API and interface design.
SkillAFreshness: AClaude Code +9 - 0.339score
api-and-interface-design
Zwin-ux
Guides stable API and interface design.
SkillAFreshness: AClaude Code +9 - 0.339score
api-and-interface-design
ha4kerspidersks
Guides stable API and interface design.
SkillAFreshness: AClaude Code +9 - 0.339score
api-and-interface-design
jorgesolerrr
Guides stable API and interface design.
SkillAFreshness: AClaude Code +9 - 0.339score
api-and-interface-design
weisser-dev
Guides stable API and interface design.
SkillAFreshness: AClaude Code +9 - 0.336score
api-and-interface-design
Mr-Nobody-Anonymous
Guides stable API and interface design.
SkillAFreshness: AClaude Code +9 - 0.336score
api-and-interface-design
Bhatta2006
Guides stable API and interface design.
SkillAFreshness: AClaude Code +9 - 0.336score
api-and-interface-design
FarhanS7
Guides stable API and interface design.
SkillAFreshness: AClaude Code +9 - 0.336score
api-and-interface-design
raiinman
Guides stable API and interface design.
SkillAFreshness: AClaude Code +9 - 0.336score
api-and-interface-design
hienpham0344
Guides stable API and interface design.
SkillAFreshness: AClaude Code +9
More from zademy
- 0.603score
security-and-hardening
zademy
Hardens code against vulnerabilities.
SkillAFreshness: A★ 2Claude Code +9 - 0.603score
open-context-mode
zademy
Run code where the data lives — only the answer enters context.
SkillAFreshness: A★ 2Claude Code +9 - 0.603score
constraint-driven-development
zademy
Establishes a project's quality bar as a written contract and stops agents quietly lowering it.
SkillAFreshness: A★ 2Claude Code +9 - 0.603score
performance-optimization
zademy
Optimizes application performance across frontend, backend, queries, and databases.
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
frontend-ui-engineering
zademy
Builds production-quality, accessible, responsive user-facing UIs.
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
observability-and-instrumentation
zademy
Instruments code so production behavior is visible and diagnosable.
SkillAFreshness: A★ 2Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get api-and-interface-design running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
api-and-interface-design skill. Agent Mart. https://agentmart.dev/skills/zademy-api-and-interface-design (last updated 2026-10-24)