export#

Generate a starter skill scaffold from an AgentPM tool.

Overview#

agentpm export --skill resolves a tool and writes a scaffolded skill directory with progressive disclosure:

skills/<tool-name>/
  SKILL.md
  references/
    tool-contract.md
    examples.md
  scripts/
    run.sh

This is a scaffold, not a polished final skill. It is meant to give you a strong starting point while keeping the packaged AgentPM tool as the execution source of truth.

Command synopsis#

agentpm export --skill <PACKAGE_REF> [--output <PATH>] [--manifest] [--force] [--token <PAT>]

Arguments#

  • --skill <PACKAGE_REF>. Tool spec to export as a starter skill scaffold.
  • --output <PATH>. Override the default output directory.
  • --manifest. Also generate a starter kind: "skill" agent.json.
  • --force. Overwrite an existing output directory.
  • --token <PAT>. Optional PAT for private remote export fallback.

Examples#

Generate the default scaffold#

agentpm export --skill @zack/echo-json

Write the scaffold somewhere else#

agentpm export --skill @zack/echo-json --output ./generated-skills/echo-json

Generate a publishable starter manifest too#

agentpm export --skill @zack/echo-json --manifest --force

Overwrite an existing scaffold#

agentpm export --skill @zack/echo-json --force

Behavior#

  • The command prefers installed tool metadata when the tool is already available locally.
  • If the tool is not installed, the command can resolve it from the registry and scaffold from the package artifact without installing it.
  • The generated SKILL.md stays concise and links out to deeper reference files.
  • references/tool-contract.md contains manifest-derived contract details.
  • references/examples.md contains generated starter examples.
  • scripts/run.sh delegates execution back to agentpm run.
  • --manifest adds a starter agent.json with:
    • kind: "skill"
    • standard: {"id":"agentpm","version":"1.0.0"} and the version-pinned editor $schema
    • a local name ending in -skill (the Tool name is shortened when necessary to stay within 64 characters)
    • the source tool pinned in top-level tools
    • skill.entrypoint, skill.references, and skill.scripts pointing at the generated files
  • The generated manifest is a starter, not a finished package. Edit the prose, examples, and dependency metadata before publishing.
  • The default output path uses only the tool name (skills/<tool-name>). If you have packages like @zack/echo-json and @acme/echo-json, use --output to avoid collisions.
  • Remote export fallback does not install the tool, create .agentpm package directories, or mutate agent.lock / workspace metadata.

Troubleshooting#

  • Registry connection failure. Remote fallback reports that the Skill export could not reach the server, rather than presenting an internal install endpoint as the operation. Check the registry address and network, then retry; RUST_LOG=agentpm=debug enables transport diagnostics.
  • Tool not found locally. That is fine if the package is available from the registry. The command will fall back to remote resolution when it can.
  • Private tool export fails. Re-run with --token <PAT> or log in first so remote fallback can access the package.
  • Output directory already exists. Re-run with --force if you want to replace the existing scaffold.
  • Scaffold is too generic. That is expected. Add your own workflow-specific guidance and examples after generation.