Agent skill

API And Interface Design

by dzhalaevd in dzhalaevd/Donatello

Guides stable API and interface design. An agent skill from dzhalaevd/Donatello.

Apache-2.0Auto-check passedBackend & APIs

Install API And Interface Design

skills CLI
$ npx skills add dzhalaevd/Donatello --skill api-and-interface-design -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dzhalaevd/Donatello api-and-interface-design --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dzhalaevd/Donatello.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/api-and-interface-design .claude/skills/api-and-interface-design && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
api-and-interface-design
GitHub stars
135
Used in
9 other repos
Token cost
~2.6k tokens
SKILL.md length
728 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
Apache-2.0

At a glance

Guides stable API and interface design. An agent skill from dzhalaevd/Donatello.

  • Works in 5 steps: Contract First → Consistent Error Semantics → Validate at Boundaries → …
  • Module boundaries
  • SKILL.md covers Overview, When to Use, Core Principles and REST API Patterns, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

API And Interface Design is an agent skill from dzhalaevd/Donatello. 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.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering API design and GraphQL. It works with GraphQL. The repository describes itself as: Make Dating Great Again. An open source dating platform. The licence is Apache-2.0.

When your agent uses it

  • Module boundaries
  • Any public interface
  • GraphQL endpoints
  • Defining type contracts between modules

Example prompts

  • “Use the api-and-interface-design skill to guide stable API and interface design. An agent skill from dzhalaevd/Donatello”
  • “/api-and-interface-design”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Contract First
  2. Consistent Error Semantics
  3. Validate at Boundaries
  4. Prefer Addition Over Modification
  5. Predictable Naming

What it can do on your machine

Read from SKILL.md and the folder at commit b57816e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

API And Interface Design loads about 2.6k tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 728 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dzhalaevd/Donatello at commit b57816e, republished under its Apache-2.0 licence (© dzhalaevd). 728 words, ~2,565 tokens.

