init#
Scaffold a new AgentPM package by generating a starter agent.json manifest for a tool, skill, knowledge, memory, profile, loop, agent, or template package.
Overview#
agentpm init creates the minimal manifest you’ll complete later. New scaffolds use the version-pinned editor $schema bundled with the CLI. Descriptions must contain non-whitespace text. An Agent may omit its Tool, Loop and Profile dependencies; structural validity alone does not make it runnable. Each new manifest declares standard: {"id":"agentpm","version":"1.0.0"}; $schema is an editor hint, not the standard selector. The default is an Agent Package. Choose an explicit kind (tool, skill, knowledge, memory, profile, loop, agent, or template), set a name/description, and optionally an output directory.
Command synopsis#
agentpm init [--kind <tool|skill|knowledge|memory|profile|loop|agent|template>] [--mode <context|vector>] [--name <string>] [--description <string>] [--out-dir <path>]Arguments#
--kind(default:agent). What to scaffold: a single tool, a procedural skill, a knowledge package, a memory blueprint package, an instruction profile package, a loop package, a composed agent, or a workflow template package.--mode(default:context). Only used with--kind knowledge. Choosecontextfor direct context documents orvectorfor a prepared retrieval corpus starter.--name. Local package name, defaulting tomy-agent, ormy-<kind>for an explicit Component or Template (for example,my-tool). Names must satisfy the manifest schema; invalid names fail before files are created.--description. Nonblank package purpose. The default describes the selected scaffold. Quotes, backslashes, Unicode and newlines are encoded safely.--out-dir. Directory to write files to (defaults to current working directory).
Use --out-dir ./my-project to keep each package in its own folder.
agentpm init and agentpm init --kind agent produce the same Agent Package.
If a script previously relied on the Tool default, add --kind tool.
The Agent scaffold passes lint without any Components or a Loop. To execute it
with agentpm harness, add a Loop dependency and configure a model. The command
prints these next steps immediately after creation.
Generated files are never overwritten. Use an empty directory or another
--out-dir. An existing Tool main.py is kept; otherwise the runnable JSON echo
script is created. Collisions with secondary files or their parent paths are
checked before writing the manifest.
Examples#
Create an agent#
agentpm init --name research-assistant --description "Assistant composed of multiple tools"Generates agent.json:
{
"$schema": "https://raw.githubusercontent.com/agentpm-dev/cli/refs/tags/apds-v1.0.0/standards/agentpm/1.0.0/manifest.schema.json",
"standard": {
"id": "agentpm",
"version": "1.0.0"
},
"kind": "agent",
"name": "research-assistant",
"version": "0.1.0",
"description": "Assistant composed of multiple tools",
"examples": [
{
"prompt": "Describe the user request this agent should handle.",
"title": "Example prompt"
}
],
"knowledge": [],
"memory": [],
"profiles": [],
"skills": [],
"tools": []
}Create a skill#
agentpm init --kind skill --name incident-commander --description "Incident response coordination playbook"Creates:
incident-commander/
agent.json
SKILL.mdGenerates agent.json:
{
"$schema": "https://raw.githubusercontent.com/agentpm-dev/cli/refs/tags/apds-v1.0.0/standards/agentpm/1.0.0/manifest.schema.json",
"standard": {
"id": "agentpm",
"version": "1.0.0"
},
"kind": "skill",
"name": "incident-commander",
"version": "0.1.0",
"description": "Incident response coordination playbook",
"skill": {
"entrypoint": "SKILL.md"
}
}Create a tool#
agentpm init --kind tool --name summarize --description "Summarize input text"Creates agent.json and a small main.py that echoes one JSON input to stdout.
Existing main.py content is preserved. The fresh scaffold passes agentpm lint;
Python 3 is needed to run it, but not to generate or lint it.
{
"$schema": "https://raw.githubusercontent.com/agentpm-dev/cli/refs/tags/apds-v1.0.0/standards/agentpm/1.0.0/manifest.schema.json",
"standard": {
"id": "agentpm",
"version": "1.0.0"
},
"kind": "tool",
"name": "summarize",
"version": "0.1.0",
"description": "Summarize input text",
"entrypoint": {
"args": ["main.py"],
"command": "python3"
},
"files": ["main.py"],
"inputs": {},
"outputs": {},
"runtime": {
"type": "python",
"version": "3"
}
}Check the scaffold and run its source before replacing the echo implementation:
agentpm lint
echo '{"message":"hello"}' | python3 main.pyIf your Python interpreter uses a different command, update entrypoint.command.
The scaffold declares Python 3 as its minimum runtime, making published Tools
discoverable through the Python runtime filter. Update runtime alongside the
entrypoint if you change languages or require a newer interpreter.
Replace main.py and the input/output schemas with your Tool's actual behavior.
Create a knowledge package#
agentpm init --kind knowledge --name engineering-playbook --description "Engineering playbook intended for direct context loading"Creates:
engineering-playbook/
agent.json
README.md
knowledge/
docs/
context.mdGenerates agent.json:
{
"$schema": "https://raw.githubusercontent.com/agentpm-dev/cli/refs/tags/apds-v1.0.0/standards/agentpm/1.0.0/manifest.schema.json",
"standard": {
"id": "agentpm",
"version": "1.0.0"
},
"kind": "knowledge",
"name": "engineering-playbook",
"version": "0.1.0",
"description": "Engineering playbook intended for direct context loading",
"knowledge": {
"content_type": "documentation",
"documents": [
{
"content_type": "text/markdown",
"description": "Starter context document.",
"path": "knowledge/docs/context.md",
"role": "context"
}
],
"mode": "context",
"retrieval": {
"strategy": "full_context"
}
}
}The generated README.md is also mode-specific and explains the direct-context workflow rather than the vector workflow.
For a vector-mode starter:
agentpm init --kind knowledge --mode vector --name python-docs --description "Prepared retrieval corpus for Python documentation"Creates:
python-docs/
agent.json
README.md
knowledge/
chunks.jsonl
sources.jsonl
embeddings/Generates agent.json:
{
"$schema": "https://raw.githubusercontent.com/agentpm-dev/cli/refs/tags/apds-v1.0.0/standards/agentpm/1.0.0/manifest.schema.json",
"standard": {
"id": "agentpm",
"version": "1.0.0"
},
"kind": "knowledge",
"name": "python-docs",
"version": "0.1.0",
"description": "Prepared retrieval corpus for Python documentation",
"knowledge": {
"content_type": "documentation",
"corpus": {
"chunks_path": "knowledge/chunks.jsonl",
"sources_path": "knowledge/sources.jsonl"
},
"embedding": {
"dimensions": 1536,
"id": "default",
"metric": "cosine",
"model": "unknown",
"normalized": true,
"provider": "custom",
"vectors_path": "knowledge/embeddings/default.f32"
},
"mode": "vector",
"retrieval": {
"strategy": "vector"
}
}
}The generated README.md for vector mode explains the prepared corpus placeholders and calls out that knowledge/indexes/default is generated later by agentpm knowledge build.
Create a memory blueprint#
agentpm init --kind memory --name conversation-continuity --description "Describe the durable memory contract this blueprint provides."Creates:
conversation-continuity/
agent.json
README.md
schemas/
user-preference.schema.jsonGenerates agent.json:
{
"$schema": "https://raw.githubusercontent.com/agentpm-dev/cli/refs/tags/apds-v1.0.0/standards/agentpm/1.0.0/manifest.schema.json",
"standard": {
"id": "agentpm",
"version": "1.0.0"
},
"kind": "memory",
"name": "conversation-continuity",
"version": "0.1.0",
"description": "Describe the durable memory contract this blueprint provides.",
"memory": {
"record_types": {
"user_preference": {
"description": "Durable structured preferences for one user.",
"schema": "schemas/user-preference.schema.json",
"version": "1.0.0"
}
},
"scopes": {
"user": {
"description": "The user whose memory is being retained."
}
},
"spaces": {
"profile": {
"description": "The current durable profile for one user.",
"model": "document",
"record_types": ["user_preference"],
"retrieval": {
"modes": ["key"]
},
"scope": ["user"]
}
}
},
"readme": "README.md"
}The generated README.md explains the authored files, when to run agentpm memory build, how to use agentpm memory inspect, and that the blueprint does not provide a live memory store by itself.
Create a loop#
agentpm init --kind loop --name incident-response-loop --description "Portable incident triage and response loop"Creates:
incident-response-loop/
agent.json
README.mdGenerates agent.json:
{
"$schema": "https://raw.githubusercontent.com/agentpm-dev/cli/refs/tags/apds-v1.0.0/standards/agentpm/1.0.0/manifest.schema.json",
"standard": {
"id": "agentpm",
"version": "1.0.0"
},
"kind": "loop",
"name": "incident-response-loop",
"version": "0.1.0",
"description": "Portable incident triage and response loop",
"loop": {
"archetype": "review_execute_escalate",
"checkpoints": [
{
"before_phase": "review",
"id": "approve-execution",
"on_reject": "$handoff",
"type": "approval"
}
],
"entry_phase": "assess",
"error_policy": {
"phase_failure": {
"action": "handoff"
},
"tool_failure": {
"action": "retry",
"max_retries": 1,
"on_exhausted": "fail_phase"
}
},
"limits": {
"max_steps": 8
},
"phases": [
{
"id": "assess",
"objective": "Assess the current task state and decide whether work can proceed safely.",
"outcomes": [
{
"description": "The task can proceed to execution.",
"id": "proceed"
},
{
"description": "The task should be handed off instead of executed here.",
"id": "handoff"
}
]
},
{
"id": "execute",
"objective": "Perform the bounded unit of work and prepare the result for review."
},
{
"id": "review",
"objective": "Review the work and decide whether to finish or iterate once more.",
"outcomes": [
{
"description": "The work needs another execution pass before it can finish.",
"id": "needs-more-work"
},
{
"description": "The work is ready to finish.",
"id": "ready"
}
]
}
],
"transitions": [
{
"from": "assess",
"on": "proceed",
"to": "execute"
},
{
"from": "assess",
"on": "handoff",
"to": "$handoff"
},
{
"from": "execute",
"on": "complete",
"to": "review"
},
{
"from": "review",
"on": "needs-more-work",
"to": "execute"
},
{
"from": "review",
"on": "ready",
"to": "$end"
}
]
},
"readme": "README.md"
}The generated README.md explains Loop versus Agent responsibilities, implicit complete, graph-defined control flow, and that the README is documentation only.
Create an instruction profile#
agentpm init --kind profile --name support-style --description "Portable support communication profile"Creates:
support-style/
agent.json
README.mdGenerates agent.json:
{
"$schema": "https://raw.githubusercontent.com/agentpm-dev/cli/refs/tags/apds-v1.0.0/standards/agentpm/1.0.0/manifest.schema.json",
"standard": {
"id": "agentpm",
"version": "1.0.0"
},
"kind": "profile",
"name": "support-style",
"version": "0.1.0",
"description": "Portable support communication profile",
"profile": {
"communication": {
"tone": ["clear", "helpful"],
"verbosity": "concise"
},
"identity": {
"role": "Support assistant"
},
"objectives": ["Help the user reach a clear next step."]
},
"readme": "README.md"
}The generated README.md explains the Profile-versus-Skill boundary, notes that constraints express author intent rather than runtime enforcement, and clarifies that README text is package documentation rather than executable runtime instruction.
Create a workflow template#
agentpm init --kind template --name research-template --description "Bootstrap a research workflow"Creates:
research-template/
agent.json
template/
README.mdGenerates agent.json:
{
"$schema": "https://raw.githubusercontent.com/agentpm-dev/cli/refs/tags/apds-v1.0.0/standards/agentpm/1.0.0/manifest.schema.json",
"standard": {
"id": "agentpm",
"version": "1.0.0"
},
"kind": "template",
"name": "research-template",
"version": "0.1.0",
"description": "Bootstrap a research workflow",
"template": {
"dependencies": {
"agents": [],
"tools": []
},
"display_name": "Research Template",
"entrypoints": [
{
"command": "cat README.md",
"label": "Review generated scaffold"
}
],
"execution_surfaces": ["agentpm-run"],
"files_root": "template",
"use_case": "starter",
"variables": [
{
"default": "research-template",
"description": "Generated project name. Generation-time only; do not use for API keys, tokens, passwords, or runtime secrets.",
"name": "project_name",
"required": true
}
]
}
}agentpm init --kind template does not create consumer output like template/agent.json.
What's next?#
The generated manifests are valid starting definitions. Add the content and dependencies your package needs before sharing it; executable readiness depends on its kind and runtime.
- For agents:
- Add tools to the
tools[]array (viaagentpm install <tool>or by editing then runningagentpm install). - Replace the placeholder example prompt with a real user request your agent should handle.
- Leave dependency arrays empty unless you intentionally want the agent to resolve them.
- Add a Loop dependency and configure a model before running with
agentpm harness.
- Add tools to the
- For tools:
- Fill in
entrypoint.command(andargsif needed). - Define
inputsandoutputsschemas. - List any packaged artifacts in
files[](scripts, models, prompts, etc.).
- Fill in
- For skills:
- Author
SKILL.md. - Add tool refs to
tools[]when the skill depends on runnable packages. - Add optional
skill.references,skill.scripts, and descriptiveskill.compatibilitymetadata.
- Author
- For templates:
- Fill in the template package metadata, variables, dependencies, and entrypoints.
- Add scaffold files under
template/(or your chosentemplate.files_root). - Keep registry docs in the root
README.mdand generated-project docs intemplate/README.md. - Use
agentpm new . ../my-template-testto verify the scaffold locally before publishing.
- For knowledge packages:
- Replace the placeholder files under
knowledge/with your real content. - Keep
mode: "context"for direct context bundles, or use--mode vectorwhen starting a prepared retrieval corpus. - Run
agentpm knowledge buildbefore publishing so the derived metadata and local vector index are current.
- Replace the placeholder files under
- For memory packages:
- Replace the starter schema and authored
memorymetadata with the real scopes, record types, spaces, and optional lifecycle operations your blueprint needs. - Run
agentpm memory buildbefore publishing somemory/build.jsonand the generated contracts are current. - Use
agentpm memory inspectto verify the authored metadata, generated contracts, and freshness status before publishing.
- Replace the starter schema and authored
- For profile packages:
- Fill in the authored
profilestructure with real identity, objectives, communication guidance, and any optional constraints. - Keep README content as package documentation; the structured
profileobject is the runtime-facing contract. - Do not add runtime fields, build output, parameters, variables, or install-time prompts.
- Fill in the authored
- For loop packages:
- Replace the starter phases, outcomes, and transitions with the real control-flow contract you want to publish.
- Keep loop packages declarative: author phases, checkpoints, limits, and error policy metadata, but do not add runtime/provider configuration.
- Use
agentpm lintto validate graph semantics locally before publishing.
Run a quick check:
agentpm lintLint helps you catch missing fields, schema issues, and versioning problems early.
After linting and completing the manifest:
- Use
agentpm installto fetch declared tools, skills, knowledge, memory, profiles, and an optional loop (for agents) or declared tools (for skills). - Use
agentpm newto verify local or published templates. - When ready to share, head to
agentpm publish.
Notes & gotchas#
- Naming: Choose a unique
name—it’s surfaced in the registry and in your namespaces. - Versioning:
initseeds0.1.0. Bump versions semantically as your package evolves. - Subprocess runtime: Tools execute in a managed subprocess; define any required environment variables in the manifest so hosts know what to set.