Examples
InitRunner ships with 60+ ready-to-run examples across four categories — single agents, teams, flow pipelines, and reusable skills. You can discover and clone them straight from the CLI, or browse the detailed walkthroughs below to understand how each one works.
Browse and Copy from the CLI
The fastest way to get started is the built-in examples workflow:
- List every example to see what's available:
initrunner examples list- Show an example before copying — preview its YAML with syntax highlighting:
initrunner examples show code-reviewer- Copy it into your current directory:
initrunner examples copy code-reviewer- Run it:
initrunner run code-reviewer.yaml -p "Review the last commit"Tip: The walkthroughs below explain every field in detail. If you already know what you need, skip ahead to the Full Example Catalog for a complete list of available examples.
Detailed Walkthroughs
The following examples are explained section by section so you can understand the patterns and adapt them to your own agents.
Code Reviewer
A read-only code review agent that uses git and filesystem tools to examine changes and produce structured reviews.
apiVersion: initrunner/v1
kind: Agent
metadata:
name: code-reviewer
description: An experienced code review agent
tags:
- engineering
- review
spec:
role: |
You are an experienced senior software engineer performing code reviews.
When reviewing code:
1. Start with git_list_files to understand the project structure
2. Use git_changed_files to identify what was modified
3. Use git_diff with specific file paths to examine changes
4. Use git_log to understand the commit history and context
5. Read relevant source files to understand the surrounding code
6. Use git_blame on suspicious lines to understand their history
Review guidelines:
- Focus on correctness, readability, and maintainability
- Identify potential bugs, security issues, and performance problems
- Suggest specific improvements with code examples
- Be constructive and explain the reasoning behind each suggestion
- Prioritize issues by severity: critical > major > minor > style
If a diff is truncated, narrow your search by passing a specific file
path to git_diff.
Format your review as a structured list of findings, each with:
- Severity level
- Location (file/line if applicable)
- Description of the issue
- Suggested fix
model:
provider: openai
name: gpt-4o-mini
temperature: 0.1
max_tokens: 4096
tools:
- type: git
repo_path: .
read_only: true
- type: filesystem
root_path: .
read_only: true
guardrails:
max_tokens_per_run: 50000
max_tool_calls: 30
timeout_seconds: 300
max_request_limit: 50initrunner run code-reviewer.yaml -p "Review the last commit"What to notice: Two read-only tools (
git+filesystem) give the agent everything it needs to navigate a codebase. The low temperature (0.1) keeps reviews consistent, and the structured role prompt produces predictable output formatting.
Data Analyst
A multi-tool agent that queries SQLite databases, runs Python analysis, and writes output files.
apiVersion: initrunner/v1
kind: Agent
metadata:
name: data-analyst
description: Queries a SQLite database and runs Python analysis
tags:
- example
- sql
- python
- analytics
spec:
role: |
You are a data analyst with access to a SQLite database and a Python
execution environment. Help the user explore data, answer questions, and
produce reports.
Workflow:
1. Start by exploring the schema: query sqlite_master for tables, then
use PRAGMA table_info(table_name) to understand columns.
2. Write SQL queries to answer the user's questions. Use aggregate
functions (COUNT, SUM, AVG, GROUP BY) for summaries.
3. For complex analysis (trends, percentages, rankings), use run_python
with pandas or the csv module.
4. Write reports and results to the ./output/ directory using write_file.
Guidelines:
- Always explore the schema before writing queries
- Use LIMIT when exploring large tables
- Explain your SQL logic to the user
- Format numbers with appropriate precision (2 decimal places for currency)
- When using Python, prefer the standard library (csv, statistics) if
pandas is not available
model:
provider: openai
name: gpt-4o-mini
temperature: 0.1
max_tokens: 4096
tools:
- type: sql
database: ./sample.db
read_only: true
max_rows: 100
- type: python
working_dir: .
require_confirmation: true
timeout_seconds: 30
- type: filesystem
root_path: .
read_only: false
allowed_extensions:
- .txt
- .md
- .csv
guardrails:
max_tokens_per_run: 50000
max_tool_calls: 30
timeout_seconds: 300
max_request_limit: 50initrunner run data-analyst.yaml -i -p "What were the top 5 products by revenue last quarter?"What to notice: Three tools working together —
sqlfor queries,pythonfor complex analysis, andfilesystemfor writing reports. Therequire_confirmation: trueon the Python tool adds a safety gate before executing code.
RAG Knowledge Base
A documentation assistant with document ingestion, paragraph chunking, and source citation.
apiVersion: initrunner/v1
kind: Agent
metadata:
name: rag-agent
description: Knowledge base Q&A agent with document ingestion
tags:
- example
- rag
- knowledge-base
spec:
role: |
You are a helpful documentation assistant for AcmeDB. You answer user
questions using the ingested knowledge base.
Rules:
- ALWAYS call search_documents before answering a question
- Base your answers only on information found in the documents
- Cite the source document for each claim (e.g., "Per the Getting Started
guide, ...")
- If search_documents returns no relevant results, say so honestly rather
than guessing
- When a user asks about a topic covered across multiple documents,
synthesize the information and cite all relevant sources
- Use read_file to view a full document when the search snippet is not
enough context
model:
provider: openai
name: gpt-4o-mini
temperature: 0.1
max_tokens: 4096
ingest:
sources:
- ./docs/**/*.md
chunking:
strategy: paragraph
chunk_size: 512
chunk_overlap: 50
embeddings:
provider: openai
model: text-embedding-3-small
api_key_env: OPENAI_API_KEY
tools:
- type: filesystem
root_path: ./docs
read_only: true
allowed_extensions:
- .md
guardrails:
max_tokens_per_run: 30000
max_tool_calls: 15
timeout_seconds: 120
max_request_limit: 30initrunner ingest rag-agent.yaml
initrunner run rag-agent.yaml -p "How do I create a database?"What to notice:
paragraphchunking preserves natural document structure (better for prose thanfixed). The role prompt enforces citation discipline — the agent must callsearch_documentsbefore answering and cite sources. Thefilesystemtool lets it read full documents when snippets aren't enough.
GitHub Project Tracker
A declarative API agent that manages GitHub issues without writing any code — endpoints are defined entirely in YAML.
apiVersion: initrunner/v1
kind: Agent
metadata:
name: github-tracker
description: Manages GitHub issues and repos via declarative API endpoints
tags:
- example
- api
- github
spec:
role: |
You are a GitHub project assistant. You help users track issues, manage
repositories, and stay on top of their projects using the GitHub REST API.
Capabilities:
- List and search issues (filter by state, labels, assignee)
- View issue details including comments and labels
- Create new issues with title, body, and labels
- Add comments to existing issues
- List repositories for any user or organization
Guidelines:
- When listing issues, default to state=open unless the user specifies otherwise
- When creating issues, ask for confirmation before submitting
- Format issue lists as numbered summaries with title, state, and labels
- Include issue URLs in your responses so users can click through
- Use get_current_time for timestamps in comments
model:
provider: openai
name: gpt-4o-mini
temperature: 0.1
max_tokens: 4096
tools:
- type: api
name: github
description: GitHub REST API v3
base_url: https://api.github.com
headers:
Accept: application/vnd.github.v3+json
User-Agent: initrunner-github-tracker
auth:
Authorization: "Bearer ${GITHUB_TOKEN}"
endpoints:
- name: list_issues
method: GET
path: "/repos/{owner}/{repo}/issues"
description: List issues in a repository
parameters:
- name: owner
type: string
required: true
- name: repo
type: string
required: true
- name: state
type: string
required: false
default: open
- name: labels
type: string
required: false
query_params:
state: "{state}"
labels: "{labels}"
per_page: "10"
response_extract: "$[*].{number,title,state,labels[*].name}"
timeout_seconds: 15
- name: get_issue
method: GET
path: "/repos/{owner}/{repo}/issues/{issue_number}"
description: Get details of a specific issue
parameters:
- name: owner
type: string
required: true
- name: repo
type: string
required: true
- name: issue_number
type: integer
required: true
timeout_seconds: 15
- name: create_issue
method: POST
path: "/repos/{owner}/{repo}/issues"
description: Create a new issue
parameters:
- name: owner
type: string
required: true
- name: repo
type: string
required: true
- name: title
type: string
required: true
- name: body
type: string
required: false
- name: labels
type: string
required: false
body_template:
title: "{title}"
body: "{body}"
labels: "{labels}"
timeout_seconds: 15
- name: add_comment
method: POST
path: "/repos/{owner}/{repo}/issues/{issue_number}/comments"
description: Add a comment to an issue
parameters:
- name: owner
type: string
required: true
- name: repo
type: string
required: true
- name: issue_number
type: integer
required: true
- name: body
type: string
required: true
body_template:
body: "{body}"
timeout_seconds: 15
- type: datetime
guardrails:
max_tokens_per_run: 50000
max_tool_calls: 20
timeout_seconds: 120
max_request_limit: 30export GITHUB_TOKEN=ghp_...
initrunner run github-tracker.yaml -i -p "List open bugs in myorg/myrepo"Or, to persist the token across sessions, add it to ~/.initrunner/.env:
GITHUB_TOKEN=ghp_...What to notice: The
apitool type defines REST endpoints declaratively — no Python code needed.response_extractuses JSONPath to trim verbose API responses down to the fields the agent needs. Environment variables (${GITHUB_TOKEN}) keep secrets out of YAML.
Uptime Monitor
A daemon agent that checks HTTP endpoints on a cron schedule and alerts Slack on failures.
apiVersion: initrunner/v1
kind: Agent
metadata:
name: uptime-monitor
description: Checks HTTP endpoints and alerts Slack on failures
tags:
- example
- http
- slack
- monitoring
spec:
role: |
You are an uptime monitor. When triggered, check all configured endpoints
and report their health status to Slack.
Endpoints to check:
- GET /health — main application health
- GET /api/status — API service status
- GET /readiness — Kubernetes readiness probe
For each endpoint:
1. Make the HTTP request using http_request
2. Record the status code and response time
3. Use get_current_time to timestamp the check
Reporting rules:
- If ALL endpoints return 2xx: send a single green summary to Slack
- If ANY endpoint fails (non-2xx or timeout): send a red alert to Slack
with the failing endpoint, status code, and error details
- Always include the timestamp in the Slack message
model:
provider: openai
name: gpt-4o-mini
temperature: 0.0
max_tokens: 2048
tools:
- type: http
base_url: https://api.example.com
allowed_methods:
- GET
headers:
Accept: application/json
- type: slack
webhook_url: "${SLACK_WEBHOOK_URL}"
default_channel: "#ops-alerts"
username: Uptime Monitor
icon_emoji: ":satellite:"
- type: datetime
sinks:
- type: file
path: ./logs/uptime-results.json
format: json
triggers:
- type: cron
schedule: "*/5 * * * *"
prompt: "Run the uptime check on all endpoints and report to Slack."
timezone: UTC
guardrails:
max_tokens_per_run: 10000
max_tool_calls: 10
timeout_seconds: 60
max_request_limit: 15
daemon_token_budget: 500000
daemon_daily_token_budget: 100000initrunner run uptime-monitor.yaml --daemonWhat to notice: The
crontrigger runs the agent every 5 minutes without human intervention.daemon_token_budgetanddaemon_daily_token_budgetcap spending for unattended agents. Thefilesink logs every result to JSON for later analysis.
Deployment Checker
An autonomous agent that creates a verification plan, executes checks, adapts on failure, and reports results — all without human intervention. See Autonomous Mode for details.
apiVersion: initrunner/v1
kind: Agent
metadata:
name: deployment-checker
description: Autonomous deployment verification agent
tags: [devops, autonomous, deployment]
spec:
role: |
You are a deployment verification agent. When given one or more URLs to check,
create a todo list with one item per URL, execute each check, and produce a
pass/fail report.
Workflow:
1. Use batch_add_todos to create a checklist — one item per URL to verify
2. Use get_next_todo to pick the next item
3. Run curl -sSL -o /dev/null -w "%{http_code} %{time_total}s" for each URL
4. Mark each item completed (2xx) or failed (anything else) via update_todo
5. If a check fails, add a retry item with add_todo
6. When done, send a Slack summary with pass/fail results per URL
7. Call finish_task with the overall status
model:
provider: openai
name: gpt-5-mini
temperature: 0.0
tools:
- type: think
- type: todo
max_items: 12
- type: shell
allowed_commands:
- curl
require_confirmation: false
timeout_seconds: 30
- type: slack
webhook_url: "${SLACK_WEBHOOK_URL}"
default_channel: "#deployments"
username: Deploy Checker
icon_emoji: ":white_check_mark:"
reasoning:
pattern: todo_driven
auto_plan: true
autonomy:
max_plan_steps: 12
max_history_messages: 20
iteration_delay_seconds: 1
max_scheduled_per_run: 1
guardrails:
max_iterations: 6
autonomous_token_budget: 30000
max_tokens_per_run: 10000
max_tool_calls: 15
session_token_budget: 100000initrunner run deployment-checker.yaml -a \
-p "Verify https://api.example.com/health and https://api.example.com/ready"What to notice: The
reasoningsection enables todo-driven planning — the agent creates a structured todo list and works through items by priority. Thethinktool gives the agent a reasoning scratchpad.finish_tasksignals completion, or the loop auto-completes when all todo items reach terminal status. See Reasoning Primitives for all strategies.
Multi-Agent Delegation
A coordinator that delegates research and writing to specialist sub-agents with shared memory.
coordinator.yaml
apiVersion: initrunner/v1
kind: Agent
metadata:
name: research-coordinator
description: Orchestrator that delegates research and writing tasks
tags:
- example
- multi-agent
- delegation
spec:
role: |
You are a research coordinator. Your job is to produce well-researched,
clearly written reports by delegating to specialist agents.
You have two delegates:
- researcher: Use this agent to gather information on a topic. It can
fetch web pages and extract key facts. Send it focused research
questions and it will return structured findings.
- writer: Use this agent to turn raw research notes into polished prose.
Send it the research findings along with instructions on tone, length,
and format.
Workflow:
1. Break the user's request into research questions
2. Delegate each question to the researcher agent
3. Collect and review the research findings
4. Delegate to the writer agent with the findings and formatting guidance
5. Review the final output and return it to the user
Always delegate — do not research or write long-form content yourself.
model:
provider: openai
name: gpt-4o-mini
temperature: 0.2
max_tokens: 4096
tools:
- type: delegate
mode: inline
max_depth: 2
timeout_seconds: 120
shared_memory:
store_path: ./.initrunner/shared-research.lance
max_memories: 500
agents:
- name: researcher
role_file: ./agents/researcher.yaml
description: Gathers information from the web on a given topic
- name: writer
role_file: ./agents/writer.yaml
description: Turns research notes into polished, structured writing
guardrails:
max_tokens_per_run: 100000
max_tool_calls: 30
timeout_seconds: 600
max_request_limit: 50agents/researcher.yaml
apiVersion: initrunner/v1
kind: Agent
metadata:
name: web-researcher
description: Research sub-agent that fetches web pages and extracts key facts
spec:
role: |
You are a focused research assistant. Your job is to find and extract
key facts on a given topic.
Guidelines:
- Use fetch_page to retrieve web content when given URLs or when you
need to look up specific information
- Extract only the most relevant facts — skip boilerplate and ads
- Return your findings as a structured bullet-point list
- Include the source URL for each fact
- If a page is irrelevant, say so and move on
- Do not editorialize or write prose — just report the facts
model:
provider: openai
name: gpt-4o-mini
temperature: 0.1
max_tokens: 2048
tools:
- type: web_reader
timeout_seconds: 15
guardrails:
max_tokens_per_run: 20000
max_tool_calls: 10
timeout_seconds: 120agents/writer.yaml
apiVersion: initrunner/v1
kind: Agent
metadata:
name: content-writer
description: Writing sub-agent that produces polished prose from research notes
spec:
role: |
You are a skilled technical writer. You receive research notes and
produce clear, well-structured content.
Guidelines:
- Organize information with headings, subheadings, and logical flow
- Write in a clear, professional tone unless told otherwise
- Cite sources inline where appropriate
- Keep paragraphs short and scannable
- Use bullet points for lists of items or steps
- End with a brief summary or conclusion when appropriate
- Do not invent facts — only use information provided in the research notes
model:
provider: openai
name: gpt-4o-mini
temperature: 0.7
max_tokens: 4096
guardrails:
max_tokens_per_run: 10000
max_tool_calls: 0
timeout_seconds: 60initrunner run coordinator.yaml -p "Write a report on WebAssembly adoption in 2025"What to notice: The coordinator never researches or writes directly — it delegates via
delegate_to_researcheranddelegate_to_writertools.shared_memorygives all agents access to the same memory database.max_depth: 2prevents infinite delegation chains. The writer hasmax_tool_calls: 0— it's a pure generation agent with no tools.
Code Review Team
A team of three personas that review code from different angles — architecture, security, and maintainability — all from a single YAML file. See Team Mode for full documentation.
apiVersion: initrunner/v1
kind: Team
metadata:
name: code-review-team
description: Multi-perspective code review
spec:
model:
provider: openai
name: gpt-5-mini
personas:
architect: "review for design patterns, SOLID principles, and architecture issues"
security: "find security vulnerabilities, injection risks, auth issues"
maintainer: "check readability, naming, test coverage gaps, docs"
tools:
- type: filesystem
root_path: .
read_only: true
- type: git
repo_path: .
read_only: true
guardrails:
max_tokens_per_run: 50000
max_tool_calls: 20
timeout_seconds: 300
team_token_budget: 150000initrunner run code-review-team.yaml --task "review the auth module"What to notice:
kind: Teamreplaceskind: Agent. Three personas run sequentially — the architect reviews first, then security builds on the architect's findings, then the maintainer synthesizes everything. All personas share the same read-only tools. Compare this with the Multi-Agent Delegation example above, which requires three separate YAML files.
PR Reviewer
A code review agent that diffs your current branch against main and produces a GitHub-flavored Markdown review ready to paste into a PR comment.
File: examples/roles/pr-reviewer.yaml
apiVersion: initrunner/v1
kind: Agent
metadata:
name: pr-reviewer
description: Reviews PR changes and produces GitHub-flavored Markdown ready to paste into a PR comment
tags:
- example
- shareable
- engineering
- review
author: initrunner
version: "1.0.0"
spec:
role: |
You are a senior engineer performing a pull-request review. Your output is
GitHub-flavored Markdown that the user will paste directly into a PR comment,
so formatting matters.
Workflow:
1. Use git_changed_files with ref="main...HEAD" to list what changed.
2. Use git_diff with ref="main...HEAD" per file (use the path argument to
narrow results if the full diff is truncated).
3. Use read_file on changed files when you need surrounding context.
4. Use git_log to read recent commit messages for intent.
5. Produce the formatted review below.
Output format (omit any severity section that has no findings):
## Review: [verdict emoji] [Approve | Request Changes | Needs Discussion]
**Summary**: One-sentence overall assessment.
### Findings
🔴 **Critical**
- **`path/to/file.py:42`** — Description of issue.
> Suggested fix or code snippet
🟡 **Major**
- ...
🔵 **Minor**
- ...
⚪ **Nit**
- ...
### What's Good
- Positive callout 1
- Positive callout 2
---
_Files reviewed: N | Findings: N critical, N major, N minor, N nit_
Verdict emojis: ✅ Approve, ⚠️ Request Changes, 💬 Needs Discussion.
Guidelines:
- Focus on correctness, security, readability, and maintainability.
- Reference exact file paths and line numbers when possible.
- Suggest concrete fixes — include code snippets in fenced blocks.
- Be constructive; explain the "why" behind each finding.
- Do NOT pad output with disclaimers or preamble — the Markdown IS the deliverable.
model:
provider: openai
name: gpt-5-mini
temperature: 0.1
max_tokens: 4096
tools:
- type: git
repo_path: .
read_only: true
- type: filesystem
root_path: .
read_only: true
guardrails:
max_tokens_per_run: 50000
max_tool_calls: 30
timeout_seconds: 300
max_request_limit: 50# Review current branch against main
initrunner run examples/roles/pr-reviewer.yaml -p "Review changes vs main"
# Review a specific range
initrunner run examples/roles/pr-reviewer.yaml -p "Review changes in main...feature-branch"
# Focus on specific concerns
initrunner run examples/roles/pr-reviewer.yaml -p "Review changes vs main, focusing on security"What to notice: Two read-only tools (
git+filesystem) keep the agent strictly non-destructive. The structured output format with severity tiers (🔴 Critical → ⚪ Nit) makes reviews easy to scan and act on. Low temperature (0.1) keeps the analysis consistent across runs.
| Tool | Mode | Purpose |
|---|---|---|
git | read-only | git_changed_files, git_diff, git_log to inspect the branch diff |
filesystem | read-only | read_file for surrounding code context |
| Setting | Value |
|---|---|
| Temperature | 0.1 |
| Max tool calls | 30 |
| Timeout | 300s |
Changelog for Slack
Generates a changelog from git history formatted in Slack mrkdwn — ready to paste directly into a Slack channel.
File: examples/roles/changelog-slack.yaml
apiVersion: initrunner/v1
kind: Agent
metadata:
name: changelog-slack
description: Generates a changelog formatted in Slack mrkdwn, ready to paste into a channel
tags:
- example
- shareable
- git
- developer-tools
author: initrunner
version: "1.0.0"
spec:
role: |
You are a release-notes writer. Your output is Slack mrkdwn that the user
will paste directly into a Slack channel, so formatting matters.
Workflow:
1. Determine the commit range from the user's prompt.
- If the prompt includes a tag or range (e.g. "since v1.2.0"), run:
shell_execute command="git log v1.2.0..HEAD --pretty=format:\"%h %an %s\""
(adjust the range to match the user's request).
- Otherwise, fall back to the built-in git_log with an appropriate max_count.
2. Use git_diff with the same ref range and look at the --stat style output
(ref="v1.2.0..HEAD" or similar) to collect file-change stats.
3. Use get_current_time for the date header.
4. Categorize each commit by its conventional-commit prefix:
- feat → *Features*
- fix → *Fixes*
- BREAKING → *Breaking Changes*
- docs → *Documentation*
- refactor → *Refactoring*
- perf → *Performance*
- chore, ci, build, test → *Maintenance*
If a commit has no prefix, categorize by reading the message content.
5. Format the output as Slack mrkdwn (see template below).
Output template (omit empty categories):
*Release Notes — YYYY-MM-DD*
_v1.2.0 → HEAD (N commits by N contributors)_
*Features*
• Brief description (`abc1234`)
*Fixes*
• Brief description (`111aaa`)
*Breaking Changes*
• ⚠️ Description (`222bbb`)
*Maintenance*
• Description (`333ccc`)
*Contributors*: @alice, @bob, @carol
*Stats*: N commits · N files changed · +NNN / −NNN lines
Slack formatting rules:
- *bold* for headings and emphasis
- _italic_ for subheadings
- • (bullet) for list items
- `backticks` for commit hashes and code
- No Markdown headings (#), no triple backticks — these don't render in Slack
Do NOT pad output with disclaimers or preamble — the mrkdwn IS the deliverable.
model:
provider: openai
name: gpt-5-mini
temperature: 0.1
max_tokens: 4096
tools:
- type: git
repo_path: .
read_only: true
- type: shell
allowed_commands:
- git
require_confirmation: false
timeout_seconds: 30
- type: datetime
guardrails:
max_tokens_per_run: 30000
max_tool_calls: 15
timeout_seconds: 120
max_request_limit: 20# Changelog since a tag
initrunner run examples/roles/changelog-slack.yaml -p "Changelog since v1.2.0"
# Last N commits
initrunner run examples/roles/changelog-slack.yaml -p "Changelog for the last 20 commits"
# Between two tags
initrunner run examples/roles/changelog-slack.yaml -p "What changed between v1.1.0 and v1.2.0?"What to notice: The
shelltool restricted toallowed_commands: [git]is intentional — the built-ingit_logtool accepts norefargument, so range-based changelogs like "since v1.2.0" requiregit log v1.2.0..HEADvia the shell. The output uses Slackmrkdwnsyntax (*bold*,_italic_,•bullets) rather than Markdown, so it renders correctly when pasted into Slack.
| Tool | Mode | Purpose |
|---|---|---|
git | read-only | git_diff with ref ranges for file-change stats |
shell | allowed_commands: [git] | git log <range> for range-based history |
datetime | — | get_current_time for the date header |
| Setting | Value |
|---|---|
| Temperature | 0.1 |
| Max tool calls | 15 |
| Timeout | 120s |
CI Failure Explainer
Reads a CI/CD log file, identifies the root failure (not cascading noise), and produces a GitHub-flavored Markdown explanation ready to paste into a PR comment or issue.
File: examples/roles/ci-explainer.yaml
apiVersion: initrunner/v1
kind: Agent
metadata:
name: ci-explainer
description: Reads a CI/CD log file and produces a GitHub-flavored Markdown failure explanation ready to paste into a PR comment or issue
tags:
- example
- shareable
- devops
- ci
author: initrunner
version: "1.0.0"
spec:
role: |
You are a CI/CD failure analyst. Your output is GitHub-flavored Markdown that
the user will paste directly into a PR comment or issue, so formatting matters.
Workflow:
1. Use read_file to read the log file referenced in the user's prompt.
2. Scan the log bottom-up — errors and failures cluster at the end.
3. Identify the decisive failure: the first root error, not cascading noise.
4. Optionally use read_file on implicated source files and git_log or
git_blame for context on when/why the failing code was introduced.
5. Classify the failure into one of these categories:
Build Error, Test Failure, Lint Error, Dependency Issue, Timeout,
Infrastructure, Permission Error.
6. Produce the formatted explanation below.
Output format:
## CI Failure: [Category]
**TL;DR**: One-sentence plain-English summary of what went wrong.
### What FailedExact error message or failing command, extracted from the logs
### Why It Failed
Plain-English root cause analysis. Reference specific lines and files.
### How to Fix
1. Step-by-step actionable instructions
2. Include exact commands or code changes
3. That someone can follow right now
---
_Stage: build/test/lint/deploy | File: `path/file.py:42` | Since: `abc1234`_
Guidelines:
- Extract the exact error — do not paraphrase log output in the "What Failed" block.
- Distinguish root cause from cascading failures.
- Provide concrete, copy-pasteable fix commands or code changes.
- Keep the explanation accessible to someone unfamiliar with the codebase.
- The footer line fields (Stage, File, Since) are optional — include only what
you can determine from the logs and git history.
- Do NOT pad output with disclaimers or preamble — the Markdown IS the deliverable.
model:
provider: openai
name: gpt-5-mini
temperature: 0.0
max_tokens: 4096
tools:
- type: filesystem
root_path: /
read_only: true
allowed_extensions:
- .log
- .txt
- .json
- .xml
- .yaml
- .yml
- .py
- .js
- .ts
- .go
- .rs
- .java
- .rb
- .sh
- type: git
repo_path: .
read_only: true
guardrails:
max_tokens_per_run: 40000
max_tool_calls: 20
timeout_seconds: 180
max_request_limit: 25# Explain a local log file
initrunner run examples/roles/ci-explainer.yaml -p "Explain the failure in /tmp/build.log"
# Point to a log in the repo
initrunner run examples/roles/ci-explainer.yaml -p "What went wrong in ./ci-output/test-results.log?"
# Multiple logs
initrunner run examples/roles/ci-explainer.yaml -p "Analyze the build failure in /tmp/build.log and /tmp/test.log"What to notice: The
filesystemtool usesroot_path: /so the agent can read logs written anywhere on disk (e.g./tmp). Anallowed_extensionsallowlist restricts it to log, config, and source file types — it cannot read arbitrary binary files.temperature: 0.0ensures precise, deterministic log analysis.
| Tool | Mode | Purpose |
|---|---|---|
filesystem | read-only, root / | read_file on log files anywhere on disk and source files in the repo |
git | read-only | git_log, git_blame for context on when failing code was introduced |
| Setting | Value |
|---|---|
| Temperature | 0.0 (precision for log analysis) |
| Max tool calls | 20 |
| Timeout | 180s |
Tips
Pipe output to clipboard for instant pasting:
# macOS
initrunner run examples/roles/changelog-slack.yaml -p "Last 10 commits" 2>/dev/null | pbcopy
# Linux (X11)
initrunner run examples/roles/changelog-slack.yaml -p "Last 10 commits" 2>/dev/null | xclip -selection clipboard
# Linux (Wayland)
initrunner run examples/roles/changelog-slack.yaml -p "Last 10 commits" 2>/dev/null | wl-copyThe 2>/dev/null strips stderr (progress messages) so only the agent's output reaches the clipboard.
Shell aliases for frequent use:
alias pr-review='initrunner run examples/roles/pr-reviewer.yaml -p'
alias changelog='initrunner run examples/roles/changelog-slack.yaml -p'
alias ci-explain='initrunner run examples/roles/ci-explainer.yaml -p'
# Then:
pr-review "Review changes vs main"
changelog "Changelog since v1.0.0"
ci-explain "Explain /tmp/build.log"Thinker
An agent that uses the think tool with accumulated reasoning chains and self-critique — useful for complex problem-solving where you want the agent to reason carefully before acting.
File: examples/roles/thinker.yaml
apiVersion: initrunner/v1
kind: Agent
metadata:
name: thinker
description: An agent that reasons step-by-step with self-critique
tags:
- example
- think
- reasoning
author: InitRunner Team
version: "2.0.0"
spec:
role: >
You are a careful, methodical assistant. Before answering any question
or taking any action, always use the think tool to reason step-by-step.
Break down complex problems, consider edge cases, and plan your approach
before responding. Use the datetime tool when time-related information
is needed.
model:
provider: openai
name: gpt-5-mini
temperature: 0.3
max_tokens: 2048
tools:
- type: think
critique: true
max_thoughts: 30
- type: datetime
default_timezone: UTC
guardrails:
max_tokens_per_run: 10000
max_tool_calls: 20
timeout_seconds: 60initrunner run thinker.yaml -p "What day of the week will January 1, 2030 fall on?"What to notice: The
thinktool now accumulates reasoning as a numbered chain — each call returns the full history, surviving context trimming. Withcritique: true, every 5th thought triggers a self-critique nudge.max_thoughts: 30caps the ring buffer to control token overhead. Combined with lowtemperature: 0.3, this produces deliberate, accurate responses.
Reasoning Planner
A structured planning agent that uses think + todo tools with the todo_driven reasoning strategy — creates a comprehensive plan before executing.
File: examples/roles/reasoning-planner/
apiVersion: initrunner/v1
kind: Agent
metadata:
name: reasoning-planner
description: Structured planner with think + todo tools
tags:
- example
- reasoning
- planning
- autonomous
author: InitRunner Team
version: "1.0.0"
spec:
role: |
You are a senior project planner. Break tasks into structured
todo lists, research each item, and synthesize findings.
Use the think tool to reason about each item before working on it.
model:
provider: openai
name: gpt-5-mini
tools:
- type: think
critique: true
- type: todo
max_items: 20
- type: search
provider: duckduckgo
reasoning:
pattern: todo_driven
auto_plan: true
autonomy:
max_plan_steps: 20
guardrails:
max_iterations: 15
autonomous_token_budget: 100000initrunner run reasoning-planner/ -a -p "Research the top 3 Python web frameworks and compare them"What to notice: The
reasoning.pattern: todo_drivenwithauto_plan: trueprepends planning instructions to the first turn, then guides the agent through its todo list on subsequent turns. Thethinktool withcritique: trueensures the agent reasons carefully about each item. Auto-completion triggers when all items reach terminal status.
Research Team
A multi-agent research coordinator that uses the spawn tool to parallelize research across specialist sub-agents, then synthesizes their findings.
File: examples/roles/research-team/
apiVersion: initrunner/v1
kind: Agent
metadata:
name: research-team
description: Multi-agent research coordinator with parallel sub-agents
tags:
- example
- reasoning
- spawn
- multi-agent
author: InitRunner Team
version: "1.0.0"
spec:
role: |
You are a research lead. Given a topic:
1. Break it into research questions (todo list)
2. Spawn researchers for parallelizable questions
3. Await their results
4. Synthesize findings into a structured report
model:
provider: openai
name: gpt-5-mini
tools:
- type: think
critique: true
- type: todo
max_items: 15
- type: spawn
max_concurrent: 3
agents:
- name: web-researcher
role_file: ./agents/web-researcher.yaml
description: Searches the web and summarizes findings
- type: filesystem
root_path: ./output
read_only: false
reasoning:
pattern: todo_driven
auto_plan: true
autonomy:
max_plan_steps: 15
guardrails:
max_iterations: 15
autonomous_token_budget: 100000initrunner run research-team/ -a -p "Compare the top 3 vector databases for production RAG systems"What to notice: The
spawntool lets the coordinator run multiple sub-agents in parallel —spawn_agentreturns immediately with a task_id,await_tasksblocks until results are ready. Combined withtodo_drivenplanning, the coordinator creates a todo list, spawns researchers for parallelizable items, and updates item statuses as results come in.
Self-Correcting Writer
A writing agent that uses the reflexion reasoning strategy to self-critique and improve its output after an initial draft.
File: examples/roles/self-correcting-writer/
apiVersion: initrunner/v1
kind: Agent
metadata:
name: self-correcting-writer
description: Writer with reflexion-based self-critique
tags:
- example
- reasoning
- reflexion
- writing
author: InitRunner Team
version: "1.0.0"
spec:
role: |
You are a technical writer. Given a topic, produce a well-structured
article with clear explanations and examples. After completing your
draft, critically evaluate it for accuracy, clarity, and completeness.
model:
provider: openai
name: gpt-5-mini
tools:
- type: think
critique: true
- type: todo
- type: filesystem
root_path: ./output
read_only: false
- type: search
provider: duckduckgo
reasoning:
pattern: todo_driven
auto_plan: true
reflection_rounds: 1
autonomy:
max_plan_steps: 10
guardrails:
max_iterations: 12
autonomous_token_budget: 80000initrunner run self-correcting-writer/ -a -p "Write a guide on WebAssembly for backend developers"What to notice:
reflection_rounds: 1enables one round of self-critique after the agent finishes its initial work. The agent completes its todo list, then the runner re-opens the state and injects the output back as a critique prompt. The agent gets one additional turn to self-correct — catching mistakes, improving clarity, and filling gaps. This composes naturally withtodo_drivenplanning.
Script Runner
A sysadmin agent with inline shell script tools — each script is defined directly in the YAML with its own parameter schema.
File: examples/roles/script-runner.yaml
apiVersion: initrunner/v1
kind: Agent
metadata:
name: script-runner
description: A sysadmin agent with inline script tools
tags:
- example
- script
- sysadmin
author: InitRunner Team
version: "1.0.0"
spec:
role: >
You are a system administrator assistant. Use the provided script tools
to inspect disk usage, count files, and gather system information.
Report results clearly and suggest actions when thresholds are exceeded.
model:
provider: openai
name: gpt-5-mini
temperature: 0.2
max_tokens: 2048
tools:
- type: script
timeout_seconds: 15
scripts:
- name: disk_usage
description: Check disk usage for a path
interpreter: /bin/bash
allowed_commands: [df]
body: |
df -h "$TARGET_PATH"
parameters:
- name: target_path
description: Filesystem path to check
required: true
- name: count_files
description: Count files in a directory (returns the count)
interpreter: /bin/bash
body: |
count=$(find "$DIR" -type f 2>/dev/null | wc -l)
echo "$count files found in $DIR"
parameters:
- name: dir
description: Directory path
required: true
- name: system_info
description: Show basic system information
interpreter: /bin/bash
body: |
echo "Hostname: $(hostname)"
echo "Kernel: $(uname -r)"
echo "Uptime: $(uptime -p 2>/dev/null || uptime)"
echo "Memory:"
free -h 2>/dev/null || echo "free not available"
guardrails:
max_tokens_per_run: 10000
max_tool_calls: 10
timeout_seconds: 60initrunner run script-runner.yaml -p "Check disk usage on / and report system info"What to notice: The
scripttool type lets you define multiple named scripts inline — each with its ownbody,interpreter,parameters, and optionalallowed_commandsallowlist. Parameters are injected as uppercase environment variables (e.g.target_pathbecomes$TARGET_PATH). No separate script files needed.
Long-Running Analyst
An autonomous research agent with conversation history compaction — keeps context manageable during long multi-source investigations. See History Compaction for details.
File: examples/roles/long-running-analyst.yaml
apiVersion: initrunner/v1
kind: Agent
metadata:
name: long-running-analyst
description: Autonomous research analyst with conversation history compaction
tags:
- example
- autonomous
- compaction
- research
spec:
role: |
You are a research analyst. Given a topic, methodically gather information from
multiple sources, synthesise findings, and produce a structured report.
Workflow:
1. Use batch_add_todos to outline your research steps — one item per source or angle
2. Use get_next_todo to pick the next item
3. Use http_request to fetch data from each source
4. Use get_current_time to timestamp your report
5. Summarise each source's key findings via update_todo notes
6. When all sources are processed, write the final report to ./reports/ using write_file
7. Call finish_task with a one-paragraph executive summary
Guidelines:
- Focus on facts and cite sources
- If a source is unreachable, mark the item failed and move on
- Keep intermediate notes brief — history compaction will summarise older context
- Final report format: title, date, executive summary, per-source sections, conclusion
model:
provider: openai
name: gpt-5-mini
temperature: 0.2
tools:
- type: http
base_url: https://api.example.com
allowed_methods:
- GET
headers:
Accept: application/json
- type: filesystem
root_path: ./reports
read_only: false
- type: datetime
- type: think
- type: todo
max_items: 15
reasoning:
pattern: todo_driven
auto_plan: true
autonomy:
max_history_messages: 30
max_plan_steps: 10
iteration_delay_seconds: 1
compaction:
enabled: true
threshold: 15
tail_messages: 4
model_override: "openai:gpt-4o-mini"
guardrails:
max_iterations: 20
autonomous_token_budget: 120000
max_tokens_per_run: 15000
max_tool_calls: 40
session_token_budget: 250000initrunner run long-running-analyst.yaml -a \
-p "Research the current state of WebAssembly adoption in production environments"What to notice: The
reasoningsection enables todo-driven planning alongsidecompaction— withthreshold: 15andtail_messages: 4, older messages are LLM-summarized once the conversation exceeds 15 messages, keeping the 4 most recent verbatim. Themodel_override: "openai:gpt-4o-mini"routes summarization to a cheaper model. The todo-driven strategy structures the research into trackable items, while compaction prevents context window exhaustion acrossmax_iterations: 20.
Ops Heartbeat
A periodic operations agent that processes a markdown checklist via the Heartbeat trigger. Active hours restrict runs to business hours.
File: examples/roles/ops-heartbeat.yaml
apiVersion: initrunner/v1
kind: Agent
metadata:
name: ops-heartbeat
description: Periodic ops agent that processes an open-tasks checklist via heartbeat trigger
tags:
- example
- heartbeat
- ops
- shell
- slack
spec:
role: |
You are an operations assistant. Each time you are triggered you receive an
updated task checklist. Work through every incomplete item using shell commands
and mark them done.
Workflow:
1. Read through all unchecked items (lines starting with "- [ ]")
2. For each item, run the appropriate shell command to perform the check
3. Report pass/fail per item to the #ops-alerts Slack channel
4. If a check fails, include the relevant error output in your Slack message
Rules:
- Never modify production resources — only read / inspect
- If a command times out, report it as "timed out" and move to the next item
- At the end, post a summary: items checked, passed, failed
model:
provider: openai
name: gpt-5-mini
temperature: 0.0
tools:
- type: shell
allowed_commands:
- curl
- ping
- dig
- df
- free
- uptime
- systemctl
require_confirmation: false
timeout_seconds: 30
- type: slack
webhook_url: "${SLACK_WEBHOOK_URL}"
default_channel: "#ops-alerts"
username: Ops Heartbeat
icon_emoji: ":heartbeat:"
- type: datetime
triggers:
- type: heartbeat
file: ./ops-checklist.md
interval_seconds: 3600
active_hours: [8, 18]
timezone: America/New_York
guardrails:
max_tokens_per_run: 20000
max_tool_calls: 25
timeout_seconds: 180
max_request_limit: 30The companion checklist file (ops-checklist.md):
# Ops Checklist
## Infrastructure
- [ ] Check disk usage on /data (alert if > 80%)
- [ ] Verify DNS resolution for api.example.com
- [ ] Ping gateway 10.0.0.1 (alert if packet loss > 0%)
- [ ] Confirm NTP sync — `systemctl status chronyd`
## Services
- [ ] Curl health endpoint https://api.example.com/health (expect 200)
- [ ] Curl metrics endpoint https://api.example.com/metrics (expect 200)
- [ ] Check available memory (alert if free < 512 MB)initrunner run ops-heartbeat.yaml --daemonWhat to notice: The
heartbeattrigger readsops-checklist.mdevery hour and only fires when unchecked items (- [ ]) remain.active_hours: [8, 18]restricts runs to business hours (Eastern time), so the agent stays quiet overnight. Theallowed_commandsallowlist on the shell tool limits the agent to read-only inspection commands.
Reloadable Assistant
A Slack-connected daemon with hot-reload — edit the YAML while the daemon is running and changes take effect automatically without a restart.
File: examples/roles/reloadable-assistant.yaml
apiVersion: initrunner/v1
kind: Agent
metadata:
name: reloadable-assistant
description: Slack daemon with hot-reload — edit YAML, see changes live
tags:
- example
- daemon
- hot-reload
- slack
- cron
spec:
role: |
You are a team assistant running as a long-lived daemon. You respond to Slack
messages and run periodic summaries on a cron schedule.
Responsibilities:
1. Answer questions from the team in Slack
2. Every four hours, summarise recent activity and post to #team-updates
3. Use shell commands to gather system metrics when asked
Tone: concise, friendly, and professional. Prefer bullet points over prose.
model:
provider: openai
name: gpt-5-mini
temperature: 0.3
max_tokens: 4096
tools:
- type: slack
webhook_url: "${SLACK_WEBHOOK_URL}"
default_channel: "#team-updates"
username: Team Assistant
icon_emoji: ":robot_face:"
- type: shell
allowed_commands:
- uptime
- df
- free
- date
require_confirmation: false
timeout_seconds: 15
- type: datetime
triggers:
- type: cron
schedule: "0 */4 * * *"
prompt: "Summarise recent activity and post a status update to Slack."
timezone: UTC
daemon:
hot_reload: true
reload_debounce_seconds: 2.0
guardrails:
max_tokens_per_run: 20000
max_tool_calls: 15
timeout_seconds: 120
max_request_limit: 20
daemon_token_budget: 500000
daemon_daily_token_budget: 200000initrunner run reloadable-assistant.yaml --daemonWhat to notice: The
daemon.hot_reload: truesetting (on by default) watches the YAML file for changes. Editspec.role, tweakguardrails, or adjust the cronschedule— the daemon picks up changes after a 2-second debounce. What does NOT hot-reload: model provider changes, adding/removing trigger types, and.envfiles (those require a restart). See Hot-Reload for details.
Support Desk (Auto-Routing)
A flow pipeline where strategy: sense on the intake's delegate sink auto-routes each support request to the right handler — no static fan-out.
# flow.yaml
apiVersion: initrunner/v1
kind: Flow
metadata:
name: support-desk
description: Support desk with auto-routing
spec:
agents:
intake:
role: roles/intake.yaml
sink:
type: delegate
strategy: sense
target:
- researcher
- responder
- escalator
researcher:
role: roles/researcher.yaml
needs: [intake]
responder:
role: roles/responder.yaml
needs: [intake]
restart: { condition: on-failure, max_retries: 3, delay_seconds: 5 }
escalator:
role: roles/escalator.yaml
needs: [intake]roles/intake.yaml — receives and summarizes support requests:
apiVersion: initrunner/v1
kind: Agent
metadata:
name: intake
description: Receives support requests and summarizes them for triage
tags:
- support
- intake
spec:
role: >
You are a support intake agent. When you receive a support request,
produce a concise summary including: the customer's issue, urgency
level, and the type of action needed (research, direct response,
or human escalation). Be factual and brief.
model:
provider: openai
name: gpt-5-mini
temperature: 0.1
guardrails:
max_tokens_per_run: 1000
timeout_seconds: 30roles/researcher.yaml — investigates technical issues:
apiVersion: initrunner/v1
kind: Agent
metadata:
name: researcher
description: Investigates technical issues and gathers diagnostic information
tags:
- research
- analysis
- investigation
- technical
- diagnose
spec:
role: >
You are a technical research agent for a support desk. When you
receive a triaged support request that requires investigation,
research the issue thoroughly. Produce a structured report with:
root cause analysis, relevant documentation references, and
recommended resolution steps.
model:
provider: openai
name: gpt-5-mini
temperature: 0.3
guardrails:
max_tokens_per_run: 4000
timeout_seconds: 60initrunner flow up flow.yamlWhat to notice: The
strategy: senseline is the only difference from a static fan-out pipeline. Each message from intake is scored against the three targets' role metadata — because their tags don't overlap (researcher uses[research, analysis, investigation, technical, diagnose], responder and escalator cover different domains), keyword scoring resolves most messages without an LLM call. See Flow — Routing Strategy for details.
Full Example Catalog
Every example below can be previewed with initrunner examples show <name> and copied with initrunner examples copy <name>. Source files are also available in the GitHub examples directory.
Role Examples
Single-agent configurations — one YAML file, one purpose.
| Name | Description |
|---|---|
api-monitor | Monitor API endpoints on a heartbeat with degradation trend detection and Slack alerts |
audio-assistant | Fetch YouTube transcripts and transcribe local audio files |
changelog-generator | Generate a CHANGELOG.md from git commit history |
changelog-slack | Generate a changelog formatted in Slack mrkdwn |
ci-explainer | Read CI/CD logs and produce a Markdown failure explanation |
code-reviewer | Read-only code review with git + filesystem tools |
deploy-notifier | Check deployment health and post Slack reports |
deployment-checker | Autonomous deployment verification with todo-driven reasoning |
discord-assistant | Discord bot that responds to DMs and @mentions |
docker-sandbox | Code execution agent with Docker container isolation |
docker-sandbox-hardened | Code execution agent with a hardened Docker runtime (gVisor by default). Since v2026.5.2. |
email-agent | Autonomous inbox monitoring, triage, context-aware reply drafting, and urgent alerts |
email-assistant | Search, read, and summarize emails via IMAP |
full-tools-assistant | All 10 zero-config tools enabled (filesystem, git, shell, python, web_reader, datetime, calculator, json, csv, regex) |
github-tracker | Manage GitHub issues via declarative API endpoints |
hello-world | Minimal greeter agent |
integration-tester | Run integration test suites and diagnose failures via service health and env checks |
invoice-classifier | Classify invoices and extract structured data |
long-running-analyst | Autonomous research with history compaction and todo-driven reasoning |
memory-assistant | Personal assistant that learns across sessions |
ops-heartbeat | Periodic ops checks via heartbeat trigger and checklist |
pr-reviewer | Review PR changes and produce GitHub-flavored Markdown |
reloadable-assistant | Slack daemon with hot-reload — edit YAML, see changes live |
reasoning-planner | Structured planning with think + todo tools and todo-driven strategy |
research-team | Multi-agent research coordination with spawn tool |
rich-memory-assistant | Assistant with episodic, semantic, and procedural memory plus consolidation |
sandboxed-dev-assistant | Developer assistant with fine-grained tool permissions and secret blocking |
script-runner | Sysadmin agent with inline shell script tools |
self-correcting-writer | Self-correcting output via reflexion strategy |
secure-api-gateway | Hardened agent for external requests with full security policy |
security-scanner | Static analysis scanning with LLM-powered triage of findings |
skill-demo | Demonstration of skill-based composition |
auto-skill-demo | Demonstrates auto-discovered skills with progressive disclosure |
slack-digest | Curate daily news digests and post to Slack, learning what matters to your team |
slack-echo | Echo messages to Slack |
telegram-assistant | Telegram bot that responds to messages via long-polling |
thinker | Step-by-step reasoning with accumulated thought chains and self-critique |
traced-agent | Simple agent with OpenTelemetry console tracing |
unit-tester | Detect test framework, generate tests, run suite, and iterate until passing |
uptime-monitor | Cron-scheduled HTTP checks with Slack alerts |
web-monitor | Periodically scrape web pages and store content for search |
web-reader | Fetch and summarize web pages |
web-searcher | Research assistant with web and news search |
webhook-processor | Receive webhooks and route notifications to Slack |
Team Examples
Multi-persona teams defined with kind: Team. See Team Mode.
| Name | Description |
|---|---|
code-review-team | Three personas (architect, security, maintainer) review code sequentially |
test-review | Three personas (coverage analyst, edge case finder, quality reviewer) review test quality sequentially |
Flow Examples
Multi-agent pipelines defined with kind: Flow.
| Name | Description |
|---|---|
ci-pipeline | CI event processing with webhook receiver, build analyzer, and notifier |
content-pipeline | Watcher → researcher → writer → reviewer |
support-desk | Intake with strategy: sense auto-routes to researcher, responder, or escalator |
test-pipeline | File watcher detects changes, analyzes git diff, and delegates to unit and integration test runners |
Skills
Reusable tool bundles you can import into any agent with skills:, or auto-discover by placing them in a well-known directory.
| Name | Description |
|---|---|
web-research | Web search, page fetching, and summarization |
code-tools | Filesystem and Python tools for reading code and running snippets |
summarizer | Summarize long documents, articles, and threads into concise bullet points |
Run
initrunner examples listfor the latest catalog — new examples are added with every release.