AGENT SKILL

create-template

Turn this agent into a shareable Template for a person to review.

License 许可
MIT
所属仓库
openclaw/openclaw
最近更新
2026-11-11
Stars
★ 39w
Forks
8.3w

01 前言 Front Matter

name
create-template
description
Turn this agent into a shareable Template for a person to review.
user-invocable
true

02 资源文件 2

03 SKILL.md 正文

Create a Template

Use this skill when the person asks to create a Template from this agent, including ordinary chat requests such as “create a new template from this agent.” No sidebar action or special command is required. Stay in this conversation and use this agent's current workspace and durable instructions as source material. Prepare only a private proposal; the existing Control UI owns exact-archive review, package assembly, and explicit human publication. A request to create a Template is not permission to publish it.

Locate this SKILL.md and invoke its scripts/cli.mjs with an absolute path so commands use the running OpenClaw installation. If this turn has a request-specific workContext.detail.draftId from the optional Control UI entry, reuse it. Otherwise run node <absolute-skill-directory>/scripts/cli.mjs templates draft <absolute-current-agent-workspace> --json once and capture the returned draftId and path. Read and edit only that request's .openclaw/template-drafts/<draftId>.json. Never search for a latest draft, use a shared pointer, select a different agent, or start another conversation. Independent requests each get a new draft. If initialization has an uncertain result, inspect its recorded output before creating another draft. Keep internal paths and IDs out of your reply.

  1. Capture the reusable agent. Read the current draft JSON. Use this conversation and the agent's durable instructions to identify its coherent reusable role, input, job, output, and authority. Preserve useful behavior and settings; leave out personal context. If the responsibilities do not form one coherent Template, ask which responsibility to share before writing. Complete when the four scope fields describe an agent a new person can use.
  2. Inventory only relevant material. Select portable workspace instructions and files that implement that role. Locate this SKILL.md and use its scripts/cli.mjs for inventory so the CLI matches the running OpenClaw installation; invoke it with an absolute path when outside the skill directory. Run node scripts/cli.mjs skills list --agent <this agent's id> --json and node scripts/cli.mjs plugins list --enabled --json. Compare the results with tools actually available in this session and capabilities used in the role. Inspect a candidate with node scripts/cli.mjs plugins inspect <id> --json for its source and exact version. Declare a skill or plugin only when you can ground it in a current ClawHub package reference and exact version; plugin availability alone is not a requirement. Put package references in packages, MCP requirements in mcpServers, and useful schedules in automations. Their declarations are dependencies, not files copied into the archive. Complete when every included file and declaration has a reason tied to the reusable role.
  3. Author the proposal. Follow the draft format. Rewrite instructions for a new owner. Include input, job, output, and authority in the draft scope, and describe the portable behavior in CLAW.md. Place only newly authored portable text in files, mapping included workspace files by source in the manifest. Exclude raw conversations, memories, USER.md, credentials, secret values, private URLs, local paths, and personal facts. Never copy the source workspace tree. Complete when the JSON at this turn's draft path is valid and contains no private source material.
  4. Hand off for review. After saving the completed proposal, call screen(action="template_review", draftId="<this request’s draftId>"). Do not pass another session or agent: review is bound to this conversation and this agent. The existing Control UI review shows the exact built archive; the person can remove optional items and explicitly publish there. Briefly explain what the Template does, what optional files/dependencies it includes, and any capability you could not port. Do not print internal paths or IDs, invent a review link, upload, invoke publication, or claim that dispatch proves the review rendered. If screen/review is unavailable (for example outside an active administrator Control UI or with Templates Lab disabled), retain the private draft and report that precise review blocker without publishing or redirecting to a different conversation. Complete when review is available to the person, or clearly report the review-delivery blocker.

04 同仓库更多 Skills