RAPP linked-agent bridge
An Agent Skill projection produced by rapp-agent-converter is a pair:
<skill>/
├── SKILL.md
└── <slug>_agent.py
The linked Python file is not a helper or an approximation. It is a byte-exact
copy of the canonical RAPP cartridge. The SKILL.md also carries the complete
Python inline and a checksum-verified capsule, so separating the two files does
not lose the implementation.
When Python is available
Use the linked file directly:
python3 <slug>_agent.py --tool
python3 <slug>_agent.py '{"argument": "value"}'
Treat --tool as the parameter contract and pass one JSON object. Treat stdout
as a tool result:
- Missing or unresolved inputs: stop and collect them.
- A
stepsarray: execute the steps in order exactly as returned. - An
instructionsfield: follow those instructions with the supplied inputs. - Anything else: use the result verbatim.
Do not claim work completed merely because a planner returned steps. This is the EXEC tier only after the linked file actually exits zero.
When the linked file is missing
Locate the installed rapp-agent-converter skill with the host's workspace or
file tools. Use its absolute script path; never assume toast.py is in the
current directory.
CONVERTER="/absolute/path/to/rapp-agent-converter/scripts/toast.py"
python3 "$CONVERTER" convert <skill>/SKILL.md \
--to agent -o <skill>/<slug>_agent.py
A capsule-bearing skill restores the original bytes and verifies the checksum. If the capsule, generated commands, parameters, or inline Python was modified, stop on the converter's refusal. Never edit generated content to make it pass.
When Python execution is unavailable
The full Python under ## Run this — do not improvise is the exact
implementation. Treat it and the ## Parameters schema as the specification.
Do not claim EXEC. Do not paraphrase, reorder, or invent behavior.
Guardrails
- Prefer the linked agent over interpreting prose.
- Never import an agent merely to inspect it; use
--tool. - Never bypass capsule, checksum, generated-region, or inline-drift failures.
- Report SYNTHESISED versus RESTORED (byte-exact) exactly as the converter reports it.
- Keep the pair together when sharing or publishing the skill.
Run this — do not improvise
This capability's deterministic implementation is a RAPP single-file agent, linked beside this file as rapp_agent_bridge_agent.py and embedded as the fenced Python below (sha256 2b0a70061d1e76c2…; a byte-exact copy is also vaulted in the capsule comment at the end of this file). On a host with sandbox execution, run the linked file directly — if it is missing, write the fence contents verbatim to rapp_agent_bridge_agent.py first:
python3 rapp_agent_bridge_agent.py '{"key": "value"}' # arguments as one JSON object
echo '{"key": "value"}' | python3 rapp_agent_bridge_agent.py # or on stdin
python3 rapp_agent_bridge_agent.py --tool # emit the JSON tool contract
Treat stdout as a tool result. If it reports missing or unresolved inputs, stop and collect them. If it returns steps, execute those steps in order exactly as returned; if it returns instructions, follow them with the supplied inputs. Otherwise use the result verbatim. Do not invent behavior beyond that output. On a host without code execution, treat the Parameters schema and the code below as the exact specification and never paraphrase a step. Never edit inside the generated markers; a converter-equipped host can instead restore the original file checksum-verified with the installed rapp-agent-converter/scripts/toast.py convert SKILL.md --to agent.
"""RappAgentBridge -- Use whenever an Agent Skill ships a linked *_agent.py beside SKILL.md, the linked file is missing, or the user asks how to run a RAPP agent projection without paraphrasing it. Prefer execution of the exact linked agent where Python is available; otherwise use the complete embedded Python as the exact specification.
Generated by the rapp skill from rapp-agent-bridge. The RCI capsule at the bottom of this file carries the full original; `toast.py convert` restores it byte-exact."""
import json
import re
import sys
try:
from agents.basic_agent import BasicAgent
except ImportError: # running OUTSIDE a brainstem -- stay executable anyway.
class BasicAgent: # noqa: D101 - minimal stand-in, same contract
def __init__(self, name=None, metadata=None):
if name:
self.name = name
if metadata:
self.metadata = metadata
def perform(self, **kwargs):
return "Not implemented."
def system_context(self):
return None
def to_tool(self):
return {"type": "function", "function": {
"name": self.name,
"description": self.metadata.get("description", ""),
"parameters": self.metadata.get("parameters", {})}}
# The procedural layer, verbatim from the source capability.
INSTRUCTIONS = '# RAPP linked-agent bridge\n\nAn Agent Skill projection produced by `rapp-agent-converter` is a pair:\n\n```text\n<skill>/\n├── SKILL.md\n└── <slug>_agent.py\n```\n\nThe linked Python file is not a helper or an approximation. It is a byte-exact\ncopy of the canonical RAPP cartridge. The `SKILL.md` also carries the complete\nPython inline and a checksum-verified capsule, so separating the two files does\nnot lose the implementation.\n\n## When Python is available\n\nUse the linked file directly:\n\n```bash\npython3 <slug>_agent.py --tool\npython3 <slug>_agent.py '{"argument": "value"}'\n```\n\nTreat `--tool` as the parameter contract and pass one JSON object. Treat stdout\nas a tool result:\n\n1. Missing or unresolved inputs: stop and collect them.\n2. A `steps` array: execute the steps in order exactly as returned.\n3. An `instructions` field: follow those instructions with the supplied inputs.\n4. Anything else: use the result verbatim.\n\nDo not claim work completed merely because a planner returned steps. This is\nthe **EXEC** tier only after the linked file actually exits zero.\n\n## When the linked file is missing\n\nLocate the installed `rapp-agent-converter` skill with the host's workspace or\nfile tools. Use its absolute script path; never assume `toast.py` is in the\ncurrent directory.\n\n```bash\nCONVERTER="/absolute/path/to/rapp-agent-converter/scripts/toast.py"\npython3 "$CONVERTER" convert <skill>/SKILL.md \\\n --to agent -o <skill>/<slug>_agent.py\n```\n\nA capsule-bearing skill restores the original bytes and verifies the checksum.\nIf the capsule, generated commands, parameters, or inline Python was modified,\nstop on the converter's refusal. Never edit generated content to make it pass.\n\n## When Python execution is unavailable\n\nThe full Python under `## Run this — do not improvise` is the exact\nimplementation. Treat it and the `## Parameters` schema as the specification.\nDo not claim EXEC. Do not paraphrase, reorder, or invent behavior.\n\n## Guardrails\n\n- Prefer the linked agent over interpreting prose.\n- Never import an agent merely to inspect it; use `--tool`.\n- Never bypass capsule, checksum, generated-region, or inline-drift failures.\n- Report **SYNTHESISED** versus **RESTORED (byte-exact)** exactly as the\n converter reports it.\n- Keep the pair together when sharing or publishing the skill.'
# Ordered commands lifted verbatim from the capability's own documentation.
STEPS = []
class RappAgentBridgeAgent(BasicAgent):
def __init__(self):
self.name = 'RappAgentBridge'
self.metadata = {
"name": "RappAgentBridge",
"description": "Use whenever an Agent Skill ships a linked *_agent.py beside SKILL.md, the linked file is missing, or the user asks how to run a RAPP agent projection without paraphrasing it. Prefer execution of the exact linked agent where Python is available; otherwise use the complete embedded Python as the exact specification.",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
}
super().__init__(name=self.name, metadata=self.metadata)
def perform(self, **kwargs): # toaster:generated-perform
return json.dumps({"status": "ok", "instructions": INSTRUCTIONS,
"inputs": kwargs,
"note": "Prose-only capability: follow INSTRUCTIONS "
"with the given inputs."}, indent=2)
if __name__ == "__main__":
# echo '{"arg": "value"}' | python3 rapp_agent_bridge_agent.py
# python3 rapp_agent_bridge_agent.py '{"arg": "value"}'
# python3 rapp_agent_bridge_agent.py --tool # emit the JSON tool contract
_a = sys.argv[1:]
if _a and _a[0] == "--tool":
print(json.dumps(RappAgentBridgeAgent().to_tool(), indent=2))
else:
_raw = _a[0] if _a else (sys.stdin.read().strip() or "{}")
print(RappAgentBridgeAgent().perform(**json.loads(_raw)))
# rci-capsule:v1:H4sIAAAAAAAC/31Ya5OqyLL9K4RzI+bebXerCCo950wEvgDf4Nvjjd0FFIK8KUBxYv77zULt3Xti5vaHDqWqsjJXrlyZ+EcFZakdJpX3IPO8l4qJiZE4UeqEQeW9siaYudg4wDlOGBQw4gkHKbN0Hc9jiO1EhEGM5wQuNplv3xFdfIsKRsfEMTGzHCuTyZtvvjCpjZ/bLMfDjEMY3yHECU4vTJiUyxmhNxCXMHZ4YdKQSbIAjGviYsGUhpkoCc/YoI4xFwdczuARSlBkJ4haYpz0jVkk2AI7+IqNrNwZWqV1fEVG+nThbg7CSjCzKMBSQB1COXI8pHv4NyaEI8nFIaVX5Xkj9CMPp2DI17FpgpHHQUS+2CcRNhzLMRC9+q3yUoHH9BypvP/nf18qDnx+wuwEJE2yMhpYrfxyD/Tu4OvdQT1xzBM+BsdA/Bn4L0DARzMzwB29YD4Ai+h+9tUIA8hYipOPMjQAykneqamPj48UX9Nj8C9Cbf1eg4cZyzcM+r9ev///zNxjkftp8V/Ey06/f2a7tElNr34k+QHOM9dBmIIPNvYiyE1YEglcTcKr49+hYpT07qdepPi1BPMYGCFQ6ZE/AwVhAMB6d5wMlKQlOm8MvfXj6e8HgzwS0uXEweSnzB2DZ6oDcBKDD0AExrCx4ZLMfwW0IHPguoEiknn4hQE7BFOCpZRc1FR6CcuQCGOGmBwDGpYXPhhCk4t9gOQeEQXkl1+YLdTO33GMLq8fJ78WhukkkFmveOZKR8Q+BlFpoPlX5JnX1zQMvX9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