InitRunner

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:

  1. List every example to see what's available:
initrunner examples list
  1. Show an example before copying — preview its YAML with syntax highlighting:
initrunner examples show code-reviewer
  1. Copy it into your current directory:
initrunner examples copy code-reviewer
  1. 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.

name: code-reviewer
description: An experienced code review agent
tags:
- engineering
- review
model:
  provider: openai
  name: gpt-4o-mini
  temperature: 0.1
  max_tokens: 4096
prompt: |
  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
tools:
- git:
    repo_path: .
    read_only: true
- filesystem:
    root_path: .
    read_only: true
guardrails:
  max_tokens_per_run: 50000
  max_tool_calls: 30
  timeout_seconds: 300
  max_request_limit: 50
initrunner 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.

name: data-analyst
description: Queries a SQLite database and runs Python analysis
tags:
- example
- sql
- python
- analytics
model:
  provider: openai
  name: gpt-4o-mini
  temperature: 0.1
  max_tokens: 4096
prompt: |
  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
tools:
- sql:
    database: ./sample.db
    read_only: true
    max_rows: 100
- python:
    working_dir: .
    require_confirmation: true
    timeout_seconds: 30
- 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: 50
initrunner run data-analyst.yaml -i -p "What were the top 5 products by revenue last quarter?"

What to notice: Three tools working together — sql for queries, python for complex analysis, and filesystem for writing reports. The require_confirmation: true on the Python tool adds a safety gate before executing code.

RAG Knowledge Base

A documentation assistant with document ingestion, paragraph chunking, and source citation.

name: rag-agent
description: Knowledge base Q&A agent with document ingestion
tags:
- example
- rag
- knowledge-base
model:
  provider: openai
  name: gpt-4o-mini
  temperature: 0.1
  max_tokens: 4096
prompt: |
  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
tools:
- filesystem:
    root_path: ./docs
    read_only: true
    allowed_extensions:
    - .md
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
guardrails:
  max_tokens_per_run: 30000
  max_tool_calls: 15
  timeout_seconds: 120
  max_request_limit: 30
initrunner ingest rag-agent.yaml
initrunner run rag-agent.yaml -p "How do I create a database?"

What to notice: paragraph chunking preserves natural document structure (better for prose than fixed). The role prompt enforces citation discipline — the agent must call search_documents before answering and cite sources. The filesystem tool 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.

name: github-tracker
description: Manages GitHub issues and repos via declarative API endpoints
tags:
- example
- api
- github
model:
  provider: openai
  name: gpt-4o-mini
  temperature: 0.1
  max_tokens: 4096
prompt: |
  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
tools:
- 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
- datetime
guardrails:
  max_tokens_per_run: 50000
  max_tool_calls: 20
  timeout_seconds: 120
  max_request_limit: 30
export 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 api tool type defines REST endpoints declaratively — no Python code needed. response_extract uses 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.

name: uptime-monitor
description: Checks HTTP endpoints and alerts Slack on failures
tags:
- example
- http
- slack
- monitoring
model:
  provider: openai
  name: gpt-4o-mini
  temperature: 0.0
  max_tokens: 2048
prompt: |
  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
tools:
- http:
    base_url: https://api.example.com
    allowed_methods:
    - GET
    headers:
      Accept: application/json
- slack:
    webhook_url: ${SLACK_WEBHOOK_URL}
    default_channel: '#ops-alerts'
    username: Uptime Monitor
    icon_emoji: ':satellite:'
- 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: 100000
initrunner run uptime-monitor.yaml --daemon

What to notice: The cron trigger runs the agent every 5 minutes without human intervention. daemon_token_budget and daemon_daily_token_budget cap spending for unattended agents. The file sink 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.

name: deployment-checker
description: Autonomous deployment verification agent
tags:
- devops
- autonomous
- deployment
model:
  provider: openai
  name: gpt-5-mini
  temperature: 0.0
prompt: |
  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
tools:
- think
- todo:
    max_items: 12
- shell:
    allowed_commands:
    - curl
    require_confirmation: false
    timeout_seconds: 30
