feat: add Grok Build native skills adapter (revive #561) - #661
Open
p-clements wants to merge 5 commits into
Open
feat: add Grok Build native skills adapter (revive #561)#661p-clements wants to merge 5 commits into
p-clements wants to merge 5 commits into
Conversation
Thin Grok packaging under .grok-plugin/ with root plugin.json path overrides (hooks + MCP). SessionStart/UserPromptSubmit/SubagentStart reuse shared hooks/ponytail-*.js; mode state under GROK_PLUGIN_DATA. Rebases the approach from DietrichGebert#561 onto current main: keep Qoder detection and output paths, add isGrok, export getGrokPluginDataDir, drop bash-only exec from Grok hooks, and document install/enable/uninstall on the front-page README (en/es/ko) plus agent-portability. Direct install works today: grok plugin install DietrichGebert/ponytail --trust Marketplace root source ("./") matches Claude; Grok's scanner still rejects it (see xai-org/plugin-marketplace#123 class of bugs). Co-authored-by: Vinícius Souza <souza.vinicius@bb.com.br>
Review feedback on DietrichGebert#661: - Remove MCP wiring (git install never installs ponytail-mcp deps; no other host ships MCP; hooks+skills cover always-on) - Drop static plugin-index.json (optional catalog fluff) - Clear GROK_PLUGIN_* in hooks.test.js so host suites cannot leak - Exclusive isGrok after Copilot/Codex; state falls back to ROOT not ~/.claude - Tighten Qoder regression assert; structural checks for plugin.json/hooks - List Grok Build among skill-capable hosts in README
Second review pass for DietrichGebert#661: - Delete .grok-plugin/hooks.json (near-copy of claude-codex-hooks.json). Root plugin.json points at the shared map; Grok sets CLAUDE_PLUGIN_ROOT. - Drop getGrokPluginDataDir; inline GROK_PLUGIN_DATA || ROOT like other hosts. - Grok uses Claude-compatible writeHookOutput (raw SessionStart, JSON SubagentStart) instead of a separate raw-only branch. - Slim .grok-plugin/marketplace.json to match .claude-plugin. - Tests: shared-map assert, SubagentStart JSON under Grok, Qoder isolation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Native Grok Build skill plugin, rebased from #561. It keeps that contribution's clean marketplace/plugin packaging and shared Ponytail skill content, while using Grok's supported native skill activation path.
Important behavior note
The original #561 hook-based approach was a reasonable Claude-compatible design, but it assumes that Grok consumes lifecycle-hook stdout as model context. Current xAI Grok Build documentation defines
SessionStart,UserPromptSubmit, andSubagentStartas passive events; onlyPreToolUseandStop/SubagentStophave output-control contracts. Passive hook stdout is informational and is not injected into the conversation. See xAI's Hook events and hook output contract.So #561's hooks could execute and persist mode state, but they could not deliver the intended Ponytail ruleset to the main session or subagents. This is a platform-contract mismatch, not a problem with the original contribution's packaging approach.
This PR therefore uses Grok's documented native skill mechanism: skill descriptions can trigger automatic invocation for matching coding tasks, while
/ponytailexplicitly loads Ponytail when deterministic activation is wanted. See xAI's Skills guide.Resulting Grok behavior
ponytailfor coding tasks from the existing skill description./ponytail,/ponytail lite,/ponytail full, and/ponytail ultramake activation explicit.Packaging
plugin.jsonis a minimal Grok manifest..grok-plugin/marketplace.jsonkeeps the repo marketplace entry.Validation
node --test tests/grok-plugin.test.js tests/hooks-windows.test.js tests/hooks.test.js tests/gemini-extension.test.jsnode scripts/check-rule-copies.jsnode scripts/check-versions.jsgrok plugin validate .GROK_HOMEinstall: 6 skills, 0 hooks.