Discovers, routes, evaluates, installs, and in some cases executes reusable agent capabilities. TeaAgent currently has two related skill surfaces:
- Agent Skills prompt packages: directories containing
SKILL.mdand optional references/scripts/assets. These are discovered byskill_loader.pyand injected into agent context. - Executable skill tools: Python/WASM/Docker callable modules handled by
skill_executor.pyandskill_router.py.
The daily-driver skill path should prefer the governed Agent Skills candidate workflow before a skill becomes active in a project.
Strategic direction and current gaps are recorded in:
docs/strategy/agent-ecosystem-core-values-2026-06-05.mddocs/analysis/rss-failure-case-study-2026-06-05.mddocs/architecture/dynamic-skill-lifecycle-and-result-flow-2026-06-05.mddocs/plans/dynamic-skill-and-long-result-work-items-2026-06-05.md
- Isolation planning —
plan_skill_isolation(skill_path)inspects the skill manifest to determine the sandbox type:NATIVE,DOCKER, orWASM. - Risk-based routing — skill risk level (from
consensus.RiskLevel) influences whether Docker isolation is required. - Fallback — if Docker is unavailable and the plan says DOCKER, falls back to NATIVE with a warning.
- Tool file discovery — looks for
tool.py(primary) or any.pyin the skill directory. - WASM execution — if skill has
tool.wasmand WASM runtime is available, runs in WASM sandbox. - Docker execution — injects payload as a JSON argument into the container; captures stdout as JSON.
- Native execution — imports
tool.pyand callsrun(payload) -> Any. - Result wrapping — always returns
SkillExecutionResult(success, sandbox_type, output, error).
- Discovery — scans project and user skill directories in priority order (first match wins per skill name):
- Project scope:
.config/agent/skills/,.claude/skills/,.opencode/skill/,.opencode/skills/ - User scope:
~/.config/agent/skills/,~/.claude/skills/,~/.config/opencode/skills/
- Project scope:
- Review gate — loads only
SKILL.mdfiles that passreview_skill(). - Candidate artifact gate — installed candidate bundles with policy, provenance, cost, or contract artifacts must pass artifact validation.
- Prompt mode — eager mode loads full skill text; index-only mode exposes metadata without injecting full instructions.
- Explainability —
explain_skill_activation()reports loaded skills, shadowed paths, searched directories, token estimates, governance status, and expected project write targets.
- Proposal — creates a quarantined candidate under
.teaagent/skill-candidates/. - Artifact bundle — requires
SKILL.md,REFERENCE.md,tool_call_contract.json,cost_profile.json,interaction_policy.json, andprovenance.json. - Offline eval — validates artifacts, size, review findings, provenance,
reference content, and candidate-specific
eval_dataset.jsonchecks. - Review — a candidate must pass review before installation.
- Install — project installs write to
.config/agent/skills/<name>; personal installs require explicit personal-install attestation. - Provenance — installed candidates record install scope and candidate origin so CLI/TUI can distinguish reviewed skills from direct writes.
- Candidate proposal — repeated successful procedures become quarantined candidate bundles, not direct active-skill writes.
- Artifact and eval gates — structure, provenance, cost, interaction policy, reference content, and deterministic task behavior are checked before install.
- Reviewed install — reviewed project installs write to
.config/agent/skills/<name>with provenance. - Activation evidence — a later run must record skill selection, activation, resource reads, and output verification separately from load.
- Long-result preservation — source-heavy skill outputs use preview plus artifact pointer, hash, and cursor when they exceed model-visible limits.
- Semantic matching —
SkillRouter.route(query)returns ranked skills by description similarity. - Exact match — skill name matches take priority over semantic matches.
- Skill execution never modifies the main agent's workspace directly (isolation guarantee).
SkillExecutionResult.success=Falsealways has a non-emptyerrorstring.- Native execution timeout is enforced (subprocess or thread limit).
- A reviewed candidate install must carry provenance next to
SKILL.md. - A loaded active skill without candidate provenance should be treated as an unmanaged/direct-write skill for explainability and review purposes.
- "Skill loaded" does not imply "skill used"; runtime activation and output verification require separate audit evidence.
- Long RSS/WebSearch/skill outputs must remain source-backed through artifact pointers and verification, not preview-only summarization.