- 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: 100000
initrunner run deployment-checker.yaml -a \
  -p "Verify https://api.example.com/health and https://api.example.com/ready"

What to notice: The reasoning section enables todo-driven planning — the agent creates a structured todo list and works through items by priority. The think tool gives the agent a reasoning scratchpad. finish_task signals 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

name: research-coordinator
description: Orchestrator that delegates research and writing tasks
tags:
- example
- multi-agent
- delegation
model:
  provider: openai
  name: gpt-4o-mini
  temperature: 0.2
  max_tokens: 4096
prompt: |
  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.
tools:
- 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: 50

agents/researcher.yaml

name: web-researcher
description: Research sub-agent that fetches web pages and extracts key facts
model:
  provider: openai
  name: gpt-4o-mini
  temperature: 0.1
  max_tokens: 2048
prompt: |
  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
tools:
- web_reader:
    timeout_seconds: 15
guardrails:
  max_tokens_per_run: 20000
  max_tool_calls: 10
  timeout_seconds: 120

agents/writer.yaml

name: content-writer
description: Writing sub-agent that produces polished prose from research notes
model:
  provider: openai
  name: gpt-4o-mini
  temperature: 0.7
  max_tokens: 4096
prompt: |
  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
guardrails:
  max_tokens_per_run: 10000
  max_tool_calls: 0
  timeout_seconds: 60
initrunner 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_researcher and delegate_to_writer tools. shared_memory gives all agents access to the same memory database. max_depth: 2 prevents infinite delegation chains. The writer has max_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.

name: code-review-team
description: Multi-perspective code review
model:
  provider: openai
  name: gpt-5-mini
tools:
- filesystem:
    root_path: .
    read_only: true
- git:
    repo_path: .
    read_only: true
agents:
  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
run: sequential
guardrails:
  max_tokens_per_run: 50000
  max_tool_calls: 20
  timeout_seconds: 300
  team_token_budget: 150000
initrunner run code-review-team.yaml -p "review the auth module"

What to notice: A team file uses agents and run instead of a single prompt. Three agents run sequentially — the architect reviews first, then security builds on the architect's findings, then the maintainer synthesizes everything. All agents 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

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
model:
  provider: openai
  name: gpt-5-mini
  temperature: 0.1
  max_tokens: 4096
prompt: |
  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.
tools:
- git:
    repo_path: .
    read_only: true
- 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.

ToolModePurpose
gitread-onlygit_changed_files, git_diff, git_log to inspect the branch diff
filesystemread-onlyread_file for surrounding code context
SettingValue
Temperature0.1
Max tool calls30
Timeout300s

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

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
model:
  provider: openai
  name: gpt-5-mini
  temperature: 0.1
  max_tokens: 4096
prompt: |
  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:
       run_shell 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.
tools:
- git:
    repo_path: .
    read_only: true
- shell:
    allowed_commands:
    - git
    require_confirmation: false
    timeout_seconds: 30
- 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 shell tool restricted to allowed_commands: [git] is intentional — the built-in git_log tool accepts no ref argument, so range-based changelogs like "since v1.2.0" require git log v1.2.0..HEAD via the shell. The output uses Slack mrkdwn syntax (*bold*, _italic_, bullets) rather than Markdown, so it renders correctly when pasted into Slack.

ToolModePurpose
gitread-onlygit_diff with ref ranges for file-change stats
shellallowed_commands: [git]git log <range> for range-based history
datetimecurrent_time for the date header
SettingValue
Temperature0.1
Max tool calls15
Timeout120s

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

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
model:
  provider: openai
  name: gpt-5-mini
  temperature: 0.0
  max_tokens: 4096
prompt: |
  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 Failed

Exact 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.
tools:
- filesystem:
  root_path: /
  read_only: true
  allowed_extensions:
  - .log
  - .txt
  - .json
  - .xml
  - .yaml
  - .yml
  - .py
  - .js
  - .ts
  - .go
  - .rs
  - .java
  - .rb
  - .sh
- 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 filesystem tool uses root_path: / so the agent can read logs written anywhere on disk (e.g. /tmp). An allowed_extensions allowlist restricts it to log, config, and source file types — it cannot read arbitrary binary files. temperature: 0.0 ensures precise, deterministic log analysis.

ToolModePurpose
filesystemread-only, root /read_file on log files anywhere on disk and source files in the repo
gitread-onlygit_log, git_blame for context on when failing code was introduced
SettingValue
Temperature0.0 (precision for log analysis)
Max tool calls20
Timeout180s

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-copy

The 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

name: thinker
description: An agent that reasons step-by-step with self-critique
tags:
- example
- think
- reasoning
author: InitRunner Team
version: 2.0.0
model:
  provider: openai
  name: gpt-5-mini
  temperature: 0.3
  max_tokens: 2048
prompt: |
  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.
tools:
- think:
    critique: true
    max_thoughts: 30
- datetime:
    default_timezone: UTC
guardrails:
  max_tokens_per_run: 10000
  max_tool_calls: 20
  timeout_seconds: 60
initrunner run thinker.yaml -p "What day of the week will January 1, 2030 fall on?"

What to notice: The think tool now accumulates reasoning as a numbered chain — each call returns the full history, surviving context trimming. With critique: true, every 5th thought triggers a self-critique nudge. max_thoughts: 30 caps the ring buffer to control token overhead. Combined with low temperature: 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/

name: reasoning-planner
description: Structured planner with think + todo tools
tags:
- example
- reasoning
- planning
- autonomous
author: InitRunner Team
version: 1.0.0
model:
  provider: openai
  name: gpt-5-mini
prompt: |
  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.
tools:
- think:
    critique: true
- todo:
    max_items: 20
- search:
    provider: duckduckgo
reasoning:
  pattern: todo_driven
  auto_plan: true
autonomy:
  max_plan_steps: 20
guardrails:
  max_iterations: 15
  autonomous_token_budget: 100000
initrunner run reasoning-planner/ -a -p "Research the top 3 Python web frameworks and compare them"

What to notice: The reasoning.pattern: todo_driven with auto_plan: true prepends planning instructions to the first turn, then guides the agent through its todo list on subsequent turns. The think tool with critique: true ensures 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/

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
model:
  provider: openai
  name: gpt-5-mini
prompt: |
  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
tools:
- think:
    critique: true
- todo:
    max_items: 15
- spawn:
    max_concurrent: 3
    agents:
    - name: web-researcher
      role_file: ./agents/web-researcher.yaml
      description: Searches the web and summarizes findings
- 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: 100000
initrunner run research-team/ -a -p "Compare the top 3 vector databases for production RAG systems"

What to notice: The spawn tool lets the coordinator run multiple sub-agents in parallel — spawn_agent returns immediately with a task_id, await_tasks blocks until results are ready. Combined with todo_driven planning, 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/

name: self-correcting-writer
description: Writer with reflexion-based self-critique
tags:
- example
- reasoning
- reflexion
- writing
author: InitRunner Team
version: 1.0.0
model:
  provider: openai
  name: gpt-5-mini
prompt: |
  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.
tools:
- think:
    critique: true
- todo
- filesystem:
    root_path: ./output
    read_only: false
- 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: 80000
initrunner run self-correcting-writer/ -a -p "Write a guide on WebAssembly for backend developers"

What to notice: reflection_rounds: 1 enables 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 with todo_driven planning.

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

name: script-runner
description: A sysadmin agent with inline script tools
tags:
- example
- script
- sysadmin
author: InitRunner Team
version: 1.0.0
model:
  provider: openai
  name: gpt-5-mini
  temperature: 0.2
  max_tokens: 2048
prompt: |
  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.
tools:
- 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: 60
initrunner run script-runner.yaml -p "Check disk usage on / and report system info"

What to notice: The script tool type lets you define multiple named scripts inline — each with its own body, interpreter, parameters, and optional allowed_commands allowlist. Parameters are injected as uppercase environment variables (e.g. target_path becomes $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

name: long-running-analyst
description: Autonomous research analyst with conversation history compaction
tags:
- example
- autonomous
- compaction
- research
model:
  provider: openai
  name: gpt-5-mini
  temperature: 0.2
prompt: |
  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
tools:
- http:
    base_url: https://api.example.com
    allowed_methods:
    - GET
    headers:
      Accept: application/json
- filesystem:
    root_path: ./reports
    read_only: false
- datetime
- think
- 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: 250000
initrunner run long-running-analyst.yaml -a \
  -p "Research the current state of WebAssembly adoption in production environments"

What to notice: The reasoning section enables todo-driven planning alongside compaction — with threshold: 15 and tail_messages: 4, older messages are LLM-summarized once the conversation exceeds 15 messages, keeping the 4 most recent verbatim. The model_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 across max_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

name: ops-heartbeat
description: Periodic ops agent that processes an open-tasks checklist via heartbeat trigger
tags:
- example
- heartbeat
- ops
- shell
- slack
model:
  provider: openai
  name: gpt-5-mini
  temperature: 0.0
prompt: |
  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
tools:
- shell:
    allowed_commands:
    - curl
    - ping
    - dig
    - df
    - free
    - uptime
    - systemctl
    require_confirmation: false
    timeout_seconds: 30
- slack:
    webhook_url: ${SLACK_WEBHOOK_URL}
    default_channel: '#ops-alerts'
    username: Ops Heartbeat
    icon_emoji: ':heartbeat:'
- 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: 30

The 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 --daemon

What to notice: The heartbeat trigger reads ops-checklist.md every 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. The allowed_commands allowlist 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

name: reloadable-assistant
description: Slack daemon with hot-reload — edit YAML, see changes live
tags:
- example
- daemon
- hot-reload
- slack
- cron
model:
  provider: openai
  name: gpt-5-mini
  temperature: 0.3
  max_tokens: 4096
prompt: |
  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.
tools:
- slack:
    webhook_url: ${SLACK_WEBHOOK_URL}
    default_channel: '#team-updates'
    username: Team Assistant
    icon_emoji: ':robot_face:'
- shell:
    allowed_commands:
    - uptime
    - df
    - free
    - date
    require_confirmation: false
    timeout_seconds: 15
- 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: 200000
initrunner run reloadable-assistant.yaml --daemon

What to notice: The daemon.hot_reload: true setting (on by default) watches the YAML file for changes. Edit prompt, tweak guardrails, or adjust the cron schedule — the daemon picks up changes after a 2-second debounce. What does NOT hot-reload: model provider changes, adding/removing trigger types, and .env files (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.

name: support-desk
description: Support desk with auto-routing
agents:
  intake:
    use: roles/intake.yaml
    then:
      to:
      - researcher
      - responder
      - escalator
      strategy: sense
  researcher:
    use: roles/researcher.yaml
    after:
    - intake
  responder:
    use: roles/responder.yaml
    after:
    - intake
  escalator:
    use: roles/escalator.yaml
    after:
    - intake

roles/intake.yaml — receives and summarizes support requests:

name: intake
description: Receives support requests and summarizes them for triage
tags:
- support
- intake
model:
  provider: openai
  name: gpt-5-mini
  temperature: 0.1
prompt: |
  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.
guardrails:
  max_tokens_per_run: 1000
  timeout_seconds: 30

roles/researcher.yaml — investigates technical issues:

name: researcher
description: Investigates technical issues and gathers diagnostic information
tags:
- research
- analysis
- investigation
- technical
- diagnose
model:
  provider: openai
  name: gpt-5-mini
  temperature: 0.3
prompt: |
  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.
guardrails:
  max_tokens_per_run: 4000
  timeout_seconds: 60
initrunner flow up flow.yaml

What to notice: The strategy: sense line 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.

NameDescription
api-monitorMonitor API endpoints on a heartbeat with degradation trend detection and Slack alerts
audio-assistantFetch YouTube transcripts and transcribe local audio files
changelog-generatorGenerate a CHANGELOG.md from git commit history
changelog-slackGenerate a changelog formatted in Slack mrkdwn
ci-explainerRead CI/CD logs and produce a Markdown failure explanation
code-reviewerRead-only code review with git + filesystem tools
deploy-notifierCheck deployment health and post Slack reports
deployment-checkerAutonomous deployment verification with todo-driven reasoning
discord-assistantDiscord bot that responds to DMs and @mentions
docker-sandboxCode execution agent with Docker container isolation
docker-sandbox-hardenedCode execution agent with a hardened Docker runtime (gVisor by default). Since v2026.5.2.
postmanAutonomous inbox monitoring, triage, context-aware reply drafting, and urgent alerts
email-assistantSearch, read, and summarize emails via IMAP
full-tools-assistantAll 10 zero-config tools enabled (datetime, search, web_reader, web_scraper, filesystem, git, python, shell, csv_analysis, audio)
github-trackerManage GitHub issues via declarative API endpoints
hello-worldMinimal greeter agent
integration-testerRun integration test suites and diagnose failures via service health and env checks
invoice-classifierClassify invoices and extract structured data
long-running-analystAutonomous research with history compaction and todo-driven reasoning
memory-assistantPersonal assistant that learns across sessions
ops-heartbeatPeriodic ops checks via heartbeat trigger and checklist
pr-reviewerReview PR changes and produce GitHub-flavored Markdown
reloadable-assistantSlack daemon with hot-reload — edit YAML, see changes live
reasoning-plannerStructured planning with think + todo tools and todo-driven strategy
research-teamMulti-agent research coordination with spawn tool
rich-memory-assistantAssistant with episodic, semantic, and procedural memory plus consolidation
sandboxed-dev-assistantDeveloper assistant with fine-grained tool permissions and secret blocking
script-runnerSysadmin agent with inline shell script tools
self-correcting-writerSelf-correcting output via reflexion strategy
secure-api-gatewayHardened agent for external requests with full security policy
security-scannerStatic analysis scanning with LLM-powered triage of findings
skill-demoDemonstration of skill-based composition
auto-skill-demoDemonstrates auto-discovered skills with progressive disclosure
slack-digestCurate daily news digests and post to Slack, learning what matters to your team
slack-echoEcho messages to Slack
telegram-assistantTelegram bot that responds to messages via long-polling
thinkerStep-by-step reasoning with accumulated thought chains and self-critique
traced-agentSimple agent with OpenTelemetry console tracing
unit-testerDetect test framework, generate tests, run suite, and iterate until passing
uptime-monitorCron-scheduled HTTP checks with Slack alerts
web-monitorPeriodically scrape web pages and store content for search
web-readerFetch and summarize web pages
web-searcherResearch assistant with web and news search
webhook-processorReceive webhooks and route notifications to Slack

Group Examples

Several independent agents deployed as one unit. See Grouped Agents.

NameFileDescription
deskexamples/groups/desk.yamlThree support desk agents (intake, researcher, writer) that ship together and never hand off to each other

Team Examples

Multi-agent teams defined in one file with agents and run. See Team Mode. These two are not in the initrunner examples catalog; copy them from the GitHub examples directory.

NameFileDescription
code-review-teamexamples/teams/code-review.yamlThree agents (architect, security, maintainer) review code sequentially
test-review-teamexamples/teams/test-review.yamlThree agents (coverage analyst, edge case finder, quality reviewer) review test quality sequentially

Flow Examples

Multi-agent pipelines defined in a flow.yaml.

NameDescription
ci-pipelineCI event processing with webhook receiver, build analyzer, and notifier
content-pipelineWatcher → researcher → writer → reviewer
support-deskIntake with strategy: sense auto-routes to researcher, responder, or escalator
test-pipelineFile 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.

NameDescription
web-researcherWeb search, page fetching, and summarization
code-toolsFilesystem and Python tools for reading code and running snippets

Run initrunner examples list for the latest catalog — new examples are added with every release.

On this page