Skip to content

docs: Diataxis framework refactor — navigation restructure, content gaps, tone/style pass#408

Draft
mefellows wants to merge 34 commits into
masterfrom
diataxis-refactor
Draft

docs: Diataxis framework refactor — navigation restructure, content gaps, tone/style pass#408
mefellows wants to merge 34 commits into
masterfrom
diataxis-refactor

Conversation

@mefellows

Copy link
Copy Markdown
Member

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/, and blog/ (excluded by design).

What changed

Navigation restructure (Phases 1–13)

  • Added Concepts sidebar (extracted from Getting Started)
  • Added Tutorials sidebar (replacing University nav item)
  • Renamed Guides → How-to Guides in nav + footer
  • Slimmed Getting Started; added Diátaxis signposting table to landing page
  • Added /university/tutorials redirect
  • Fixed pre-existing broken Step file references in tutorials sidebar

Content 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–V4
  • provider/best_practices.md — new How-to guide mirroring consumer.md depth
  • plugins/concepts.md — new Explanation: plugin model and system actors

Structural fixes (Phase 15)

  • Extracted Message Pact how-to walkthrough from how_pact_works.mdconsumer/how_to_test_async_messages.md
  • Removed explanation digressions from 5-minute-getting-started-guide.md
  • Declared pact_nirvana.md as a how-to guide; reframed step_1.md
  • Moved Best Practice section from matching.md to consumer.md
  • Replaced Matrix explanation in can_i_deploy.md with 2-sentence summary + link
  • Rewrote recipes/kafka.md with imperative headings and goal-first framing
  • Extracted 530-line Best Practice Guide from consumer.mdconsumer/best_practices.md
  • Made conceptual_overview.md self-contained; replaced forward references with direct links

Tone and style pass (Phase 16, T1–T15)

  • Removed first-person plural ("we/our") throughout 30+ pages
  • Removed filler openers ("Remember that...", "Keep in mind that...")
  • Removed hedging language ("it can be tempting to...", "you would hopefully have read")
  • Removed first-person author voice ("I've written...", "Let's walk through...")
  • Applied second-person voice consistently ("you", not "we")

Bug fixes

  • Fixed 3 of 5 pre-existing broken links (concepts.md, step_1.md)
  • The 2 remaining broken links are in implementation_guides/ (protected scope, pre-existing)

Test plan

  • npm run build passes with no new broken links (2 pre-existing broken links in implementation_guides/ remain)
  • All new pages wired into sidebars.json
  • All redirects added to netlify.toml for URL changes
  • No modifications to implementation_guides/, pact_broker/, or blog/

🤖 Generated with Claude Code

mefellows and others added 30 commits March 19, 2026 18:41
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>
mefellows and others added 4 commits March 20, 2026 16:12
…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": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ahh actually it is just showing an excerpt of an object entry in the messages array

Comment on lines +251 to +252
| 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`). |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

would be good to link here to each spec version

@YOU54F YOU54F left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can just be new Pact( now

const pact = new PactV4({
consumer: "ThingConsumer",
provider: "ThingProvider",
spec: SpecificationVersion.SPECIFICATION_VERSION_V4,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

spec version will default to 4 so we can remove this

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

like this, I think I remember this from the PF docs that you created. shame the sidebar doesn't list the rules

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good line

@mefellows

Copy link
Copy Markdown
Member Author

@YOU54F sorry this isn't ready for review, please don't waste your time on it!

@mefellows mefellows marked this pull request as draft March 20, 2026 11:23
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