Skip to content

agent-pack: The first language for agent harnessesDevelopers aren't dead.They're stuck writing prompts.

agent-pack turns prompts back into code: a language for your agents, with imports, types and a compiler that catches mistakes before they run.

Typed templates. Shared libraries. Context on demand. Agent teams.

Hey, I’m Orphy. Want to see an agent compile?

Show me
GitHub
  • Claude Code
  • Cursor
  • GitHub Copilot
  • Codex
  • Junie
  • Gemini CLI
  • Windsurf

writeagents/standalone/reviewer.ap

IMPORT finding FROM @main.templates

EXPORT AGENT reviewer:
    ABOUT     reviews a diff before it merges
    OWNS      reviews/**
    LENS-OUT  finding
    NEVER     approve a diff whose tests fail
    WHEN asked to review a pull request:
        ASK    sum up {{diff}} in three lines
        RUN    risk INTO score
        IF!!   {{tests}} report zero failures:
          MUST!  approve it with its {{score}}

COMPUTE risk:
    REQUIRE:
        MUST  {{diff}} be a unified diff
    RETURN AS score:
        DO  weigh the diff and rate its risk
    ENSURE:
        ALWAYS  the result be between 0 and 100

Meet reviewer, the agent everyone writes first. In agent-pack it is source: rules, a trigger, a typed answer.

judge$ agent-pack bundle all

error …/agents/standalone/reviewer.ap:18:9 [judge-program-vague.line.1] DO line breaks the rule "never require the programmer to guess a detail to implement it" (p=0.04)

error …/agents/standalone/reviewer.ap:18:9 [judge-executed-inputs.line.1] DO line breaks the rule "never rely on any information that is neither one of `inputs` nor written out literally in `line`" (p=0.31)

[agent-pack] bundled 1 agent(s) × 1 adapter(s) → 0 file(s) (1 error(s))

Caught before it ever runs: “weigh the diff” is too vague for a program to compute.

fix$ git diff

diff --git a/agents/standalone/reviewer.ap b/agents/standalone/reviewer.ap--- a/agents/standalone/reviewer.ap+++ b/agents/standalone/reviewer.ap@@ -15,6 +15,6 @@ COMPUTE risk:     REQUIRE:         MUST  {{diff}} be a unified diff     RETURN AS score:-        DO  weigh the diff and rate its risk+        DO  changed lines / 10, plus 5 per file in src/auth/, at most 100     ENSURE:         ALWAYS  the result be between 0 and 100

Say it exactly, and a program computes it — every time, the same, with no tokens.

compiled.claude/agents/reviewer.md

---
name: reviewer
description: "reviews a diff before it merges"
tools: "*"
model: inherit
---
You may write only: reviews/**
You must never approve a diff whose tests fail
When asked to review a pull request:
    Ask a delegate to sum up the diff in three lines [node .agent-pack/apx/reviewer.apx get exe-5c1d02a7]
    Run the procedure `risk` [node .agent-pack/apx/reviewer.apx get cmp-91e4b3f0]
    …
```bash
node .agent-pack/apx/reviewer.apx start
```

Clean build. Claude Code gets a short agent file; the rest waits in the apx, read only when needed.

runClaude Code → .agent-pack/apx/reviewer.apx

claude
> review pull request #42
node .agent-pack/apx/reviewer.apx start
# agent reviewer — reviews a diff before it merges
node .agent-pack/apx/reviewer.apx run exe-91e4b3f0 --into score
# stored as `score` for this session
node .agent-pack/apx/reviewer.apx get score
{"score": 23}
node .agent-pack/apx/reviewer.apx check cnd-4a7e1c22
open
the gate opened (p=0.97)

The program scores the risk, and a check the agent never sees decides whether it may approve.

skillplaybooks/release-notes.playbook.ap

PLAYBOOK release-notes:
    ABOUT  drafts the notes of a release
    WHEN asked for release notes:
        DO     list the merged pull requests
        DO     group them by kind
        MUST   cite each pull request
        NEVER  invent a change
        SHOULD keep each line under 80 chars

.claude/skills/release-notes.playbook/SKILL.md

---
name: release-notes.playbook
description: release-notes.playbook
---
# Steps for release-notes.playbook

PLAYBOOK release-notes:
    ABOUT  drafts the notes of a release
    When asked for release notes:
        Do:
        - list the merged pull requests
        - group them by kind
        You must cite each pull request
        You must never invent a change
        You should keep each line under 80 chars

A playbook is one triggered workflow; on the right, the Claude Code skill agent-pack compiled from it.

Start coding agents, for real
An illustrative run of a code reviewer through agent-pack 0.28, and the playbook a skill is compiled from.

From source to a bundled agent

Build agent-pack from source with Node 20 or newer, make and a C compiler.npm link puts the agent-pack command on your PATH.

shell
git clone https://github.com/digitex3d/agent-pack && cd agent-pack && npm ci && npm run build && npm link

Nine mechanisms, each answering a problem of agent programming.

A compiler for your instructions

Prompt text has no build. In .ap, a dangling reference or a misspelled keyword fails the build at file and line, before any agent runs. With judge on, a model reviews each line your #judge rules name, pinned by the lock.

Reasoning that becomes tested code

Calculations redone each run cost tokens and drift. Mark a step COMPUTE and state what it returns: the agent writes the program and its tests once; from then on the program answers, same input, same output.

Checks the agent never sees

An agent should not grade its work. IF! puts the condition to a judge model, deciding on stored variables. IF!! seals it out of every prompt: the agent hears open or closed. In doubt, closed. IF** asks a tested program.

Typed hand-offs between agents

Free text has no contract. A TEMPLATE is a type: named slots, word limits, enums, optional fields, nested templates. A step declares the shape it hands over; a typed variable keeps it; an answer breaking its contract is never stored.

A team you call like one agent

Calling several agents means knowing each one. Hand a step to a team with BY, or one line with ASK … BY: its routing picks who does it. flows.ap compiles into AGENTS.md; agents follow it inside the harness. No runtime, no server.

One source, every harness

One copy per harness drifts. The same .ap compiles to Claude Code, Cursor, Junie and AGENTS.md, each output projected from one compiled document. On Claude Code, flows become Workflow scripts and playbooks skills.

  • Write a rule once, import it everywhere

    Policies, roles, procedures and templates are modules, private unless exported, imported by name. A new rule reaches an agent only when that agent imports it.

  • The agent reads only what it needs

    Each agent ships as one .apx, a file holding its definition and the engine that serves it. The agent reads the blocks its task needs, by id; a small agent is printed whole.

  • Emphasis is syntax

    MAY, SHOULD, MUST, MUST!, NEVER: each level compiles to one exact formula, the same in every agent. The judge's builtin rules keep force words and conditions out of DO lines.

Measured on a real team

Four measurements taken on the six-agent team that builds this site, from its own .ap sources.

apx

Context on demand

27 % fewer characters

loaded by an agent served by its apx before its first read, and 20 % fewer when the task uses all of the agent’s own rules.

imports

Rules written once

68,199 characters

in the team’s 39 .ap files, against 246,794 for one self-contained file per agent (−72 %), and 83,508 for a hand-written team that writes each paragraph once (−18 %).

adapters

One source, every harness

6 of 6 agents

receive the same rules in Claude Code and Cursor, text for text.

compiler

Errors stopped at compile time

14 of 15 errors

seeded into real sources fail the build, each with its file and line. A hand-written .md has no build.

agent-pack 0.28.0, measured 2026-10-14. Sizes are characters, not tokens.

Compiled for the harness you use

Adapters guide →

adapter

claude-code

Writes the whole definition to .claude/agents/<name>.md, playbooks to .claude/skills/.

adapter

claude-code-apx

Writes the agent’s own definition to .claude/agents/<name>.md, then a pointer to its apx.

adapter

cursor

Writes each agent and playbook to .cursor/rules/<name>.mdc.

file

AGENTS.md

Always written: the project context, every team, its members and routing.

Latest releases

Changelog →

2026-10-06

0.27.1

The agent-pack-developer example and the builtin scaffolds write the 0.27 syntax.

2026-10-06

0.27.0

Variables, checked conditions (IF!, UNTIL!), a compile-time judge, flows compiled to harness scripts.

2026-09-13

0.26.0

STORE working tables, the claude-code-apx adapter, the apc executable compiler.

agent-pack is pre-1.0: the .ap language and the CLI may change between minor versions. The changelog lists every breaking change.

Where this goes

Agent rules began as prose pasted into configuration files. agent-pack makes them a language: syntax, imports, force levels, a compiler. The source states intent, the model carries it out: a better model makes the source more powerful, not obsolete.

One day, agents will generate programs live, directly, without going through code.

— Giuseppe Federico

If agents produce the program, the agent is what we program. agent-pack already holds the parts: request and answer shapes, checked conditions, tested programs for deterministic steps, typed state, each reached through the agent's apx, each check and run recorded.

You decide what the model decides. IF! asks a judge, itself a model; IF!! seals the condition out of every prompt; IF** and COMPUTE hand work to tested programs. An answer breaking its contract is never stored; every check is recorded.

Giuseppe Federico, author of agent-pack

Pixel-art portrait of Giuseppe Federico at his desk, three screens of code behind him, Orphy the dwarf spitz lying beside the keyboard.

Giuseppe Federico has been passionate about programming since childhood, and has contributed to many open-source projects along the way, among them the well-known jfbchat. A software engineer by training, Giuseppe has worked in several startups as founder, CTO or principal engineer. agent-pack, designed in May 2026, joins that craft with LLMs and agents: agent teams, flows and typed answer formats, written as source and compiled. Giuseppe is also the owner of Orphy, a beautiful dwarf spitz — the real one behind the pixel guide of this site.

Founder, CTO, principal engineer

Several startups, as founder, CTO or principal engineer, from architecture design to product delivery.

AI-augmented engineering

Integrates LLMs and AI tools into exploration, design, implementation and problem solving; builds agents and automation.

More than five languages

Including TypeScript, JavaScript and Node.js, Python, PHP; React, Vue, Nest, Django, Flask, Laravel, Ionic; REST and GraphQL; PostgreSQL, MySQL.

Open source, jfbchat and more

Contributor to many open-source projects, among them the well-known jfbchat. agent-pack's code is open source too, under Apache-2.0.

Software engineer by training

Master's degree in Software Science and Technology (Science et Technologie du Logiciel), UPMC, Paris.

Programming since age ten

Programming since age ten; more than eight years of fullstack web development in startups: IT security, e-commerce, embedded AI.