Download SKILL.mdSave it as .claude/skills/api-and-interface-design/SKILL.md (or your agent's skills folder).
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.

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 database
4. Prefer Addition Over Modification

Extend interfaces without breaking existing consumers:

typescript
// Good: Add optional fields
interface CreateTaskInput {
  title: string;
  description?: string;
  priority?: 'low' | 'medium' | 'high';  // Added later, optional
  labels?: string[];                       // Added later, optional
}

// Bad: Change existing field types or remove fields
interface CreateTaskInput {
  title: string;
  // description: string;  // Removed — breaks existing consumers
  priority: number;         // Changed from string — breaks existing consumers
}
5. Predictable Naming
PatternConventionExample
REST endpointsPlural nouns, no verbsGET /api/tasks, POST /api/tasks
Query paramscamelCase?sortBy=createdAt&pageSize=20
Response fieldscamelCase{ createdAt, updatedAt, taskId }
Boolean fieldsis/has/can prefixisComplete, hasAttachments
Enum valuesUPPER_SNAKE"IN_PROGRESS", "COMPLETED"
Show full SKILL.md (278 more words)Show less

REST API Patterns

Resource Design
GET    /api/tasks              → List tasks (with query params for filtering)
POST   /api/tasks              → Create a task
GET    /api/tasks/:id          → Get a single task
PATCH  /api/tasks/:id          → Update a task (partial)
DELETE /api/tasks/:id          → Delete a task

GET    /api/tasks/:id/comments → List comments for a task (sub-resource)
POST   /api/tasks/:id/comments → Add a comment to a task
Pagination

Paginate list endpoints:

typescript
// Request
GET /api/tasks?page=1&pageSize=20&sortBy=createdAt&sortOrder=desc

// Response
{
  "data": [...],
  "pagination": {
    "page": 1,
    "pageSize": 20,
    "totalItems": 142,
    "totalPages": 8
  }
}
Filtering

Use query parameters for filters:

GET /api/tasks?status=in_progress&assignee=user123&createdAfter=2025-01-01
Partial Updates (PATCH)

Accept partial objects — only update what's provided:

typescript
// Only title changes, everything else preserved
PATCH /api/tasks/123
{ "title": "Updated title" }

TypeScript Interface Patterns

Use Discriminated Unions for Variants
typescript
// Good: Each variant is explicit
type TaskStatus =
  | { type: 'pending' }
  | { type: 'in_progress'; assignee: string; startedAt: Date }
  | { type: 'completed'; completedAt: Date; completedBy: string }
  | { type: 'cancelled'; reason: string; cancelledAt: Date };

// Consumer gets type narrowing
function getStatusLabel(status: TaskStatus): string {
  switch (status.type) {
    case 'pending': return 'Pending';
    case 'in_progress': return `In progress (${status.assignee})`;
    case 'completed': return `Done on ${status.completedAt}`;
    case 'cancelled': return `Cancelled: ${status.reason}`;
  }
}
Input/Output Separation
typescript
// Input: what the caller provides
interface CreateTaskInput {
  title: string;
  description?: string;
}

// Output: what the system returns (includes server-generated fields)
interface Task {
  id: string;
  title: string;
  description: string | null;
  createdAt: Date;
  updatedAt: Date;
  createdBy: string;
}
Use Branded Types for IDs
typescript
type TaskId = string & { readonly __brand: 'TaskId' };
type UserId = string & { readonly __brand: 'UserId' };

// Prevents accidentally passing a UserId where a TaskId is expected
function getTask(id: TaskId): Promise<Task> { ... }

Common Rationalizations

RationalizationReality
"We'll document the API later"The types ARE the documentation. Define them first.
"We don't need pagination for now"You will the moment someone has 100+ items. Add it from the start.
"PATCH is complicated, let's just use PUT"PUT requires the full object every time. PATCH is what clients actually want.
"We'll version the API when we need to"Breaking changes without versioning break consumers. Design for extension from the start.
"Nobody uses that undocumented behavior"Hyrum's Law: if it's observable, somebody depends on it. Treat every public behavior as a commitment.
"We can just maintain two versions"Multiple versions multiply maintenance cost and create diamond dependency problems. Prefer the One-Version Rule.
"Internal APIs don't need contracts"Internal consumers are still consumers. Contracts prevent coupling and enable parallel work.

Red Flags

  • Endpoints that return different shapes depending on conditions
  • Inconsistent error formats across endpoints
  • Validation scattered throughout internal code instead of at boundaries
  • Breaking changes to existing fields (type changes, removals)
  • List endpoints without pagination
  • Verbs in REST URLs (/api/createTask, /api/getUsers)
  • Third-party API responses used without validation or sanitization

Verification

After designing an API:

  • Every endpoint has typed input and output schemas
  • Error responses follow a single consistent format
  • Validation happens at system boundaries only
  • List endpoints support pagination
  • New fields are additive and optional (backward compatible)
  • Naming follows consistent conventions across all endpoints
  • API documentation or types are committed alongside the implementation

© dzhalaevd, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/api-and-interface-design of dzhalaevd/Donatello.

Open the folder on GitHubat commit b57816e

Used in 9 other repositories

We found 13 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 9 other GitHub owners. This page covers the copy in dzhalaevd/Donatello, which our catalogue first saw on October 7, 2026.

Compare with similar skills

API And Interface Design next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

API And Interface Design compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
API And Interface Design this skilldzhalaevd/Donatello1359 repos~2.6kAutomated safety check: PassApache-2.0
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
Nodejs Backend Patternsever-works/ever-works15817 repos~4kAutomated safety check: PassAGPL-3.0
API Design Principlesjh941213/my-cc-harness12619 repos~3.4kAutomated safety check: PassNone
Designing APIsCloudAI-X/claude-workflow-v21.4k2 repos~1.2kAutomated safety check: PassMIT
GraphQL ArchitectJeffallan/claude-skills12k1 repos~1.3kAutomated safety check: PassMIT

Similar skills

  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    158 GitHub starsUsed in 17 repos~4k tokens
    Backend & APIsAuto-check passed
  • API Design Principles

    jh941213/my-cc-harness

    REST 및 GraphQL API 설계 원칙 가이드. An agent skill from jh941213/my-cc-harness.

    126 GitHub starsUsed in 19 repos~3.4k tokens
    Backend & APIsAuto-check passed
  • Designing APIs

    CloudAI-X/claude-workflow-v2

    Designs REST and GraphQL APIs including endpoints, error handling, versioning, and documentation.

    1.4k GitHub starsUsed in 2 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • GraphQL Architect

    Jeffallan/claude-skills

    Designs GraphQL schemas and Apollo Federation graphs, with DataLoader resolvers, subscriptions, query complexity limits and caching.

    12k GitHub starsUsed in 1 repo~1.3k tokens
    Backend & APIsAuto-check passed
  • API Design Reviewer

    oxbshw/LLM-Agents-Ecosystem-Handbook

    A skill your agent uses when reviewing a proposed REST or GraphQL API change before merge — checks contract clarity, backwards compatibility, errors, pagination, auth, and naming.

    551 GitHub stars~553 tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed

More from dzhalaevd/Donatello

All 15 skills in this repo
  • Documentation And Adrs

    dzhalaevd/Donatello

    Records decisions and documentation. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 8 repos~2.4k tokens
    Auto-check: notes
  • CI CD And Automation

    dzhalaevd/Donatello

    Automates CI/CD pipeline setup. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 7 repos~2.7k tokens
    Auto-check: notes
  • Deprecation And Migration

    dzhalaevd/Donatello

    Manages deprecation and migration. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 7 repos~3.1k tokens
    Auto-check passed
  • Instruments code so production behavior is visible and diagnosable.

    135 GitHub starsUsed in 5 repos~2.7k tokens
    Auto-check passed
  • Shipping And Launch

    dzhalaevd/Donatello

    Prepares production launches. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 5 repos~2.5k tokens
    Auto-check passed
  • Performance Optimization

    dzhalaevd/Donatello

    Optimizes application performance across frontend, backend, queries, and databases.

    135 GitHub starsUsed in 2 repos~3.7k tokens
    Auto-check passed

Works with

Categories

Questions about API And Interface Design

What does API And Interface Design do?

Guides stable API and interface design. An agent skill from dzhalaevd/Donatello. API And Interface Design is an agent skill from dzhalaevd/Donatello. Guides stable API and interface design.

When should I use API And Interface Design?

API And Interface Design fits situations like: module boundaries; any public interface; graphQL endpoints; defining type contracts between modules.

How do I install API And Interface Design in Claude Code?

Run `npx skills add dzhalaevd/Donatello --skill api-and-interface-design -a claude-code`. Or copy the skill folder (.agents/skills/api-and-interface-design in dzhalaevd/Donatello) into .claude/skills/api-and-interface-design in your project. Claude Code loads it when a task matches its description.

How do I install API And Interface Design in Codex?

Run `npx skills add dzhalaevd/Donatello --skill api-and-interface-design -a codex`. Or copy the skill folder (.agents/skills/api-and-interface-design in dzhalaevd/Donatello) into .agents/skills/api-and-interface-design in your project. Codex loads it when a task matches its description.

Can I use API And Interface Design in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dzhalaevd/Donatello --skill api-and-interface-design -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/api-and-interface-design, .gemini/skills/api-and-interface-design, .github/skills/api-and-interface-design and .opencode/skills/api-and-interface-design in your project.

What does API And Interface Design need to run?

SKILL.md names no scripts, command-line tools or credentials: API And Interface Design is instructions for the agent only.

Does API And Interface Design access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is API And Interface Design safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does API And Interface Design use?

API And Interface Design is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does API And Interface Design use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to API And Interface Design?

Skills that share tags, products or a category with API And Interface Design: API Designer (Jeffallan/claude-skills, 12k stars), Nodejs Backend Patterns (ever-works/ever-works, 158 stars), API Design Principles (jh941213/my-cc-harness, 126 stars) and Designing APIs (CloudAI-X/claude-workflow-v2, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains API And Interface Design?

dzhalaevd (a GitHub user) maintains it in dzhalaevd/Donatello, which has 135 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 3, 2026.

Source: dzhalaevd/Donatello on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.