Write Spec

VerifiedSafe

Write a formal specification from accepted ADRs and idea docs. Interviews about contract boundaries, sketches bounded concerns, and produces a spec with no hand-waving.

Sby Skills Guide Bot
DocumentationIntermediate
7/24/2026
Claude Code
#spec-writing#adr#api-contracts#technical-writing#architecture

Recommended for

Automated summary

Turns accepted ADRs and idea docs into formal implementation specs by interviewing the author about contract boundaries and enforcing a rigor checklist.

Strengths

  • Structured interview covering types, signatures, error cases, edge cases, ordering, and constraints
  • The rigor check forbids TBDs and forces measurable constraints plus defined behavior for every error
  • Encourages splitting specs along bounded concerns and extracting deep modules behind simple boundaries
  • Ties the output back to ADRs through cross-references and an updated docs/specs/README.md index

Limitations

  • Requires at least one accepted ADR as input; cannot start from a blank page
  • Assumes project conventions: docs/specs template, mise tasks, the /de-slopify command, and a spec index
  • Final precision depends on the interview answers; existing code is only read when a question demands it
When to use it

Use when an accepted ADR must become an implementable contract for an API surface, wire protocol, or data format.

When not to use it

Skip it for tooling config or doc conventions, or when the ADR is already specific enough to implement from directly.

Security analysis

Safe
Quality score86/100

This is a documentation/prose authoring workflow: it reads ADRs and idea docs, interviews the user, and writes a markdown spec file. The only executable actions are a project task runner (`mise run fmt/lint`), a self-hosted slash command, and a git commit gated on explicit user approval. There is no network egress, no secret handling, no destructive filesystem operations, and no obfuscated payloads, so the listing itself carries no meaningful execution risk. The only minor note is that these shell invocations are implied rather than declared in allowed-tools.

Findings
  • •Skill instructs running project-local commands (`mise run fmt`, `mise run lint`, `/de-slopify`) even though no allowed-tools are declared, so tool permissions are ambiguous at the harness level
How this analysis is made

Examples

Spec from an ADR
Read docs/adr/0012-session-serialization.md and write the spec for the session serialization format. Interview me on field types, error cases, and size limits before drafting.
API surface spec
Turn the accepted ADR on the plugin API into a formal spec at docs/specs/0007-plugin-api.md — cover every function signature, error type, and edge case, and leave no TBDs.
Split bounded concerns
Based on the accepted daemon IPC ADR, decide whether this should be one spec or several, then draft the wire protocol spec with measurable constraints.

name: write-spec description: | Write a formal specification from accepted ADRs and idea docs. Interviews about contract boundaries, sketches bounded concerns, and produces a spec with no hand-waving.

Use when: transitioning from accepted ADRs to implementation specs, formalizing API surfaces, wire protocols, or data formats. Must have at least one accepted ADR as input.

Write Spec

Turn accepted ADRs into formal implementation contracts. A spec defines the exact interface, behavior, and constraints that code must satisfy.

Skip for: decisions that don't need formal contracts (tooling config, doc conventions), or when the ADR itself is specific enough to implement from directly.

Process

1. Gather Input

Read the accepted ADR(s) that led to this spec. Read the idea docs they reference. Identify what the spec must formalize — the ADR decided what, the spec defines how exactly.

2. Interview About the Contract Boundary

Walk through each branch of the contract, resolving ambiguity:

  • Types: What are the exact data structures? Field names, types, optionality, invariants.
  • Functions/Messages: What are the signatures? Parameters, return types, error types.
  • Error Cases: What can go wrong? How is each error reported? What does the caller do?
  • Edge Cases: Empty input, maximum sizes, concurrent access, version mismatches.
  • Constraints: Performance budgets, memory limits, security requirements.
  • Ordering: Are operations sequential, concurrent, or unordered? What happens during races?

For each question, provide a recommended answer. If the answer requires exploration (reading existing code, checking a dependency's API), do the exploration.

3. Sketch Bounded Concerns

Identify if this spec should be one document or split into multiple specs. One spec per bounded concern:

  • One API surface (plugin API, config API, agent control API)
  • One wire protocol (daemon↔client IPC, remote access WebSocket)
  • One data format (session serialization, scroll buffer archive format)

Look for opportunities to extract deep modules — interfaces that encapsulate complexity behind a simple, testable boundary that rarely changes.

4. Write the Spec

Use the project's spec template (docs/specs/0000-template.md). Every section must be concrete:

Overview: One paragraph — what this spec defines and why.

Contract: The formal definition. No hand-waving. Every type is defined. Every function has a signature. Every message has a format. If referencing an IDL file (.proto, .wit), the IDL is the source of truth and the spec explains behavior and constraints the IDL can't express.

Behavior: Expected behavior for normal and error cases. Edge cases called out explicitly. State transitions documented if applicable.

Constraints: Performance budgets, memory limits, security requirements, backward compatibility guarantees.

References: Link to the ADR(s) that led here and the idea doc(s) for broader context.

5. Rigor Check

Before presenting the spec:

  • [ ] Every type is fully defined (no TBD, details later, to be determined)
  • [ ] Every function/message has input types, output types, and error types
  • [ ] Every error case has a defined behavior (what happens, what the caller sees)
  • [ ] Edge cases are called out (empty, maximum, concurrent, disconnected)
  • [ ] Constraints are measurable (not "fast" but "< X ms" or "competitive with Y")
  • [ ] All ADR decisions are reflected in the spec
  • [ ] Cross-references link to real docs
  • [ ] If an IDL file is referenced, its path is specified

6. Checks

  • mise run fmt — format
  • mise run lint — lint
  • /de-slopify on all prose
  • Verify frontmatter is complete (spec number, title, status: draft, date, ADR references, tags)
  • Check all cross-references resolve

7. Update Index

  • Add the new spec to the index table in docs/specs/README.md.
  • Update cross-references in related ADR and idea docs if needed.

8. Commit Gate

Present the spec summary and wait for explicit "commit" before committing.

Common Mistakes

| Mistake | Fix | | ----------------------------------------- | -------------------------------------------------------------------- | | Spec restates the ADR's rationale | Spec defines the contract; ADR explains why. Don't duplicate. | | "TBD" or "details later" in any section | Resolve it now or split into a separate spec with a dependency note. | | Types defined only by example | Write the full type definition. Examples supplement, not replace. | | Error cases listed without behavior | For each error: what does the system do? What does the caller see? | | Performance constraints as absolutes | Use "competitive with X" or "measured by benchmark Y" per ADR-0002. | | Spec too broad (covers multiple concerns) | Split into focused specs. One API surface, one protocol, one format. |

Output

A spec file at docs/specs/NNNN-short-title.md following the project template. If the spec references an IDL, the IDL file path is specified (the file itself may not exist yet — the spec is the contract, the IDL is generated during implementation).

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/write-spec-mryiqikg/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/write-spec-mryiqikg' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/write-spec-mryiqikg/download' --output '.skill-downloads/write-spec-mryiqikg/SKILL.md.part' && mv '.skill-downloads/write-spec-mryiqikg/SKILL.md.part' '.skill-downloads/write-spec-mryiqikg/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/write-spec-mryiqikg/SKILL.md' && test -s '.skill-downloads/write-spec-mryiqikg/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/write-spec' && cp -R '.skill-downloads/write-spec-mryiqikg' '.claude/skills/write-spec'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/write-spec-mryiqikg'

openskills read 'write-spec-mryiqikg'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/write-spec-mryiqikg/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills