Agent exploration

From compozy/agh · View interactive version

Agent exploration is an AI agent skill from the GitHub repository compozy/agh. Dispatches scoped-write explorer agents in parallel via `compozy exec` for multi-area research that must produce written artifacts — one seven-section analysis file per slice plus a parent-authored summary. Use when a research question spans several distinct areas and chat output is not enough. Do n

How to use this skill

Skill file

Agent Exploration

Generic parallel-research workflow. Use when a question requires deep reads across multiple distinct areas and the operator needs written artifacts (not chat output). The skill dispatches explorer agents in parallel through compozy exec; each invocation writes one analysis file. The parent then synthesizes a final summary.

The skill is self-contained and harness-agnostic. The explorer is a Compozy agent — a single definition (assets/AGENT.md) installed once at ~/.compozy/agents/explorer/AGENT.md, discoverable by compozy exec --agent explorer from any harness (Claude Code, Codex CLI, Cursor, Droid, OpenCode, Pi, Gemini, Copilot, …). The parent runtime is selected per invocation via --ide, --model, and --reasoning. Parallel dispatch uses whatever async/background tool calls your harness exposes — the skill does not prescribe a specific tool.

Required Reading Router

Match your step to the row. Read the listed files in full before producing output. They are not appendices — they are load-bearing. Inline content in this SKILL.md is a pointer, not a substitute.

| Step | MUST read |

| ------------------------------------------------------- | ---------------------------------------------------------------------- |

| Step 4 — composing every slice prompt | references/dispatch-rules.md + assets/analysis-template.md |

| Step 5 — verifying outputs | references/checklist.md + assets/analysis-template.md |

| Step 6 — synthesizing summary.md | every <path>/analysis/NN_analysis_<slug>.md from this round |

| Any contract violation, fabricated evidence, or retry | references/dispatch-rules.md (re-read; do not paraphrase from memory)|

Reference Index

Bundled Path Rule

Resolve every bundled helper relative to the directory that holds this SKILL.md. When a command appears below as scripts/<name>, treat the actual invocation as <agent-exploration-dir>/scripts/<name> — expand <agent-exploration-dir> to the absolute skill directory before running.

Required Inputs

If --path or --prompt is missing, the parent asks the operator a single clarification before continuing. Never invent defaults for either. Apply the documented defaults for --ide, --model, --reasoning silently when omitted; reject an invalid --ide rather than falling back.

Model Options

Two dispatch profiles are supported. Opus is the default; Grok 4.5 High Fast is the fast alternative for breadth work. Pick per run via --ide/--model.

| Profile | Flags | When |

| -------------------------------------- | -------------------------------------------------------------- | ----------------------------------------------------------- |

| Opus (default, high-fidelity) | --ide claude --model opus --reasoning xhigh | Hardest slices; when citation precision must be maximal. |

| Grok 4.5 High Fast (via cursor-agent) | --ide cursor-agent --model 'grok-4.5[effort=high,fast=true]' | Breadth research, cost-sensitive runs, high slice counts. |

Grok profile notes:

Output Layout

<path>/analysis/
├── 01_analysis_<slug-a>.md
├── 02_analysis_<slug-b>.md
├── 03_analysis_<slug-c>.md
└── summary.md

Procedures

Step 1: Verify the explorer agent is installed

  1. Confirm the compozy binary is on PATH (e.g. command -v compozy). If missing, abort with a one-line message instructing the operator to install Compozy from /Users/pedronauck/dev/compozy/looper. Do not fall back to harness-native subagents.
  2. Check for the explorer agent in the Compozy registry:

At least one must be present.

  1. If both are absent, ask the operator a single question: "The explorer Compozy agent is not installed at ~/.compozy/agents/explorer/AGENT.md. Install it now? [yes/no]". Do not proceed silently.
  2. On "yes", run the bundled bootstrap helper: <agent-exploration-dir>/scripts/install-explorer.sh. The helper installs to ~/.compozy/agents/explorer/AGENT.md and refuses to overwrite an existing file.
  3. On "no", abort the dispatch with a one-line message — the agent definition is never inlined into a slice prompt.
  4. After installation, re-check that the file exists before continuing.
  5. (Optional sanity check) Run compozy agents inspect explorer and confirm the entry is discoverable. Any error here blocks dispatch.

