Agent Harness logo

Agent Harness

OrganizationPopular
lightdash
agent-harness

Guide for AI agents running in the isolated agent-harness environment. Use when you need to discover your agent ID, find your ports, manage your stack with agent-cli.sh, run verification, or understand the multi-agent development setup.

Overview

Publisherlightdash
Repositorylightdash
Skill nameagent-harness
Stars
6.2K
Forks
790
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by lightdash on GitHub. Read the source before you install it.

Installation

Install the Agent Harness AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/lightdash/lightdash/tree/main/.claude/skills/agent-harness
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lightdash/lightdash.git /tmp/lightdash
mkdir -p .claude/skills
cp -r /tmp/lightdash/.claude/skills/agent-harness .claude/skills/agent-harness
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Agent Harness in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Agent Harness on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Agent Harness is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Agent Harness Quick Start

You are running in an isolated Lightdash development environment managed by the agent-harness. This guide helps you discover your environment and get productive immediately.

Step 1: Discover Your Agent ID

Your agent ID determines all your ports and resources. Find it by checking for the generated environment file:

bash
ls -la .env.agent.* 2>/dev/null | head -1

This will show something like .env.agent.1 — the number is your agent ID.

Alternative: Check which PM2 processes are running:

bash
pnpm exec pm2 jlist 2>/dev/null | node -e "
  const data = JSON.parse(require('fs').readFileSync(0, 'utf8'));
  const agents = [...new Set(data.map(p => p.name.match(/^agent-(\d+)-/)?.[1]).filter(Boolean))];
  if (agents.length === 1) console.log('AGENT_ID=' + agents[0]);
  else if (agents.length > 1) console.log('Multiple agents running: ' + agents.join(', '));
  else console.log('No agent processes found');
"

Step 2: Know Your Ports

Once you have your agent ID, your ports are deterministic:

ServiceFormulaAgent 1Agent 2Agent 3
Frontend (Vite)3000 + (ID × 10)301030203030
Backend API8000 + (ID × 10)801080208030
Node Debugger9200 + (ID × 10)921092209230

Shared infrastructure (same for all agents):

  • PostgreSQL: localhost:15432
  • MinIO S3: localhost:19000
  • Headless Browser: localhost:13001
  • Mailpit SMTP: localhost:11025
  • Mailpit Web UI: localhost:18025

Get your URLs with:

bash
./agent-harness/agent-cli.sh <AGENT_ID> url

Step 3: Use the CLI

All stack management goes through agent-cli.sh:

bash
# Replace <ID> with your agent ID (1-5)

# Check process status (uptime, restarts, memory)
./agent-harness/agent-cli.sh <ID> status

# View logs (services: api, frontend, common-watch, warehouses-watch)
./agent-harness/agent-cli.sh <ID> logs api
./agent-harness/agent-cli.sh <ID> logs frontend

# Check API health
./agent-harness/agent-cli.sh <ID> health

# Restart services after code changes
./agent-harness/agent-cli.sh <ID> restart api
./agent-harness/agent-cli.sh <ID> restart frontend

# Run SQL queries against your database
./agent-harness/agent-cli.sh <ID> psql "SELECT * FROM users LIMIT 5;"

# View slow queries (useful for debugging)
./agent-harness/agent-cli.sh <ID> slow-queries

# Run arbitrary command with your agent's environment loaded
./agent-harness/agent-cli.sh <ID> exec pnpm -F backend test:dev:nowatch

Step 4: Verification Workflow

Run verification after every code change:

bash
# Quick verification (typecheck + lint + unit tests for changed files)
./agent-harness/verify.sh <ID>

# Full verification (complete test suite + smoke test)
./agent-harness/verify.sh <ID> --full

Output is JSON to stdout:

json
{
  "status": "pass",
  "stages": [
    {"name": "typecheck", "status": "pass", "duration_ms": 3200},
    {"name": "lint", "status": "pass", "duration_ms": 1800},
    {"name": "test-unit", "status": "pass", "duration_ms": 4500}
  ],
  "total_duration_ms": 9500
}

Stages run in order, stopping on first failure:

  1. typecheck — TypeScript for common, backend, frontend (parallel)
  2. lint — ESLint for common, backend, frontend (parallel)
  3. test-unit — Unit tests for changed files
  4. test-full (--full only) — Complete test suite
  5. smoke (--full only) — API health check

