You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cb9ccf2
Browse filesBrowse the repository at this point in the historyBrowse files
authored
v1.91.158.0 feat(config): plan_mode_preamble=off drops the plan-mode preamble from installed skills (port of #3213) (#3308)
* feat(gen-skill-docs): add --plan-mode=off to omit the plan-mode preamble (#3168)
Generated skills ship a ~1.8 KB "## Plan Mode Safe Operations" +
"## Skill Invocation During Plan Mode" block on every skill, for hosts
and users who never enter plan mode. This adds a --plan-mode=off flag to
gen-skill-docs that drops that block at gen time. Default builds
(planMode undefined or true) keep the block byte-identically.
The "PLAN MODE EXCEPTION — ALWAYS RUN" markers inside skill bodies
still apply when the flag is off.
(cherry picked from commit 51edee9)
* style(types): fix stray indentation on TemplateContext.installRoot
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* feat(config): plan_mode_preamble key wires --plan-mode=off into setup and every installed render
gstack-config plan_mode_preamble (on|off, default on) makes ./setup pass
--plan-mode=off to every gen:skill-docs render, gbrain-refresh and the
gstack-relink router render. The default Claude install, which otherwise
serves the committed SKILL.md files, gets a plain render with the key off;
the activation record notes plan_mode=off so switching back on removes the
render, including on the gbrain=unknown keep branch. With the key on or
unset every path and record is byte-for-byte unchanged.
Fixes#3168. Finishes #3213 by @xingzihai.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* fix(setup,relink): plan_mode_preamble=off survives builds and failed renders; alias follows the router
Review findings on the plan_mode_preamble wiring:
- a build renders env hosts without --plan-mode=off, so with the key off
setup no longer skips their re-render after a build;
- with the key off the gbrain-absent branch leaves the render to the plain
re-render, so a failed render keeps the previous one;
- gstack-relink refreshes the _gstack-command alias after re-rendering the
router (also fixes the same staleness for disabled_skills).
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
---------
Co-authored-by: xingzihai <xingzihai@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,21 @@
1
1
# Changelog
2
2
3
+
## [1.91.158.0] - 2026-10-19
4
+
5
+
**`gstack-config set plan_mode_preamble off` leaves the plan-mode preamble out of every installed skill, for people who never use plan mode.** The "Plan Mode Safe Operations" and "Skill Invocation During Plan Mode" sections add about 1.6 KB to each of 50 Claude skills. With the key off, the next `./setup` renders every host's skills with `gen-skill-docs --plan-mode=off`, and the default Claude install serves that render instead of the committed files. The default is on, and with it on every render and the committed SKILL.md files are byte-for-byte unchanged.
6
+
7
+
### Added
8
+
- **`gen-skill-docs --plan-mode=off`** drops the two sections at generation time. Commands marked "PLAN MODE EXCEPTION — ALWAYS RUN" keep their marker. Hosts whose capabilities declare no plan mode already render the sections empty, so in practice the flag matters for Claude, Copilot and OpenCode. Fixes #3168. From #3213 by @xingzihai, finished with the config wiring.
9
+
- **The `plan_mode_preamble` config key** (`on` | `off`, default `on`). It is a closed domain like `explain_level`: an unknown value warns and stores `on`. Setting it outside `./setup` says it applies on the next setup run and prints the `./setup --refresh-registered` command that applies it now.
10
+
- **Every installed render carries the choice:** all 16 `gen:skill-docs` call sites in `setup`, the Claude render helper, `gstack-config gbrain-refresh`, and the router that `gstack-relink` re-renders in place (as it already does for `disabled_skills`). When setup has to build, `scripts/build.sh` renders Factory, OpenCode, Cursor, Copilot and Antigravity without the flag, so with the key off setup renders those hosts again afterwards.
11
+
- **The default Claude install gets a render when the key is off.** Without a working gbrain (absent, or the detector failed), `gstack_claude_render_action` returns `plain` instead of serving the committed files; with gbrain the brain-aware render already runs and now carries the flag too. The activation record (`~/.gstack/render/claude.overlay`) gains `plan_mode=off`. Turning the key back on removes that render on the next setup when gbrain is absent or its detector fails (a failed detector otherwise keeps a render), and re-renders the brain-aware render with the sections when gbrain is present. A failed render with the key off keeps the previous render. Records written with the key on are unchanged.
12
+
13
+
### Fixed
14
+
- **`gstack-relink` refreshes the `_gstack-command` router alias after it re-renders the router.** It used to copy the router before the re-render, so the alias kept the previous router (with `disabled_skills`, the full skill list) until the next relink.
15
+
16
+
### Changed
17
+
- **Gate integrity:** new tests `test/plan-mode-off-build.test.ts` (from #3213, unchanged), `test/plan-mode-off-generation.test.ts`, `test/plan-mode-preamble-config.test.ts`, `test/plan-mode-preamble-render.test.ts` and `test/plan-mode-preamble-setup.test.ts`. No existing test was edited, and no threshold, trial count, case kind or judge changed.
18
+
3
19
## [1.91.157.0] - 2026-10-19
4
20
5
21
**Claude SKILL.md files no longer carry a "When to invoke" body section, which saves about 20 KB across 56 skills.** Claude Code reads a skill's body only after the skill is invoked, so routing prose there never routed anything. Routing still comes from the catalog description and the CLAUDE.md routing block, and voice triggers move into the root router's routing block. From #3129 by @thanhnguyentung95.
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -797,6 +797,8 @@ types into that element; bare `browse type <text>` types into whatever has focus
797
797
798
798
**Don't use some skills?**`gstack-config set disabled_skills make-pdf,pair-agent` stops registering them on every host, so their descriptions stop loading into each session. Claude Code updates right away; other hosts on their next `./setup --host <name>` or `/gstack-upgrade`. Their files stay installed, so a skill that calls a disabled one still works (you get a warning). Typos are rejected with the closest skill name, `gstack-upgrade` can't be disabled, and `gstack-config set disabled_skills ""` re-enables everything.
799
799
800
+
**Never use plan mode?**`gstack-config set plan_mode_preamble off` leaves the "Plan Mode Safe Operations" and "Skill Invocation During Plan Mode" sections (about 1.6 KB per skill) out of every installed skill on the next `./setup` run; the command prints the exact `./setup --refresh-registered` line that applies it. Claude Code then serves a render under `~/.gstack/render/claude` instead of the committed files. Commands marked "PLAN MODE EXCEPTION — ALWAYS RUN" keep their marker. `gstack-config set plan_mode_preamble on` (the default) and another `./setup` bring the sections back. It matters for Claude Code, Copilot and OpenCode: hosts without plan mode (Codex and others) never carry these sections.
801
+
800
802
**Want namespaced commands?**`cd ~/.claude/skills/gstack && ./setup --prefix` — switches from `/qa` to `/gstack-qa`. Useful if you run other skill packs alongside gstack.
801
803
802
804
**Codex says "Skipped loading skill(s) due to invalid SKILL.md"?** Your Codex skill descriptions are stale. `${CODEX_HOME:-~/.codex}/skills/gstack` is a runtime directory, not the checkout: `./setup --status` shows the Codex row's source checkout. Fix: `cd <that source> && git pull && ./setup --host codex` — for a repo-local install, run it from inside the project.
# Installed skills are rendered by ./setup, so the preamble choice lands
1001
+
# on its next run (every registered host).
1002
+
if [ "$KEY"="plan_mode_preamble" ] && [ -z"${GSTACK_SETUP_RUNNING:-}" ];then
1003
+
printf'gstack-config: plan_mode_preamble=%s applies on the next ./setup run. Apply now: cd %q && ./setup --refresh-registered\n'"$VALUE""$(cd "$(dirname "$0")/.."&& pwd)"
1004
+
fi
988
1005
;;
989
1006
unset)
990
1007
KEY="${2:?Usage: gstack-config unset <key>}"
@@ -1009,7 +1026,7 @@ $_gstack_legacy_root"
1009
1026
echo"# ─── Active values (including defaults for unset keys) ───"
# generated SKILL.md files match your installation state.
1066
1083
SCRIPT_DIR="$(cd "$(dirname "$0")"&& pwd)"
1067
1084
."$SCRIPT_DIR/gstack-render-claude.sh"2>/dev/null || { echo"$0: $SCRIPT_DIR/gstack-render-claude.sh is missing. fix: reinstall with ./setup or /gstack-upgrade">&2;exit 1; }
1085
+
_PLAN_MODE_ARG=""
1086
+
[ "$("$0" get plan_mode_preamble 2>/dev/null || true)"!= off ] || _PLAN_MODE_ARG="--plan-mode=off"
1068
1087
DETECT_BIN="$SCRIPT_DIR/gstack-gbrain-detect"
1069
1088
DETECTION_FILE="$STATE_DIR/gbrain-detection.json"
1070
1089
mkdir -p "$STATE_DIR"
@@ -1133,7 +1152,7 @@ $_gstack_legacy_root"
1133
1152
gstack_claude_overlay "$INSTALL_DIR""$0"
1134
1153
RENDER_TMP="$RENDER_DIR.tmp.$$"
1135
1154
rm -rf "$RENDER_TMP"
1136
-
if ( cd"$INSTALL_DIR"&& bun run gen:skill-docs:user --host claude --out-dir "$RENDER_TMP" --link-root "$RENDER_DIR" --model "$_GSTACK_OVERLAY">/dev/null 2>&1 );then
1155
+
if ( cd"$INSTALL_DIR"&& bun run gen:skill-docs:user --host claude --out-dir "$RENDER_TMP" --link-root "$RENDER_DIR" --model "$_GSTACK_OVERLAY"${_PLAN_MODE_ARG:+"$_PLAN_MODE_ARG"}>/dev/null 2>&1 );then
1137
1156
gstack_render_lock "$RENDER_DIR"
1138
1157
_swap_in_render "$RENDER_DIR""$RENDER_TMP"
1139
1158
gstack_render_unlock "$RENDER_DIR"
@@ -1159,7 +1178,7 @@ $_gstack_legacy_root"
1159
1178
# brain blocks, so removing gbrain keeps the chosen overlay.
if [ -n"$_ROUTER_TMP" ] &&command -v bun >/dev/null 2>&1 \
471
-
&& (cd "$_GEN_SRC"&& bun run scripts/gen-skill-docs.ts --host claude --out-dir "$_ROUTER_TMP"${_DISABLED_CSV:+"--disabled-skills=$_DISABLED_CSV"}>/dev/null 2>&1) \
477
+
&& (cd "$_GEN_SRC"&& bun run scripts/gen-skill-docs.ts --host claude --out-dir "$_ROUTER_TMP"${_DISABLED_CSV:+"--disabled-skills=$_DISABLED_CSV"}${_PLAN_MODE_ARG:+"$_PLAN_MODE_ARG"}>/dev/null 2>&1) \
[ -n"$_DISABLED_CSV" ] &&echo"Router: disabled skills left out of $_ROUTER"
474
481
else
475
482
rm -f "$_ROUTER.tmp.$$"
476
-
echo"gstack-relink: could not re-render the router for disabled_skills (bun missing or generation failed); $_ROUTERstill lists every skill. Fix: install Bun, then run $0">&2
483
+
echo"gstack-relink: could not re-render the router for disabled_skills or plan_mode_preamble (bun missing or generation failed); $_ROUTERis unchanged. Fix: install Bun, then run $0">&2
local src="$1" RENDER_DIR="$2" RENDER_TMP out rc=0
103
111
RENDER_TMP="$RENDER_DIR.tmp.$$"
104
112
rm -rf "$RENDER_TMP"
105
-
_gstack_render_say "Rendering Claude skills with the $_GSTACK_OVERLAY overlay into $RENDER_DIR (source checkout stays clean)..."
106
-
out="$(cd "$src"&& _gstack_render_bun run gen:skill-docs --host claude --out-dir "$RENDER_TMP" --link-root "$RENDER_DIR" --model "$_GSTACK_OVERLAY"${_DISABLED_CSV:+"--disabled-skills=$_DISABLED_CSV"}2>&1)"|| rc=$?
113
+
_gstack_render_say "Rendering Claude skills with the $_GSTACK_OVERLAY overlay${_PLAN_MODE_ARG:+ and no plan-mode preamble} into $RENDER_DIR (source checkout stays clean)..."
114
+
out="$(cd "$src"&& _gstack_render_bun run gen:skill-docs --host claude --out-dir "$RENDER_TMP" --link-root "$RENDER_DIR" --model "$_GSTACK_OVERLAY"${_DISABLED_CSV:+"--disabled-skills=$_DISABLED_CSV"}${_PLAN_MODE_ARG:+"$_PLAN_MODE_ARG"}2>&1)"|| rc=$?
0 commit comments