Skip to content

docs: add RoR-specific competitive landscape and template refs#2869

Merged
justin808 merged 1 commit intomainfrom
jg/fix-pr-review-agents
Mar 28, 2026
Merged

docs: add RoR-specific competitive landscape and template refs#2869
justin808 merged 1 commit intomainfrom
jg/fix-pr-review-agents

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Mar 27, 2026

Summary

  • Adds .claude/docs/docs-competitive-landscape.md with React on Rails competitor analysis (Inertia Rails, Vite Ruby, react-rails, Hotwire) and documentation improvement targets
  • Adds .claude/docs/docs-templates.md with RoR-specific template examples (README Hello World with react_component, API reference, config reference, troubleshooting)
  • Updates CLAUDE.md to reference both new docs files

This is the react_on_rails side of moving project-specific content out of the shared claude-code-commands-skills-agents repo.

Addresses shakacode/claude-code-commands-skills-agents#19
Addresses shakacode/claude-code-commands-skills-agents#20

Test plan

  • Files contain only React on Rails-specific content (no Shakapacker sections)
  • CLAUDE.md references both new files
  • Pre-commit hooks pass (prettier, trailing newlines)

🤖 Generated with Claude Code


Note

Low Risk
Low risk: documentation-only additions plus a reference update in CLAUDE.md, with no runtime or build changes.

Overview
Adds two new Claude guidance docs: a competitive documentation landscape (.claude/docs/docs-competitive-landscape.md) summarizing key competitors and doc gaps to target, and project-specific documentation templates (.claude/docs/docs-templates.md) with canonical React on Rails examples for README/API/config/troubleshooting sections.

Updates CLAUDE.md to include these new docs in the recommended reading list.

Written by Cursor Bugbot for commit 2848581. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Documentation
    • Updated internal documentation framework with enhanced guidance covering implementation patterns, configuration references, and troubleshooting examples for React on Rails projects.

Move React on Rails-specific content from the shared
claude-code-commands-skills-agents repo into project-local
.claude/docs/ files:

- docs-competitive-landscape.md: competitor analysis (Inertia Rails,
  Vite Ruby, react-rails, Hotwire) and documentation improvement targets
- docs-templates.md: RoR-specific README, API, config, and
  troubleshooting template examples using react_component helper

Addresses the react_on_rails side of:
- shakacode/claude-code-commands-skills-agents#19
- shakacode/claude-code-commands-skills-agents#20

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 27, 2026

Walkthrough

Three documentation files are added to support React on Rails development: a competitive landscape analysis comparing docs across similar projects, a templates file with copy-ready documentation examples and patterns, and a link update to reference these new docs.

Changes

Cohort / File(s) Summary
Documentation Files
.claude/docs/docs-competitive-landscape.md, .claude/docs/docs-templates.md
New documentation files: competitive landscape analysis of similar projects and their doc structures, plus reusable templates with React on Rails examples (component helpers, configuration, troubleshooting, environment variables, requirements checklist).
Documentation Reference
CLAUDE.md
Added links to the two new documentation files in the Claude-oriented guidance section.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hopping through docs with care and delight,
New templates and landscape shine bright!
Rails and React in harmony blend,
Good docs help developers transcend. 📚✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding React on Rails-specific competitive landscape documentation and template references to the repository.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jg/fix-pr-review-agents

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

When documenting API methods, use `react_component` as the canonical example:

```ruby
method_name(component_name, options = {}) -> String
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placeholder method_name was not replaced with the actual method name. Based on the surrounding context ("use react_component as the canonical example"), this should be:

Suggested change
method_name(component_name, options = {}) -> String
react_component(component_name, options = {}) -> String

**Common causes:**

1. Component not registered — call `ReactOnRails.register({ MyComponent })` in your entry file
2. Entry file not included in the page — check `javascript_pack_tag` or Shakapacker configuration
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This troubleshooting step only covers Shakapacker/Webpacker users. Since the Requirements section below lists "Shakapacker >= 6.0 (or Rspack)" and the competitive landscape doc highlights Rspack support as a key differentiator, this should mention both bundlers to avoid confusing users on non-Shakapacker setups:

Suggested change
2. Entry file not included in the page — check `javascript_pack_tag` or Shakapacker configuration
2. Entry file not included in the page — check `javascript_pack_tag` (Shakapacker) or your Rspack/Vite entry point configuration

- Wiki with community-contributed articles
- No dedicated docs site
- Outdated examples in some areas
- Migration guide to React on Rails exists (this is an opportunity)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ambiguous — it could mean either (a) a migration guide already exists and that's an advantage, or (b) there's an opportunity to create one because react-rails users need a migration path. Intent appears to be the latter. Consider clarifying:

Suggested change
- Migration guide to React on Rails exists (this is an opportunity)
- No migration guide from react-rails to React on Rails exists yet — creating one is an opportunity to capture those users

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 27, 2026

Review: docs-only additions

Overall this is a clean, well-scoped addition. The competitive landscape analysis is genuinely useful context for Claude when working on documentation, and the templates give concrete React on Rails-specific examples that fill a real gap. Three issues to address before merging:

Bug (must fix)

  • .claude/docs/docs-templates.md line 30: The API reference signature uses the placeholder method_name instead of react_component. See inline comment.

Clarity (should fix)

  • .claude/docs/docs-competitive-landscape.md line 52: The react-rails migration guide comment is ambiguous about whether one exists or needs to be created. See inline comment.

Consistency (should fix)

  • .claude/docs/docs-templates.md line 111: Troubleshooting step only references Shakapacker/Webpacker. Given that the same file's Requirements section lists Rspack as an alternative, and the competitive landscape doc highlights Rspack as a key strength, this should mention both bundler paths. See inline comment.

Minor observation

  • The troubleshooting code block at lines 115-121 uses app/javascript/packs/application.js — the packs/ directory is Webpacker/Shakapacker-specific. For Rspack users the entry point path will differ. Worth a brief note or generalizing the path.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 27, 2026

Greptile Summary

This PR adds two new AI-agent guidance documents to .claude/docs/ and wires them into CLAUDE.md. The additions bring React on Rails-specific documentation strategy context (competitor analysis and doc templates) out of a shared repo and into this one, making them available to Claude Code when working on the project's documentation.

  • .claude/docs/docs-competitive-landscape.md — solid, well-researched breakdown of Inertia Rails, Vite Ruby, react-rails, and Hotwire doc structures, plus a prioritised improvement checklist; no issues found
  • .claude/docs/docs-templates.md — useful RoR-specific code samples for README, API reference, config reference, and troubleshooting sections; two minor template issues: method_name placeholder should be react_component in the API reference signature, and the SSR troubleshooting snippet defines isBrowser but never uses it, which will confuse readers who copy the pattern
  • CLAUDE.md — cleanly appends both new file paths to the existing Claude-Specific Workflow list

Confidence Score: 5/5

Safe to merge — documentation-only changes with no impact on runtime behaviour.

All three changed files are documentation/guidance files consumed only by AI agents. The two style-level issues in docs-templates.md (a method-name placeholder and an unused variable in a snippet) do not affect the product or CI, and can be addressed in a follow-up.

.claude/docs/docs-templates.md has two minor template polish issues worth addressing, but neither blocks merge.

Important Files Changed

Filename Overview
.claude/docs/docs-competitive-landscape.md New file documenting competitor doc-site structures and a prioritised list of improvements for React on Rails docs; content is accurate and well-structured with no issues found.
.claude/docs/docs-templates.md New template reference for RoR-specific doc examples; two minor template issues: method_name placeholder should be react_component, and an unused isBrowser variable in the SSR troubleshooting snippet.
CLAUDE.md Two new doc-file references appended to the Claude-Specific Workflow list; change is correct and consistent with the existing format.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    CLAUDE["CLAUDE.md\n(entry point for Claude Code)"]
    CL["docs-competitive-landscape.md\nCompetitor analysis &\nimprovement targets"]
    CT["docs-templates.md\nRoR-specific code samples\n(README, API ref, config, troubleshooting)"]
    OTHER["Other .claude/docs/ files\n(architecture, CI, testing…)"]

    CLAUDE -->|references| CL
    CLAUDE -->|references| CT
    CLAUDE -->|references| OTHER

    CL -->|informs| DOCS_WORK["AI agent doc-writing tasks"]
    CT -->|informs| DOCS_WORK
Loading

Reviews (1): Last reviewed commit: "docs: add RoR-specific competitive lands..." | Re-trigger Greptile


## API Reference Entry Example

When documenting API methods, use `react_component` as the canonical example:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Placeholder method_name inconsistent with stated intent

The prose above this code block says "use react_component as the canonical example", but the signature itself uses the generic placeholder method_name. Any AI agent consuming this template will copy the placeholder rather than the actual helper name.

Suggested change
When documenting API methods, use `react_component` as the canonical example:
react_component(component_name, options = {}) -> String

Comment on lines +119 to +125

ReactOnRails.register({ MyComponent });
```

