api-and-interface-design — for Claude Code api-and-interface-design, community, for Claude Code, ide skills, agent-orchestration, ai-agents, audit-trail, capability-based-security, human-in-the-loop, operating-system

v1.0.0

关于此技能

适用场景: Ideal for AI agents that need api and interface design. 本地化技能摘要: An agent-first runtime where AI agents are native processes, capabilities replace permissions, and the system is designed for autonomy — not human interaction. It covers agent-orchestration, ai-agents, audit-trail workflows.

功能特性

API and Interface Design
Designing new API endpoints
Defining module boundaries or contracts between teams
Creating component prop interfaces
Establishing database schema that informs API shape

# 核心主题

Joncik91 Joncik91
[3]
[1]
更新于: 4/25/2026

技能概览

先看适用场景、限制条件和安装路径,再决定是否继续深入。

适用场景: Ideal for AI agents that need api and interface design. 本地化技能摘要: An agent-first runtime where AI agents are native processes, capabilities replace permissions, and the system is designed for autonomy — not human interaction. It covers agent-orchestration, ai-agents, audit-trail workflows.

核心价值

推荐说明: api-and-interface-design helps agents api and interface design. An agent-first runtime where AI agents are native processes, capabilities replace permissions, and the system is designed for autonomy — not human

适用 Agent 类型

适用场景: Ideal for AI agents that need api and interface design.

赋予的主要能力 · api-and-interface-design

适用任务: Applying API and Interface Design
适用任务: Applying Designing new API endpoints
适用任务: Applying Defining module boundaries or contracts between teams

! 使用限制与门槛

  • 限制说明: Don't leak implementation details. If users can observe it, they will depend on it.
  • 限制说明: // Partial update — only provided fields change
  • 限制说明: Don't leak implementation details

关于来源内容

The section below comes from the upstream repository. Use it as supporting material alongside the fit, use-case, and installation summary on this page.

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

api-and-interface-design 是什么?

适用场景: Ideal for AI agents that need api and interface design. 本地化技能摘要: An agent-first runtime where AI agents are native processes, capabilities replace permissions, and the system is designed for autonomy — not human interaction. It covers agent-orchestration, ai-agents, audit-trail workflows.

如何安装 api-and-interface-design?

运行命令:npx killer-skills add Joncik91/aaOS/api-and-interface-design。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

api-and-interface-design 适用于哪些场景?

典型场景包括:适用任务: Applying API and Interface Design、适用任务: Applying Designing new API endpoints、适用任务: Applying Defining module boundaries or contracts between teams。

api-and-interface-design 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

api-and-interface-design 有哪些限制?

限制说明: Don't leak implementation details. If users can observe it, they will depend on it.;限制说明: // Partial update — only provided fields change;限制说明: Don't leak implementation details。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add Joncik91/aaOS/api-and-interface-design。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    api-and-interface-design 已启用,可立即在当前项目中调用。

! 来源说明

此页面仍可作为安装与查阅参考。继续使用前,请结合上方适用场景、限制条件和上游仓库说明一起判断。

Upstream Repository Material

The section below comes from the upstream repository. Use it as supporting material alongside the fit, use-case, and installation summary on this page.

Upstream Source

api-and-interface-design

安装 api-and-interface-design,这是一款面向AI agent workflows and automation的 AI Agent Skill。查看功能、使用场景、限制条件与安装命令。

SKILL.md
Readonly
Upstream Repository Material
The section below comes from the upstream repository. Use it as supporting material alongside the fit, use-case, and installation summary on this page.
Upstream Source

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
1// Define the contract first 2interface TaskAPI { 3 // Creates a task and returns the created task with server-generated fields 4 createTask(input: CreateTaskInput): Promise<Task>; 5 6 // Returns paginated tasks matching filters 7 listTasks(params: ListTasksParams): Promise<PaginatedResult<Task>>; 8 9 // Returns a single task or throws NotFoundError 10 getTask(id: string): Promise<Task>; 11 12 // Partial update — only provided fields change 13 updateTask(id: string, input: UpdateTaskInput): Promise<Task>; 14 15 // Idempotent delete — succeeds even if already deleted 16 deleteTask(id: string): Promise<void>; 17}

2. Consistent Error Semantics

Pick one error strategy and use it everywhere:

