Documentation
This page covers where the docs live, the style guide every page follows, how Mintlify is set up and synced, and how to disconnect it if you need to.Where docs live
All documentation lives underapps/documentation/. The directory maps 1:1 to the Mintlify site structure — folder names become URL path segments, file names become page URLs.
.md). The sync workflow converts them to .mdx automatically before pushing to Mintlify. You never need to touch .mdx files directly.
Style guide
Every page in Refract’s docs follows the same shape. Here’s the short version: Tone — Warm and direct, like a knowledgeable teammate explaining things over coffee. No filler, no committee-speak. First-person is fine. Short sentences. Structure — Every page should have:- A one-sentence frontmatter description
- An
🤖 Agent contextblock right after the H1 (see format below) - Clear sections with code examples
- A
What's next?section at the bottom
```ts, ```bash, etc.). When in doubt, show the code.
Callouts — Use Mintlify’s native callout syntax:
.md or converted to .mdx:
⚠️ Watch out: Don’t use relative.mdpaths like../architecture/configuration-system.md— those only work after the sync script rewrites them. Root-absolute paths work immediately on every push.
Mintlify setup
Refract’s documentation is hosted on Mintlify. The connection lives entirely in GitHub — there’s no separate build step you need to run. If you are using a custom docs domain, manage the domain and DNS at the provider level (Cloudflare is the recommended setup in this project) and keep that operational guide in deployment docs, not in random page-level notes. How to connect a new Mintlify project:- Sign up at mintlify.com and create a new project.
- In the Mintlify dashboard, install the Mintlify GitHub App on your repo and set the docs root to
apps/documentation. - Mintlify will look for
apps/documentation/docs.jsonas the site config. It’s already there. - That’s it — no secrets or API keys needed. The integration runs through the GitHub App.
main, the mintlify-docs-sync workflow automatically runs .github/scripts/mintlify_sync.mjs. That script:
- Snapshots every file under
apps/documentation/into memory. - Converts
.mdfiles to.mdx. - Rewrites internal links to extensionless, root-absolute Mintlify routes.
- Validates all
.mdxfiles for parse errors and broken links. - Commits the converted files back to the repo (Mintlify watches the repo and picks up the commit).
workflow_dispatch (with an optional dry_run flag). Source and target roots are intentionally locked to apps/documentation to prevent accidental writes to other directories.
Domain and DNS guidance
Custom docs domains should be documented as part of deployment operations so they are easy to audit and hand off. For Cloudflare-specific domain transfer, DNS records, CDN cache behavior, and SSL/TLS setup, use: When you update domain settings, also verify docs links and canonical URLs still resolve after propagation.How to disconnect Mintlify
If you decide to move away from Mintlify, here’s how to cleanly disconnect:- In the Mintlify dashboard — go to
Settings → Danger Zoneand disconnect the GitHub integration. - Remove the workflow — delete
.github/workflows/mintlify-docs-sync.ymland.github/scripts/mintlify_sync.mjs. - Keep the source docs —
apps/documentation/stays as-is. The.mdfiles are plain Markdown and work with any static site generator (Docusaurus, VitePress, etc.). - Remove
docs.json— this is Mintlify-specific. If you’re moving to another platform, replace it with that platform’s config file.
docs.json and the sync workflow.
What’s next?
- Continuous Integration — how the sync workflow fits into the broader CI setup.
- Architecture Overview — the boundaries every doc page is written around.