### SSR fails with "ReferenceError: window is not defined"

**Cause:** Component or dependency accesses browser APIs during the initial render pass, which runs in Node/ExecJS where those globals do not exist.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 isBrowser declared but never used in the snippet

The variable isBrowser is defined on the first line but then the example immediately jumps to a useEffect block without referencing it. A developer reading this will likely copy both lines and end up with a lint warning (no-unused-vars), or worse, assume isBrowser is automatically applied inside the effect. Either use it in the example or remove the declaration and rely solely on the useEffect guard:

Suggested change
ReactOnRails.register({ MyComponent });
```
### SSR fails with "ReferenceError: window is not defined"
**Cause:** Component or dependency accesses browser APIs during the initial render pass, which runs in Node/ExecJS where those globals do not exist.
useEffect(() => {
// window is always defined here — useEffect only runs in the browser
const width = window.innerWidth;
}, []);

Or, if the intent is to show the isBrowser guard pattern separately, add a usage:

const isBrowser = typeof window !== 'undefined';

if (isBrowser) {
  // Safe to access window APIs outside React lifecycle
}

useEffect(() => {
  // Also safe here — only runs in browser
}, []);

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.claude/docs/docs-competitive-landscape.md (1)

62-73: Consider adding a “Last reviewed on” date for the competitive checklist.

This section will age quickly; a date marker helps future updates prioritize stale assumptions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/docs/docs-competitive-landscape.md around lines 62 - 73, Add a "Last
reviewed on" date string at the top of the competitive checklist section that
begins with "Based on competitive analysis, the minimum viable docs
improvement:" (in docs-competitive-landscape.md) so readers can see staleness;
insert a single-line timestamp such as "Last reviewed on: YYYY-MM-DD"
immediately above or below that header, use ISO date format, and ensure the date
is updated whenever that checklist is edited.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/docs/docs-templates.md:
- Around line 27-31: Update the example API signature to use the actual helper
name instead of a generic placeholder: replace the line using
method_name(component_name, options = {}) -> String with the canonical helper
signature react_component(component_name, options = {}) -> String so readers can
copy/paste the real method name; ensure the parameter names and return type
remain unchanged.

---

Nitpick comments:
In @.claude/docs/docs-competitive-landscape.md:
- Around line 62-73: Add a "Last reviewed on" date string at the top of the
competitive checklist section that begins with "Based on competitive analysis,
the minimum viable docs improvement:" (in docs-competitive-landscape.md) so
readers can see staleness; insert a single-line timestamp such as "Last reviewed
on: YYYY-MM-DD" immediately above or below that header, use ISO date format, and
ensure the date is updated whenever that checklist is edited.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: af81773d-80d6-47e8-8d40-7c8f0d892db6

📥 Commits

Reviewing files that changed from the base of the PR and between 65dcf20 and 2848581.

📒 Files selected for processing (3)
  • .claude/docs/docs-competitive-landscape.md
  • .claude/docs/docs-templates.md
  • CLAUDE.md

Comment on lines +27 to +31
When documenting API methods, use `react_component` as the canonical example:

```ruby
method_name(component_name, options = {}) -> String
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use the actual helper name in the API signature example.

