Skip to content

feat(pstack): support Claude Code as a harness - #629

Draft
sirine707 wants to merge 3 commits into
cursor:mainfrom
sirine707:sirine/pstack-claude-code-support
Draft

sirine707 wants to merge 3 commits into
cursor:mainfrom
sirine707:sirine/pstack-claude-code-support

Conversation

@sirine707

@sirine707 sirine707 commented Oct 14, 2026 •

Copy link
Copy Markdown

Builds on #455 (harness-aware model routing). Until #455 merges, this PR also shows its commit f721e2e; review the last two commits.

Summary

Makes pstack installable and working in Claude Code without changing Cursor behavior.

  • One source of truth: a new Harness reference section in pstack/docs/model-routing.md translates Cursor's subagent fields, agent frontmatter, plugin and skill paths, and transcript locations for Claude Code. Skills keep their Cursor text as written and add a pointer to it, so Cursor agents read the same instructions as before.
  • Packaging: pstack/.claude-plugin/plugin.json and a pstack entry in .claude-plugin/marketplace.json.
  • Agents: poteto-agent gets background: true next to is_background: true and searches the Claude Code plugin root. poteto-mode passes delegates the absolute SKILL.md path and uses pstack:poteto-agent in Claude Code.
  • Skills: transcript lookups (recall, reflect, show-me-your-work, automate-me, session-pickup, eval), project skill paths (create-/maintain-verification-skill, automate-me), and subagent fields (swarm, arena, interrogate, reflect, no-comments, orchestrate, why) point to the reference.
  • worktree-audit.sh also reads Claude Code transcripts (~/.claude/projects/<slug>).
  • CI: validate-plugins.mjs checks Claude marketplace entries and that all of a plugin's manifests carry the same version; the workflow runs claude plugin validate ..
  • automations/benny stays Cursor-only.

No version bump. It follows the separate chore(pstack): bump convention. The next bump must update all three manifests, and CI now enforces that.

Test plan

Claude Code 2.1.299, claude -p --plugin-dir ./pstack:

  • Plugin loads: pstack:poteto-agent, pstack:comment-sicko, 53 /pstack:* commands
  • /pstack:poteto-help answers with Claude Code names
  • /pstack:poteto-mode spawns pstack:poteto-agent with the skill path; the delegate reads SKILL.md
  • /pstack:recall resolves ~/.claude/projects/<slug>/
  • /pstack:interrogate spawns read-only Explore reviewers, with no rejected calls and no edits
  • worktree-audit.sh with Claude-only, Cursor-only, and empty transcript homes
  • node scripts/validate-plugins.mjs and claude plugin validate . pass; each fails on version drift, name mismatch, missing manifest, or a bad agents field
  • /pstack:setup-pstack writes a claude-code profile (manual)
  • Cursor smoke test: /poteto-mode and /recall unchanged, and Cursor accepts the extra background key

🤖 Generated with Claude Code


Note

Medium Risk
Broad changes to agent orchestration docs and model routing across harnesses; mistakes could mis-spawn subagents or read wrong transcripts, though impact is limited to local agent workflows and CI guards manifest consistency.

Overview
Adds Claude Code as a first-class install target for pstack without changing Cursor’s default behavior.

Packaging & CI: Registers pstack in .claude-plugin/marketplace.json with pstack/.claude-plugin/plugin.json, documents Claude install (/plugin install pstack@cursor-plugins), and extends plugin validation to cover Claude marketplace entries, claude plugin validate, and matching versions across Cursor/Claude manifests.

Harness reference: pstack/docs/model-routing.md (including Harness reference) centralizes how to translate Cursor Task fields, agent frontmatter, paths, slash commands (/pstack:poteto-mode), and transcript locations for Claude Code. Skills keep Cursor wording and add pointers to that doc instead of duplicating tables everywhere.

Runtime behavior in skills: Model/spawn logic in setup-pstack, poteto-mode, arena, interrogate, swarm, how, why, reflect, and related playbooks now reads ~/.config/pstack/models.json per active harness, with Cursor’s pstack-models.mdc as a compatibility export only. Transcript- and skill-path skills (recall, reflect, automate-me, verification skills, etc.) resolve Claude paths when not in Cursor.

Agents & tooling: poteto-agent gains background: true and Claude plugin-root lookup; worktree-audit.sh scans Claude transcript dirs alongside Cursor. Benny automations are explicitly Cursor-only.

Reviewed by Cursor Bugbot for commit 8543ac8. Bugbot is set up for automated code reviews on this repo. Configure here.

