When to use a skill vs. a custom agent
Build a skill when the same logic — say, “summarize a campaign in three bullets” — needs to be invoked from Houston, Space Bob, AND a custom Performance Reporter agent. Build a custom agent when the workflow is end-to-end and persona-defined.
Skill shape
ASkill row has:
Skills are created via the Skills page in the agent surface. Saving creates a new version (the prior version is preserved for replay).
Markdown skills
skills/markdown.py provides a renderer that converts Skill prompts written in lightweight markdown into the format LangGraph expects. Operators write skills like:
## Tools and ## Output sections are parsed and applied to the underlying Skill model. The ## Output block becomes the output_template.
Skill chaining + run replay
Two endpoints make skills production-grade:POST /api/skills/<id>/clone/— fork a skill so you can iterate without breaking the in-use version.POST /api/skills/<id>/run-replay/— re-run a previous invocation through the current skill version (not the version that ran originally). Surfaces gains from a prompt tweak retroactively.
Invocation paths
Skills are passed into the LangGraph swarm at run time. The agent’s tool list is augmented with the skill’s tools (deduplicated), and the skill’s prompt is prepended to the agent’s system prompt. Three places this happens:- In-chat — a user runs
/skill <name>(the chat parser detects the slash command and loads the skill into the next turn’s context). - Custom agent — a custom agent’s tool list can include
run_skill:<skill_id>, which is a meta-tool that the agent calls when it wants to invoke a skill mid-conversation. - Automation — the
run_agentaction accepts askill_idfield; if set, the skill is loaded into the one-shot run.
Endpoints
List skills the caller can see. Tenant-scoped.
Create a new skill. Body:
{ name, description, prompt, tools, output_template? }.Fetch a single skill (latest version).
List historical versions of a skill.
Fork a skill into a new id. Useful for A/B-testing prompt variants.
Replay a prior run through the skill’s current version. Returns the new run’s output for diffing.
shared.permissions.AgentSurfaceAllowed.
Worked example
A “Hook Diagnoser” skill that any creative-savvy agent can call:tools: ['run_skill:hook-diagnoser', ...]. When a user says “diagnose creative-abc-123”, Space Bob calls the skill, which calls find_similar_creatives + recommend_next_creative_brief and shapes the response per the skill’s output template.
.png?fit=max&auto=format&n=Frm2GFbmok4D-yJA&q=85&s=93c3ebd47542af65d1cd06d8563a7f6e)