feat: add Grok as a first-class Comet platform - #309
Conversation
There was a problem hiding this comment.
Sorry @mouyase, your pull request is larger than the review limit of 150000 diff characters
Reviewer's GuideAdds Grok as a first-class Comet platform by registering it in the platform table, wiring its hook paths and matcher into the installer/inspector and hook adapter, mapping Grok to Codex’s shared .agents Skills and Superpowers agent, and updating tests and docs to reflect the new platform and version bump to 0.4.0-beta.19. Sequence diagram for Grok hook installation with matcher resolutionsequenceDiagram
participant CometInstaller
participant ClaudeCodeHooks
participant GrokPlatform
CometInstaller->>GrokPlatform: installClaudeCodeHooks(context.platformId=grok)
GrokPlatform->>ClaudeCodeHooks: buildHookCommand(baseDir,skillsDir,scriptRelPath,context)
ClaudeCodeHooks->>ClaudeCodeHooks: resolveClaudeCodeHookMatcher(platformId,config.matcher)
ClaudeCodeHooks->>ClaudeCodeHooks: group commands by matcher
ClaudeCodeHooks-->>GrokPlatform: write hooks to .grok/hooks/comet.json
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (21)
🚧 Files skipped from review as they are similar to previous changes (15)
Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review. 📝 WalkthroughWalkthroughGrok becomes the 35th supported platform. The change adds Grok paths, detection, skills, rules, hooks, OpenSpec integration, tool matching, release metadata, documentation, generated assets, and tests. ChangesGrok platform support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR adds Grok platform support without any actionable merge-blocking risk remaining; it is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Grok
participant HookAdapter
participant PlatformInstall
participant PlatformInspect
Grok->>HookAdapter: send write or search_replace event
HookAdapter->>PlatformInstall: normalize tool and target
PlatformInstall->>PlatformInspect: install resolved hook matcher
PlatformInspect-->>Grok: recognize managed hook
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
|
Please first sync with the latest version of the |
Install Grok Skills into the shared .agents root, keep rules and the Hook Router under .grok, and recognize Grok's native write/search_replace tools.
4883bba to
92d402a
Compare
|
Rebased onto latest
|
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
✨ Summary
Add Grok as a first-class Comet host so
comet init --platform grokinstalls Skills, the phase-guard Rule, and a Hook Router that Grok actually loads.Grok scans
.agents/skillsnatively, but its project hooks live under.grok/hooks/*.jsonand its native write tool iswrite(not Claude'sWrite). Without this platform,comet init --platform grokeither duplicates Skills or writes hooks to a file Grok never reads, and--platform grokis rejected by the Router.🎯 Scope
init,status,doctor,update)assets/skills/comet/scripts/)What this does
grokinPLATFORMS: project Skills share Codex's.agentsroot; rules go to.grok/rules/; hooks go to.grok/hooks/comet.json.grokto the Hook Router allowlist and treats Grok'swrite/search_replacepayloads as writes.Write|Edit|write|search_replaceso Grok's nativewritetool cannot bypass the phase guard..agentsagent so Grok-only Classic installs still get Superpowers.codextool id so Classic OpenSpec skills land in.agents.🧪 Testing
pnpm buildpnpm lintpnpm run lint:architecturepnpm format:checkpnpm test— full suite was also run; remaining failures were/varvs/private/varand linked-worktree leakage from running inside a git worktree, unrelated to this platformpnpm test -- test/domains/comet-classic/comet-scripts.test.ts✅ Checklist
README.md/README-zh.mdCHANGELOG.mdis updated0.4.0-beta.19(one step ahead of0.4.0-beta.18on master)👀 Notes for Reviewers
Grok is Claude-hook compatible (
exit 2+ stderr deny). The only Grok-specific hook difference is the matcher and the.grok/hooks/comet.jsonpath. Skills are intentionally not copied into.grok/skills/so a repo that already has Codex /.agentsdoes not get a second Comet Skill tree.Summary by Sourcery
Add Grok as a first-class Comet platform, wiring its skills, rules, and hooks into the CLI, router, and Native runtime, and updating docs, tests, and version metadata accordingly.
New Features:
Enhancements:
Build:
Documentation:
Tests:
Summary by CodeRabbit
writeandsearch_replace..agents/Project Skills compatibility with Codex.