Data normalization docs and OpenAPI sync implementation plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.
Goal: Align the docs site with the final normalization state (Phase 1 -> Phase 2 batches A/B/C/D -> Phase 2B/2C -> app 1.10.10) and keep OpenAPI synced from d-sports-api as source of truth.
Architecture: Treat ../d-sports-api/openapi.json as canonical API contract, sync it into docs, then update Mintlify fundamentals/domain/repository pages to describe the final strict envelope behavior and exceptions. Add an explicit coverage audit artifact so missing OpenAPI paths are intentional and documented, not accidental drift.
Tech Stack: Mintlify (docs.json, MDX), Bun scripts, OpenAPI 3.1 JSON, Next.js API routes (d-sports-api), Expo native client (d-sports-engage-native).
File structure and responsibility map
d-sports-api/openapi.jsonCanonical route contract used by generated API reference pages.docs/api-reference/openapi.jsonSynced copy consumed by Mintlify endpoint generation.docs/api-reference/introduction.mdxEntry page for API architecture and how to use generated endpoint docs.docs/api-reference/errors-and-status-codes.mdxCanonical semantics for status code andcode-field handling.docs/api-reference/authentication.mdxAuth contract + protected/public expectations.docs/api-reference/domains/*.mdxDomain-level endpoint maps and migration-specific caveats.docs/repositories/d-sports-api.mdxBackend/PWA lifecycle notes and normalization rollout summary.docs/repositories/d-sports-engage-native.mdxNative contract behavior aligned with strict envelope mode (1.10.10).docs/docs.jsonNavigation updates for any newly added normalization contract/history page.docs/.mintlify/workflows/api-docs-sync.mdWorkflow rules for future updates after merges.docs/docs/superpowers/artifacts/2026-03-22-openapi-route-audit.md(new) Route coverage decision log for every API route not present in OpenAPI.docs/scripts/audit-openapi-coverage.ts(new, optional but recommended) Repeatable route-vs-spec audit script.
Task 1: Capture route/spec baseline and classify coverage deltas
Files:-
Create:
docs/superpowers/artifacts/2026-03-22-openapi-route-audit.md - Modify: none
- Test: run shell audit command from docs repo root
- Step 1: Generate route-vs-openapi inventory
- Step 2: Classify each missing path
docs/superpowers/artifacts/2026-03-22-openapi-route-audit.md, classify each route as:
-
public-and-should-document -
internal/admin/not-in-public-reference -
test/debug/operational -
non-json/stream/binary exception - Step 3: Define action per route
public-and-should-document route, add “OpenAPI add/update required” with owning repo file path.
- Step 4: Commit baseline artifact
Task 2: Update canonical OpenAPI and sync into docs
Files:-
Modify:
../d-sports-api/openapi.json(only where Task 1 marked required) -
Modify (synced):
api-reference/openapi.json - Test: OpenAPI validation + hash parity check
- Step 1: Patch canonical OpenAPI in API repo
../d-sports-api/openapi.json for any public missing routes and any route contract changes introduced by Phase 2/2B/2C and app 1.10.10.
- Step 2: Validate canonical OpenAPI
../d-sports-api:
- Step 3: Sync spec into docs repo
api-reference/openapi.json updated from ../d-sports-api/openapi.json.
- Step 4: Verify file parity
- Step 5: Commit synced spec
Task 3: Update API fundamentals for final normalization contract
Files:-
Modify:
api-reference/introduction.mdx -
Modify:
api-reference/errors-and-status-codes.mdx -
Modify:
api-reference/authentication.mdx -
Create:
api-reference/normalization-contract-and-rollout.mdx -
Modify:
docs.json(add new page in API Fundamentals) - Test: local content/link checks
- Step 1: Add normalization contract page
api-reference/normalization-contract-and-rollout.mdx covering:
- rollout timeline: Phase 1 -> Phase 2 A/B/C/D -> Phase 2B/2C -> app
1.10.10 - standard envelope:
-
strict native behavior (
INVALID_RESPONSE_ENVELOPEon non-envelope2xx) - known exceptions (SSE/binary passthrough routes).
- Step 2: Update fundamentals pages to link/use new contract
code semantics.
- Step 3: Add page to navigation
api-reference/normalization-contract-and-rollout in docs.json under API Fundamentals.
- Step 4: Commit fundamentals update
Task 4: Refresh domain guides for phase-2-complete behavior
Files:-
Modify:
api-reference/domains/auth-onboarding.mdx -
Modify:
api-reference/domains/social-locker-room.mdx -
Modify:
api-reference/domains/gamification.mdx -
Modify:
api-reference/domains/commerce.mdx -
Modify:
api-reference/domains/collectibles.mdx -
Modify:
api-reference/domains/wallet-web3.mdx -
Modify:
api-reference/domains/moderation.mdx -
Modify:
api-reference/domains/platform-infra.mdx -
Test: MDX lint by
mint validate - Step 1: Update endpoint caveats by domain
- Step 2: Link each domain to normalization contract page
/api-reference/normalization-contract-and-rollout.
- Step 3: Commit domain updates
Task 5: Update repository overviews to match latest rollout state
Files:-
Modify:
repositories/d-sports-api.mdx -
Modify:
repositories/d-sports-engage-native.mdx - Test: link check + content accuracy pass
- Step 1: Add normalized API contract summary to backend page
repositories/d-sports-api.mdx, add a concise “API contract status” section that points to the normalization contract page and OpenAPI source-of-truth workflow.
- Step 2: Add strict client behavior summary to native page
repositories/d-sports-engage-native.mdx, document strict envelope mode and the app-version anchor at 1.10.10.
- Step 3: Commit repository updates
Task 6: Harden future sync workflow (recommended)
Files:-
Modify:
.mintlify/workflows/api-docs-sync.md -
Create:
scripts/audit-openapi-coverage.ts -
Modify:
package.json - Test: run audit script
- Step 1: Add explicit sync gates to workflow
-
update
../d-sports-api/openapi.json -
run
bun run sync-openapi - run route coverage audit
- update docs pages when behavior changes.
- Step 2: Add repeatable coverage audit script
scripts/audit-openapi-coverage.ts to print and optionally fail on undocumented public routes.
- Step 3: Expose audit command
package.json:
- Step 4: Commit guardrail updates
Task 7: Verify docs integrity end-to-end and package PR
Files:- Modify: none (verification/report only)
- Test: Mintlify + OpenAPI + broken links
- Step 1: Run final verification
- Step 2: Validate timeline consistency
- Phase 1 established starter envelope
- Phase 2 A/B/C/D completed
- Phase 2B/2C action/client hardening completed
-
app/version context aligned to
1.10.10. - Step 3: Prepare PR summary
- canonical OpenAPI changes
- synced docs OpenAPI update
- docs pages updated
- coverage audit results (including intentional exclusions list).
