api-and-interface-design
Guides stable API and interface design for REST endpoints, GraphQL schemas, module boundaries, and component contracts.
Skill by jankneumann
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/jankneumann-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: documents, design, frontend, backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/api-and-interface-design
What's inside
- Skill name
api-and-interface-design- Description
- Guides stable API and interface design for REST endpoints, GraphQL schemas, module boundaries, and component contracts. Use when designing new APIs, defining type contracts between modules, establishing boundaries between frontend and backend, or modifying existing public interfaces. Covers Hyrum's Law, contract-first design, the One-Version Rule, REST resource patterns, pagination, PATCH semantics, and idiomatic type-system patterns in both TypeScript (discriminated unions, branded types) and Python (Pydantic discriminated unions, NewType branded types, FastAPI route shapes, frozen dataclasses).
- License
- MIT
- Instructions
- 503 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- body: 503 lines (spec recommends under 500)
- files: referenced but missing: references/security-checklist.md
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, function signatures, and any surface where one piece of code talks to another.
This skill ships with **TypeScript and Python examples side-by-side**. Pick the one that matches the codebase you are working in; the principles are identical.
## When to Use
- Designing new API endpoints
- Defining module boundaries or contracts between teams
- Creating component prop interfaces or function signatures
- 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.
Every observable behavior — including undocumented quirks, error message text, response ordering, and timing — 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.** Versioning, sunset headers, and migration paths are part of the original design, not a later cleanup.
- **Tests are not enough.** Even with perfect contract tests, "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:**
```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: TaskId): Promise<Task>;
// Partial update — only provided fields change
updateTask(id: TaskId, input: UpdateTaskInput): Promise<Task>;
// Idempotent delete — succeeds even if already deleted
deleteTask(id: TaskId): Promise<void>;
}
```
**Python (Protocol-style contract):**
```python
from typing import Protocol
from .models import Task, TaskId, CreateTaskInput, UpdateTaskInput, ListTasksParams, Page
class TaskAPI(Protocol):
async def create_task(self, payload: CreateTaskInput) -> Task: ...
async def list_tasks(self, params: ListTasksParams) -> Page[Task]: ...
async def get_task(self, task_id: TaskId) -> Task: ...
async def update_task(self, task_id: TaskId, patch: UpdateTaskInput) -> Task: ...
async def delete_task(self, task_id: TaskId) -> None: ...
```
A `Protocol` documents the contract independently of any concrete implementation, and both ASGI handlers and in-process callers can satisfy the same shape.
### 2. Consistent Error Semantics
Pick one error strategy and apply it everywhere.
**TypeScript:**
```typescript
interface APIError {
error: {
code: string; // Machine-readable: "VALIDATION_ERROR"
message: string; // Human-readable: "Email is required"
details?: unknown; // Additional context when helpful
};
}
```
**Python (FastAPI exception handler):**
```python
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
from pydantic import BaseModel
class APIErrorBody(BaseModel):
code: str
message: str
details: dict | None = None
class APIError(Exception):
def __init__(self, status: int, code: str, message: str, details: dict | None = None):
self.status = status
self.body = APIErrorBody(code=code, message=message, details=details)
app = FastAPI()
@app.exception_handler(APIError)
async def api_error_handler(_: Request, exc: APIError) -> JSONResponse:
return JSONResponse(status_code=exc.status, content={"error": exc.body.model_dump()})
```
HTTP status mapping (same in any language):
| Status | Meaning |
|---|---|From jankneumann/agentic-coding-tools, MIT.
More from jankneumann/agentic-coding-tools
- 0.611score
bug-scrub
jankneumann
Comprehensive project health diagnostic — collects signals from CI tools, reports, deferred work, code markers, and open GitHub issues
SkillAFreshness: A★ 4Claude Code +9 - 0.608score
autopilot-roadmap
jankneumann
Execute roadmap items iteratively with policy-aware vendor routing and learning feedback
SkillAFreshness: A★ 4Claude Code +9 - 0.608score
coordination-bridge
jankneumann
HTTP fallback bridge for coordinator when MCP transport is unavailable
SkillAFreshness: A★ 4Claude Code +9 - 0.605score
bao-vault
jankneumann
OpenBao/Vault credential seeding and management scripts
SkillAFreshness: A★ 4Claude Code +9 - 0.599score
autopilot
jankneumann
Orchestrate the full plan-review-implement-validate-PR lifecycle with multi-vendor review convergence
SkillAFreshness: A★ 4Claude Code +9 - 0.571score
audit-choices
jankneumann
Independent, read-only audit of implementation-time decisions made where the spec was silent, producing a schema-valid choices ledger
SkillBFreshness: B★ 4Claude Code +9 - 0.571score
collect-transcripts
jankneumann
Ingest raw session transcripts from coding-agent harnesses via vendor-specific adapters, normalize to a common event schema, triage for struggle signals, and…
SkillBFreshness: B★ 4Claude Code +9 - 0.571score
codebase-atlas
jankneumann
Render the architecture graph as a single self-contained interactive HTML page — foldable structure tree, animated dependency graph, and cross-connection…
SkillBFreshness: B★ 4Claude Code +9 - 0.568score
coordinator-task-status-renderer
jankneumann
Render and seed coordinator-owned task status block in OpenSpec tasks.md
SkillBFreshness: B★ 4Claude Code +9 - 0.568score
archive-roadmap
jankneumann
Archive a completed roadmap workspace to openspec/roadmaps/archive/<date>-<id>/
SkillBFreshness: B★ 4Claude Code +9 - 0.566score
agent-ergonomics
jankneumann
Refine a system design or plan to be maximally agent-intuitive, agent-ergonomic, and agent-accretive — grounded in simulated agent journeys and real friction…
SkillBFreshness: B★ 4Claude Code +9 - 0.565score
context-engineering
jankneumann
Curates the right context for an agent at the right time.
SkillBFreshness: B★ 4Claude Code +9
Signals
- Stars
- 4
- Forks
- 1
- Open issues
- 129
- Last commit (this folder)
- May 1, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from jankneumann
- 0.611score
bug-scrub
jankneumann
Comprehensive project health diagnostic — collects signals from CI tools, reports, deferred work, code markers, and open GitHub issues
SkillAFreshness: A★ 4Claude Code +9 - 0.608score
autopilot-roadmap
jankneumann
Execute roadmap items iteratively with policy-aware vendor routing and learning feedback
SkillAFreshness: A★ 4Claude Code +9 - 0.608score
coordination-bridge
jankneumann
HTTP fallback bridge for coordinator when MCP transport is unavailable
SkillAFreshness: A★ 4Claude Code +9 - 0.605score
bao-vault
jankneumann
OpenBao/Vault credential seeding and management scripts
SkillAFreshness: A★ 4Claude Code +9 - 0.599score
autopilot
jankneumann
Orchestrate the full plan-review-implement-validate-PR lifecycle with multi-vendor review convergence
SkillAFreshness: A★ 4Claude Code +9 - 0.571score
audit-choices
jankneumann
Independent, read-only audit of implementation-time decisions made where the spec was silent, producing a schema-valid choices ledger
SkillBFreshness: B★ 4Claude 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/jankneumann-api-and-interface-design (last updated 2026-10-24)