Skip to content

AgentSkills Overview

AgentSkills are portable skill folders: a SKILL.md with YAML frontmatter and instructions, plus optional scripts/, references/ and assets/. AgentSkillStepDescription runs one skill as a chain step.

from mmar_carl import (
AgentSkillStepDescription, AgentSkillStepConfig, AgentSkillExecutionMode,
)
AgentSkillStepDescription(
number=1,
title="Extract PDF text",
config=AgentSkillStepConfig(
skill="github://anthropics/skills/skills/pdf@main",
task="Extract the text from {pdf_path} and summarise it.",
execution_mode=AgentSkillExecutionMode.LLM_AGENT,
input_mapping={"pdf_path": "$memory.input.pdf_path"},
),
)

The core package runs skills without extras. Optional extras:

Terminal window
pip install 'mmar-carl[agent-skills]' # agent-skills library for SkillLoader.catalog_from_agent_skills()
pip install 'mmar-carl[skills]' # agent-skills + pdf + pptx (the PDF -> PPTX example)

skill accepts a string or an AgentSkillSource. A string is converted to an AgentSkillSource when the config is built:

String formBecomesHow the step loads it
github://owner/repo/path@refgit_url + git_subdirectory + git_refGitHub tarball through GithubResolver; no git binary. Ref defaults to main.
/abs/path, ./rel, ../rel, local:///abs/path, anything ending in /pathDirectory with a SKILL.md.
module://pkg.namepackagePackage directory, or <pkg>/skills/<last-name>/.
https://..., http://..., git@...git_urlhttps://github.com/... goes through GithubResolver; any other URL is cloned with git clone --depth=1.
any other string, e.g. pdfnameSearched in search_paths, then ./.agents/skills, ./.claude/skills, ~/.agents/skills, ~/.claude/skills.

A tarball URL such as https://host/skill.tar.gz is not downloaded by the step: the step treats it as a git URL. Fetch tarballs with resolve_skill() and pass the local path.

ModeBehaviour
LLM (default)SKILL.md goes into the system prompt; one LLM call with the task as the user turn.
SCRIPTRuns one bundled .py or .sh script, no LLM. script_name picks it; without it the skill must have exactly one script. Inputs are passed as --key value. A non-zero exit fails the step.
HYBRIDRuns the script first; falls back to LLM mode if it fails, raises or prints nothing.
SUBAGENTRuns the script, then the LLM reasons over its output. If the script fails, the LLM still runs with an error note.
LLM_AGENTTool-calling loop over five fixed tools (run_script, read_file, write_file, list_resources, read_resource), up to llm_max_iterations rounds. See the workspace model.

LLM_AGENT needs a client that implements get_response_with_tools. The base client’s default returns no tool calls, so with such a client the loop ends after one plain LLM call.

All fields of AgentSkillStepConfig with their defaults in 0.5.2:

FieldDefaultPurpose
skillrequiredSkill string or AgentSkillSource (see above).
taskrequiredTask text. {key} placeholders are filled from input_mapping.
execution_modeLLMOne of the five modes.
input_mapping{}Name to reference ($history[-1], $memory.ns.key, …).
output_key"result"Label for the result.
output_memory_keyNoneIf set, the text result is written to memory under this key.
output_memory_namespace"agent_skill"Namespace for output_memory_key.
output_file_keyNoneIf set, the path of the first output file is written to agent_skill.<key>.
llm_configNonePer-step LLM override.
system_prompt_prefixNoneText placed before the skill instructions.
include_skill_descriptionTrueInclude the frontmatter description.
max_instructions_chars3000Truncate instructions; None for no limit.
strip_code_blocksTrueDrop fenced code blocks from the instructions.
filter_security_termsTrueDrop sections whose headings mention password / encrypt / decrypt / crypt, and such items from the description.
script_nameNoneScript for SCRIPT / HYBRID / SUBAGENT, relative to the skill dir.
script_args{}Static --key value args, merged with resolved inputs.
python_executable"python"Interpreter for .py scripts.
working_dirNoneScript cwd; defaults to the skill directory.
cache_skillsTrueCache parsed manifests in the loader.
skill_cache_dirNoneCache for git clone checkouts (default ~/.cache/mmar_carl/skills). GitHub tarballs always use the default cache.
timeout120.0Seconds per script run.
llm_max_iterations8Max rounds in LLM_AGENT.
persist_workspaceFalseLLM_AGENT: keep the workspace and write its path to agent_skill.<output_memory_key or title>_workspace.
output_capture"both"LLM_AGENT: "stdout", "files" or "both".
output_files_glob["*"]LLM_AGENT: which files from out/ are collected.
runtime"local"Script runtime. Only local works for this step, see sandboxing.
runtime_config{}Network policy keys (network, network_allowlist); validated, not enforced on local.
trust_policy"any""any" or "sha_pinned". With sha_pinned the step verifies SKILL.md before it uses it, see below.
skill_sha256NoneExpected SHA-256 of SKILL.md (64 hex chars). Required with sha_pinned.
extra_pip[]Packages installed with pip install --target into a temporary overlay put on PYTHONPATH. Runs on the host.
output_schemaNoneLLM_AGENT only: light JSON-schema check of the final answer (type, properties, required, items).
output_schema_strictTrueFail the step on a parse or schema error; False records schema_warnings instead.

result_data holds skill_name and execution_mode, plus mode-specific keys: stderr / returncode for SCRIPT, script_used / llm_fallback / script_error for HYBRID, and iterations, tool_calls_made, output_files, parsed_output, schema_validated, schema_warnings, workspace_root for LLM_AGENT. The history entry is tagged [skill:<name>].

AgentSkill steps round-trip through chain.to_dict() / from_dict(). The skill is stored as the converted AgentSkillSource (for example git_url + git_subdirectory), not as the original URI string. See JSON serialization.

chain.preflight(context) lists skill identifiers in required_skills; missing_skills is always empty because skills are not resolved during preflight. See Preflight.