Skip to content

Commit 04b709d

Browse files
garrytanclaude
andauthored
feat: declarative multi-host platform + OpenCode, Slate, Cursor, OpenClaw (v0.15.5.0) (#793)
* test: add golden-file baselines for host config refactor Snapshot generated SKILL.md output for ship skill across all 3 existing hosts (Claude, Codex, Factory). These baselines verify the config-driven refactor produces identical output to the current hardcoded system. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add HostConfig interface and validator for declarative host system New scripts/host-config.ts defines the typed HostConfig interface that captures all per-host variation: paths, frontmatter rules, path/tool rewrites, suppressed resolvers, runtime root symlinks, install strategy, and behavioral config (co-author trailer, learnings mode, boundary instruction). Includes validateHostConfig() and validateAllConfigs() with regex-based security validation and cross-config uniqueness checks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add typed host configs for Claude, Codex, Factory, and Kiro Extract all hardcoded host-specific values from gen-skill-docs.ts, types.ts, preamble.ts, review.ts, and setup into typed HostConfig objects. Each host is a single file in hosts/ with its paths, frontmatter rules, path/tool rewrites, runtime root manifest, and install behavior. hosts/index.ts exports all configs, derives the Host type, and provides resolveHostArg() for CLI alias handling (e.g., 'agents' -> 'codex', 'droid' -> 'factory'). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: derive Host type and HOST_PATHS from host configs types.ts no longer hardcodes host names or paths. The Host type is derived from ALL_HOST_CONFIGS in hosts/index.ts, and HOST_PATHS is built dynamically from each config's globalRoot/localSkillRoot/usesEnvVars. Adding a new host to hosts/index.ts automatically extends the type system. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: gen-skill-docs.ts consumes typed host configs Replace hardcoded EXTERNAL_HOST_CONFIG, transformFrontmatter host branches, path/tool rewrite if-chains, and ALL_HOSTS array with config-driven lookups from hosts/*.ts. - Host detection uses resolveHostArg() (handles aliases like agents/droid) - transformFrontmatter uses config's allowlist/denylist mode, extraFields, conditionalFields, renameFields, and descriptionLimitBehavior - Path rewrites use config's pathRewrites array (replaceAll, order matters) - Tool rewrites use config's toolRewrites object - Skill skipping uses config's generation.skipSkills - ALL_HOSTS derived from ALL_HOST_NAMES - Token budget display regex derived from host configs Golden-file comparison: all 3 hosts produce IDENTICAL output to baselines. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: preamble, co-author trailer, and resolver suppression use host configs - preamble.ts: hostConfigDir derived from config.globalRoot instead of hardcoded Record - utility.ts: generateCoAuthorTrailer reads from config.coAuthorTrailer instead of host switch statement - gen-skill-docs.ts: suppressedResolvers from config skip resolver execution at placeholder replacement time (belt+suspenders with existing ctx.host checks in individual resolvers) Golden-file comparison: all 3 hosts produce IDENTICAL output to baselines. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: setup tooling uses config-driven host detection - host-config-export.ts: new CLI that exposes host configs to bash (list, get, detect, validate, symlinks commands) - bin/gstack-platform-detect: reads host configs instead of hardcoded binary/path mapping - scripts/skill-check.ts: iterates host configs for skill validation and freshness checks instead of separate Codex/Factory blocks - lib/worktree.ts: iterates host configs for directory copy instead of hardcoded .agents Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add OpenCode, Slate, and Cursor host configs Three new hosts added to the declarative config system. Each is a typed HostConfig object with paths, frontmatter rules, and path rewrites. All generate valid SKILL.md output with zero .claude/skills path leakage. - hosts/opencode.ts: OpenCode (opencode.ai), skills at ~/.config/opencode/ - hosts/slate.ts: Slate (Random Labs), skills at ~/.slate/ - hosts/cursor.ts: Cursor, skills at ~/.cursor/ - .gitignore: add .kiro/, .opencode/, .slate/, .cursor/, .openclaw/ Zero code changes needed — just config files + re-export in index.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add OpenClaw host config with adapter for tool mapping OpenClaw gets a hybrid approach: typed config for paths/frontmatter/ detection + a post-processing adapter for semantic tool rewrites. Config handles: path rewrites, frontmatter (name+description+version), CLAUDE.md→AGENTS.md, tool name rewrites (Bash→exec, Read→read, etc.), suppressed resolvers, SOUL.md via staticFiles. Adapter handles: AskUserQuestion→prose, Agent→sessions_spawn, $B→exec $B. Zero .claude/skills path leakage. Zero hardcoded tool references remaining. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: contributor add-host skill + fix version sync - contrib/add-host/SKILL.md.tmpl: contributor-only skill that guides new host config creation. Lives in contrib/, excluded from user installs. - package.json: sync version with VERSION file (0.15.2.1) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: add parameterized host smoke tests for all hosts 35 new tests covering all 7 external hosts (Codex, Factory, Kiro, OpenCode, Slate, Cursor, OpenClaw). Each host gets 4-5 tests: - output exists on disk with SKILL.md files - no .claude/skills path leakage in non-root skills - frontmatter has name + description fields - --dry-run freshness check passes - /codex skill excluded (for hosts with skipSkills: ['codex']) Tests are parameterized over ALL_HOST_CONFIGS so adding a new host automatically gets smoke-tested with zero new test code. Also updates --host all test to verify all registered hosts generate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: 100% coverage for host config system 71 new tests in test/host-config.test.ts covering: - hosts/index.ts: ALL_HOST_CONFIGS, getHostConfig, resolveHostArg (aliases), getExternalHosts, uniqueness checks - host-config.ts validateHostConfig: name regex, displayName, cliCommand, cliAliases, globalRoot, localSkillRoot, hostSubdir, frontmatter.mode, linkingStrategy, shell injection attempts, paths with $ and ~ - host-config.ts validateAllConfigs: duplicate name/hostSubdir/globalRoot detection, error prefix format, real configs pass - HOST_PATHS derivation: env vars for external hosts, literal paths for Claude, localSkillRoot matches config, every host has entry - host-config-export.ts CLI: list, get (string/boolean/array), detect, validate, symlinks, error cases (missing args, unknown field/host) - Golden-file regression: claude/codex/factory ship SKILL.md vs baselines - Individual host config correctness: prefixable, linkingStrategy, usesEnvVars, description limits, metadata, sidecar, tool rewrites, conditional fields, suppressed resolvers, boundary instruction, co-author trailers, skip rules, path rewrites, runtime root assets Combined with the 35 parameterized smoke tests from gen-skill-docs.test.ts, total new test coverage for multi-host: 106 tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: update golden baselines and sync version after merge from main Golden files refreshed to match post-merge generated output. package.json version synced to VERSION file (0.15.4.0). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: bump version and changelog (v0.15.5.0) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: sidebar E2E tests now self-contained and passing - sidebar-url-accuracy: fix stale assertion that expected extensionUrl in prompt text (prompt format changed, URL is now in pageUrl field) - sidebar-css-interaction: simplify task from multi-step HN comment navigation to single-page example.com style injection (faster, more reliable, still exercises goto + style + completion flow) - Update golden baselines after merge from main All 3 sidebar tests now pass: 3/3, 0 fail, ~36s total. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: add ADDING_A_HOST.md guide + update docs for multi-host system - docs/ADDING_A_HOST.md: step-by-step guide for adding a new host (create config, register, gitignore, generate, test). Covers the full HostConfig interface, adapter pattern, and validation. - CONTRIBUTING.md: replace stale "Dual-host development" section with "Multi-host development" covering all 8 hosts and linking to the guide. - README.md: consolidate Codex/Factory install sections into one "Other AI Agents" section listing all supported hosts with auto-detect. - CLAUDE.md: add hosts/, host-config.ts, host-adapters/, contrib/ to project structure tree. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: README per-host install instructions for all 8 agents Each supported agent now has its own copy-paste install block with the exact command and where skills end up on disk. Includes: auto-detect, Codex, OpenCode, Cursor, Factory, OpenClaw, Slate, and Kiro. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4478514 commit 04b709d

34 files changed

+8529
-274
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ bin/gstack-global-discover
88
.claude/skills/
99
.agents/
1010
.factory/
11+
.kiro/
12+
.opencode/
13+
.slate/
14+
.cursor/
15+
.openclaw/
1116
.context/
1217
extension/.auth.json
1318
.gstack-worktrees/

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
## [0.15.6.0] - 2026-04-04 — Declarative Multi-Host Platform
4+
5+
Adding a new coding agent to gstack used to mean touching 9 files and knowing the internals of `gen-skill-docs.ts`. Now it's one TypeScript config file and a re-export. Zero code changes elsewhere. Tests auto-parameterize.
6+
7+
### Added
8+
9+
- **Declarative host config system.** Every host is a typed `HostConfig` object in `hosts/*.ts`. The generator, setup, skill-check, platform-detect, uninstall, and worktree copy all consume configs instead of hardcoded switch statements. Adding a host = one file + re-export in `hosts/index.ts`.
10+
- **4 new hosts: OpenCode, Slate, Cursor, OpenClaw.** `bun run gen:skill-docs --host all` now generates for 8 hosts. Each produces valid SKILL.md output with zero `.claude/skills` path leakage.
11+
- **OpenClaw adapter.** OpenClaw gets a hybrid approach: config for paths/frontmatter/detection + a post-processing adapter for semantic tool mapping (Bash→exec, Agent→sessions_spawn, AskUserQuestion→prose). Includes `SOUL.md` via `staticFiles` config.
12+
- **106 new tests.** 71 tests for config validation, HOST_PATHS derivation, export CLI, golden-file regression, and per-host correctness. 35 parameterized smoke tests covering all 7 external hosts (output exists, no path leakage, frontmatter valid, freshness, skip rules).
13+
- **`host-config-export.ts` CLI.** Exposes host configs to bash scripts via `list`, `get`, `detect`, `validate`, `symlinks` commands. No YAML parsing needed in bash.
14+
- **Contributor `/gstack-contrib-add-host` skill.** Guides new host config creation. Lives in `contrib/`, excluded from user installs.
15+
- **Golden-file baselines.** Snapshots of ship/SKILL.md for Claude, Codex, and Factory verify the refactor produces identical output.
16+
- **Per-host install instructions in README.** Every supported agent has its own copy-paste install block.
17+
18+
### Changed
19+
20+
- **`gen-skill-docs.ts` is now config-driven.** EXTERNAL_HOST_CONFIG, transformFrontmatter host branches, path/tool rewrite if-chains, ALL_HOSTS array, and skill skip logic all replaced with config lookups.
21+
- **`types.ts` derives Host type from configs.** No more hardcoded `'claude' | 'codex' | 'factory'`. HOST_PATHS built dynamically from each config's globalRoot/usesEnvVars.
22+
- **Preamble, co-author trailer, resolver suppression all read from config.** hostConfigDir, co-author strings, and suppressedResolvers driven by host configs instead of per-host switch statements.
23+
- **`skill-check.ts`, `worktree.ts`, `platform-detect` iterate configs.** No per-host blocks to maintain.
24+
25+
### Fixed
26+
27+
- **Sidebar E2E tests now self-contained.** Fixed stale URL assertion in sidebar-url-accuracy, simplified sidebar-css-interaction task. All 3 sidebar tests pass without external browser dependencies.
28+
329
## [0.15.5.0] - 2026-04-04 — Interactive DX Review + Plan Mode Skill Fix
430

531
`/plan-devex-review` now feels like sitting down with a developer advocate who has used 100 CLI tools. Instead of speed-running 8 scores, it asks who your developer is, benchmarks you against competitors' onboarding times, makes you design your magical moment, and traces every friction point step by step before scoring anything.

CLAUDE.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,16 @@ gstack/
6363
│ │ └── snapshot.ts # SNAPSHOT_FLAGS metadata array
6464
│ ├── test/ # Integration tests + fixtures
6565
│ └── dist/ # Compiled binary
66+
├── hosts/ # Typed host configs (one per AI agent)
67+
│ ├── claude.ts # Primary host config
68+
│ ├── codex.ts, factory.ts, kiro.ts # Existing hosts
69+
│ ├── opencode.ts, slate.ts, cursor.ts, openclaw.ts # New hosts
70+
│ └── index.ts # Registry: exports all, derives Host type
6671
├── scripts/ # Build + DX tooling
67-
│ ├── gen-skill-docs.ts # Template → SKILL.md generator
72+
│ ├── gen-skill-docs.ts # Template → SKILL.md generator (config-driven)
73+
│ ├── host-config.ts # HostConfig interface + validator
74+
│ ├── host-config-export.ts # Shell bridge for setup script
75+
│ ├── host-adapters/ # Host-specific adapters (OpenClaw tool mapping)
6876
│ ├── resolvers/ # Template resolver modules (preamble, design, review, etc.)
6977
│ ├── skill-check.ts # Health dashboard
7078
│ └── dev-skill.ts # Watch mode
@@ -108,6 +116,8 @@ gstack/
108116
├── .github/ # CI workflows + Docker image
109117
│ ├── workflows/ # evals.yml (E2E on Ubicloud), skill-docs.yml, actionlint.yml
110118
│ └── docker/ # Dockerfile.ci (pre-baked toolchain + Playwright/Chromium)
119+
├── contrib/ # Contributor-only tools (never installed for users)
120+
│ └── add-host/ # /gstack-contrib-add-host skill
111121
├── setup # One-time setup: build binary + symlink skills
112122
├── SKILL.md # Generated from SKILL.md.tmpl (don't edit directly)
113123
├── SKILL.md.tmpl # Template: edit this, run gen:skill-docs

CONTRIBUTING.md

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,10 @@ SKILL.md files are **generated** from `.tmpl` templates. Don't edit the `.md` di
216216
# 1. Edit the template
217217
vim SKILL.md.tmpl # or browse/SKILL.md.tmpl
218218

219-
# 2. Regenerate for both hosts
220-
bun run gen:skill-docs
221-
bun run gen:skill-docs --host codex
219+
# 2. Regenerate for all hosts
220+
bun run gen:skill-docs --host all
222221

223-
# 3. Check health (reports both Claude and Codex)
222+
# 3. Check health (reports all hosts)
224223
bun run skill:check
225224

226225
# Or use watch mode — auto-regenerates on save
@@ -231,59 +230,74 @@ For template authoring best practices (natural language over bash-isms, dynamic
231230

232231
To add a browse command, add it to `browse/src/commands.ts`. To add a snapshot flag, add it to `SNAPSHOT_FLAGS` in `browse/src/snapshot.ts`. Then rebuild.
233232

234-
## Dual-host development (Claude + Codex)
233+
## Multi-host development
235234

236-
gstack generates SKILL.md files for two hosts: **Claude** (`.claude/skills/`) and **Codex** (`.agents/skills/`). Every template change needs to be generated for both.
235+
gstack generates SKILL.md files for 8 hosts from one set of `.tmpl` templates.
236+
Each host is a typed config in `hosts/*.ts`. The generator reads these configs
237+
to produce host-appropriate output (different frontmatter, paths, tool names).
237238

238-
### Generating for both hosts
239+
**Supported hosts:** Claude (primary), Codex, Factory, Kiro, OpenCode, Slate, Cursor, OpenClaw.
239240

240-
```bash
241-
# Generate Claude output (default)
242-
bun run gen:skill-docs
241+
### Generating for all hosts
243242

244-
# Generate Codex output
245-
bun run gen:skill-docs --host codex
246-
# --host agents is an alias for --host codex
243+
```bash
244+
# Generate for a specific host
245+
bun run gen:skill-docs # Claude (default)
246+
bun run gen:skill-docs --host codex # Codex
247+
bun run gen:skill-docs --host opencode # OpenCode
248+
bun run gen:skill-docs --host all # All 8 hosts
247249

248-
# Or use build, which does both + compiles binaries
250+
# Or use build, which does all hosts + compiles binaries
249251
bun run build
250252
```
251253

252254
### What changes between hosts
253255

254-
| Aspect | Claude | Codex |
255-
|--------|--------|-------|
256-
| Output directory | `{skill}/SKILL.md` | `.agents/skills/gstack-{skill}/SKILL.md` (generated at setup, gitignored) |
257-
| Frontmatter | Full (name, description, voice-triggers, allowed-tools, hooks, version) | Minimal (name + description only) |
258-
| Paths | `~/.claude/skills/gstack` | `$GSTACK_ROOT` (`.agents/skills/gstack` in a repo, otherwise `~/.codex/skills/gstack`) |
259-
| Hook skills | `hooks:` frontmatter (enforced by Claude) | Inline safety advisory prose (advisory only) |
260-
| `/codex` skill | Included (Claude wraps codex exec) | Excluded (self-referential) |
256+
Each host config (`hosts/*.ts`) controls:
257+
258+
| Aspect | Example (Claude vs Codex) |
259+
|--------|---------------------------|
260+
| Output directory | `{skill}/SKILL.md` vs `.agents/skills/gstack-{skill}/SKILL.md` |
261+
| Frontmatter | Full (name, description, hooks, version) vs minimal (name + description) |
262+
| Paths | `~/.claude/skills/gstack` vs `$GSTACK_ROOT` |
263+
| Tool names | "use the Bash tool" vs same (Factory rewrites to "run this command") |
264+
| Hook skills | `hooks:` frontmatter vs inline safety advisory prose |
265+
| Suppressed sections | None vs Codex self-invocation sections stripped |
261266

262-
### Testing Codex output
267+
See `scripts/host-config.ts` for the full `HostConfig` interface.
268+
269+
### Testing host output
263270

264271
```bash
265-
# Run all static tests (includes Codex validation)
272+
# Run all static tests (includes parameterized smoke tests for all hosts)
266273
bun test
267274

268-
# Check freshness for both hosts
269-
bun run gen:skill-docs --dry-run
270-
bun run gen:skill-docs --host codex --dry-run
275+
# Check freshness for all hosts
276+
bun run gen:skill-docs --host all --dry-run
271277

272-
# Health dashboard covers both hosts
278+
# Health dashboard covers all hosts
273279
bun run skill:check
274280
```
275281

276-
### Dev setup for .agents/
282+
### Adding a new host
283+
284+
See [docs/ADDING_A_HOST.md](docs/ADDING_A_HOST.md) for the full guide. Short version:
285+
286+
1. Create `hosts/myhost.ts` (copy from `hosts/opencode.ts`)
287+
2. Add to `hosts/index.ts`
288+
3. Add `.myhost/` to `.gitignore`
289+
4. Run `bun run gen:skill-docs --host myhost`
290+
5. Run `bun test` (parameterized tests auto-cover it)
277291

278-
When you run `bin/dev-setup`, it creates symlinks in both `.claude/skills/` and `.agents/skills/` (if applicable), so Codex-compatible agents can discover your dev skills too. The `.agents/` directory is generated at setup time from `.tmpl` templates — it is gitignored and not committed.
292+
Zero generator, setup, or tooling code changes needed.
279293

280294
### Adding a new skill
281295

282-
When you add a new skill template, both hosts get it automatically:
296+
When you add a new skill template, all hosts get it automatically:
283297
1. Create `{skill}/SKILL.md.tmpl`
284-
2. Run `bun run gen:skill-docs` (Claude output) and `bun run gen:skill-docs --host codex` (Codex output)
285-
3. The dynamic template discovery picks it up no static list to update
286-
4. Commit `{skill}/SKILL.md``.agents/` is generated at setup time and gitignored
298+
2. Run `bun run gen:skill-docs --host all`
299+
3. The dynamic template discovery picks it up, no static list to update
300+
4. Commit `{skill}/SKILL.md`, external host output is generated at setup time and gitignored
287301

288302
## Conductor workspaces
289303

README.md

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,49 +59,79 @@ Real files get committed to your repo (not a submodule), so `git clone` just wor
5959
> git clone https://github.com/garrytan/gstack.git ~/.claude/skills/gstack
6060
> ```
6161
62-
### Codex, Gemini CLI, or Cursor
62+
### Other AI Agents
6363
64-
gstack works on any agent that supports the [SKILL.md standard](https://github.com/anthropics/claude-code). Skills live in `.agents/skills/` and are discovered automatically.
64+
gstack works on 8 AI coding agents, not just Claude. All 31 skills work across
65+
every supported agent. Setup auto-detects which agents you have installed, or
66+
you can target a specific one.
6567
66-
Install to one repo:
68+
#### Auto-detect (installs for every agent on your machine)
6769
6870
```bash
69-
git clone --single-branch --depth 1 https://github.com/garrytan/gstack.git .agents/skills/gstack
70-
cd .agents/skills/gstack && ./setup --host codex
71+
git clone --single-branch --depth 1 https://github.com/garrytan/gstack.git ~/gstack
72+
cd ~/gstack && ./setup
7173
```
7274
73-
When setup runs from `.agents/skills/gstack`, it installs the generated Codex skills next to it in the same repo and does not write to `~/.codex/skills`.
74-
75-
Install once for your user account:
75+
#### OpenAI Codex CLI
7676

7777
```bash
7878
git clone --single-branch --depth 1 https://github.com/garrytan/gstack.git ~/gstack
7979
cd ~/gstack && ./setup --host codex
8080
```
8181

82-
`setup --host codex` creates the runtime root at `~/.codex/skills/gstack` and
83-
links the generated Codex skills at the top level. This avoids duplicate skill
84-
discovery from the source repo checkout.
82+
Skills install to `~/.codex/skills/gstack-*/`. For repo-local installs, clone
83+
into `.agents/skills/gstack` instead.
8584

86-
Or let setup auto-detect which agents you have installed:
85+
#### OpenCode
8786

8887
```bash
8988
git clone --single-branch --depth 1 https://github.com/garrytan/gstack.git ~/gstack
90-
cd ~/gstack && ./setup --host auto
89+
cd ~/gstack && ./setup --host opencode
9190
```
9291

93-
For Codex-compatible hosts, setup now supports both repo-local installs from `.agents/skills/gstack` and user-global installs from `~/.codex/skills/gstack`. All 31 skills work across all supported agents. Hook-based safety skills (careful, freeze, guard) use inline safety advisory prose on non-Claude hosts.
92+
Skills install to `~/.config/opencode/skills/gstack-*/`.
93+
94+
#### Cursor
95+
96+
```bash
97+
git clone --single-branch --depth 1 https://github.com/garrytan/gstack.git ~/gstack
98+
cd ~/gstack && ./setup --host cursor
99+
```
94100

95-
### Factory Droid
101+
Skills install to `~/.cursor/skills/gstack-*/`.
96102

97-
gstack works with [Factory Droid](https://factory.ai). Skills install to `.factory/skills/` and are discovered automatically. Sensitive skills (ship, land-and-deploy, guard) use `disable-model-invocation: true` so Droids don't auto-invoke them.
103+
#### Factory Droid
98104

99105
```bash
100106
git clone --single-branch --depth 1 https://github.com/garrytan/gstack.git ~/gstack
101107
cd ~/gstack && ./setup --host factory
102108
```
103109

104-
Skills install to `~/.factory/skills/gstack-*/`. Restart `droid` to rescan skills, then type `/qa` to get started.
110+
Skills install to `~/.factory/skills/gstack-*/`. Sensitive skills use
111+
`disable-model-invocation: true` so Droids don't auto-invoke them.
112+
113+
#### OpenClaw
114+
115+
```bash
116+
git clone --single-branch --depth 1 https://github.com/garrytan/gstack.git ~/gstack
117+
cd ~/gstack && ./setup --host openclaw
118+
```
119+
120+
Skills install to `~/.openclaw/skills/gstack-*/`. Tool names are rewritten
121+
for OpenClaw's tool system (exec, read, write, edit, sessions_spawn).
122+
123+
#### Slate / Kiro
124+
125+
```bash
126+
./setup --host slate # Slate (Random Labs)
127+
./setup --host kiro # Amazon Kiro
128+
```
129+
130+
Hook-based safety skills (careful, freeze, guard) use inline safety advisory
131+
prose on all non-Claude hosts.
132+
133+
**Want to add support for another agent?** See [docs/ADDING_A_HOST.md](docs/ADDING_A_HOST.md).
134+
It's one TypeScript config file, zero code changes.
105135

106136
### Voice input (AquaVoice, Whisper, etc.)
107137

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.15.5.0
1+
0.15.6.0

bin/gstack-platform-detect

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@
22
set -euo pipefail
33

44
# gstack-platform-detect: show which AI coding agents are installed and gstack status
5+
# Config-driven: reads host definitions from hosts/*.ts via host-config-export.ts
6+
7+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8+
GSTACK_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
9+
510
printf "%-16s %-10s %-40s %s\n" "Agent" "Version" "Skill Path" "gstack"
611
printf "%-16s %-10s %-40s %s\n" "-----" "-------" "----------" "------"
7-
for entry in "claude:claude" "codex:codex" "droid:factory" "kiro-cli:kiro"; do
8-
bin="${entry%%:*}"; label="${entry##*:}"
9-
if command -v "$bin" >/dev/null 2>&1; then
10-
ver=$("$bin" --version 2>/dev/null | head -1 || echo "unknown")
11-
case "$label" in
12-
claude) spath="$HOME/.claude/skills/gstack" ;;
13-
codex) spath="$HOME/.codex/skills/gstack" ;;
14-
factory) spath="$HOME/.factory/skills/gstack" ;;
15-
kiro) spath="$HOME/.kiro/skills/gstack" ;;
16-
esac
17-
status=$([ -d "$spath" ] && echo "INSTALLED" || echo "NOT INSTALLED")
18-
printf "%-16s %-10s %-40s %s\n" "$label" "$ver" "$spath" "$status"
12+
13+
for host in $(bun run "$GSTACK_DIR/scripts/host-config-export.ts" list 2>/dev/null); do
14+
cmd=$(bun run "$GSTACK_DIR/scripts/host-config-export.ts" get "$host" cliCommand 2>/dev/null)
15+
root=$(bun run "$GSTACK_DIR/scripts/host-config-export.ts" get "$host" globalRoot 2>/dev/null)
16+
spath="$HOME/$root"
17+
18+
if command -v "$cmd" >/dev/null 2>&1; then
19+
ver=$("$cmd" --version 2>/dev/null | head -1 || echo "unknown")
20+
if [ -d "$spath" ] || [ -L "$spath" ]; then
21+
status="INSTALLED"
22+
else
23+
status="NOT INSTALLED"
24+
fi
25+
printf "%-16s %-10s %-40s %s\n" "$host" "$ver" "$spath" "$status"
1926
fi
2027
done

contrib/add-host/SKILL.md.tmpl

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
name: gstack-contrib-add-host
3+
description: |
4+
Contributor-only skill: create a new host config for gstack's multi-host system.
5+
NOT installed for end users. Only usable from the gstack source repo.
6+
---
7+
8+
# /gstack-contrib-add-host — Add a New Host
9+
10+
This skill helps contributors add support for a new AI coding agent to gstack.
11+
12+
## What you'll create
13+
14+
A single TypeScript file in `hosts/<name>.ts` that defines:
15+
- CLI binary name for detection
16+
- Skill directory paths (global + local)
17+
- Frontmatter transformation rules
18+
- Path and tool rewrites
19+
- Runtime root symlink manifest
20+
21+
## Steps
22+
23+
### 1. Gather host info
24+
25+
Ask the contributor:
26+
- What's the agent's name? (e.g., "OpenCode")
27+
- What's the CLI binary? (e.g., "opencode")
28+
- Where does it store skills globally? (e.g., "~/.config/opencode/skills/")
29+
- Where does it store skills locally in a project? (e.g., ".opencode/skills/")
30+
- What frontmatter fields does it support? (name + description is the minimum)
31+
- Does it have its own tool names? (e.g., "exec" instead of "Bash")
32+
33+
### 2. Create the config file
34+
35+
Use `hosts/opencode.ts` as a reference. Create `hosts/<name>.ts` with the
36+
gathered info. Follow the HostConfig interface in `scripts/host-config.ts`.
37+
38+
### 3. Register in index
39+
40+
Add the import and re-export in `hosts/index.ts`.
41+
42+
### 4. Add to .gitignore
43+
44+
Add `.<name>/` to `.gitignore`.
45+
46+
### 5. Generate and verify
47+
48+
```bash
49+
bun run gen:skill-docs --host <name>
50+
```
51+
52+
Check:
53+
- Output exists at `.<name>/skills/gstack-*/SKILL.md`
54+
- No `.claude/skills` path leakage
55+
- Frontmatter matches expected format
56+
57+
### 6. Run tests
58+
59+
```bash
60+
bun test test/gen-skill-docs.test.ts
61+
```
62+
63+
All parameterized tests auto-include the new host.

0 commit comments

Comments
 (0)