dodeja and others added 3 commits October 13, 2026 22:13
Package pstack as a Claude Code plugin and make the skills work there without
changing Cursor behavior. Cursor fields, paths, and agent names stay as written;
a single Harness reference in docs/model-routing.md translates them for other
harnesses (subagent fields, agent frontmatter, plugin and skill paths,
transcript locations and slugs).

- Add pstack/.claude-plugin/plugin.json and a pstack marketplace entry.
- poteto-agent: add background: true and the Claude Code plugin root;
  poteto-mode passes delegates the absolute SKILL.md path.
- Point transcript, skill-path, and subagent-field instructions at the
  Harness reference.
- worktree-audit.sh also reads Claude Code transcripts.
- README: Claude Code install and /pstack: prefix; benny stays Cursor-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- validate-plugins.mjs checks Claude marketplace entries and that every
  manifest of a plugin carries the same version.
- The workflow runs `claude plugin validate .` and triggers on the Claude
  marketplace, the validator, and the workflow itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 8543ac8. Configure here.

Explore the codebase to answer "how does X work?" questions. Produce architectural explanations at the level of a senior engineer onboarding onto a subsystem, enough to build a working mental model, not so much that it reads like annotated source code.

Every spawn is a Task subagent with `subagent_type: generalPurpose` and `readonly: true`. Explorers use the `how explorer` line in the `pstack-models.mdc` rule (default `grok-4.7-xhigh-fast`), and every explainer uses the `how explainer` line (default `claude-opus-5-5-xhigh`). Set `model` to that line's value, or to the default if the rule or the line is missing. Leave `model` unset when the value is `auto` or `inherit-parent`. If the Task tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message. Pick each subagent's reasoning level and fast or standard speed for the job, per the Subagents section of the **poteto-mode** skill.
First read [model routing](../../docs/model-routing.md) and use the matching harness profile in `~/.config/pstack/models.json` when present. A profile entry specifies runner, model, and effort; do not pass an external CLI model to Task. Without a profile, use `pstack-models.mdc` or the defaults below in Cursor; in another harness use native `inherit-parent`. Omit native `model` for `auto` or `inherit-parent`. Report rejected slugs and choose a confirmed fallback of the same family.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How skill lost model defaults

Medium Severity · Logic Bug

The replacement routing paragraph points at defaults below that are no longer in the file, and it drops the explorer versus explainer role split plus generalPurpose and readonly: true. Without a profile, Cursor how no longer assigns grok-4.7-xhigh-fast explorers and claude-opus-5-5-xhigh explainers, and children may run writable.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8543ac8. Configure here.

Each spawn below names a role line in the `pstack-models.mdc` rule and a default. Set `model` to that line's value, or to the default if the rule or the line is missing. Leave `model` unset when the value is `auto` or `inherit-parent`. If the Task tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message. Pick each subagent's reasoning level and fast or standard speed for the job, per the Subagents section of the **poteto-mode** skill.

Every spawn is `generalPurpose` with `readonly: false` (agent mode). **Do not use readonly/Ask mode.** It strips MCP access, which disables the MCP-backed investigators and the synthesizer's citation spot-checks. Investigators still shouldn't write anything.
First read [model routing](../../docs/model-routing.md) and use the matching harness profile in `~/.config/pstack/models.json` when present. A profile entry specifies runner, model, and effort; do not pass an external CLI model to Task. Without a profile, use `pstack-models.mdc` or the defaults below in Cursor; in another harness use native `inherit-parent`. Omit native `model` for `auto` or `inherit-parent`. Report rejected slugs and choose a confirmed fallback of the same family.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why skill has conflicting routing

Medium Severity · Logic Bug

The old pstack-models.mdc spawn rule remains above the new models.json paragraph, so agents get opposite instructions. The same edit also dropped the generalPurpose plus readonly: false MCP contract. Claude Code may receive Cursor slugs such as grok-4.7-xhigh-fast, and investigators can lose MCP if they spawn read-only.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8543ac8. Configure here.


Tell the user which profile was written, the selected budget, runner families,
and what will happen if a reviewer is unavailable. The profile applies to new
sessions; re-running `/setup-pstack` updates it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Setup dropped budget remap rules

Medium Severity · Bugbot Rules

The rewritten flow no longer rebuilds the role table from skill defaults before applying budget, then overlaying only family, list, or alias customizations. The Cursor export asks for a # budget line without the label and target form, so a re-run can keep stale default slugs and omit # budget: large (xhigh).

Fix in Cursor Fix in Web

Triggered by learned rule: setup-pstack budget remap: rebuild first, then effort

Reviewed by Cursor Bugbot for commit 8543ac8. Configure here.

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.

3 participants