Skip to content

port pstack 0.15.42 - #47

Merged
caelaxie merged 1 commit into
mainfrom
cursor/port-pstack-0-15-42-098b
Nov 16, 2026
Merged

caelaxie merged 1 commit into
mainfrom
cursor/port-pstack-0-15-42-098b

Conversation

@caelaxie

Copy link
Copy Markdown
Contributor

Why

The Grok Build port was pinned to upstream pstack 0.15.36 (c742dd61706fbacc1b95f1a20b7b988cf096ce6c). Upstream main is now pstack 0.15.42 (bf0c7cd80abdbf7fe47b634978a7d1b4071f71a7).

What changed

Ported that commit's pstack changes into this repo: version 0.15.42, one-file why and how, statechart SANY line and column reporting plus Mermaid parent-border arrows, sharpen's prototype last line, and the reflect synthesizer's function-rename example. The port version and upstream pin are 0.15.42 / bf0c7cd80abdbf7fe47b634978a7d1b4071f71a7.

deslop, control-cli, and control-ui are unchanged. Their SKILL.md blobs are 1b3827c7f991182149a7abda696af43ff8f17a12, 69289ac517e8a28380c8eca5c6692e8a601fa62c, and 68484fd5418cc893a6bf40e0db45b3001dcf5947.

Grok adaptations

Upstream text is copied verbatim except where this port already adapts Cursor-only instructions:

  • Skills stay in skills/ and install under .agents/skills/. This port does not add .cursor/skills/.
  • setup-pstack still writes ~/.grok/rules/pstack-models.md as plain Markdown, detects models with grok models, and passes only the model id. Defaults stay grok slugs (grok-4.6 at xhigh, panel second entry grok-4.5 at high). Effort stays a separate field. The new budget moves each entry's effort by steps from its own default: large keeps it, unlimited raises one step, medium lowers one, small lowers two. # defaults: 2 marks the shape after dropping how explorer, how explainer, why investigators, and why synthesizer. A re-run drops those lines and does not replace grok-* slugs.
  • Arena and swarm keep a different detected slug for the cross-judge and the existing grok defaults. Cursor marketplace slugs and the vendor/family migration were not copied.
  • how spawns with spawn_subagent, no subagent_type, and a prompt that forbids file edits. recall starts one investigator per source the same way.
  • Existing spawn rules stay: only this chat calls spawn_subagent, workers use isolation: "worktree" or isolation: "none", and interrogate omits subagent_type.
  • Post-0.15.36 fixes stay: /poteto-mode and the task in one message, install from the published git url, model id only, multi-phase-plan reads from the installed plugin with the git show origin/main:<control skill path> marker, swarm run_in_background, subagent lines pointed at the poteto-mode skill, and the pinned poteto-help upstream link (now bf0c7cd80abdbf7fe47b634978a7d1b4071f71a7).

Changed skills

architect, blast-radius, how, no-comments, poteto-help, poteto-mode (playbooks bug-fix, feature, hillclimb, investigation, multi-phase-plan, perf-issue, refactoring), recall, reflect, setup-pstack, sharpen, statechart, teach, why.

Removed: skills/how/references/ and skills/why/references/.

Harness

Local CI from .github/workflows/ci.yml passed on f40e04cb8289760c0270396336ce11d5a1758024 with grok 1.0.77 (61 skills, 2 agents, 23 playbooks, script typecheck, 61 tests). Statechart tests: 270 pass, 0 fail. With tla2tools 1.7.4, the three SANY line and column tests passed. grok plugin install pstack-ports/grok-pstack@cursor/port-pstack-0-15-42-098b --trust installed pstack 0.15.42 at f40e04cb8289760c0270396336ce11d5a1758024. grok plugin list and grok inspect --json loaded the changed skills plus deslop, control-cli, and control-ui. Command output and installed skill text are in the PR comments.

Open in Web Open in Cursor 

Bring the Grok Build port up to upstream bf0c7cd80abdbf7fe47b634978a7d1b4071f71a7. Keep grok model defaults, effort as a separate field, and the existing spawn contract.

Co-authored-by: Kaitian Xie <caelaxie@users.noreply.github.com>
@cursor

cursor Bot commented Nov 16, 2026

Copy link
Copy Markdown

Harness proof

Head f40e04cb8289760c0270396336ce11d5a1758024 on cursor/port-pstack-0-15-42-098b. grok 1.0.77 (50ca579fa996).

