documenting-contracts
БесплатноБез исполняемых скриптовНе проверенLoad when documenting an interface other systems depend on: HTTP or RPC endpoints, webhooks, event and message payloads, or file formats, for the callers who…
от riekelt★ 43 звезды на GitHubОб этом скилле
Documenting contracts
REQUIRED BACKGROUND: the technical-writing skill (hard rules, truth rules, style).
Overview
A contract document is read by a stranger who cannot see the code and is about to depend on it. Core principle: document the wire, exhaustively, with each detail at its own level; the caller's language is the wire format and domain terms, never the implementation's types. Contract surfaces are reference kind, so the core Reference rule applies: every endpoint, every field, every error.
When to invoke, and not
Invoke when documenting anything machines call or parse: REST and RPC endpoints, message queues and topics, webhooks, CLI commands, file formats. The api-reference.md of a legacy campaign (documenting-legacy-codebases) is this skill's document. Do NOT invoke for internal code interfaces, which the code documents itself, or for configuration references, which belong in config-reference.md under the core Reference rule. Judging whether the contract is well designed is out of scope: this skill documents the contract that exists.
One home versus generated specs
When an OpenAPI or AsyncAPI spec exists, or the code generates one, that spec owns the field tables. The markdown then documents only what the spec cannot say (semantics, side effects, ordering, omitted-versus-null) and links the spec; never hand-maintain field tables beside a generated one; a second home drifts. The catalog below is for the case where no machine spec exists; writing one is not this document's job.
The four detail levels
Each level has its own home; the writer moves detail found at the wrong level into the level that owns it:
| Level | The caller asks | Home |
|---|---|---|
| Index | What exists here | The endpoint, message, and command tables |
| Semantics | What invoking it does | Per-endpoint, per-message, and per-command prose: side effects, events published, idempotency, redelivery, exit behavior, quirks |
| Shape | What crosses the wire | The DTO catalog: one field table per DTO |
| Example | What it looks like | At most one illustrative example per DTO |
Repetition across levels is the defect to hunt: an endpoint section restating its DTO's fields, an example smuggling in a field the table lacks.
The DTO catalog
A DTO is defined once and referenced everywhere:
- Wire types, not language types.
string (date, ISO 8601),number (64-bit integer),string (decimal): the column says what crosses the wire, complete enough that no reader needs the implementation's type as a proxy. A 64-bit integer that exceeds the range or precision of a consumer's native number type is wire information; the type name that produced it is not. - One Source line per DTO, naming the owning class or schema file. Reference kind sanctions this evidence anchor, as a config reference carries binding evidence.
- Required is a tri-state:
yes,no, orif <condition>with the condition stated. - Omitted versus null is stated wherever it matters, and always on a DTO used in a replace-style write, where an omitted field is absent from the result. Where the server assumes a value on omission instead, that value goes in the Default column.
- Enums get their own table, values with meanings; nested objects link to their own catalog entry, never a second inline copy.
- Constraints in domain terms: "past date", "1..100 chars", "must reference an existing budget policy", read from validation the code enforces.
The template
# API reference: <service>
## Conventions
[Once, never per endpoint: base path, auth, content type, the error
envelope, global (de)serialization behavior, idempotency defaults.]
## Endpoints
| Method | Path | Purpose | Request | Response | Errors |
|---|---|---|---|---|---|
| POST | `/thing` | Create a thing | [ThingRequest](#thingrequest) | 200 [Thing](#thing) | 422, 404 |
### POST /thing
[Semantics only: side effects, events published, idempotency, quirks.
No field lists; the index and catalog are not repeated.]
## Messages
| Direction | Destination | Payload | Reply | On error |
|---|---|---|---|---|
| in | `thing.create` | [ThingRequest](#thingrequest) | `thing.created` | `thing.create.error` |
### thing.create
[Semantics only: redelivery, ordering, events published, quirks;
what differs from the sibling transport is called out here.]
## Commands
| Command | Purpose | Arguments | Output |
|---|---|---|---|
### <command>
[Semantics only: side effects, idempotency, exit behavior, quirks.]
## DTOs
### ThingRequest
Source: `api/ThingRequest`
| Field | Type | Required | Default | Constraints | Meaning |
|---|---|---|---|---|---|
[Omitted versus null, where it matters. At most one illustrative example.]
### Thing
[Response shapes are catalog entries like any other.]
## Errors
| Status | When | Body |
|---|---|---|
Rules
- Verify against the serializer, not the class. The wire is what the configured serializer emits and ac
Установить documenting-contracts в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл documenting-contracts?
Load when documenting an interface other systems depend on: HTTP or RPC endpoints, webhooks, event and message payloads, or file formats, for the callers who integrate with it. Not for internal code interfaces. Builds on technical-writing: load both.
Как установить скилл documenting-contracts?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл documenting-contracts запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic