Skip to content
agent-pack
v0.27 — checked conditions and session variables

agent-pack

A programming language to orchestrate agents across every harness.

Write agents, rules, answer formats and teams in .ap files; agent-pack compiles them for Claude Code, Cursor, Junie and AGENTS.md.

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

From source to a bundled agent

agent-pack is not on npm yet: build it from source with Node 20 or newer.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

What agent-pack does

One language, every harness

Agents, rules, answer formats and teams are written once in .ap files and compiled into what each harness reads: Claude Code, Cursor, Junie and AGENTS.md.

The .apx file

Each agent compiles to one .apx: its definition and the engine that serves it, run by Node alone. The agent reads the blocks a task needs on demand, instead of the whole definition in its prompt.

Teams and flows

A team is a folder of members and a flows.ap file that routes requests and orders the steps between members, with parallel groups, conditions, loops and a context mode per step.

Typed templates

A TEMPLATE is a typed answer format with slots, a layout and an example. An agent shapes its answer, or reads an incoming request, through one.

Checked conditions

IF! and UNTIL! compile into a command the apx decides: it reads the session variables the condition depends on and asks a judge, answering open or closed, closed whenever in doubt.

No runtime, no server

The compiled files are all there is: the agents orchestrate themselves inside the harness, following the flows you wrote.

A first agent

agents/standalone/web-researcher.ap
EXPORT AGENT web-researcher AS web-researcher-role:
    ABOUT     Researches a question on the internet and answers with a cited source for every claim
    MANDATE   answer the user's question from independent web sources, citing each one
    MUST      cite a URL and a publication date for every finding
    NEVER     invent a source, a URL or a quote

ROLE web-researcher-role:
    ABOUT   a careful researcher who finds, checks and cites sources before drawing any conclusion
    ALWAYS  prefer the primary source over a report relaying it
    WHEN asked to research a question:
        DO     split the question into the claims the answer depends on
        UNTIL  every claim has been checked
          RUN  verify-claim

PROCEDURE verify-claim:
    ABOUT  back one claim with independent sources before it enters the brief
    DO     search for the claim and read the most authoritative result
    IF     the sources disagree
      DO   add the conflict, with both sources, to the open questions
    AS     finding

TEMPLATE finding:
  ABOUT  one claim of the answer, backed by its sources
  SLOTS:
    claim:    TEXT MAX_WORDS 30   "the claim, stated as fact or labelled as opinion"
    sources:  TEXT                "each source as <url> (<publication date>)"
  BODY:
    - {claim} — {sources}
  EXAMPLE:
    - Paris hosted the 2024 Olympics — https://olympics.com (2024-08-11)

What bundle all writes

FileWhat it is
.agent-pack/apx/<agent>.apxThe agent: its definition and the engine that serves it, one file, run by Node alone
.claude/agents/<agent>.md, .cursor/rules/<agent>.mdc, …What each harness loads — the whole definition, or (claude-code-apx) a pointer to the.apx
AGENTS.mdThe project context (from PROJECT.ap) and the orchestration: every team, its members and routing
CLAUDE.mdOne line, @AGENTS.md, for harnesses that read their own file
.agent-pack/compiled/<agent>.ap.jsonThe compiled document every output is projected from

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.

adapter

junie

Writes agents to .junie/AGENTS.md, playbooks to .junie/skills/<name>/SKILL.md.

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.