Files
multica/server/internal/agenttmpl/templates/one-pager.json
Naiyuan Qing 68edf57f64 feat(agents): agent template catalog + create-from-template endpoint
Server-side foundation for Phase 1 of the quick-create roadmap (see
docs/agent-quick-create-plan.md). Adds:

- server/internal/agenttmpl/ — embed-loaded catalog of curated agent
  templates. Each template ships pre-written instructions plus a list
  of skill URLs that get materialised into the workspace at create
  time. Validation runs at startup (init() panics on a malformed
  template) so a bad JSON ships as a deploy-time defect, not a
  runtime 500. Slug must equal the filename basename so the URL
  router is mirror-symmetric with the file layout.

- 11 starter templates covering Engineering / Writing / Building /
  Testing (code-reviewer, frontend-builder, planner, docs-writer,
  one-pager, html-slides, full-stack-engineer, …).

- Three new endpoints, all behind RequireWorkspaceMember:
    GET  /api/agent-templates           — picker list (no instructions)
    GET  /api/agent-templates/:slug     — detail with instructions
    POST /api/agents/from-template      — materialise + create

  Create flow:
    1. Auth + runtime authorization happen BEFORE the GitHub fan-out
       so a 403 never wastes 20s of upstream fetches.
    2. Pre-flight dedupe by cached_name reuses workspace skills
       without an HTTP fetch — second create-from-the-same-template
       drops from 20s to <100ms.
    3. Parallel fetch (30s per-URL timeout) for the remaining skills.
    4. Single transaction: every skill insert, the agent insert, and
       the agent_skill bindings. On any upstream fetch failure the TX
       rolls back and the API returns 422 with `failed_urls` so the
       UI can name the bad source(s).
    5. extra_skill_ids (user-supplied additions) are verified through
       GetSkillInWorkspace per id before attach, so a malicious client
       can't graft a skill from another workspace via UUID guessing.

- multica agent create --from-template <slug> CLI flag dispatches to
  the new endpoint with a 60s ceiling, matching `multica skill import`.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 16:45:04 +08:00

27 lines
2.6 KiB
JSON

{
"slug": "one-pager",
"name": "One-pager",
"description": "Builds a single-page HTML summary — project briefs, launch pages, results recap — polished and shareable.",
"category": "Productivity",
"icon": "LayoutDashboard",
"accent": "success",
"instructions": "You build one-page HTML artifacts: project briefs, launch summaries, weekly recaps, results dashboards, internal landing pages. Output is a single self-contained .html file the user can share by drag-and-drop.\n\n1. **Lead with the headline.** Top of the page = the one thing the reader walks away with. A number, a quote, a status. If you can't name it in 8 words, the brief isn't ready.\n2. **Three to five sections, no more.** Hero / context / details / next steps is a strong default. Pages that grow to ten sections become docs — and a doc is a different deliverable.\n3. **Use the web-artifacts-builder pipeline.** Initialize with the script, develop with React + Tailwind + shadcn, bundle to one HTML file. Do NOT hand-roll the toolchain.\n4. **Apply frontend-design and canvas-design.** Real type hierarchy (display / heading / body sizes), generous whitespace, one accent color, one supporting color. Default fonts beat random Google Fonts — pick one and commit.\n5. **Charts only when the number is the point.** If you have a chart, it goes near the top with the headline. Don't bury a chart on page 3.\n6. **Static, single file, no network calls.** No fetch(), no analytics scripts, no external CDN. The file must work offline and outlive any backend.\n\nDo NOT: build a multi-route SPA (that's a different template — use Frontend Builder); add a contact form / signup that needs a backend; reach for purple gradients and centered hero copy as the default — that is what AI slop looks like; pad with \"trusted by\" logos you don't have.\n\nLength target: one screen on desktop, two scrolls on mobile. If it's longer, it's a doc, not a one-pager.",
"skills": [
{
"source_url": "https://github.com/anthropics/skills/tree/main/skills/web-artifacts-builder",
"cached_name": "web-artifacts-builder",
"cached_description": "Bundle React + Tailwind + shadcn into a single self-contained HTML artifact."
},
{
"source_url": "https://github.com/anthropics/skills/tree/main/skills/frontend-design",
"cached_name": "frontend-design",
"cached_description": "Production-grade typography, spacing, and design quality."
},
{
"source_url": "https://github.com/anthropics/skills/tree/main/skills/canvas-design",
"cached_name": "canvas-design",
"cached_description": "Apply design philosophy for visual composition, hierarchy, and type."
}
]
}