/harness-build:api-and-interface-designfrom harness-build
Guides design of stable interfaces that are hard to misuse, covering REST and GraphQL endpoints, module boundaries, type contracts, errors, pagination and idempotency. Use when designing or changing any public interface, or when drawing the boundary between frontend and backend or between modules.
Ships in harness-build. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Design interfaces that make the right thing easy and the wrong thing hard. The same principles apply to REST endpoints, GraphQL schemas, module boundaries, component props, and any seam where one piece of code calls another.
With enough users, every observable behaviour will be depended on, whatever the contract says. That includes quirks, error text, timing and ordering. So: be deliberate about what you expose, do not leak implementation details, plan removal at design time (see harness-ship:deprecation-and-migration), and remember contract tests cannot catch reliance on undocumented behaviour.
Do not make consumers choose between versions of the same thing. Extend rather than fork, so a single version exists at a time and diamond dependency problems do not arise.
Write the interface, with comments stating semantics, before the implementation:
interface TaskAPI {
createTask(input: CreateTaskInput): Promise<Task>; // returns server-generated fields
listTasks(params: ListTasksParams): Promise<Page<Task>>;
getTask(id: string): Promise<Task>; // throws NotFoundError
updateTask(id: string, input: UpdateTaskInput): Promise<Task>; // partial update
deleteTask(id: string): Promise<void>; // idempotent
}
Use a single shape everywhere:
interface APIError {
error: { code: string; message: string; details?: unknown };
}
Map statuses consistently: 400 malformed, 401 unauthenticated, 403 unauthorized, 404 missing, 409 conflict, 422 semantically invalid, 500 server fault (never leak internals). Do not have some endpoints throw, some return null and others return an error object.
Validate where external input enters: route handlers, form handlers, third-party responses (always untrusted: check shape and content before use), and environment configuration. After validation, internal code trusts its types. Do not re-validate between internal functions or on data you just read from your own database.
Extend with optional fields. Removing a field or changing its type breaks existing consumers.
Plural nouns and no verbs in REST paths (GET /tasks), one casing style for params and fields, is/has/can prefixes for booleans, one convention for enum values. Match what the codebase already does.
Accepting a key is the contract; honouring it is the implementation. A key handled carelessly is worse than none, because the client now believes retry is safe.
charge:v1:<orderId>), never from the retrying layer.IDEMPOTENCY_KEY_REUSED), not the first response.GET /tasks list (filter by query params)
POST /tasks create
GET /tasks/:id read
PATCH /tasks/:id partial update
DELETE /tasks/:id delete
GET /tasks/:id/comments sub-resource
Paginate every list: accept page and page size (or an opaque page token) plus sort, and return the data with pagination metadata. Filter with query parameters (?status=open&assignee=u1). Accept partial bodies on PATCH and change only what is given.
{type:'pending'} | {type:'completed', completedAt:Date}).CreateTaskInput is what callers send; Task adds server-generated id, timestamps and owner.TaskId, UserId) so one cannot be passed for the other.| Rationalization | Reality |
|---|---|
| "We'll document it later" | The types are the documentation; write them first. |
| "No pagination yet" | You will need it the moment lists grow. |
| "PUT is simpler than PATCH" | PUT forces full objects; clients want partial updates. |
| "We'll version when needed" | Unplanned breaking changes break consumers. Design for extension. |
| "Nobody uses that undocumented behaviour" | Hyrum's Law says somebody does. |
| "We can run two versions" | Doubles maintenance and invites diamond problems. |
| "Internal APIs need no contract" | Internal consumers are consumers. |
| "Accepting the header is enough" | The key must be stored against the result and claimed atomically. |
| "Our queue is exactly-once" | Across a consumer crash it is not. Design for at-least-once with idempotent handlers. |
| "Duplicates are rare" | They spike exactly when a dependency is degraded. |
What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/code-simplificationReduces complexity in working code while preserving exact behaviour, so it is easier to read, change and debug. Use when code works but is deeply nested, overlong, unclearly named or duplicated, when review flags readability, or when asked to simplify, clean up or flatten a function or module./context-engineeringCurates what an agent sees (rules files, specs, source, errors, history) so output stays accurate and on-convention. Use when starting a session, when output quality drops or ignores conventions, when switching tasks or areas of a codebase, or when setting up rules and context for a project./Other plugins' skills for the same job
npx claudepluginhub ivedha-tech/platformnex-abilities --plugin harness-build2 plugins ship this exact skill · first indexed Nov 17, 2026