From 42a68147903a35ea513ec88d144f1d760d5eb6cf Mon Sep 17 00:00:00 2001 From: Romi Singh <100926607+RomiSinghio@users.noreply.github.com> Date: Fri, 4 Sep 2026 10:08:40 +0400 Subject: [PATCH] fix(pstack): preload poteto-mode in Claude agent --- CHANGES.md | 4 ++++ NOTICE.md | 1 + docs/reference.md | 2 +- plugins/pstack/agents/poteto-agent.md | 2 ++ tests/skill-collision-repro.sh | 30 +++++++++++++++++++++++++++ 5 files changed, 38 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index ca4c99e..26a7438 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ This port applies the Cursor → Claude Code substitutions in skill bodies. Earlier drafts left them flagged; this revision resolves them. A later pass added a Codex build that shares the same skills; see [Codex port](#codex-port) below. +## Unreleased + +**Claude poteto-agent preload.** The Claude Code agent definition preloads `pstack:poteto-mode` through its `skills` frontmatter. Claude subagents start with isolated context, so the upstream prompt alone exposed the skill name but not its body. The shared skill tree and the Codex path are unchanged. The static invariants preserve the binding, and the behavioral check proves that the packaged agent can read a named principle without invoking `Skill` or reading a file. + ## 1.3.0 syncs to Cursor pstack 0.14.7 Open Pstack now tracks Cursor pstack 0.14.7 at `efa2a531985e0a8084d36ff3cf87233be8a9f34b`. diff --git a/NOTICE.md b/NOTICE.md index 49d832d..5876ea6 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -32,6 +32,7 @@ Summary of structural changes: - `plugins/pstack/skills/babysit/` is independently authored as the Claude Code analog of Cursor's `/babysit` built-in. It has no upstream pstack equivalent; its workflow is informed by Cursor's public `/babysit` behavior. No code or prose was copied from any source. - `plugins/pstack/skills/poteto-mode/scripts/` is vendored from upstream (`watch-pr`, `orch`, `bootstrap.ts`, `worktree-audit.sh`, `package.json`, `bun.lock`) with these port edits: `worktree-audit.sh` reads `~/.claude/projects/` instead of Cursor's transcript directory and warns when `jq` or `rg` is missing (their absence silently blanks the columns the prune decision reads), the private workspace package is named `@open-pstack/poteto-mode-tools`, `bootstrap.ts` rejects Node before it reads Bun-only APIs, and `package.json` includes the port-authored tests in `bun run test`. `check-plan.mjs` is the Cursor 0.14.3 checker adapted for the shared Claude Code and Codex skeleton. `bootstrap.test.ts` and `check-plan.test.ts` are authored for this port. - `plugins/pstack/agents/comment-sicko.md` is upstream's `Comment Sicko` agent, renamed to `comment-sicko` so the name works as a Claude Code `subagent_type`. The body is verbatim. +- `plugins/pstack/agents/poteto-agent.md` keeps the upstream prompt and adds Claude Code `skills` frontmatter so the isolated subagent preloads `pstack:poteto-mode`. - Claude-native Fable and Opus lanes are port-authored agent definitions. They select the rolling family alias plus requested effort for every selectable Claude-native pair in the provider-dispatch model matrix. - A Codex build shares the same `skills/` tree. It adds `plugins/pstack/.codex-plugin/plugin.json`, a root `.agents/plugins/marketplace.json`, and `plugins/pstack/skills/poteto-mode/references/codex-tools.md` (the Claude-to-Codex tool, model, and built-in map), plus a one-line Platform note in the skills that name a Claude primitive. The skill content itself is unchanged. See [CHANGES.md](CHANGES.md#codex-port). diff --git a/docs/reference.md b/docs/reference.md index 5e69907..fdef21b 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -154,7 +154,7 @@ The table uses the short upstream names. Claude Code exposes each native skill w ## Subagents -`poteto-agent` ships unchanged. Spawn from a parent with `subagent_type: "poteto-agent"`. +`poteto-agent` keeps the upstream prompt and adds Claude Code `skills` frontmatter. The field preloads `pstack:poteto-mode` because Claude subagents do not inherit the parent's loaded skills. Spawn the agent from a parent with `subagent_type: "poteto-agent"`. `comment-sicko` is the read-only comment reviewer the `no-comments` skill spawns. Upstream names it `Comment Sicko`; the port renames it to `comment-sicko` so the name is a valid `subagent_type`. Invoke it through `/no-comments`, not directly. diff --git a/plugins/pstack/agents/poteto-agent.md b/plugins/pstack/agents/poteto-agent.md index 838a0cd..f6d3ba7 100644 --- a/plugins/pstack/agents/poteto-agent.md +++ b/plugins/pstack/agents/poteto-agent.md @@ -1,6 +1,8 @@ --- name: poteto-agent description: Routing target for `/poteto-mode` and any request for poteto's style. Resume an existing `poteto-agent` for the conversation rather than spawning a sibling. Reads the `poteto-mode` skill's `SKILL.md` in full before any work, including its inline Principles index. Substituting `general-purpose` skips that read and drifts. +skills: + - pstack:poteto-mode --- # Poteto subagent diff --git a/tests/skill-collision-repro.sh b/tests/skill-collision-repro.sh index 6b66608..5d938a0 100755 --- a/tests/skill-collision-repro.sh +++ b/tests/skill-collision-repro.sh @@ -132,6 +132,24 @@ else fi plugin="$repo/plugins/pstack" + +poteto_agent="$plugin/agents/poteto-agent.md" +poteto_agent_front="$(sed -n '2,/^---$/p' "$poteto_agent")" +poteto_preload_bad="" +if [ "$(printf '%s\n' "$poteto_agent_front" | grep -cx 'skills:' || true)" != "1" ]; then + poteto_preload_bad="${poteto_agent} must declare one skills list"$'\n' +fi +if [ "$(printf '%s\n' "$poteto_agent_front" | grep -cx ' - pstack:poteto-mode' || true)" != "1" ]; then + poteto_preload_bad="${poteto_preload_bad}${poteto_agent} must preload pstack:poteto-mode"$'\n' +fi +if [ -n "$poteto_preload_bad" ]; then + note "FAIL: Claude poteto-agent does not preload poteto-mode:" + note "$poteto_preload_bad" + fail=1 +else + note "ok: Claude poteto-agent preloads poteto-mode" +fi + canon="$plugin/skills/poteto-mode/references/bugbot-triage.md" skill="$plugin/skills/babysit/SKILL.md" playbook="$plugin/skills/poteto-mode/playbooks/babysit.md" @@ -437,4 +455,16 @@ invoke='Call the Skill tool with skill "testplug:foo" exactly once and follow wh check "model-initiated Skill-tool invocation" "SKILL-RAN" "$(run "$invoke")" check "user /testplug:foo invocation" "SKILL-RAN" "$(run '/testplug:foo')" +preloaded_agent_output="$( + claude -p \ + 'Use the Agent tool once with subagent_type pstack:poteto-agent. Give it this task verbatim: "Without invoking Skill or reading files, reply with the first Core principle named in the preloaded poteto-mode skill." Return only the child response.' \ + --plugin-dir "$plugin" \ + --model fable \ + --effort max \ + --max-turns 5 \ + --tools Agent \ + < /dev/null 2>&1 +)" +check "poteto-agent preloaded skill" "Laziness Protocol" "$preloaded_agent_output" + exit "$fail"