Use this style guide when drafting, editing, or reviewing documentation for the agentgateway project.
- Product naming conventions
- Writing style
- Formatting with shortcodes
- Content structure
- Visuals
- Code examples
- Files and organization
Use sentence-case for agentgateway, such as:
- ✅ Agentgateway is...
- ✅ The agentgateway project is...
Do not use other variations, such as:
- ❌ Agent Gateway is...
- ❌ AgentGateway is...
- ❌ The Agentgateway project is...
- Active voice: "The gateway routes traffic" (not "Traffic is routed by the gateway").
- Present tense: "Istio provides mTLS" (not "Istio will provide mTLS").
- Second-person: "In this guide, you configure" (not "let's configure" or "we will configure").
- Conversational but technical: Explain "why" and "how it works", not just "what".
- No emojis in body text.
- Short sentences: Aim for 15-25 words per sentence.
- One idea per sentence: Complex ideas get multiple sentences.
- Paragraph length: 2-5 sentences per paragraph.
- Lists for enumeration: Use bullet points or numbered lists for 3+ items. Unless bullets are short (one or two words), punctuate them with a period.
- End sentences with the proper punctuation: Generally, end sentences with a period. If it is a question, end with a question mark. Use exclamation marks sparingly. Do not end sentences with a colon, unless it is a short phrase that introduces an immediate example, such as
Example output:. The first sentence after a heading that introduces steps should end with a period, not a colon.
-
First mention: Spell out acronyms with definition
**Mutual TLS (mTLS)** is a protocol where both client and server...
-
Subsequent mentions: Use acronym only
Configure mTLS for the control-to-data plane connection.
-
Avoid jargon: Explain technical concepts clearly
✅ "ztunnel is a node-level L4 proxy that handles TCP traffic" ❌ "ztunnel does L4 stuff"
When writing short descriptions, intros, or metadata, lead with the familiar term and alternative keywords that reflect the language people search for. Then, use our more declarative terms in the sentence. Incorporate the language into the sentence instead of listing alternatives in brackets.
Examples:
- "Use failover (also called automatic fallback) to keep services running..."
- "Set up cost controls, budgets, and spend limits..."
Places to put the terms:
- Page
description(front matter): Lead with the familiar term, then the action or outcome. Example: "Control cost with token budgets and spend limits to prevent unexpected bills and LLM misuse." - First paragraph or intro: Weave the discoverable term into the sentence after each heading. Example: "Get prompt logging, cost tracking, and an audit trail: review LLM-specific metrics, logs, and traces via OpenTelemetry."
- Card subtitles: Use the familiar language. Example: "Budget and spend limits" under Rate limiting.
Do not list every alternative in brackets. Do not mention specific products (such as Langfuse, LangSmith) in a description unless that page documents them.
The Hextra Hugo theme provides a set of shortcodes to style, format, and add content to your pages. For more information, see the Hextra Hugo theme documentation.
calloutfor callouts (such as notes, warnings, tips, and other admonitions).cardsto format a collection of related links, especially on index pages to present the subpages visually.detailsto format a collapsible section of content.filetreeto format a directory file tree in a visually appealing way.iconused sparingly to add an icon inline.stepsused in tutorial pages only to style headings in a more visual way.tabsto present alternative ways within a step, such as for different modes, languages, load balancer vs localhost access, and so on.
This project has a few custom Hugo shortcodes that are used for content management.
link-hextrato link to a topic within the documentation in a way that is compatible with the versioning strategy.conditional-textto conditionally include text based on the current section of the docs (standalonefor the agentgateway binary orkubernetesfor agentgateway deployed on Kubernetes).glossto add a glossary term to the page.redirectto redirect a page to a different location within the doc set that has the same content. Useful for "placeholder" pages where we want the page to appear in several different sections in the navigation, but do not want to duplicate or reuse the content.reuseto include a piece of content from theassets/agw-docs/directory.versionto conditionally include text based on the current version. The versions for each section are defined in thehugo.yamlfile.
The docs have the following content types, although they are not strict.
- Concepts that explain key functionality and features of agentgateway. These are typically found in the
about/concepts/directory. They are typically written in a way that is easy to understand and follow. Include diagrams where appropriate. Usually do not include steps. - Reference pages that provide detailed information about certain agentgateway components such as Helm values or API docs. Most reference content is automatically generated from the code through the
reference-docsworkflow. These are typically found in thereference/directory. - FAQ page in the
faqs.mdfile that provides short answers to common questions about agentgateway. - Guides that provide the steps or procedure to accomplish a certain task. These are typically found in the rest of the directories. Their layout is as follows in the next section.
Content for guides typically follows a structure similar to the STYLE_EXAMPLE_PAGE.md file.
Agentgateway's primary color is #7734be.
Screenshots are used to illustrate the steps of a guide. They are typically found in the assets/agw-docs/img/ directory. Use sparingly, as these must be updated as the UI changes.
Use Mermaid to create diagrams. The most common diagram types are flowcharts and sequences. For more information and syntax, see the Mermaid documentation.
For more complex diagrams, we sometimes use Excalidraw.
General diagram principles:
- Include alt text context in surrounding prose
- Don't rely solely on color: Use labels and shapes too
- Describe flow in text: "The diagram shows traffic flowing from client → gateway → service"
- Use the primary color:
#7734befor the primary color.
Complete and valid:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example-route
namespace: default # Always include namespace
spec:
parentRefs:
- name: my-gateway
hostnames:
- "example.com"
rules:
- matches:
- path:
type: PathPrefix
value: /api
backendRefs:
- name: backend-service
port: 8080Key requirements:
- Valid YAML syntax: No syntax errors
- Realistic scenarios: Production-like configurations
- Complete examples: Don't omit required fields
- Namespace explicit: Always show
metadata.namespace - Comments inline: Explain non-obvious settings
Comment style:
spec:
parentRefs:
- name: my-gateway # References the Gateway this route attaches to
hostnames:
- "api.example.com" # Must match Gateway listener hostname
rules:
- matches:
- path:
type: PathPrefix # Matches /api, /api/v1, /api/v2, etc.
value: /apiBreak up long commands into multiple lines.
helm upgrade -i agentgateway-crds oci://ghcr.io/kgateway-dev/charts/agentgateway-crds \
--create-namespace \
--namespace agentgateway-system \
--version v{{< reuse "agw-docs/versions/n-patch.md" >}}Show expected output when helpful:
$ kubectl get gateways -A
NAMESPACE NAME CLASS ADDRESS READY
default my-gateway agentgateway 10.0.0.5 True- Lowercase with hyphens:
api-gateway-concepts.md(notAPI_Gateway_Concepts.md) - Descriptive: Name should indicate content
- Short but clear: 2-5 words ideal
- No special characters: Only
a-z,0-9, and-
The main content is organized into sections for the different deployment types. Each section has versioned subdirectories for the different versions of the documentation.
Often, the content pages consist of just the front matter for the page and a reuse shortcode that calls content from the assets/agw-docs/ directory. This is done for reuse across product sections and versions.
content/docs/
├── kubernetes/
│ ├── latest/
│ │ ├── index.md
│ │ ├── about/
│ │ ├── agent/
...
│ ├── main/
│ │ ├── index.md
│ │ ├── about/
│ │ ├── agent/
...
├── standalone/
│ ├── latest/
│ │ ├── index.md
│ │ ├── about/
│ │ ├── agent/
...
│ ├── main/
│ │ ├── index.md
│ │ ├── about/
│ │ ├── agent/
Every directory MUST have an _index.md file. The _index.md file might have a brief description of the collection and then the cards shortcode to list the subpages in the collection.