Skip to content

Commit fd75ea8

Browse files
louis-preclaude
andauthored
chore: Rewrite CLAUDE.md with dev commands and architecture (#1097)
* Rename claude.md to CLAUDE.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Rewrite CLAUDE.md with dev commands and architecture Replace the lengthy style guide with a focused reference that includes build/lint/format commands, the 3-site GitBook architecture, codegen pipeline details, and condensed writing conventions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Update CLAUDE.md with dev commands, 3-site architecture, and codegen details Keep all existing writing conventions, patterns, and guidelines intact. Add new sections for: - Development commands (generate, format, lint, validate-*) - Three GitBook sites (guides, api-reference, brand-guides) - Codegen pipeline (smith.ts, Metalsmith, Handlebars, @seamapi packages) - Auto-generated vs. hand-written content guidance Fix stale references from /docs/api/ to docs/api-reference/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add guideline to avoid modifying file URLs in SUMMARY.md Use the GitBook UI to rename or move pages instead, as modifying URLs via SUMMARY.md can break GitBook sync. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent aec6e09 commit fd75ea8

1 file changed

Lines changed: 59 additions & 44 deletions

File tree

claude.md renamed to CLAUDE.md

Lines changed: 59 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,57 @@
1-
# Seam API Documentation - Repository Guide
1+
# CLAUDE.md
22

3-
This document provides a comprehensive overview of the Seam API documentation repository structure, organization, and writing conventions. Use this as a reference when working with the documentation.
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44

5-
**Repository:** Seam API Documentation (hosted on GitBook at https://docs.seam.co/latest/)
6-
**Total Files:** 627 markdown files
7-
**Last Updated:** 2026-01-28
5+
## Repository Overview
86

9-
---
7+
Seam API documentation hosted on GitBook at https://docs.seam.co/latest/. Contains hand-written guides, auto-generated API reference pages, a codegen pipeline, and a GitBook plugin.
8+
9+
## Commands
10+
11+
```bash
12+
nvm install && npm install # Setup (requires Node >=22.11.0)
13+
npm run generate # Regenerate API reference docs (Metalsmith + Handlebars)
14+
npm run format # Prettier (also runs eslint --fix via preformat hook)
15+
npm run lint # ESLint + Prettier check
16+
npm run typecheck # TypeScript type checking
17+
npm run validate-paths # Validate doc file paths
18+
npm run validate-links # Validate internal links
19+
npm run validate-orphan-pages # Find pages not in SUMMARY.md
20+
npm run validate-redirects # Validate .gitbook.yaml redirects
21+
```
22+
23+
**Always run `npm run format` before committing.** CI auto-commits formatting fixes on non-main branches, but formatting locally avoids noise.
24+
25+
Optional external tools used during `npm run generate` for code sample formatting: `ruff` (Python), `shfmt` (shell), `gofmt` (Go), `stree` from `syntax_tree` gem (Ruby).
26+
27+
## Architecture
28+
29+
### Three GitBook Sites
30+
31+
The repo serves three separate GitBook sites, each with its own config, `SUMMARY.md`, and redirect rules:
32+
33+
| Site | Root | Config | Content |
34+
| ------------- | --------------------- | ---------------------------------- | ---------------------------------------- |
35+
| Main docs | `docs/guides/` | `.gitbook.yaml` | Guides, core concepts, capability guides |
36+
| API reference | `docs/api-reference/` | `docs/api-reference/.gitbook.yaml` | Auto-generated API endpoint docs |
37+
| Brand guides | `docs/brand-guides/` | `docs/brand-guides/.gitbook.yaml` | Device/system integration guides |
38+
39+
### Auto-Generated vs. Hand-Written Content
40+
41+
**`docs/api-reference/`** is auto-generated by `npm run generate`. Do not manually edit these files -- changes will be overwritten. The codegen pipeline:
1042

11-
## Table of Contents
43+
- Entry point: `codegen/smith.ts` (Metalsmith static site generator)
44+
- Templates: `codegen/layouts/*.hbs` (Handlebars)
45+
- Code samples: `codegen/data/code-sample-definitions/*.yaml`
46+
- Types come from `@seamapi/types` and `@seamapi/blueprint` packages
1247

13-
1. [Documentation Organization](#documentation-organization)
14-
2. [File Structure](#file-structure)
15-
3. [Writing Style & Tone](#writing-style--tone)
16-
4. [Content Types](#content-types)
17-
5. [GitBook Configuration](#gitbook-configuration)
18-
6. [Common Patterns & Conventions](#common-patterns--conventions)
19-
7. [Key Guidelines](#key-guidelines)
48+
**Everything else under `docs/`** is hand-written and edited directly.
49+
50+
### Other Directories
51+
52+
- `gitbook-plugin/` -- Custom GitBook integration plugin (separate npm package)
53+
- `seam-sdk-playground/` -- Dev environment for testing SDK code samples across languages
54+
- `codegen/` -- API reference generation pipeline + validation scripts
2055

2156
---
2257

@@ -63,7 +98,7 @@ The documentation is organized into **7 main sections**, each serving a distinct
6398

6499
### 3. API Reference (Technical Specifications)
65100

66-
**Purpose:** Complete API endpoint documentation (appears to be auto-generated from OpenAPI specs)
101+
**Purpose:** Complete API endpoint documentation, auto-generated by `npm run generate`
67102

68103
**Topics:**
69104

@@ -79,7 +114,7 @@ The documentation is organized into **7 main sections**, each serving a distinct
79114
- Connected Accounts
80115
- And 20+ other resources
81116

82-
**Location:** `/docs/api/`
117+
**Location:** `docs/api-reference/` (do not manually edit -- see [Auto-Generated vs. Hand-Written Content](#auto-generated-vs-hand-written-content))
83118

84119
### 4. UI Components
85120

@@ -147,7 +182,7 @@ The documentation is organized into **7 main sections**, each serving a distinct
147182
/docs/
148183
├── core-concepts/ (9 subdirectories)
149184
├── capability-guides/ (11 subdirectories)
150-
├── api/ (29 subdirectories - auto-generated)
185+
├── api-reference/ (auto-generated - do not edit)
151186
├── device-and-system-integration-guides/ (26 subdirectories)
152187
├── device-guides/ (41 subdirectories)
153188
├── products/ (4 subdirectories)
@@ -326,33 +361,11 @@ The documentation is organized into **7 main sections**, each serving a distinct
326361

327362
## GitBook Configuration
328363

329-
### Key Settings (from `.gitbook.yaml`)
330-
331-
**Root directory:** `./docs/`
332-
333-
**Structure files:**
334-
335-
- `README.md` - Landing page
336-
- `SUMMARY.md` - Table of contents
364+
See the [Architecture](#architecture) section above for the three GitBook site configs and the codegen pipeline.
337365

338366
### Redirect Management
339367

340-
The configuration includes **198+ redirects** maintaining backward compatibility:
341-
342-
**Common redirect patterns:**
343-
344-
```yaml
345-
# API client paths → Unified API paths
346-
api-clients/access-codes/create: api/access_codes/create
347-
348-
# Device guides → Integration guides
349-
device-guides/august-locks: device-and-system-integration-guides/august-locks
350-
351-
# URL normalization
352-
old/path/with-dashes: new-path/with-underscores
353-
```
354-
355-
**Purpose:** Ensures old documentation links continue working as structure evolves
368+
Each `.gitbook.yaml` contains redirects maintaining backward compatibility. When restructuring, always add redirects in the appropriate site's config.
356369

357370
---
358371

@@ -698,7 +711,7 @@ To follow this guide, you need:
698711

699712
### For Working with This Repository
700713

701-
1. **Auto-generated content:** The `/docs/api/` directory appears to be auto-generated. Avoid manual edits here - changes should be made to the source spec.
714+
1. **Auto-generated content:** The `docs/api-reference/` directory is auto-generated by `npm run generate`. Do not manually edit these files -- changes should be made to the codegen pipeline or upstream packages (`@seamapi/types`, `@seamapi/blueprint`).
702715

703716
2. **Consistency is critical:** With 627 files, maintaining consistent formatting, tone, and structure is essential. Follow existing patterns exactly.
704717

@@ -714,9 +727,11 @@ To follow this guide, you need:
714727

715728
8. **Link maintenance:** When restructuring, always add redirects in `.gitbook.yaml` to maintain backward compatibility.
716729

717-
9. **Visual aids:** Use screenshots, diagrams, and videos generously. IoT integrations benefit from visual guidance.
730+
9. **Do not modify file URLs in SUMMARY.md.** Renaming or moving page URLs via SUMMARY.md can break GitBook sync. Use the GitBook UI to rename or move pages instead.
731+
732+
10. **Visual aids:** Use screenshots, diagrams, and videos generously. IoT integrations benefit from visual guidance.
718733

719-
10. **Accessibility:** Provide alt text for images, use semantic HTML, and ensure code examples are properly formatted.
734+
11. **Accessibility:** Provide alt text for images, use semantic HTML, and ensure code examples are properly formatted.
720735

721736
### Writing Checklist
722737

0 commit comments

Comments
 (0)