From fdc0a9d4886e2f8639ea89cfb3f7299f6de914ee Mon Sep 17 00:00:00 2001 From: Ethan <257484394+EthanYoQ@users.noreply.github.com> Date: Sat, 24 Oct 2026 22:01:04 +0800 Subject: [PATCH 1/2] fix(pstack): give Claude Code delegates a todolist checkpoint In Claude Code without TodoWrite, the adapter told agents to keep the todolist in their reply. A background delegate's reply reaches its parent only when it finishes, so that list was never a checkpoint. The adapter now maps "Open a todolist" to a Markdown file written before the first edit, updated per item, and named in the reply. poteto-agent now opens that list before its first edit when its brief hands it playbook steps, returns steps that need a spawn it cannot make to its parent instead of skipping them, and ends its reply with the skill, playbook, and principle files it read. Regenerated harness/pstack/claude-code with node scripts/generate-pstack-harness-trees.mjs. Co-Authored-By: Claude Opus 5.5 --- harness/pstack/claude-code/agents/poteto-agent.md | 2 ++ harness/pstack/claude-code/docs/harness/claude-code.md | 2 +- pstack/agents/poteto-agent.md | 2 ++ pstack/docs/harness/claude-code.md | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/harness/pstack/claude-code/agents/poteto-agent.md b/harness/pstack/claude-code/agents/poteto-agent.md index e1d2df2e8..5482e6e5d 100644 --- a/harness/pstack/claude-code/agents/poteto-agent.md +++ b/harness/pstack/claude-code/agents/poteto-agent.md @@ -7,3 +7,5 @@ is_background: true # Poteto subagent You are operating as poteto-mode's full agent style. The chat that receives `/poteto-mode` owns the playbook, the todo list, and every Task spawn. You are one of its delegates. Read the `poteto-mode` skill's `SKILL.md` in full before doing any work, including its inline Principles index. Use the absolute path your parent gave you. With no path, before any other work, search `~/.cursor/plugins/` for a file whose path ends in `skills/poteto-mode/SKILL.md`. If more than one file matches, use the copy whose `.cursor-plugin/plugin.json` has the highest `version`. Your skill catalog hides this skill, so a missing catalog entry does not mean pstack is absent. If no such file exists, stop and tell your parent. Navigate to a leaf `principle-*` skill whenever you apply that principle. + +When your brief hands you playbook steps, open a todolist of them before your first edit. A step that needs a Task spawn you cannot make, or were told not to make, goes back to your parent. List it under "Returned to parent" in your reply instead of skipping it. End your reply with the skill, playbook, and principle files you read. diff --git a/harness/pstack/claude-code/docs/harness/claude-code.md b/harness/pstack/claude-code/docs/harness/claude-code.md index bf154e646..98bbda667 100644 --- a/harness/pstack/claude-code/docs/harness/claude-code.md +++ b/harness/pstack/claude-code/docs/harness/claude-code.md @@ -8,7 +8,7 @@ pstack skills use Cursor names. In Claude Code, read this file once per session, | --- | --- | | `Task` | `Agent` | | `AskQuestion` | `AskUserQuestion`. In `-p` mode it is absent, so ask in plain text. | -| Open a todolist | Use `TodoWrite` if the session offers it. Otherwise keep the list in your reply and update it at each phase. | +| Open a todolist | Use `TodoWrite` if the session offers it. Otherwise write the list to a Markdown file before your first edit, mark each item done or `skip: ` as you go, and name the file in your reply. A background subagent's reply reaches its parent only when it finishes, so a list kept in the reply is no checkpoint. | | Run another pstack skill (`/name` or "the **name** skill") | `Read` `/skills//SKILL.md` and follow it. The `Skill` tool refuses most pstack skills. When you tell the user to type it, write `/pstack:`. | | `Grep`, `Glob` | `Bash` with `rg` when the session has no `Grep` or `Glob`. | diff --git a/pstack/agents/poteto-agent.md b/pstack/agents/poteto-agent.md index e1d2df2e8..5482e6e5d 100644 --- a/pstack/agents/poteto-agent.md +++ b/pstack/agents/poteto-agent.md @@ -7,3 +7,5 @@ is_background: true # Poteto subagent You are operating as poteto-mode's full agent style. The chat that receives `/poteto-mode` owns the playbook, the todo list, and every Task spawn. You are one of its delegates. Read the `poteto-mode` skill's `SKILL.md` in full before doing any work, including its inline Principles index. Use the absolute path your parent gave you. With no path, before any other work, search `~/.cursor/plugins/` for a file whose path ends in `skills/poteto-mode/SKILL.md`. If more than one file matches, use the copy whose `.cursor-plugin/plugin.json` has the highest `version`. Your skill catalog hides this skill, so a missing catalog entry does not mean pstack is absent. If no such file exists, stop and tell your parent. Navigate to a leaf `principle-*` skill whenever you apply that principle. + +When your brief hands you playbook steps, open a todolist of them before your first edit. A step that needs a Task spawn you cannot make, or were told not to make, goes back to your parent. List it under "Returned to parent" in your reply instead of skipping it. End your reply with the skill, playbook, and principle files you read. diff --git a/pstack/docs/harness/claude-code.md b/pstack/docs/harness/claude-code.md index bf154e646..98bbda667 100644 --- a/pstack/docs/harness/claude-code.md +++ b/pstack/docs/harness/claude-code.md @@ -8,7 +8,7 @@ pstack skills use Cursor names. In Claude Code, read this file once per session, | --- | --- | | `Task` | `Agent` | | `AskQuestion` | `AskUserQuestion`. In `-p` mode it is absent, so ask in plain text. | -| Open a todolist | Use `TodoWrite` if the session offers it. Otherwise keep the list in your reply and update it at each phase. | +| Open a todolist | Use `TodoWrite` if the session offers it. Otherwise write the list to a Markdown file before your first edit, mark each item done or `skip: ` as you go, and name the file in your reply. A background subagent's reply reaches its parent only when it finishes, so a list kept in the reply is no checkpoint. | | Run another pstack skill (`/name` or "the **name** skill") | `Read` `/skills//SKILL.md` and follow it. The `Skill` tool refuses most pstack skills. When you tell the user to type it, write `/pstack:`. | | `Grep`, `Glob` | `Bash` with `rg` when the session has no `Grep` or `Glob`. | From 31913099d88b626460732aa30b990d23f211f50f Mon Sep 17 00:00:00 2001 From: Ethan <257484394+EthanYoQ@users.noreply.github.com> Date: Sun, 25 Oct 2026 10:01:13 +0800 Subject: [PATCH 2/2] fix(pstack): preserve returned work and delegate implementation ownership Keep returned steps pending in the todo checkpoint and distinguish them from deliberate skips. Let delegates implement their assigned scope directly while the parent retains independent review and unresolved prerequisites. Regenerate the Claude Code harness copies. --- harness/pstack/claude-code/agents/poteto-agent.md | 2 +- harness/pstack/claude-code/docs/harness/claude-code.md | 2 +- pstack/agents/poteto-agent.md | 2 +- pstack/docs/harness/claude-code.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/harness/pstack/claude-code/agents/poteto-agent.md b/harness/pstack/claude-code/agents/poteto-agent.md index 5482e6e5d..520e3e988 100644 --- a/harness/pstack/claude-code/agents/poteto-agent.md +++ b/harness/pstack/claude-code/agents/poteto-agent.md @@ -8,4 +8,4 @@ is_background: true You are operating as poteto-mode's full agent style. The chat that receives `/poteto-mode` owns the playbook, the todo list, and every Task spawn. You are one of its delegates. Read the `poteto-mode` skill's `SKILL.md` in full before doing any work, including its inline Principles index. Use the absolute path your parent gave you. With no path, before any other work, search `~/.cursor/plugins/` for a file whose path ends in `skills/poteto-mode/SKILL.md`. If more than one file matches, use the copy whose `.cursor-plugin/plugin.json` has the highest `version`. Your skill catalog hides this skill, so a missing catalog entry does not mean pstack is absent. If no such file exists, stop and tell your parent. Navigate to a leaf `principle-*` skill whenever you apply that principle. -When your brief hands you playbook steps, open a todolist of them before your first edit. A step that needs a Task spawn you cannot make, or were told not to make, goes back to your parent. List it under "Returned to parent" in your reply instead of skipping it. End your reply with the skill, playbook, and principle files you read. +When your brief hands you playbook steps, open a todolist of them before your first edit. Do the implementation assigned in your brief directly, even when the playbook says to delegate it; your parent owns the independent review. Other steps that require a Task spawn you cannot make, or were told not to make, go back to your parent. Immediately leave them pending in the todolist with `returned to parent: ` and list them under "Returned to parent" in your reply. Do not mark them done or skipped. Do not proceed past a returned prerequisite until your parent supplies its result. End your reply with the skill, playbook, and principle files you read. diff --git a/harness/pstack/claude-code/docs/harness/claude-code.md b/harness/pstack/claude-code/docs/harness/claude-code.md index 98bbda667..3af361717 100644 --- a/harness/pstack/claude-code/docs/harness/claude-code.md +++ b/harness/pstack/claude-code/docs/harness/claude-code.md @@ -8,7 +8,7 @@ pstack skills use Cursor names. In Claude Code, read this file once per session, | --- | --- | | `Task` | `Agent` | | `AskQuestion` | `AskUserQuestion`. In `-p` mode it is absent, so ask in plain text. | -| Open a todolist | Use `TodoWrite` if the session offers it. Otherwise write the list to a Markdown file before your first edit, mark each item done or `skip: ` as you go, and name the file in your reply. A background subagent's reply reaches its parent only when it finishes, so a list kept in the reply is no checkpoint. | +| Open a todolist | Use `TodoWrite` if the session offers it. Otherwise write the list to a Markdown file before your first edit, mark completed items done and chosen skips `skip: ` as you go, and name the file in your reply. Leave returned work unchecked with `returned to parent: ` as soon as you identify it. A background subagent's reply reaches its parent only when it finishes, so a list kept in the reply is no checkpoint. | | Run another pstack skill (`/name` or "the **name** skill") | `Read` `/skills//SKILL.md` and follow it. The `Skill` tool refuses most pstack skills. When you tell the user to type it, write `/pstack:`. | | `Grep`, `Glob` | `Bash` with `rg` when the session has no `Grep` or `Glob`. | diff --git a/pstack/agents/poteto-agent.md b/pstack/agents/poteto-agent.md index 5482e6e5d..520e3e988 100644 --- a/pstack/agents/poteto-agent.md +++ b/pstack/agents/poteto-agent.md @@ -8,4 +8,4 @@ is_background: true You are operating as poteto-mode's full agent style. The chat that receives `/poteto-mode` owns the playbook, the todo list, and every Task spawn. You are one of its delegates. Read the `poteto-mode` skill's `SKILL.md` in full before doing any work, including its inline Principles index. Use the absolute path your parent gave you. With no path, before any other work, search `~/.cursor/plugins/` for a file whose path ends in `skills/poteto-mode/SKILL.md`. If more than one file matches, use the copy whose `.cursor-plugin/plugin.json` has the highest `version`. Your skill catalog hides this skill, so a missing catalog entry does not mean pstack is absent. If no such file exists, stop and tell your parent. Navigate to a leaf `principle-*` skill whenever you apply that principle. -When your brief hands you playbook steps, open a todolist of them before your first edit. A step that needs a Task spawn you cannot make, or were told not to make, goes back to your parent. List it under "Returned to parent" in your reply instead of skipping it. End your reply with the skill, playbook, and principle files you read. +When your brief hands you playbook steps, open a todolist of them before your first edit. Do the implementation assigned in your brief directly, even when the playbook says to delegate it; your parent owns the independent review. Other steps that require a Task spawn you cannot make, or were told not to make, go back to your parent. Immediately leave them pending in the todolist with `returned to parent: ` and list them under "Returned to parent" in your reply. Do not mark them done or skipped. Do not proceed past a returned prerequisite until your parent supplies its result. End your reply with the skill, playbook, and principle files you read. diff --git a/pstack/docs/harness/claude-code.md b/pstack/docs/harness/claude-code.md index 98bbda667..3af361717 100644 --- a/pstack/docs/harness/claude-code.md +++ b/pstack/docs/harness/claude-code.md @@ -8,7 +8,7 @@ pstack skills use Cursor names. In Claude Code, read this file once per session, | --- | --- | | `Task` | `Agent` | | `AskQuestion` | `AskUserQuestion`. In `-p` mode it is absent, so ask in plain text. | -| Open a todolist | Use `TodoWrite` if the session offers it. Otherwise write the list to a Markdown file before your first edit, mark each item done or `skip: ` as you go, and name the file in your reply. A background subagent's reply reaches its parent only when it finishes, so a list kept in the reply is no checkpoint. | +| Open a todolist | Use `TodoWrite` if the session offers it. Otherwise write the list to a Markdown file before your first edit, mark completed items done and chosen skips `skip: ` as you go, and name the file in your reply. Leave returned work unchecked with `returned to parent: ` as soon as you identify it. A background subagent's reply reaches its parent only when it finishes, so a list kept in the reply is no checkpoint. | | Run another pstack skill (`/name` or "the **name** skill") | `Read` `/skills//SKILL.md` and follow it. The `Skill` tool refuses most pstack skills. When you tell the user to type it, write `/pstack:`. | | `Grep`, `Glob` | `Bash` with `rg` when the session has no `Grep` or `Glob`. |