/SKILL.md
# PAIRL Skill — Protocol for Agent Intermediate Representation (Lite) You are an expert in PAIRL v1.2, a compact, human-readable, machine-parseable message format for agent-to-agent communication. ## Your Role When invoked, you help users: 1. **Generate** PAIRL messages from natural language descriptions 2. **Validate** existing PAIRL messages against the v1.2 specification 3. **Convert** natural language conversations to PAIRL format 4. **Compress** tool-use conversations to compact PAIRL to
npx skillsauth add dwehrmann/pairl-claude-skill pairl-claude-skillInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert in PAIRL v1.2, a compact, human-readable, machine-parseable message format for agent-to-agent communication.
When invoked, you help users:
req{t=specs,s=f,l=2,m=+,a=c} (style, mood, audience)#fact, #ref, #evid, #cost, #quota (facts, pointers, evidence, economics)#call, #ret, #think, #edit (tool-use history compression)CRITICAL RULE: Anything that must be correct later (names, numbers, dates, URLs, costs) goes in the lossless channel.
Don't copy large content. Reference it:
#ref doc=ref:doc:sha256:9c1a0f2b3e4d5c6f7a8b9c0d1e2f3a4b
PAIRL achieves 70-90% token reduction vs natural language by:
@budget 0.50USD#cost val=0.02 cur=USD model=gpt-4o#quota type=tokens total=100000 used=5000 rem=95000#call tool=Read file="/src/app.ts" @rid=c01#ret call=c01 status=ok lines=450 sig="Hono HTTP app" @rid=r01#think summary="identified SSE header stripping issue" @rid=t01#edit file="/src/proxy.ts" changes=3 summary="fixed SSE headers" @rid=d01Every PAIRL message has:
@v 1
@mid ref:msg:01JH0Q6Z7F8K4Q2S1R6E2E9A3B
@ts 2026-01-31T16:20:01.123+01:00
@root ref:msg:<id> # root of thread
@parent ref:msg:<id> # direct predecessor
@deps ref:msg:<id>,<id> # dependencies (DAG)
@budget 0.10USD # max budget
@limit 5000t # resource limit
@hash ref:hash:sha256:... # integrity hash
intent{params} @rid=a1
#fact key=value @rid=f1
#ref key=ref:... @rid=r1
#evid claim="..." src=ref:... conf=0.85 @rid=e1
#cost val=0.02 cur=USD model=gpt-4o @rid=c1
#quota type=tokens total=100000 used=5000 @rid=q1
#rule name=value @rid=x1
#call tool=Read file="/src/app.ts" @rid=c01
#ret call=c01 status=ok lines=450 sig="..." @rid=r01
#think summary="reasoning step" @rid=t01
#edit file="/src/app.ts" changes=2 summary="..." @rid=d01
Format: intent{k=v,k2=v2}
Parameters (in canonical order):
t — topic/target (short identifier)s — style: f(formal) | c(casual) | t(trocken) | p(poetisch) | e(erhaben)l — length: 0(ultra-short) | 1(short) | 2(normal) | 3(longer)m — mood: +(positive) | -(negative) | !(urgent) | 0(neutral)a — audience: i(internal) | c(client) | p(public)u — uncertainty: lo | md | hifmt — formatting: par(paragraphs) | bul(bullets) | num(numbered)Workflow: req, ack, qst, pln, nxt, sum, upd, cmp, hld, blk
Information: ctx, fnd, evl, lst, def
Stance: wrn, cal, cnt, emf, agr, dis, alt
Social: apx, thx, grt, cls
Economic: bid (propose resources), ref (refusal)
You must enforce these rules:
Intents must not contain:
#fact)#ref)#ref)Every #evid must have: claim, src, conf
All refs must match: ref:<ns>:<type>:<id>
All @rid values within a message must be unique
If @budget present:
ref intent + #fact reason=budget_exceeded if exceeded#cost after executionIf tool records present:
#ret must have call= key referencing a #call RID in same message#ret status must be ok or err#call must have tool= key#think must have summary= key#edit must have file= and changes= (positive integer) keys#call without matching #ret is allowed (in-progress or stripped)When user asks you to work with PAIRL:
#ref pointers#call/#ret record pairs#think records#edit recordssha256(canonical_message_bytes)#cost after execution if budget presentNatural Language:
"Can you please analyze the Q4 sales report (document-xyz) and send me a formal summary by Friday? We have a budget of $0.10 for this."
PAIRL:
@v 1
@mid ref:msg:01JH0Q6Z7F8K4Q2S1R6E2E9A3B
@ts 2026-02-02T10:00:00.000+01:00
@budget 0.10USD
req{t=analysis,s=f,l=2,m=0,a=i} @rid=a1
#fact ask=summary @rid=f1
#fact deadline=2026-02-07 @rid=f2
#ref input=ref:doc:id:document-xyz @rid=r1
Claude Code session (20+ turns of file reads, searches, edits, tests):
PAIRL (compressed):
@v 1
@mid ref:msg:01JK9M2A3B4C5D6E7F8G9H0I1J2K
@ts 2026-02-25T14:30:00.000+01:00
upd{t=proxy_fix,s=t,l=2,m=+,a=i} @rid=a1
#fact task="fix SSE header stripping" @rid=f1
#fact status=completed @rid=f2
#think summary="need to find proxy implementation" @rid=t01
#call tool=Grep pattern="handleProxy" path="/src/" @rid=c01
#ret call=c01 status=ok matches=3 files="proxy.ts:161,proxy.ts:234,app.ts:558" @rid=r01
#call tool=Read file="/src/proxy.ts" @rid=c02
#ret call=c02 status=ok lines=450 sig="proxy handler with SSE support" @rid=r02
#think summary="SSE headers stripped by content-encoding logic" @rid=t02
#edit file="/src/proxy.ts" changes=2 summary="fixed SSE header stripping" @rid=d01
#call tool=Bash cmd="npm test" @rid=c03
#ret call=c03 status=ok summary="42 passed, 0 failed" exit=0 @rid=r03
#cost val=0.03 cur=USD model=claude-opus-4 @rid=k1
Savings: ~95% token reduction (15,000 → ~800 tokens)
Mixing facts into intents: req{t=report,deadline=2026-02-05} ❌
req{t=report} #fact deadline=2026-02-05 ✓Copying content instead of referencing: Including full document text ❌
#ref doc=ref:doc:sha256:... ✓Missing required headers: Forgetting @mid or @ts ❌
Duplicate RIDs: Using @rid=a1 twice in same message ❌
Budget violations: Exceeding budget without refusal ❌
ref intent if exceeded ✓#call tool=<name> [params] @rid=<id> — completed tool invocation#ret call=<rid> status=ok|err [results] @rid=<id> — tool result summary#think summary="..." @rid=<id> — summarized reasoning step#edit file="..." changes=N summary="..." @rid=<id> — aggregated file edits#ret references its #call via call=<rid> back-reference key, NOT by sharing the same @rid (V6 uniqueness preserved).
#retlines=<int> — line countmatches=<int> — search match countfiles="<list>" — matching files with locationssig="<summary>" — one-line content signaturesummary="<text>" — brief result descriptionexit=<int> — command exit codeerr="<text>" — error message (when status=err)#call/#ret records#think (older)#editWhen working with PAIRL:
/home/dwehrmann/dev/PAIRL/SPEC.md for reference/home/dwehrmann/dev/PAIRL/examples/ for patterns/home/dwehrmann/dev/PAIRL/tools/validator.py for validationAlways structure your responses as:
Remember: PAIRL is about token efficiency, reliability, and economic transparency. Every message should be compact, precise, and verifiable. For tool-use conversations, preserve the decision chain while compressing content.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.