Files
coder/AGENTS.md
T
Nick Vigilante b95f2531b5 feat: populate docs prose style guide as a landing page plus subpages (#26632)
Replace the `docs/.style/style-guide.md` scaffold with the populated
prose style guide,
structured as a `README.md` landing page plus one subpage per topic so
GitHub auto-renders the landing when readers open the style-guide
folder.

## Layout

```text
docs/.style/
  style-guide/
    README.md                          (landing: intro, section list, editing conventions, Vale enforcement)
    audience-and-scope.md              (one audience, one outcome, declared up front; canonical personas)
    voice-and-tone.md
    word-choice.md
    accessibility-and-inclusion.md     (new)
    capitalization-and-punctuation.md
    formatting.md                      (text formatting + block elements + screenshots sparingly)
    numbers-units-and-dates.md
    editor-setup.md                    (placeholder)
```

Every repo reference to the old path is rewired to the new path:
`AGENTS.md` (and its `CLAUDE.md` / `.cursorrules` symlinks),
`.claude/docs/DOCS_STYLE_GUIDE.md`,
`docs/about/contributing/documentation.md`, `docs/.style/README.md`,
`docs/.style/styles/Coder/README.md`, and a comment in
`.github/workflows/ci.yaml`. The touched paragraph in each of those
files is reformatted to one sentence per line per the touch-paragraph
rule (refer to [Conventions the guide
dogfoods](#conventions-the-guide-dogfoods)).

## What each page covers

- **Audience and scope** (new): every page targets **one audience
working toward one outcome**; the **install-vs-deploy Coder example**
(workspace user vs platform engineer); pick one audience per page (write
two pages and cross-link rather than tagging sections); pick one outcome
per page (`Configure SSO with Okta` is one outcome, `Configure SSO` is
not); declare audience and scope up front (the H1 names the outcome; the
first paragraph names the audience); **canonical Coder personas**
inlined as four primary (Dave the Developer, Ada the Infrastructure
Admin, Perry the Platform Engineer, Steven the Sponsor) and six
secondary (Melissa the Machine Learner, Tommy the Tester, Caitlin the
Citizen Developer, Felipe the FinOps, Sergio the Security Officer, Tara
the Team Leader), each with a `Coder surface:` line covering the
relevant CLI/workspace/template/RBAC surfaces.
- **Voice and tone**: address the reader directly, avoid first-person
singular, reserve first-person plural for **Coder Technologies the
company** (with an explicit ban on `we` for the product itself and on
combined `you and the docs`), active voice, present tense with a
**conditional/predictive `will` exception** (`If you do X, Y will
happen`), **no sentence-ending prepositions** with a clunky-exception
note.
- **Word choice**: Coder product and feature names with the **Coder CLI
always in backticks (`coder`)** rule, brand names with a parallel
**Terraform CLI in backticks (`terraform`)** rule, **Dev Container**
terminology (proper-noun specification vs lowercase instance, parallel
to Coder / workspace), **phrasal verbs and their noun forms generalized
as a table** (set up/setup, log in/login, sign in/sign-in, log
out/logout, back up/backup, roll out/rollout, start up/startup, shut
down/shutdown, with the `Quickstart` exception), `refer to` / `check
out` / `visit` over `see`, `Learn more` versus `Next steps` with an
**ableism rationale** (`steps` as a physical-mobility metaphor),
`tutorial` versus `walkthrough` with an **ableism rationale**,
**`select` over `click`**, **`Don't assume simplicity or
difficulty`** (covers both `simple`/`easy` and `complex`/`non-trivial`),
**`Avoid weasel words`** (vague attributions in the Wikipedia sense like
`many believe`, `experts agree`, `studies show`), plain language for
product actions with an **industry-term exception scope** for the Linux
`kill` command, the `SIGKILL` signal, and the `disabled` config flag
state.
- **Accessibility and inclusion** (new): WCAG 2.1 Level AA as the
minimum target with AAA as a stretch goal; heading structure (one H1 per
page, no skipped levels, **substantive content between headings**);
inclusive pronouns; inclusive-language substitutions including a
**dedicated `sanity check` row** with `smoke testing` / `confidence
testing` / `acceptance testing` alternatives; descriptive link text; alt
text and decorative-image conventions; **plain English for international
readers** (no idioms; common Latin abbreviations `e.g.`, `i.e.`, `etc.`,
`vs.`, and `et al.` allowed, less common ones not); page descriptions in
`docs/manifest.json` (the docs site does not yet support YAML front
matter); reading level; color contrast deferred to the docs site theme.
- **Capitalization and punctuation**: sentence-case headings, no
gerund-leading headings with **documented exceptions** (`Pricing`,
`Billing`, `Logging`, `String formatting`, etc.), **trailing heading
punctuation in three tiers** (periods and exclamation marks forbidden at
error severity, question marks allowed sparingly at suggestion severity,
characters inside backticks exempt for both), no em or en-dashes with a
**corrected example** showing parenthetical em-dash use rather than
series-joining, Oxford comma, US-style quotation, semicolons sparingly,
rare exclamation marks, numeric ranges.
- **Formatting**: text formatting (bold for UI with **explicit
greater-than separator rule for navigation paths**, italics for
emphasis, code font for identifiers presented as a **bulleted list**)
and block elements (code blocks with language fences plus **link to the
Prism supported-languages reference**, callouts with tightened
scenarios, tabs with the actual `` syntax and a **macOS/Linux/Windows
example**, lists with a **five-item prose-list cap rule** and an
**explicit terminal-punctuation rule** (complete sentences end in
periods, phrases completing a lead-in paragraph end in periods,
single-word labels carry no terminal punctuation, no mixing styles in
one list), tables with a **narrow-table guideline** that reconsiders the
structure when many columns are needed, links including the rule that
**non-docs codebase links also use relative paths**, images,
**screenshots sparingly** with a maintenance-burden rationale and an
adapted quote from Lorna Jane Mitchell's `Short tech writing style
guide for developers`), with cross-references to the accessibility page
for link text and alt text.
- **Numbers, units, and dates**: digits everywhere preference,
non-breaking space between number and unit with **separate pre-render
(Markdown source) and post-render (visible output) demonstrations** plus
a **window-shrink tip** for confirming the rule visually, `Month Day,
Year` date format, 12-hour time with AM/PM, ordinals exception.
- **Editor setup**: placeholder.

## Conventions the guide dogfoods

- **One sentence per line**. Source lines follow a one-sentence-per-line
policy: each sentence sits on its own Markdown source line, sentences
are not split across lines, and lines do not wrap to a fixed column
width. The same convention applies corpus-wide through an **incremental
touch-paragraph rule**: when a contributor edits any line inside a
paragraph, the whole paragraph is reformatted to one sentence per line
as part of the same edit. Bullet items, numbered list entries, and
blockquote lines are each their own paragraph for the rule. Headings,
fenced code blocks, and tables are out of scope. `markdownlint`'s
`MD013` is already disabled, so the convention is editorial.
- **No navigational `see`**. Replaced with **refer to** (formal
default), **check out** (informal/tutorials), or **visit** (external
URLs). `See` is reserved for the observational meaning.
- **HTML entities for em-dashes inside demos**. The em-dash demo encodes
`—` / `–` so the source stays ASCII while the rendered output still
shows the character.
- **No semicolons in body prose**. Body prose prefers two sentences over
a semicolon. Semicolons survive only in heading and rule labels where
they act as separators.
- **Common Latin abbreviations allowed in own prose**. `e.g.`, `i.e.`,
`etc.`, `vs.`, and `et al.` (citation contexts) are fine. Less common
Latin abbreviations (`a priori`, `q.v.`, `viz.`, `n.b.`, `cf.`, `ibid.`)
are not. The rule covers punctuation too: prefer parentheses around
`e.g.` and `i.e.` clauses, one period when `etc.` ends a sentence, both
periods when `etc.` ends a parenthetical that ends a sentence.
- **No idioms or industry-jargon idioms**. `deep dive`, `paved path`,
etc. are rewritten in plain language.

## Rule conventions

Each rule pairs a rationale with **Do** / **Don't** blockquoted
examples and a parenthetical noting the Vale rule that enforces (or will
enforce) the policy. Documentation-only rules are explicitly labeled as
such. Substitution rules use tables.

## Out of scope

- Wiring any new Vale rule. Per-rule PRs land separately per the
rule-authoring doctrine in `docs/.style/README.md`.
- Editor setup page population.
- Redirecting `docs/about/contributing/documentation.md` to the
populated guide (needs a coordinated `coder.com` PR after merge).
- Trimming the `Writing Style` block in
`.claude/docs/DOCS_STYLE_GUIDE.md` and removing the `currently a
scaffold` framing in the agent docs.
- A separate demo PR for the callout types rendered against an existing
docs page.
- Sweeping navigational `see` out of other docs files. The new rule only
dogfoods on the style guide itself; a corpus-wide sweep is a separate
ticket.

## Validation

- `make fmt/markdown`: clean.
- `make lint/markdown`: 0 errors across 494 files.
- `./scripts/check_emdash.sh`: clean.
- Pre-commit-light: passes (fmt + lint + emdash + shellcheck + typos +
actionlint + migrations + helm).
- Dogfood scan: no first-person singular in own prose, no idioms, only
the five allowed Latin abbreviations in own prose, no `walkthrough` or
`Next steps` outside rule definitions and examples, no navigational
`see`, no `click` outside rule definitions and examples, no semicolons
in body prose.

<details>
<summary>CI flake note: <code>check-docs</code> (linkspector)</summary>

The `check-docs` job can fail intermittently on pre-existing external
links in `docs/about/contributing/documentation.md` (lines 29 and 30):
Merriam-Webster occasionally returns HTTP 403 to GitHub Actions runners
and Chicago Manual of Style can time out at 30s. Neither link is touched
by this PR. `docs/.style/` itself is in `.github/.linkspector.yml`
`excludedDirs`, and linkspector annotations confirm zero broken links
from the new pages.

</details>

Resolves DOCS-434.

---

*Filed via [Coder Agents](https://coder.com/docs/ai-coder/agents) on
Nick&#39;s behalf.*
2026-06-25 21:11:39 +00:00

13 KiB

Coder Development Guidelines

You are an experienced, pragmatic software engineer. You don't over-engineer a solution when a simple one is possible. Rule #1: If you want exception to ANY rule, YOU MUST STOP and get explicit permission first. BREAKING THE LETTER OR SPIRIT OF THE RULES IS FAILURE.

Agent navigation

Foundational rules

  • Doing it right is better than doing it fast. You are not in a rush. NEVER skip steps or take shortcuts.
  • Tedious, systematic work is often the correct solution. Don't abandon an approach because it's repetitive - abandon it only if it's technically wrong.
  • Honesty is a core value.

Our relationship

  • Act as a critical peer reviewer. Your job is to disagree with me when I'm wrong, not to please me. Prioritize accuracy and reasoning over agreement.
  • YOU MUST speak up immediately when you don't know something or we're in over our heads
  • YOU MUST call out bad ideas, unreasonable expectations, and mistakes - I depend on this
  • NEVER be agreeable just to be nice - I NEED your HONEST technical judgment
  • NEVER write the phrase "You're absolutely right!" You are not a sycophant. We're working together because I value your opinion. Do not agree with me unless you can justify it with evidence or reasoning.
  • YOU MUST ALWAYS STOP and ask for clarification rather than making assumptions.
  • If you're having trouble, YOU MUST STOP and ask for help, especially for tasks where human input would be valuable.
  • When you disagree with my approach, YOU MUST push back. Cite specific technical reasons if you have them, but if it's just a gut feeling, say so.
  • If you're uncomfortable pushing back out loud, just say "Houston, we have a problem". I'll know what you mean
  • We discuss architectutral decisions (framework changes, major refactoring, system design) together before implementation. Routine fixes and clear implementations don't need discussion.

Proactiveness

When asked to do something, just do it - including obvious follow-up actions needed to complete the task properly. Only pause to ask for confirmation when:

  • Multiple valid approaches exist and the choice matters
  • The action would delete or significantly restructure existing code
  • You genuinely don't understand what's being asked
  • Your partner asked a question (answer the question, don't jump to implementation)

@.claude/docs/WORKFLOWS.md @package.json

Essential Commands

Task Command Notes
Development ./scripts/develop.sh ⚠️ Don't use manual build
Build make build Fat binaries (includes server)
Build Slim make build-slim Slim binaries
Test make test Full test suite
Test Single make test RUN=TestName Faster than full suite
Test Race make test-race Run tests with Go race detector
Lint make lint Always run after changes
Generate make gen After database changes
Format make fmt Auto-format code
Clean make clean Clean build artifacts
Pre-commit make pre-commit Fast CI checks (gen/fmt/lint/build)
Pre-push make pre-push Heavier CI checks (allowlisted)

Documentation Commands

  • pnpm run format-docs - Format markdown tables in docs
  • pnpm run lint-docs - Lint and fix markdown files
  • pnpm run storybook - Run Storybook (from site directory)

Critical Patterns

Detailed workflow and topic guidance lives in the imported docs. Keep root instructions focused on guardrails that agents should see immediately.

  • Database changes: Follow Database Development Patterns. Modify coderd/database/queries/*.sql, run make gen, update enterprise/audit/table.go for audit errors, then run make gen again.
  • LSP navigation: Use LSP tools first. See Modern Go for Go LSP and Frontend Development Guidelines for TypeScript LSP.
  • OAuth2 and authorization: Follow OAuth2 Development Guide. OAuth2 endpoints must use RFC-compliant errors such as writeOAuth2Error(...), and public endpoints that need system access should use dbauthz.AsSystemRestricted.
  • Chatd: consult Chatd Architecture to understand the architecture of the chatd subsystem. If you update the chatd subsystem in ways that affect the architecture, you must update the architecture document.
  • API design: Follow the API guardrails in Development Workflows and Guidelines, including swagger annotations for new public HTTP endpoints.
  • Transactions and conversions: Keep InTx work on the transaction handle, and prefer explicit db-to-SDK converters. See Database Development Patterns.
  • Testing: Follow Testing Patterns and Best Practices. Use unique identifiers in concurrent tests and do not use time.Sleep to mitigate timing issues.
  • Frontend: Read Frontend Development Guidelines before changing anything under site/. Reuse shared UI primitives when possible and prefer Storybook stories for component and page testing.

Quick Reference

Full workflows available in imported WORKFLOWS.md

Git Hooks (MANDATORY - DO NOT SKIP)

You MUST install and use the git hooks. NEVER bypass them with --no-verify. Skipping hooks wastes CI cycles and is unacceptable.

The first run can be slow while caches warm up. Wait for hooks to complete, even when git commit or git push appears to hang.

See Development Workflows and Guidelines for hook setup, pre-commit behavior, pre-push behavior, and failure handling.

Git Workflow

When working on existing PRs, check out the branch first. See Development Workflows and Guidelines for the full workflow. Don't use git push --force unless explicitly requested.

New Feature Checklist

See Development Workflows and Guidelines for the new feature checklist, including git pull, database migration checks, and audit table checks.

Architecture

  • coderd: Main API service
  • provisionerd: Infrastructure provisioning
  • Agents: Workspace services (SSH, port forwarding)
  • Database: PostgreSQL with dbauthz authorization

Code Style

Detailed guidelines in imported WORKFLOWS.md

  • Follow Uber Go Style Guide
  • Commit format: type(scope): message
  • PR titles follow the same type(scope): message format.
  • When you use a scope, it must be a real filesystem path containing every changed file.
  • Use a broader path scope, or omit the scope, for cross-cutting changes.
  • Example: fix(coderd/chatd): ... for changes only in coderd/chatd/.

Frontend Patterns

  • Prefer existing shared UI components and utilities over custom implementations. Reuse common primitives such as loading, table, and error handling components when they fit the use case.
  • Use Storybook stories for all component and page testing, including visual presentation, user interactions, keyboard navigation, focus management, and accessibility behavior. Do not create standalone vitest/RTL test files for components or pages. Stories double as living documentation, visual regression coverage, and interaction test suites via play functions. Reserve plain vitest files for pure logic only: utility functions, data transformations, hooks tested via renderHook() that do not require DOM assertions, and query/cache operations with no rendered output.

Writing Comments and Avoiding Unnecessary Changes

See Modern Go for comment formatting and the rule to avoid unrelated edits. Preserve existing comments that explain non-obvious behavior unless the task directly requires changing them.

Comments MUST be substantive and concise. Describe the behaviour of the code, not the reasoning the agent used to produce the change. Do not leave comments like // Added per PR feedback or // Refactored for clarity. Instead, explain what the code does and why the behaviour matters.

No Emdash or Endash

Do not use emdash (U+2014), endash (U+2013), or -- as punctuation in code, comments, string literals, or documentation. Use commas, semicolons, or periods instead. Restructure the sentence if needed. Do not replace an emdash with --. Unicode emdash and endash are caught by make lint/emdash.

// Good: uses a period to separate the clauses.
// This is slow. We should cache it.

// Good: uses a comma to join related clauses.
// This is slow, so we should cache it.

Detailed Development Guides

@.claude/docs/ARCHITECTURE.md @.claude/docs/GO.md @.claude/docs/OAUTH2.md @.claude/docs/TESTING.md @.claude/docs/TROUBLESHOOTING.md @.claude/docs/DATABASE.md @.claude/docs/PR_STYLE_GUIDE.md @.claude/docs/DOCS_STYLE_GUIDE.md

If your agent tool does not auto-load @-referenced files, read these manually before starting work:

Always read:

  • .claude/docs/WORKFLOWS.md - dev server, git workflow, hooks

Read when relevant to your task:

  • .claude/docs/GO.md - Go patterns and modern Go usage (any Go changes)
  • .claude/docs/TESTING.md - testing patterns, race conditions (any test changes)
  • .claude/docs/DATABASE.md - migrations, SQLC, audit table (any DB changes)
  • .claude/docs/ARCHITECTURE.md - system overview (orientation or architecture work)
  • .claude/docs/PR_STYLE_GUIDE.md - PR description format (when writing PRs)
  • .claude/docs/OAUTH2.md - OAuth2 and RFC compliance (when touching auth)
  • .claude/docs/TROUBLESHOOTING.md - common failures and fixes (when stuck)
  • .claude/docs/DOCS_STYLE_GUIDE.md - docs prose and formatting (when writing docs/)
  • docs/.style/content-guidelines.md - canonical content scope and routing rules (when writing docs/; governs on conflicts with the style guide)

For frontend work, also read site/AGENTS.md before making any changes in site/.

Local Configuration

These files may be gitignored, read manually if not auto-loaded.

@AGENTS.local.md

Common Pitfalls

  1. Audit table errors → Update enterprise/audit/table.go
  2. OAuth2 errors → Return RFC-compliant format
  3. Race conditions → Use unique test identifiers
  4. Missing newlines → Ensure files end with newline

This file stays lean and actionable. Detailed workflows and explanations are imported automatically.