Step 5: Test Login Credentials

Email:    demo@lightdash.com
Password: demo_password!

Common Workflows

Making code changes

  1. Edit files as needed
  2. If you changed packages/common/, the TypeScript watcher auto-rebuilds
  3. If you changed packages/backend/, restart the API:
    bash
    ./agent-harness/agent-cli.sh <ID> restart api
  4. Run verification:
    bash
    ./agent-harness/verify.sh <ID>

Debugging API issues

bash
# Check health
./agent-harness/agent-cli.sh <ID> health

# View recent API logs
./agent-harness/agent-cli.sh <ID> logs api

# Check for errors in Maple (local tracing)
maple errors --since 5m

# Get trace details (full 32-char trace ID from the logs)
maple trace <trace-id>

Debugging frontend issues

bash
# View Vite server logs
./agent-harness/agent-cli.sh <ID> logs frontend

# Use Chrome DevTools MCP for browser automation
# (Your frontend URL is http://localhost:<3000 + ID*10>)

Database queries

bash
# View schema
./agent-harness/agent-cli.sh <ID> psql "\d tablename"

# Run queries
./agent-harness/agent-cli.sh <ID> psql "SELECT * FROM projects LIMIT 5;"

# Check slow queries
./agent-harness/agent-cli.sh <ID> slow-queries

Definition of Done

Your task is complete when ALL are true:

  • ./agent-harness/verify.sh <ID> --full returns "status": "pass"
  • Feature/fix works in browser at your frontend URL
  • Tests cover the change
  • No TypeScript errors or lint warnings
  • Changes are committed

What NOT to Do

  • Do NOT modify shared infrastructure (PostgreSQL, MinIO containers)
  • Do NOT hardcode ports — always derive from your agent ID
  • Do NOT run docker compose commands — use agent-cli.sh
  • Do NOT touch other agents' databases or processes
  • Do NOT manually edit .env.agent.<ID> or ecosystem.agent.<ID>.config.cjs
  • Do NOT disable tests to make verification pass

Tmux Session Management

If you were launched with --claude, you're running inside a named tmux session agent-<ID>.

For human supervisors to attach to your session:

bash
# Attach to a specific agent's tmux session
./agent-harness/attach.sh <ID>

# Or directly with tmux
tmux attach -t agent-<ID>

# List all agent sessions
tmux list-sessions | grep "^agent-"

Useful tmux commands (prefix is Ctrl-a on cloud servers, Ctrl-b locally):

  • prefix + d — Detach from session (leaves Claude running)
  • prefix + [ — Enter scroll mode (q to exit)
  • prefix + c — Create new window
  • prefix + n/p — Next/previous window

Quick Reference Card

bash
# Status & Health
./agent-harness/agent-cli.sh <ID> status
./agent-harness/agent-cli.sh <ID> health
./agent-harness/agent-cli.sh <ID> url

# Logs
./agent-harness/agent-cli.sh <ID> logs api
./agent-harness/agent-cli.sh <ID> logs frontend

# Restart
./agent-harness/agent-cli.sh <ID> restart api
./agent-harness/agent-cli.sh <ID> restart frontend

# Database
./agent-harness/agent-cli.sh <ID> psql "<SQL>"
./agent-harness/agent-cli.sh <ID> slow-queries

# Verification
./agent-harness/verify.sh <ID>           # Quick
./agent-harness/verify.sh <ID> --full    # Complete

# Package commands (use your agent's env)
pnpm -F common typecheck
pnpm -F backend typecheck
pnpm -F frontend typecheck
pnpm -F backend lint
pnpm -F common test
pnpm generate-api  # After TSOA controller changes

Frequently asked questions

What does the Agent Harness AI skill do?

Guide for AI agents running in the isolated agent-harness environment. Use when you need to discover your agent ID, find your ports, manage your stack with agent-cli.sh, run verification, or understand the multi-agent development setup.

Why use Agent Harness on TypingMind?

Because you install it once and use it with any model. Agent Harness is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Agent Harness in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/lightdash/lightdash/tree/main/.claude/skills/agent-harness. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Agent Harness?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Agent Harness?

As many as you like. As long as a model supports skills, you can use Agent Harness with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Agent Harness AI skill free?

It is published on GitHub by lightdash. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