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
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"name": "pstack",
"source": "./plugins/pstack",
"description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.",
"version": "0.15.0",
"version": "0.15.1",
"author": {
"name": "Lauren Tan (pstack), pmwoz (T3 Code port)"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "t3-pstack",
"version": "0.15.0",
"version": "0.15.1",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion plugins/pstack/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pstack",
"displayName": "pstack",
"version": "0.15.0",
"version": "0.15.1",
"description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.",
"author": {
"name": "Lauren Tan (pstack), pmwoz (T3 Code port)"
Expand Down
2 changes: 1 addition & 1 deletion plugins/pstack/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pstack",
"version": "0.15.0",
"version": "0.15.1",
"description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.",
"author": {
"name": "Lauren Tan (pstack), pmwoz (T3 Code port)"
Expand Down
6 changes: 3 additions & 3 deletions plugins/pstack/skills/poteto-mode/references/t3-adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ T3 has no cloud agents. Every lane is a `delegate_task` child on this machine or
- **A PR owner (autopilot, multi-phase plans)** is a role, not a long-lived agent. Each owner round (build, fix, merge) is a fresh `delegate_task` in that PR's worktree. The round does its work, reports the PR URL, head SHA, and state, and returns. The root decides and delegates the next round.
- **Babysit inside a child.** A child told to babysit does one `check` pass, fixes what it can, and returns the PR state. It never arms a watch.
- **`/loop` around a PR.** This covers babysit's `drive` mode, shipping, and autonomous-run events. The root calls `watch_pull_request` and ends the turn. T3 wakes it on checks, reviews, and conflicts. On each wake, take the verdict from `<pstack-root>/skills/poteto-mode/scripts/watch-pr/watch-pr --status-only --pr <number>`, run in the PR's checkout (or the playbook's `origin` or `gh pr view` read), act, and keep the watch armed across push waves. Call `unwatch_pull_request` before handing back to the user. `scripts/watch-pr` stays the verdict oracle.
- **`/loop` on a fixed cadence** (`/loop 1h`, audit ticks, heartbeats). The root calls `schedule_task` with `{type: "interval", everyMs: 3600000}` bound to its own thread, reports `nextRunAt`, and calls `delete_scheduled_task` when the run closes. Schedule from the root, because a child's schedule posts into the child's thread.
- **`/loop` on a fixed cadence** (`/loop 1h`, audit ticks, heartbeats). The root calls `schedule_task` with `{type: "interval", everyMs: 3600000}` bound to its own thread, reports `nextRunAt`, and calls `delete_scheduled_task` when the run closes. To read that schedule again, such as on session pickup, call `list_scheduled_tasks` with its `scheduledTaskId`. Schedule from the root, because a child's schedule posts into the child's thread.
- **`/loop until X`** with no outside event: keep iterating within the run. Add a schedule only when the work must survive turn ends.
- **Events a PR watch cannot see.** T3 refuses to watch a PR that is already merged or whose host it cannot read, such as when `gh` is missing or signed out, and it cannot watch a ref, a branch without a PR, or a post-merge CI run. On Claude, wait on an event that a command can wait for, such as a post-merge CI run (`gh run watch <run-id> --exit-status`) or a deploy (its CLI's wait command), by running that command as a long shell command (Claude item below). For an event no command waits on (an autonomous run waiting on a ref), on Codex, and for a heartbeat fallback, the root calls `schedule_task` with an interval bound to its own thread. When the event has a known time, such as a release window or a deploy ETA, use `{type: "once", runAt}` with an ISO time and offset instead, so the root wakes once at that time. The prompt states the check and the exit condition. Call `delete_scheduled_task` once the condition holds.
- **Long shell commands on Claude.** Run a long command, such as a gate, a test suite, or a build, with `run_in_background` and end the turn. Its exit wakes you, and so does each delegated task that finishes. Before you end the turn, call `t3_background_wait` with `taskIds: ["<id>"]`, where the id is the one that Claude Code shows when the command starts. It takes shell task ids only. A `delegate_task` task id never matches, and a delegated task wakes you on its own. The result lists each id under `matched` or `unmatched`. An unmatched id marks nothing, so check that it is the id of a command that still runs. The thread then stays in the user's Working list instead of their inbox, T3 does not settle it while the command runs, and a T3 restart that kills the command wakes you with a note. Mark only a command whose result you will act on, never a dev server or a watcher you leave running. Do not wait in a foreground loop while children run, because a child's completion can stay queued until your turn ends. A command you start with `run_in_background` already wakes you when it exits, so do not add a waiter loop for it. Use an `until [ -s x.exit ]` loop, itself run with `run_in_background`, only for an exit file that a process you did not start that way writes. A foreground call stops at 600000 ms whatever its `timeout`. The pstack hook blocks a foreground `until` or `while` loop that sleeps.
Expand All @@ -108,7 +108,7 @@ T3 has no cloud agents. Every lane is a `delegate_task` child on this machine or
- **Earlier chats** (recall, session pickup, show-me-your-work audits). Use `t3_thread_search` and `t3_thread_list` in this project only. `t3_thread_search` returns title, branch, and PR matches first. A message match needs every query word of three or more characters and carries `source` (`user` or `assistant`), a `snippet`, and `messageCreatedAt`, so pick threads from the snippets before you read them. Message matches fill at most a fifth of `limit`, so pass `limit: 50`, the maximum, when you look for message content. Search skips subagent threads. Drop the match whose `threadId` equals the result's `currentThreadId`, which is your own thread. Pass thread ids to children, not file paths. Page a thread the way the description of `t3_thread_read` in your session says, because the cursor parameters and the order of a read without a cursor differ between T3 builds. Read a long thread in pages of `limit: 20` with `maxCharsPerItem: 2000`, and recover a long item with `itemId` and `textOffset`. T3 ends a page at about 30,000 characters and reports the rest through `hasMore` or `earlierPosition`. On Codex, never print a raw `t3_thread_read` result. Keep it in a variable and print what you need, such as each item's `position`, `type`, and first 300 characters. Cite a thread by the `link` a thread tool returned, verbatim, never by a title or a bare id. With only an id, `t3_thread_read` returns its `link`.
- **Messages from other threads.** A `t3_thread_read` item with `senderThreadId` is a message that thread sent with `t3_thread_send`, such as a parent's follow-up. The user did not type it, so do not read it as the user's words.
- **Shell fallback.** `~/.claude/projects/<encoded-cwd>/*.jsonl` (Claude) and `~/.codex/sessions/**/*.jsonl` (Codex).
- **Pinned and active chats** ("from the user or the sidebar") are the threads `t3_thread_list` returns with `settled: false`. Add `allProjects: true` when the work spans repositories, such as a disk cleanup.
- **Pinned and active chats** ("from the user or the sidebar") are the threads `t3_thread_list` returns with `pinned: true` or `settled: false`, called with `includeSubagents: false`. That leaves out child tasks and the tasks a linked environment delegated here, which `delegatedFrom` marks in any list or read. A child task of a pinned or active chat is in use too, and its `parentThreadId` names that chat. Add `allProjects: true` when the work spans repositories, such as a disk cleanup.

## Locations

Expand All @@ -132,7 +132,7 @@ T3 has no cloud agents. Every lane is a `delegate_task` child on this machine or
- **Custom Mode, Option+Enter.** None. Start a task with `/pstack:poteto-mode` (Claude) or `$pstack:poteto-mode` (Codex). On Claude, T3's composer also offers pstack's skills in its `$` picker when the plugin is enabled in Claude Code, and sends the pick as `/pstack:<name>`.
- **Cursor's built-in `/babysit` and `/autopilot` PR watchers.** Not present. The Babysit playbook is the only PR watcher. The Autopilot playbooks are pstack's own, not this built-in.
- **Plan Mode.** T3 interaction mode `plan`.
- **Automations** (`automations/benny`). A webhook or fixed-time `schedule_task`. Each run handles one event. A run that only reads and replies, such as benny's triage, is created with `bindToCurrentThread: false` and `freshSession: true`: the first run makes the automation's thread in a new worktree, and every later run posts there in a fresh session without earlier runs' context. A run that changes code or opens a PR, such as benny's reproduce automation, takes only `bindToCurrentThread: false`, so each run gets its own thread and a fresh worktree from the default branch. With neither set, a task in the creating thread's own project binds to that thread, and every run continues that conversation. A task for another project then gets a new thread per run. Get webhook signing secrets with `request_secret`. Put the trigger's conditions in the webhook schedule's `filters`, so other requests never start a run. For benny, `body.event.channel` equals the source channel. A path segment ending in `[]` checks each element of an array. `{path: "body.issue.labels[].name", op: "equals", value: "<label>"}` matches a GitHub issue that has that label, and `notEquals` matches only when no element has the value. Set `dedupe.replayKey` to the sender's delivery id, `{{body.event_id}}` for Slack or `{{headers.x-github-delivery}}` for GitHub, so a retried delivery does not run twice. When a sender fires bursts about one subject, such as pushes to one PR, set `dedupe.coalesceKey` to that subject. Deliveries with the same key within `coalesceWindowSeconds` (default 120, counted from the first) become one run on the latest payload. Never key it on something distinct events share, such as the channel.
- **Automations** (`automations/benny`). A webhook or fixed-time `schedule_task`. Each run handles one event. A run that only reads and replies, such as benny's triage, is created with `bindToCurrentThread: false` and `freshSession: true`: the first run makes the automation's thread in a new worktree, and every later run posts there in a fresh session without earlier runs' context. A run that changes code or opens a PR, such as benny's reproduce automation, takes only `bindToCurrentThread: false`, so each run gets its own thread and a fresh worktree from the default branch. With neither set, a task in the creating thread's own project binds to that thread, and every run continues that conversation. A task for another project then gets a new thread per run. Get webhook signing secrets with `request_secret`. To test an automation, call `run_scheduled_task_now`. When its `lastRunStatus` is `failed`, `lastRunError` says why. Put the trigger's conditions in the webhook schedule's `filters`, so other requests never start a run. For benny, `body.event.channel` equals the source channel. A path segment ending in `[]` checks each element of an array. `{path: "body.issue.labels[].name", op: "equals", value: "<label>"}` matches a GitHub issue that has that label, and `notEquals` matches only when no element has the value. Set `dedupe.replayKey` to the sender's delivery id, `{{body.event_id}}` for Slack or `{{headers.x-github-delivery}}` for GitHub, so a retried delivery does not run twice. When a sender fires bursts about one subject, such as pushes to one PR, set `dedupe.coalesceKey` to that subject. Deliveries with the same key within `coalesceWindowSeconds` (default 120, counted from the first) become one run on the latest payload. Never key it on something distinct events share, such as the channel.
- **Grok Bot** (`/make-bot-ui`). None. The skill ships unchanged but has nothing to wake under T3.
- **A Cursor restart.** T3 keeps threads, delegated tasks, and queues across restarts. Re-read each recorded child with `t3_thread_read`. Read `t3_thread_list`, whose `pullRequests` lists up to 5 open PRs per thread. For a thread whose `openPullRequestCount` is higher, call `list_thread_pull_requests` with `states: ["open"]`. Then reattach by PR and branch.

Expand Down
Loading