No slash command · from Agent Flow
Partitions N items into K groups by key using path-prefix, regex, jsonpath, or LLM classification. Output is items.json-compatible for downstream foreach processing.
Ships in Agent Flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Make it visible: the moment you start, say so in one line (skill + run-id) so it's clear an Agent Flow run is happening;
/agentflow:boardthen lists every run on disk — the audit trail.
Portable bundle. To use this skill in another project, copy:
${CLAUDE_PLUGIN_ROOT}/skills/group/(this folder: SKILL.md + defaults.md)${CLAUDE_PLUGIN_ROOT}/dist/(common.js,state/group.js) — shared framework${CLAUDE_PLUGIN_ROOT}/dist/hook/continue.js— generalized Stop hook- the Stop hook is wired automatically by the plugin (hooks/hooks.json)
You are the orchestrator of a /agentflow:group run. Job:
groups.json — an items.json-compatible array of group items, ready for downstream /agentflow:foreach.Composition pattern: the output of /agentflow:group IS a valid input for /agentflow:foreach. Pipe them: /agentflow:group → /agentflow:foreach --items <groups.json>. Each "item" foreach sees is a whole group, with data: {group_id, items, size}.
/agentflow:group --method path-prefix|regex|jsonpath|llm-classify \
--input-source <descriptor.json> [--method-config '{…}'] \
[--model haiku|sonnet|opus] [--run-id NAME]
--input-source is a descriptor file:
{"source": "run", "cmd": "foreach", "run_id": "…"} // or
{"source": "file", "path": "<items.json>"} // or
{"source": "inline", "data": [ {"id": "…", "data": {…}} ]}
--method-config per method: path-prefix '{"depth":2}' · regex
'{"pattern":"^src/([^/]+)/","field":"id"}' · jsonpath '{"path":"data.component"}'. For
llm-classify, the classify instructions are given to the agent at dispatch time (Step 4b). If no
method or input source is provided → stop with a clear message.
Read ${CLAUDE_PLUGIN_ROOT}/skills/group/defaults.md (YAML frontmatter). Use defaults when CLI/spec do not supply a value.
run-id is missing: generate group-<8 char hash> from the input source + method + method_config.path-prefix, regex, jsonpath, llm-classify}.regex: pattern is required; field defaults to id.jsonpath: path is required (e.g. data.component, data.labels.0).llm-classify: classify instructions are required (given to the agent at dispatch, Step 4b).After the input source is resolved (you can peek at items count cheaply by reading the source), compute items_total. If items_total < min_items from defaults (default 10) AND this is an autonomous invocation, STOP and use AskUserQuestion:
"Only items to group. /agentflow:group adds an extra step (and possibly an agent dispatch for llm-classify). For this size you can probably feed items directly to /agentflow:foreach without partitioning. Proceed with /agentflow:group anyway?" Options: skip (cancel /agentflow:group, the caller can use the items directly) | proceed (continue with /agentflow:group)
If the user typed /agentflow:group explicitly → skip the guardrail.
Write the input source descriptor to .agentflow/group/<run-id>/input-source.json:
{"source": "run", "cmd": "foreach", "run_id": "enum-abc123"}
{"source": "file", "path": "<path-to-json-array>"}
{"source": "inline", "data": [ {...}, {...} ]}
Then init the state:
node "${CLAUDE_PLUGIN_ROOT}/dist/state/group.js" init <run-id> \
--method <path-prefix|regex|jsonpath|llm-classify> \
--input-source .agentflow/group/<run-id>/input-source.json \
--method-config '<json>' \
--model <model> --min-items <N> \
--max-auto-continues <N> \
[--auto-continue|--no-auto-continue] \
[--force]
--method-config examples:
path-prefix: '{"depth": 2}'regex: '{"pattern": "^src/([^/]+)/", "field": "id"}'jsonpath: '{"path": "data.component"}'llm-classify: '{}' (the prompt is passed at dispatch time)If the run-id exists without --force: ask the user resume or reset. DO NOT overwrite without confirmation.
One shot. The state helper resolves input + applies method + writes groups.json + marks done:
node "${CLAUDE_PLUGIN_ROOT}/dist/state/group.js" run-deterministic <run-id>
Skip to Step 5.
Materialize input items to a file the agent will read:
node "${CLAUDE_PLUGIN_ROOT}/dist/state/group.js" prepare-classify <run-id>
This writes .agentflow/group/<run-id>/items-to-classify.json and marks state in_progress.
Dispatch ONE Agent. Self-contained prompt:
subagent_type: from config (default general-purpose)model: from config if not inheritdescription: group:<run-id>:classifyprompt:
.agentflow/group/<run-id>/items-to-classify.json (JSON array of {id, data, ...}).agentflow/group/<run-id>/classification.json (JSON object {"<item_id>": "<group_id>", ...} covering EVERY item).agentflow/group/<run-id>/classification.json via the Write tool: a JSON object mapping every id from the input to a group_id string. Group IDs should be short, lowercase, hyphenated (e.g. auth, billing, data-pipeline)."unclassified."OK <group_count>. Nothing else."Apply the classification:
node "${CLAUDE_PLUGIN_ROOT}/dist/state/group.js" apply-classification <run-id> \
--mapping .agentflow/group/<run-id>/classification.json
This produces groups.json and marks done.
If the classification file is missing or unparseable: node "${CLAUDE_PLUGIN_ROOT}/dist/state/group.js" fail <run-id> --error "<reason>". The Stop hook will retry on the next turn (up to max_auto_continues).
node "${CLAUDE_PLUGIN_ROOT}/dist/state/group.js" status <run-id>
Print: run-id, method, items_total, groups_count, output_pointer, plus a one-line summary of group sizes (e.g. "auth: 12, billing: 8, api: 5, unclassified: 2").
Suggest the next step explicitly: "Output .agentflow/group/<run-id>/groups.json is items.json-compatible. Run /agentflow:foreach --items .agentflow/group/<run-id>/groups.json --prompt '...' to process per group, or /agentflow:reduce it for a partition-aware digest."
A Stop hook (${CLAUDE_PLUGIN_ROOT}/dist/hook/continue.js) scans .agentflow/group/. For /agentflow:group, "residual work" = status in {"pending", "in_progress"} AND auto_continues < max_auto_continues. If you are re-activated by the hook with a /agentflow:group run-id:
run-deterministic. If method is llm-classify → check whether classification.json exists; if yes, run apply-classification; if no, re-dispatch the classify agent (Step 4b.2).init/run-deterministic/prepare-classify/apply-classification/fail. The classify agent only writes the classification file.groups.json shape is always [{"id": <group_id>, "data": {"group_id", "items", "size"}}, ...]. Downstream consumers can rely on this.path-prefix/regex/jsonpath over llm-classify — cheaper, faster, reproducible across runs./agentflow:group with the same run-id without --force resumes.Group .cs files by directory, then review each group together:
# src.json: {"source":"run","cmd":"foreach","run_id":"review-cs"}
/agentflow:group --method path-prefix --method-config '{"depth":2}' --input-source src.json --run-id cs-by-dir
/agentflow:foreach --items .agentflow/group/cs-by-dir/groups.json \
--prompt "Review every file in this group together; cross-reference for cross-file bugs"
LLM-classify Jira issues by intent (the classify instructions go to the agent at dispatch, Step 4b):
# issues.json: {"source":"file","path":".agentflow/pipe/triage/issues.json"}
/agentflow:group --method llm-classify --input-source issues.json --model sonnet
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
grouping, partition, agentflow, workflow-automation, data-pipeline
npx claudepluginhub alesaiani/agentflow --plugin agentflow23 skills in this plugin
/auditDeep code-audit recipe: discover files in a target → review each (LLM, cached) → partition by
component → executive digest with hotspots and recurring patterns. A layer-3 recipe over /agentflow:pipe
(the 6-stage pipeline and caching are detailed in the body).
USE when the user asks to "review / audit / find bugs across" a folder, repo, or glob and wants a
persisted, structured report — and the target is large enough (≥ ~10 files) that per-file parallelism
plus a digest beats reading inline.
DON'T use for a few named files (read them inline), exploratory questions ("what does this do?"), or
generic per-item work that isn't a code review (→ /agentflow:foreach).
Not a `/`-menu command — it's the shipped `workflows/audit/` recipe: reach it by asking ("audit src
for bugs"), or run it directly with `/agentflow:run-workflow workflows/audit/WORKFLOW.md`.
/boardWorkspace dashboard: lists every active framework run across all primitives, highlights blockers (stuck items, exhausted auto-continue caps), shows cumulative cost, and suggests the next action. The natural command to run after re-opening Claude Code in a workspace with in-flight runs, or whenever the user wants a one-shot overview of "what's going on".
USE this skill when:
- the user has just (re)opened the workspace and wants to know what is in flight;
- the user says "what's going on", "show me everything", "any active runs", "where are we", "any pipelines running";
- the user wants a one-shot health check + suggested next action.
DON'T use this to inspect a specific run in depth (use `/agentflow:inspect show <id>` or `tree <id>`), or
to modify state (board is read-only). Explicit: `/agentflow:board` or `/agentflow:board --json`.