External API Mintlify Docs 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: Initialize API-Doc as a Mintlify docs site and publish the currently implemented external/* endpoints from a60-lensmor-event-business as developer-facing API reference pages, while updating PM external API docs to match implemented behavior.
Architecture: Use a code-first documentation pipeline. First create a committed endpoint inventory artifact from live controllers plus DTO/service/filter/runtime auth checks, then scaffold a manual-MDX Mintlify site with resource-based navigation, then author shared pages and one endpoint page per route, and finally reconcile the PM revision/auth docs to the same inventory.
Tech Stack: Mintlify (mint.json + MDX), NestJS controller/DTO/service/filter code inspection, PM markdown docs, Git
Inputs
- Spec:
docs/superpowers/specs/2026-03-24-external-api-mintlify-design.md - Source controllers:
../a60-lensmor-event-business/src/modules/external-api/controllers/external-events.controller.ts../a60-lensmor-event-business/src/modules/external-api/controllers/external-exhibitors.controller.ts../a60-lensmor-event-business/src/modules/external-api/controllers/external-personnel.controller.ts../a60-lensmor-event-business/src/modules/external-api/controllers/external-contacts.controller.ts../a60-lensmor-event-business/src/modules/external-api/controllers/external-profile-matching.controller.ts
- Runtime auth / error truth:
../a60-lensmor-event-business/src/modules/external-api/external-api-auth.middleware.ts../a60-lensmor-event-business/src/common/filters/all-exceptions.filter.ts../a60-lensmor-event-business/src/main.ts../a60-lensmor-event-business/test/e2e/external-events.e2e-spec.ts../a60-lensmor-event-business/test/e2e/external-exhibitors.e2e-spec.ts
- PM docs:
../a60-lensmor-pm/工作流/研发设计/external-api-platform/README.md../a60-lensmor-pm/工作流/研发设计/external-api-platform/外部 API 鉴权与错误契约.md../a60-lensmor-pm/工作流/研发设计/external-api-platform/外部 API 接口文档(revision).md
Planned File Structure
Create
mint.json— Mintlify site settings and navigationindex.mdx— public introduction pageauthentication.mdx— shared external auth page using runtime truthconcepts/errors.mdx— shared external error contract pageconcepts/pagination.mdx— shared pagination/response conventions pageapi-reference/events/list.mdxapi-reference/events/fit-score.mdxapi-reference/events/rank.mdxapi-reference/events/brief.mdxapi-reference/exhibitors/list.mdxapi-reference/exhibitors/search.mdxapi-reference/exhibitors/profile.mdxapi-reference/exhibitors/events.mdxapi-reference/personnel/list.mdxapi-reference/personnel/profile.mdxapi-reference/personnel/events.mdxapi-reference/contacts/search.mdxapi-reference/profile-matching/recommendations-events-paged.mdxapi-reference/profile-matching/recommendations-exhibitors.mdxdocs/endpoint-inventory/external-api-endpoints.md— committed endpoint inventory gate artifactdocs/reconciliation/external-api-pm-reconciliation.md— bounded reconciliation table required by specdocs/response-sources/events.md— evidence notes for Events response examples and success codesdocs/response-sources/exhibitors.md— evidence notes for Exhibitors response examples and success codesdocs/response-sources/personnel-and-contacts.md— evidence notes for Personnel/Contacts response examples and success codesdocs/response-sources/profile-matching.md— evidence notes for Profile Matching response examples and success codes
Modify
README.md— local contributor setup / preview instructions for the Mintlify site../a60-lensmor-pm/工作流/研发设计/external-api-platform/外部 API 鉴权与错误契约.md— align auth prefix and external error contract to runtime truth../a60-lensmor-pm/工作流/研发设计/external-api-platform/外部 API 接口文档(revision).md— align endpoint list and examples to implemented controllers only../a60-lensmor-pm/工作流/研发设计/external-api-platform/README.md— tighten description if needed so revision doc is clearly “implemented now” and older drafts remain historical
Implementation Notes
- Do not publish PM-draft-only endpoints in Mintlify.
- Treat controller routes as the only method/path source of truth.
- Treat
/external/*exception filtering as the final source of truth for error-body shape. - Treat runtime middleware as the public source of truth for API key prefix and auth examples even if Swagger/tests still differ.
- Record auth/test/Swagger discrepancies in the reconciliation artifact instead of silently smoothing them over.
- Every endpoint page must include
Success status code. - Use manual MDX pages for v1 of the docs site; do not build an OpenAPI-driven site in this pass.
- Prefer small commits after each completed task group.
Task 1: Create the committed endpoint inventory gate artifact
Files:-
Create:
docs/endpoint-inventory/external-api-endpoints.md -
Read/inspect only: all five controller files,
../a60-lensmor-event-business/src/common/filters/all-exceptions.filter.ts,../a60-lensmor-event-business/src/modules/external-api/external-api-auth.middleware.ts - Step 1: Write the inventory artifact skeleton
- Step 2: Fill in the 14 implemented endpoints from live controllers
-
GET /external/events/list -
POST /external/events/fit-score -
POST /external/events/rank -
GET /external/events/brief -
GET /external/exhibitors/list -
POST /external/exhibitors/search -
GET /external/exhibitors/profile -
GET /external/exhibitors/events -
GET /external/personnel/list -
GET /external/personnel/profile -
GET /external/personnel/events -
GET /external/contacts/search -
POST /external/profile-matching/recommendations/events/paged -
GET /external/profile-matching/recommendations/exhibitors - Step 3: Add auth and error truth notes to the artifact
- Step 4: Verify the artifact against controllers and middleware/filter
- all 14 routes are present exactly once
-
no
job/start,job/status, orrecommendations/eventsGET route is listed -
auth note says
uak_... -
error note says
{ code, message, errorKey, traceId } - Step 5: Commit the gate artifact
Task 2: Create the PM reconciliation artifact before page writing
Files:-
Create:
docs/reconciliation/external-api-pm-reconciliation.md -
Read/inspect:
../a60-lensmor-pm/工作流/研发设计/external-api-platform/README.md -
Read/inspect:
../a60-lensmor-pm/工作流/研发设计/external-api-platform/外部 API 鉴权与错误契约.md -
Read/inspect:
../a60-lensmor-pm/工作流/研发设计/external-api-platform/外部 API 接口文档(revision).md -
Reference:
docs/endpoint-inventory/external-api-endpoints.md - Step 1: Write the reconciliation table skeleton
- Step 2: Add shared contract discrepancy rows first
-
auth token prefix: code=
uak_..., PM=sk_..., Mintlify=publish uak_... -
external error body: code=
{ code, message, errorKey, traceId }, PM missing/older shape - success status semantics for POST endpoints when evidenced by runtime/tests
- Step 3: Add one row per live endpoint
-
GET /external/events/list -
POST /external/events/fit-score -
POST /external/events/rank -
GET /external/events/brief -
GET /external/exhibitors/list -
POST /external/exhibitors/search -
GET /external/exhibitors/profile -
GET /external/exhibitors/events -
GET /external/personnel/list -
GET /external/personnel/profile -
GET /external/personnel/events -
GET /external/contacts/search -
POST /external/profile-matching/recommendations/events/paged -
GET /external/profile-matching/recommendations/exhibitors - Step 4: Add rows for PM-only or stale routes that must not be published
-
POST /external/profile-matching/job/start -
GET /external/profile-matching/job/status -
GET /external/profile-matching/recommendations/events - Step 5: Review the table against the endpoint inventory
- every live endpoint appears explicitly
- auth mismatch is explicit
- error-contract mismatch is explicit
- planned-only endpoints are marked non-published
- Step 6: Commit the reconciliation artifact
Task 3: Initialize Mintlify settings and top-level navigation
Files:-
Create:
mint.json -
Modify:
README.md - Step 1: Verify current Mintlify requirements before writing config
- required top-level
mint.jsonfields for a valid site - navigation/group syntax expected by current Mintlify docs/CLI
- local preview command needed to validate the project
-
the implementer can write
mint.jsonusing current Mintlify requirements rather than memory -
Step 2: Write
mint.jsonwith minimal valid site settings and the planned navigation
- intro page
- auth page
-
one
API Referencegroup with all 14 endpoint pages -
one
Conceptsgroup with shared support pages -
Step 3: Update
README.mdwith local docs instructions
- Step 4: Create temporary placeholder page files only if required for config validation
- Step 5: Run local Mintlify validation/preview
- Step 6: Fix any config/path issues revealed by validation and rerun once
- Step 7: Commit the site scaffold config
Task 4: Author shared public pages from runtime truth
Files:-
Create:
index.mdx -
Create:
authentication.mdx -
Create:
concepts/errors.mdx -
Create:
concepts/pagination.mdx -
Reference:
docs/endpoint-inventory/external-api-endpoints.md -
Reference:
docs/reconciliation/external-api-pm-reconciliation.md -
Reference: runtime auth/error files in
a60-lensmor-event-business -
Step 1: Write
index.mdxwith the site purpose and current scope
- Step 2: Write
authentication.mdxfrom runtime middleware truth
Notes
- Bearer scheme is case-insensitive at runtime
- Public docs follow runtime middleware behavior
- Older PM/Swagger references to
sk_...are historical and not the public-doc source of truth for this phase
Notes
- External responses include
traceId - External error bodies do not expose internal
dataordetailsfields
Task 5: Author Events and Profile Matching API pages
Files:-
Create:
api-reference/events/list.mdx -
Create:
api-reference/events/fit-score.mdx -
Create:
api-reference/events/rank.mdx -
Create:
api-reference/events/brief.mdx -
Create:
api-reference/profile-matching/recommendations-events-paged.mdx -
Create:
api-reference/profile-matching/recommendations-exhibitors.mdx -
Create:
docs/response-sources/events.md -
Create:
docs/response-sources/profile-matching.md -
Read/inspect supporting DTOs, services, response mappers, stable response-building code, and any relevant tests from
../a60-lensmor-event-business/src/modules/external-api/ -
Step 1: Write
docs/response-sources/events.mdwith evidence for the four Events pages
- method/path source file
- DTO/query/body source file
- success status source (runtime or tests)
- response example source (mapper/service/response builder)
- ambiguity note if any
-
Step 2: Write
docs/response-sources/profile-matching.mdwith evidence for the two Profile Matching pages
- method/path source file
- DTO/query/body source file
- success status source
- response example source
-
error-contract note pointing to shared
/external/*filter behavior -
Step 3: Write one reusable endpoint-page template and apply it to
events/list
Error responses
401 Unauthorized
Notes
- …
Task 6: Author Exhibitors, Personnel, and Contacts API pages
Files:-
Create:
api-reference/exhibitors/list.mdx -
Create:
api-reference/exhibitors/search.mdx -
Create:
api-reference/exhibitors/profile.mdx -
Create:
api-reference/exhibitors/events.mdx -
Create:
api-reference/personnel/list.mdx -
Create:
api-reference/personnel/profile.mdx -
Create:
api-reference/personnel/events.mdx -
Create:
api-reference/contacts/search.mdx -
Create:
docs/response-sources/exhibitors.md -
Create:
docs/response-sources/personnel-and-contacts.md -
Read/inspect supporting DTOs, services, response mappers, stable response-building code, and any relevant tests from
../a60-lensmor-event-business/src/modules/external-api/ -
Step 1: Write
docs/response-sources/exhibitors.mdwith evidence for the four Exhibitors pages
- method/path source file
- DTO/query/body source file
- success status source
- response example source
- ambiguity note if any
-
Step 2: Write
docs/response-sources/personnel-and-contacts.mdwith evidence for the four Personnel/Contacts pages
- method/path source file
- DTO/query source file
- success status source
- response example source
- ambiguity note if any
- Step 3: Write the four Exhibitors pages
-
POST /external/exhibitors/searchwith explicit success status code from route/tests -
GET /external/exhibitors/profileusingexhibitor_id, notcompany_name -
Step 4: Write the three Personnel pages and
contacts/search
- Step 5: Verify all eight pages against controller routes, DTOs, response-source notes, and shared error/auth pages
- page title matches route purpose
- every page has success status code
- no unsupported query mode is documented
- each response example is traceable to the response-source notes
- Step 6: Commit these resource pages plus evidence notes
Task 7: Reconcile PM auth and revision documents to implemented behavior
Files:-
Modify:
../a60-lensmor-pm/工作流/研发设计/external-api-platform/外部 API 鉴权与错误契约.md -
Modify:
../a60-lensmor-pm/工作流/研发设计/external-api-platform/外部 API 接口文档(revision).md -
Modify:
../a60-lensmor-pm/工作流/研发设计/external-api-platform/README.md -
Reference:
docs/reconciliation/external-api-pm-reconciliation.md - Step 1: Patch PM auth doc to reflect runtime public truth and historical drift
-
replace
sk_...public examples withuak_... -
update error contract to include
traceId -
note that
/external/*final error body is the external contract - preserve history only as note, not as current contract
- Step 2: Patch PM revision doc to match live endpoint inventory
-
remove live-status framing for
job/start,job/status,GET /recommendations/events -
add implemented routes now missing from the revision summary (
events/list,exhibitors/list,exhibitors/events,personnel/list,personnel/profile,personnel/events,POST /profile-matching/recommendations/events/paged) -
fix auth examples to
uak_... - Step 3: Update PM README only if navigation wording is now misleading
- Step 4: Review PM docs against the reconciliation artifact
-
current contract uses
uak_... - revision doc no longer claims unimplemented routes are live
- implemented-now wording is consistent across PM entry docs
- Step 5: Commit the PM alignment changes
Task 8: Final verification and cleanup
Files:-
Review only: all created Mintlify pages,
mint.json, inventory artifact, reconciliation artifact, response-source notes, PM docs - Step 1: Run a final route/page cross-check manually
- 14 live endpoints in inventory
- 14 endpoint pages in Mintlify nav
- no draft-only endpoint page exists
- Step 2: Run a final auth/error truth check manually
-
auth pages/examples use
uak_... -
external errors show
{ code, message, errorKey, traceId } -
no public page mentions
dataordetailsas external error-body fields - Step 3: Run a final success-status and response-source check manually
-
each page includes a
Success status codesection -
POST routes do not silently default to
200 - each endpoint example is traceable to a response-source note
- Step 4: Run the local Mintlify preview/validation one more time
- config loads
- navigation resolves
- created pages render without missing-file errors
-
Step 5: Review
README.mdandmint.jsonfor contributor clarity
- a new contributor can find the main docs files quickly
- nav references only existing pages
- Step 6: Commit the final cleanup if needed