Skip to content

Commit 5a0975c

Browse files
authored
docs: refresh reference section with category badges and dynamic index pages (#69)
* docs: normalize reference page titles to Title Case * docs: add sidebar badges for definition types * docs: add definition header with source link and category * docs: add CSS for definition headers * docs: extract helpers to reduce processDirectory complexity * docs: replace type badges with category badges for agents only * docs: upgrade skills index to LinkCard grid * docs: upgrade agents index to categorized LinkCard grid * docs: upgrade commands index to categorized LinkCard grid * docs: prefix unused definitionType param to fix lint warning * docs: dynamically generate reference index pages from enumerated entries Replace hardcoded index.mdx files with dynamic generation in transform-content.ts. Index pages are now built from the same DefinitionEntry metadata collected during processDirectory, using Starlight CardGrid/LinkCard components. - Add generateIndexPage() with type-aware grouping (agents by category, commands by workflows/utilities, skills flat) - Remove unused definitionType param from transformFrontmatter - Add helper functions: cleanDescription, escapeAttr, firstSentence, renderLinkCard, renderCardGrid - Simplify .gitignore to ignore entire reference/ directory - Remove index.mdx skip guard from clean step - Update docs/AGENTS.md to reflect generated index pages * docs: add brainstorm, plan, and solution artifacts from reference refresh
1 parent 7538522 commit 5a0975c

11 files changed

Lines changed: 1397 additions & 57 deletions

File tree

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,4 @@ tests/tmp/
3333
# Docs build artifacts
3434
docs/dist/
3535
docs/.astro/
36-
docs/src/content/docs/reference/**
37-
!docs/src/content/docs/reference/**/
38-
!docs/src/content/docs/reference/**/index.mdx
36+
docs/src/content/docs/reference/

docs/AGENTS.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ bun run docs:preview # Preview production build
2525
docs/
2626
├── astro.config.mjs # Site config (sidebar, social, base path)
2727
├── scripts/
28-
│ └── transform-content.ts # Content generator (156 lines)
28+
│ └── transform-content.ts # Content generator (~390 lines)
2929
├── src/
3030
│ ├── styles/custom.css # Theme overrides
3131
│ └── content/docs/
3232
│ ├── index.mdx # Landing page
3333
│ ├── getting-started/ # 2 manual pages (installation, configuration)
3434
│ ├── guides/ # 3 manual pages (architecture, conversion, creating-skills)
3535
│ └── reference/ # Generated — DO NOT EDIT
36-
│ ├── skills/ # 8 pages + index.mdx
37-
│ ├── agents/ # 11 pages + index.mdx
38-
│ └── commands/ # 9 pages + index.mdx
36+
│ ├── skills/ # 11 pages + index.mdx (all generated)
37+
│ ├── agents/ # 24 pages + index.mdx (all generated)
38+
│ └── commands/ # 9 pages + index.mdx (all generated)
3939
└── package.json
4040
```
4141

@@ -45,13 +45,13 @@ docs/
4545

4646
| Source | Pattern | Output |
4747
|--------|---------|--------|
48-
| `skills/*/SKILL.md` | `SKILL.md` files | `reference/skills/<slug>.md` |
49-
| `agents/**/*.md` | All `.md` files | `reference/agents/<slug>.md` |
50-
| `commands/**/*.md` | All `.md` files | `reference/commands/<slug>.md` |
48+
| `skills/*/SKILL.md` | `SKILL.md` files | `reference/skills/<slug>.md` + `index.mdx` |
49+
| `agents/**/*.md` | All `.md` files | `reference/agents/<slug>.md` + `index.mdx` |
50+
| `commands/**/*.md` | All `.md` files | `reference/commands/<slug>.md` + `index.mdx` |
5151

52-
Pipeline: `read file → parseFrontmatter → transformFrontmatter (name→title) → generatePage → write`
52+
Pipeline: `read file → parseFrontmatter → transformFrontmatter (name→title, agent category→badge) → generatePage → write`
5353

54-
Each run cleans output dirs (preserves `index.mdx`) before regenerating. Slug collisions abort with error.
54+
Each run cleans output dirs before regenerating. Index pages (`index.mdx`) are dynamically generated from the same enumerated entries using Starlight `CardGrid`/`LinkCard` components. Agents are grouped by category; commands are split into Workflows and Utilities. Slug collisions abort with error.
5555

5656
## Where to Look
5757

@@ -66,8 +66,8 @@ Each run cleans output dirs (preserves `index.mdx`) before regenerating. Slug co
6666

6767
## Notes
6868

69-
- Reference pages under `reference/` are gitignored — always regenerated from source
70-
- `index.mdx` files in reference subdirs are manual (not generated, not cleaned)
69+
- Reference pages under `reference/` are gitignored — always regenerated from source (including `index.mdx`)
70+
- Only agents get sidebar badges (category: Review, Research, Design, Workflow); skills and commands have no badge
7171
- Script has its own `parseFrontmatter` (duplicates `src/lib/frontmatter.ts` logic)
7272
- Frontmatter `name` → Starlight `title`, `description` gets HTML tags stripped
7373
- Sidebar: Getting Started, Guides, Reference (Skills/Agents/Commands) — all autogenerated from dirs
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
date: 2026-02-12
3+
topic: reference-section-refresh
4+
---
5+
6+
# Reference section refresh (skills, agents, commands)
7+
8+
## What we’re building
9+
10+
We’re improving the docs site’s **Reference** section so that generated pages for **skills**, **agents**, and **commands** feel like a coherent, scannable reference—rather than a raw copy of source Markdown.
11+
12+
Each reference page will render a **structured definition header** that surfaces essential metadata (from frontmatter) in a consistent layout, followed by the existing source body content. The goal is to make it immediately clear:
13+
14+
- What the definition is
15+
- When to use it (at least via its description; deeper “when to use” stays in body)
16+
- Where it comes from (source path)
17+
18+
We will also improve readability by generating **human-friendly headings** from names/slugs (e.g., `agent-browser``Agent Browser`) while keeping stable URLs.
19+
20+
## Why this approach
21+
22+
We want the reference pages to be **content-driven** (source Markdown remains canonical) but **presentation-consistent** (shared UI across all pages). The chosen approach is:
23+
24+
- **Generate MDX pages** that render a shared Astro/MDX component for the header
25+
- Keep the remaining body content as-is (minimal transforms)
26+
27+
This gives us consistent UI without duplicating formatting logic across hundreds of generated pages.
28+
29+
## Key decisions
30+
31+
- **Target experience:** “Structured API ref” style pages: a consistent, compact header + clean body.
32+
- **Implementation approach:** **MDX + shared components** (generator outputs an MDX wrapper that calls components living in `docs/src/components/...`).
33+
- **Metadata policy (default): Minimal (scannability-first).**
34+
- Skills: `name`, `description`
35+
- Agents: `name`, `description`, `category` (where applicable)
36+
- Commands: `name`, `description`
37+
- Plus: `source` (path) where available
38+
- **Title normalization:** Display titles should be derived from the canonical name/slug (e.g., kebab-case → Title Case).
39+
- **Source linking:** Include a **GitHub “View source”** link in the header.
40+
- Repo: `marcusrbrown/systematic`
41+
- Branch: `main`
42+
- URLs derived from repo-relative paths for each definition file
43+
44+
## Success criteria
45+
46+
- Reference pages visually communicate “what/when/source” in under 5 seconds.
47+
- Titles/headings are human-readable without manual editing.
48+
- Styling/layout is consistent across skills/agents/commands.
49+
- Minimal metadata avoids clutter and keeps pages readable.
50+
- Generator output remains deterministic and friendly to sidebar autogeneration.
51+
52+
## Open questions
53+
54+
- **Title casing rules:** any special handling for acronyms (e.g., MCP, JSON), “v2”, etc.?
55+
- **Source linking details:** do we also show the plain path alongside the GitHub link (copyable), or link-only?
56+
- **Index pages:** should the reference landing pages become richer (e.g., CardGrid of categories/tags) or stay simple?
57+
58+
## Next steps
59+
60+
→ Move to `/workflows:plan` to decide the concrete generator output format (MDX shape), component API, and any minimal style system for the reference header.

0 commit comments

Comments
 (0)