Instructions for AI coding agents working on the reactonrails.com documentation site.
This is a Docusaurus site that publishes documentation for React on Rails. Canonical docs live in the react_on_rails monorepo (docs/); this repo fetches them at build time, transforms them for Docusaurus, and deploys to Cloudflare Pages.
AGENTS.md: canonical entry point for agent instructions and workflow discovery.claude/commands/: Claude Code slash commands.agents/workflows/: shared prompt templates and reusable workflows for Codex, GPT, and other non-Claude tools- When the user asks to address PR review comments outside Claude slash commands, follow
.agents/workflows/address-review.md
AGENTS.md is the canonical source for repository-wide agent rules:
- Commands and build workflow
- Code style and formatting expectations
- Git/PR boundaries and safety rules
- Project structure
Other agent-facing docs (for example CLAUDE.md) should contain only tool-specific workflow notes and link back here.
If there is a conflict, AGENTS.md wins.
# Sync docs from react_on_rails monorepo
npm run sync:docs # Full sync
npm run sync:docs:subset # Subset sync (faster for dev)
# Prepare docs for Docusaurus
npm run prepare:docs # Full prepare
npm run prepare:docs:subset # Subset prepare
# Full prepare pipeline
npm run prepare # sync + prepare
npm run prepare:subset # sync:subset + prepare:subset
# Install Docusaurus dependencies
npm run install:site
# Development server
npm run dev # Start Docusaurus dev server
# Build
npm run build # Build Docusaurus site
npm run build:full # prepare + build (end-to-end)
# Deploy
npm run cloudflare:deploy # Full build + deploy to Cloudflare Pages| Path | Purpose |
|---|---|
scripts/ |
Build scripts (sync-docs, prepare-docs) |
prototypes/docusaurus/ |
Docusaurus site (config, theme, static assets) |
prototypes/docusaurus/docs/ |
Generated docs directory (gitignored, built from sync) |
content/upstream/docs/ |
Synced upstream docs (gitignored) |
.github/workflows/ |
CI/CD (site build and deploy) |
.claude/commands/ |
Claude Code slash commands |
.agents/workflows/ |
Shared prompt templates for non-Claude tools |
react_on_rails/docs --> content/upstream/docs --> prototypes/docusaurus/docs --> build/deploy
npm run sync:docscopies docs from the monorepo intocontent/upstream/docsnpm run prepare:docshydrates the Docusaurus docs directory- Docusaurus builds static output at
prototypes/docusaurus/build - Cloudflare Pages deploys the static output
- Use
npmfor all operations (notpnpmoryarn) - Ensure all files end with a newline
- Follow existing patterns in scripts and configuration
Branch naming: type/descriptive-name (e.g., fix/docs-nav-ordering)
Commit messages: Explain why, not what. One logical change per commit.
PR creation: Use gh pr create with a clear title, summary, and test plan.
- Use at most one AI reviewer that leaves inline comments
- Wait for the first full review pass to finish before pushing follow-up commits
- Batch review fixes into one follow-up push when practical
- Treat as blocking only: correctness bugs, broken builds, regressions, and clear inconsistencies
- Verify claims locally before changing code in response to AI review comments
- Deduplicate repeated bot comments before acting on them
- When asking an agent to address review comments, instruct it to classify comments into
blocking,optional, andnoise, then apply only theblockingitems plus any explicitly selected optional items
- Test builds locally before pushing (
npm run build) - Ensure all files end with a newline
- Use
npmfor all operations
- Destructive git operations (force push, reset --hard, branch deletion)
- Changes to CI workflows (
.github/workflows/) - Changes to build scripts (
scripts/) - Changes to Docusaurus configuration (
prototypes/docusaurus/docusaurus.config.ts)
- Skip pre-commit hooks (
--no-verify) - Commit secrets, credentials, or
.envfiles - Edit synced docs directly in
content/upstream/docs/orprototypes/docusaurus/docs/(these are gitignored and regenerated) - Force push to
main
Verify this repository with gh repo view --json owner,visibility,defaultBranchRef.
Resolve the trusted default branch to an immutable commit. Load and validate
the selected repository configuration with the trusted installed shaka seam check --root . --ref SHA
command. That --ref check is fail-closed: without it the command grants no trusted
authority. Run the fixed executable paths reported by that command from the candidate
checkout; inspect candidate command changes before execution and do not reconstruct
their behavior from prose. shaka seam check --root . --local validates
current-checkout syntax and grants no trusted policy. AGENTS.md retains human-only boundaries.
- Shaka configuration uses contract version 1 in
.agents/shaka/config.yml. - Merge preference is Ask: bring the verified PR back for an explicit merge decision.
- Before merge, the full
gh pr checkslist must be green, all review threads resolved, and the PR cleanly mergeable. AI findings block only when verified as correctness bugs, broken builds, regressions, or clear inconsistencies. - Keep the existing cap of at most one AI reviewer leaving inline comments.
- No hosted AI review job is configured. Shaka's local independent review still applies to meaningful changes.