|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Critical Rules |
| 6 | + |
| 7 | +These rules override all other instructions: |
| 8 | +1. **NEVER commit directly to main** - Always create a feature branch and submit a pull request |
| 9 | +2. **Conventional commits** - Format: `type(scope): description` |
| 10 | +3. **GitHub Issues for TODOs** - Use `gh` CLI to manage issues, no local TODO files. Use conventional commit format for issue titles |
| 11 | +4. **Pull Request titles** - Use conventional commit format (same as commits) |
| 12 | +5. **Branch naming** - Use format: `type/scope/short-description` (e.g., `feat/docs/new-guide`) |
| 13 | +6. **Working an issue** - Always create a new branch from an updated main branch |
| 14 | +7. **Check branch status before pushing** - Verify the remote tracking branch still exists. If a PR was merged/deleted, create a new branch from main instead |
| 15 | +8. **No co-authors** - Do not add co-author information on commits or pull requests |
| 16 | +9. **No "generated by" statements** - Do not add generated-by statements on pull requests |
| 17 | + |
| 18 | +## Overview |
| 19 | + |
| 20 | +This is the **official documentation website** for [rnr](https://github.com/CodingWithCalvin/rnr.cli), a cross-platform task runner with zero-setup execution. Built with Astro and deployed to Cloudflare Workers/Pages. |
| 21 | + |
| 22 | +## Tech Stack |
| 23 | + |
| 24 | +- **Framework**: Astro 5.x |
| 25 | +- **Styling**: Tailwind CSS 4.x with @theme CSS variables |
| 26 | +- **Content**: MDX for documentation pages |
| 27 | +- **Deployment**: Cloudflare Pages via Wrangler |
| 28 | +- **Primary Color**: Purple/Violet (#8B5CF6) |
| 29 | + |
| 30 | +## Build Commands |
| 31 | + |
| 32 | +| Command | Description | |
| 33 | +|---------|-------------| |
| 34 | +| `npm install` | Install dependencies | |
| 35 | +| `npm run dev` | Start development server | |
| 36 | +| `npm run build` | Build for production | |
| 37 | +| `npm run preview` | Preview production build | |
| 38 | + |
| 39 | +## Directory Structure |
| 40 | + |
| 41 | +``` |
| 42 | +rnrcli.io/ |
| 43 | +├── .github/workflows/ # CI/CD workflows |
| 44 | +│ ├── build.yml # PR build validation |
| 45 | +│ ├── deploy.yml # Production deployment |
| 46 | +│ └── commit-lint.yml # PR title validation |
| 47 | +├── src/ |
| 48 | +│ ├── components/ # Reusable UI components |
| 49 | +│ │ ├── Header.astro |
| 50 | +│ │ ├── Footer.astro |
| 51 | +│ │ └── CopyableCommand.astro |
| 52 | +│ ├── content/ |
| 53 | +│ │ └── docs/ # MDX documentation files |
| 54 | +│ │ ├── getting-started.mdx |
| 55 | +│ │ ├── tasks.mdx |
| 56 | +│ │ ├── commands.mdx |
| 57 | +│ │ ├── configuration.mdx |
| 58 | +│ │ └── examples.mdx |
| 59 | +│ ├── layouts/ # Page layouts |
| 60 | +│ │ ├── BaseLayout.astro |
| 61 | +│ │ └── DocLayout.astro |
| 62 | +│ ├── pages/ # Astro pages and routes |
| 63 | +│ │ ├── index.astro |
| 64 | +│ │ ├── features.astro |
| 65 | +│ │ └── docs/[...slug].astro |
| 66 | +│ └── styles/ # Global CSS with Tailwind |
| 67 | +│ └── global.css |
| 68 | +├── public/ # Static assets |
| 69 | +│ └── favicon.svg |
| 70 | +├── astro.config.mjs # Astro configuration |
| 71 | +├── package.json # Dependencies and scripts |
| 72 | +├── tsconfig.json # TypeScript configuration |
| 73 | +└── wrangler.toml # Cloudflare deployment config |
| 74 | +``` |
| 75 | + |
| 76 | +## Content Collections |
| 77 | + |
| 78 | +Documentation is managed via Astro Content Collections: |
| 79 | + |
| 80 | +- **Location**: `src/content/docs/` |
| 81 | +- **Format**: MDX files |
| 82 | +- **Schema fields**: |
| 83 | + - `title` (required): Page title |
| 84 | + - `description` (required): SEO description |
| 85 | + - `order` (optional): Sidebar sort order (default: 999) |
| 86 | + - `draft` (optional): Exclude from build (default: false) |
| 87 | + |
| 88 | +### Adding New Documentation |
| 89 | + |
| 90 | +1. Create a new `.mdx` file in `src/content/docs/` |
| 91 | +2. Add frontmatter with required fields: |
| 92 | + ```mdx |
| 93 | + --- |
| 94 | + title: Your Page Title |
| 95 | + description: Brief description for SEO |
| 96 | + order: 5 |
| 97 | + --- |
| 98 | + |
| 99 | + Your content here... |
| 100 | + ``` |
| 101 | +3. The page will automatically appear in the sidebar navigation |
| 102 | + |
| 103 | +### Documentation Pages |
| 104 | + |
| 105 | +| File | Order | Description | |
| 106 | +|------|-------|-------------| |
| 107 | +| `getting-started.mdx` | 1 | Installation and quick start | |
| 108 | +| `tasks.mdx` | 2 | Task definition syntax | |
| 109 | +| `commands.mdx` | 3 | CLI command reference | |
| 110 | +| `configuration.mdx` | 4 | Config files and structure | |
| 111 | +| `examples.mdx` | 5 | Real-world examples | |
| 112 | + |
| 113 | +## Styling Conventions |
| 114 | + |
| 115 | +- Uses Tailwind CSS 4 with `@theme` CSS variables |
| 116 | +- Primary color palette: `primary-50` through `primary-950` (purple/violet) |
| 117 | +- Dark theme by default with custom background colors |
| 118 | +- Component classes defined in `src/styles/global.css`: |
| 119 | + - `.btn`, `.btn-primary`, `.btn-secondary` |
| 120 | + - `.card` |
| 121 | + - `.nav-link`, `.sidebar-link` |
| 122 | + - `.prose` for documentation content |
| 123 | + - `.gradient-text`, `.gradient-bg` |
| 124 | + |
| 125 | +## CI/CD |
| 126 | + |
| 127 | +- **Build workflow**: Validates PRs by building the site |
| 128 | +- **Deploy workflow**: Deploys to Cloudflare on push to main |
| 129 | +- **Commit lint**: Validates PR titles follow conventional commit format |
| 130 | + |
| 131 | +### Required Secrets |
| 132 | + |
| 133 | +- `CLOUDFLARE_API_TOKEN`: API token for Cloudflare deployment |
| 134 | + |
| 135 | +## Related Repository |
| 136 | + |
| 137 | +The rnr CLI tool source code is at: https://github.com/CodingWithCalvin/rnr.cli |
| 138 | + |
| 139 | +When updating documentation, ensure it stays in sync with the CLI's actual behavior and features. |
| 140 | + |
| 141 | +## Conventional Commit Types |
| 142 | + |
| 143 | +| Type | Description | |
| 144 | +|------|-------------| |
| 145 | +| `feat` | New feature | |
| 146 | +| `fix` | Bug fix | |
| 147 | +| `docs` | Documentation changes | |
| 148 | +| `style` | Code style changes | |
| 149 | +| `refactor` | Code refactoring | |
| 150 | +| `perf` | Performance improvements | |
| 151 | +| `test` | Adding or updating tests | |
| 152 | +| `build` | Build system changes | |
| 153 | +| `ci` | CI/CD changes | |
| 154 | +| `chore` | Maintenance tasks | |
0 commit comments