Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ installs and passes the conformance tests but has no certification run yet;
| Hermes | experimental | `--host hermes` (every skill in `$HERMES_HOME/skills/gstack`; automatic when setup runs inside Hermes) | ask for the task, or `/gstack-review` | advisory, not blocked | — | `./setup --host hermes` |
| GBrain (mod) | instruction-only | `--host gbrain` (brain-aware variants ship from the GBrain repo) | — | advisory, not blocked | — | — |

Per-host notes (agent harnesses, Copilot, Antigravity, Gemini CLI, OpenClaw and ClawHub, the Codex behavioral profile and model tiers, outside-review providers, the design binary's models) are in [docs/hosts.md](docs/hosts.md). Any rules-reading agent (Zed, Amp, Jules) can use the 2KB [agents digest](agents-digest/gstack-AGENTS.md) with no install. Adding a host: [docs/ADDING_A_HOST.md](docs/ADDING_A_HOST.md).
Per-host notes (agent harnesses, Copilot, Antigravity, Gemini CLI, OpenClaw native skills, the Codex behavioral profile and model tiers, outside-review providers, the design binary's models) are in [docs/hosts.md](docs/hosts.md). Any rules-reading agent (Zed, Amp, Jules) can use the 2KB [agents digest](agents-digest/gstack-AGENTS.md) with no install. Adding a host: [docs/ADDING_A_HOST.md](docs/ADDING_A_HOST.md).

## See it work

Expand Down Expand Up @@ -262,7 +262,7 @@ On Windows without Developer Mode (MSYS2 / Git Bash), `setup` falls back to file
| [gstack + Capy: the software factory](capy/README.md) | What we built with Capy Captains and gstack, how the pieces fit, the measured before/after, tips, and how Garry uses it |
| [Why gstack](docs/why-gstack.md) | The story, the productivity numbers and their caveats, Karpathy's failure modes, parallel sprints |
| [Install details](docs/install.md) | Setup timing, requirements in detail, team mode, the hooks setup registers, agent harness registration |
| [Other agents](docs/hosts.md) | Agent harnesses (OpenClaw, Hermes, dots, QM, Muse Code, Grok, any other), OpenClaw and ClawHub, per-host notes, the Codex profile and model tiers, outside-review providers, the design binary's models |
| [Other agents](docs/hosts.md) | Agent harnesses (OpenClaw, Hermes, dots, QM, Muse Code, Grok, any other), OpenClaw native skills, per-host notes, the Codex profile and model tiers, outside-review providers, the design binary's models |
| [QA without a webpage](docs/qa-without-a-webpage.md) | `/qa` and `/qa-only` on CLIs, APIs, jobs, workers and webhooks |
| [Standalone binaries](docs/standalone-binaries.md) | The standalone `gstack-*` CLIs (egress auditor, context bill, model benchmark, the review and evidence ledgers, the iOS QA daemon), and the CSO evaluation producer contract |
| [Privacy & Telemetry](docs/privacy.md) | What is sent, what never is, the update check, outside reviews, egress receipts |
Expand Down
4 changes: 3 additions & 1 deletion bin/gstack-config
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,9 @@ $_gstack_legacy_root"
gstack_claude_overlay "$INSTALL_DIR" "$0"
RENDER_TMP="$RENDER_DIR.tmp.$$"
rm -rf "$RENDER_TMP"
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"} ${_LOADOUT_ARG:+"$_LOADOUT_ARG"} >/dev/null 2>&1 ); then
_skill_prefix="$("$0" get skill_prefix 2>/dev/null || echo false)"
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"} ${_LOADOUT_ARG:+"$_LOADOUT_ARG"} >/dev/null 2>&1 \
&& "$INSTALL_DIR/bin/gstack-patch-names" "$RENDER_TMP" "$_skill_prefix" >/dev/null ); then
gstack_render_lock "$RENDER_DIR"
_swap_in_render "$RENDER_DIR" "$RENDER_TMP"
gstack_render_unlock "$RENDER_DIR"
Expand Down
9 changes: 5 additions & 4 deletions bin/gstack-issue-links
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { spawnSync } from 'node:child_process';
import * as fs from 'node:fs';
import * as path from 'node:path';
import { EXIT, exitTableHelp } from '../lib/headless-artifacts';
import { lineSources, mentionsIn, promotionCandidates, receiptIssues, relatedPrs, renderIssueLines, resolveLinks, selectFlakes, type ClosingPr, type FlakeLink, type IssueMention, type IssueRow } from '../lib/issue-links';
import { lineSources, mentionsIn, ownRepoMentions, promotionCandidates, receiptIssues, relatedPrs, renderIssueLines, resolveLinks, selectFlakes, type ClosingPr, type FlakeLink, type IssueMention, type IssueRow } from '../lib/issue-links';
import { resultLine, resultLineWithDocs } from '../lib/result-codes';
import { resolveBaseBranch } from '../lib/ship-policy';

Expand Down Expand Up @@ -143,19 +143,20 @@ function main(argv: string[]): number {

const log = git(['log', '--format=%H%n%B%x00', `origin/${base}..HEAD`], repoRoot) ?? git(['log', '--format=%H%n%B%x00', `${base}..HEAD`], repoRoot);
if (log === undefined) { process.stderr.write(`gstack-issue-links: cannot read commits ${base}..HEAD (fetch origin/${base} first)\n`); return EXIT.usage; }
const mentions: IssueMention[] = [];
const named: IssueMention[] = [];
for (const entry of log.split('\0')) {
const nl = entry.indexOf('\n');
if (nl < 0) continue;
mentions.push(...mentionsIn(entry.slice(nl + 1), `commit ${entry.slice(0, nl).trim().slice(0, 12)}`));
named.push(...mentionsIn(entry.slice(nl + 1), `commit ${entry.slice(0, nl).trim().slice(0, 12)}`));
}
const readable = (issue: number): boolean => {
const r = spawnSync(path.join(binDir, 'gstack-issue-guard'), ['issue', String(issue)], { cwd: repoRoot, encoding: 'utf8', timeout: 60_000, maxBuffer: 16 * 1024 * 1024 });
return r.status === 0 && r.stdout.length > 0;
};
const gh = ghLookups(repoRoot);
const needRepo = runs.length > 0 || explicit.length > 0 || (autoLinks && mentions.some(m => m.intent === 'fixes'));
const needRepo = runs.length > 0 || explicit.length > 0 || named.some(m => m.repo?.includes('/')) || (autoLinks && named.some(m => m.intent === 'fixes'));
const repo = flags(argv, '--repo')[0] ?? (needRepo ? gh.json<{ nameWithOwner?: string }>('repository', ['repo', 'view', '--json', 'nameWithOwner'])?.nameWithOwner : undefined);
const mentions = ownRepoMentions(named, repo);

const flakes: FlakeLink[] = [];
const rejectedFlakes: Array<{ issue: number; run: string; reason: string }> = [];
Expand Down
6 changes: 5 additions & 1 deletion bin/gstack-render-claude.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,18 @@ gstack_claude_render_action() {
fi
}

_GSTACK_RENDER_BIN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# gstack_claude_render_plain SOURCE_DIR RENDER_DIR — render the pinned overlay
# without brain blocks into a temp dir and swap it in only on success.
# without brain blocks into a temp dir, apply the saved skill_prefix to its
# name: fields (#4413), and swap it in only on success.
gstack_claude_render_plain() {
local src="$1" RENDER_DIR="$2" RENDER_TMP out rc=0
RENDER_TMP="$RENDER_DIR.tmp.$$"
rm -rf "$RENDER_TMP"
_gstack_render_say "Rendering Claude skills with the $_GSTACK_OVERLAY overlay${_PLAN_MODE_ARG:+ and no plan-mode preamble}${_LOADOUT_ARG:+ and the ${_LOADOUT_ARG#--loadout=} loadout} into $RENDER_DIR (source checkout stays clean)..."
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"} ${_LOADOUT_ARG:+"$_LOADOUT_ARG"} 2>&1)" || rc=$?
[ "$rc" -ne 0 ] || out="$("$_GSTACK_RENDER_BIN/gstack-patch-names" "$RENDER_TMP" "$("$_GSTACK_RENDER_BIN/gstack-config" get skill_prefix 2>/dev/null || echo false)" 2>&1)" || rc=$?
if [ "$rc" -ne 0 ]; then
rm -rf "$RENDER_TMP"
printf '%s\n' "$out" | tail -3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- **`skill_prefix=true` now survives updates when gbrain is installed.** Every Claude re-render (the brain-aware render in `./setup`, `gstack-config gbrain-refresh`, and the pinned-overlay render) applies your saved prefix before it goes live, so skills stay `/gstack-retro`, `/gstack-review` and so on instead of reverting to short names after each update (#4413). Thanks @fliaron for the report.
- The OpenClaw docs no longer send you to ClawHub, which held only April 2026 builds of office-hours, ceo-review and retro and no longer has gstack skills (the docs also said four skills while listing three). `docs/hosts.md` and `docs/OPENCLAW.md` now point to native registration (`./setup --host openclaw`), which already serves the current version of each, and tell you to remove the ClawHub copies if you installed them (#4421). Thanks @exGeni for the report.
- **`gstack-issue-links` no longer reads other repositories' issues as gstack's.** A parenthesis that cites several repositories, such as `(founderstar #837, harness-evals #393)`, now gives each its own cross-repo reference instead of `Refs #837` and `Refs #393` on this repository, and `owner/repo#N` naming the current repository counts as its own issue, so `Fixes garrytan/gstack#N` closes it.
17 changes: 8 additions & 9 deletions docs/OPENCLAW.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,14 @@ 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
Published to ClawHub. Install with `clawhub install`:
- `gstack-openclaw-office-hours` — Product interrogation (6 forcing questions)
- `gstack-openclaw-ceo-review` — Strategic challenge (10-section review, 4 modes)
- `gstack-openclaw-retro` — Operational retrospective (weekly review)
### Methodology skills in the OpenClaw agent
To run /office-hours, /plan-ceo-review or /retro in the OpenClaw agent itself,
use native registration (see [Installation](#installation)): its `gstack` router
skill serves the current version of each.

Source lives in `openclaw/skills/` in the gstack repo. These are hand-crafted
adaptations of the gstack methodology for OpenClaw's conversational context.
No gstack infrastructure (no browser, no telemetry, no preamble).
gstack no longer publishes skills on ClawHub. If you installed the April 2026
`gstack-openclaw-office-hours`, `gstack-openclaw-ceo-review` or
`gstack-openclaw-retro` from there, remove them.

## Spawned session detection

Expand Down Expand Up @@ -175,7 +174,7 @@ 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
2. Register gstack's native skills with `./setup --host openclaw` (below)
3. Add dispatch routing to AGENTS.md
4. Verify with a test spawn

Expand Down
5 changes: 5 additions & 0 deletions docs/OPENCLAW_PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Moved verbatim from CLAUDE.md (token-load reduction).

**Status:** gstack's user docs no longer send anyone to ClawHub (#4421). Native
registration (`./setup --host openclaw`) gives OpenClaw's agent the current
/office-hours, /plan-ceo-review and /retro, and the gstack skills were removed
from ClawHub on 2026-11-17.

## Workflow

Native OpenClaw skills live in `openclaw/skills/gstack-openclaw-*/SKILL.md`. These are
Expand Down
23 changes: 9 additions & 14 deletions docs/hosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,17 @@ when Claude Code has gstack installed. Paste this to your OpenClaw agent:
See [docs/OPENCLAW.md](OPENCLAW.md) for advanced dispatch routing and
the gstack-lite/gstack-full prompt templates.

## Native OpenClaw Skills (via ClawHub)
## /office-hours, /plan-ceo-review and /retro in OpenClaw

Four methodology skills that work directly in your OpenClaw agent, no Claude Code
session needed. Install from ClawHub:
Your OpenClaw agent can run these directly in chat, with no Claude Code session.
They come with native registration: `./setup --host openclaw` registers gstack's
`gstack` router skill, which lists them with every other workflow and serves
the current version of each ([install, verify and remove](#agent-harnesses)).

```
clawhub install gstack-openclaw-office-hours gstack-openclaw-ceo-review gstack-openclaw-retro
```

| Skill | What it does |
|-------|-------------|
| `gstack-openclaw-office-hours` | Product interrogation with 6 forcing questions |
| `gstack-openclaw-ceo-review` | Strategic challenge with 4 scope modes |
| `gstack-openclaw-retro` | Weekly engineering retrospective |

These are conversational skills. Your OpenClaw agent runs them directly via chat.
Earlier docs sent you to ClawHub for `gstack-openclaw-office-hours`,
`gstack-openclaw-ceo-review` and `gstack-openclaw-retro`. Those were April 2026
builds, and gstack no longer publishes skills on ClawHub. If you installed them,
remove them, so your agent doesn't load an old copy next to the current one.

## Which agents a checkout renders for

Expand Down
3 changes: 3 additions & 0 deletions docs/pregate.md
Original file line number Diff line number Diff line change
Expand Up @@ -2278,6 +2278,9 @@ cross-repo `owner/repo#N` are `Refs`. A parenthesised named reference,
token that is not a closure, reference, filler or version word, is a
cross-repo `Refs name#N`, never a same-repo Refs line or a promotion
candidate; `(see #12)`, `(closing #12)` and `(#301)` stay bare refs.
Several in one parenthesis, `(founderstar #837, harness-evals #393)`, are each
their own name's reference. `owner/repo#N` naming this repository is its own
issue, so a `Fixes garrytan/gstack#N` trailer closes it.
Same-repo references are printed as
promotion candidates (`reference #N ← <commit line> (promote: fix #N)` on
stderr, `candidates` in `--json`): the owner's `fix #N` reply reruns with
Expand Down
32 changes: 25 additions & 7 deletions lib/issue-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
* reference, filler or version word (`closing`, `cf.`, `e.g.`, `v1.2`
* name nothing), is a cross-repo reference to `name`: rendered as
* `Refs name#N`, never a same-repo Refs line or a promotion candidate.
* Several in one parenthesis, `(founderstar #837, harness-evals #393)`,
* are each their own name's reference.
* - `owner/repo#N` naming this repository (ownRepoMentions) is this
* repository's own issue, so `Fixes garrytan/gstack#N` closes it.
* - A closure issue that cannot be read through gstack-issue-guard is
* downgraded to `Refs #N` with ISSUE_UNREADABLE (never Fixes).
* - Same-repo references are promotion candidates: the owner's `fix #N`
Expand Down Expand Up @@ -41,12 +45,14 @@ export interface IssueRow { number: number; title?: string; body?: string; autho
/** One `closedByPullRequestsReferences` node of an issue this PR fixes. */
export interface ClosingPr { number: number; state?: string; headRefName?: string; author?: { login?: string } | null; repository?: { nameWithOwner?: string } }

const CLOSURE = /^\s*(?:fix(?:es|ed)?|close[sd]?|resolve[sd]?)\s*:?\s+(?:#|GH-)(\d+)\s*$/i;
const CLOSURE = /^\s*(?:fix(?:es|ed)?|close[sd]?|resolve[sd]?)\s*:?\s+(?:([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)#|#|GH-)(\d+)\s*$/i;
const PARTIAL = /\b(?:partial(?:ly)?|part of|defer(?:red)?|follow-?up|related|refs?|see|context)\b/i;
const CROSS = /\b([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)#(\d+)\b/g;
const BARE = /(?<![A-Za-z0-9_./-])#(\d+)\b/g;
/** `(name #N[, #M]…)`, `(name PR #N)`, `(name issue #N)`: the name, then every number. */
const NAMED = /\(([A-Za-z][\w.-]*(?:\/[\w.-]+)?)\s+(?:(?:PR|issue)\s+)?(#\d+(?:,\s*#\d+)*)\)/gi;
/** One `name #N[, #M]…`, `name PR #N` or `name issue #N`: the name, then every number. */
const NAMED_PART = /([A-Za-z][\w.-]*(?:\/[\w.-]+)?)\s+(?:(?:PR|issue)\s+)?(#\d+(?:,\s*#\d+)*)/gi;
/** A parenthesis holding one or more NAMED_PARTs separated by commas or semicolons. */
const NAMED = new RegExp(`\\((?:${NAMED_PART.source})(?:[,;]\\s*(?:${NAMED_PART.source}))*\\)`, 'gi');
/** Words that open a reference in parentheses without naming a repository. */
const NOT_A_NAME = /^(?:fix(?:es|ed|ing)?|clos(?:e[sd]?|ing)|resolv(?:e[sd]?|ing)|address(?:es|ed|ing)?|implement(?:s|ed|ing)?|supersed(?:es|ed|ing)|replac(?:es|ed|ing)|track(?:s|ed|ing)?|block(?:s|ed|ing)?|dup|duplicates?|bugs?|upstream|refs?|see|related|partial(?:ly)?|part|context|follow-?up|defer(?:red)?|prs?|issues?|gh|via|from|after|since|with|in|by|for|also|cf\.?|e\.?g\.?|i\.?e\.?|and|or|per|of|to|on|at|as|is|was|the|an?|this|that|not|no|vs\.?|like|v\d[\w.-]*)$/i;

Expand All @@ -58,19 +64,31 @@ export function mentionsIn(message: string, source = 'commit'): IssueMention[] {
for (const raw of message.split('\n')) {
const line = raw.replace(/\s+$/, '');
const trailer = CLOSURE.exec(line);
if (trailer && !PARTIAL.test(line)) { add({ issue: Number(trailer[1]), intent: 'fixes', source: `${source}: ${line.trim()}` }); continue; }
const rest = line.replace(NAMED, (whole, name: string, numbers: string) => {
if (NOT_A_NAME.test(name)) return whole;
if (trailer && !PARTIAL.test(line)) { add({ issue: Number(trailer[2]), intent: 'fixes', ...(trailer[1] ? { repo: trailer[1] } : {}), source: `${source}: ${line.trim()}` }); continue; }
const rest = line.replace(NAMED, whole => whole.replace(NAMED_PART, (part, name: string, numbers: string) => {
if (NOT_A_NAME.test(name)) return part;
for (const n of numbers.matchAll(/#(\d+)/g)) add({ issue: Number(n[1]), intent: 'refs', repo: name, source: `${source}: ${line.trim()}` });
return ' ';
});
}));
for (const c of rest.matchAll(CROSS)) add({ issue: Number(c[2]), intent: 'refs', repo: c[1], source: `${source}: ${line.trim()}` });
const stripped = rest.replace(CROSS, '');
for (const b of stripped.matchAll(BARE)) add({ issue: Number(b[1]), intent: 'refs', source: `${source}: ${line.trim()}` });
}
return out;
}

/** Mentions whose `owner/repo` is `repo` (case-insensitive) become this repository's own; the rest are unchanged. */
export function ownRepoMentions(mentions: IssueMention[], repo: string | undefined): IssueMention[] {
if (!repo) return mentions;
const out: IssueMention[] = [];
for (const m of mentions) {
const { repo: named, ...own } = m;
const next: IssueMention = named?.toLowerCase() === repo.toLowerCase() ? own : m;
if (!out.some(o => o.repo === next.repo && o.issue === next.issue && o.intent === next.intent)) out.push(next);
}
return out;
}

/**
* Resolve the final link set. `readable(n)` is the gstack-issue-guard probe
* for a closure candidate; a false answer downgrades it to Refs.
Expand Down
3 changes: 3 additions & 0 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -4548,6 +4548,9 @@ if [ -x "$DETECT_BIN" ]; then
# main gen:skill-docs site had). Capture, show the tail, propagate.
_GEN_USER_OUT=$(bun_cmd run gen:skill-docs:user --host claude --out-dir "$_GSTACK_RENDER_TMP" --link-root "$_GSTACK_RENDER_DIR" --model "$_GSTACK_OVERLAY" ${_DISABLED_CSV:+"--disabled-skills=$_DISABLED_CSV"} ${_PLAN_MODE_ARG:+"$_PLAN_MODE_ARG"} ${_LOADOUT_ARG:+"$_LOADOUT_ARG"} 2>&1)
_GEN_USER_RC=$?
# The generator writes unprefixed name: fields; apply skill_prefix
# before the swap, as _render_install does (#4413).
[ "$_GEN_USER_RC" -ne 0 ] || "$SOURCE_GSTACK_DIR/bin/gstack-patch-names" "$_GSTACK_RENDER_TMP" "$SKILL_PREFIX" >/dev/null || _GEN_USER_RC=$?
printf '%s\n' "$_GEN_USER_OUT" | tail -3
exit "$_GEN_USER_RC"
); then
Expand Down
Loading
Loading