Docs As Contract logo

Docs As Contract

Community
adamentwistle
docs-as-contract

Treat READMEs, docstrings, help text, comments, examples, and changelogs as promises that must match the code that ships — sweep them when behaviour changes, write comments for why not what, run every documented command once, never document intent as fact. Use when a change alters behaviour, an interface, a default, or a setup step; when asked to "add docs" or "document this"; when writing comments or docstrings; and when reviewing a diff that changes user-visible behaviour without touching docs.

Overview

Publisheradamentwistle
Repositoryfable-skills
Skill namedocs-as-contract
Stars
98
Forks
11
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by adamentwistle on GitHub. Read the source before you install it.

Installation

Install the Docs As Contract AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/adamentwistle/fable-skills/tree/main/docs-as-contract
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/adamentwistle/fable-skills.git /tmp/fable-skills
mkdir -p .claude/skills
cp -r /tmp/fable-skills/docs-as-contract .claude/skills/docs-as-contract
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Docs As Contract in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Docs As Contract on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Docs As Contract is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

docs-as-contract

Weak documentation is written from the plan, not the code: a README describing the feature you meant to build, a comment restating the line below it, a setup section nobody has run since it was typed. Strong documentation is a contract with the reader: every sentence describes what the code does today, every command was run, and a behaviour change updates the docs in the same diff.

1. Sweep the docs when behaviour changes

Before done on any change to behaviour, an interface, a default, or a setup step, grep the repo for the old behaviour — the old flag, default value, function name, error text, file path — across README*, docs/, CHANGELOG*, docstrings, --help strings, OpenAPI or JSON schema, .env.example, code comments, and example snippets. Record the command and the hit count (see surgical-refactoring). Every hit is updated in this diff or listed in the report as deliberately left. Docs that contradict the code are worse than none: the reader trusts them.

2. Comments say why, not what

  • Delete a comment that restates the code (// increment counter, # open the file). Write one for what the code cannot say: the constraint, the non-obvious reason, the bug being worked around (with the link), the invariant the next editor must keep.
  • Never narrate the change inside the code: // added null check, // changed from X to Y. That is the commit message; in the file it is stale the moment anyone touches the line again.
  • No commented-out code. Git remembers.
  • A TODO carries an owner or ticket and what would unblock it. A bare TODO is a comment nobody will act on.
  • Match the repo's docstring convention — grep three neighbouring functions for style, sections, and whether params are documented — instead of importing your own.

3. Document what runs, in the order it runs

  • Every command in a README or runbook is copy-pasteable from a fresh clone: exact command, working directory, expected output or side effect, prerequisites stated before the first command that needs them.
  • Run each documented command once from a fresh shell before shipping it. A setup section you have not executed is a guess. A step that cannot be run here (needs production credentials) is marked unverified in the doc and named in the report.
  • Examples are code. A snippet that would not compile or a curl that would return 400 is a bug. Prefer examples the test suite executes (doctests, example tests) so they cannot rot silently.

4. Describe the current state, not the roadmap

Docs state what exists. Planned behaviour goes under a heading that says so ("Not yet supported", "Planned") or in the tracker, never in the same voice as shipped features. Version- or platform-specific behaviour names the version or platform.

5. Know when not to write

Do not add docs nobody asked for: a docstring on every private helper, a docs/ tree for a 200-line script, a changelog format the repo does not use. Follow the repo's existing density. "Stop adding docstrings" holds for the rest of the session (see generalize-the-correction).

6. Write the changelog for the upgrader

If the repo keeps one, add the entry under the unreleased section in its existing format, written for the consumer: what changed for them and what they must do. "Refactored config loading" tells an upgrader nothing; "TIMEOUT is now TIMEOUT_MS; the old name is still read with a warning until v3" does.

Reporting

List the docs updated (path, what changed), the grep for the old behaviour with its hit count, and which documented commands you ran. A doc left knowingly stale is a named item, not an omission.

Frequently asked questions

What does the Docs As Contract AI skill do?

Treat READMEs, docstrings, help text, comments, examples, and changelogs as promises that must match the code that ships — sweep them when behaviour changes, write comments for why not what, run every documented command once, never document intent as fact. Use when a change alters behaviour, an interface, a default, or a setup step; when asked to "add docs" or "document this"; when writing comments or docstrings; and when reviewing a diff that changes user-visible behaviour without touching docs.

Why use Docs As Contract on TypingMind?

Because you install it once and use it with any model. Docs As Contract is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Docs As Contract in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/adamentwistle/fable-skills/tree/main/docs-as-contract. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Docs As Contract?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Docs As Contract?

As many as you like. As long as a model supports skills, you can use Docs As Contract with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Docs As Contract AI skill free?

Yes. It is published on GitHub by adamentwistle under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