U2(c) is built: you can now import a bot from a Grok Bot template link. It's on main as
2b84990, pushed, and in the app installed in /Applications.
**What it does:**
- **CLI:** herdbot import-template <url> [--name] [--cwd] [--class] [--paste FILE] [--dry-run] [--json].
- It accepts only https://x.ai/bot/<id> and https://x.ai/bot/marketplace/bots/<slug>, nothing else.
- It fetches the page with /usr/bin/curl: HTTPS only, no redirects, no cookies, a 20-second timeout and a 5 MB cap.
- If the page layout doesn't match what it expects, it stops with an error and doesn't import anything.
- --dry-run shows a preview and writes nothing.
- --paste adds the parts the page doesn't include, using ## Skill:, ## Routine: (optionally with a Cron: line), ## Memories and ## Instructions headings.
- **What the bot gets:** it's written as an ordinary local bot that herdbot owns, with a note of which template it came from.
- Memories go to memory/imported-<date>.md and each skill to its own file in skills/; BOT.md lists the skills so the agent knows to read them.
- A routine becomes a schedule only if you give it a cron, and the schedule starts disabled.
- Secrets and code are never written.
- **App:** the sidebar's + menu, and the menu-bar menu, gain **Import Template…**. Paste a URL and click Preview to see what was fetched and what wasn't. Paste the rest, then finish with the same name, folder and task-class fields as New Bot.
- **Grok sync:** if a Grok bot later has the same name as an imported template, it's added under a separate name like alfred-grok. Your imported copy is never overwritten.
**Checked:**
- 243 Rust tests pass, using two saved real pages and no network. 225 Swift tests pass, clippy is clean, and the app builds.
- I read the URL allowlist and the curl flags myself.
- I ran a dry run with a throwaway home: the live Alfred marketplace page returned 2 memories, with skills and routines listed as not imported. A non-x.ai URL was rejected, and nothing was written.
- After the install, every doctor check passes, herdbot-dev kept its pane, and the installed helper has import-template.
**Not checked:** I haven't tried the Import Template sheet by hand; the steps are in TASKS.md. There's also a built-in limit: if x.ai changes its page layout, import stops working until the parser is updated, and the error tells you to copy the template in by hand instead.commit 4869670