Closes DOCS-332. ## Summary Add `docs/.style/content-guidelines.md` as the canonical source of truth for what belongs in Coder's docs and what doesn't. Slim `.claude/skills/doc-check/SKILL.md` and reconcile `.claude/docs/DOCS_STYLE_GUIDE.md` so they defer to that canonical file. One-line pointer added from root `AGENTS.md`. ## Problem DOCS-332 cataloged five gaps in the doc-check skill and its sibling AI-facing docs: 1. Two style guides overlapping and contradicting each other on bold and italic conventions. 2. The SKILL had a single "do not comment" class (auto-generated CLI docs); everything else was inferred. Source of sticky-comment noise. 3. Premium signaling split across two files (`(Premium)` H1 suffix in SKILL, `"state": ["premium"]` manifest entry in DOCS_STYLE_GUIDE). 4. The no-emdash rule lived in root `AGENTS.md` and DOCS_STYLE_GUIDE but not in the SKILL. 5. The redirects-live-in-`coder/coder.com:redirects.json` rule lived only in DOCS_STYLE_GUIDE. In parallel, a cross-repo content guidance discussion (June 2026) produced a canonical "what belongs in the docs" document in Notion that disagreed with the existing GitHub guidance in three places: screenshots, "proactive documentation," and in-docs troubleshooting. ## Fix **New canonical file**: `docs/.style/content-guidelines.md`. Translates the canonical content guidance into the repo: - Diátaxis framing. - "Documentation lands with the change" rule with three corollaries (docs in same PR; no docs for unconfirmed features; multi-PR launch exception, present tense, never as a promise). - 7-step quick decision checklist. - "What belongs / what doesn't / routing table" structure. - Screenshot policy: only when the topic would be confusing without it; PHI/PII, secrets, minimal surface area, alt text required. - Premium signaling requires both H1 suffix and `"state": ["premium"]` in `docs/manifest.json`. - Redirects must be added to `coder/coder.com:redirects.json`, never `docs/_redirects`. - Verify-against-code rule with exact RBAC names and full API paths. - Terraform exception for minimal teaching examples. **Slim `.claude/skills/doc-check/SKILL.md`**: defers scope and routing to `docs/.style/content-guidelines.md`. Adds an explicit "What not to comment on" list (Gap 2) covering internal refactors, test-only changes, CI/tooling, dep bumps, and pure code reorganizations. Closes Gaps 3, 4, and 5 in the same pass. **Reconcile `.claude/docs/DOCS_STYLE_GUIDE.md`**: removes the image-driven documentation pattern, the placeholder-screenshot workflow, the "proactive documentation" pattern, and the in-docs troubleshooting H3 pattern. Each is replaced with a short pointer to the canonical guidelines. Prose, formatting, and structural conventions remain; this file continues to cover those. **`AGENTS.md`**: one-line pointer added to the navigation section and the read-when-relevant list. ## What's explicitly out of scope - **Gap 1** (bold and italic reconciliation): deferred to DOCS-186, which will redirect the human-facing `docs/about/contributing/documentation.md` to `docs/.style/style-guide.md` once DOCS-180 lands. - **Prose-rule migration** to `docs/.style/style-guide.md`: handled by DOCS-180. - **doc-check workflow comment-format changes**: deferred (Phase 2 work). - **redirect-suggestion behavior in doc-check**: tracked as DOCS-359. - **Historical predictive-content sweep across `docs/`**: tracked as DOCS-358. ## Known CI notes - This PR will trigger `docs-preview`, which posts a comment with a deep link to the first added Markdown file. The link will 404 because `docs/.style/**` files are not added to `docs/manifest.json` and shouldn't be (the directory is contributor-facing, not published). DOCS-180 negates `docs/.style/**` in the `docs-preview` workflow; once that lands the papercut goes away. Safe to ignore the comment on this PR. - `deploy-docs` will run on merge but is manifest-driven: since `docs/.style/**` files are not in `docs/manifest.json`, the surgical Algolia indexer will skip them and no full Vercel rebuild fires. - `doc-check` will run on this PR; the diff has no user-facing product change, so it should report no documentation impact. ## Review This change is documentation-only and does not modify product code or CI checks in any meaningful way. Per standing instructions this requires a human review; the `/coder-agents-review` bot is **not** triggered. <details> <summary>Implementation plan and decision log</summary> ### Decisions made during scoping 1. **Option B (consolidate)** for DOCS-332: a single canonical content-guidance file instead of distributing fixes back into the existing sibling files. 2. **File location**: `docs/.style/content-guidelines.md`. The rules apply to both humans and AI, so an AI-prefixed naming scheme would mislead. `docs/.style/` is contributor-facing and not published to coder.com per the DOCS-180 convention. 3. **Independent merge**: this PR does not block on DOCS-180. The README in `docs/.style/` is a minimal stub that should merge cleanly with the DOCS-180 README. 4. **Canonical-source model**: GitHub becomes canonical for docs content guidance. The cross-repo source page will be rewritten to point at this file as a follow-up. ### Conflicts resolved | Topic | Old GitHub guidance | New canonical | |----------------|---------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------| | Screenshots | Image-driven sections; placeholders welcome | Use only when topic confusing without; 4 rules (no PHI or PII, no secrets, minimal surface area, alt text) | | Timelessness | "Proactive Documentation" pattern (write ahead, reference PR number) | "Documentation lands with the change" plus 3 corollaries; predictive language banned | | Troubleshooting| In-docs H3 pattern | Routes to Support KB (Pilon); embedded widget under investigation | ### Pre-mortem - **`docs-preview` dead link**: known papercut documented in the CI notes above. - **`deploy-docs` over-fire**: addressed by manifest-driven exclusion; the surgical indexer skips non-manifest paths. - **Merge conflict with DOCS-180 `docs/.style/README.md`**: expected to be small and mechanical. Both PRs introduce the same directory and a "What lives here" table; the merge is "combine the rows". - **Merge conflict with DOCS-186**: none expected. DOCS-186 changes `docs/about/contributing/documentation.md`, which this PR does not touch. ### Follow-up tickets filed - **DOCS-358**: Sweep `docs/` for predictive or proactive content that violates the "docs land with the change" rule. - **DOCS-359**: doc-check suggests `redirects.json` entries on doc renames and moves. </details> --- *Generated via Coder Agents.*
12 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
- Day-to-day: Start with Development Workflows and Guidelines for dev servers, git workflow, hooks, and routine checks.
- Observability and isolation: Use Observability Guide for Agents for logs, tracing, and metrics, and Development Isolation Guide for Agents for ports, state, readiness, and cleanup.
- Failures: Use Agent Failure Catalog for repeatable failure formats and seeded diagnostics.
- Language and area docs: Use Modern Go, Testing Patterns and Best Practices, Database Development Patterns, OAuth2 Development Guide, Coder Architecture, Troubleshooting Guide, Documentation Style Guide, and Pull Request Description Style Guide when that area is in scope.
- Docs content scope: Use Coder Docs Content Guidelines to decide whether a piece of content belongs in
docs/at all. The Documentation Style Guide above covers prose and formatting; the content guidelines govern scope and routing and supersede the style guide on conflicts. - Compatibility:
.agents/docssymlinks to.claude/docsfor agent runtimes that look there. - Frontend: Read Frontend Development Guidelines before changing anything under
site/.
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 docspnpm run lint-docs- Lint and fix markdown filespnpm 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, runmake gen, updateenterprise/audit/table.gofor audit errors, then runmake genagain. - 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 usedbauthz.AsSystemRestricted. - API design: Follow the API guardrails in Development Workflows and Guidelines, including swagger annotations for new public HTTP endpoints.
- Transactions and conversions: Keep
InTxwork 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.Sleepto 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
dbauthzauthorization
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): messageformat. - 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 incoderd/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
playfunctions. Reserve plain vitest files for pure logic only: utility functions, data transformations, hooks tested viarenderHook()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 writingdocs/)docs/.style/content-guidelines.md- canonical content scope and routing rules (when writingdocs/; 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
- Audit table errors → Update
enterprise/audit/table.go - OAuth2 errors → Return RFC-compliant format
- Race conditions → Use unique test identifiers
- Missing newlines → Ensure files end with newline
This file stays lean and actionable. Detailed workflows and explanations are imported automatically.