Documentation Rulebook
This rulebook defines how Caracal documentation is written, split, linked, and maintained.
Audience: Documentation maintainers, contributors, and reviewers.
Context: Apply these rules before writing or editing any page in the Caracal docs system.
Writing Principles
- Write from the codebase, not from assumptions.
- Explain what exists, why it exists, how it works, and when to use it.
- Keep one canonical explanation for each concept.
- Prefer exact behavior over conceptual hand-waving.
- Use repository terminology exactly as the code and UI use it.
- Separate operator guidance from contributor guidance.
- Document system boundaries, not just happy-path tasks.
- Treat missing detail as a documentation defect.
Page Structure Standard
Every content page must follow this order unless a section is genuinely not applicable:
- Title
- One-line summary
- Audience
- Context
- Core explanation
- Internal behavior
- Practical usage
- Edge cases and constraints
- Related concepts
Use short introductory metadata lines near the top of the page:
Audience: user | developer | bothContext: where this page fits in the system
Terminology Consistency Rules
- Use
host commandfor the outercaracalcommand that orchestrates Docker Compose. - Use
in-container CLIfor the interactive Click CLI that runs inside the runtime container. - Use
Flowfor the terminal UI implemented undercaracal/flow. - Use
workspacefor the directory rooted underCARACAL_HOME/workspaces/<name>. - Use
principalfor any identity that can hold authority. - Use
authority policyfor issuance constraints. - Use
execution mandateormandatefor signed, time-bound authorization. - Use
delegation edgefor graph relationships between mandates. - Use
authority ledgerfor mandate issuance, validation, and revocation events. - Use
ledgerfor metering and resource-usage events. - Use
provider-scoped scopeforprovider:<provider>:resource:<id>andprovider:<provider>:action:<id>values. - Do not alternate between synonyms such as
agent identityandprincipal, ortokenandmandate, unless the code defines them as different objects.
Linking Rules
- Define a concept once on its canonical page and link back to it elsewhere.
- Link to the narrowest page that fully answers the next question.
- Use internal links heavily when a page depends on another concept.
- Do not duplicate definitions just to avoid linking.
- Use related-links sections to connect adjacent concepts, not to compensate for weak structure.
Diagram Rules
- Use diagrams only when a flow is easier to understand visually than textually.
- Keep diagrams small and system-level.
- Prefer text diagrams or simple mermaid diagrams.
- Each diagram must explain an actual code path or user flow.
- Do not add decorative diagrams.
Valid example:
Host caracal command
-> Docker Compose runtime
-> mcp service / cli session / flow session
-> PostgreSQL + Redis + workspace state
Example Rules
- Avoid code snippets by default.
- Include code only when a reader must copy a command, config fragment, or exact invocation.
- Every example must match the current codebase and command surface.
- Prefer the smallest successful example first.
- Put extended or advanced examples in collapsible sections when they would break the main flow.
- Never add illustrative code that is not needed to operate or understand the system.
Formatting Rules
- Use short paragraphs and descriptive headings.
- Use tables when comparing commands, modules, or behaviors.
- Use callouts only when they clarify risk, constraints, or failure modes.
- Use monospace for commands, file paths, environment variables, identifiers, and config keys.
- Keep lists flat unless nesting is essential to correctness.
- Keep prose technical, precise, and direct.
Separation Rules
- Open-source docs must stay split between
End UsersandDevelopers. - End-user pages explain installation, operation, workflows, configuration, troubleshooting, and public security behavior.
- Developer pages explain architecture, module boundaries, internal flows, test strategy, release surfaces, and contributor workflow.
- Enterprise pages remain user-facing placeholders only in the public docs.
- SDK pages may define structure now, but SDK content stays deferred until the SDK content phase.
- The only enterprise-adjacent public developer page is
Enterprise Connector, and it must describe public connector boundaries only.
Anti-Patterns
Do not do any of the following:
- Do not use emojis anywhere.
- Do not use vague explanations.
- Do not repeat explanations across pages.
- Do not write shallow summaries that omit system behavior.
- Do not add unnecessary code snippets.
- Do not use decorative writing.
- Do not mix user guidance and contributor internals on the same page.
- Do not describe enterprise internals in public documentation.
- Do not hide critical constraints inside long paragraphs.
- Do not write around missing understanding of the code.
Strict Content Rules
- No emojis anywhere.
- No vague explanations.
- No repeated explanations across pages.
- No shallow summaries.
- No unnecessary code snippets.
- No decorative writing.
- No marketing tone.
- No filler text.
Review Checklist
Before a page is complete, confirm all of the following:
- The intended audience is explicit.
- The page has one clear purpose.
- The canonical definition lives on exactly one page.
- Commands and config examples match the current implementation.
- Internal behavior is explained where it matters.
- Constraints and failure modes are explicit.
- Related pages point to the canonical concept source.
- The page does not depend on undocumented prerequisite behavior.