site-infra
The documentation site, docs.capsem.org. Use for user-directed Diátaxis documentation and Astro Starlight changes.
Documentation Site
Site purpose
capsem.organswers: “Why Capsem, what can I do, and how quickly can I get value?” Marketing owns benefits, use cases, and the short path to value; see/site-marketing.docs.capsem.organswers: “Exactly how does this work, how do I operate/integrate/administer it, and what is the contract?” Docs owns precise procedures, behavior, configuration, interfaces, limits, and guarantees.
Diátaxis is the authoring contract
All technical documentation must follow the principles and structure of the Diátaxis Framework. Before drafting or reviewing a page, identify its reader, the question it answers, and exactly one of the four document types below. Its structure and content must serve that type.
Guiding principles
- Clarity: use simple, clear, unambiguous language. Explain necessary terms for the intended reader; remove internal jargon that adds no value.
- Accuracy: check commands, code snippets, UI controls, defaults, limits, and guarantees against the current target contracts. Verify examples through the relevant project rails and record what was verified. Never invent output or present an untested example as tested.
- User-centricity: identify a specific user and the task or need the page serves. That need may be learning a skill, solving a problem, looking up a fact, or understanding a topic; do not force all four into procedures.
- Consistency: use consistent tone, terminology, names, units, and example conventions across the manual. Keep a stable structure within each type; do not impose the same structure on all four types.
The four document types
| Type | Orientation and purpose | Structure |
|---|---|---|
| Tutorial | Learning: guide a newcomer through a practical lesson to a successful outcome. | Concrete outcome and prerequisites → small ordered actions → visible results and checkpoints → completed exercise. |
| How-to guide | Problem-solving: help a competent user accomplish a specific real-world task. A recipe. | Specific goal and starting conditions → necessary actions and relevant decisions → result or completion check. |
| Reference | Information: give precise technical descriptions of the machinery. A dictionary to consult. | Predictable entries that mirror the product's interfaces, with exact facts and concise examples. |
| Explanation | Understanding: clarify a bounded topic and its context. A discussion. | Topic or why question → concepts and relationships → rationale, constraints, implications, and relevant alternatives. |
Tutorials: choose a reliable path for the learner and make success visible early and throughout. Explain only what they need for the next action; link to deeper explanation and reference. Avoid branches, optional advanced tasks, catalogues of alternatives, and exhaustive flags. A tutorial teaches through doing; it is not a collection of how-tos.
How-to guides: start from the user's problem, not a feature tour. Assume the reader knows the basics and wants a result. Include choices or branches when the real task requires them, with enough guidance to choose. Omit lessons, background discussions, and complete option lists; link to the other types.
Reference: describe accurately, neutrally, and completely within the declared scope. Use consistent fields for syntax, inputs, types, defaults, outputs, errors, constraints, and guarantees where applicable. Examples illustrate usage; they do not become a lesson or a procedural walkthrough. Link to guides for tasks and explanation for rationale.
Explanation: develop understanding of how and why things fit together. Discuss design decisions, trade-offs, boundaries, and alternatives when useful, distinguishing established facts from interpretation. Do not bury installation steps, recipes, or API/CLI inventories in the discussion; link to their owners.
Keep the types distinct. A short definition, illustrative example, or link can support a page's purpose without turning it into a second type. If substantial material belongs to another type, use an existing approved destination or wait for user direction; this framework does not authorize new pages or page splits.
Applying the types to our approved sections
getting-started/: newcomer tutorials for learning by doing. An installation procedure can be a how-to; classify by reader need, not directory name.guides/: task-specific how-to guides, written last as agreed.architecture/: explanations of architecture and the security model.reference/: CLI, MCP, API, and configuration reference.sdk/: an integration subject area, not a fifth document type. Each SDK page must be a tutorial, how-to, reference, or explanation with a distinct purpose; link between those purposes instead of mixing them.
These are the approved section names. Applying Diátaxis does not authorize renaming them, creating more directories, filling TODOs, or adding pages.
Content budget and user direction
Write the minimum content on the minimum number of pages needed to answer those documentation questions completely. Prefer a section in an approved page and links to the canonical explanation over another page or duplicated prose. A feature, subsystem, troubleshooting case, or release does not automatically earn a page. Keep necessary prerequisites, defaults, failure behavior, and security limits; brevity must not make the contract ambiguous.
New pages require explicit user approval before creation. A general request to improve or rebuild docs is not approval for an agent-chosen page list. The user will tell us what to write. Do not proactively propose pages, page lists, outlines, or documentation topics. Follow the user's supplied scope and record page approval in the owning Sprinty item. New categories and page splits follow the same rule. Edit approved pages within their agreed scope without asking again.
Rebuild from scratch
The documentation rebuild starts from reader needs and current product contracts. The old manual is reference material, not the target information architecture or a backlog of stubs to fill.
Capsem 0.7 is the baseline. Architecture and security pages describe the agreed final architecture with the security refactoring complete; verify against those contracts rather than carrying over older behavior.
- Wait for the user to specify what to write and which pages to create or edit.
- Keep that requested content on the fewest approved pages, using related sections and canonical links instead of duplicating explanations.
- Write the requested content afresh from current code, schemas, CLI/API contracts, and verified behavior. Reuse old text only after checking it against those sources; do not carry forward historical commands or claims by default.
- Review for completeness, duplication, and removable prose. Verify commands, links, and examples with the relevant project skills and bounded rails.
Approval of content or page structure does not itself authorize publication. The replacement manual and its publication were explicitly approved on October 15, 2026.
Publication and development
The user approved publishing the 33-page Capsem 0.7 manual on October 15, 2026.
Production astro.config.mjs re-exports astro.preview.config.mjs; both use the
approved inventory in approved-docs.mjs. Legacy manual sources remain checked
in but are excluded from the collection. The former holding surface is archival.
Use pnpm --dir web/docs run dev for local review and pnpm --dir web/docs run build
for the production build and link checks, through the bounded command wrapper.
Verify root navigation and changed routes after restarting the server.
ci.yaml owns the merge-blocking docs-build job.
Pushes to main run .github/workflows/docs.yaml, build the manual, deploy it to
Cloudflare Pages capsem-docs, and smoke the introduction, SDK, installation,
and security pages. Verify the deployed content before reporting publication.
This deployment is independent from binary and runtime releases; use
/release-process for channel publication at release.capsem.org.
Writing and review
Write for the intended reader with the structure of the chosen document type. Start every page with a short introductory paragraph explaining what the page covers and which reader question it answers. Give the reader the overall idea before definitions, implementation details, diagrams, tables, code, or language tabs. This applies to reference and generated pages too. A page title or frontmatter description does not replace the visible introduction.
Use BLUF as a writing principle, not a mandatory format: explain the main idea before supporting detail. Do not add a BLUF heading, a canned summary, or force every opening into the same wording. A concrete sentence such as “This page provides an overview of Capsem's security architecture and how it mitigates risks” is useful orientation; follow it with the specific scope of that page.
Check logical progression across the whole page: introduce the topic before its parts, explain a concept before using it, and put prerequisites and choices before dependent actions. In procedures, show the result before moving to the next step; in reference, order entries by the interface rather than imposing a tutorial. Avoid abstract framing and paragraphs that repeat a diagram or table. Architecture pages use concrete component relationships and a process/role/sandboxing table. Keep one canonical explanation or contract and link to it instead of repeating it. No filler, marketing pitches, or speculative features. Use tables for comparable facts and JointJS diagrams when they clarify relationships.
In tutorials and how-tos, explain necessary options when first used, identify
sample names and replaceable values, and say whether commands run on the
reader's computer or inside the VM. Complete the requested task: launching a
VM must lead to accessing it when the goal is to work in it. Explain capsem suspend
as pausing work, capsem resume as returning to it, and capsem fork as duplicating a prepared setup for
another use. Keep explanations proportional to the chosen type, with detailed
mechanics and rationale in their reference and explanation destinations.
When introducing an interface, explain what it lets the user manage, describe the visible layout, and provide the controls needed to navigate it. For a TUI, include switching between VMs, checking status, opening help, and exiting without stopping the VMs. Do not reduce a multi-VM manager to “an interactive terminal.”
Every single paragraph serves a user action
Every single paragraph must answer a user's question and help the user do something concrete. This applies to every page and document type, including introductions, architecture explanations, reference, transitions, and endings. There is no exemption for background, general explanation, or “useful context.”
For each paragraph, identify both:
- What question is the user asking here?
- What can the user do with this answer?
If either answer is missing, delete or rewrite the paragraph. Do not write prose merely to repeat a topic, diagram, or heading, or fill space. An opening that explains scope helps readers decide whether the page answers their question; it is not filler. Explanations must support a concrete user action or decision; reference must help the user configure, call, inspect, or diagnose something. The questions are an editing check, not mandatory question-shaped headings.
Links must state what the user can accomplish at the destination and appear where that task arises. Generic endings such as “For component relationships, read System architecture” or “For exact interfaces, use Reference” fail this rule. Review every single paragraph on the affected page after a correction.
One thing, one name
Use the names exposed by the public command line for its concepts, commands,
and options. One thing has one name throughout prose, headings, links, and
examples; do not invent synonyms for variety. Write image as in --image
and capsem images, then explain what it lets the user do in simple language.
When referring to a command, include the executable and format the full name
as inline code so it stands out: capsem fork, capsem suspend,
capsem resume, capsem create, and capsem shell. Do not shorten command
references to bare subcommands such as fork or create.
VM is the environment the user creates, accesses, suspends, resumes, or forks. Do not rename it a project, workspace, container, session, or setup. An image supplies its software; a container image and a VM are distinct things. Use TUI for the terminal interface and Capsem UI for the graphical interface, not “UI app.” Define these interface terms at first use. Keep exact command names and actual control labels when quoting them.
Simplicity, links, and sequence
Keep first-use explanations short and specific to what the reader can do.
For example, explain that a name keeps a VM for stop/resume and reuse, then
link to the sections on pausing work and duplicating a setup. Explain that
--image selects a prebuilt or administrator-authorized custom image,
then link to image selection. Preserve these useful capabilities instead
of replacing them with vague wording such as “come back later.”
Link at the point where the reader may need more detail: to the relevant section for the next action, to reference for exact options, or to explanation for deeper understanding. Use descriptive link text, verify the destination, and avoid repeating the destination's full content. Do not create a page to supply a link without approval.
For tutorials and how-tos, make the temporal relationship between sections explicit. State the prerequisite or trigger before an action: “Once your VM is created…”, “When you are ready to pause…”, or “After preparing a setup…”. Order dependent actions by when they become possible; identify choices and optional branches as such. Distinguish work on the current VM from decisions made before creating another VM. A heading alone does not communicate this. Do not impose chronological steps on reference or explanation.
Improve the skill with every documentation change
Whenever documentation changes, propose a concise, reusable improvement to this skill based on what the change or user correction taught us. State the proposed rule to the user alongside the work; a generic promise to improve is not a proposal. Apply improvements the user requests or accepts and record them in the owning Sprinty item. Keep proposals about writing rules separate from page/topic proposals, which remain user-directed.
Generalize the lesson rather than accumulating instructions for one sentence. If an existing rule already captures it, propose a clearer rule or a specific review check rather than adding a duplicate. After incorporating a correction, review the whole affected page for the same pattern, not only the cited line.
Review before delivery:
- Every page: does its opening explain the topic and scope before details? Does the main idea come before supporting material, and does each section follow logically from what the reader already knows? Does it answer its description question, use consistent terms, and stay within one type?
- Tutorial: can a newcomer follow the chosen path without guessing and see the promised result at each meaningful step? Are prerequisites, transitions, and links for further detail clear throughout?
- How-to: can the intended user solve the stated problem, including any necessary decisions, without being taken through an unrelated lesson? Is it clear when each action or branch applies and where to find deeper detail?
- Reference: can someone quickly find exact, complete facts for the stated interface or contract without searching through a narrative?
- Explanation: does the reader understand the topic, its relationships and