From cad96d086d27d0725e78939eb51487fc8552c84a Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 14 Apr 2026 10:52:20 -0700 Subject: [PATCH] feat: add Hermes and GBrain host configs Hermes: tool rewrites for terminal/read_file/patch/delegate_task, paths to ~/.hermes/skills/gstack, AGENTS.md config file. GBrain: coding skills become brain-aware when GBrain mod is installed. Same tool rewrites as OpenClaw (agents spawn Claude Code via ACP). GBRAIN_CONTEXT_LOAD and GBRAIN_SAVE_RESULTS NOT suppressed on gbrain host, enabling brain-first lookup and save-to-brain behavior. Both registered in hosts/index.ts with setup script redirect messages. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitignore | 2 ++ hosts/gbrain.ts | 73 +++++++++++++++++++++++++++++++++++++++++++++++++ hosts/hermes.ts | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ hosts/index.ts | 6 ++-- setup | 24 +++++++++++++++- 5 files changed, 174 insertions(+), 3 deletions(-) create mode 100644 hosts/gbrain.ts create mode 100644 hosts/hermes.ts diff --git a/.gitignore b/.gitignore index 4a76c6c1..c0ab4c16 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ bin/gstack-global-discover .slate/ .cursor/ .openclaw/ +.hermes/ +.gbrain/ .context/ extension/.auth.json .gstack-worktrees/ diff --git a/hosts/gbrain.ts b/hosts/gbrain.ts new file mode 100644 index 00000000..30c9fb4b --- /dev/null +++ b/hosts/gbrain.ts @@ -0,0 +1,73 @@ +import type { HostConfig } from '../scripts/host-config'; + +const gbrain: HostConfig = { + name: 'gbrain', + displayName: 'GBrain', + cliCommand: 'gbrain', + cliAliases: [], + + globalRoot: '.gbrain/skills/gstack', + localSkillRoot: '.gbrain/skills/gstack', + hostSubdir: '.gbrain', + usesEnvVars: true, + + frontmatter: { + mode: 'allowlist', + keepFields: ['name', 'description'], + descriptionLimit: null, + }, + + generation: { + generateMetadata: false, + skipSkills: ['codex'], + includeSkills: [], + }, + + pathRewrites: [ + { from: '~/.claude/skills/gstack', to: '~/.gbrain/skills/gstack' }, + { from: '.claude/skills/gstack', to: '.gbrain/skills/gstack' }, + { from: '.claude/skills', to: '.gbrain/skills' }, + { from: 'CLAUDE.md', to: 'AGENTS.md' }, + ], + toolRewrites: { + 'use the Bash tool': 'use the exec tool', + 'use the Write tool': 'use the write tool', + 'use the Read tool': 'use the read tool', + 'use the Edit tool': 'use the edit tool', + 'use the Agent tool': 'use sessions_spawn', + 'use the Grep tool': 'search for', + 'use the Glob tool': 'find files matching', + 'the Bash tool': 'the exec tool', + 'the Read tool': 'the read tool', + 'the Write tool': 'the write tool', + 'the Edit tool': 'the edit tool', + }, + + // GBrain gets brain-aware resolvers. All other hosts suppress these. + suppressedResolvers: [ + 'DESIGN_OUTSIDE_VOICES', + 'ADVERSARIAL_STEP', + 'CODEX_SECOND_OPINION', + 'CODEX_PLAN_REVIEW', + 'REVIEW_ARMY', + // NOTE: GBRAIN_CONTEXT_LOAD and GBRAIN_SAVE_RESULTS are NOT suppressed here. + // GBrain is the only host that gets brain-first lookup and save-to-brain behavior. + ], + + runtimeRoot: { + globalSymlinks: ['bin', 'browse/dist', 'browse/bin', 'gstack-upgrade', 'ETHOS.md'], + globalFiles: { + 'review': ['checklist.md', 'TODOS-format.md'], + }, + }, + + install: { + prefixable: false, + linkingStrategy: 'symlink-generated', + }, + + coAuthorTrailer: 'Co-Authored-By: GBrain Agent ', + learningsMode: 'basic', +}; + +export default gbrain; diff --git a/hosts/hermes.ts b/hosts/hermes.ts new file mode 100644 index 00000000..584652bb --- /dev/null +++ b/hosts/hermes.ts @@ -0,0 +1,72 @@ +import type { HostConfig } from '../scripts/host-config'; + +const hermes: HostConfig = { + name: 'hermes', + displayName: 'Hermes', + cliCommand: 'hermes', + cliAliases: [], + + globalRoot: '.hermes/skills/gstack', + localSkillRoot: '.hermes/skills/gstack', + hostSubdir: '.hermes', + usesEnvVars: true, + + frontmatter: { + mode: 'allowlist', + keepFields: ['name', 'description'], + descriptionLimit: null, + }, + + generation: { + generateMetadata: false, + skipSkills: ['codex'], + includeSkills: [], + }, + + pathRewrites: [ + { from: '~/.claude/skills/gstack', to: '~/.hermes/skills/gstack' }, + { from: '.claude/skills/gstack', to: '.hermes/skills/gstack' }, + { from: '.claude/skills', to: '.hermes/skills' }, + { from: 'CLAUDE.md', to: 'AGENTS.md' }, + ], + toolRewrites: { + 'use the Bash tool': 'use the terminal tool', + 'use the Write tool': 'use the patch tool', + 'use the Read tool': 'use the read_file tool', + 'use the Edit tool': 'use the patch tool', + 'use the Agent tool': 'use delegate_task', + 'use the Grep tool': 'search for', + 'use the Glob tool': 'find files matching', + 'the Bash tool': 'the terminal tool', + 'the Read tool': 'the read_file tool', + 'the Write tool': 'the patch tool', + 'the Edit tool': 'the patch tool', + }, + + suppressedResolvers: [ + 'DESIGN_OUTSIDE_VOICES', + 'ADVERSARIAL_STEP', + 'CODEX_SECOND_OPINION', + 'CODEX_PLAN_REVIEW', + 'REVIEW_ARMY', + 'GBRAIN_CONTEXT_LOAD', + 'GBRAIN_SAVE_RESULTS', + ], + + runtimeRoot: { + globalSymlinks: ['bin', 'browse/dist', 'browse/bin', 'gstack-upgrade', 'ETHOS.md'], + globalFiles: { + 'review': ['checklist.md', 'TODOS-format.md'], + }, + }, + + install: { + prefixable: false, + linkingStrategy: 'symlink-generated', + }, + + coAuthorTrailer: 'Co-Authored-By: Hermes Agent ', + learningsMode: 'basic', +}; + +export default hermes; diff --git a/hosts/index.ts b/hosts/index.ts index 0b205092..cc1c213b 100644 --- a/hosts/index.ts +++ b/hosts/index.ts @@ -14,9 +14,11 @@ import opencode from './opencode'; import slate from './slate'; import cursor from './cursor'; import openclaw from './openclaw'; +import hermes from './hermes'; +import gbrain from './gbrain'; /** All registered host configs. Add new hosts here. */ -export const ALL_HOST_CONFIGS: HostConfig[] = [claude, codex, factory, kiro, opencode, slate, cursor, openclaw]; +export const ALL_HOST_CONFIGS: HostConfig[] = [claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain]; /** Map from host name to config. */ export const HOST_CONFIG_MAP: Record = Object.fromEntries( @@ -63,4 +65,4 @@ export function getExternalHosts(): HostConfig[] { } // Re-export individual configs for direct import -export { claude, codex, factory, kiro, opencode, slate, cursor, openclaw }; +export { claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain }; diff --git a/setup b/setup index f71f4552..c6ca9764 100755 --- a/setup +++ b/setup @@ -67,7 +67,29 @@ case "$HOST" in echo " 3. See docs/OPENCLAW.md for the full architecture" echo "" exit 0 ;; - *) echo "Unknown --host value: $HOST (expected claude, codex, kiro, factory, openclaw, or auto)" >&2; exit 1 ;; + hermes) + echo "" + echo "Hermes integration uses the same model as OpenClaw — Hermes spawns" + echo "Claude Code sessions, and gstack provides methodology artifacts." + echo "" + echo "To integrate gstack with Hermes:" + echo " 1. Tell your Hermes agent: 'install gstack for hermes'" + echo " 2. Or generate artifacts: bun run gen:skill-docs --host hermes" + echo "" + exit 0 ;; + gbrain) + echo "" + echo "GBrain is a mod for gstack — it makes coding skills brain-aware." + echo "GBrain generates brain-enhanced skill variants that search your brain" + echo "for context before starting and save results after finishing." + echo "" + echo "To generate brain-aware skills:" + echo " bun run gen:skill-docs --host gbrain" + echo "" + echo "GBrain setup and brain skills ship from the GBrain repo." + echo "" + exit 0 ;; + *) echo "Unknown --host value: $HOST (expected claude, codex, kiro, factory, openclaw, hermes, gbrain, or auto)" >&2; exit 1 ;; esac # ─── Resolve skill prefix preference ─────────────────────────