Cycle 214: AI-Native Spec-Driven Development — Mintlify + PRDs + RFCs + Cycles
Priority: HIGH Status: DONE Domain: infra Wave: 10 Owner: @pj Dependencies: None Product: Flux — AI-native hiring platform Organization: Employ Inc. (employ-inc GitHub org)
Overview
Flux development currently relies on Cycle docs as the primary spec artifact. These docs are powerful — detailed architecture, file-level implementation plans, validation criteria — but the development process lacks formal separation between product requirements (what), architectural decisions (how), and implementation plans (build). There’s no structured way for PMs to own functional specs, no formal RFC process for engineering decisions, and no AI-native tooling to make specs consumable by coding agents. This cycle establishes a complete, AI-native spec-driven development process built on three pillars:- PRDs (
docs/PRDs/) — Product Requirements Documents. The PM-owned functional spec. Written in Mintlify’s web editor or directly in MDX. Every feature starts here. - RFCs (
docs/RFCs/) — Request for Comments. Engineering-owned non-functional specs: architecture decisions, performance requirements, security constraints, data model changes. Written by engineers in MDX. - Cycle Docs (
docs/roadmap/cycles/) — Implementation specs. The engineering plan derived from one or more PRDs/RFCs. Contains architecture, file index, validation plan, and maps to GitHub Project items for tracking.
.mdx) for Mintlify’s full component support, while Cycle docs remain plain Markdown (.md) since they are engineering-internal and don’t need interactive components. Bi-directional GitHub sync means edits in Mintlify’s web editor push commits, and repo commits appear instantly in Mintlify. Critically, Mintlify provides:
- Autopilot: Proactive AI agent that monitors the repo, detects code changes that affect specs, and opens PRs with doc updates automatically
AGENTS.md: Customization file for AI agent behavior (mirrors ourCLAUDE.mdpattern)- Auto-generated MCP server: Every Mintlify site gets an MCP server that Claude Code can query
llms.txt/llms-full.txt: Auto-generated AI-friendly content index- AI traffic analytics: See which AI agents consume specs and where they fail
docs/PRDs/ in the repo, an engineer creates a Cycle doc referencing it, Claude Code implements the feature reading all three spec types as native repo files, and Autopilot flags when code changes drift from the spec — no Slack threads, no lost context, no spec drift.
Current State
What Works
- Cycle docs are mature and detailed (established template with frontmatter, architecture, implementation plan, validation criteria)
- GitHub Projects track cycle execution with project items
- ADR pattern exists but is nascent (1 ADR so far)
- Claude Code already consumes cycle docs as context during implementation
CLAUDE.mdpattern is established — Mintlify’sAGENTS.mdis a natural extension
What’s Missing
- No PRD structure — functional requirements are embedded in cycle docs, making it hard for PMs to own and edit them independently
- No RFC structure — architectural decisions are either in cycle docs or ADRs, with no clear process for proposing and reviewing non-functional requirements
- No documentation platform — all docs are raw markdown with no navigation, search, or AI-powered discovery
- No proactive spec drift detection — when code changes, no one checks if specs are still accurate
- No formal spec → cycle → implementation traceability — the link between “what the PM asked for” and “what got built” is implicit
- No templates — cycle doc format is established by convention but not documented as a template
Architecture: The Spec-Driven Development Loop
Three-Document Model
Document Ownership & Lifecycle
| Document | Owner | Audience | Edited In | Lifecycle |
|---|---|---|---|---|
| PRD | PM | PM, Eng, Stakeholders | Mintlify web editor or MDX in repo | draft → review → approved → in-progress → completed |
| RFC | Engineer | Engineers, Architects | MDX in repo (primary), Mintlify (browse) | draft → review → accepted / rejected / superseded |
| Cycle Doc | Engineer | Engineers, AI agents | MDX in repo | draft → ready → in-progress → complete |
Traceability Chain
Implementation Plan
Phase 1: Repository Structure & Templates
Goal: Establish thedocs/PRDs/ and docs/RFCs/ directories with templates, process docs, and Mintlify navigation config.
1.1 Directory Structure
1.2 Mintlify Configuration
File:docs/docs.json
Note: Mintlify migrated frommint.jsontodocs.jsonin early 2025. The new schema consolidates navigation into a single recursive object with tabs containing groups.
1.3 AGENTS.md (AI Agent Customization)
File:AGENTS.md (repository root — Mintlify expects this at the repo root, not inside docs/)
1.4 PRD Template
File:docs/PRDs/_template.mdx
1.5 RFC Template
File:docs/RFCs/_template.mdx
1.6 Cycle Doc Template
File:docs/roadmap/cycles/_template.md
Phase 2: Process Documentation
2.1 Docs Landing Page
File:docs/README.md
Content: Overview of the spec-driven dev process, the three-document model (PRDs → RFCs → Cycles), how to create each type, how they flow into GitHub Projects and Claude Code implementation. Includes a quick-start guide for PMs (use Mintlify web editor) and engineers (use your editor, files are MDX in the repo).
2.2 PRD Process Guide
File:docs/PRDs/README.md
Content:
- What is a PRD? — The PM-owned functional specification. Captures what to build and why.
- When to write a PRD — Every new feature, significant enhancement, or user-facing change.
- When NOT to write a PRD — Bug fixes, refactors, infra changes (use Cycle docs directly). Tech debt (use RFCs).
- PRD numbering — Sequential: PRD-001, PRD-002, etc. Never reuse numbers.
- PRD lifecycle —
draft→ PM writes in Mintlify web editor or MDX →review→ stakeholder feedback →approved→ engineer creates Cycle doc →in-progress→ implementation begins →completed→ feature shipped. - How to create a PRD — Option A: Mintlify web editor (duplicate template, fill sections). Option B: Copy
_template.mdx, rename toPRD-NNN-slug.mdx, edit in your IDE. - Tips for AI-friendly PRDs — Use structured headings, explicit acceptance criteria with Given/When/Then, avoid ambiguity. Claude Code reads your PRD as a native file during implementation. Mintlify Autopilot monitors for spec drift.
2.3 RFC Process Guide
File:docs/RFCs/README.md
Content:
- What is an RFC? — An engineering-owned proposal for non-functional decisions: architecture, data model changes, security, performance, infrastructure, process changes.
- When to write an RFC — New architectural patterns, breaking API changes, security model changes, new infrastructure, process changes, anything requiring cross-team input.
- When NOT to write an RFC — Feature requirements (use PRDs). Implementation details (use Cycle docs).
- RFC numbering — Sequential: RFC-001, RFC-002, etc.
- RFC lifecycle —
draft→ author writes →review→ reviewers provide feedback via GitHub PR →accepted/rejected/superseded. - Review process — RFCs require at least one reviewer. For architectural RFCs, the CTO reviews.
- Relationship to ADRs — An accepted RFC may result in an ADR that records the decision. RFCs capture the discussion; ADRs capture the outcome.
Phase 3: Mintlify Setup
3.1 Mintlify Project Configuration
- Sign up at mintlify.com and create a project for Employ Inc
- Connect GitHub repository:
employ-inc/flux - Set documentation directory to
docs/ - Configure branch:
main - Deploy — Mintlify reads
docs.jsonand renders the site - Verify bi-directional sync: edit in Mintlify web editor → commit appears on
main
3.2 Mintlify Autopilot Configuration
Autopilot is enabled per-project and configured via the Mintlify dashboard +AGENTS.md:
- Enable Autopilot in the Mintlify dashboard for the Flux project
- Configure monitoring: Point Autopilot at the
backend/andweb/directories for code change detection - Set behavior: When code changes are detected that affect spec’d functionality, Autopilot opens a PR with suggested doc updates (not auto-merge)
AGENTS.md(created in Phase 1) customizes what Autopilot looks for and how it suggests changes
3.3 Mintlify MCP Server + Claude Code Integration
Mintlify auto-generates an MCP server at the/mcp path of every published site using Streamable HTTP transport. Add it to Claude Code:
.mcp.json at the repo root:
llms.txt and llms-full.txt at the site root for AI-friendly content indexing.
3.4 Mintlify Plan Recommendation
| Plan | Cost | Key Features |
|---|---|---|
| Hobby | Free | 1 editor, GitHub sync, web editor, custom domain, MCP server, LLM optimizations |
| Pro | $300/mo | 5 editors, AI Assistant, Autopilot, preview deployments, password protection, styling checks |
| Custom (Enterprise) | Contact sales | + SSO, 99.99% SLA, granular permissions, audit logs, SOC 2 |
3.5 Team Permissions
| Role | Access | Primary Workflow |
|---|---|---|
| PM | Full edit on docs/PRDs/ | Create/edit PRDs in Mintlify web editor |
| Engineer | Full edit on all docs/ | Create RFCs and Cycles in IDE, browse in Mintlify |
| CTO | Admin | Full access, configure Autopilot, review analytics |
| Stakeholder | Read-only | Browse specs in Mintlify, provide comments |
Phase 4: End-to-End Workflow Integration
4.1 The Complete Spec-Driven Development Loop
4.2 GitHub Project Integration
The existing GitHub Projects workflow continues unchanged. The additions:- Every GitHub Project item references a Cycle number (already true)
- Every Cycle now references source PRD(s) and RFC(s) in frontmatter (new)
- PRD status updates when its Cycle completes (manual for now, automatable later via GitHub Actions)
- Mintlify Autopilot opens PRs when code changes affect spec’d functionality (new, automated)
4.3 AI-Native Workflow: Claude Code + Specs
Claude Code’s workflow becomes:- Before implementation: Read the Cycle doc, its source PRD(s), and RFC(s)
- During implementation: Reference acceptance criteria and functional requirements from the PRD
- During code review: Verify implementation matches spec
- After implementation: Mintlify Autopilot handles spec drift detection
- Direct file read:
docs/PRDs/PRD-XXX.mdx— files are native MDX in the repo, zero friction - Mintlify MCP server: Query specs via MCP tool for richer search and cross-referencing
CLAUDE.mdreferences: Cycle docs are already referenced in CLAUDE.md
4.4 CLAUDE.md Update
Add to CLAUDE.md:Phase 5: Seed Example Docs
Create one example PRD and one example RFC to demonstrate the format and serve as reference:- PRD-001: Extract from the AI Chat feature (Cycle 212) — shows what a real PRD looks like with user stories, functional requirements, and acceptance criteria
- RFC-001: Extract from the canonical schema strategy — shows what a real RFC looks like with architecture, data model, alternatives considered, and decision
Validation Plan
-
docs/docs.jsonexists and is valid Mintlify configuration -
AGENTS.mdexists at repo root with AI agent instructions -
docs/PRDs/_template.mdxexists with all required sections -
docs/RFCs/_template.mdxexists with all required sections -
docs/roadmap/cycles/_template.mdexists withsource_prdsandsource_rfcsfrontmatter fields -
docs/PRDs/README.mddocuments the PRD process -
docs/RFCs/README.mddocuments the RFC process -
docs/README.mddocuments the overall spec-driven dev process - Mintlify project created and GitHub sync configured
- Bi-directional sync verified: edit in Mintlify → commit appears on
main - Bi-directional sync verified: push to
main→ appears in Mintlify - Mintlify Autopilot enabled and configured
- MCP server URL added to
.mcp.json(repo root) - CLAUDE.md updated with spec-driven dev section
- At least one example PRD (
PRD-001) and one example RFC (RFC-001) exist -
llms.txtis accessible at the published site root
Estimated Scope
| Dimension | Estimate |
|---|---|
| Files created | ~14 (templates, process docs, config, AGENTS.md, examples) |
| Files modified | 2 (CLAUDE.md, .mcp.json) |
| Risk level | Low — additive only, no code changes |
| Effort | Small — documentation and process, no engineering |
| Cost | ~$300/mo (Mintlify Pro plan) |
Risks & Mitigations
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Mintlify web editor not polished enough for PMs | Low | Medium | PMs can also use any Markdown editor; the web editor is improving rapidly; GitBook is a fallback |
| Autopilot generates noisy/unhelpful PRs | Medium | Low | Configure AGENTS.md with specific instructions; tune over first 2 weeks; can disable per-directory |
| MDX syntax unfamiliar to PMs | Low | Low | MDX is a superset of Markdown — PMs write plain Markdown, MDX features are optional for engineering |
| Mintlify uptime/reliability | Low | Medium | Docs are MDX files in the repo — Mintlify going down doesn’t block development, only browsing |
| Over-specification slows velocity | Low | High | PRDs are intentionally lightweight (problem + stories + acceptance criteria); RFC only when needed; process doc explicitly calls out when NOT to write |
| Spec drift (implementation diverges from spec) | Medium | Medium | Autopilot detects drift automatically; convention: “spec drift is a bug” |
Out of Scope
- Automated spec → code generation — Claude Code uses specs as context, not as executable code generators. This is spec-driven, not spec-generated.
- CI validation of spec completeness — No automated checks on whether PRD sections are filled. Future enhancement.
- Automated PRD → Cycle doc creation — Engineers manually create Cycle docs. Automation is a future cycle.
- Public-facing documentation site — Mintlify will initially serve internal specs. Public developer docs are a separate concern.
- Migrating existing cycle docs to new templates — Existing cycle docs retain their current format. New cycles use the template.
- ADR process changes — ADRs continue as-is. RFCs may produce ADRs but the ADR process itself isn’t changing.
Design Decisions
Why Three Documents Instead of One?
Problem: A single spec document (like current cycle docs) conflates “what to build” (PM concern) with “how to build it” (engineering concern). PMs can’t own their requirements without navigating implementation details, and engineers can’t restructure implementation plans without risking PM-owned content. Solution: Separation of concerns. PRDs own the “what and why.” RFCs own the “how and constraints.” Cycles own the “implementation plan.” Each has a clear owner, clear lifecycle, and clear audience. Trade-off: Three documents means more overhead per feature. Mitigation: small features can skip RFCs entirely (PRD → Cycle directly). Bug fixes and refactors skip PRDs entirely (Cycle only). The process doc explicitly defines when each document type is and isn’t needed.Why Mintlify Over Alternatives?
| Criteria | Mintlify | GitBook | Docusaurus | Notion |
|---|---|---|---|---|
| Docs as native files in repo | MDX — zero translation | Proprietary format → Markdown | Git-native | Not in repo |
| Proactive AI agent (Autopilot) | Shipped, monitors code | Roadmap only | No | No |
AGENTS.md customization | Yes — mirrors CLAUDE.md | No equivalent | No | No |
| MCP server auto-generated | Yes | Yes | No | Separate MCP server |
llms.txt auto-generated | Yes | Yes | No | No |
| AI traffic analytics | Yes | No | No | No |
| WYSIWYG for PMs | Good (beta, improving) | Best in class | No | Best in class |
| Bi-directional Git Sync | Yes | Yes | N/A (Git-native) | No |
| Used by | Anthropic, Cursor, Perplexity | Many teams | Meta (OSS) | Broad |
AGENTS.md pattern is a natural extension of our existing CLAUDE.md workflow. Anthropic (makers of Claude Code) use Mintlify for their own documentation.
Why MDX Over Plain Markdown?
MDX is a superset of Markdown that supports JSX components. For specs:- PMs write plain Markdown — MDX adds zero complexity for them
- Engineers can optionally use interactive components (API playgrounds, tabs, callouts) in RFCs
- Mintlify’s rendering engine requires MDX for full feature support
- Claude Code reads MDX files identically to Markdown — no friction
Numbering Convention
- PRDs:
PRD-001,PRD-002, etc. Sequential, never reused. - RFCs:
RFC-001,RFC-002, etc. Sequential, never reused. - Cycles: Continue existing
cycle[N]numbering.
PRD-001-smart-scheduling.mdx) for human readability.
Future Enhancements (Not This Cycle)
- Mintlify Autopilot tuning: Refine
AGENTS.mdbased on first 2 weeks of Autopilot PRs - Spec drift CI gate: GitHub Action that fails if a Cycle doc references non-existent PRD/RFC numbers
- PRD status automation: GitHub Action updates PRD status when linked Cycle completes
- AI-powered PRD review: Claude Code reviews PRDs for completeness and clarity before approval
- AI traffic dashboard: Monitor which specs AI agents consume most, identify gaps
- OpenAPI playground: Embed interactive API docs in RFCs using Mintlify’s OpenAPI support
- Searchable spec index: Auto-generated index of all PRDs/RFCs/Cycles with status and links
This cycle establishes the Flux spec-driven development process. See Roadmap Overview.