Skip to content

Latest commit

 

History

History
154 lines (124 loc) · 5.43 KB

File metadata and controls

154 lines (124 loc) · 5.43 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Critical Rules

These rules override all other instructions:

  1. NEVER commit directly to main - Always create a feature branch and submit a pull request
  2. Conventional commits - Format: type(scope): description
  3. GitHub Issues for TODOs - Use gh CLI to manage issues, no local TODO files. Use conventional commit format for issue titles
  4. Pull Request titles - Use conventional commit format (same as commits)
  5. Branch naming - Use format: type/scope/short-description (e.g., feat/docs/new-guide)
  6. Working an issue - Always create a new branch from an updated main branch
  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
  8. No co-authors - Do not add co-author information on commits or pull requests
  9. No "generated by" statements - Do not add generated-by statements on pull requests

Overview

This is the official documentation website for rnr, a cross-platform task runner with zero-setup execution. Built with Astro and deployed to Cloudflare Workers/Pages.

Tech Stack

  • Framework: Astro 5.x
  • Styling: Tailwind CSS 4.x with @theme CSS variables
  • Content: MDX for documentation pages
  • Deployment: Cloudflare Pages via Wrangler
  • Primary Color: Purple/Violet (#8B5CF6)

Build Commands

Command Description
npm install Install dependencies
npm run dev Start development server
npm run build Build for production
npm run preview Preview production build

Directory Structure

rnrcli.io/
├── .github/workflows/    # CI/CD workflows
│   ├── build.yml         # PR build validation
│   ├── deploy.yml        # Production deployment
│   └── commit-lint.yml   # PR title validation
├── src/
│   ├── components/       # Reusable UI components
│   │   ├── Header.astro
│   │   ├── Footer.astro
│   │   └── CopyableCommand.astro
│   ├── content/
│   │   └── docs/         # MDX documentation files
│   │       ├── getting-started.mdx
│   │       ├── tasks.mdx
│   │       ├── commands.mdx
│   │       ├── configuration.mdx
│   │       └── examples.mdx
│   ├── layouts/          # Page layouts
│   │   ├── BaseLayout.astro
│   │   └── DocLayout.astro
│   ├── pages/            # Astro pages and routes
│   │   ├── index.astro
│   │   ├── features.astro
│   │   └── docs/[...slug].astro
│   └── styles/           # Global CSS with Tailwind
│       └── global.css
├── public/               # Static assets
│   └── favicon.svg
├── astro.config.mjs      # Astro configuration
├── package.json          # Dependencies and scripts
├── tsconfig.json         # TypeScript configuration
└── wrangler.toml         # Cloudflare deployment config

Content Collections

Documentation is managed via Astro Content Collections:

  • Location: src/content/docs/
  • Format: MDX files
  • Schema fields:
    • title (required): Page title
    • description (required): SEO description
    • order (optional): Sidebar sort order (default: 999)
    • draft (optional): Exclude from build (default: false)

Adding New Documentation

  1. Create a new .mdx file in src/content/docs/
  2. Add frontmatter with required fields:
    ---
    title: Your Page Title
    description: Brief description for SEO
    order: 5
    ---
    
    Your content here...
  3. The page will automatically appear in the sidebar navigation

Documentation Pages

File Order Description
getting-started.mdx 1 Installation and quick start
tasks.mdx 2 Task definition syntax
commands.mdx 3 CLI command reference
configuration.mdx 4 Config files and structure
examples.mdx 5 Real-world examples

Styling Conventions

  • Uses Tailwind CSS 4 with @theme CSS variables
  • Primary color palette: primary-50 through primary-950 (purple/violet)
  • Dark theme by default with custom background colors
  • Component classes defined in src/styles/global.css:
    • .btn, .btn-primary, .btn-secondary
    • .card
    • .nav-link, .sidebar-link
    • .prose for documentation content
    • .gradient-text, .gradient-bg

CI/CD

  • Build workflow: Validates PRs by building the site
  • Deploy workflow: Deploys to Cloudflare on push to main
  • Commit lint: Validates PR titles follow conventional commit format

Required Secrets

  • CLOUDFLARE_API_TOKEN: API token for Cloudflare deployment

Related Repository

The rnr CLI tool source code is at: https://github.com/CodingWithCalvin/rnr.cli

When updating documentation, ensure it stays in sync with the CLI's actual behavior and features.

Conventional Commit Types

Type Description
feat New feature
fix Bug fix
docs Documentation changes
style Code style changes
refactor Code refactoring
perf Performance improvements
test Adding or updating tests
build Build system changes
ci CI/CD changes
chore Maintenance tasks