agentleFS
QuarktexQuarktex/qcobrain/.claude/skills/call-agent/SKILL.md

call-agent

Skill4 starsChanged 4 months agoMITView on GitHub

OPTIONAL (requires a Quarktex API key). Invoke one remote Quarktex agent over the relay — preflight the brain's digests in, build the payload from the agent card's example_prompt, POST /agents/call, handle the needs_input human-in-the-loop on the SAME session_id, then route any returned fact through cite-or-refuse as an attributed third-party claim (sourced into sources/agents/ with the session_id as its citation, then captured to wiki/). Trigger on "call agent X", "ask the <capability> agent", "use the Hive". Only runs when quarktex.enabled:true.

  • Reads credentials

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 0 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

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

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

    Read config.yml → require quarktex.enabled: true and a non-empty QUARKTEX_API_KEY in .env (verify with bash integrations/quarktex/relay.sh …

    line 14
  2. Very specific:

    If either is missing, refuse in one line and stop: *"Quarktex is off — enable it and add a key per integrations/quarktex/SETUP.md."* Do not …

    line 16
  3. Very specific:

    If the user named a qt_<8> id, use it.

    line 28
  4. Very specific:

    Check the agent's trust tier (in the cache / connections.md).

    line 31
  5. Very specific:

    Read the chosen card's example_prompt / example_output — that is the exact payload *shape*.

    line 41
  6. Very specific:

    Read the response: { success, session_id, turn_number, response, meta }.

    line 52
  7. Very specific:

    If response.output.status === "needs_input", present output.ask to the user, collect the answer, and

    line 56
  8. Very specific:

    Write the verbatim exchange to sources/agents/<target_agent_id>-<session_id>.md: the request payload you sent and the final response you …

    line 65
  9. Very specific:

    Run /capture against sources/agents/<…>.md.

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

OPTIONAL — requires a Quarktex API key in config.yml; refuse with a one-line setup pointer if disabled.

Inherits references/kernel.md (the provenance contract). Reads references/wiki-spec.md for schema. Wire contract: integrations/quarktex/relay-contract.md. Layer overview: integrations/quarktex/README.md.

Gate (check first, every run)

  1. Read config.yml → require quarktex.enabled: true and a non-empty QUARKTEX_API_KEY in .env (verify with bash integrations/quarktex/relay.sh check).
  2. If either is missing, refuse in one line and stop: "Quarktex is off — enable it and add a key per integrations/quarktex/SETUP.md." Do not partially run.

What this does

Calls one remote agent on the Quarktex Hive and folds its answer back into the brain only through the provenance gate. A remote agent is a third-party brain (see the 3-brain separation in references/kernel.md) — its output is never canon by itself, only ever an attributed, sourced claim.

Execution

Step 1 — Pick the target agent

  1. If the user named a qt_<8> id, use it. Otherwise find one: prefer the cache integrations/quarktex/agents/_agents.md; if nothing fits, run /agents-sync "<capability>" (or bash integrations/quarktex/relay.sh search "<text>" --capability <cap>) and pick the best card.
  2. Check the agent's trust tier (in the cache / connections.md). deny → refuse, full stop. read-only (the default) → you may capture its output as a sourced claim but grant it no write authority. read-write → its sourced output may auto-route through /capture.

Step 2 — Preflight (digests in)

  1. Load digests/ (product.md, goals.md, user-profile.md, relevant recent-decisions.md). Fold the already-known context into the payload so you don't ask the agent what the brain already knows — and so a "prior X applied" is legible. Never paste secrets or .env contents into a payload.

Step 3 — Build the payload from the card

  1. Read the chosen card's example_prompt / example_output — that is the exact payload shape. Build payload to match it (same keys, same structure), filling in the user's real request + preflight context. Don't invent fields the card doesn't show.

Step 4 — Call the relay

  1. Start with session_id: null:
    bash integrations/quarktex/relay.sh call --target qt_yyyyyyyy --payload '<json>'
    (Or, if your brain speaks MCP, call the quarktex_call_agent tool — see integrations/quarktex/SETUP.md §4.) The brain calls from its caller-only from_agent_id (no inbound surface).
  2. Read the response: { success, session_id, turn_number, response, meta }. Keep the session_id — it is the citation anchor and the key to continuing the conversation.

Step 5 — Human-in-the-loop (needs_input)

  1. If response.output.status === "needs_input", present output.ask to the user, collect the answer, and call again with the SAME session_id:
    bash integrations/quarktex/relay.sh call --target qt_yyyyyyyy --session ses_xxx --payload '<json>'
    Loop until the response is final (no needs_input). Remember sessions expire after 30 min idle or 50 turns — don't try to resume a cold one.

Step 6 — Land the source (the citation)

  1. Write the verbatim exchange to sources/agents/<target_agent_id>-<session_id>.md: the request payload you sent and the final response you got back. This is the bottom of the provenance chain for this claim.
  2. Hash it (shasum -a 256 <file> | cut -c1-12) and add a row to sources/_sources.md with origin = quarktex:<target_agent_id> session:<session_id>, <date>. The session_id is what makes the claim verifiable — it ties back to a logged, replayable relay call.

Step 7 — Route through cite-or-refuse (hand to /capture)

  1. Run /capture against sources/agents/<…>.md. Each atomic claim becomes a wiki/ note that is:
    • type: reference (or fact), confidence: reported, origin: agent-generated,
    • bodied as an attributed third-party claim — "per {{Agent Name}} (Quarktex), as of <date>: …",
    • with a src block whose quote is a verbatim substring of the saved exchange and whose source key is the new _sources.md row.
  2. Anything worth keeping but not cleanly sourceable → inbox/ with status: needs-source. Junk (transient errors, the agent's own unverified beliefs, env-specific noise) → dropped per references/blocklist.md.
  3. Close with a one-screen summary: agent + session_id, source file written, N notes captured, M quarantined.

Guardrails (hard)

  • Autonomy never bypasses governance. A relay response enters canon ONLY via cite-or-refuse. A read-only agent gets no write authority; a deny agent is never called.
  • The source is the exchange, not the brain's paraphrase. Quote the saved sources/agents/ file verbatim; never cite a wiki/ note as the source of a relay claim.
  • Never leak secrets into a payload (no .env, no keys, no PII the user didn't authorize sending out).
  • Empty / success:false / timeout → no source, no wiki/ write. Report it honestly; at most an inbox/ draft noting the attempt. Never fabricate a response to fill the gap.
  • Caller-only. The brain calls; it never registers a webhook or runs an agent locally.

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.