|
| 1 | +--- |
| 2 | +applyTo: "docs/**" |
| 3 | +--- |
| 4 | + |
| 5 | +# Documentation — instructions for Copilot coding agent |
| 6 | + |
| 7 | +Follow these conventions when writing or editing pages in the `docs/` directory. |
| 8 | + |
| 9 | +## 1. Tool & rendering pipeline |
| 10 | + |
| 11 | +- **Generator**: [VitePress](https://vitepress.dev/) — pure Markdown/MDX, no Vue components needed. |
| 12 | +- **Build**: `bun run docs:build` → static output in `docs/.vitepress/dist/` |
| 13 | +- **Dev server**: `bun run docs:dev` → `http://localhost:5173/github-code-search/` |
| 14 | +- **Deploy**: GitHub Actions workflow `.github/workflows/docs.yml` → GitHub Pages. |
| 15 | + |
| 16 | +## 2. Brand guidelines |
| 17 | + |
| 18 | +### Typography |
| 19 | + |
| 20 | +| Role | Font | Usage | |
| 21 | +| ------------------------------ | ------------------------------------------- | ---------------------------- | |
| 22 | +| Primary (headings, short text) | **Poppins** (Aestetico Informal substitute) | Titles, taglines, callouts | |
| 23 | +| Accompanying (body text) | **Poppins** | Paragraphs, tables, lists | |
| 24 | +| Monospace | VitePress default (`--vp-font-family-mono`) | All code blocks | |
| 25 | +| Bureautic fallback | **Arial** | Email / Office contexts only | |
| 26 | + |
| 27 | +Poppins is loaded from Google Fonts in `docs/.vitepress/theme/custom.css`. Do not add additional font imports. |
| 28 | + |
| 29 | +### Colour palette |
| 30 | + |
| 31 | +| Name | Hex | Role | |
| 32 | +| ---------- | --------- | ------------------------------------------------------------- | |
| 33 | +| Violet | `#9933FF` | Primary — links, buttons, accents (9.1:1 on white ✓ WCAG AAA) | |
| 34 | +| Yellow | `#FFCC33` | Highlight / soft background tints | |
| 35 | +| Dark blue | `#0000CC` | Secondary / hover state | |
| 36 | +| Light blue | `#66CCFF` | Decorative only — **never for text** (insufficient contrast) | |
| 37 | +| Green | `#CCFF33` | Decorative only | |
| 38 | +| Orange | `#FF9933` | Decorative / warning callouts | |
| 39 | + |
| 40 | +Only override CSS variables in `docs/.vitepress/theme/custom.css`. Do not hard-code colour values inside Markdown. |
| 41 | + |
| 42 | +### Dark / light mode |
| 43 | + |
| 44 | +`appearance: 'force-auto'` in the VitePress config means the site follows `prefers-color-scheme` by default; the user can toggle manually. All colour tokens have dark-mode variants defined in `custom.css`. Never use `@media (prefers-color-scheme)` directly — rely on the `.dark` class selector that VitePress manages. |
| 45 | + |
| 46 | +## 3. File structure & naming |
| 47 | + |
| 48 | +``` |
| 49 | +docs/ |
| 50 | +├── index.md # Landing page (layout: home) |
| 51 | +├── getting-started/ # Onboarding section |
| 52 | +├── usage/ # Use-case-driven guides |
| 53 | +├── reference/ # Reference tables (CLI, shortcuts, API, env) |
| 54 | +└── architecture/ # C4 diagrams (L1 → L3 in Mermaid) |
| 55 | +``` |
| 56 | + |
| 57 | +- Use **kebab-case** for file names: `team-grouping.md`, not `teamGrouping.md`. |
| 58 | +- Every section must have an `index.md` that serves as the landing page for that section. |
| 59 | +- All pages must have a `# Title` as the first heading — VitePress uses it for the sidebar and `<title>`. |
| 60 | + |
| 61 | +## 4. Writing style |
| 62 | + |
| 63 | +- Write in **English**. |
| 64 | +- Lead each page with a one-sentence description of what the feature does and **when to use it**. |
| 65 | +- Prefer **use-case-driven content**: show a realistic CLI example first, explain options after. |
| 66 | +- Every code block must declare its language: ` ```bash `, ` ```typescript `, ` ```json `, etc. |
| 67 | +- Use admonitions for important caveats: |
| 68 | + ```markdown |
| 69 | + ::: warning GitHub API limit |
| 70 | + Code search is capped at 1 000 results. See [GitHub API limits](/reference/github-api-limits). |
| 71 | + ::: |
| 72 | + ``` |
| 73 | +- Cross-link liberally using root-relative paths: `[GitHub API limits](/reference/github-api-limits)`. |
| 74 | + |
| 75 | +## 5. Mermaid / C4 diagrams |
| 76 | + |
| 77 | +- Use `vitepress-plugin-mermaid` — wrap diagrams in ` ```mermaid ` fenced blocks. |
| 78 | +- C4 diagrams use `C4Context`, `C4Container`, `C4Component` diagram types. |
| 79 | +- Include a prose introduction **before** every diagram explaining what level it represents. |
| 80 | +- Keep diagrams self-contained: label every node and every arrow. |
| 81 | +- Do not add inline CSS to Mermaid diagrams — the plugin handles dark/light theming automatically via `mermaid.theme: 'default'` in the config. |
| 82 | + |
| 83 | +## 6. Versioning |
| 84 | + |
| 85 | +- `docs/public/versions.json` tracks published major versions. |
| 86 | + - Format: `[{ "text": "v1 (latest)", "link": "/" }]` |
| 87 | + - A new entry is appended automatically by CI when a `vX.0.0` tag is pushed. |
| 88 | +- Do **not** manually edit `versions.json` outside of the release workflow. |
| 89 | +- When updating docs for a new major version, update the nav `text` field in `docs/.vitepress/config.mts`. |
| 90 | + |
| 91 | +## 7. Validation checklist |
| 92 | + |
| 93 | +Before opening a PR for any docs change: |
| 94 | + |
| 95 | +```bash |
| 96 | +bun run docs:build # must complete without errors |
| 97 | +bun run format:check # oxfmt — no formatting diff |
| 98 | +``` |
| 99 | + |
| 100 | +- All internal links must resolve (VitePress reports dead links on build). |
| 101 | +- No new `bun run knip` violations (docs/\*\* is excluded but `package.json` changes are not). |
0 commit comments