Checking access…

Skip to main content

Engineering Guide Documentation Guidelines

Use these guidelines for docs-ccg-internal/05-engineering-guide/. Engineering pages serve platform engineers who need to understand a service, implement a payment flow, look up exact behavior, or resolve an incident. Classify each page as Explanation, How-to, Reference, or Tutorial before writing it. A page should have one primary reader task; link to a companion page when the task changes.

For the shared sidebar_label prefixes, feature-folder pattern, category links, and ordering rules, follow the Integration Document Guidelines. Engineering pages use the same mechanics but different content-placement decisions. The V2 Payments pilot shows the pattern in this guide.

Choose the Page Type​

TypeReader's taskEngineering contentExample
ExplanationUnderstand how or why a system worksDomain model, lifecycle, flow comparison, architecture rationale, design tradeoffsPayment Lifecycle States
ReferenceLook up an exact fact while workingState and status tables, validation rules, event payloads, dependency maps, component contracts, source-level behaviorCustomer Creation During Payment β€” Reference
How-toComplete a specific task or diagnose a symptomRequest/response walkthrough, operational procedure, debugging steps, failure recoveryTroubleshoot Customer Creation During Payment
TutorialLearn a system for the first timeGuided, end-to-end exercise with a learning outcome and checkpointsUse 1-start-here/ for a genuine new-engineer walkthrough

The page type describes what the reader can do with the page, not which format it contains. A sequence diagram can explain a lifecycle; a status table can serve as reference. Code excerpts can support either, depending on whether they explain a design choice or specify exact behavior.

Place Mixed Engineering Content​

  • Put the domain model, flow rationale, and lifecycle narrative in an Explanation page. Keep diagrams there when they help a reader understand the flow. Link to tables rather than repeating every state and error value.
  • Put exact contracts and lookup material in Reference: state transitions, event and webhook details, validation and error tables, component behavior, repository or index details, and test coverage inventories. A component diagram used primarily for lookup also belongs here.
  • Put actions and observable results in How-to pages. A request/response example belongs with the steps for submitting or retrying a request. A runbook should begin with a symptom or goal and give checks, resolution, and escalation. Keep related troubleshooting in the same domain as the flow it diagnoses; the CC-12883 case stays in Payments.
  • Put first-time guided learning in a Tutorial only when the reader works through a complete exercise. A list of API examples or a general overview is not a tutorial.
  • Fold a short FAQ answer or list of best practices into the page type that answers the underlying question. Create another page only when it has a distinct reader task.

For example, Customer Creation During Payment has a lifecycle Explanation, a request How-to, a Reference, and a troubleshooting How-to. Its old content URL remains the Explanation page; the CC-12883 postmortem and failure scenarios live in the troubleshooting page. Idempotency & Retries keeps its model and short best-practices table together, with separate rules and request examples.

A short page can keep a supporting table or list when the primary task remains clear. The V2 split-tender refund processing page explains the flow and includes one webhook status table; the refund ER diagram is a separate Reference page. Shared dispute and ACH return processing pages likewise explain their flows with small lookup tables.

Document engineering use cases​

The Use Cases section contains Reference pages that mirror Business capabilities and organize their positive, negative, and applicable edge cases. Use the separate Engineering Use Case Guidelines and Engineering Use Case Template for case structure, evidence, and two-way links to Business rules. Keep detailed processing flows and contracts in their domain pages.

Guide readers through categories​

Decide whether a category needs its own landing page based on the reader's next choice:

  • Several distinct tasks: Write an index.md with a short purpose statement and task choices near the top. Name each choice for an action or symptom, explain what the linked page helps the reader do, and link directly to the relevant Explanation, How-to, Reference, or troubleshooting page. The Platform Implementation index shows the pattern.
  • One natural starting page: Link the category to the existing overview or reference. Keep companion pages in the sidebar and link to them from that starting page when readers need a next step.
  • Navigation-only group: Use "link": null when a category only groups a few related items and a separate landing page would repeat their titles.

Do not add a generated index merely to expose a folder's contents. Preserve any retired category URL with a redirect in config/legacy-redirects.js, and update links to point to the destination page. A navigation index guides readers; it does not repeat the technical content of its linked pages.

Apply the Pattern​

  1. Identify the reader task for each section and group sections by task. Preserve the technical details and source-verification notes when moving content.
  2. Use a Diataxis-prefixed sidebar_label on each page. Keep the H1 aligned with the label. Give each page an explicit, stable slug; preserve the old slug on an overview.md page when that page remains the natural entry point.
  3. Add a feature folder and _category_.json when a page becomes several pages. Choose an authored task index, an existing overview, or a navigation-only group using the rules above; give siblings unique sidebar_position values.
  4. Add direct links between companion pages and update links to headings that moved. If a slug changes or disappears, add a redirect in config/legacy-redirects.js.
  5. Run node scripts/docs/lintDocStructure.js and npm run lint:links; run npm run build:internal when a build is required for the change or publication gate. The structure linter currently enforces Diataxis labels and explicit slugs for Start Here, V1 and V2 payment processing, shared payment processing, V2 refunds, and Operate & Troubleshoot; expand its coverage as other Engineering Guide areas migrate. Navigational index.md pages are excluded from this page-type check.

The Engineering Guide is internal documentation. Link to merchant-facing Integration pages for the public contract instead of duplicating that contract in multiple internal pages.