create-template

Draft a shareable Template for a person to review, either from this agent or from their description of a new one (a role, plugins, automations). Tell the person you are drafting the Template as you load this skill.

Create a Template

While the person waits

PR #202077 records the silent creation run that prompted the separate progress messages and single proposal write.

Stay with this agent in this conversation. A request to create a Template means prepare a private copy for review, not publish it.

The person may ask to share this agent, or describe a new Template to make: a role, the plugins it uses, the automations it runs. Both are drafted here in the same way, with the same inventory command, progress messages, single proposal write and review card. A described Template takes its content from the description instead of from this agent, and step 3 says how. Don't build its package by hand or in another repository. PR #202773 records the described request that this skill turned away when it only covered sharing the current agent.

  1. Start in chat. Say “I'm drafting the Template now. I'll check what goes with it.” Then run one inventory command using this skill's absolute directory:

node <absolute-skill-directory>/scripts/inventory.mjs <absolute-current-agent-workspace> --agent <this agent's id> --json

Add --draft <id> only for the request-specific workContext.detail.draftId supplied by the Control UI. Otherwise the command starts a fresh draft. Keep its draftId and draftPath; never look for the latest draft or reuse another request's. It checks instructions, the avatar, skills, plugins and automations together. Don't run separate lookups for the sake of narration. If a lookup warned, say what you couldn't check rather than treating it as empty. If the command result is uncertain, inspect it before retrying.

  1. Send two short updates, at the decisions they describe. Use message(action="send", final=false) in this chat, with no target. Send each as its own call in its own turn, before the file write. Don't send them as one paragraph, batch them with the write, or wait until the card opens. If messaging is unavailable, use ordinary progress text at the same steps.

These are examples, not a script. Use only facts from this agent, or from the person's description when the Template is a new one. One or two short sentences per message; no role essay, file names, internal terms, personal details, or inventory counts. The three messages should tell the person something new each time.

  1. Write once. To share this agent, use the agent's role and working instructions already in context. Only read a missing or truncated instruction if it defines the role. If there's no single coherent role, ask which one to share. Write the proposal directly to draftPath with one file write. In a simple Template, a few concrete instructions about how to do the job are enough. Include what makes this agent useful, how it handles uncertainty, and when it hands work back. No word quota. Don't repeat the scope in the body or create another file just to restate the same instructions.

Write for a new owner. Never copy raw conversations, memories, USER.md, private URLs, paths, accounts, credentials or personal facts. Include required skills, plugins and automations even when that takes longer. Use the inventory's exact ClawHub ref and version. For a required workspace skill, read its SKILL.md, then re-author it and its supporting text for a new owner. Don't invent dependencies, copy installed plugin trees, or carry an automation just because it's available. When sharing this agent, choose only from the active automations in this inventory. Leave paused automations on the source agent; don't reconstruct them from memory. Rewrite included automations without the original owner's details.

For a described Template, write the role, scope, instructions and automations from the description. Its automations are new and need not exist on this agent. Leave out this agent's avatar, its automations, and any skill or plugin the person didn't name. For one they did name, use the inventory's ref and version when it has them. The inventory only knows how something was installed here, so a published plugin that was installed from a local file is counted in notPortable without a ref. Look that one up with a tool you have, such as plugins(action="search", query="<name>"), and declare the package name and latestVersion it returns. If you can't find an exact published release, say so and leave it out instead of guessing a ref or version.

A described Template may also need something only its new owner knows, such as a repository or their time zone. That is asked on first run, not now: add a BOOTSTRAP.md to files that asks for it. Declare an automation that depends on the answers with enabled: false and timezone: UTC, and have BOOTSTRAP.md save the answers, set the owner's time zone on that declared job, and turn it on once they agree, without creating a second job. This first-run setup is only for a described Template. A shared agent's automations keep the schedule and time zone the inventory reports.

  1. Open private review. After the write succeeds, call screen(action="template_review", draftId="<this request's draftId>") on its own. The review builds and checks the exact archive; no second validation or generic docs lookup is needed. End with the card alone, not a recap or a claim that it rendered. Only the person can publish. If review can't open in the active administrator Control UI, keep the draft and explain the blocker. For revisions, update this draft and open a fresh review; don't upload, print internal paths or IDs, or invent a review link.

Proposal format

Write one JSON object to draftPath:

{
  "name": "research-brief",
  "description": "Turn a question and sources into a cited brief.",
  "version": "0.1.0",
  "avatar": "avatars/agent.png",
  "scope": {
    "input": "A research question and sources.",
    "job": "Compare the evidence for each answer.",
    "output": "A short brief with links and open questions.",
    "authority": "Read the supplied sources. Ask before contacting anyone."
  },
  "manifest": "---\nschemaVersion: 1\nagent:\n  id: research-brief\n---\nStart with primary sources. Link each claim to its evidence. When sources disagree, show where they differ and say what would resolve it. Lead with the answer and put uncertain findings last.\n",
  "files": []
}

```yaml skills:

version: 1.2.3 plugins:

version: 2.0.0 automations:

name: Daily summary schedule: { cron: "0 9 *", timezone: UTC } session: main message: Summarize what changed since yesterday. ```

A bundled skill at skills/portable-checklist needs skills/portable-checklist/SKILL.md, with a name and description, in files. MCP requirements go in mcpServers with environment values left as ${NAME} references. Review rejects unsafe paths and credential-like content.