method_name(component_name, options = {}) is a generic placeholder and can mislead copy/paste. Since this section declares react_component as canonical, show that exact signature.

✏️ Proposed doc fix
- method_name(component_name, options = {}) -> String
+ react_component(component_name, options = {}) -> String
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
When documenting API methods, use `react_component` as the canonical example:
```ruby
method_name(component_name, options = {}) -> String
```
When documenting API methods, use `react_component` as the canonical example:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/docs/docs-templates.md around lines 27 - 31, Update the example API
signature to use the actual helper name instead of a generic placeholder:
replace the line using method_name(component_name, options = {}) -> String with
the canonical helper signature react_component(component_name, options = {}) ->
String so readers can copy/paste the real method name; ensure the parameter
names and return type remain unchanged.

@justin808 justin808 merged commit 1d6b1fe into main Mar 28, 2026
20 checks passed
@justin808 justin808 deleted the jg/fix-pr-review-agents branch March 28, 2026 08:32
justin808 added a commit that referenced this pull request Mar 28, 2026
## Summary

- Adds `.claude/docs/docs-competitive-landscape.md` with React on Rails
competitor analysis (Inertia Rails, Vite Ruby, react-rails, Hotwire) and
documentation improvement targets
- Adds `.claude/docs/docs-templates.md` with RoR-specific template
examples (README Hello World with `react_component`, API reference,
config reference, troubleshooting)
- Updates `CLAUDE.md` to reference both new docs files

This is the react_on_rails side of moving project-specific content out
of the shared `claude-code-commands-skills-agents` repo.

Addresses
shakacode/claude-code-commands-skills-agents#19
Addresses
shakacode/claude-code-commands-skills-agents#20

## Test plan

- [x] Files contain only React on Rails-specific content (no Shakapacker
sections)
- [x] CLAUDE.md references both new files
- [x] Pre-commit hooks pass (prettier, trailing newlines)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: documentation-only additions plus a reference update in
`CLAUDE.md`, with no runtime or build changes.
> 
> **Overview**
> Adds two new Claude guidance docs: a **competitive documentation
landscape** (`.claude/docs/docs-competitive-landscape.md`) summarizing
key competitors and doc gaps to target, and **project-specific
documentation templates** (`.claude/docs/docs-templates.md`) with
canonical React on Rails examples for README/API/config/troubleshooting
sections.
> 
> Updates `CLAUDE.md` to include these new docs in the recommended
reading list.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2848581. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Updated internal documentation framework with enhanced guidance
covering implementation patterns, configuration references, and
troubleshooting examples for React on Rails projects.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
justin808 added a commit that referenced this pull request Mar 28, 2026
…ew-fixes

* origin/main:
  Remove dependency on internal TanStack Router router.ssr flag (#2833)
  Revert "Eliminate double JSON.stringify in RSC payload embedding (#2835)" (#2878)
  Eliminate double JSON.stringify in RSC payload embedding (#2835)
  docs: align Pro references with canonical docs routes (#2866)
  docs: make Pro route entry points explicit (#2867)
  Bump fastify from 5.8.1 to 5.8.3 in the npm-security group across 1 directory (#2846)
  docs: add RoR-specific competitive landscape and template refs (#2869)
  Clarify streaming narrative in RSC docs (#2813) (#2814)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant