Docs Generation
You get API reference docs that stay current without anyone manually updating markdown files every time a field changes. Prism generates all /docs-generated content from the source proto definitions and a rules file that enforces consistency.
The Rules Engine
Documentation at this scale drifts. A developer adds a field to the proto, forgets to update the docs, and now the examples don't compile. Prism prevents this by treating documentation as code.
The docs/rules/rules.md file contains 700+ lines of specifications that define:
Front matter format for every page
Required sections (Overview, Purpose, Request Fields, Response Fields, Examples)
Code example standards (test card numbers, authentication headers, endpoint format)
Table formats for operations, field documentation, and type references
Cross-linking patterns between related operations
When the proto definitions change, the documentation regenerates automatically. No human has to remember which pages need updates.
Generation Pipeline
proto definitions → parse messages/fields → apply rules.md templates → markdown outputThe generator reads the protobuf service definitions, extracts RPC operations and their request/response message structures, then formats them according to the rules specification.
For example, the PaymentService/Authorize RPC becomes:
Overview section — Business context for authorization flows
Purpose section — When to use Authorize vs CreateOrder
Request Fields table — Every field from
AuthorizeRequestwith types and descriptionsResponse Fields table — Every field from
AuthorizeResponseExample section — A working grpcurl command using Stripe test credentials
What Gets Generated
Service operations
Proto RPC definitions
/docs-generated/api-reference/services/{service}/{operation}.md
Service overview
Proto service comments
/docs-generated/api-reference/services/{service}/README.md
Connector guides
Connector implementation status
/docs-generated/connectors/{connector}.md
SDK reference
Proto types + examples
/docs-generated/sdks/{language}/README.md
The generation preserves hand-written content in /docs while keeping API reference in /docs-generated strictly derived from source.
Field Documentation Rules
The rules enforce completeness. Every field from the proto appears in the generated tables:
amount
Money
Yes
Amount to authorize in minor units
currency
string
Yes
ISO 4217 currency code
payment_method
PaymentMethod
Yes
Card, wallet, or bank transfer details
Missing fields in documentation are impossible because the generator pulls directly from the proto definition.
Example Consistency
All examples follow the same pattern:
Test credentials stay consistent across all 50+ connector examples. Developers copy-paste and it works.
Keeping Docs in Sync
When you add a new RPC to the PaymentService proto:
The generator creates a new markdown file at
/docs-generated/api-reference/services/payment-service/{rpc}.mdThe service README gets updated with a link to the new operation
Cross-references from related operations update automatically
The SUMMARY.md file includes the new page
No manual editing of individual markdown files. The rules.md specification drives everything.
Validation
The documentation build includes a validation pass that checks:
All proto RPCs have corresponding markdown files
All required sections exist in each file
Code examples use valid test credentials
Internal links resolve correctly
Front matter is properly formatted
Build fails if documentation doesn't match the rules. This prevents drift.
Benefits
Completeness: Every field documented, every time
Consistency: Same format across 500+ pages
Currency: Docs update when protos change
Accuracy: Examples use real test data that compiles
Your API documentation becomes a build artifact, not a maintenance burden.
Last updated
Was this helpful?

