Skip to content

feat(skills): add OpenAPI SSOT api-documentation skill#10

Merged
nicholastn1 merged 2 commits into
mainfrom
feat/openapi-ssot-skill
Jun 3, 2026
Merged

feat(skills): add OpenAPI SSOT api-documentation skill#10
nicholastn1 merged 2 commits into
mainfrom
feat/openapi-ssot-skill

Conversation

@anachronicsofa

@anachronicsofa anachronicsofa commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a new distributable skill — update-api-documentation — that standardizes external API/webhook documentation around a single source of truth (docs/openapi.yml), with generated Redoc HTML, validation/build tasks, a CI step, and a recyclable guide so agents update docs alongside code.

What's included

  • New skill: templates/.claude/skills/update-api-documentation/SKILL.md
    • Stack-agnostic guide with Rails / Node / Python examples (collapsible per-stack blocks)
    • Covers: SSOT docs/openapi.yml, generated Redoc HTML (never hand-edited), docs:validate/docs:build tasks, CI step, code→OpenAPI mapping table, agent workflow, anti-patterns, bootstrap checklist, per-app variables
    • Documents external contracts only (/api/v1/*, /webhooks/*) — not admin/UI/jobs/health

CLI wiring

Follows the bug-reproduction seed pattern — created on init, never overwritten, tracked by update:

  • src/commands/init.shmkdir + download_if_missing
  • src/commands/update.sh — added to seed_templates
  • templates/CLAUDE.md — reference in Additional Context
  • Rebuilt the bundled dotcontext executable (make build)

Design decisions

  • Distributable (ships with every dotcontext init), stack-agnostic (Rails as one example), SKILL.md only (the agent generates openapi.yml/tasks/HTML in the target project by following the guide).
  • Guide written in English to match existing skills; it instructs agents to write API descriptions in the project's documentation language rather than hardcoding one.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a new API documentation skill for managing OpenAPI specifications as a single source of truth. The skill provides workflows, validation tasks, and best practices for keeping API contracts synchronized with code changes across multiple language environments.
  • Documentation

    • Updated main documentation to reference the new API documentation skill.

Add a distributable `update-api-documentation` skill that documents
external API contracts from a single source of truth (docs/openapi.yml),
with generated Redoc HTML, docs:validate/docs:build tasks, and a CI step.

The guide is stack-agnostic (Rails/Node/Python examples) and follows the
code→OpenAPI mapping so agents update docs alongside code.

Wired into the CLI as a seed file (created on init, never overwritten,
tracked by update), mirroring the bug-reproduction pattern:
- src/commands/init.sh: mkdir + download_if_missing
- src/commands/update.sh: seed_templates entry
- templates/CLAUDE.md: Additional Context reference
- rebuilt bundled dotcontext executable

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@nicholastn1, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 11 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e7054315-a981-427c-ae1c-e02621110a1b

📥 Commits

Reviewing files that changed from the base of the PR and between 486da8d and 5a0465f.

📒 Files selected for processing (4)
  • dotcontext
  • src/commands/init.sh
  • src/commands/update.sh
  • templates/AGENTS.md

Walkthrough

This PR adds a new "update-api-documentation" skill template for OpenAPI single-source-of-truth (SSOT) workflows. The skill is seeded during project initialization, included as a create-only template during updates, and referenced in the project's guidance documentation.

Changes

API Documentation (OpenAPI SSOT) Skill

Layer / File(s) Summary
API documentation skill template content
templates/.claude/skills/update-api-documentation/SKILL.md
Defines the complete OpenAPI SSOT skill covering purpose, SSOT rules (docs/openapi.yml as source-of-truth, generated HTML as build artifact), documentation scope (external contracts only), minimal required OpenAPI structure, implementation tasks with Ruby/Node/Python examples, CI validation, agent workflows for code-driven OpenAPI updates including field mapping and YAML quoting, anti-patterns to avoid, integration guidance for other skills, bootstrap checklist for first-time setup, and placeholder variables for per-app substitution.
Skill registration in init and update flows
dotcontext, src/commands/init.sh, src/commands/update.sh
Registers the skill by adding .claude/skills/update-api-documentation directory creation and SKILL.md seed download during init, and adding the skill to the create-only seed templates list during update so it is created if missing but never overwritten.
Skill reference in project guidance
templates/CLAUDE.md
Adds an "API documentation (OpenAPI SSOT)" reference under Additional Context pointing to the skill template.

🎯 2 (Simple) | ⏱️ ~12 minutes


Possibly related PRs

  • goca-se/dotcontext#8: Both PRs extend the template seeding system to register new managed skill templates through the same init and update mechanisms.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a new OpenAPI SSOT api-documentation skill. It is concise, specific, and clearly reflects the primary objective of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/openapi-ssot-skill

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

# Conflicts:
#	dotcontext
#	src/commands/init.sh
#	templates/CLAUDE.md

@nicholastn1 nicholastn1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nicholastn1 nicholastn1 merged commit 98bd9c4 into main Jun 3, 2026
2 checks passed
@nicholastn1 nicholastn1 deleted the feat/openapi-ssot-skill branch June 3, 2026 17:16
nicholastn1 added a commit that referenced this pull request Jun 3, 2026
…0.17.0

PR #10 merged after v0.16.0 with no release of its own, so the skill first ships
in v0.17.0; give it a proper entry instead of only a passing mention.
nicholastn1 added a commit that referenced this pull request Jun 3, 2026
* feat(2b): add name/description frontmatter to all skills (discovery)

All SKILL.md files now carry YAML frontmatter so the model can auto-discover
skills by description across agents (not just explicit /name). ADR-018 item 4
done. First increment of phase 2b.

* feat(2b): multi-agent commands (hybrid) + skill discovery

- skills: name/description frontmatter on all SKILL.md → auto-discovery on every
  agent (done earlier in this branch).
- commands (hybrid, ADR-018): opencode → .opencode/command/*.md, Copilot →
  .github/prompts/*.prompt.md (native copies of the canonical workflow prompts);
  Gemini/Cursor/Codex → new "## Workflows" section in AGENTS.md. Claude keeps
  .claude/commands/. Per selected harness, create-only.
- registry: emit_agent_commands + DOTCONTEXT_COMMANDS; init wires it in.
- --version --json: + commands:true. ADR-018 Accepted.
- bump 0.17.0 + CHANGELOG.

Deferred (recorded in ADR-018): code-review/deep-context → skill-mode promotion;
per-agent TOML/skill command transforms for Gemini/Cursor/Codex.

* fix(2b): /add-skill generates name/description frontmatter

/add-skill produced the old format (# Skill: … with no YAML frontmatter), so
newly created skills wouldn't be auto-discoverable — inconsistent with the
frontmatter now required across agents. Updated the command to emit
name/description frontmatter (description front-loaded for discovery) and noted
the .agents/skills mirror for non-Claude agents.

* docs(changelog): note /add-skill format update in v0.17.0

* fix(2b): consistency sweep — kill stale CLAUDE.md/Claude-only references

Functional (commands were reading/writing the now-stub CLAUDE.md):
- setup-context: writes project instructions to AGENTS.md (was CLAUDE.md)
- fix-bug, execute-prp, deep-context, code-review: read AGENTS.md (canonical)
- doctor: Claude CLI missing → warn not fail; commands check is harness-aware
  (no false failure for valid non-Claude projects)

User-facing text:
- help.sh tagline/init desc/section header → multi-agent
- update.sh MCP prompt "for your agents"
- README: taglines, AGENTS.md canonical, 4-skill tree, per-harness commands row,
  conditional setup-context launch, per-agent notifications
- CLAUDE.md: tagline, init --agents / --version --features, template-init mapping,
  multi-agent integration section
- CONTEXT.md: tagline, AGENTS.md canonical entity, command entity

ADRs reconciled:
- ADR-003: drop --force (contradicted its own v2.0); doctor not "status" cmd
- ADR-004: note extended beyond Claude by 016/017/018 + Related
- ADR-005: cross-agent note ({{ASK}} via ADR-018) + Related
- ADR-015: multiagent/skills/hooks/commands now true; drop "(forthcoming)"
- ADR-016/018: fix dangling "ADR-005 v2.0" ref → ADR-018; status/History consistency

* docs: add CONTRIBUTING.md (skill-first, full deploy/release flow)

Leads with the most common contribution — adding a skill (SKILL.md frontmatter,
init/update wiring, .agents/.claude mirror, build) — then covers other
contributions, local dev, PR workflow, decision compliance, and the deploy model
(templates live on merge; CLI binary + release via tag-triggered release.yml;
merge != release). Includes issue/PR guidance and community expectations per
GitHub's contributing-guidelines recommendations.

* docs: add issue templates + PR template

- .github/ISSUE_TEMPLATE/: bug_report + feature_request (skill/harness-aware) + config (links to CONTRIBUTING)
- .github/PULL_REQUEST_TEMPLATE.md: summary/changes/type/checklist (incl. the make-build-in-sync reminder CI enforces) + test plan

* docs: humanize CONTRIBUTING.md and README multi-agent section

Remove AI-writing tells (em-dash overuse, signposting, inline-header dashes,
rule-of-three, generic bookends) per the humanizer guide. Keeps the technical
content and tone; just reads less like generated text.

* feat(release): use CHANGELOG.md section for release notes

Squash-merges collapse history, so git-log-based notes were one line. Pull the
matching CHANGELOG.md section as the release body instead (fall back to git log
when absent), and keep the Full Changelog compare link. Docs/ADR-014 updated.

* docs(changelog): round out v0.17.0 entry to cover the whole PR

The release notes come from this section, so it must reflect everything shipping
in v0.17.0: phase 2b + the consistency fixes, doctor non-Claude fix, CONTRIBUTING,
issue/PR templates, humanized docs, and the CHANGELOG-based release notes.

* docs(changelog): credit the update-api-documentation skill (#10) in v0.17.0

PR #10 merged after v0.16.0 with no release of its own, so the skill first ships
in v0.17.0; give it a proper entry instead of only a passing mention.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants