Concrete need
poe-agent-tools needs to ship a hidden command named poe-agent-tools install-skill that installs this repository's checked-in skill file into the current project for Codex:
- source skill file:
.agents/skills/poe-agent-tools/SKILL.md
- target agent:
codex
- target scope:
local
- expected installed path:
.codex/skills/poe-agent-tools/SKILL.md
This command should call a poe-code SDK function. It should not shell out to poe-code, hand-roll file copies, duplicate path validation, or rely on private package internals.
Current blocker
As of poe-code@3.0.389:
- The package includes internal files under
packages/agent-skill-config/dist.
@poe-code/agent-skill-config is not published as an importable npm package.
poe-code's exports map exposes only ., ./agent, and ./memory; it does not expose ./skills.
So external repos cannot safely call installSkill without relying on private package internals or duplicating behavior.
SDK contract needed by poe-agent-tools
Please expose a public SDK subpath from poe-code:
{
"exports": {
"./skills": {
"types": "./dist/skills.d.ts",
"import": "./dist/skills.js"
}
}
}
The subpath should export an installSkill helper with this shape:
import { installSkill } from "poe-code/skills";
const result = await installSkill(
"codex",
{
name: "poe-agent-tools",
file: ".agents/skills/poe-agent-tools/SKILL.md"
},
{
cwd: process.cwd(),
homeDir: os.homedir(),
scope: "local",
dryRun: false
}
);
// result.displayPath === ".codex/skills/poe-agent-tools/SKILL.md"
// result.skillPath === `${process.cwd()}/.codex/skills/poe-agent-tools/SKILL.md`
The helper should also accept direct content for callers that do not want the SDK to read from a file:
await installSkill(
"codex",
{ name: "poe-agent-tools", content: skillMarkdown },
{ cwd, homeDir, scope: "local", dryRun }
);
Types needed by callers:
type SkillInstallSource =
| { name: string; file: string }
| { name: string; content: string };
type InstallSkillOptions = {
cwd: string;
homeDir: string;
scope: "local" | "global";
dryRun?: boolean;
};
type InstallSkillResult = {
displayPath: string;
skillPath: string;
};
If the implementation needs an injected filesystem for poe-code's own tests, expose that as an optional advanced option. The normal external SDK call must not require importing poe-code's internal FileSystem type.
Required behavior
scope: "local" installs under ${cwd}/.codex/skills for codex.
scope: "global" installs under ${homeDir}/.codex/skills for codex.
file paths are resolved relative to cwd unless absolute.
name is validated by the same skill-name validation used internally today.
- Existing destination files should fail loudly unless the existing centralized skill machinery deliberately supports overwrite.
dryRun: true returns the intended path and writes nothing.
- The implementation should continue to rely on
@poe-code/agent-skill-config internally so path validation and mutation behavior stay centralized.
How poe-agent-tools will use this
Once this SDK exists, poe-agent-tools will:
- Add
poe-code as a runtime dependency at the released version containing poe-code/skills.
- Add a hidden handwritten Toolcraft command through
handwrittenCommands:
import os from "node:os";
import process from "node:process";
import { defineCommand, S } from "toolcraft";
import { installSkill } from "poe-code/skills";
export const installSkillCommand = defineCommand({
name: "install-skill",
hidden: true,
params: S.Object({}),
handler: async () => {
return installSkill(
"codex",
{
name: "poe-agent-tools",
file: ".agents/skills/poe-agent-tools/SKILL.md"
},
{
cwd: process.cwd(),
homeDir: os.homedir(),
scope: "local"
}
);
}
});
- Include
.agents/skills/poe-agent-tools/SKILL.md in the npm package files list.
- Remove the temporary pre-dispatch shell-out from
src/bin/cli.ts.
Acceptance criteria
npm view poe-code@latest exports --json includes ./skills.
- From a clean external package, this works:
node -e 'import("poe-code/skills").then(m => console.log(Object.keys(m)))'
and prints installSkill.
- A clean external repo can run the SDK example above and create
.codex/skills/poe-agent-tools/SKILL.md without importing private subpaths.
Concrete need
poe-agent-toolsneeds to ship a hidden command namedpoe-agent-tools install-skillthat installs this repository's checked-in skill file into the current project for Codex:.agents/skills/poe-agent-tools/SKILL.mdcodexlocal.codex/skills/poe-agent-tools/SKILL.mdThis command should call a
poe-codeSDK function. It should not shell out topoe-code, hand-roll file copies, duplicate path validation, or rely on private package internals.Current blocker
As of
poe-code@3.0.389:packages/agent-skill-config/dist.@poe-code/agent-skill-configis not published as an importable npm package.poe-code'sexportsmap exposes only.,./agent, and./memory; it does not expose./skills.So external repos cannot safely call
installSkillwithout relying on private package internals or duplicating behavior.SDK contract needed by poe-agent-tools
Please expose a public SDK subpath from
poe-code:{ "exports": { "./skills": { "types": "./dist/skills.d.ts", "import": "./dist/skills.js" } } }The subpath should export an
installSkillhelper with this shape:The helper should also accept direct content for callers that do not want the SDK to read from a file:
Types needed by callers:
If the implementation needs an injected filesystem for poe-code's own tests, expose that as an optional advanced option. The normal external SDK call must not require importing poe-code's internal
FileSystemtype.Required behavior
scope: "local"installs under${cwd}/.codex/skillsforcodex.scope: "global"installs under${homeDir}/.codex/skillsforcodex.filepaths are resolved relative tocwdunless absolute.nameis validated by the same skill-name validation used internally today.dryRun: truereturns the intended path and writes nothing.@poe-code/agent-skill-configinternally so path validation and mutation behavior stay centralized.How poe-agent-tools will use this
Once this SDK exists,
poe-agent-toolswill:poe-codeas a runtime dependency at the released version containingpoe-code/skills.handwrittenCommands:.agents/skills/poe-agent-tools/SKILL.mdin the npm packagefileslist.src/bin/cli.ts.Acceptance criteria
npm view poe-code@latest exports --jsonincludes./skills.node -e 'import("poe-code/skills").then(m => console.log(Object.keys(m)))'and prints
installSkill..codex/skills/poe-agent-tools/SKILL.mdwithout importing private subpaths.