typescript
1// REST: HTTP status codes + structured error body 2// Every error response follows the same shape 3interface APIError { 4 error: { 5 code: string; // Machine-readable: "VALIDATION_ERROR" 6 message: string; // Human-readable: "Email is required" 7 details?: unknown; // Additional context when helpful 8 }; 9} 10 11// Status code mapping 12// 400 → Client sent invalid data 13// 401 → Not authenticated 14// 403 → Authenticated but not authorized 15// 404 → Resource not found 16// 409 → Conflict (duplicate, version mismatch) 17// 422 → Validation failed (semantically invalid) 18// 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
1// Validate at the API boundary 2app.post('/api/tasks', async (req, res) => { 3 const result = CreateTaskSchema.safeParse(req.body); 4 if (!result.success) { 5 return res.status(422).json({ 6 error: { 7 code: 'VALIDATION_ERROR', 8 message: 'Invalid task data', 9 details: result.error.flatten(), 10 }, 11 }); 12 } 13 14 // After validation, internal code trusts the types 15 const task = await taskService.create(result.data); 16 return res.status(201).json(task); 17});

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
1// Good: Add optional fields 2interface CreateTaskInput { 3 title: string; 4 description?: string; 5 priority?: 'low' | 'medium' | 'high'; // Added later, optional 6 labels?: string[]; // Added later, optional 7} 8 9// Bad: Change existing field types or remove fields 10interface CreateTaskInput { 11 title: string; 12 // description: string; // Removed — breaks existing consumers 13 priority: number; // Changed from string — breaks existing consumers 14}

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"

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
1// Request 2GET /api/tasks?page=1&pageSize=20&sortBy=createdAt&sortOrder=desc 3 4// Response 5{ 6 "data": [...], 7 "pagination": { 8 "page": 1, 9 "pageSize": 20, 10 "totalItems": 142, 11 "totalPages": 8 12 } 13}

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
1// Only title changes, everything else preserved 2PATCH /api/tasks/123 3{ "title": "Updated title" }

TypeScript Interface Patterns

Use Discriminated Unions for Variants

typescript
1// Good: Each variant is explicit 2type TaskStatus = 3 | { type: 'pending' } 4 | { type: 'in_progress'; assignee: string; startedAt: Date } 5 | { type: 'completed'; completedAt: Date; completedBy: string } 6 | { type: 'cancelled'; reason: string; cancelledAt: Date }; 7 8// Consumer gets type narrowing 9function getStatusLabel(status: TaskStatus): string { 10 switch (status.type) { 11 case 'pending': return 'Pending'; 12 case 'in_progress': return `In progress (${status.assignee})`; 13 case 'completed': return `Done on ${status.completedAt}`; 14 case 'cancelled': return `Cancelled: ${status.reason}`; 15 } 16}

Input/Output Separation

typescript
1// Input: what the caller provides 2interface CreateTaskInput { 3 title: string; 4 description?: string; 5} 6 7// Output: what the system returns (includes server-generated fields) 8interface Task { 9 id: string; 10 title: string; 11 description: string | null; 12 createdAt: Date; 13 updatedAt: Date; 14 createdBy: string; 15}

Use Branded Types for IDs

typescript
1type TaskId = string & { readonly __brand: 'TaskId' }; 2type UserId = string & { readonly __brand: 'UserId' }; 3 4// Prevents accidentally passing a UserId where a TaskId is expected 5function 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

相关技能

寻找 api-and-interface-design 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

本地化技能摘要: 🦞 # OpenClaw Release Maintainer Use this skill for release and publish-time workflow. It covers ai, assistant, crustacean workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

333.8k
0
AI

widget-generator

Logo of f
f

本地化技能摘要: Generate customizable widget plugins for the prompts.chat feed system # Widget Generator Skill This skill guides creation of widget plugins for prompts.chat . It covers ai, artificial-intelligence, awesome-list workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf

149.6k
0
AI

flags

Logo of vercel
vercel

本地化技能摘要: The React Framework # Feature Flags Use this skill when adding or changing framework feature flags in Next.js internals. It covers blog, browser, compiler workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

本地化技能摘要: Usage Modes No Argument If the user invokes /pr-review with no arguments, do not perform a review . It covers autograd, deep-learning, gpu workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

98.6k
0
开发者工具