Agent harness — runbook
Agent harness — runbook
Section titled “Agent harness — runbook”This page is for humans steering and agents executing: how to boot the app, verify changes, and find signals when something breaks. Keep long prose in docs/; keep AGENTS.md as a short index.
Quick verify (from repo root)
Section titled “Quick verify (from repo root)”-
Install dependencies and build workspace packages:
Terminal window pnpm installpnpm run build -
Run type checking and linting:
Terminal window pnpm run typecheckpnpm run lint -
Run the full test suite:
Terminal window pnpm test
After config or plugin option schema edits, regenerate and check drift:
pnpm docs:configpnpm docs:plugins# CI equivalents:pnpm run docs:config:checkpnpm run docs:plugins:checkRun the server
Section titled “Run the server”pnpm run devUses tsx watch mode — restarts on file changes.
pnpm run build:app && pnpm startBundles to dist/index.js first, then runs the production entrypoint.
Default config: config/default.json; overrides: config/local.json (deep merge). See Configuration hub.
Plugin / integration smoke
Section titled “Plugin / integration smoke”- Jira webhook smoke (server on
PORT):agent-detective smoke(npm) orpnpm run jira:webhook-smoke(monorepo) - CI webhook E2E (temp config, mock agent, mock Jira — no real OpenCode/Cursor):
pnpm run ci:webhook-smoke(also runs in thebuildCI job afterbuild:app) - Manual Jira E2E (tunnel, labels): e2e/jira-manual-e2e.md
Set AGENT_DETECTIVE_MOCK_AGENT=1 (or true / yes) to skip the real agent subprocess; the runner returns a fixed mock analysis string. Used by scripts/ci-webhook-smoke.mjs so CI can POST a Jira fixture and assert [MOCK] Added comment in logs without installing OpenCode or Cursor.
Logs and observability
Section titled “Logs and observability”- Tune level via
observabilityin config or env (see Observability). - Request logging excludes paths such as
/api/healthand/api/metrics— adjust in config if you add new high-chatter routes.
Worktrees and agents
Section titled “Worktrees and agents”- Use a clean worktree per task when possible; run
pnpm installif dependencies changed. - Prefer absolute paths in
config/local.jsonfor repo entries so worktrees do not depend on cwd.
Parallel runs (PORT)
Section titled “Parallel runs (PORT)”PORT=3001 pnpm run devThen hit health on that port (see below).
Quick HTTP checks
Section titled “Quick HTTP checks”With the server listening (dev or pnpm start after build:app):
curl -sf "http://127.0.0.1:${PORT:-3001}/api/health"curl -sf "http://127.0.0.1:${PORT:-3001}/api/metrics" | headAdjust the path if your deployment uses a different base URL. High-chatter routes may be excluded from request logs; use structured logs for deep debugging — see Observability.
Plans and acceptance criteria
Section titled “Plans and acceptance criteria”- Architecture decisions: docs/architecture/adr/ — link new behavior-changing work to an ADR when appropriate.
- Large multi-step work: add markdown under
docs/exec-plans/active/(anddocs/exec-plans/README.mdas an index when you introduce that folder); move todocs/exec-plans/completed/when done so intent lives in git, not only in chat.
Site and docs builds
Section titled “Site and docs builds”pnpm run docs:site:sync # mirror docs/ → Starlight contentpnpm run docs:site:dev # Starlight devpnpm run docs:site:landing # docs + landing for same artifact as GitHub PagesStarlight home apps/docs/src/content/docs/index.mdx is not overwritten by sync — see apps/docs/README.md.
Mechanical guards (lint)
Section titled “Mechanical guards (lint)”pnpm run lint includes:
scripts/check-package-root-imports.mjs— fails ifpackages/*/src/**reaches rootsrc/via a relative import.scripts/check-plugin-cross-imports.mjs— fails if one plugin package compile-imports another (ADR 0001); use@agent-detective/typesandgetService().scripts/check-docs-internal-links.mjs— fails on broken relative links fromdocs/**/*.mdinto the repo.
Related
Section titled “Related”- Agent workflow — suggested PR loop and review expectations.
- Agent golden rules — do / don’t / common failures.
- Development guide — monorepo and tooling detail.
- Documentation map — all
docs/areas.