|
| 1 | +# FinishLine Documentation Site |
| 2 | + |
| 3 | +This directory contains the Docusaurus-based documentation site for FinishLine developers. |
| 4 | + |
| 5 | +## Architecture |
| 6 | + |
| 7 | +**Source of Truth:** `docs-site/docs/` contains all developer documentation in standard Docusaurus markdown format. |
| 8 | + |
| 9 | +**Claude AI Integration:** Documentation files flagged with `skill: true` in their frontmatter are automatically synced to `.claude/skills/` for Claude AI to use as context when helping with development. |
| 10 | + |
| 11 | +### Workflow |
| 12 | + |
| 13 | +1. **Developers edit**: `docs-site/docs/` (tracked in Git) |
| 14 | +2. **Run sync**: `yarn skills:sync` generates `.claude/skills/` (gitignored) |
| 15 | +3. **Claude reads**: `.claude/skills/` to understand the codebase |
| 16 | + |
| 17 | +This approach allows us to: |
| 18 | + |
| 19 | +- Maintain comprehensive documentation for developers |
| 20 | +- Selectively sync relevant docs to Claude's skills |
| 21 | +- Have docs-only content (deployment, architecture) that Claude doesn't need |
| 22 | + |
| 23 | +## Prerequisites |
| 24 | + |
| 25 | +- Node.js 18 or higher |
| 26 | +- Yarn package manager (this project uses Yarn workspaces) |
| 27 | + |
| 28 | +## Setup |
| 29 | + |
| 30 | +The docs-site is part of the FinishLine monorepo workspace. Dependencies are managed from the root: |
| 31 | + |
| 32 | +```bash |
| 33 | +# From the FinishLine root directory |
| 34 | +yarn install |
| 35 | +``` |
| 36 | + |
| 37 | +This will install all dependencies for docs-site along with the rest of the project. |
| 38 | + |
| 39 | +## Development |
| 40 | + |
| 41 | +### Running the documentation site locally: |
| 42 | + |
| 43 | +**From the root directory:** |
| 44 | + |
| 45 | +```bash |
| 46 | +yarn docs:dev |
| 47 | +``` |
| 48 | + |
| 49 | +**Or from within docs-site:** |
| 50 | + |
| 51 | +```bash |
| 52 | +cd docs-site |
| 53 | +yarn start |
| 54 | +``` |
| 55 | + |
| 56 | +The Docusaurus development server will start at `http://localhost:3002`. |
| 57 | + |
| 58 | +The site will automatically reload when you edit files in `docs/`. |
| 59 | + |
| 60 | +## Building for Production |
| 61 | + |
| 62 | +To create a production build: |
| 63 | + |
| 64 | +**From root:** |
| 65 | + |
| 66 | +```bash |
| 67 | +yarn docs:build |
| 68 | +``` |
| 69 | + |
| 70 | +**Or from docs-site:** |
| 71 | + |
| 72 | +```bash |
| 73 | +cd docs-site |
| 74 | +yarn build |
| 75 | +``` |
| 76 | + |
| 77 | +The static site will be generated in the `build/` directory. |
| 78 | + |
| 79 | +To test the production build locally: |
| 80 | + |
| 81 | +```bash |
| 82 | +yarn docs:serve |
| 83 | +``` |
| 84 | + |
| 85 | +## Syncing Skills for Claude |
| 86 | + |
| 87 | +After editing documentation that should be available to Claude: |
| 88 | + |
| 89 | +```bash |
| 90 | +yarn skills:sync |
| 91 | +``` |
| 92 | + |
| 93 | +This command: |
| 94 | + |
| 95 | +1. Scans all files in `docs/` for `skill: true` in frontmatter |
| 96 | +2. Transforms them to Claude's SKILL.md format |
| 97 | +3. Writes them to `.claude/skills/` (gitignored) |
| 98 | + |
| 99 | +**When to sync:** |
| 100 | + |
| 101 | +- After adding or editing documentation flagged as a skill |
| 102 | +- Before using Claude for development (to ensure it has latest context) |
| 103 | +- Can be automated in a pre-commit hook if desired |
| 104 | + |
| 105 | +## Project Structure |
| 106 | + |
| 107 | +``` |
| 108 | +docs-site/ |
| 109 | +├── docs/ # Source of truth - developer documentation |
| 110 | +│ ├── intro.md |
| 111 | +│ └── general-practices/ |
| 112 | +│ ├── backend-endpoints.md |
| 113 | +│ └── ... |
| 114 | +├── scripts/ |
| 115 | +│ ├── sync-skills.js # Generate .claude/skills/ from docs/ |
| 116 | +│ └── generate-sidebar.js # Auto-generate sidebars.js from docs/ structure |
| 117 | +├── src/ |
| 118 | +│ ├── css/ |
| 119 | +│ │ └── custom.css # Custom styling |
| 120 | +│ └── pages/ |
| 121 | +│ └── index.js # Homepage redirect |
| 122 | +├── static/ |
| 123 | +│ └── img/ # Static assets (logos, favicon) |
| 124 | +├── docusaurus.config.js # Docusaurus configuration |
| 125 | +├── sidebars.js # Auto-generated sidebar (gitignored) |
| 126 | +└── package.json # Dependencies and scripts |
| 127 | +``` |
| 128 | + |
| 129 | +## Adding New Documentation |
| 130 | + |
| 131 | +### For All Documentation (Developers): |
| 132 | + |
| 133 | +1. **Create a new markdown file** in `docs/`: |
| 134 | + |
| 135 | + ```bash |
| 136 | + docs/deployment/github-actions.md |
| 137 | + ``` |
| 138 | + |
| 139 | +2. **Add frontmatter:** |
| 140 | + |
| 141 | + ```yaml |
| 142 | + --- |
| 143 | + title: GitHub Actions Deployment |
| 144 | + description: Guide for deploying FinishLine using GitHub Actions |
| 145 | + skill: false # This is docs-only, not a Claude skill |
| 146 | + --- |
| 147 | + ``` |
| 148 | + |
| 149 | +3. **Test it:** |
| 150 | + ```bash |
| 151 | + yarn docs:dev |
| 152 | + ``` |
| 153 | + |
| 154 | +The sidebar will be automatically generated from the folder structure! |
| 155 | + |
| 156 | +### For Documentation That Should Be a Claude Skill: |
| 157 | + |
| 158 | +1. **Create the markdown file** as above |
| 159 | + |
| 160 | +2. **Use `skill: true` in frontmatter:** |
| 161 | + |
| 162 | + ```yaml |
| 163 | + --- |
| 164 | + title: Backend Endpoints |
| 165 | + description: Guide for creating API endpoints |
| 166 | + skill: true |
| 167 | + skill_name: backend-endpoints # Maps to folder name in .claude/skills/ |
| 168 | + --- |
| 169 | + ``` |
| 170 | + |
| 171 | +3. **Sync to Claude:** |
| 172 | + ```bash |
| 173 | + yarn skills:sync |
| 174 | + ``` |
| 175 | + |
| 176 | +The sidebar will be automatically generated! |
| 177 | + |
| 178 | +### Organizing Documentation |
| 179 | + |
| 180 | +The sidebar navigation is **automatically generated** from the `docs/` folder structure: |
| 181 | + |
| 182 | +- **Reorder pages**: Rename files (alphabetical order is used) |
| 183 | +- **Create categories**: Create nested folders in `docs/` |
| 184 | +- **Change labels**: Folder names become category labels (use hyphens: `my-category`) |
| 185 | + |
| 186 | +The sidebar regenerates automatically when you run `yarn docs:dev` or `yarn docs:build`. |
| 187 | + |
| 188 | +You can also manually regenerate it: |
| 189 | + |
| 190 | +```bash |
| 191 | +yarn generate-sidebar |
| 192 | +``` |
| 193 | + |
| 194 | +## Frontmatter Fields |
| 195 | + |
| 196 | +All documentation files should have frontmatter: |
| 197 | + |
| 198 | +| Field | Required | Purpose | Example | |
| 199 | +| ------------- | ------------- | ------------------------------ | ---------------------------------- | |
| 200 | +| `title` | Yes | Page title | `Backend Endpoints` | |
| 201 | +| `description` | Yes | Page description | `Guide for creating API endpoints` | |
| 202 | +| `skill` | Yes | Should sync to Claude? | `true` or `false` | |
| 203 | +| `skill_name` | If skill:true | Folder name in .claude/skills/ | `backend-endpoints` | |
| 204 | + |
| 205 | +## Customization |
| 206 | + |
| 207 | +### Navbar and Footer |
| 208 | + |
| 209 | +Edit `docusaurus.config.js` to customize: |
| 210 | + |
| 211 | +- Site title and tagline |
| 212 | +- Navbar links |
| 213 | +- GitHub repository links |
| 214 | +- Production URL |
| 215 | + |
| 216 | +### Styling |
| 217 | + |
| 218 | +Edit `src/css/custom.css` to customize: |
| 219 | + |
| 220 | +- Primary colors (currently set to NER red: #ef4345) |
| 221 | +- Dark mode colors |
| 222 | +- Font sizes and spacing |
| 223 | +- Custom component styles |
| 224 | + |
| 225 | +### Sidebar Navigation |
| 226 | + |
| 227 | +The sidebar is **automatically generated** from the `docs/` folder structure. To customize it: |
| 228 | + |
| 229 | +- **Reorder pages**: Rename files (alphabetical sorting) |
| 230 | +- **Create categories**: Create nested folders in `docs/` |
| 231 | +- **Change labels**: Folder names become category labels (use hyphens: `my-category`) |
| 232 | + |
| 233 | +The sidebar regenerates each time you run `yarn docs:dev` or `yarn docs:build`. |
| 234 | + |
| 235 | +## Troubleshooting |
| 236 | + |
| 237 | +### Documentation not updating |
| 238 | + |
| 239 | +If your changes aren't appearing: |
| 240 | + |
| 241 | +1. Stop the dev server (Ctrl+C) |
| 242 | +2. Clear the cache: `yarn clear` |
| 243 | +3. Run `yarn docs:dev` again |
| 244 | + |
| 245 | +### Build errors |
| 246 | + |
| 247 | +Common issues: |
| 248 | + |
| 249 | +- **Node version**: Ensure you're running Node.js 18 or higher |
| 250 | +- **Dependencies**: From the root directory, try `rm -rf docs-site/node_modules && yarn install` |
| 251 | +- **Port conflict**: Docs run on port 3002. If it's in use, Docusaurus will try another port or you can stop the conflicting process |
| 252 | + |
| 253 | +### Skills not syncing |
| 254 | + |
| 255 | +If `yarn skills:sync` doesn't generate expected skills: |
| 256 | + |
| 257 | +- Verify the doc has `skill: true` in frontmatter |
| 258 | +- Verify `skill_name` is set for all docs with `skill: true` |
| 259 | +- Check the console output for warnings |
| 260 | +- Ensure `.claude/skills/` is gitignored (it will be regenerated) |
| 261 | + |
| 262 | +## Future Enhancements |
| 263 | + |
| 264 | +Potential improvements for future iterations: |
| 265 | + |
| 266 | +- **Public deployment**: Deploy to GitHub Pages or Vercel |
| 267 | +- **Search functionality**: Add DocSearch or local search plugin |
| 268 | +- **Versioning**: Support documentation for multiple FinishLine versions |
| 269 | +- **Interactive components**: Add live code examples or API explorers |
| 270 | +- **Automated sync**: Pre-commit hook to run skills:sync automatically |
| 271 | + |
| 272 | +## Contributing |
| 273 | + |
| 274 | +When contributing to the documentation: |
| 275 | + |
| 276 | +1. Edit markdown files in `docs-site/docs/` |
| 277 | +2. Test your changes locally with `yarn docs:dev` (sidebar auto-generates) |
| 278 | +3. If you edited a skill doc (`skill: true`), run `yarn skills:sync` |
| 279 | +4. Ensure the site builds successfully with `yarn docs:build` |
| 280 | +5. Submit a PR with your documentation changes |
| 281 | + |
| 282 | +## License |
| 283 | + |
| 284 | +This documentation is part of the FinishLine project, licensed under GNU AGPLv3. |
0 commit comments