From e2d005c7f49c3edc87f15589daccd9469bbe487e Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 5 Apr 2026 02:23:59 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20OpenClaw=20integration=20v2=20=E2=80=94?= =?UTF-8?q?=20prompt=20is=20the=20bridge=20(v0.15.9.0)=20(#816)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add includeSkills to HostConfig + update OpenClaw config Add includeSkills allowlist field with union logic (include minus skip). Update OpenClaw to generate only 4 native methodology skills (office-hours, plan-ceo-review, investigate, retro). Remove staticFiles.SOUL.md reference (pointed to non-existent file). * feat: OpenClaw integration — gstack-lite/full generation + spawned session detection Add includeSkills filter to gen-skill-docs pipeline. Generate gstack-lite (planning discipline for spawned coding sessions) and gstack-full (complete feature pipeline) for OpenClaw host. Add OPENCLAW_SESSION env var detection in preamble for spawned session auto-detect. Update setup --host openclaw to print redirect message. * docs: OpenClaw architecture doc + regenerate all SKILL.md with spawned session detection Add docs/OPENCLAW.md with 4-tier dispatch routing and integration architecture. Generate gstack-lite and gstack-full prompt templates. Regenerate all SKILL.md files with OPENCLAW_SESSION env var check in preamble. * test: update golden baselines + OpenClaw includeSkills tests Update golden SKILL.md baselines for preamble SPAWNED_SESSION change. Replace staticFiles SOUL.md test with includeSkills validation. * chore: bump version and changelog (v0.15.9.0) Co-Authored-By: Claude Opus 4.6 (1M context) * fix: remove all Wintermute references from source files Replace with generic "orchestrator" or "OpenClaw" as appropriate. Co-Authored-By: Claude Opus 4.6 (1M context) * feat: add Plan dispatch tier — full review gauntlet for Claude Code project planning New gstack-plan template chains /office-hours → /autoplan (CEO + eng + design + DX + codex adversarial), saves the reviewed plan, and reports back to the orchestrator. The orchestrator persists the plan link to its own memory store. 5 tiers now: Simple, Medium, Heavy, Full, Plan. Co-Authored-By: Claude Opus 4.6 (1M context) --------- Co-authored-by: Claude Opus 4.6 (1M context) --- CHANGELOG.md | 19 +++ SKILL.md | 9 ++ VERSION | 2 +- autoplan/SKILL.md | 9 ++ benchmark/SKILL.md | 9 ++ browse/SKILL.md | 9 ++ canary/SKILL.md | 9 ++ checkpoint/SKILL.md | 9 ++ codex/SKILL.md | 9 ++ cso/SKILL.md | 9 ++ design-consultation/SKILL.md | 9 ++ design-html/SKILL.md | 9 ++ design-review/SKILL.md | 9 ++ design-shotgun/SKILL.md | 9 ++ devex-review/SKILL.md | 9 ++ docs/OPENCLAW.md | 161 +++++++++++++++++++++ document-release/SKILL.md | 9 ++ health/SKILL.md | 9 ++ hosts/openclaw.ts | 5 +- investigate/SKILL.md | 9 ++ land-and-deploy/SKILL.md | 9 ++ learn/SKILL.md | 9 ++ office-hours/SKILL.md | 9 ++ open-gstack-browser/SKILL.md | 9 ++ openclaw/gstack-full-CLAUDE.md | 12 ++ openclaw/gstack-lite-CLAUDE.md | 12 ++ openclaw/gstack-plan-CLAUDE.md | 20 +++ plan-ceo-review/SKILL.md | 9 ++ plan-design-review/SKILL.md | 9 ++ plan-devex-review/SKILL.md | 9 ++ plan-eng-review/SKILL.md | 9 ++ qa-only/SKILL.md | 9 ++ qa/SKILL.md | 9 ++ retro/SKILL.md | 9 ++ review/SKILL.md | 9 ++ scripts/gen-skill-docs.ts | 73 +++++++++- scripts/host-config.ts | 2 + scripts/resolvers/preamble.ts | 12 ++ setup | 14 +- setup-browser-cookies/SKILL.md | 9 ++ setup-deploy/SKILL.md | 9 ++ ship/SKILL.md | 9 ++ test/fixtures/golden/claude-ship-SKILL.md | 34 +++++ test/fixtures/golden/codex-ship-SKILL.md | 34 +++++ test/fixtures/golden/factory-ship-SKILL.md | 34 +++++ test/host-config.test.ts | 14 +- 46 files changed, 715 insertions(+), 12 deletions(-) create mode 100644 docs/OPENCLAW.md create mode 100644 openclaw/gstack-full-CLAUDE.md create mode 100644 openclaw/gstack-lite-CLAUDE.md create mode 100644 openclaw/gstack-plan-CLAUDE.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 2216f639..7b03b8d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [0.15.9.0] - 2026-04-05 — OpenClaw Integration v2 + +You can now connect gstack to OpenClaw as a methodology source. OpenClaw spawns Claude Code sessions natively via ACP, and gstack provides the planning discipline and thinking frameworks that make those sessions better. + +### Added + +- **gstack-lite planning discipline.** A 15-line CLAUDE.md that turns every spawned Claude Code session into a disciplined builder: read first, plan, resolve ambiguity, self-review, report. A/B tested: 2x time, meaningfully better output. +- **gstack-full pipeline template.** For complete feature builds, chains /autoplan, implement, and /ship into one autonomous flow. Your orchestrator drops a task, gets back a PR. +- **4 native methodology skills for OpenClaw.** Office hours, CEO review, investigate, and retro, adapted for conversational work that doesn't need a coding environment. +- **4-tier dispatch routing.** Simple (no gstack), Medium (gstack-lite), Heavy (specific skill), Full (complete pipeline). Documented in docs/OPENCLAW.md with routing guide for OpenClaw's AGENTS.md. +- **Spawned session detection.** Set OPENCLAW_SESSION env var and gstack auto-skips interactive prompts, focusing on task completion. Works for any orchestrator, not just OpenClaw. +- **includeSkills host config field.** Union logic with skipSkills (include minus skip). Lets hosts generate only the skills they need instead of everything-minus-a-list. +- **docs/OPENCLAW.md.** Full architecture doc explaining how gstack integrates with OpenClaw, the prompt-as-bridge model, and what we're NOT building (no daemon, no protocol, no Clawvisor). + +### Changed + +- OpenClaw host config updated: generates only 4 native skills instead of all 31. Removed staticFiles.SOUL.md (referenced non-existent file). +- Setup script now prints redirect message for `--host openclaw` instead of attempting full installation. + ## [0.15.8.1] - 2026-04-05 — Community PR Triage + Error Polish Closed 12 redundant community PRs, merged 2 ready PRs (#798, #776), and expanded the friendly OpenAI error to every design command. If your org isn't verified, you now get a clear message with the right URL instead of a raw JSON dump, no matter which design command you run. diff --git a/SKILL.md b/SKILL.md index 258a7e4a..395ae131 100644 --- a/SKILL.md +++ b/SKILL.md @@ -80,6 +80,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -206,6 +208,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice **Tone:** direct, concrete, sharp, never corporate, never academic. Sound like a builder, not a consultant. Name the file, the function, the command. No filler, no throat-clearing. diff --git a/VERSION b/VERSION index 06c9be90..e2d76d24 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.15.8.1 +0.15.9.0 diff --git a/autoplan/SKILL.md b/autoplan/SKILL.md index bcfb6224..4b268832 100644 --- a/autoplan/SKILL.md +++ b/autoplan/SKILL.md @@ -90,6 +90,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -216,6 +218,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/benchmark/SKILL.md b/benchmark/SKILL.md index 156ae8cf..a13c2e8b 100644 --- a/benchmark/SKILL.md +++ b/benchmark/SKILL.md @@ -83,6 +83,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -209,6 +211,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice **Tone:** direct, concrete, sharp, never corporate, never academic. Sound like a builder, not a consultant. Name the file, the function, the command. No filler, no throat-clearing. diff --git a/browse/SKILL.md b/browse/SKILL.md index d224b309..ed840e69 100644 --- a/browse/SKILL.md +++ b/browse/SKILL.md @@ -82,6 +82,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -208,6 +210,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice **Tone:** direct, concrete, sharp, never corporate, never academic. Sound like a builder, not a consultant. Name the file, the function, the command. No filler, no throat-clearing. diff --git a/canary/SKILL.md b/canary/SKILL.md index e7153e93..32cacd51 100644 --- a/canary/SKILL.md +++ b/canary/SKILL.md @@ -82,6 +82,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -208,6 +210,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/checkpoint/SKILL.md b/checkpoint/SKILL.md index 2967f14c..82ecb5e0 100644 --- a/checkpoint/SKILL.md +++ b/checkpoint/SKILL.md @@ -85,6 +85,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -211,6 +213,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/codex/SKILL.md b/codex/SKILL.md index 5706dd8c..bafdf7df 100644 --- a/codex/SKILL.md +++ b/codex/SKILL.md @@ -84,6 +84,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -210,6 +212,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/cso/SKILL.md b/cso/SKILL.md index 20efe14b..58a65c8b 100644 --- a/cso/SKILL.md +++ b/cso/SKILL.md @@ -87,6 +87,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -213,6 +215,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/design-consultation/SKILL.md b/design-consultation/SKILL.md index 92067d74..a8b512b5 100644 --- a/design-consultation/SKILL.md +++ b/design-consultation/SKILL.md @@ -87,6 +87,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -213,6 +215,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/design-html/SKILL.md b/design-html/SKILL.md index c50b37ed..cc5aebcd 100644 --- a/design-html/SKILL.md +++ b/design-html/SKILL.md @@ -89,6 +89,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -215,6 +217,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/design-review/SKILL.md b/design-review/SKILL.md index 9b78080e..684177b1 100644 --- a/design-review/SKILL.md +++ b/design-review/SKILL.md @@ -87,6 +87,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -213,6 +215,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/design-shotgun/SKILL.md b/design-shotgun/SKILL.md index 7de41cf3..03223146 100644 --- a/design-shotgun/SKILL.md +++ b/design-shotgun/SKILL.md @@ -84,6 +84,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -210,6 +212,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/devex-review/SKILL.md b/devex-review/SKILL.md index 18ba792f..70cc3fdf 100644 --- a/devex-review/SKILL.md +++ b/devex-review/SKILL.md @@ -87,6 +87,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -213,6 +215,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/docs/OPENCLAW.md b/docs/OPENCLAW.md new file mode 100644 index 00000000..e2260a14 --- /dev/null +++ b/docs/OPENCLAW.md @@ -0,0 +1,161 @@ +# gstack x OpenClaw Integration + +gstack integrates with OpenClaw as a methodology source, not a ported codebase. +OpenClaw's ACP runtime spawns Claude Code sessions natively. gstack provides the +planning discipline and methodology that makes those sessions better. + +This is a lightweight protocol encoded as prompt text. No daemon. No JSON-RPC. +No compatibility matrices. The prompt is the bridge. + +## Architecture + +``` + OpenClaw gstack repo + ───────────────────── ────────────── + Orchestrator: messaging, Source of truth for + calendar, memory, EA methodology + planning + │ │ + ├── Native skills (conversational) ├── Generates native skills + │ office-hours, ceo-review, │ via gen-skill-docs pipeline + │ investigate, retro │ + │ ├── Generates gstack-lite + ├── sessions_spawn(runtime: "acp") │ (planning discipline) + │ │ │ + │ └── Claude Code ├── Generates gstack-full + │ └── gstack installed at │ (complete pipeline) + │ ~/.claude/skills/gstack │ + │ └── docs/OPENCLAW.md (this file) + └── Dispatch routing (AGENTS.md) +``` + +## Dispatch Routing + +OpenClaw decides at spawn time which tier of gstack support to use: + +| Tier | When | Prompt prefix | +|------|------|---------------| +| **Simple** | One-file edits, typos, config changes | No gstack context injected | +| **Medium** | Multi-file features, refactors | gstack-lite CLAUDE.md appended | +| **Heavy** | Specific gstack skill needed | "Load gstack. Run /X" | +| **Full** | Complete features, objectives, projects | gstack-full pipeline appended | +| **Plan** | "Help me plan a Claude Code project" | gstack-plan pipeline appended | + +### Decision heuristic + +- Can it be done in <10 lines of code? -> **Simple** +- Does it touch multiple files but the approach is obvious? -> **Medium** +- Does the user name a specific skill (/cso, /review, /qa)? -> **Heavy** +- Is it a feature, project, or objective (not a task)? -> **Full** +- Does the user want to PLAN something for Claude Code without implementing yet? -> **Plan** + +### Dispatch routing guide (for AGENTS.md) + +Add this to OpenClaw's AGENTS.md: + +```markdown +## Coding Task Dispatch + +When asked for coding work, pick the dispatch tier: + +SIMPLE: "fix this typo," "update that config," single-file changes +-> sessions_spawn(runtime: "acp", prompt: "") + +MEDIUM: multi-file features, refactors, skill edits +-> sessions_spawn(runtime: "acp", prompt: "\n\n") + +HEAVY: needs a specific gstack methodology +-> sessions_spawn(runtime: "acp", prompt: "Load gstack. Run /qa https://...") + Skills: /cso, /review, /qa, /ship, /investigate, /design-review, /benchmark + +FULL: build a complete feature, multi-day scope, needs planning + review +-> sessions_spawn(runtime: "acp", prompt: "\n\n") + Claude Code runs: /autoplan -> implement -> /ship -> report back + +PLAN: user wants to plan a Claude Code project, spec out a feature, or design + something before any code is written +-> sessions_spawn(runtime: "acp", prompt: "\n\n") + Claude Code runs: /office-hours -> /autoplan -> saves plan file -> reports back + The orchestrator persists the plan link to its memory/knowledge store. + When the user is ready to implement, spawn a new FULL session pointing at the plan. +``` + +### CLAUDE.md collision handling + +When spawning Claude Code in a repo that already has a CLAUDE.md, APPEND +gstack-lite/full as a new section. Do not replace the repo's existing instructions. + +## What gstack generates for OpenClaw + +All artifacts live in the `openclaw/` directory and are generated by +`bun run gen:skill-docs --host openclaw`: + +### gstack-lite (Medium tier) +`openclaw/gstack-lite-CLAUDE.md` — ~15 lines of planning discipline: +1. Read every file before modifying +2. Write a 5-line plan: what, why, which files, test case, risk +3. Resolve ambiguity using decision principles +4. Self-review before reporting done +5. Completion report: what shipped, decisions made, anything uncertain + +A/B tested: 2x time, meaningfully better output. + +### gstack-full (Full tier) +`openclaw/gstack-full-CLAUDE.md` — chains existing gstack skills: +1. Read CLAUDE.md and understand the project +2. Run /autoplan (CEO + eng + design review) +3. Implement the approved plan +4. Run /ship to create a PR +5. Report back with PR URL and decisions + +### gstack-plan (Plan tier) +`openclaw/gstack-plan-CLAUDE.md` — full review gauntlet, no implementation: +1. Run /office-hours to produce a design doc +2. Run /autoplan (CEO + eng + design + DX reviews + codex adversarial) +3. Save the reviewed plan to `plans/-plan-.md` +4. Report back: plan path, summary, key decisions, recommended next step + +The orchestrator persists the plan link to its own memory store (brain repo, +knowledge base, or whatever is configured in AGENTS.md). When the user is +ready to build, spawn a FULL session that references the saved plan. + +### Native methodology skills +Conversational skills for non-coding work, generated from gstack source templates: +- `openclaw/office-hours.md` — Product interrogation (6 forcing questions) +- `openclaw/ceo-review.md` — Strategic challenge (10-section review, 4 modes) +- `openclaw/investigate.md` — Operational debugging (4-phase methodology) +- `openclaw/retro.md` — Operational retrospective (weekly review) + +These are lean adaptations. They contain the methodology, not the full gstack +skill infrastructure (no browse, no telemetry, no preamble). + +## Spawned session detection + +When Claude Code runs inside a session spawned by OpenClaw, the `OPENCLAW_SESSION` +environment variable should be set. gstack detects this and adjusts: +- Skips interactive prompts (auto-chooses recommended options) +- Skips upgrade checks and telemetry prompts +- Focuses on task completion and prose reporting + +Set the env var in sessions_spawn: `env: { OPENCLAW_SESSION: "1" }` + +## Installation + +For OpenClaw users: tell your OpenClaw agent "install gstack for openclaw." + +The agent should: +1. Install gstack-lite CLAUDE.md into its coding session templates +2. Install the 4 native methodology skills +3. Add dispatch routing to AGENTS.md +4. Verify with a test spawn + +For gstack developers: `./setup --host openclaw` outputs this documentation. +The actual artifacts are generated by `bun run gen:skill-docs --host openclaw`. + +## What we don't do + +- No dispatch daemon (ACP handles session spawning) +- No Clawvisor relay (no security layer needed) +- No bidirectional learnings bridge (brain repo is the knowledge store) +- No JSON schemas or protocol versioning +- No SOUL.md from gstack (OpenClaw has its own) +- No full skill porting (coding skills stay native to Claude Code) diff --git a/document-release/SKILL.md b/document-release/SKILL.md index a4f2617e..f4dde2bf 100644 --- a/document-release/SKILL.md +++ b/document-release/SKILL.md @@ -84,6 +84,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -210,6 +212,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/health/SKILL.md b/health/SKILL.md index ee42db1f..801b2ef4 100644 --- a/health/SKILL.md +++ b/health/SKILL.md @@ -84,6 +84,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -210,6 +212,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/hosts/openclaw.ts b/hosts/openclaw.ts index 81f511ff..86c99307 100644 --- a/hosts/openclaw.ts +++ b/hosts/openclaw.ts @@ -23,6 +23,7 @@ const openclaw: HostConfig = { generation: { generateMetadata: false, skipSkills: ['codex'], + includeSkills: ['office-hours', 'plan-ceo-review', 'investigate', 'retro'], }, pathRewrites: [ @@ -69,10 +70,6 @@ const openclaw: HostConfig = { coAuthorTrailer: 'Co-Authored-By: OpenClaw Agent ', learningsMode: 'basic', - // SOUL.md ships as a static file alongside generated skills - staticFiles: { - 'SOUL.md': 'openclaw/SOUL.md', - }, adapter: './scripts/host-adapters/openclaw-adapter', }; diff --git a/investigate/SKILL.md b/investigate/SKILL.md index f69914a1..ab5b2231 100644 --- a/investigate/SKILL.md +++ b/investigate/SKILL.md @@ -99,6 +99,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -225,6 +227,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/land-and-deploy/SKILL.md b/land-and-deploy/SKILL.md index b1e75902..af239456 100644 --- a/land-and-deploy/SKILL.md +++ b/land-and-deploy/SKILL.md @@ -81,6 +81,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -207,6 +209,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/learn/SKILL.md b/learn/SKILL.md index 9afca4c4..28375e5a 100644 --- a/learn/SKILL.md +++ b/learn/SKILL.md @@ -84,6 +84,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -210,6 +212,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/office-hours/SKILL.md b/office-hours/SKILL.md index c3cceba3..289ae646 100644 --- a/office-hours/SKILL.md +++ b/office-hours/SKILL.md @@ -91,6 +91,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -217,6 +219,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/open-gstack-browser/SKILL.md b/open-gstack-browser/SKILL.md index 31757899..fad2736b 100644 --- a/open-gstack-browser/SKILL.md +++ b/open-gstack-browser/SKILL.md @@ -81,6 +81,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -207,6 +209,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/openclaw/gstack-full-CLAUDE.md b/openclaw/gstack-full-CLAUDE.md new file mode 100644 index 00000000..0cca47a4 --- /dev/null +++ b/openclaw/gstack-full-CLAUDE.md @@ -0,0 +1,12 @@ +# gstack-full Pipeline + +Injected by the orchestrator for complete feature builds. Append to existing CLAUDE.md. + +## Full Pipeline +1. Read CLAUDE.md and understand the project context. +2. Run /autoplan to review your approach (CEO + eng + design review pipeline). +3. Implement the approved plan. Follow the planning discipline above. +4. Run /ship to create a PR with tests, changelog, and version bump. +5. Report back: PR URL, what shipped, decisions made, anything uncertain. + +Do not ask for human input until the PR is ready for review. diff --git a/openclaw/gstack-lite-CLAUDE.md b/openclaw/gstack-lite-CLAUDE.md new file mode 100644 index 00000000..a6e0d1d3 --- /dev/null +++ b/openclaw/gstack-lite-CLAUDE.md @@ -0,0 +1,12 @@ +# gstack-lite Planning Discipline + +Injected by the orchestrator into spawned Claude Code sessions. Append to existing CLAUDE.md. + +## Planning Discipline +1. Read every file you will modify. Understand existing patterns first. +2. Before writing code, state your plan: what, why, which files, test case, risk. +3. When ambiguous, prefer: completeness over shortcuts, existing patterns over new ones, + reversible choices over irreversible ones, safe defaults over clever ones. +4. Self-review your changes before reporting done. Check for: missed files, broken + imports, untested paths, style inconsistencies. +5. Report when done: what shipped, what decisions you made, anything uncertain. diff --git a/openclaw/gstack-plan-CLAUDE.md b/openclaw/gstack-plan-CLAUDE.md new file mode 100644 index 00000000..d1a32ef1 --- /dev/null +++ b/openclaw/gstack-plan-CLAUDE.md @@ -0,0 +1,20 @@ +# gstack-plan: Full Review Gauntlet + +Injected by the orchestrator when the user wants to plan a Claude Code project. +Append to existing CLAUDE.md. + +## Planning Pipeline +1. Read CLAUDE.md and understand the project context. +2. Run /office-hours to produce a design doc (problem statement, premises, alternatives). +3. Run /autoplan to review the design (CEO + eng + design + DX reviews + codex adversarial). +4. Save the final reviewed plan to a file the orchestrator can reference later. + Write it to: plans/-plan-.md in the current repo. + Include the design doc, all review decisions, and the implementation sequence. +5. Report back to the orchestrator: + - Plan file path + - One-paragraph summary of what was designed and the key decisions + - List of accepted scope expansions (if any) + - Recommended next step (usually: spawn a new session with gstack-full to implement) + +Do not implement anything. This is planning only. +The orchestrator will persist the plan link to its own memory/knowledge store. diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index 3cafdb6f..716ee652 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -87,6 +87,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -213,6 +215,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/plan-design-review/SKILL.md b/plan-design-review/SKILL.md index 7d24477b..0779ee2c 100644 --- a/plan-design-review/SKILL.md +++ b/plan-design-review/SKILL.md @@ -85,6 +85,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -211,6 +213,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/plan-devex-review/SKILL.md b/plan-devex-review/SKILL.md index 6c2547ca..4df9a521 100644 --- a/plan-devex-review/SKILL.md +++ b/plan-devex-review/SKILL.md @@ -89,6 +89,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -215,6 +217,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index 32f3d979..1634f28f 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -87,6 +87,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -213,6 +215,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index e49088c7..a34932b5 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -83,6 +83,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -209,6 +211,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/qa/SKILL.md b/qa/SKILL.md index 06e23e6f..fcffb10f 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -89,6 +89,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -215,6 +217,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/retro/SKILL.md b/retro/SKILL.md index 6b059aee..cbbabdc5 100644 --- a/retro/SKILL.md +++ b/retro/SKILL.md @@ -82,6 +82,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -208,6 +210,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/review/SKILL.md b/review/SKILL.md index 8c88d0e2..43b6c200 100644 --- a/review/SKILL.md +++ b/review/SKILL.md @@ -85,6 +85,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -211,6 +213,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/scripts/gen-skill-docs.ts b/scripts/gen-skill-docs.ts index 3ecd9d56..4da9203f 100644 --- a/scripts/gen-skill-docs.ts +++ b/scripts/gen-skill-docs.ts @@ -507,11 +507,16 @@ for (const currentHost of hostsToRun) { let hasChanges = false; const tokenBudget: Array<{ skill: string; lines: number; tokens: number }> = []; + const currentHostConfig = getHostConfig(currentHost); for (const tmplPath of findTemplates()) { - // Skip skills listed in host config's generation.skipSkills - const currentHostConfig = getHostConfig(currentHost); + const dir = path.basename(path.dirname(tmplPath)); + + // includeSkills allowlist (union logic: include minus skip) + if (currentHostConfig.generation.includeSkills?.length) { + if (!currentHostConfig.generation.includeSkills.includes(dir)) continue; + } + // skipSkills denylist (subtracts from includeSkills or full set) if (currentHostConfig.generation.skipSkills?.length) { - const dir = path.basename(path.dirname(tmplPath)); if (currentHostConfig.generation.skipSkills.includes(dir)) continue; } @@ -539,6 +544,68 @@ for (const currentHost of hostsToRun) { tokenBudget.push({ skill: relOutput, lines, tokens }); } + // Generate gstack-lite and gstack-full for OpenClaw host + if (currentHost === 'openclaw' && !DRY_RUN) { + const openclawDir = path.join(ROOT, 'openclaw'); + if (!fs.existsSync(openclawDir)) fs.mkdirSync(openclawDir, { recursive: true }); + + const gstackLite = `# gstack-lite Planning Discipline + +Injected by the orchestrator into spawned Claude Code sessions. Append to existing CLAUDE.md. + +## Planning Discipline +1. Read every file you will modify. Understand existing patterns first. +2. Before writing code, state your plan: what, why, which files, test case, risk. +3. When ambiguous, prefer: completeness over shortcuts, existing patterns over new ones, + reversible choices over irreversible ones, safe defaults over clever ones. +4. Self-review your changes before reporting done. Check for: missed files, broken + imports, untested paths, style inconsistencies. +5. Report when done: what shipped, what decisions you made, anything uncertain. +`; + fs.writeFileSync(path.join(openclawDir, 'gstack-lite-CLAUDE.md'), gstackLite); + console.log('GENERATED: openclaw/gstack-lite-CLAUDE.md'); + + const gstackFull = `# gstack-full Pipeline + +Injected by the orchestrator for complete feature builds. Append to existing CLAUDE.md. + +## Full Pipeline +1. Read CLAUDE.md and understand the project context. +2. Run /autoplan to review your approach (CEO + eng + design review pipeline). +3. Implement the approved plan. Follow the planning discipline above. +4. Run /ship to create a PR with tests, changelog, and version bump. +5. Report back: PR URL, what shipped, decisions made, anything uncertain. + +Do not ask for human input until the PR is ready for review. +`; + fs.writeFileSync(path.join(openclawDir, 'gstack-full-CLAUDE.md'), gstackFull); + console.log('GENERATED: openclaw/gstack-full-CLAUDE.md'); + + const gstackPlan = `# gstack-plan: Full Review Gauntlet + +Injected by the orchestrator when the user wants to plan a Claude Code project. +Append to existing CLAUDE.md. + +## Planning Pipeline +1. Read CLAUDE.md and understand the project context. +2. Run /office-hours to produce a design doc (problem statement, premises, alternatives). +3. Run /autoplan to review the design (CEO + eng + design + DX reviews + codex adversarial). +4. Save the final reviewed plan to a file the orchestrator can reference later. + Write it to: plans/-plan-.md in the current repo. + Include the design doc, all review decisions, and the implementation sequence. +5. Report back to the orchestrator: + - Plan file path + - One-paragraph summary of what was designed and the key decisions + - List of accepted scope expansions (if any) + - Recommended next step (usually: spawn a new session with gstack-full to implement) + +Do not implement anything. This is planning only. +The orchestrator will persist the plan link to its own memory/knowledge store. +`; + fs.writeFileSync(path.join(openclawDir, 'gstack-plan-CLAUDE.md'), gstackPlan); + console.log('GENERATED: openclaw/gstack-plan-CLAUDE.md'); + } + if (DRY_RUN && hasChanges) { console.error(`\nGenerated SKILL.md files are stale (${currentHost} host). Run: bun run gen:skill-docs --host ${currentHost}`); if (HOST_ARG_VAL !== 'all') process.exit(1); diff --git a/scripts/host-config.ts b/scripts/host-config.ts index 240fb0d4..4421c4a7 100644 --- a/scripts/host-config.ts +++ b/scripts/host-config.ts @@ -62,6 +62,8 @@ export interface HostConfig { metadataFormat?: string | null; /** Skill directories to exclude from generation for this host. */ skipSkills?: string[]; + /** Skill directories to include (allowlist). Union logic: include minus skip. */ + includeSkills?: string[]; }; // --- Content Rewrites --- diff --git a/scripts/resolvers/preamble.ts b/scripts/resolvers/preamble.ts index 56989bef..732a51a4 100644 --- a/scripts/resolvers/preamble.ts +++ b/scripts/resolvers/preamble.ts @@ -89,6 +89,8 @@ fi _ROUTING_DECLINED=$(${ctx.paths.binDir}/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true \`\`\``; } @@ -226,6 +228,15 @@ Say "No problem. You can add routing rules later by running \`gstack-config set This only happens once per project. If \`HAS_ROUTING\` is \`yes\` or \`ROUTING_DECLINED\` is \`true\`, skip this entirely.`; } +function generateSpawnedSessionCheck(): string { + return `If \`SPAWNED_SESSION\` is \`"true"\`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain.`; +} + function generateAskUserFormat(_ctx: TemplateContext): string { return `## AskUserQuestion Format @@ -675,6 +686,7 @@ export function generatePreamble(ctx: TemplateContext): string { generateTelemetryPrompt(ctx), generateProactivePrompt(ctx), generateRoutingInjection(ctx), + generateSpawnedSessionCheck(), generateVoiceDirective(tier), ...(tier >= 2 ? [generateContextRecovery(ctx), generateAskUserFormat(ctx), generateCompletenessSection()] : []), ...(tier >= 3 ? [generateRepoModeSection(), generateSearchBeforeBuildingSection(ctx)] : []), diff --git a/setup b/setup index 19adc73d..fd298140 100755 --- a/setup +++ b/setup @@ -46,7 +46,19 @@ done case "$HOST" in claude|codex|kiro|factory|auto) ;; - *) echo "Unknown --host value: $HOST (expected claude, codex, kiro, factory, or auto)" >&2; exit 1 ;; + openclaw) + echo "" + echo "OpenClaw integration uses a different model — OpenClaw spawns Claude Code" + echo "sessions natively via ACP. gstack provides methodology artifacts, not a" + echo "full skill installation." + echo "" + echo "To integrate gstack with OpenClaw:" + echo " 1. Tell your OpenClaw agent: 'install gstack for openclaw'" + echo " 2. Or generate artifacts: bun run gen:skill-docs --host openclaw" + 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 ;; esac # ─── Resolve skill prefix preference ───────────────────────── diff --git a/setup-browser-cookies/SKILL.md b/setup-browser-cookies/SKILL.md index 549c4d25..717d6405 100644 --- a/setup-browser-cookies/SKILL.md +++ b/setup-browser-cookies/SKILL.md @@ -79,6 +79,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -205,6 +207,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice **Tone:** direct, concrete, sharp, never corporate, never academic. Sound like a builder, not a consultant. Name the file, the function, the command. No filler, no throat-clearing. diff --git a/setup-deploy/SKILL.md b/setup-deploy/SKILL.md index 0dfd1df4..6791b956 100644 --- a/setup-deploy/SKILL.md +++ b/setup-deploy/SKILL.md @@ -85,6 +85,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -211,6 +213,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/ship/SKILL.md b/ship/SKILL.md index 25afbb03..34cfaa7b 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -86,6 +86,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -212,6 +214,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. diff --git a/test/fixtures/golden/claude-ship-SKILL.md b/test/fixtures/golden/claude-ship-SKILL.md index 4886ea03..34cfaa7b 100644 --- a/test/fixtures/golden/claude-ship-SKILL.md +++ b/test/fixtures/golden/claude-ship-SKILL.md @@ -86,6 +86,8 @@ fi _ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -212,6 +214,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. @@ -443,6 +452,31 @@ artifacts that inform the plan, not code changes: These are read-only in spirit — they inspect the live site, generate visual artifacts, or get independent opinions. They do NOT modify project source files. +## Skill Invocation During Plan Mode + +If a user invokes a skill during plan mode, that invoked skill workflow takes +precedence over generic plan mode behavior until it finishes or the user explicitly +cancels that skill. + +Treat the loaded skill as executable instructions, not reference material. Follow +it step by step. Do not summarize, skip, reorder, or shortcut its steps. + +If the skill says to use AskUserQuestion, do that. Those AskUserQuestion calls +satisfy plan mode's requirement to end turns with AskUserQuestion. + +If the skill reaches a STOP point, stop immediately at that point, ask the required +question if any, and wait for the user's response. Do not continue the workflow +past a STOP point, and do not call ExitPlanMode at that point. + +If the skill includes commands marked "PLAN MODE EXCEPTION — ALWAYS RUN," execute +them. The skill may edit the plan file, and other writes are allowed only if they +are already permitted by Plan Mode Safe Operations or explicitly marked as a plan +mode exception. + +Only call ExitPlanMode after the active skill workflow is complete and there are no +other invoked skill workflows left to run, or if the user explicitly tells you to +cancel the skill or leave plan mode. + ## Plan Status Footer When you are in plan mode and about to call ExitPlanMode: diff --git a/test/fixtures/golden/codex-ship-SKILL.md b/test/fixtures/golden/codex-ship-SKILL.md index 6331b650..ec0116f0 100644 --- a/test/fixtures/golden/codex-ship-SKILL.md +++ b/test/fixtures/golden/codex-ship-SKILL.md @@ -80,6 +80,8 @@ fi _ROUTING_DECLINED=$($GSTACK_BIN/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -206,6 +208,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. @@ -437,6 +446,31 @@ artifacts that inform the plan, not code changes: These are read-only in spirit — they inspect the live site, generate visual artifacts, or get independent opinions. They do NOT modify project source files. +## Skill Invocation During Plan Mode + +If a user invokes a skill during plan mode, that invoked skill workflow takes +precedence over generic plan mode behavior until it finishes or the user explicitly +cancels that skill. + +Treat the loaded skill as executable instructions, not reference material. Follow +it step by step. Do not summarize, skip, reorder, or shortcut its steps. + +If the skill says to use AskUserQuestion, do that. Those AskUserQuestion calls +satisfy plan mode's requirement to end turns with AskUserQuestion. + +If the skill reaches a STOP point, stop immediately at that point, ask the required +question if any, and wait for the user's response. Do not continue the workflow +past a STOP point, and do not call ExitPlanMode at that point. + +If the skill includes commands marked "PLAN MODE EXCEPTION — ALWAYS RUN," execute +them. The skill may edit the plan file, and other writes are allowed only if they +are already permitted by Plan Mode Safe Operations or explicitly marked as a plan +mode exception. + +Only call ExitPlanMode after the active skill workflow is complete and there are no +other invoked skill workflows left to run, or if the user explicitly tells you to +cancel the skill or leave plan mode. + ## Plan Status Footer When you are in plan mode and about to call ExitPlanMode: diff --git a/test/fixtures/golden/factory-ship-SKILL.md b/test/fixtures/golden/factory-ship-SKILL.md index 04dcfd5c..95f05111 100644 --- a/test/fixtures/golden/factory-ship-SKILL.md +++ b/test/fixtures/golden/factory-ship-SKILL.md @@ -82,6 +82,8 @@ fi _ROUTING_DECLINED=$($GSTACK_BIN/gstack-config get routing_declined 2>/dev/null || echo "false") echo "HAS_ROUTING: $_HAS_ROUTING" echo "ROUTING_DECLINED: $_ROUTING_DECLINED" +# Detect spawned session (OpenClaw or other orchestrator) +[ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not @@ -208,6 +210,13 @@ Say "No problem. You can add routing rules later by running `gstack-config set r This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely. +If `SPAWNED_SESSION` is `"true"`, you are running inside a session spawned by an +AI orchestrator (e.g., OpenClaw). In spawned sessions: +- Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option. +- Do NOT run upgrade checks, telemetry prompts, routing injection, or lake intro. +- Focus on completing the task and reporting results via prose output. +- End with a completion report: what shipped, decisions made, anything uncertain. + ## Voice You are GStack, an open source AI builder framework shaped by Garry Tan's product, startup, and engineering judgment. Encode how he thinks, not his biography. @@ -439,6 +448,31 @@ artifacts that inform the plan, not code changes: These are read-only in spirit — they inspect the live site, generate visual artifacts, or get independent opinions. They do NOT modify project source files. +## Skill Invocation During Plan Mode + +If a user invokes a skill during plan mode, that invoked skill workflow takes +precedence over generic plan mode behavior until it finishes or the user explicitly +cancels that skill. + +Treat the loaded skill as executable instructions, not reference material. Follow +it step by step. Do not summarize, skip, reorder, or shortcut its steps. + +If the skill says to use AskUserQuestion, do that. Those AskUserQuestion calls +satisfy plan mode's requirement to end turns with AskUserQuestion. + +If the skill reaches a STOP point, stop immediately at that point, ask the required +question if any, and wait for the user's response. Do not continue the workflow +past a STOP point, and do not call ExitPlanMode at that point. + +If the skill includes commands marked "PLAN MODE EXCEPTION — ALWAYS RUN," execute +them. The skill may edit the plan file, and other writes are allowed only if they +are already permitted by Plan Mode Safe Operations or explicitly marked as a plan +mode exception. + +Only call ExitPlanMode after the active skill workflow is complete and there are no +other invoked skill workflows left to run, or if the user explicitly tells you to +cancel the skill or leave plan mode. + ## Plan Status Footer When you are in plan mode and about to call ExitPlanMode: diff --git a/test/host-config.test.ts b/test/host-config.test.ts index acd6c24a..7c667710 100644 --- a/test/host-config.test.ts +++ b/test/host-config.test.ts @@ -484,9 +484,17 @@ describe('host config correctness', () => { expect(openclaw.adapter).toContain('openclaw-adapter'); }); - test('openclaw has staticFiles for SOUL.md', () => { - expect(openclaw.staticFiles).toBeDefined(); - expect(openclaw.staticFiles!['SOUL.md']).toBeDefined(); + test('openclaw has no staticFiles (SOUL.md removed)', () => { + expect(openclaw.staticFiles).toBeUndefined(); + }); + + test('openclaw has includeSkills for native methodology skills', () => { + expect(openclaw.generation.includeSkills).toBeDefined(); + expect(openclaw.generation.includeSkills).toContain('office-hours'); + expect(openclaw.generation.includeSkills).toContain('plan-ceo-review'); + expect(openclaw.generation.includeSkills).toContain('investigate'); + expect(openclaw.generation.includeSkills).toContain('retro'); + expect(openclaw.generation.includeSkills!.length).toBe(4); }); test('every host has coAuthorTrailer or undefined', () => {