Ai Docs
Structured documentation for reliable AI-assisted software development.
#ai.docs
ai.docs is a structured, documentation-first system designed to guide AI-assisted software development from intent to execution — without ambiguity.
It provides a clear, ordered documentation flow that helps humans and AI models collaborate reliably when designing, planning and building software systems.
#Why this exists
AI-assisted development often fails not because of code quality, but because of missing definitions:
- unclear scope
- undefined data models
- vague API contracts
- undocumented decisions
- UX disconnected from rules and permissions
ai.docs addresses this by enforcing:
- explicit schemas and contracts
- a strict execution order
- separation between intent, constraints and implementation
- traceable and reviewable decisions
The result is a system that can be executed, not guessed.
#What this repository is
This repository is a startkit / reference implementation of the ai.docs methodology.
It demonstrates how to structure and use an ai.docs/ directory as the canonical source of truth for:
- product intent
- requirements
- architecture
- security constraints
- execution rules
It is not a code boilerplate.
It is a documentation and reasoning framework designed to be embedded into real projects.
The example used throughout the documentation represents a small system (e.g. a mini CRM), but the methodology applies to projects of any size.
#How to use
- Clone or copy this repository into your project.
- Ensure the
ai.docs/directory exists at the root of your project. - Follow the documentation in order, starting from:
- Complete each document before moving to the next.
- Treat the documentation as a contract, not as optional notes.
The numbered files inside ai.docs/ represent the canonical execution order.
#Documentation flow (canonical order)
All documents below live inside the ai.docs/ directory:
01_README_AI.md— Operational contract for AI / LLMs02_CONTEXT.md— Purpose, scope and boundaries03_PRD.md— Product requirements and rules04_ARCHITECTURE.md— System architecture05_SECURITY_AND_COMPLIANCE.md— Security and compliance constraints06_BOILERPLATE_STRUCTURE.md— Project structure and conventions07_API_CONTRACTS.md— API contracts and versioning08_DATA_SCHEMA.md— Data models and relationships09_DECISIONS_ADR.md— Architectural decisions and rationale10_UX_UI_INDEX.md— UX/UI flows, permissions and routes11_ROADMAP.md— Future evolution12_RELEASE_CHECKLIST.md— Release and delivery gate
#CI Documentation Gate
To ensure our living contracts and diagrams do not become outdated (a "guess generator"), we have integrated a CI Gate in GitHub Actions.
Before any merge into the main branch, it is mandatory to:
- Fill out the Pull Request Template, checking whether the Documentation was updated (covering
docs/c4,docs/adr,docs/prd,docs/api, anddocs/schema) or if the change does not require documentation. - The Docs CI Gate workflow will automatically fail and block the merge if no documentation option is validated in the Pull Request body.
We are starting "small", focusing on traceability and expanding as the pain appears.
#Important principles
- Documentation comes before code.
- If something is not defined, it must not be implemented.
- AI models must not invent schemas, rules or behavior.
- Decisions must be recorded, not remembered.
- UX is a contract, not decoration.
#Contributions
This repository is open to improvements and refinements.
If you contribute:
- respect the canonical execution order
- keep examples consistent
- update related documents when changing templates
Any structural or behavioral change must be reflected inside ai.docs/.
#License
Open-source. Use, adapt and improve freely.