Skip to content

feat(bundle): include tool-skills in built-in bundle - #16

Closed
manojp99 wants to merge 1 commit into
mainfrom
feat/bundle-include-tool-skills
Closed

feat(bundle): include tool-skills in built-in bundle#16
manojp99 wants to merge 1 commit into
mainfrom
feat/bundle-include-tool-skills

Conversation

@manojp99

Copy link
Copy Markdown
Collaborator

Summary

Add tool-skills to the built-in orchestrator bundle so external host adapters can deliver custom skill markdown via the standard discovery path (.amplifier/skills/, ~/.amplifier/skills/, $AMPLIFIER_SKILLS_DIR).

Motivation

Host adapters today (e.g. Paperclip's amplifier_local) have no first-class mechanism to inject host-specific skill markdown into the agent's session-cached layer. The only available transport is prepending skill content into the user-positional prompt, which:

  1. Re-injects on every wake, monotonically growing the user-turn history over the lifetime of the session.
  2. Cannot ride --resume cleanly — accumulated context from one task pollutes the next, causing the model to respond to whichever task framing is loudest in its history rather than the current wake.
  3. Has no equivalent of Codex CLI's $CODEX_HOME/skills/ or Claude Code's --append-system-prompt-file — both of which let those CLIs deliver skill content into a session-cached layer that --resume preserves cleanly.

tool-skills is the architecturally correct mechanism. It already exists, follows the Agent Skills open standard, and is the recommended bundle inclusion per the module's README. The only missing piece is shipping it in the default bundle so host adapters can rely on it being present.

This was discovered while debugging a Paperclip host adapter's continuation-loop bug, where a session-id resumed across heartbeats kept fusing successive tasks into one accumulated conversation. The other two production adapters in the same codebase (claude_local, codex_local) avoid this class of bug precisely because their CLIs expose a session-cached skill-delivery layer; amplifier-agent's CLI does too via --mcp-servers, but markdown-shaped skills are the natural fit and tool-skills is already the de facto answer.

Change

One additive YAML entry under tools: in src/amplifier_agent_lib/bundle/bundle.md, sourced from the published amplifier-module-tool-skills module at @main. Config mirrors the canonical wiring published by that module in behaviors/skills.yaml.

Impact

  • Cache key changes: editing bundle.md changes sha256(bundle.md), triggering a one-time re-prepare on next invocation per the bundle stability contract documented in the manifest header.
  • No behavioral regression: with no .amplifier/skills/, ~/.amplifier/skills/, or $AMPLIFIER_SKILLS_DIR directories populated, the visibility hook surfaces an empty list and load_skill reports zero entries.
  • Unlocks: any host adapter that needs to ship contract documentation (Paperclip approvals contract, future Slack/VS Code hosts, etc.) can write SKILL.md files into a known directory rather than prepending into user prompts.

Verification

  1. amplifier-agent run "list available skills" — expect the visibility hook to surface in agent context and load_skill to return zero entries when no skill dirs are populated.
  2. `mkdir -p /tmp/test-skills/hello && cat > /tmp/test-skills/hello/SKILL.md <<EOF

name: hello
description: Demonstrate skill discovery

Hello

A test skill.
EOF
AMPLIFIER_SKILLS_DIR=/tmp/test-skills amplifier-agent run "what skills are available?"— expecthello` to appear in the visibility hook list.
3. Existing tests pass without modification.

Notes

  • The tool-skills module registers its visibility hook internally at mount time (verified against amplifier-module-tool-skills/behaviors/skills.yaml), so no separate hook entry is required.
  • Optional follow-up: include skills:context/skills-instructions.md in the bundle's context: block to add agent-facing meta-instructions about how to use load_skill. Skipped here to keep the change minimal; the visibility hook itself surfaces what's needed for autonomous discovery.

Generated with Amplifier

Add the Agent Skills support module (tool-skills) to the orchestrator's
default tools list so external host adapters (Paperclip, future hosts)
can deliver custom skill markdown via the standard discovery path
(.amplifier/skills/, ~/.amplifier/skills/, $AMPLIFIER_SKILLS_DIR) instead
of prompt-prepending — which doesn't survive --resume cleanly.

Config mirrors amplifier-module-tool-skills/behaviors/skills.yaml.

Bundle cache key changes (sha256 of bundle.md), triggering one-time
re-prepare on next invocation per existing bundle stability contract.
No behavioral regression: empty skill list when no directories populated.

🤖 Generated with Amplifier

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@manojp99 manojp99 closed this Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant