# API and interface design

> API and interface design is an open-source agent skill for design and media. Guides designing stable, hard-to-misuse APIs, REST endpoints and module contracts. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/addyosmani/agent-skills/tree/main/skills/api-and-interface-design
- **Repository:** https://github.com/addyosmani/agent-skills
- **GitHub stars:** 122,283
- **License:** MIT
- **Skill name:** api-and-interface-design
- **Collection:** https://github.com/addyosmani/agent-skills
- **Categories:** [design and media](https://ai-powered.com/categories/design-and-media), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill steers an agent toward designing interfaces that stay stable over time, covering REST and GraphQL endpoints, module boundaries, component props and the database shape that feeds an API. It stresses contract-first design, one consistent error format, and validating input only at system edges rather than inside internal code.

The guide walks through concrete conventions: plural resource URLs without verbs, paginated list endpoints, partial PATCH updates, additive and optional fields for backward compatibility, and discriminated unions or branded types in TypeScript. It also covers idempotency keys, explaining how to derive them from intent, claim them atomically with a unique constraint, reject reused keys with a different payload, and set retention longer than any retry path.

The skill is a single instruction file with code examples and no scripts. It is written with TypeScript and Express-style examples, and it ends with a red-flag list and a verification checklist the agent can run through after designing an API.

## When your agent uses it

> 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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/addyosmani/agent-skills/tree/HEAD/skills/api-and-interface-design)
- [License: MIT](https://github.com/addyosmani/agent-skills/tree/HEAD/skills/api-and-interface-design)

## Features

- **Contract-first interface design:** Defines the typed contract before implementation, so the spec drives the code.
- **Consistent error semantics:** Sets one error body shape and a status code mapping used across all endpoints.
- **Boundary validation rules:** Explains where input should be validated and treats third-party responses as untrusted.
- **Backward-compatible evolution:** Favors adding optional fields over changing or removing existing ones.
- **REST naming and pagination:** Covers resource URLs, query parameter naming, filtering, paging and PATCH updates.
- **Idempotency key handling:** Covers deriving keys from intent, atomic claims, payload checks and in-flight duplicate responses.
- **TypeScript interface patterns:** Shows discriminated unions, input and output separation and branded ID types.

## Good for

- Design a REST endpoint set for a task management service
- Review an API for inconsistent error formats and pagination gaps
- Define type contracts between a frontend and backend module
- Add idempotency key support to a payment or order endpoint
- Plan a backward-compatible change to an existing public interface

## Install

### Claude Code

This skill ships in the `agent-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add chrisalehman/bionic
/plugin install agent-skills@bionic
```

Or copy only this skill to `~/.claude/skills/api-and-interface-design`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/api-and-interface-design &&
cp -R "$tmp/skills/api-and-interface-design" ~/.claude/skills/api-and-interface-design &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/api-and-interface-design` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/api-and-interface-design` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/api-and-interface-design &&
cp -R "$tmp/skills/api-and-interface-design" ~/.agents/skills/api-and-interface-design &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/api-and-interface-design` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/api-and-interface-design` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/api-and-interface-design &&
cp -R "$tmp/skills/api-and-interface-design" ~/.cursor/skills/api-and-interface-design &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/api-and-interface-design` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/addyosmani/agent-skills.git --path skills/api-and-interface-design
```

Or copy the folder to `~/.gemini/skills/api-and-interface-design` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/api-and-interface-design`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/api-and-interface-design &&
cp -R "$tmp/skills/api-and-interface-design" ~/.copilot/skills/api-and-interface-design &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/api-and-interface-design` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/addyosmani/agent-skills.git
```

Then copy `agent-skills/skills/api-and-interface-design` into your agent's skills folder as `api-and-interface-design`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does API and interface design work with a specific language or framework?

The examples are written in TypeScript and use an Express-style route handler with a schema validator, but the principles described apply to REST and GraphQL design more broadly.

### Does API and interface design run any scripts or change files?

No. The skill contains only its SKILL.md instructions, with no scripts or additional reference files.

### When does the skill trigger?

It loads when a task involves designing APIs, module boundaries or public interfaces, creating REST or GraphQL endpoints, defining type contracts between modules, or setting boundaries between frontend and backend.

### How do I install API and interface design in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/api-and-interface-design to use it in all your projects, or to .claude/skills/api-and-interface-design in one project. Or install the agent-skills plugin, which includes it: /plugin marketplace add chrisalehman/bionic, then /plugin install agent-skills@bionic.

### Does API and interface design run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use API and interface design?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to API and interface design?

The closest alternatives to API and interface design are API design, API design, API design edho ferdian, API and Go API design.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [API design](https://ai-powered.com/skills/api-design): API design is an open-source agent skill for developer tools.
- [API design](https://ai-powered.com/skills/api-design-nabwinsaud): API design is an open-source agent skill for developer tools.
- [API design edho ferdian](https://ai-powered.com/skills/api-design-edho-ferdian): API design edho ferdian is an open-source agent skill for developer tools.
- [API](https://ai-powered.com/skills/api): API is an open-source agent skill for developer tools.
- [Go API design](https://ai-powered.com/skills/go-api-design): Go API design is an open-source agent skill for developer tools.
- [Codebase design](https://ai-powered.com/skills/codebase-design): Codebase design is an open-source agent skill for design and media.
- [Backend patterns](https://ai-powered.com/skills/backend-patterns): Backend patterns is an open-source agent skill for developer tools.
- [Contract first](https://ai-powered.com/skills/contract-first): Contract first is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/api-and-interface-design
