Overview
At Formbricks, we maintain strict documentation standards to ensure code clarity, maintainability, and ease of use for both internal developers and external contributors.Contribute to Documentation
We use Mintlify to maintain our documentation. You can find more information about how to contribute to the documentation in the README file.Code Documentation
Function Documentation
- Complex Logic Documentation
- All functions with complex logic must include JSDoc comments
- Document parameters, return types, and potential side effects
- Example:
- TypeScript Ignore Comments
- When using
@ts-ignoreor@ts-expect-error, always include a comment explaining why - Example:
- When using
API Documentation
-
API Endpoints
- All new API endpoints must be documented in the OpenAPI specification
- Include request/response schemas, authentication requirements, and examples
- Document both Client API and Management API endpoints
- Use
docs/api-reference/openapi.jsonfor v1,docs/api-v2-reference/openapi.ymlfor v2, and the v3 sources underdocs/api-v3-reference/src/; regenerate the v3 bundle withpnpm api:v3:sync
-
Authentication
- Clearly specify authentication requirements
- Document API key usage and permissions
- Include error scenarios and handling
Feature Documentation
- All new features must include a feature documentation file
- Document the feature’s purpose, usage, and implementation details
- Include code examples and best practices
Working with Mintlify
We use Mintlify to write our documentation.File Structure
- MDX Files
- All documentation files must use the
.mdxextension - Include frontmatter with required metadata:
- All documentation files must use the
- Navigation
- Add new pages to the appropriate section in
docs/docs.json - Follow the existing navigation structure
- Include proper redirects if URLs change
- Add new pages to the appropriate section in
Content Guidelines
- Writing Style
- Use clear, concise language
- Break content into logical sections with proper headings
- Include practical examples and code snippets
- Use Mintlify components for notes, warnings, and callouts:
-
Media and Assets
- Store images in the appropriate
/imagessubdirectory - Use descriptive alt text for all images
- Optimize images for web delivery
- Use relative paths for internal links
- Store images in the appropriate
-
Code Examples
- Specify the language for all code blocks
- Include comments for complex code snippets
- Use proper indentation and formatting
Validation
- Local Testing
- Test documentation locally using Mintlify CLI:
- Review Process
- Documentation changes require peer review
- Verify all links and references work
- Ensure proper formatting and rendering
One home for each instruction
Keep the runbooks version-neutral; version pages add only what’s specific to that version.
Use pinned versions in examples, never
latest.
Release notes for every release
GitHub Releases is the source of truth. Therelease-notes skill writes each stable release, including
patches and backports, with an ## Upgrade impact section: None, or Action required for named
setups with a link to the steps. After publication, copy the summary and the upgrade-impact line into
docs/platform/changelog.mdx. Don’t rewrite the text, and don’t publish a “review required” or other
“not yet known” status.
A release with nothing to do still gets an entry, but no extra page.
Version pages
Each minor gets one page, named<version>: Upgrade guide, with the sections What changes,
Before you upgrade, Patch actions, Upgrade, Check it worked and If something goes wrong.
Each patch adds a row to its minor’s Patch actions table. Use Unreleased: <Topic> for changes that
aren’t in a release yet. Use the copyable template in docs/templates/release-guidance.md.
Upgrades go one minor version at a time, to the latest patch of each. Skipping a minor version is not
supported. When you add a minor, add its row to the upgrade paths table.
Write for the reader
- For each manual step, say where to run it, the exact command or file change, and what the operator should see.
- Explain secret generation and bindings; don’t stop at “generate tokens” or “merge services”.
- Say what runs automatically and what the operator runs.
- Don’t describe how the page was made: no “evidence”, “source review” or “reviewed on” notes.
- Use plain words and short sentences. Avoid slash compounds such as “app/Hub” in sentences.
Review a documentation change
- Keep existing URLs. Add redirects for moved pages, and an invisible
<span id>for a removed heading anchor. - Check navigation, links, anchors, MDX rendering and mobile layout in the preview. Include screenshots in the PR.
- A documentation build doesn’t prove that an upgrade works.