AGENTS.md
Guidance for AI coding agents (Cursor, Claude, Windsurf, Warp, GitHub Copilot, etc.) working in this repository.Project Overview
This is the public documentation site for the entire D-Sports ecosystem, built on Mintlify. It documents:- The D-Sports API (full OpenAPI reference + per-domain narrative docs)
- The D-Sports Engage native mobile app (architecture, integration contracts, compliance evidence)
- The
d-sports-backendRust rewrite (parity/shim only — not the production API) - The
leaguesdata repo (league assets, sync workflows, canonical team data) - The
d-sports-sitemarketing site - The Game Engine (native client, API server, modularity) as its own Guides section
- Cross-cutting topics: ecosystem overview, AI tooling integration (Cursor, Claude Code, Windsurf), authentication, errors, rate limits
docs.json. Run mint dev to preview locally.
To refresh the site from latest source main branches, run /update-docs. That command loads .cursor/skills/update-docs/SKILL.md: pull d-sports-api, d-sports-engage-native, and d-sports-backend, diff OpenAPI/routes, update the spec in the API repo first if needed, sync it here, then rewrite narrative pages and nav.
Build & Run Commands
Thepredevhook runsbun run sync-openapiautomatically beforemint dev. The script lives atscripts/sync-openapi.tsand copiesopenapi.jsonfromd-sports-api(--api,D_SPORTS_API, or sibling../d-sports-api) intoapi-reference/openapi.json. If that checkout is missing, it keeps the committed spec.
Repository Layout
Conventions
Frontmatter (every MDX page)
Style
- Active voice, second person (“you”) — talking to the reader
- One idea per sentence — keep it scannable
- Sentence case for headings (
## Adding a new endpoint, not## Adding A New Endpoint) - Bold for UI elements: “Click Settings”
- Code formatting for file names, paths, commands, and code references (e.g.
prisma/schema.prisma) - Avoid emoji unless the surrounding doc already uses them
Navigation
- All sidebar / tab structure is in
docs.json. New pages must be referenced there or they won’t appear in the nav. - Run
mint broken-linksafter restructuring to catch dangling references.
OpenAPI
- Never hand-edit
api-reference/openapi.json. It is regenerated fromd-sports-api’s spec byscripts/sync-openapi.ts. - If the API changes, update the spec in
d-sports-api, then re-runbun run sync-openapihere, then update the matching narrative page underapi-reference/domains/<domain>.mdxand the deep dive underrepositories/d-sports-api/<domain>/. - The endpoint coverage tracker is at
api-reference/domains/route-coverage-matrix.mdx.
Common Tasks
Add a new docs page
- Create the MDX file in the right folder (mirror existing structure).
- Add proper frontmatter (
title,descriptionminimum). - Add the page to
docs.jsonunder the right group/tab. - Run
bun run devand verify it renders + appears in the sidebar. - Run
mint broken-linksif you added cross-page links.
Document a new API domain
- Add narrative page under
api-reference/domains/<new-domain>.mdx. - Mirror with deep-dive folder
repositories/d-sports-api/<new-domain>/containing at leastindex.mdx,architecture.mdx,behavior.mdx. - Update
repositories/d-sports-api.mdxto link the new domain. - Add both pages to
docs.json.
Update an integration contract
For native ↔ API contract changes, update both:repositories/d-sports-engage-native/integration-contracts.mdx- The relevant
repositories/d-sports-api/<domain>/behavior.mdx
Mintlify Quick Reference
Full schema: mintlify.com/docs.json. Component cheat sheet: mintlify.com/docs/llms.txt.Code blocks
Fenced blocks supporttitle, icon, lines, wrap, expandable, highlight, focus, twoslash, and diff syntax (// [!code ++] / // [!code --]).
filename.ts
MDX 3
Mintlify supports MDX 3: adjacent block JSX/expressions without extra newlines,await in expressions, ES2024 syntax.
Sibling Workspaces
This documentation site sits alongside the code repos it documents:
When the source repo changes, the docs need to keep up. The
d-sports-api repo is the most coupled — most doc PRs here are paired with one there.
What Not To Do
- Don’t hand-edit
api-reference/openapi.json. It’s generated. - Don’t write docs that duplicate
repositories/<repo>/AGENTS.md— link to the source repo instead. AGENTS.md files are for in-repo agent guidance; this site is for end-users and integrators. - Don’t ship product features from this repo. Code lives in the sibling repos.
- Don’t add a page without registering it in
docs.json— Mintlify won’t surface it in the nav.
Optional: Mintlify MCP
For live docs search inside an agent, see the Mintlify MCP server. The workspaced-sports-engage-native already wires it into .cursor/mcp.json as Mintlify Docs.
Cursor Cloud specific instructions
The dependency-refresh step (bun install) runs automatically on VM startup. bun and the mint CLI are pre-installed in the environment snapshot (both on PATH via /usr/local/bin); you do not need to install them.
bun run sync-openapikeeps the committed spec whend-sports-apiis not beside this repo. Pass--api <dir>or setD_SPORTS_APIto copy from a checkout.bun run devcan run in the cloud VM without a sibling clone. The generatedapi-reference/openapi.jsonis already committed.mint devserves onhttp://localhost:3000.- Lint/validate commands both run but exit non-zero for pre-existing, non-environment reasons (see the Build & Run Commands and Development sections).
mint broken-linksreports the four../<sibling-repo>/links in this file (AGENTS.mdis agent guidance, not a published page).mint validateemits one warning because Mintlify tries to validatedocs.jsonas an OpenAPI file. Neither indicates a broken setup.