Step 2: Resolve inputs

  1. Parse --path, --agents, --prompt, --ide, --model, --reasoning from the invocation. If --path or --prompt is missing, ask the operator and stop.
  2. Default --agents to 3 when omitted. Reject values below 1 or above 8 — ask the operator to choose a value in range.
  3. Default --ide to claude, --model to opus, --reasoning to xhigh when omitted. Validate --ide against the accepted list (codex, claude, cursor-agent, droid, opencode, pi, gemini, copilot) and --reasoning against low, medium, high, xhigh; reject invalid values with a clear message instead of silent fallback. Do not validate --model ahead of time — let compozy surface incompatibilities.
  4. Resolve --path to an absolute path. If the directory does not exist, ask the operator whether to create it before continuing; if creation fails, stop and report the filesystem error.
  5. Create <path>/analysis/ if absent. The dispatched agents refuse to write into a missing directory.

Step 3: Parent-led initial scout (MANDATORY — do not skip)

The scout is the load-bearing step that prevents wasted parallel dispatch. The parent must do this work itself before any slice is launched.

  1. Perform a brief read-only exploration of the problem space using Glob, Grep, and targeted Read calls. The scout's job is to learn enough about the territory to divide it well — not to produce analysis content. Cap the scout at 8–15 tool calls; deep reading belongs to the dispatched agents.
  2. From the scout, identify exactly --agents distinct slices that are:
  1. For each slice, assign:
  1. Briefly tell the operator the slice list (one line per slice: NN – slug – focus) before dispatching. Do not ask for approval unless the slices look thin or overlap; just announce and proceed.

If the scout reveals that fewer than --agents non-overlapping slices exist, reduce the dispatch count and tell the operator. Do not pad slices to hit the requested count.

Step 4: Dispatch explorer agents in parallel

Gist tripwires — the contract items the parent must enforce in every dispatched prompt:

STOP. Read references/dispatch-rules.md in full before composing any slice prompt. That file contains the complete scoped-write contract, tool allow/forbid lists, parent responsibilities, and failure handling. The bullets above are tripwires, not the contract — the contract must be embedded verbatim in every slice prompt.

STOP. Read assets/analysis-template.md in full before composing any slice prompt. That file is the canonical seven-section schema every dispatched agent fills. The schema must be embedded in the prompt; do not paraphrase it.

Compose one slice prompt per slice. Every prompt MUST include:

Write each composed prompt to its own file at <path>/.dispatch/prompts/NN_<slug>.txt. The file basename (without extension) becomes the slice id used for per-slice log file naming.

Recommended dispatch path: scripts/dispatch-slices.sh. The bundled script backgrounds one compozy exec per prompt file, waits for every PID, captures per-slice stdout/stderr/exit under <logs-dir>, and exits non-zero if any slice failed. Zero external dependencies; portable across any harness that can run a bash script.

<agent-exploration-dir>/scripts/dispatch-slices.sh \
  --ide <ide> --model <model> --reasoning <reasoning> \
  --logs <path>/.dispatch/logs \
  -- <path>/.dispatch/prompts/01_<slug-a>.txt \
     <path>/.dispatch/prompts/02_<slug-b>.txt \
     <path>/.dispatch/prompts/03_<slug-c>.txt

Manual alternative (if you cannot run a bash script — e.g., a harness that prefers issuing N parallel tool calls itself): invoke each slice with the command shape below. Use whatever async/background facility your harness exposes; wait for every invocation to exit before continuing.

compozy exec \
  --agent explorer \
  --ide <ide> \
  --model <model> \
  --reasoning-effort <reasoning> \
  --prompt-file <path>/.dispatch/prompts/NN_<slug>.txt

Notes that apply to both paths:

Step 5: Verify outputs

Gist tripwires — the floor items that catch most failures:

STOP. Read references/checklist.md in full before declaring outputs verified. That file is the seven-section output validation checklist (installation, inputs, scout, dispatch, files, schema, summary). Every item must pass; failing items trigger a re-dispatch of the offending slice. The bullets above are tripwires, not the contract.

If a section is empty, a file is missing, a cited path is fake, or the schema is incomplete, re-dispatch the offending slice via a fresh compozy exec with the schema embedded and a request to fill the gap. The parent never authors the missing analysis content — the dispatched agent owns the write.

Step 6: Synthesize summary.md

  1. Read every <path>/analysis/NN_analysis_<slug>.md in full.
  2. Author <path>/analysis/summary.md with these sections:
  1. summary.md is parent-authored. Do not dispatch a slice for this step.

When Not To Use

Error Handling

Input, installation, and scout failures are handled inline where they occur — each item in Steps 1–3 names its own recovery. Contract violations, fabricated evidence, schema-incomplete analyses, and retries route through the Required Reading Router: STOP, re-read references/dispatch-rules.md in full, then re-dispatch the offending slice — the dispatched agent owns the write. One round-level rule lives only here:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.