Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# RTK Landing — Claude Code Instructions

## URLs

| Environment | URL |
|-------------|-----|
| Production | https://www.rtk-ai.app |
| GitHub Repo | https://github.com/rtk-ai/rtk-landing |
| RTK Repo | https://github.com/rtk-ai/rtk |

## Stack

Astro 5 + Starlight + CSS custom properties (dark-only). No React, no component framework.

## Local dev

```bash
pnpm dev # Quick (stub docs)
pnpm dev:full # Full (prepare-docs + search + dev)

# With a specific RTK branch/worktree:
RTK_REPO_PATH=/Users/florianbruniaux/Sites/rtk-ai/rtk/.worktrees/<branch> pnpm dev:full
```

## Build & deploy

```bash
pnpm build # Full production build (prepare-docs + build-search + astro build)
pnpm preview # Preview dist/
```

Push to `main` auto-deploys via GitHub Actions (`.github/workflows/deploy.yml`).

## Architecture overview

```
src/
pages/
index.astro # Landing page
vox/index.astro # Vox product page
icm/index.astro # ICM product page
rss.xml.ts # RSS feed endpoint
404.astro # 404 page
content/docs/guide/ # GENERATED — do not edit (from prepare-docs.mjs)
data/
rss-entries.ts # ← EDIT THIS to add RSS entries
docs-search-entries.ts # GENERATED
docs-anchor-map.json # GENERATED
search-index.ts # Search entries for landing pages
components/
landing/ # Landing-specific components (Nav, Hero, Footer, etc.)
global/ # Shared components (Header for docs pages)
starlight/ # Starlight overrides (Header, Footer)
styles/
global.css # Design tokens + base resets (source of truth)
landing.css # Landing page styles
starlight-overrides.css # Starlight theme overrides
scripts/
prepare-docs.mjs # Docs pipeline: rtk/docs/guide/ → src/content/docs/guide/
build-search-index.mjs # Builds docs-search-entries.ts from content
```

## Design system

Design tokens are in `src/styles/global.css`. Key vars:

```css
--bg: #060b18 --accent: #00e599
--bg-alt: #0c1225 --cyan: #38bdf8
--bg-card: #0f1629 --violet: #a78bfa
--text: #e2e8f0 --border: #1a2344
--text-muted: #8294ab
--text-dim: #64748b
```

Never add inline styles for colors that have tokens. Never duplicate tokens in landing.css.

## Source of truth rules

| Data | Source | Never edit |
|------|--------|-----------|
| Docs content | `rtk/docs/guide/**/*.md` | `src/content/docs/guide/` |
| Docs search index | Generated by `build-search-index.mjs` | `src/data/docs-search-entries.ts` |
| Anchor map | Generated by `prepare-docs.mjs` | `src/data/docs-anchor-map.json` |
| RSS entries | `src/data/rss-entries.ts` | `src/pages/rss.xml.ts` |

## After each RTK release

1. Update `src/data/rss-entries.ts` — add entry at top of array
2. Run `/update-rss` (slash command) or add manually with format:
```ts
{ type: 'release', title: 'RTK vX.Y.Z', date: 'Mon D, YYYY', description: '...', link: '...' }
```

## Docs pipeline

The script reads `$RTK_REPO_PATH/docs/guide/**/*.md` recursively and copies to `src/content/docs/guide/` preserving subdirectory structure. Files already have valid Starlight frontmatter.

CI clones `rtk/main` at `./rtk-repo`. Once `feat-refac-doc` is merged into main, the new nested docs structure will be live automatically.

## Nav architecture

| Page type | Nav component |
|-----------|--------------|
| Landing (`/`) | `src/components/landing/Nav.astro` |
| Product pages (`/vox/`, `/icm/`) | `src/components/landing/ProductNav.astro` |
| Docs (`/guide/**`) | `src/components/global/Header.astro` (via Starlight override) |

Anchor links in Nav.astro use absolute paths (`/#problem`, `/#install`) so they work from any page.

## Workflow before push to main

```bash
pnpm build # Must pass with 0 errors
```

Check: no TypeScript errors, all pages generated, RSS endpoint at /rss.xml.
35 changes: 35 additions & 0 deletions .claude/commands/prepare-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: prepare-docs
description: Regenerate docs content from the RTK repo
---

Regenerate the docs content by running the prepare-docs pipeline.

## Steps

1. Ask which RTK path to use (default: `../rtk`, worktree: prompt for path):
- Default sibling: `RTK_REPO_PATH=../rtk`
- Specific worktree: `RTK_REPO_PATH=/Users/florianbruniaux/Sites/rtk-ai/rtk/.worktrees/<branch>`

2. Run the script:
```bash
RTK_REPO_PATH=<path> node scripts/prepare-docs.mjs
```

3. Report: files copied count, anchor map entries count.

4. If file count is 0, diagnose why (path wrong? docs/guide/ missing?).

5. Run a quick build to validate:
```bash
pnpm build
```

6. Report build status and list of generated doc routes.

## Context

- **Source**: `$RTK_REPO_PATH/docs/guide/**/*.md` (recursive)
- **Output**: `src/content/docs/guide/` (mirrors source structure)
- **Anchor map**: `src/data/docs-anchor-map.json`
- Files already have valid Starlight frontmatter — the script does NOT inject any
29 changes: 29 additions & 0 deletions .claude/commands/update-rss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: update-rss
description: Add a new entry to the RSS feed
---

Add a new entry to `src/data/rss-entries.ts`.

## Steps

1. Ask what type of update this is:
- `release` — new RTK version
- `new_page` — new product or landing page
- `new_doc` — new documentation page
- `new_feature` — significant new feature
- `performance` — perf improvement worth announcing

2. Ask for: title, date (format: "Apr 10, 2026"), description (1-3 sentences, no HTML), link (absolute URL).

3. Add the entry at the **top** of the `rssEntries` array in `src/data/rss-entries.ts`.

4. Confirm the entry was added correctly (show the first 5 entries).

## Rules

- Entries must be sorted newest first
- Date format: "Mon D, YYYY" (e.g., "Apr 10, 2026")
- Description: plain text only, no HTML tags
- Link: always absolute URL starting with `https://`
- Never edit `src/pages/rss.xml.ts` — only `src/data/rss-entries.ts`
15 changes: 15 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hooks": {
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "input=$(cat); echo \"$input\" | grep -q 'git push' && printf '\\n⚠️ [RSS] Pushed to landing. New release or content? Update src/data/rss-entries.ts\\n Types: release | new_page | new_doc | new_feature | performance\\n File: /Users/florianbruniaux/Sites/rtk-ai/rtk-landing/src/data/rss-entries.ts\\n' || true"
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hook message hardcodes an absolute local filesystem path (/Users/.../src/data/rss-entries.ts), which will be incorrect for other contributors and leaks a machine-specific path into the repo. Consider making the message path relative (or omit it) so the hook is portable.

Suggested change
"command": "input=$(cat); echo \"$input\" | grep -q 'git push' && printf '\\n⚠️ [RSS] Pushed to landing. New release or content? Update src/data/rss-entries.ts\\n Types: release | new_page | new_doc | new_feature | performance\\n File: /Users/florianbruniaux/Sites/rtk-ai/rtk-landing/src/data/rss-entries.ts\\n' || true"
"command": "input=$(cat); echo \"$input\" | grep -q 'git push' && printf '\\n⚠️ [RSS] Pushed to landing. New release or content? Update src/data/rss-entries.ts\\n Types: release | new_page | new_doc | new_feature | performance\\n File: src/data/rss-entries.ts\\n' || true"

Copilot uses AI. Check for mistakes.
}
]
}
]
}
}
75 changes: 75 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy to GitHub Pages

on:
push:
branches: ["main"]
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workflow is configured to deploy on pushes to main, but the PR description and several links in the repo still refer to master. If the default branch is master, deployments won’t run. Consider switching the trigger to master (or include both master and main) to match the repository’s actual default branch and the post-merge instructions.

Suggested change
branches: ["main"]
branches: ["main", "master"]

Copilot uses AI. Check for mistakes.
schedule:
- cron: "0 6 * * *"
repository_dispatch:
types: [docs-updated]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Clone RTK repo
run: git clone --depth 1 --branch develop https://github.com/rtk-ai/rtk.git ./rtk-repo
# If private: use https://x-access-token:${{ secrets.RTK_REPO_PAT }}@github.com/rtk-ai/rtk.git
# TODO: revert to main once docs branches are merged into main

- name: Prepare docs content
run: RTK_REPO_PATH=./rtk-repo node scripts/prepare-docs.mjs

- name: Build search index
run: node scripts/build-search-index.mjs

- name: Build Astro site
run: pnpm astro build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist/

deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
35 changes: 31 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
.fastembed_cache/
# Astro
dist/
.astro/

# Dependencies
node_modules/

# IDE
.idea/
.vscode/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db

# Environment
.env
.env.*
*.pyc
__pycache__/
.DS_Store
!.env.example

# Debug
npm-debug.log*
pnpm-debug.log*

# Generated content (rebuilt at CI time from rtk repo)
src/content/docs/
src/data/docs-anchor-map.json
src/data/docs-search-entries.ts

# Next.js (not used here but just in case)
.next/
Loading