agentleFS
shyftlabsshyftlabs/continuum/.claude/skills/continuum-agent/SKILL.md

continuum-agent

Skill84 starsChanged 6 months agoApache-2.0View on GitHub

Build BaseAgent instances and run them with AgentRunner — covers fields, lifecycle hooks, structured outputs, ReAct mode, instruction modifiers, and the full execution flow. Invoke when the user asks "create an agent", "configure max_turns", "add lifecycle hooks", "structured output with Pydantic", or anything around the core agent abstraction.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Don't pass role= / content= to SessionClient.add_message — pass a ChatMessage object.

    line 144
  2. Very specific:

    Don't import MemoryScope from continuum.memory and then pass it to AgentMemoryConfig — that's the dataclass.

    line 146
  3. Distinctive:

    Don't make hooks async — they're sync callables.

    line 149
  4. Very specific:

    Don't change max_turns to a huge number.

    line 150

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Continuum Agent Skill

Authoritative source: docs/agent.md.


Core API

from continuum.agent import BaseAgent, AgentRunner
from continuum.agent.config import AgentConfig, AgentMemoryConfig, RunnerConfig
from continuum.agent.types import (
    Handoff, MemoryScope, RunContext, AgentResponse, EventType,
)

Minimal agent

agent = BaseAgent(
    name="my-agent",                    # required, [A-Za-z0-9_-]+
    instructions="...",                 # supports {slot} templates
    model="gpt-4o-mini",                # provider chosen by prefix
    temperature=0.7,
    max_tokens=None,
)

runner = AgentRunner()
resp = await runner.run(agent, "user input", user_id="u1", session_id="s1")
print(resp.content)
print(resp.usage.total_tokens)
print(resp.structured_output)           # populated if output_schema set

Important BaseAgent parameters

ParameterDefaultNotes
namerequiredunique id
instructions""supports {template_vars}
modelsettings.default_llm_modelprefix routes provider
tools[]LLM-shaped dicts
mcp_servers[]Auto-discovered tool sources
handoffs[][Handoff(target_agent=..., description=...)]
memory_configAgentMemoryConfig()search_memories=True / store_memories=True
output_schemaNonePydantic model
template_vars{}static slots
examples[]few-shot
instruction_modifiers[]dynamic prompt rewriters
on_start / on_end / on_error / on_tool_call / on_handoffNonesync callables
configAgentConfig()max_turns=25, react_mode, reasoning_mode, scanners, strict_security, max_consecutive_handoffs=3 (same request to the same target before HandoffLoopError; fan-out over N items is never blocked), …
gateway_modeNoneSmart Gateway routing: "strict" / "modest" / "quality"
policy_storeNoneAccess-control store. None = fail-open (no authorization). Use PolicyStore.default_deny([...]) to fail closed; set AgentConfig(strict_security=True) to raise when side-effectful tools have no policy

Structured output

from pydantic import BaseModel

class Plan(BaseModel):
    intent: str
    steps: list[str]

agent = BaseAgent(name="planner", instructions="...", output_schema=Plan)
resp = await runner.run(agent, "...")
plan: Plan = resp.structured_output

Streaming

from continuum.agent.types import EventType

async for ev in runner.run_stream(agent, "..."):
    if ev.type == EventType.CONTENT_DELTA:
        print(ev.data["content"], end="", flush=True)

Memory scope (the agent enum, not the dataclass!)

from continuum.agent.types import MemoryScope
# MemoryScope.SHARED / USER / AGENT / RUN / CONVERSATION  — string enum

ReAct + reasoning modes

agent = BaseAgent(
    name="thinker",
    instructions="...",
    config=AgentConfig(react_mode=True, reasoning_mode=False),
)

react_mode injects a hidden think tool the LLM must call before producing a final answer. reasoning_mode does a silent "think first" pass before the main loop.

RAG context

agent = BaseAgent(
    name="rag-agent",
    instructions="Answer using PROVIDED CONTEXT.",
    config=AgentConfig(rag_context=retrieved_docs, require_context=True),
)

Hooks

def on_tool_call(agent, tool_name, args):
    print(f"{agent.name} -> {tool_name}({args})")

agent = BaseAgent(name="...", instructions="...", on_tool_call=on_tool_call)

Hooks are sync. Async hooks are not awaited.


Execution flow (what runner.run() does)

  1. Validate input against agent.input_schema (if any)
  2. Build RunContext and RunState; start trace
  3. Load tool-context state from session
  4. Assemble messages: system prompt → ReAct scaffold → tool context → memory facts (Qdrant) → session history (Redis) → optional RAG → sanitized user input → optional context compression
  5. Optional reasoning pass (silent)
  6. Loop up to max_turns: LLM call → run tools / handoffs → feed results back
  7. Persist session, store memories, return AgentResponse

Don't

  • Don't pass role= / content= to SessionClient.add_message — pass a ChatMessage object.
  • Don't import MemoryScope from continuum.memory and then pass it to AgentMemoryConfig — that's the dataclass; the agent module re-exports the enum of the same name.
  • Don't make hooks async — they're sync callables.
  • Don't change max_turns to a huge number; if a loop fails to converge in 25 turns the prompt is the problem.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.