Task runner for
AI agents

Drop markdown files in a folder, number them, and run. Each file is one task sent to an AI agent. When you need loops, retries, or conditional logic — add an .ash script. Start simple. Grow as needed.

How Ash Works

Ash runs a folder of markdown files through AI agents in numbered order — no scripting required. Each file is a task. Frontmatter sets the agent and model. Output flows between steps.

tasks/

$ ash tasks/  →  sequential AI task execution
tasks/
├── 01-research.md
├── 02-implement.md
├── 03-review.ash
└── 04-deploy.md

Markdown task (01-research.md)

---
agent: opencode
model: sonnet
---

# Research the login system

Trace all files in the login flow.
Document responsibilities, inputs,
and test coverage per file.

Ash task (03-review.ash)

#!opencode:1.0

RESULT = $(npm test 2>&1)
if $? != 0 {
  do "Tests failed. Fix errors
and recompile.

Test output:
${RESULT}" with opencode
}

Markdown and .ash files sort together by numeric prefix. Choose whichever fits each step.

Progressive Complexity

You never face more than you need. Start at level 1, add one concept at a time.

Level What you use What you get
1 Folder of .md files Sequential AI task execution
2 YAML frontmatter Per-task agent, model, on_fail
3 .ash files in the tree Logic within a single step
4 ${stdout}, $? State passing between tasks
5 Standalone .ash scripts Full orchestration: loops, retry, parallelism

When You Need Full Orchestration

When the workflow itself needs programming — iterate over files, retry on failure, branch on results — standalone .ash scripts give you the full pipeline.

Variables, Strings & Shell

MSG = "hello"
ITEMS = ["a", "b", "c"]
FIRST = ITEMS[0]
print "count: ${len(ITEMS)}"
working_dir = $(pwd)

Agent Calls

do "Review this code" with opencode

try {
  do "Fix the bug" with fixer
} fail {
  do "Retry: ${stderr}"
} upto 3

Control Flow

for FILE in FILES {
  do "Review ${FILE}"
  if $? != 0 { exit 1 }
}

exec npm test
if $? == 0 {
  print "all good"
}

Functions & Composition

fn review(path) {
  do "Review ${path}" with opencode
}

include "helpers.ash"
review("src/main.rs")

Deterministic Control, AI Execution

AI agents handle ambiguity — understanding intent, making judgments. They're bad at sequencing, branching, and retrying. Ash handles the structure. Agents handle the content.

Guaranteed Sequencing

Tasks run in numbered order every time. No "what should I do next?" — the script decides. The agent executes.

Bounded Autonomy

The agent decides how to do its step. Ash decides whether the step happens, how many times, and what comes next.

Repeatability

A weekly report, a recurring audit, a batch job — same process every time, even when the content of each step varies.

Execution Efficiency

Pre-determined control flow runs at CPU speed. AI time is spent only where it adds value — on the content of each step.

Workflows as Code

Review content, audit compliance, publish updates — all live in files you commit, version, share, and re-run. Not buried in chat threads.

Agent-Agnostic

OpenCode, Claude Code, Aider, or a custom tool. Define in a config file. Swap providers without touching your workflows.

Playground

Write and run Ash scripts in your browser, or use the REPL for interactive experimentation. The built-in js-echo agent echoes your prompt back.

Script
Output Status: ready
Click "Run" to execute the script.
loading WASM...