docs: Diataxis framework refactor — navigation restructure, content gaps, tone/style pass#408
docs: Diataxis framework refactor — navigation restructure, content gaps, tone/style pass#408mefellows wants to merge 34 commits into
Conversation
Comprehensive audit of existing docs.pact.io structure, content categorisation against the Diataxis framework (tutorials, how-to guides, explanations, reference), issues identified, and a phased implementation plan. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Concepts sidebar: extracts Pact Concepts from Getting Started into its own dedicated section (terminology, matching, provider states, etc.) - Add Tutorials sidebar: replaces University nav item, promotes 5-minute guide and external workshops alongside the multi-step University content - Rename Guides -> How-to Guides in navbar and footer for clarity - Slim Getting Started to intro + How Pact Works + Should I use Pact? + FAQ - Add signposting table to landing page pointing to all 4 Diataxis quadrants - Add /university -> /tutorials redirect in netlify.toml File paths are unchanged; only sidebar membership and nav labels are updated. All existing URLs remain valid. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…BaseRegex - university.md was orphaned from all sidebars after renaming university->tutorials; add it back so /university shows proper sidebar context (netlify redirect handles external links) - Fix Concepts navbar activeBaseRegex to highlight correctly when browsing pages under /getting_started/conceptual_overview, /terminology, etc. - Tighten Getting Started regex to avoid overlap with Concepts paths Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…versity tutorials The original university sidebar referenced university/introduction/Step1..Step13 and university/message-pact-async/Step1..Step4, but the actual files are named 01_Step1..13_Step13 and 01_Step1..04_Step4 (with numeric prefixes). This was a pre-existing bug now surfaced and fixed. Also: - Convert guides sidebar from shorthand object to explicit array format - Move further_reading from Concepts/Reference to Resources sidebar (better fit: talks, articles, getting help — not technical reference) - Remove further_reading from concepts.md index table Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Docusaurus strips numeric prefixes at runtime, so 01_Step1.md has doc ID 'Step1', not '01_Step1'. Revert sidebar references back to Step1..Step13 and Step1..Step4. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- concepts/why-pact: design philosophy explanation (consumer-driven contracts, generated pact files, broker model, trade-offs) - concepts/pact-file-format: Reference page for pact JSON schema across spec versions V1–V4 (fields, matching rules, generators) - provider/best_practices: provider how-to guide mirroring consumer.md depth (verification scope, selectors, provider states, CI setup) - plugins/concepts: Explanation of the plugin model, two plugin types, system actors, and decision guide (use vs build) All four pages wired into sidebars.json and concepts.md updated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The 'How to write message pact tests' walkthrough was how-to content embedded in an explanation page. Extracted to consumer/how_to_test_async_messages.md and replaced with a two-sentence summary + link in how_pact_works.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removed three embedded explanation sections that broke the tutorial's linear journey: consumer test scope, provider test scope, and the open-ended status code advice. Replaced intro with a clear outcome statement. Scope concepts are covered in testing-scope.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pact_nirvana.md: explicit 'how-to guide' label in intro.
step_1.md: replaced tutorial prerequisite voice ('Before you read
this document, you should') with how-to 'Recommended reading' framing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The 'Best practice' section in matching.md was how-to opinion content in a Reference page. Moved the 'avoid random data' point (new) to consumer.md and the request/response guidance is already covered there. Replaced the section with a link back to consumer.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Matrix explanation at the top of can_i_deploy.md was Explanation content interrupting a How-to page. Replaced with a two-sentence problem statement and link to the broker overview. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaced tutorial narrative ('We'll start with...', 'Moving on...',
'Let's take a look...') with imperative headings and goal-first framing.
Added problem statement, explicit tips, and preserved all technical content.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The 530-line Best Practice Guide was too large to live in consumer.md. Extracted to its own page with frontmatter. consumer.md now has a one-paragraph summary and link. Added to guides sidebar. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Added scoped intro paragraph explaining what the page covers and linking to related pages. Replaced 'I'll discuss later' forward reference with a direct link to can-i-deploy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phases 14 and 15 marked complete. Phase 16 (tone/style pass) and Phase 17 (housekeeping) added with per-page task list. DIATAXIS_REVIEW.md committed alongside. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ral, hedging Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ging Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ghout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…oice Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The 2 remaining broken links are in implementation_guides/ (protected area, not in scope for this refactor) and were pre-existing before this branch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| "providerStates": [ | ||
| { "name": "product 10 exists" } | ||
| ], | ||
| "contents": { |
There was a problem hiding this comment.
this is invalid, there should be a messages array
There was a problem hiding this comment.
ahh actually it is just showing an excerpt of an object entry in the messages array
| | V3 | `providerStates` as an array of objects. Message interactions. `generators`. V3 matching rule format. | | ||
| | V4 | Plugin support. Combined interaction types (`Synchronous/HTTP`, `Asynchronous/Messages`, `Synchronous/Messages`). | |
There was a problem hiding this comment.
would be good to link here to each spec version
YOU54F
left a comment
There was a problem hiding this comment.
spent a short bit of time reviewing this morning with a coffee, good start, minor comments
| ```ts | ||
| // Top level - name of the API | ||
| describe("Thing API", () => { | ||
| const pact = new PactV4({ |
| const pact = new PactV4({ | ||
| consumer: "ThingConsumer", | ||
| provider: "ThingProvider", | ||
| spec: SpecificationVersion.SPECIFICATION_VERSION_V4, |
There was a problem hiding this comment.
spec version will default to 4 so we can remove this
There was a problem hiding this comment.
like this, I think I remember this from the PF docs that you created. shame the sidebar doesn't list the rules
There was a problem hiding this comment.
in fact, it is similar but not quite
| }); | ||
| ``` | ||
|
|
||
| > ℹ️ Tip: Always provide example values when using generators like `uuid()`, `timestamp()`, or `dateTime()` to ensure stable contract output. |
There was a problem hiding this comment.
I almost feel like we should be warning the user here if they are doing this, as it seems like an easy trap. Is there rationale for having generators with random values?
|
|
||
| Consumer-driven contracts invert this. The consumer declares what it needs. The provider runs the consumer's expectations as its own tests. If the provider breaks a consumer's expectation, the provider's test suite fails — before deployment. The feedback loop is tight and automatic. | ||
|
|
||
| This also addresses a common team-dynamics problem. Provider teams often don't know which of their consumers use which parts of the API. Consumer-driven contracts make this explicit: you can look at the pacts for a provider and see exactly which consumer calls which endpoint with which fields. |
There was a problem hiding this comment.
good lead in chance for bi-directional/provider-driven approach, and drift
| - **Is it safe to deploy this version?** The `can-i-deploy` command queries the broker's verification matrix and tells you, before you deploy, whether the version you're releasing is compatible with what's already in each environment. | ||
| - **Who uses what?** The broker provides network graphs and dashboards that show the relationships between all registered services, making it easier to reason about the impact of changes. | ||
|
|
||
| The broker is not required to use Pact. It is the piece that converts Pact from a testing tool into a deployment safety mechanism. |
|
@YOU54F sorry this isn't ready for review, please don't waste your time on it! |
Summary
A comprehensive restructure of docs.pact.io based on the Diátaxis framework, improving content discoverability, consistency, and quality across all in-scope documentation.
Scope: All documentation except
implementation_guides/,pact_broker/, andblog/(excluded by design).What changed
Navigation restructure (Phases 1–13)
/university→/tutorialsredirectContent gaps filled (Phase 14)
getting_started/why-pact.md— new Explanation: design philosophy (consumer-driven contracts, trade-offs)getting_started/pact-file-format.md— new Reference: pact JSON schema across V1–V4provider/best_practices.md— new How-to guide mirroring consumer.md depthplugins/concepts.md— new Explanation: plugin model and system actorsStructural fixes (Phase 15)
how_pact_works.md→consumer/how_to_test_async_messages.md5-minute-getting-started-guide.mdpact_nirvana.mdas a how-to guide; reframedstep_1.mdmatching.mdtoconsumer.mdcan_i_deploy.mdwith 2-sentence summary + linkrecipes/kafka.mdwith imperative headings and goal-first framingconsumer.md→consumer/best_practices.mdconceptual_overview.mdself-contained; replaced forward references with direct linksTone and style pass (Phase 16, T1–T15)
Bug fixes
concepts.md,step_1.md)implementation_guides/(protected scope, pre-existing)Test plan
npm run buildpasses with no new broken links (2 pre-existing broken links inimplementation_guides/remain)sidebars.jsonnetlify.tomlfor URL changesimplementation_guides/,pact_broker/, orblog/🤖 Generated with Claude Code