Skip to content

Commit c4cc569

Browse files
committed
feat: add Grok as a first-class Comet platform
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.
1 parent 2ff42ff commit c4cc569

19 files changed

Lines changed: 126 additions & 17 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to @rpamis/comet will be documented in this file.
44

5+
## What's Changed [0.4.0-beta.20] - 2026-08-15
6+
7+
### Added
8+
9+
- **Grok platform support**: `comet init`, `comet update`, `comet doctor`, and `comet uninstall` now treat Grok as a first-class host. Project Skills share the `.agents` root with Codex, while rules and the Hook Router live under `.grok/rules/` and `.grok/hooks/comet.json`. The Router recognizes `--platform grok` and matches Grok's native `write` / `search_replace` tools.
10+
511
## What's Changed [0.4.0-beta.19] - 2026-08-15
612

713
### Changed

README-zh.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ comet eval ./my-skill --suite langsmith --html
439439

440440
## 支持平台
441441

442-
`comet init` 支持 34 个 AI 编码平台:
442+
`comet init` 支持 35 个 AI 编码平台:
443443

444444
<details>
445445
<summary>查看完整平台列表</summary>
@@ -463,6 +463,7 @@ comet eval ./my-skill --suite langsmith --html
463463
| ForgeCode | `.forge/` | Trae | `.trae/` |
464464
| Trae CN | `.trae-cn/` | ZCode | `.zcode/` |
465465
| MimoCode | `.mimocode/` | CoStrict | `.cospec/` |
466+
| Grok | `.agents/` | | |
466467

467468
</details>
468469

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ does not expand the backend command list; see the [Skill creation guide](docs/op
468468

469469
## Supported Platforms
470470

471-
`comet init` supports 34 AI coding platforms:
471+
`comet init` supports 35 AI coding platforms:
472472

473473
<details>
474474
<summary>View full platform list</summary>
@@ -492,6 +492,7 @@ does not expand the backend command list; see the [Skill creation guide](docs/op
492492
| ForgeCode | `.forge/` | Trae | `.trae/` |
493493
| Trae CN | `.trae-cn/` | ZCode | `.zcode/` |
494494
| MimoCode | `.mimocode/` | CoStrict | `.cospec/` |
495+
| Grok | `.agents/` | | |
495496

496497
</details>
497498

assets/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.4.0-beta.19",
2+
"version": "0.4.0-beta.20",
33
"skills": [
44
"comet/SKILL.md",
55
"comet/agents/openai.yaml",

domains/comet-entry/hook-adapter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const WRITE_TOOL_NAMES = new Set([
1111
'edit',
1212
'editfile',
1313
'patch',
14+
'searchreplace',
1415
'strreplaceeditor',
1516
'write',
1617
'writefile',
@@ -46,6 +47,7 @@ export const COMET_HOOK_PLATFORM_IDS = new Set([
4647
'qoder',
4748
'trae',
4849
'trae-cn',
50+
'grok',
4951
]);
5052

5153
function isRecord(value: unknown): value is Record<string, unknown> {

domains/integrations/superpowers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const SKILLS_AGENT_MAP: Record<string, string | null> = {
1818
continue: 'continue',
1919
'github-copilot': 'github-copilot',
2020
gemini: 'gemini-cli',
21+
// Grok reads Superpowers from the shared .agents root that Codex owns.
22+
grok: 'codex',
2123
'amazon-q': 'universal',
2224
qwen: 'qwen-code',
2325
kilocode: 'kilo',

domains/skill/platform-inspect.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
computeRuleDestPath,
1313
isManagedHookCommand,
1414
readManifest,
15+
resolveClaudeCodeHookMatcher,
1516
} from './platform-install.js';
1617
import { readJsonObjectFile } from './json-object.js';
1718
import type { InitWorkflowSelection } from '../comet-entry/types.js';
@@ -392,14 +393,20 @@ export async function inspectCometHooksForPlatform(
392393
path.join(platformBase, platform.hookConfigFile ?? 'settings.local.json'),
393394
expectedHooks,
394395
(config) => collectGroupedCommands(config, 'PreToolUse'),
395-
(config, expected) => countGroupedHookMatches(config, 'PreToolUse', expected),
396+
(config, expected) =>
397+
countGroupedHookMatches(config, 'PreToolUse', expected, (matcher) =>
398+
resolveClaudeCodeHookMatcher(platform.id, matcher),
399+
),
396400
);
397401
for (const legacyFile of platform.legacyHookConfigFiles ?? []) {
398402
const legacy = await inspectSingleHookJson(
399403
path.join(platformBase, legacyFile),
400404
expectedHooks,
401405
(config) => collectGroupedCommands(config, 'PreToolUse'),
402-
(config, expected) => countGroupedHookMatches(config, 'PreToolUse', expected),
406+
(config, expected) =>
407+
countGroupedHookMatches(config, 'PreToolUse', expected, (matcher) =>
408+
resolveClaudeCodeHookMatcher(platform.id, matcher),
409+
),
403410
);
404411
if (legacy.error) {
405412
inspection = { ...inspection, present: false, error: legacy.error };

domains/skill/platform-install.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,14 @@ async function readSettingsJsonObject(
14511451
});
14521452
}
14531453

1454+
/** Grok aliases Write/Edit to search_replace, but its native write tool is a separate name. */
1455+
function resolveClaudeCodeHookMatcher(platformId: string, matcher: string): string {
1456+
if (platformId === 'grok' && matcher === 'Write|Edit') {
1457+
return 'Write|Edit|write|search_replace';
1458+
}
1459+
return matcher;
1460+
}
1461+
14541462
/**
14551463
* Claude-shaped JSON format used by Claude Code, Codex, and Amazon Q.
14561464
* Defaults to settings.local.json; platform metadata may override the filename.
@@ -1476,10 +1484,11 @@ async function installClaudeCodeHooks(
14761484
const matcherGroups: Record<string, Array<{ type: string; command: string }>> = {};
14771485
for (const [scriptRelPath, config] of Object.entries(hooksConfig)) {
14781486
const command = buildHookCommand(baseDir, skillsDir, scriptRelPath, context);
1479-
if (!matcherGroups[config.matcher]) {
1480-
matcherGroups[config.matcher] = [];
1487+
const matcher = resolveClaudeCodeHookMatcher(context.platformId, config.matcher);
1488+
if (!matcherGroups[matcher]) {
1489+
matcherGroups[matcher] = [];
14811490
}
1482-
matcherGroups[config.matcher].push({ type: 'command', command });
1491+
matcherGroups[matcher].push({ type: 'command', command });
14831492
}
14841493

14851494
const newEntries: ClaudeCodeHookEntry[] = Object.entries(matcherGroups).map(
@@ -2134,6 +2143,7 @@ export {
21342143
computeRuleDestPath,
21352144
formatRuleContent,
21362145
isManagedHookCommand,
2146+
resolveClaudeCodeHookMatcher,
21372147
removeManagedCopilotHookEntries,
21382148
buildHookCommand,
21392149
removeManagedHooksFromJsonFile,

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rpamis/comet",
3-
"version": "0.4.0-beta.19",
3+
"version": "0.4.0-beta.20",
44
"description": "Agent Skill Harness For Turning Ideas Into Evaluated Workflows",
55
"keywords": [
66
"comet",

0 commit comments

Comments
 (0)