Conventions for writing and maintaining documentation in the copilot-sdk-clojure project.
- Code-first — Lead with working Clojure examples, then explain
- Progressive disclosure — Simplest usage first, layer complexity
- Direct tone — Imperative mood, no filler ("simply", "just", "let's")
- Clojure-idiomatic — Use Clojure terminology and conventions
Every doc file follows this structure:
# Title
One-line description of what this page covers.
## Section
Short paragraphs (1–3 sentences). Use code blocks liberally.Headings:
#for the page title (one per file)##for major sections###for subsections — avoid going deeper than###
- All code blocks must be valid Clojure (parseable by
read-string) - Show
requireforms so readers know which namespace to import - Use
;; =>comments for return values - Use
;; prints:comments for output
(require '[github.copilot-sdk.helpers :as h])
(h/query "What is 2+2?")
;; => "4"- Use
copilotas the alias forgithub.copilot-sdk.client - Use
has the alias forgithub.copilot-sdk.helpers - Use
sessionas the alias forgithub.copilot-sdk.session - Prefer
defoverletin top-level examples for clarity - Include cleanup (
stop!,disconnect!) in lifecycle examples
- Pseudocode or incomplete snippets without context
- Java-style naming (use
kebab-case, notcamelCase) - Bare
printlnwithout explaining what it prints
Use Clojure terms consistently:
| Use | Don't use |
|---|---|
| namespace | package, module |
| var | variable, field |
| map | object, dictionary, hash |
| keyword | enum, symbol (unless literally a symbol) |
| function | method |
| atom | mutable variable |
| channel | queue, stream (unless referring to core.async specifically) |
| require | import |
- Use relative paths between doc files:
[API Reference](reference/API.md) - From repo root (README, AGENTS.md):
[API Reference](./doc/reference/API.md) - From examples/:
[BYOK](../doc/auth/byok.md) - Never use absolute filesystem paths
- Link to specific sections with anchors:
[Events](reference/API.md#event-types)
Use tables for options, flags, and configuration keys:
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| `:model` | string | `nil` | Model to use for the session |
| `:system-prompt` | string | `nil` | System prompt prepended to conversation |- Sort keys alphabetically or by importance
- Include types and defaults
- Use Clojure keyword notation (
:model, notmodel)
Update documentation when:
- A public API function is added, changed, or removed
- A new example is added to
examples/ - A configuration option is added or changed
- Authentication or MCP behavior changes
- The doc structure itself changes (update
doc/index.md)
After changes, run bb validate-docs to verify links and code blocks.
- Use
kebab-casefor file names:getting-started.md, notGettingStarted.md - Use
index.mdfor directory entry points (e.g.,auth/index.md) - Keep names short and descriptive
Before submitting doc changes:
- Code examples parse without errors
- All internal links resolve to existing files
-
requireforms shown for code that uses SDK namespaces - Tables have consistent formatting
- No filler language ("simply", "just", "let's", "easy")
-
bb validate-docspasses