Skip to content

Improve public API docs SEO and Mintlify metadata#2811

Merged
claudfuen merged 4 commits intomainfrom
codex/ahrefs-docs-seo-fixes
May 10, 2026
Merged

Improve public API docs SEO and Mintlify metadata#2811
claudfuen merged 4 commits intomainfrom
codex/ahrefs-docs-seo-fixes

Conversation

@claudfuen
Copy link
Copy Markdown
Contributor

@claudfuen claudfuen commented May 10, 2026

Summary

  • Broadened the public Comp AI API docs from questionnaire-only metadata to a full compliance automation API surface: evidence, tasks, policies, knowledge base, Trust Access, Trust Center, frameworks, controls, integrations, cloud checks, devices, people, training, vendors, risks, findings, SOA, and pentests.
  • Added a durable OpenAPI metadata layer in apps/api/src/openapi/* for Mintlify titles, descriptions, tags, content, code samples, production server URLs, SEO-safe fallbacks, and route/schema pruning.
  • Centralized the public-docs quality gate so generation and tests enforce the same rules for missing summaries, Mintlify metadata, SEO length, duplicate/sensitive surfaces, and private schema details.
  • Regenerated packages/docs/openapi.json from the NestJS source so Mintlify gets production https://api.trycomp.ai, complete x-mint.metadata, and no localhost examples.
  • Kept legitimate API-key/product APIs documented, including Trust Access request/grant management and public Trust Center data, while excluding app token/session plumbing such as questionnaire token upload and Trust Access reviewer-session routes.
  • Removed internal/private surfaces from the public spec: platform-admin/internal/auth/framework-editor/browserbase/assistant/health/email unsubscribe/webhook paths, Secrets, Billing, background checks, pentest credits, finding templates, OAuth setup internals, cloud remediation/legacy internals, and unused sensitive schemas.
  • Reworked authored docs positioning in packages/docs: API overview, introduction, Trust Access, and Security Questionnaire now point readers to API-key based automation instead of token-session implementation details.
  • Added Mintlify redirects for /api, /docs/api, removed token-questionnaire docs, and excluded/stale API reference groups.

Ahrefs Legitimacy Report

  • Legitimate: API docs had widespread missing/short/long metadata. The regenerated OpenAPI now has x-mint.metadata on all retained public operations with enforced title/description length bounds.
  • Legitimate: generated docs used localhost server data. The public spec now always uses https://api.trycomp.ai.
  • Legitimate: /docs/api and /api were broken/ambiguous docs routes. The docs config now redirects both to /api-reference/overview and avoids Mintlify reserved path behavior.
  • Legitimate but sensitive: some routes should not be public SEO targets. The public OpenAPI generator now removes those paths and prunes unused sensitive component schemas instead of relying on hidden pages.
  • Corrected after review: token/session endpoints are app/frontend plumbing, not the public integration contract. API-key backed product APIs remain documented broadly across Comp AI.
  • Not changed here: canonical feedback appears already addressed by recent commits, so this PR keeps focus on public docs metadata, route visibility, and authored docs quality.

Verification

  • bunx jest src/openapi-docs.spec.ts --runInBand
  • GEN_OPENAPI=1 bunx jest src/gen-openapi.spec.ts --runInBand
  • git diff --check
  • Generated spec audit: 276 public paths, 32 tags, production server URL, 0 duplicate Mintlify titles, no questionnaire token upload route, no Trust Access session/NDA routes, Trust Access admin APIs retained, public Trust Center APIs retained.
  • Sensitive scan of packages/docs/openapi.json: 0 hits for token upload/session routes, FedRAMP, internal finding-template details, secret disclosure enum, pipeline/test flags, localhost, or generated boilerplate fragments.

Notes

  • bun run typecheck in apps/api still fails on current-main issues unrelated to this diff, including @trycompai/billing module resolution, existing better-auth access-control typing, framework manifest fixture types, integration-platform manifest/spec mismatches, and several existing test mock signatures.
  • Three generated Prisma schema files are still untracked locally and intentionally not included in this PR.
  • Mintlify references used: OpenAPI customization, x-mint metadata/content, code samples, page visibility, redirects, and the reserved /api path warning.

@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented May 10, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
CompAI 🟢 Ready View Preview May 10, 2026, 5:09 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comp-framework-editor Ready Ready Preview, Comment May 10, 2026 9:30pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app Skipped Skipped May 10, 2026 9:30pm
portal Skipped Skipped May 10, 2026 9:30pm

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 7 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/docs/api-reference/overview.mdx">

<violation number="1" location="packages/docs/api-reference/overview.mdx:10">
P2: Narrow the auth wording here; not all API workflows use `X-API-Key`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread packages/docs/api-reference/overview.mdx Outdated
@vercel vercel Bot temporarily deployed to Preview – portal May 10, 2026 21:08 Inactive
@vercel vercel Bot temporarily deployed to Preview – app May 10, 2026 21:08 Inactive
@claudfuen claudfuen changed the title Fix Ahrefs docs SEO issues for questionnaire API Improve public API docs SEO and Mintlify metadata May 10, 2026
@vercel vercel Bot temporarily deployed to Preview – portal May 10, 2026 21:29 Inactive
@vercel vercel Bot temporarily deployed to Preview – app May 10, 2026 21:29 Inactive
@claudfuen claudfuen merged commit 1275f84 into main May 10, 2026
15 checks passed
@claudfuen claudfuen deleted the codex/ahrefs-docs-seo-fixes branch May 10, 2026 21:35
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.

1 participant