Skip to content

docs: enforceable doc-spec, slimmer README, migration guides - #7

Merged
swetjen merged 4 commits into
mainfrom
docs/spec-readme-migration-guides
Jun 17, 2026
Merged

swetjen merged 4 commits into
mainfrom
docs/spec-readme-migration-guides

Conversation

@swetjen

@swetjen swetjen commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

Overhauls the documentation so it matches Virtuous's "runtime truth, no drift" philosophy — the docs now follow their own contract, the README leads with the payoff, and migration paths are first-class.

Done across 5 commits:

  • Enforceable doc-spec — rewrote docs/doc-spec.md from ALL-CAPS plaintext into a contract that obeys itself: a lighter required frontmatter schema, heading discipline, gofmt-clean language-tagged code, and GitHub-native callouts. The unbuilt machinery (SSG, JSON agent-index, versioned URL trees) is parked in an explicit "Not yet" section so the spec stops claiming capabilities that don't exist.
  • Contract applied tree-wide — frontmatter added to all 33 docs.
  • Slimmer README — 707 → ~255 lines. Collapsed the two competing "Why RPC" sections, added a constraints-as-features table, fixed the broken main() indentation, resolved the httpapi voice to "HTTP-native library" (not "legacy"), and moved both cookbooks into the docs tree. Then enhanced: a generated-client payoff snippet, an agent callout, a Features list + TOC, pkg.go.dev / Go Report Card badges, an Examples section, and a pre-1.0 status note.
  • Migration guides — new docs/tutorials/coming-from-routers.md (concept map + before/after recipes for gin/echo/chi/fiber/net-http) alongside the existing Swaggo guide.
  • Cookbooks — extracted RPC and httpapi advanced patterns into docs/rpc/patterns.md and docs/http-legacy/patterns.md.
  • Split the overloaded pagerpc/docs-and-clients.mdrpc/serving-docs.md + rpc/scalar-auth-cors.md, plus three new decision trees (RPC vs httpapi; ServeDocs vs DocsHandler vs AdminHandler; WrapFunc vs TypedHandlerFunc vs struct TypedHandler).
  • Hygiene — relocated the internal Swaggo gap audit out of the published tree into _design/, added agent-hub back-links.

Validation

  • 33 docs, all with valid frontmatter (required fields, valid audience/status, H1 follows).
  • Zero broken relative links; cross-page anchors verified.
  • All Go code blocks gofmt-clean (tab-indented); the README quickstart main() indentation bug is fixed.

🤖 Generated with Claude Code

swetjen and others added 4 commits June 17, 2026 20:49
Apply the doc-spec frontmatter schema (title, description, section,
audience, status, optional related) to every doc in the tree, making the
documentation contract real tree-wide. 29 files gain frontmatter; the four
contract-authored pages already had it.

The Swaggo migration gap audit is marked status: internal per the spec's
treatment of in-tree trackers. No ad-hoc callouts were present to convert.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Break the overloaded rpc/docs-and-clients.md into two focused pages and add
the three decision trees readers were missing.

- rpc/serving-docs.md: serving mechanics (modules, ServeDocs, ServeAllDocs,
  DocsHandler, AdminHandler, hash endpoints) with a "which serving call?"
  decision table. Observability how-to now links to the patterns cookbook
  instead of duplicating it.
- rpc/scalar-auth-cors.md: guard-to-OpenAPI-scheme mapping, same-origin and
  cross-origin docs, and CORS.
- Delete rpc/docs-and-clients.md; repoint rpc/overview.md and rpc/patterns.md.
- http-legacy/typed-handlers.md: add a WrapFunc vs TypedHandlerFunc vs struct
  TypedHandler decision table.
- concepts/rpc-vs-httpapi.md: add an RPC vs httpapi decision table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Move the Swaggo migration gap audit out of the published docs tree into
  _design/ (its frontmatter stripped to match sibling design docs) and list
  it in the specs index. It is an internal tracker, not published guidance.
- Add "Part of the Agents hub" back-links to contract.md, client-codegen.md,
  and python-codegen-rules.md, which previously only linked forward.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Show the generated client: a typed TS call right after the quickstart, so
  the payoff (no hand-written types or fetch boilerplate) is visible.
- Add a "Using a coding agent?" tip linking the agents hub — cashing in the
  agent-first headline.
- Add a scannable Features list and a compact table of contents.
- Add pkg.go.dev and Go Report Card badges, and a pre-1.0 stability note.
- Add an Examples section linking the five runnable example apps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@swetjen
swetjen merged commit e932fb1 into main Jun 17, 2026
1 check passed
@swetjen
swetjen deleted the docs/spec-readme-migration-guides branch June 17, 2026 21:06
@swetjen
swetjen restored the docs/spec-readme-migration-guides branch June 17, 2026 21:11
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.

1 participant