feat: integrate ritus frontend - #41
Conversation
WalkthroughThe change adds companion manifest discovery and session-context injection, configures the session-start hook, documents companion integrations, registers the frontend marketplace plugin, and updates the plugin version to ChangesCompanion plugin integration
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/COMPANION_PLUGINS.md`:
- Around line 19-20: Update the requirements text in COMPANION_PLUGINS.md to
state that the registry refreshes for every configured SessionStart lifecycle
event, rather than only on a new session. Preserve the existing Bun PATH
requirement and hook-at-session-start context.
- Around line 38-43: Update the integrations field description in the manifest
schema table to state that it must be a nonempty array containing at least one
entry, matching the validation enforced by validateManifest.
In `@scripts/companion-bootstrap.ts`:
- Around line 93-103: Update the directory traversal around the marketplace and
plugin `readdirSync` calls to catch read errors independently for each
directory, including failures after `isDirectory()` succeeds. Continue scanning
remaining marketplace and plugin directories when a read fails, while preserving
the existing manifest limit checks and registry emission.
- Around line 127-129: Update the manifest discovery flow around
addManifestInDir to remove the cwd lookup and retain only projectRoot,
preserving projectRoot’s existing fallback to cwd when CLAUDE_PROJECT_DIR is
unset.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 6b643d12-ebc1-4846-854a-ed00a3a802e5
📒 Files selected for processing (5)
.claude-plugin/marketplace.json.github/plugin/plugin.jsondocs/COMPANION_PLUGINS.mdhooks/hooks.jsonscripts/companion-bootstrap.ts
💤 Files with no reviewable changes (1)
- .github/plugin/plugin.json
There was a problem hiding this comment.
Pull request overview
This PR adds a “companion plugin” mechanism to Ritus by discovering ritus-companion.json manifests at session start and injecting a consolidated “Ritus Companion Registry” into the agent’s context, and it registers the ritus-frontend plugin in the Claude marketplace config.
Changes:
- Added a Bun-based SessionStart bootstrap script to discover and load companion manifests and format a registry context block.
- Added a Claude hooks configuration to run the bootstrap at session start.
- Added documentation for authoring/discovering companion manifests, and registered
ritus-frontendin.claude-plugin/marketplace.json(while removing the legacy.github/plugin/plugin.json).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/companion-bootstrap.ts | Discovers/validates companion manifests and injects a formatted registry into session context. |
| hooks/hooks.json | Runs the bootstrap script on SessionStart hook events. |
| docs/COMPANION_PLUGINS.md | Documents companion manifest format, discovery rules, and usage examples. |
| .github/plugin/plugin.json | Removed legacy plugin manifest file. |
| .claude-plugin/marketplace.json | Adds ritus-frontend plugin entry to the marketplace list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- companion-bootstrap: add readDirSafe() so an unreadable or removed plugin sibling dir no longer aborts registry discovery - companion-bootstrap: restrict discovery to the project root, dropping the extra cwd scan that allowed nested-subdir manifest injection - companion-bootstrap: print manifest names only, pruning absolute paths from the injected registry (and the now-unused LoadedCompanion.path field) - docs(COMPANION_PLUGINS): note the registry refreshes on each configured SessionStart event; mark integrations as a nonempty array - marketplace: bump ritus to 2.1.0
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.claude-plugin/marketplace.json (1)
16-23: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winUse one canonical
ritus-frontendmanifest in the release.
.claude-plugin/marketplace.jsonpointsritus-frontendtomain, whilemarketplace.jsonpoints the same plugin and version tofeat/ritus-frontend-plugin. If both manifests are part of the same release, use the same release ref so consumers do not install different plugin revisions for the same version.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude-plugin/marketplace.json around lines 16 - 23, Align the ritus-frontend source ref in both marketplace manifests: update .claude-plugin/marketplace.json at lines 16-23 and marketplace.json at lines 18-25 to use the same release ref, specifically feat/ritus-frontend-plugin, while keeping the plugin name and version unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.claude-plugin/marketplace.json:
- Around line 16-23: Align the ritus-frontend source ref in both marketplace
manifests: update .claude-plugin/marketplace.json at lines 16-23 and
marketplace.json at lines 18-25 to use the same release ref, specifically
feat/ritus-frontend-plugin, while keeping the plugin name and version unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 60b99e34-bf2d-4648-8a03-520545704e4a
📒 Files selected for processing (6)
.claude-plugin/marketplace.json.claude-plugin/plugin.jsondocs/COMPANION_PLUGINS.mdmarketplace.jsonpackage.jsonscripts/companion-bootstrap.ts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (2)
hooks/hooks.json:10
hooks.jsonhardcodes${CLAUDE_PLUGIN_ROOT}for locating the bootstrap script, but the rest of the repo treats GitHub Copilot as providingPLUGIN_ROOT(seeskills/setup/SKILL.md:447-448andscripts/companion-bootstrap.ts:128). In environments where onlyPLUGIN_ROOTis set, this hook will fail to find the script and the companion registry will never load.
"command": "bun \"${CLAUDE_PLUGIN_ROOT}/scripts/companion-bootstrap.ts\"",
scripts/companion-bootstrap.ts:129
pluginRootdiscovery relies only on environment variables. If this script is invoked in a context where neitherCLAUDE_PLUGIN_ROOTnorPLUGIN_ROOTis set (e.g. manual debugging, or a hook runner that doesn't export them), companion plugin discovery will be silently skipped. Since the script itself lives under<pluginRoot>/scripts/, it can fall back to the parent directory ofimport.meta.dirname.
const projectRoot = process.env.CLAUDE_PROJECT_DIR || cwd;
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT || process.env.PLUGIN_ROOT;
No description provided.