Skip to content
Merged
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
95 changes: 95 additions & 0 deletions .claude/skills/write-docs/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
name: write-docs
description: Create or update documentation pages for the Abacus docs site. Use when adding new documentation, updating existing pages, or ensuring docs stay in sync with code changes. Ensures pages follow Starlight patterns and build correctly.
allowed-tools: Read, Grep, Glob, Edit, Write, Bash
---

# Write Docs Skill

Create and maintain documentation for the Abacus docs site (Astro Starlight).

## Before Starting

1. Read existing pages in `docs/src/content/docs/` to understand patterns
2. Check `docs/astro.config.mjs` for sidebar structure
3. Understand the section you're adding to (getting-started, providers, cli, deployment, development)

## Workflow

### Adding a New Page

1. Create `.mdx` file in the appropriate directory
2. Add required frontmatter (see below)
3. Use existing pages as reference for component usage
4. Run `cd docs && pnpm build` to verify

### Updating an Existing Page

1. Read the current page first
2. Make changes, preserving existing patterns
3. Run `cd docs && pnpm build` to verify

## Frontmatter

Every page requires:

```mdx
---
title: Page Title
description: One-line description for SEO
sidebar:
order: 1 # Position within section
---
```

## Key Rules

### Links Must Include Base Path

Internal links need `/abacus/` prefix (GitHub Pages requirement):

```mdx
[Quick Start](/abacus/getting-started/quick-start/) ✓
[Quick Start](/getting-started/quick-start/) ✗
```

### Import Components Before Use

```mdx
import { Steps, Aside } from '@astrojs/starlight/components';

<Steps>
1. First step
2. Second step
</Steps>

<Aside type="tip">Helpful note</Aside>
```

### Code Blocks Need Language Tags

```mdx
```bash
pnpm cli sync
```
```

## Build Verification

**Always verify before committing:**

```bash
cd docs && pnpm build
```

Common errors:
- Missing imports
- Invalid frontmatter
- Broken links (wrong path or missing `/abacus/`)

## Style Guidelines

- Imperative mood ("Run this" not "You should run")
- Code examples over abstract descriptions
- Keep paragraphs short - users skim
- Tables for reference data (env vars, options)
63 changes: 63 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Deploy Documentation

on:
push:
branches: [main]
paths:
- 'docs/**'
- '.github/workflows/deploy-docs.yml'
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 repository
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: docs/pnpm-lock.yaml

- name: Install dependencies
working-directory: docs
run: pnpm install --frozen-lockfile

- name: Build documentation
working-directory: docs
run: pnpm build

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

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
18 changes: 18 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,21 @@ Use `ui-design` skill when creating or modifying frontend components. Covers col
## Tips & Guides

Use `write-tip` skill when editing tips. Key files: `src/lib/tips.ts`, `.claude/skills/write-tip/SKILL.md`

## Documentation

Documentation lives in `docs/` (Astro Starlight, deployed to GitHub Pages).

**Keep docs in sync with code.** When changing these areas, update the corresponding docs:

| Code Change | Update Docs |
|-------------|-------------|
| CLI commands (usage sync) | `docs/src/content/docs/cli/usage-data.mdx` |
| CLI commands (commits) | `docs/src/content/docs/cli/commit-data.mdx` |
| CLI commands (mappings) | `docs/src/content/docs/cli/identity-mappings.mdx` |
| Environment variables | `docs/src/content/docs/getting-started/environment-variables.mdx` |
| Provider setup/behavior | `docs/src/content/docs/providers/*.mdx` |
| Cron schedules / Vercel config | `docs/src/content/docs/deployment/vercel.mdx` |
| Project structure | `docs/src/content/docs/development/architecture.mdx` |

Use `write-docs` skill when creating or updating documentation. See `.claude/skills/write-docs/SKILL.md`
60 changes: 60 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';

export default defineConfig({
site: 'https://getsentry.github.io',
base: '/abacus',
image: {
service: { entrypoint: 'astro/assets/services/noop' },
},
integrations: [
starlight({
title: 'Abacus',
description: 'Track and analyze AI coding tool usage across your team',
social: {
github: 'https://github.com/getsentry/abacus',
},
customCss: ['./src/styles/custom.css'],
head: [
{
tag: 'script',
content: `
localStorage.setItem('starlight-theme', 'dark');
document.documentElement.dataset.theme = 'dark';
`,
},
],
components: {
ThemeSelect: './src/components/ThemeSelect.astro',
},
sidebar: [
{ label: 'Welcome', link: '/' },
{
label: 'Getting Started',
autogenerate: { directory: 'getting-started' },
},
{
label: 'Providers',
autogenerate: { directory: 'providers' },
},
{
label: 'CLI Reference',
autogenerate: { directory: 'cli' },
},
{
label: 'Deployment',
autogenerate: { directory: 'deployment' },
},
{
label: 'Development',
collapsed: true,
autogenerate: { directory: 'development' },
},
],
editLink: {
baseUrl: 'https://github.com/getsentry/abacus/edit/main/docs/',
},
lastUpdated: true,
}),
],
});
14 changes: 14 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "abacus-docs",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview"
},
"dependencies": {
"astro": "^5.0.0",
"@astrojs/starlight": "^0.30.0"
}
}
Loading
Loading