Inject the pstack skills dir so a poteto-agent child can find poteto-mode - #1
Conversation
…mode The poteto-agent brief told a child to read poteto-mode's SKILL.md at the <location> of its <available_skills> entry. poteto-mode is hidden (disable-model-invocation: true), so the host never lists it there and the instruction could not resolve. Upstream Cursor has no such sentence: a poteto-agent child resolves the skill by name through the host. Prime Agent has no equivalent, so the extension now appends one line on every turn, mode on or off: pstack skills dir: <SKILLS_DIR> (every pstack skill, hidden ones included, is <name>/SKILL.md under it) The brief body is back to upstream's sentence plus one clause that points at that line. The poteto-agent-find seam emits the same clause, so the wording survives a sync if upstream ever moves the text under skills/. Tests: systemPromptInjection strings updated for the new first line, a skillsDirLine unit test, an end-to-end before_agent_start test that registers the extension against a fake host and asserts <dir>/poteto-mode/SKILL.md exists at the injected path, and a lever test pinning the seam output. npm run check passes; npm run sync:upstream writes 0 files under skills/.
| * skill paths from. `agents/poteto-agent.md` points children at it. | ||
| */ | ||
| export function skillsDirLine(skillsDir: string): string { | ||
| return `pstack skills dir: ${skillsDir} (every pstack skill, hidden ones included, is <name>/SKILL.md under it)`; |
There was a problem hiding this comment.
non_blocking (correctness, confidence 0.84): The injected line does not delimit or encode the skills directory unambiguously. If the package is installed below a path containing ( such as /opt/Prime Agent (Beta)/..., the same ( sequence appears inside the path and before the explanatory suffix. A child following the documented line-based lookup can truncate the path and fail to read poteto-mode/SKILL.md.
Suggested fix: Put the raw skills directory on a line by itself, or encode/quote it with an unambiguous format and update the brief and test parser to use that format.
| sendUserMessage: () => undefined, | ||
| }; | ||
| const previous = process.env.PRIME_AGENT_CODING_AGENT_DIR; | ||
| process.env.PRIME_AGENT_CODING_AGENT_DIR = mkdtempSync(join(tmpdir(), "pstack-agent-dir-")); |
There was a problem hiding this comment.
non_blocking (other, confidence 0.99): The new end-to-end test creates a unique temporary agent directory but never removes it. Each test run leaves an empty pstack-agent-dir-* directory under the system temporary directory.
Suggested fix: Store the result of mkdtempSync in an agentDir variable and call rmSync(agentDir, { recursive: true, force: true }) in the existing finally block, while restoring the environment variable.
Tau PR reviewVerdict: Approved Coordinator approved; risk tier full; specialists completed 14/14. Blocking findings: 0; non-blocking findings: 2. Approval bias applied: approved with comments unless a concrete blocking shipping risk remained after dedupe/downgrade. Findings
Review scope
Skipped checks
Tau PR review — risk tier |
What changes for a user
A child spawned with the
poteto-agentbrief can now find and readpoteto-mode'sSKILL.md. Before, the brief told the child to look uppoteto-modein its<available_skills>list.poteto-modeis hidden (disable-model-invocation: true), so it is never listed there, and the instruction could not resolve.Every session now carries one extra line in its system prompt, whether or not
/poteto-modeis on:This matches upstream. In Cursor, a
poteto-agentchild resolvespoteto-modeby name through the host, from any parent, with no toggle. Prime Agent has no equivalent inside a child, so a stable, always-present path is the closest native form.How it was done
extensions/pstack/index.ts: newskillsDirLine();systemPromptInjectiontakesskillsDirand always leads with that line. Thebefore_agent_starthook passes the sameSKILLS_DIRthat/pstack offalready uses.agents/poteto-agent.md: body is back to upstream's sentence plus one clause pointing at the injected line. The Pi-erafffindsentence and the Prime-era<location>sentence are both gone.scripts/reground-from-pi.mjs: thepoteto-agent-findseam emits the same clause, so the wording survives a sync if upstream ever moves that text underskills/.README.md,docs/guide.md,CHANGELOG.md: describe the line and why it is unconditional.Tests:
extensions/pstack/index.test.ts: injection strings updated for the new first line; askillsDirLineunit test; an end-to-end test that registers the extension against a fake host, firesbefore_agent_start, parses the injected path, and asserts<dir>/poteto-mode/SKILL.mdexists on disk. Withindex.tsreverted, that test fails.scripts/reground-from-pi.test.mjs: pins the seam output.Verified live:
prime-agent -p --no-tools -e <this worktree>answered "What is the pstack skills dir?" with the worktree'sskills/path and "Is poteto-mode listed as an available skill?" withNo.Checks
npm run checkpasses locally (lint 47 skills, 0 problems; node 53 pass; bun 52 pass)scripts/reground-from-pi.mjsseams orscripts/prime-overrides/(not by hand underskills/).npm run sync:upstreamwrites 0 files underskills/.Note
Low Risk
Prompt and extension injection only; no auth, data, or spawn semantics changes beyond giving children a stable path to an existing skill file.
Overview
poteto-agentchildren can now locate hiddenpoteto-mode. The brief no longer tells them to use<available_skills>(wherepoteto-modenever appears because it isdisable-model-invocation: true). Instead it points at<dir>/poteto-mode/SKILL.md, with<dir>taken from a new always-on system-prompt line.The pstack extension adds
skillsDirLine()and makessystemPromptInjectionlead every turn withpstack skills dir: <path> …, including when/poteto-modeis off and forrlm.spawnchildren. Thebefore_agent_starthook always appends that block (not only when poteto mode or a role table is active).agents/poteto-agent.md,scripts/reground-from-pi.mjs(poteto-agent-findseam), and README / guide / CHANGELOG are aligned with that contract. Tests cover the new line, updated injection strings, and an integration check that the injected path containspoteto-mode/SKILL.mdon disk.Reviewed by Cursor Bugbot for commit 27e231b. Bugbot is set up for automated code reviews on this repo. Configure here.