Update SDK Documentation
Keep documentation aligned with canonical public source and executable examples.
Read doc/style.md and
.github/instructions/documentation.instructions.md before editing.
1. Identify the Contract Change
Compare the branch with current default and map changed public source, specs,
fdefs, examples, and hand-written docs to their consumers. Do not infer scope
only from generated output.
| Area |
Canonical inputs |
Documentation |
| Public overview/install |
build.clj, deps.edn, public facade |
README.md, doc/getting-started.md |
| Helpers |
src/github/copilot_sdk/helpers.clj, specs, fdefs |
doc/reference/API.md, doc/getting-started.md |
| Client |
src/github/copilot_sdk/client.clj, specs, fdefs |
doc/reference/API.md |
| Session |
src/github/copilot_sdk/session.clj, specs, fdefs |
doc/reference/API.md |
| Tools |
src/github/copilot_sdk/tools.clj, tool_set.clj, specs, fdefs |
doc/reference/API.md |
| Specs/fdefs |
src/github/copilot_sdk/specs.clj, instrument.clj |
doc/reference/API.md |
| MCP |
src/github/copilot_sdk/util.clj, client.clj, specs |
doc/mcp/overview.md, doc/mcp/debugging.md |
| Authentication |
src/github/copilot_sdk/client.clj, specs |
doc/auth/ |
| Events |
public event sets, idiom specs, generated wire specs |
doc/reference/API.md |
| Examples |
examples/*.clj |
README.md, examples/README.md, related guides |
Read enough source and tests to establish actual defaults, omission semantics,
errors, lifecycle, and return values. Use a subagent only when the scope needs a
separate substantial context; do direct reads for small changes.
2. Update Canonical Documentation
- Lead with complete, parseable Clojure examples.
- Use the standard namespace aliases and include lifecycle cleanup.
- Use tables for option maps, including types, defaults, omission behavior, and
experimental status.
- Document stable behavior and intentional experimental exclusions.
- Keep transient audit results, local paths, temporary failures, and session
history out of evergreen docs.
- Update
doc/index.md only when navigation or document structure changes.
- Update
examples/README.md when the executable example inventory changes.
- Run
bb install-docs:sha when the documented installation SHA moves, and
review the resulting README.md and getting-started changes.
- Add a concise
[Unreleased] changelog entry for user-visible changes.
3. Treat Examples as Executable Evidence
Examples must be:
- portable across supported environments;
- bounded rather than dependent on indefinite waits;
- fail-loud on invalid results;
- explicit about client, session, subscription, process, and channel cleanup;
- listed exactly once in the maintained example inventory.
Run affected examples. Do not convert a failing contract example into
pseudocode.
4. Regenerate Outputs
Generated API HTML and other generated documentation are outputs, not editing
surfaces. Fix the canonical source or Markdown, then run the owning generator.
Never hand-edit generated files.
Run bb docs after public docstrings change. When generator drift matters, run
the generator twice from identical inputs and require the second run to produce
no diff.
5. Validate
Run:
bb validate-docs
Also run the smallest affected executable examples and repository gates
required by AGENTS.md. Review the final diff for stale links, duplicate
guidance, unparseable snippets, generated-file hand edits, and undocumented
stable or experimental behavior.
1---2name: update-docs3description: Use when public SDK behavior, examples, configuration, or documentation changes and the affected documentation must be updated and regenerated.4---56# Update SDK Documentation78Keep documentation aligned with canonical public source and executable examples.9Read `doc/style.md` and10`.github/instructions/documentation.instructions.md` before editing.1112## 1. Identify the Contract Change1314Compare the branch with current default and map changed public source, specs,15fdefs, examples, and hand-written docs to their consumers. Do not infer scope16only from generated output.1718| Area | Canonical inputs | Documentation |19|------|------------------|---------------|20| Public overview/install | `build.clj`, `deps.edn`, public facade | `README.md`, `doc/getting-started.md` |21| Helpers | `src/github/copilot_sdk/helpers.clj`, specs, fdefs | `doc/reference/API.md`, `doc/getting-started.md` |22| Client | `src/github/copilot_sdk/client.clj`, specs, fdefs | `doc/reference/API.md` |23| Session | `src/github/copilot_sdk/session.clj`, specs, fdefs | `doc/reference/API.md` |24| Tools | `src/github/copilot_sdk/tools.clj`, `tool_set.clj`, specs, fdefs | `doc/reference/API.md` |25| Specs/fdefs | `src/github/copilot_sdk/specs.clj`, `instrument.clj` | `doc/reference/API.md` |26| MCP | `src/github/copilot_sdk/util.clj`, `client.clj`, specs | `doc/mcp/overview.md`, `doc/mcp/debugging.md` |27| Authentication | `src/github/copilot_sdk/client.clj`, specs | `doc/auth/` |28| Events | public event sets, idiom specs, generated wire specs | `doc/reference/API.md` |29| Examples | `examples/*.clj` | `README.md`, `examples/README.md`, related guides |3031Read enough source and tests to establish actual defaults, omission semantics,32errors, lifecycle, and return values. Use a subagent only when the scope needs a33separate substantial context; do direct reads for small changes.3435## 2. Update Canonical Documentation3637- Lead with complete, parseable Clojure examples.38- Use the standard namespace aliases and include lifecycle cleanup.39- Use tables for option maps, including types, defaults, omission behavior, and40 experimental status.41- Document stable behavior and intentional experimental exclusions.42- Keep transient audit results, local paths, temporary failures, and session43 history out of evergreen docs.44- Update `doc/index.md` only when navigation or document structure changes.45- Update `examples/README.md` when the executable example inventory changes.46- Run `bb install-docs:sha` when the documented installation SHA moves, and47 review the resulting `README.md` and getting-started changes.48- Add a concise `[Unreleased]` changelog entry for user-visible changes.4950## 3. Treat Examples as Executable Evidence5152Examples must be:5354- portable across supported environments;55- bounded rather than dependent on indefinite waits;56- fail-loud on invalid results;57- explicit about client, session, subscription, process, and channel cleanup;58- listed exactly once in the maintained example inventory.5960Run affected examples. Do not convert a failing contract example into61pseudocode.6263## 4. Regenerate Outputs6465Generated API HTML and other generated documentation are outputs, not editing66surfaces. Fix the canonical source or Markdown, then run the owning generator.67Never hand-edit generated files.6869Run `bb docs` after public docstrings change. When generator drift matters, run70the generator twice from identical inputs and require the second run to produce71no diff.7273## 5. Validate7475Run:7677```bash78bb validate-docs79```8081Also run the smallest affected executable examples and repository gates82required by `AGENTS.md`. Review the final diff for stale links, duplicate83guidance, unparseable snippets, generated-file hand edits, and undocumented84stable or experimental behavior.