The installed tree is that commit. diff -rq of git archive f40e04cb8289760c0270396336ce11d5a1758024 against the install reported only .git as extra. Installed text of the changed skills is in this comment and the two that follow. deslop, control-cli, and control-ui were not edited.

Commands

grok --version
grok plugin install pstack-ports/grok-pstack@cursor/port-pstack-0-15-42-098b --trust
grok plugin list
grok plugin list --json
git -C /tmp/grok-harness-098b/.grok/installed-plugins/grok-pstack-619a4a2c rev-parse HEAD
git -C /tmp/grok-harness-098b/.grok/installed-plugins/grok-pstack-619a4a2c hash-object skills/deslop/SKILL.md skills/control-cli/SKILL.md skills/control-ui/SKILL.md
grok inspect --json

Output

grok 1.0.77 (50ca579fa996)
Installed 1 plugin(s) from pstack-ports/grok-pstack@cursor/port-pstack-0-15-42-098b: pstack

grok plugin list
  grok-pstack-619a4a2c: pstack [git: https://github.com/pstack-ports/grok-pstack]

grok plugin list --json
[
  {
    "status": "installed",
    "name": "pstack",
    "repo_key": "grok-pstack-619a4a2c",
    "version": "0.15.42",
    "path": "/tmp/grok-harness-098b/.grok/installed-plugins/grok-pstack-619a4a2c",
    "source": "https://github.com/pstack-ports/grok-pstack",
    "marketplace": null
  }
]

git rev-parse HEAD
f40e04cb8289760c0270396336ce11d5a1758024

git hash-object
1b3827c7f991182149a7abda696af43ff8f17a12  skills/deslop/SKILL.md
69289ac517e8a28380c8eca5c6692e8a601fa62c  skills/control-cli/SKILL.md
68484fd5418cc893a6bf40e0db45b3001dcf5947  skills/control-ui/SKILL.md

grok inspect --json loaded 61 pstack skills and agents pstack:poteto-agent and pstack:comment-sicko, including deslop, control-cli, control-ui, how, why, sharpen, setup-pstack, recall, reflect, statechart, poteto-mode, architect, blast-radius, no-comments, teach, and poteto-help.

Inspect source paths:

  • deslop: /tmp/grok-harness-098b/.grok/installed-plugins/grok-pstack-619a4a2c/skills/deslop/SKILL.md
  • control-cli: /tmp/grok-harness-098b/.grok/installed-plugins/grok-pstack-619a4a2c/skills/control-cli/SKILL.md
  • control-ui: /tmp/grok-harness-098b/.grok/installed-plugins/grok-pstack-619a4a2c/skills/control-ui/SKILL.md

Local CI on this same head (.github/workflows/ci.yml, grok 1.0.77): plugin validate, install ., list, inspect, 61 skills, 2 agents, 23 playbooks, shell bash -n, script typecheck, 61 pass / 0 fail. Statechart node --test: 270 pass, 0 fail, 70 skipped without TLA2TOOLS. With tla2tools 1.7.4, the three SANY tests passed (unknown name, parse error, twelve unknown names).

Installed skills/why/SKILL.md

---
name: why
description: "Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Returns a cited read on decisions and tradeoffs. Use how for runtime behavior."
disable-model-invocation: true
---

# Why

Answer from the record, not the code: read the commits and PR discussions that introduced the target and each later change, and other sources if the trail is thin. Cite what the authors wrote, mark your own inferences as inferences, and say what the record does not answer.

Installed skills/how/SKILL.md

---
name: how
description: "Use for \"how does X work\", code walkthroughs before changing something, and placement / ownership / layering questions (\"where should this live\", \"which package owns this\", \"is this the right layer\"). Explains subsystem architecture, runtime flow, onboarding mental models. Use why for motivation."
disable-model-invocation: true
---

# How

Explore the codebase to answer "how does X work?" questions.

If the scope is ambiguous, state your interpretation and explore. The user can redirect.

## 1. Explain

Spawn one `spawn_subagent` call with no `subagent_type` and a prompt that forbids file edits (there is no readonly flag) that explores and explains in one pass. Give it the user's question and this brief:

> You are writing an architectural explanation for a senior engineer. Explore the codebase and write an explanation that a senior engineer unfamiliar with this area could read and walk away with a solid mental model. They should understand the architecture well enough to start working in it confidently. You have read-only access to the codebase.

## 2. Present

Present the subagent's output. Light edits for clarity or context from the conversation are fine. Do not substantially rewrite it.

Installed skills/sharpen/SKILL.md

---
name: sharpen
description: "Make a task deeper, not bigger, then rewrite the prompt. Use for /sharpen."
disable-model-invocation: true
---

I want a deeper version of this task, not a bigger one. Before rewriting it, do four things:

1. Say what a top professional in this field would do here that I'm not asking for.
2. Name the rawest material they would start from instead of what has already been digested for me.
3. Name the specific methods and tools they would use.
4. Say what, other than you or me, would show the result is right.

Then rewrite my prompt to ask for exactly that.

Have the rewritten prompt ask the agent to prototype any choice an experiment can settle and recommend an option based on what it observed. Leave product or preference choices that no experiment can settle for me to make.

@cursor

cursor Bot commented Nov 16, 2026

Copy link
Copy Markdown

Harness proof, continued

Installed copy of f40e04cb8289760c0270396336ce11d5a1758024. Same install as the previous comment (/tmp/grok-harness-098b/.grok/installed-plugins/grok-pstack-619a4a2c).

Installed skills/setup-pstack/SKILL.md

---
name: setup-pstack
description: Configure which models pstack uses per role and at what budget. Detects your available models and writes a user rule that overrides the skill defaults. Use for /setup-pstack, "configure pstack models", "pstack budget", or changing pstack's model choices.
---

# Setup pstack

Write `~/.grok/rules/pstack-models.md`. Every markdown file in `~/.grok/rules/` applies on every turn. The file sets pstack's model per role.

## Steps

### 1. Detect available models

Run `grok models` and read the `spawn_subagent` schema. The slugs `grok models` lists are the only real slugs you may write. Read each model's effort levels from `grok models` / `/model`. If you cannot detect any slug, ask the user to paste the slugs they have access to. Never write a real slug you have not confirmed. The aliases `inherit-parent` and `auto` are always valid even though they are not detected slugs. Both mean omit `model`.

When `spawn_subagent` lists `model`, pass only the model id (`grok-4.6` from a `grok-4.6 xhigh` line), validated against `grok models`. When it does not, this session inherits the parent. Expose the argument for the next session before you finish setup:

- Leave the user config alone when `GROK_SUBAGENT_MODEL_INHERITANCE` is set, when `GROK_CONFIG` or `GROK_CONFIG_PATH` sets `features.subagent_model_inheritance`, or when `$GROK_HOME/requirements.toml` (default `~/.grok/requirements.toml`), `/etc/grok/requirements.toml`, or an MDM profile pins that key. Name the pin in the confirmation. This session omits `model`.
- Otherwise set `subagent_model_inheritance = false` under `[features]` in `$GROK_HOME/config.toml` (default `~/.grok/config.toml`). Preserve every other key and table. An explicit false overrides the remote default. The flag is read at session start, so this session still omits `model`.

Pass `model` only in a session whose schema includes it. Pass the effort only when `spawn_subagent` lists an effort argument. Otherwise the child inherits the parent's effort.

### 2. Load current state

The default role-to-model mapping is the rule shape shown in step 5 below. If `~/.grok/rules/pstack-models.md` already exists, read it and treat its `# budget` line and its role values as the current choices. Otherwise start from those defaults. A line whose role is not in step 5, such as `how explorer` or `why investigators`, is from a retired role. Drop it.

A rule without the `# defaults: 2` line comes from an older setup. That setup wrote lines for `how explorer`, `how explainer`, `why investigators`, and `why synthesizer`. Drop those lines. Do not replace a `grok-*` slug. Every other value is the user's choice and stays, including every `inherit-parent` or `auto` value. Tell the user which lines you dropped.

### 3. Budget, map, and confirm

**(a) Ask for a budget.** Prefer ask_user_question over free text. Offer these four options with these exact labels, and name the current budget when the rule records one. With no rule, say that `large` matches the skill defaults.

- `unlimited — max reasoning`
- `large — xhigh reasoning`
- `medium — high reasoning`
- `small — medium reasoning`

**(b) Apply it.** Build the working table from the skill defaults, and on a re-run keep any role you changed by slug, list, or alias (`inherit-parent`, `auto`). Each entry has a target effort, which is its default's effort moved by the budget. `large` keeps it, `unlimited` raises it one step, `medium` lowers it one step, and `small` lowers it two steps, on the ladder `max` > `xhigh` > `high` > `medium` > `low`. A target at either end of the ladder stays there. Most defaults are at `xhigh`, and each budget label names where those land. Set the effort of every real model entry in the role, panel entries included, to that entry's target. Effort is a separate field, written after the model id (`grok-4.6 xhigh`). If the model does not offer that effort, use its highest offered effort at or below the target, else mark the role as needing a choice. `inherit-parent` and `auto` do not change. So `unlimited` turns `grok-4.6 xhigh` into `grok-4.6 max` when `max` is offered, and otherwise keeps `xhigh`. `large` keeps the defaults. `small` turns `grok-4.6 xhigh` into `grok-4.6 medium` and `grok-4.5 high` into `grok-4.5 low`. A panel list stays two entries when two different detected slugs exist. When the budget collapses a panel onto one slug, write that slug twice and tell the user the panel has no second model. If `spawn_subagent` has no `model` argument, still write the intended slugs. They take effect in the next session, after step 1 exposes `model`.

**(c) Show the roles and confirm.** Show every role with its model, marking any real slug not in the detected set as needing a choice. Also list each line step 2 dropped. Ask whether to accept as-is or change specific roles, offering the detected models plus `inherit-parent` and `auto` (both mean this role runs on the parent chat model, so omit `model`) as the options. Prefer ask_user_question over free text. For panel roles (arena runners, architect runners, interrogate reviewers) the value is a list, and one subagent runs per entry, alias entries included, so the list length sets the count. `arena cross-judge pool` is also a list, but Arena runs one judge. It tries only values on a detected slug other than the parent's, in list order, so order it by preference. An `inherit-parent` or `auto` value never judges. `swarm workers` is the default model for every worker unless a race or comparison assigns another model per arm.

### 4. Validate

Every real model id written must be in the detected set. The effort word after the id is not a slug. `inherit-parent` and `auto` always pass. If a chosen real model id is not available, stop and ask again.

### 5. Write the rule

Write `~/.grok/rules/pstack-models.md` as plain Markdown. No YAML frontmatter. Include the `# defaults: 2` line, a `# budget` line with the chosen label and the effort that label names, and one line per role, using the same labels poteto-mode uses. Overwrite the whole file so re-runs stay idempotent. Shape for `large` when `grok-4.6` and `grok-4.5` are detected:

```
# pstack model configuration. One line per role. Delete a line to fall back to the skill default.
# `inherit-parent` or `auto` as a value: the role runs on the parent chat model (omit `model`). Alias entries in a panel list still count toward its fan-out.
# Pass model only when spawn_subagent lists it. Step 1 exposes that argument for the next session.
# defaults: 2
# budget: large (xhigh)
feature, refactoring: grok-4.6 xhigh
bug-fix: grok-4.6 xhigh
perf-issue: grok-4.6 xhigh
hillclimb: grok-4.6 xhigh
judgment and prose: grok-4.6 xhigh
hardest tasks: grok-4.6 xhigh
reflect tooling: grok-4.6 xhigh
reflect judgment, divergent, synthesizer: grok-4.6 xhigh
arena runners: grok-4.6 xhigh, grok-4.5 high
arena cross-judge pool: grok-4.6 xhigh, grok-4.5 high
swarm workers: grok-4.6 xhigh
architect runners: grok-4.6 xhigh, grok-4.5 high
interrogate reviewers: grok-4.6 xhigh, grok-4.5 high
```

Substitute the slugs step 3 actually chose. Keep the role labels exactly as written above.

### 6. Confirm

Tell the user the rule was written and that it applies to new sessions. If you set `subagent_model_inheritance = false`, say that role models start in the next session and that this session still inherits the parent. If a pin blocked the flag, say that every role inherits the parent until that pin changes. Re-running this skill updates the file.

### 7. Offer a verification skill (optional)

Check whether the project has a way to drive the real app for proof (a `verify-*` skill, or an existing harness). If not, offer once: "want a project-local verification skill, so agents can drive the app the way a user does and prove changes work? I can generate one with /create-verification-skill." On yes, invoke `/create-verification-skill` (resolves wherever pstack is installed: workspace, user, or plugin). On no, move on without pushing.

### 8. Offer a formal verification skill (optional)

Check whether the project already has a formal verification skill (a project skill that runs a model checker, a proof, or another verifier against the code). If not, offer once: "want a formal verification skill, so agents can prove a key property of your code holds in every case in scope, not only the cases tests reach? I can generate one with /create-formal-verification-skill." On yes, invoke `/create-formal-verification-skill` (resolves wherever pstack is installed: workspace, user, or plugin). On no, move on without pushing.

@cursor

cursor Bot commented Nov 16, 2026

Copy link
Copy Markdown

Harness proof, continued

Installed copy of f40e04cb8289760c0270396336ce11d5a1758024 at /tmp/grok-harness-098b/.grok/installed-plugins/grok-pstack-619a4a2c. diff -rq against git archive of that commit reported only .git. These are the changed lines from that install.

skills/recall/SKILL.md

The shared record "lives in source control, the issue tracker, chat and issue channels, long-form docs, and error tracking." Step 4: "Spawn one investigator subagent per source. There is no readonly flag, and MCP stays available through search_tool and use_tool."

skills/architect/SKILL.md

"Trace the relevant subsystems. Naming a file isn't grounding. Write an architectural explanation of each." Scrap step 1: "Trace what's been built." Runners stay grok-4.6 at xhigh and grok-4.5 at high.

skills/blast-radius/SKILL.md

Step 1 ends "Pull the PR and its commits." Step 4 no longer points at why's citation rules.

skills/no-comments/SKILL.md

"Before accepting thin IMPORTANT or do not remove kills or keeps, trace their symbol or run /why on it."

skills/teach/SKILL.md

Step 2 no longer tells the agent to narrow why by source. how stays in the catalog.

skills/poteto-mode/SKILL.md

The how trigger line is gone. Routed workflow skills are interrogate, reflect, swarm. Routed model skills are arena, swarm, architect, interrogate, reflect. "If the rule has no # defaults: 2 line, an older setup wrote it. Keep honoring its lines, and tell the user once per session to rerun /setup-pstack."

Playbooks, from the install

  • investigation: "Trace the code the question is about. For motivation questions, also route through the why skill."
  • bug-fix: "Seed them with a trace of the affected subsystem and the why skill for regression history." /loop still says each fire cannot see this chat. Default model stays grok-4.6 at xhigh.
  • feature, hillclimb, perf-issue, refactoring: trace the subsystem or target. Defaults stay grok-4.6 at xhigh.
  • multi-phase-plan Appendix D: "Which PRs get <plugin>/skills/interrogate/SKILL.md." The git show origin/main:<control skill path> marker is still there. Reads still use <plugin> from grok plugin list.

skills/reflect/references/synthesizer.md

Drop example: "we renamed parseConfig to loadConfig in settings.ts".

agents/comment-sicko.md

"I trace the named symbol or call, run /why from the why skill on it, or both."

skills/poteto-help/SKILL.md

Upstream pin: https://github.com/cursor/plugins/blob/bf0c7cd80abdbf7fe47b634978a7d1b4071f71a7/pstack/. The catalog still lists /how and /why.

Benny, from the install

how is gone from the shared-dependency lists in automations/benny/FOR_AGENTS.md and automations/benny/skills/setup-benny/SKILL.md. Reproduce says "Trace the action through the repository. Use pstack's why skill". Triage says "Trace the path from the reported action to the observed result."

@caelaxie caelaxie left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

head f40e04c. pass.

port of cursor/plugins@bf0c7cd (0.15.42). bf0c7cd is the only pstack/ change after c742dd6; cursor-team-kit is untouched and deslop/control-cli/control-ui stay byte-identical. statechart scripts, why, sharpen, investigation, blast-radius, teach, and comment-sicko are verbatim. how/why references deleted to match upstream. arena/swarm left on the existing grok-4.6 / grok-4.5 map, which is the right call — upstream's only edits there were cursor marketplace slugs. setup-pstack writes # defaults: 2, drops the retired how/why roles, and moves effort relative to each role's own default. no cursor-team-kit mentions, no .cursor/ skills or manifests. versions are 0.15.42 in plugin.json and the readme pin.

harness proof is on the exact head: grok plugin install pstack-ports/grok-pstack@cursor/port-pstack-0-15-42-098b --trust installed pstack 0.15.42 at f40e04c, grok plugin list and grok inspect --json loaded 61 skills including the changed ones plus deslop, control-cli, and control-ui. validate plugin ci is green.

no issue to close. merging.

@caelaxie
caelaxie merged commit edad7bc into main Nov 16, 2026
1 check passed
@caelaxie
caelaxie deleted the cursor/port-pstack-0-15-42-098b branch November 16, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants