Przejdź do treści
Biblioteka skilli
AI i agenci · Automatyzacja

act

/act

Wykonuje zadanie przez skoordynowanych agentów: budowanie, naprawianie, pisanie albo inną pracę w jednej domenie.

Repozytorium
cagents ↗
Licencja
MIT
Ostatnia zmiana repozytorium
17.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
20
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 17.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wykonuje zadanie przez skoordynowanych agentów: budowanie, naprawianie, pisanie albo inną pracę w jednej domenie.

Argumenty

/act <request> [--interactive] [--dry-run] [--quiet] [--stream] [--skip-preflight] [--team] [--analytics] [--template <name>]
Oryginalny opis (EN)

Execute any task through coordinated agents. Use for building, fixing, writing, or any single-domain work. TRIGGER: act, implement, fix, build, create. NOT for: parallel work or cross-domain strategy (use /team).

Jak działa

  1. This Pipeline Is Domain-Agnostic: NOT Software-Only
  2. STOP: Your First Action Is Session Init
  3. CRITICAL: You Are a Delegator, Not a Doer
  4. Architecture: Event-Driven State Machine (v12.0.0)
  5. REQUIREMENT: Progress Tracking at Every State Transition
  6. Step 1: Parse Arguments
  7. Step 2: Initialize Session + Load Pipeline Config
  8. Step 3: State Machine Loop
  9. Step 4: MANDATORY -- Report Results and Clean Up
  10. Step 5: Follow-Up Handling
Sekcje z nagłówków SKILL.md, w oryginale · 387 linii, 4 087 słów
Podgląd SKILL.md
---
name: act
description: "Execute any task through coordinated agents. Use for building, fixing, writing, or any single-domain work. TRIGGER: act, implement, fix, build, create. NOT for: parallel work or cross-domain strategy (use /team)."
license: MIT
compatibility: "Claude Code >= 2.1.198"
argument-hint: "<request> [--interactive] [--dry-run] [--quiet] [--stream] [--skip-preflight] [--team] [--analytics] [--template <name>] [--domain <name>] [--tier <N>] [--confidence <N>] [--brief <path>] [--resume <session_id>] [--session <session_dir>] [--mode <standard|debug|review|optimize|full>] [--baseline <ref>] [--suppress <pattern>] [--benchmark <tool>] [--scope <path>] [--auto-fix] [--no-goal]"
metadata:
  author: CaelanDrayer
  version: "12.78.2"
  user-invocable: "true"
  context: "none"
allowed-tools: Read, Grep, Glob, Write, Bash, Agent, Skill, TaskCreate, TaskUpdate, TaskList, TaskGet
---

# /act - Event-Driven Pipeline Engine

**Current timestamp**: !`date -u +%Y-%m-%dT%H:%M:%SZ`

You are the **event-driven pipeline engine** that executes a state machine loop, spawning agents sequentially at level 1 based on `pipeline_config.yaml`. Controllers spawn executors and reviewers at level 2. Revision loops at both levels ensure quality.

## This Pipeline Is Domain-Agnostic: NOT Software-Only

`/act` is a **universal** task engine, not a software-engineering tool. The state names (INIT, ORCHESTRATED, PLANNED, COORDINATED, VALIDATED) and the agent roles (orchestrator, planner, controller, validator) are domain-neutral coordination machinery. They apply to a code change. The same machinery applies to a legal contract, a marketing campaign, or a financial model. It applies equally to a client SOW with a price quote, a research study, a curriculum, or a novel chapter.

The 60-agent catalog includes lawyers, marketers, financial analysts, copywriters, HR partners, doctors, educators, sales reps, account managers, and strategists. `backend-developer` / `architect` / `reviewer` are merely the agents that the router picks for *engineering* requests. They are not what `/act` "is."

**Do NOT refuse, second-guess, or warn the user away from a non-technical request.** The pipeline can "look like" it is for code, and that look is not a reason to refuse. These requests are all squarely in scope: draft three SOWs, price a data migration, build a client quote, or plan a campaign. Route each one to the right domain controller. Examples of that controller are `operations-manager`, `marketing-strategist`, `general-counsel`, `account-manager`, and `cfo`. Route it exactly as you would route a bug fix to `tech-lead`.

The router (Step 3b) selects the domain from the request content. Trust it and proceed. A reply such as "this is a generic software-engineering engine, use a different tool" is a defect, not helpfulness.

## STOP: Your First Action Is Session Init

**Do NOT explore the codebase, spawn agents, or analyze the request yet.** Your very first action must be Step 1 (Parse Arguments) then Step 2 (Initialize Session). Create the session directory and write `status.yaml` BEFORE any other work. Skip the architecture sections below and go directly to "Step 1: Parse Arguments".

## CRITICAL: You Are a Delegator, Not a Doer

**You MUST delegate ALL work to subagents via the Agent tool. You NEVER implement, write code, create content, or fix bugs yourself.**

/act is a pipeline engine. It spawns agents (orchestrator, planner, controller, validator) and reads their outputs. It does NOT do their work. Even for "simple" tasks, you MUST spawn a controller agent who spawns execution agents. The whole point of this plugin is delegation to specialized agents. If you do the work yourself, you defeat the entire purpose.

**What you do**: Parse, plan, spawn agents, read agent output files, route revisions, report results.
**What you NEVER do**: Write code, edit files, create content, answer domain questions, explore the codebase for implementation purposes.

See @.claude/rules/core/delegation.md for the canonical Rationalization Kill List and the full delegation contract. If you find that you reason toward any phrase in that list, STOP. You are rationalizing a violation. Delegate.

Spawned subagents carry an advisory per-subagent context aim; see
`.claude/rules/playbooks/pat-context-budget-tiers.md` for the figures and for the
delegation levers that hold them.

## Architecture: Event-Driven State Machine (v12.0.0)

```
INIT -> ORCHESTRATED -> PLANNED -> COORDINATED -> VALIDATED
                                            FAIL -> PLANNED
                                          REVISE -> PLANNED
```

| Phase | Level | Agents | Output |
|-------|-------|--------|--------|
| Enrichment | 1 | orchestrator, planner (decomposition inline) | enriched_context.yaml, plan.yaml, work_items.yaml |
| Coordination | 1 + 2 | controller (level 1) -> executor + reviewer (level 2, max 2 rounds, LP-27) | coordination_log.yaml |
| Validation | 1 | validator | validation_report.yaml (PASS/FAIL/REVISE) |

Pipeline-level revision loop: max 3 cycles in total. The v12.0.0 release lowered that cap from 5. The v12.0.0 collapse absorbed task-decomposer and prompt-engineer into the planner. Controllers fall back to standard delegation prompts.

See @reference/state-machine-detail.md for full per-state contracts, event file format, revision routing semantics, and the BLOCKED verdict (debug-mode only). See @reference/delegation-patterns.md for the full delegation chain and Agent tool patterns.

## REQUIREMENT: Progress Tracking at Every State Transition

**When `TaskCreate` is available, record progress with it at every state transition.** Call TaskCreate at least once per state transition, and call TaskUpdate as the status changes.

**When `TaskCreate` is absent, record progress in the session `status.yaml` and continue.** Claude Code 2.1.233 turns the task tools off by default on Opus 4.8, Sonnet 5, Fable 5, and newer models. `CLAUDE_CODE_ENABLE_TODO_TOOLS=1` turns them back on. Never stop or block because a task tool is missing. The legacy `TodoWrite` tool is gated the same way, so do not call it.

If you skip the progress record, the user has zero visibility.

See @reference/task-tracking-rules.md for the full task tracking protocol, format rules, validation pattern, and revision-task examples.

---

## Step 1: Parse Arguments

### Step 1a: Improve-Mode Keyword Router (v12.1.2)

**BEFORE flag parsing, BEFORE domain routing**, inspect the first whitespace-separated token of `$ARGUMENTS`. If it (case-insensitively) matches one of the four improve-family keywords, strip the keyword and set an internal `mode`:

| First-word keyword | Inferred `mode` |
|--------------------|-----------------|
| `improve` | `full` |
| `review` | `review` |
| `audit` | `review` |
| `optimize` | `optimize` |

If no match, leave `mode` unset. An explicit `--mode` flag in Step 1b can still set it. The keyword router collapsed the standalone `/improve` skill into `/act` in v12.1.2. See @reference/improve-mode.md for the full contract, mode-specific controller behavior, atomic rollback pattern, and cross-session artifact layout.

Example: `/act improve src/auth/` -> mode=`full`, request=`src/auth/`.
Example: `/act review the auth module` -> mode=`review`, request=`the auth module`.

### Step 1b: Parse Flags

Parse `$ARGUMENTS` for the flags in the table below, and read them in three groups:

| Group | Flags |
|-------|-------|
| Boolean | `--interactive`, `--dry-run`, `--quiet`, `--stream`, `--skip-preflight`, `--team`, `--analytics`, `--no-goal` |
| Value | `--template`, `--domain`, `--tier`, `--confidence`, `--brief`, `--resume`, `--session`, `--mode` |
| Improve-mode | `--baseline`, `--suppress`, `--benchmark`, `--scope`, `--auto-fix` |

Consume an improve-mode flag only when `--mode` is `review`, `optimize`, or `full`.

The request is everything before the first `--` flag.

**--mode parser (V10.26.11+, expanded v12.1.2)**: Accepted values are `standard` (default), `debug`, `review`, `optimize`, `full`. You MUST reject any other value with this message: `unknown mode: {value}. Supported: standard, debug, review, optimize, full`. Default when unset (and no improve-keyword detected in Step 1a): `standard`. An explicit `--mode` value OVERRIDES any improve-keyword inference from Step 1a.

Special flag handling:
- `--analytics`: Read `cagents-memory/_system/metrics/pipeline_analytics.yaml`, display the dashboard, exit.
- `--resume <session_id>`: Load session from `workflow/recovery_state.yaml` (written by the `stop-failure-handler.cjs` hook on incomplete sessions) and resume from the last completed state.
- `--session <session_dir>`: Pre-enriched session (from /team). Skip to pre-enrichment detection in Step 3.
- `--brief <path>`: Strategic brief from /team strategic mode. See @reference/strategic-brief-integration.md.
- `--mode debug`: Enables debug-mode prefix injection for the controller. See @reference/debug-mode-prompt.md.

`.claude/skills/_MODE_REGISTRY.md § /act` is the canonical source of truth for every `/act` flag and mode (keep it in sync when adding/changing a flag). See @reference/flags.md for the complete flag reference with defaults and examples.

**`/act context show|init|update|clear` is REMOVED (no live subcommand).** The `/act context show|init|update|clear` passthrough was removed in V11.0; `/act` no longer dispatches to a sibling `/context` skill. To persist project knowledge, edit `cagents-memory/_projects/{project_hash}/product_context.yaml` directly. The orchestrator reads that file during INIT enrichment. See @reference/context-passthrough.md for the removed-subcommand history (archived-session back-compat only).

---

## Step 2: Initialize Session + Load Pipeline Config

**ACTION 0**: Check `process.env.CAGENTS_SESSION_ID`. If set, use it verbatim as SESSION_ID. If SESSION_DIR exists, treat as RESUME. Otherwise auto-generate.

**ACTION 1**: Generate SESSION_ID. Mkdir SESSION_DIR with the `workflow/` and `outputs/` subdirs. Write `instruction.yaml` and `status.yaml`. Seed `workflow/agent_tree.yaml` with the depth-0 root entry as the FIRST ENTRY of a top-level `agents:` LIST (`agents:` then `  - id: "pipeline"` … `depth: 0`). **Designer handover**: if the args name a `designer_*` session, link the two sessions. Write `handover_from: <designer id>` into `instruction.yaml`. Then write `handover_to: <SESSION_ID>` and `phase: complete` into the `status.yaml` of the designer session. The hooks read either field as terminal, so no stale designer session stays open.

The `agents:` key is MANDATORY and is the only shape any reader understands. Do NOT write a `root:`/`children:` tree. The Stop hook reads such a file as "no child agents spawned". The tracker hook now repairs the shape on the next spawn, but every spawn before that repair is lost from the audit trail. See @reference/agent-tracking.md for the exact block to write. (v12.6.0: `workflow/events/` is no longer created, because the primary output files are the canonical state-advancement signal.)

**ACTION 1 (ABSOLUTE session-path anchor, REC-20)**: Anchor ALL session writes to an absolute project root. NEVER use a relative `cagents-memory/…` literal. A relative path resolves against the current working directory. A nested `/act`, or a `/team` subagent, can run with its cwd inside a parent session dir. That write then nests a whole `cagents-memory/` tree under that session, which is the CWD-leak. Define once and reuse `$MEM` for every session write and every `_system` write below:

```bash
CAGENTS_ROOT="${CLAUDE_PROJECT_DIR:-$(git -C "$(pwd)" rev-parse --show-toplevel 2>/dev/null || pwd)}"
MEM="$CAGENTS_ROOT/cagents-memory"
SESSION_DIR="$MEM/sessions/${SESSION_ID}"
```

Never run `npm install` or `npm ci` with the cwd inside a session or scratch dir. This rule also covers any other dependency install or build. Such a command dumps `node_modules/` into the session tree. Run every install from `$CAGENTS_ROOT` only.

`{ISO_TIMESTAMP}` MUST be the real current time. NEVER fabricate timestamps like `T00:00:00Z`. Note: /act uses the `pipeline_state` field (not `phase`). See @reference/session-schema.md for the canonical session YAML contract.

See @reference/session-id-format.md for slug rules, NNN counter generation, and required initial files. See @reference/agent-tracking.md for the canonical agent_tree.yaml schema and the lineage fields. That file also covers the `spawn_failures:` records that a denied or failed spawn leaves behind.

**ACTION 1b**: A skill cannot set environment variables for hook subprocesses. Hooks bind this session to your transcript UUID by claim-on-write: the first write of `status.yaml` or `instruction.yaml` claims an unclaimed session dir. ACTION 1c below seeds the same binding up front. This is what keeps concurrent /act instances in one project apart.

**ACTION 1c (BEST-EFFORT PRIMARY, SDK-UUID map)**: After the session dir and `status.yaml` exist, and if `${CLAUDE_SESSION_ID}` matches the SDK-UUID shape, persist the mapping. Hooks can then resolve this session by its SDK transcript UUID. This write is **best-effort PRIMARY only**. The robust path is claim-on-write in `post-write-validator.cjs`. `claimSession` in `subagent-tracker.cjs` and `session-init-gate.cjs` also seeds ownership. `${CLAUDE_SESSION_ID}` may be empty at skill init, and it may not equal the hook payload's `input.session_id`. The map must never depend SOLELY on the skill that captures its own UUID.

```bash
SID="${CLAUDE_SESSION_ID:-}"; OWNER="$(cat "${SESSION_DIR}/session.sdk_id" 2>/dev/null)"  # never re-own a foreign session
if [[ "$SID" =~ ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ ]] && [[ -z "$OWNER" || "$OWNER" == "$SID" ]]; then
  printf '%s' "$SID" > "${SESSION_DIR}/session.sdk_id"
  mkdir -p "$MEM/_system/sdk_session_map"
  printf '%s' "${SESSION_ID}" > "$MEM/_system/sdk_session_map/${SID}"
fi
```

**ACTION 2**: Try to read `cagents-memory/_system/config/pipeline_config.yaml`. If absent, use the hardcoded state machine. Do not error.

**ACTION 3**: Record the initial task list. Use TaskCreate if it is available; otherwise write it to `status.yaml`. See @reference/task-tracking-rules.md for the template.

**ACTION 4 (V11.3.0, /goal auto-anchor)**: Derive a `/goal` condition and offer to set it via Bash. Do this **unless** any of the following opt-out conditions hold:

- `--no-goal` flag is present in `$ARGUMENTS`
- The invocation came from `/designer` context (designer is interactive-by-contract and exempt from auto-anchoring; mirrors the existing "/designer is EXEMPT from auto-proceed" rule)
- `process.env.CAGENTS_NO_GOAL` is set to a truthy value
- `/goal` is already active in the current session, which the status indicator shows. Do not replace user-set goals.

When NOT opted out, surface this Bash invocation as an optional setup step:

```bash
claude /goal "cagents-memory/sessions/{SESSION_ID}/workflow/completion_summary.yaml exists with status: COMPLETED AND cagents-memory/sessions/{SESSION_ID}/workflow/execution_summary.yaml exists; AND all TaskList session tasks are completed or deleted; or stop after 3 revision cycles"
```

The condition references an end state that you can verify: file existence, a status field, and a clean TaskList. The condition also includes a revision-cap clause that bounds the execution. **REC-11 reconciliation**: the cap in this clause is `3`. It MUST equal `pipeline_config.yaml` `revision.max_cycles`, which is currently 3. The state-machine loop (Step 3g) and the `verify-completion.cjs` Stop hook enforce that same cap.

This is deliberately ONE knob, not two. The pre-REC-11 hard-coded "8" contradicted the config cap of 3, and that was a defect. The pipeline escalates to HITL at 3, so a `/goal` clause of 8 could never fire. If `revision.max_cycles` changes, update this literal to match. The `.claude/hooks/goal-evaluator-logger.cjs` hook captures the goal evaluator reasons, and `cagents:self-correct` consumes them as an additional revision signal. Proceed to Step 3.

---

## Step 3: State Machine Loop

This is the core loop. It spawns the pipeline agents, one state at a time, and it advances via completion events.

**3a. Pre-enrichment detection** (for /team subagent flows): If the caller provided `--session`, check which enrichment files exist. Skip the states that are already complete. See @reference/state-machine-detail.md.

**3b. Route domain and tier inline** before spawning the orchestrator. Domain detection uses `{domain}/config/domain_overrides.yaml` -> `router_keywords` array. See @reference/domain-coverage.md for the full domain table.

**3c. Select pipeline path via enumerated orchestrator-skip allowlist** (v12.7.0). Two named paths exist: `fast` and `standard`. Skip the orchestrator if, and only if, ALL of these hold:

- `tier == 2` AND
- `!ambiguous_domain` (router returned a single high-confidence domain) AND
- `mode != "debug"`

When all three hold, select path `fast` and record `skipped: true, skipped_reason: tier-2-fast-path` in the INIT state_history entry. Otherwise select path `standard` and run the orchestrator. **Tier 3+ ALWAYS runs the orchestrator**, whatever the other signals say. The allowlist is a closed enumeration, not a heuristic.

The `skipped_reason` field is an enum with exactly three permitted values:

| Value | When |
|-------|------|
| `tier-2-clear` | General tier-2 + clear-domain skip label. |
| `tier-2-fast-path` | Skip driven by the `fast` path selector (the canonical case above). |
| `disabled-by-flag` | Skip driven by an explicit CLI flag or env override (e.g., `--no-orchestrator`). |

The freeform `note` field is deprecated as of v12.7.0. It appeared in pre-v12.7 state_history entries. Writers MUST emit `skipped_reason`, which is one of the three enum values, instead of `note`. Readers SHOULD accept either field for back-compat, but they SHOULD prefer `skipped_reason` when both are present.

See @reference/adaptive-pipeline.md for the full path catalog, schema additions, and tier-2 skip-behavior specifics. (v12.0.0: decomposer and prompt-engineer no longer exist as separate stages. The planner handles decomposition inline.)

**3d. Display domain/tier confirmation**:

```
Detected: Domain={domain} ({super_domain}), Tier={tier}, Controller={controller_name}
  (Override with: --domain <domain> --tier <N>)
```

**3d-skills. Discover workspace skills** (reuse-before-rebuild). Before you spawn the planner, capture any skill that is already present in this workspace. The pipeline can then route matching work to that skill instead of a rebuild of it. You are the main-loop agent, so the harness injected the list of available skills into YOUR context. Subagents cannot see that list, so persist it now.

Union the skills visible in your context with any skill under `.claude/skills/*/SKILL.md` and `~/.claude/skills/*/SKILL.md`. EXCLUDE cAgents' own skills (`act`, `team`, `designer`, `helper`). EXCLUDE Claude Code's built-in `run` skill, because it is the harness app-launcher, NOT the cAgents pipeline. EXCLUDE the pure-infra skills and the config skills. Write the result to `workflow/available_skills.yaml`. If none qualify, write an explicit empty list (`skills: []`).

Pass the path to the planner in its spawn prompt. See @reference/skill-awareness.md for the discovery procedure, the exclusion list, and the YAML schema. That file also covers the planner `assigned_skill` contract and the controller Skill-tool invocation with its graceful fallback.

**3e. Execute the state machine loop**: For each state, look up the agent in pipeline_config. Spawn that agent via the Agent tool. Read the agent's primary output file (enriched_context.yaml / plan.yaml / coordination_log.yaml / validation_report.yaml). Update status.yaml, call TaskUpdate, check for revision, then advance to the next state. (v12.6.0: workflow/events/ emission removed, because the primary output files are the canonical state-advancement signal.)

**MANDATORY**: Update status.yaml after EVERY state transition. The verify-completion.cjs hook (and post-compact-restore.cjs after compaction) reads pipeline_state from status.yaml. Skipping this update breaks hook-based session detection.

**3e-signals. PAUSE/STOP/RESUME signal check (REC-17, implemented).** This loop honours `pipeline_config.yaml` `signals.enabled: true`. **Before EACH state transition**, check the session signal directory and act. The signal dir does not need to pre-exist. An absent file is a no-op, so this check is free on the happy path.

```bash
SIG="$SESSION_DIR/signals"
if [ -f "$SIG/STOP" ]; then
  # Graceful stop: finish the current agent, write a waypoint, finalize honestly.
  # A user-requested stop is NOT a genuine validation — go to Step 4, write
  # execution_summary.yaml with status: interrupted, set the terminal state to
  # `incomplete` (never fabricate `complete`/VALIDATED), then STOP.
  :
elif [ -f "$SIG/PAUSE" ]; then
  # Pause: finish the current agent, write a waypoint, set `paused_at: {ISO}` in
  # status.yaml, WAIT for "$SIG/RESUME" (poll or next turn). On resume set paused_at
  # and paused_reason to null, remove PAUSE + RESUME, and continue to the next state.
  :
fi
```

Honour order: STOP wins over PAUSE. The canonical protocol lives in `.claude/rules/core/orchestration-reference.md` § Signal File Intervention Protocol, which covers the waypoint contents and the resume semantics. This step is the `/act`-loop implementation of that protocol. The config `signals.enabled: true` is therefore no longer a half-advertised feature. A user drives it with `touch cagents-memory/sessions/{SESSION_ID}/signals/{PAUSE|STOP|RESUME}`.

**3f. Agent delegation pattern** for each state spawn:

```
Agent({
  subagent_type: "cagents:{agent_from_pipeline_config}",
  description: "{state}: {brief_description}",
  prompt: `You are the {agent_name} in the event-driven pipeline.

REQUEST: {user_request}
SESSION: cagents-memory/sessions/{SESSION_ID}/
DOMAIN: {domain} | TIER: {tier}
CURRENT STATE: {current_state}

INSTRUCTIONS:
1. Read your inputs from session workflow/.
2. Perform your phase work.
3. Write outputs to session workflow/ (your primary output file is the canonical state-advancement signal — see SKILL.md for which file your state owns).`
})
```

For the **PLANNED state (controller)**, the controller is dynamic -- resolved from `plan.yaml` `controller_assignment.primary`. (v12.0.0: PROMPTS_READY removed; planner produces work_items.yaml inline and controllers fall back to standard delegation prompts.)

**Debug-mode prefix injection (V10.26.13+)**: If `flags.mode === "debug"`, read `.claude/skills/act/reference/debug-mode-prompt.md` and PREPEND its prefix text to the controller spawn prompt. See @reference/debug-mode-prompt.md.

**3g. Revision handling** after the COORDINATED state. Read `workflow/validation_report.yaml`:

| Verdict | Action |
|---------|--------|
| PASS | Advance to VALIDATED. **Loop exits -- proceed IMMEDIATELY to Step 4.** Do NOT stop. |
| FAIL | Increment `revision_cycles` (below), then route back to PLANNED. Pass validation feedback to controller. (v12.0.0: PROMPTS_READY removed; controller re-runs from PLANNED.) |
| REVISE | Increment `revision_cycles` (below), then route back to PLANNED. Pass feedback to planner. |
| BLOCKED (debug only) | Increment `revision_cycles`, then route to PLANNED with falsification annotation. |

**Revision-cycle cap (REC-11, MANDATORY, persisted).** Persist the revision counter to `status.yaml` as `revision_cycles` (re-added in REC-11; removed in v12.6.0). On EVERY FAIL/REVISE/BLOCKED verdict, BEFORE you route back to PLANNED:

1. Increment `revision_cycles` in `status.yaml`. Write it to disk. Do NOT hold it only in working memory. The `verify-completion.cjs` Stop hook reads this persisted counter, and that is how it enforces the cap mechanically.
2. Read `max_cycles` from `pipeline_config.yaml` (`revision.max_cycles`, currently **3**). This is the single revision cap. The `/goal` auto-anchor (Step 2 ACTION 4) and the Stop hook reconcile to that same value.
3. If `revision_cycles >= max_cycles`: **do NOT route back to PLANNED again.** The budget is exhausted. Escalate to the user per `pipeline_config.yaml revision.escalation: user_hitl`.

On that escalation, write `execution_summary.yaml` with `status: incomplete`, and set `status.yaml` `pipeline_state: incomplete`. NEVER fabricate `complete`, `VALIDATED`, or PASS for a capped-out session. A session that exhausted its revision budget is NOT genuinely validated. Report what completed against what remains, and STOP. The `verify-completion.cjs` hook independently detects `revision_cycles >= max_cycles`, and it finalizes instead of blocks as a backstop.

This is a mechanical cap, not a heuristic: two contradictory caps (a config `max_cycles: 3` and an ephemeral "8") are a defect. There is exactly ONE revision cap (`max_cycles`, currently 3).

> **CRITICAL: DO NOT STOP HERE.** When the loop exits at ANY terminal state, Step 4 is MANDATORY. The verify-completion.cjs Stop hook will block stopping if execution_summary.yaml is missing or auto-generated.

See @reference/state-machine-detail.md for the full protocol of the revision routing and for the BLOCKED verdict semantics.

---

## Step 4: MANDATORY -- Report Results and Clean Up

This step MUST execute after the state machine loop exits. Not optional, not deferrable, not handled by any hook.

- [ ] **4.1**. Read final state from status.yaml
- [ ] **4.2**. (v12.6.0: removed. `duration_ms` is no longer emitted to state_history. Skip this step.)
- [ ] **4.3**. Write `execution_summary.yaml` -- MANDATORY even on failure or interruption. Write this BEFORE anything else. The verify-completion.cjs hook creates a stub if you forget, but that triggers a warning visible to the user.

```yaml
session_id: {SESSION_ID}
final_state: VALIDATED  # or FAILED, INTERRUPTED
status: completed | failed | interrupted
states_executed: [INIT, ORCHESTRATED, PLANNED, COORDINATED, VALIDATED]
states_skipped: [{list}]
total_agents_spawned: {count}
started_at: "{ISO_TIMESTAMP}"
completed_at: "{ISO_TIMESTAMP}"
```

Note: v12.6.0 dropped `revision_rounds_used` and `total_duration_ms` from execution_summary.yaml (external-UI-only fields).

- [ ] **4.4**. Update status.yaml to terminal state (`complete` or `failed`).
- [ ] **4.5**. Append session metrics to `cagents-memory/_system/metrics/pipeline_analytics.yaml`. Recalculate aggregates (success_rate, avg_duration, by_domain, by_tier). Keep the last 500 sessions in the log; archive older entries.
- [ ] **4.6**. Clean up tasks: call `TaskList`, mark ALL session tasks as `completed` or `deleted` via `TaskUpdate`. Never leave stale in_progress tasks.
- [ ] **4.7**. Pre-stop verification: confirm that `execution_summary.yaml` exists. If a controller ran, confirm that `coordination_log.yaml` has self_validation and validation_checkpoints blocks. Confirm that `status.yaml` is in a terminal state, and that no stale tasks remain.
- [ ] **4.8**. Report results to the user with final pipeline state, revision count, key deliverables, and any validation warnings.

If the pipeline failed after max revisions, report what completed against what remains. Suggest `/act --resume {SESSION_ID}`. Make sure that `workflow/recovery_state.yaml` captures the phase, the domain, and the controller. That file must also capture the pending and in-progress work items. The `stop-failure-handler.cjs` hook writes that file on incomplete sessions.

---

## Step 5: Follow-Up Handling

After reporting results, the pipeline enters a listening state. User follow-ups in the same conversation re-enter execution within the SAME session rather than starting a new one.

Classify the follow-up (adjustment, rework, extension, fix, review) and re-enter the pipeline at the appropriate state. No limit on follow-up rounds.

See @reference/followup-handling.md for the full classification rubric, re-entry procedure, status.yaml/execution_summary.yaml schema additions, and controller follow-up prompt format.

---

## Team Mode (--team flag)

For team mode, after completing routing + planning inline, delegate to `/team`:

```
Skill({ skill: "team", args: "{request} --session {SESSION_DIR}" })
```

The /team skill handles decomposition into work items, team creation, and parallel execution. Each subagent invokes `/act --session {SESSION_DIR}` which detects pre-enrichment and picks up from the appropriate state.

If `--dry-run` with `--team`: Display plan summary and team composition, then STOP.

---

## What /act Does Directly vs Delegates

| /act does directly | /act delegates |
|--------------------|----------------|
| Parse flags, create session dir, write instruction.yaml + status.yaml | Orchestrator (level 1) -> enriched_context.yaml |
| Load pipeline_config, read strategic_brief.yaml | Universal-planner (level 1) -> plan.yaml + work_items.yaml (decomposition inline, v12.0.0) |
| Domain detection + tier classification (inline) | Controller (level 1, dynamic) -> coordination_log.yaml |
| Track state transitions in status.yaml state_history (entered_at only; v12.6.0 dropped duration_ms) | Universal-validator (level 1) -> validation_report.yaml |
| (v12.6.0: events/index.yaml emission removed. workflow/events/ is no longer maintained) | Execution agents (level 2, via controller): implementation work |
| Always write execution_summary.yaml | Reviewer (level 2, via controller): acceptance criteria review |
| Call TaskCreate/TaskUpdate at every transition | |
| Spawn pipeline agents via Agent tool | |
| Read agent output files, handle revision routing | |
| Validate final state, report results | |

See @reference/delegation-workaround.md for notes on the Task vs Agent tool naming.

## Error Handling

If an agent fails or returns incomplete:
1. Check for partial results in session workflow/
2. Check for the agent's primary output file (enriched_context.yaml / plan.yaml / coordination_log.yaml / validation_report.yaml)
3. If no output: retry agent once with reduced scope
4. If retry fails: ensure `workflow/recovery_state.yaml` exists (written by `stop-failure-handler.cjs`), suggest `--resume {SESSION_ID}`

If context is exhausted mid-workflow:
1. Session state is preserved in cagents-memory/sessions/
2. The pre-compact-save hook automatically creates the waypoints
3. User can resume with `/act --resume {SESSION_ID}`
4. Resume detects completed states from status.yaml state_history and primary output files, and skips them

## Configuration

| Path | Purpose |
|------|---------|
| `cagents-memory/_system/config/pipeline_config.yaml` | Pipeline state machine (optional, generated at runtime) |
| `{domain}/config/planner_config.yaml` | Per-domain planner config |
| `cagents-memory/_system/templates/event.yaml` | Event template |
| `cagents-memory/sessions/act_{slug}_{YYMMDD}_{NNN}/` | Session folder |
| `cagents-memory/sessions/{session_id}/workflow/agent_tree.yaml` | Audit trail |
| `cagents-memory/_system/logs/agent_spawns.log` | Global audit log |
| `cagents-memory/_system/metrics/pipeline_analytics.yaml` | Pipeline analytics |

---

**Event-driven pipeline: Config-driven state machine with sequential enrichment, nested execution with reviewer loops, and revision routing. TaskCreate/TaskUpdate at every state transition.**
Pliki w paczce (20)
  • SKILL.md 31 KB
  • reference/adaptive-pipeline.md 5 KB
  • reference/agent-tracking.md 9 KB
  • reference/context-passthrough.md 4 KB
  • reference/debug-mode-prompt.md 2 KB
  • reference/delegation-patterns.md 6 KB
  • reference/delegation-workaround.md 4 KB
  • reference/domain-coverage.md 3 KB
  • reference/flags.md 6 KB
  • reference/followup-handling.md 5 KB
  • reference/improve-mode.md 7 KB
  • reference/improve-optimization-types.md 3 KB
  • reference/improve-pattern-effectiveness.md 3 KB
  • reference/improve-risk-classification.md 4 KB
  • reference/session-id-format.md 4 KB
  • reference/session-schema.md 12 KB
  • reference/skill-awareness.md 7 KB
  • reference/state-machine-detail.md 9 KB
  • reference/strategic-brief-integration.md 4 KB
  • reference/task-tracking-rules.md 9 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · caelandrayer/cagents100MIT
TerminalSkills/skills100Apache-2.0
apideck-libraries/api-skills100Apache-2.0
vinnie357/claude-skills100MIT
gkhairallah/aios-template100MIT

Migawka bazy z 13.11.2026 · wersja paczki 81ca43920b61 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100team
    Koordynuje wielu agentów równolegle w falach z bramkami jakości, przy zadaniach z co najmniej trzema niezależnymi częściami.
  • 90implement-team
    Wykonuje plan wdrożenia równolegle przez podagentów dla niezależnych kroków, gdy zespół agentów ma przyspieszyć pracę.
  • 100team
    Koordynuje kilku agentów na wspólnej liście zadań z etapowym potokiem, gdy praca ma iść równolegle.
  • 90implement
    Prowadzi pisanie kodu, budowanie funkcji, naprawę błędów, refaktoryzację i wieloetapową pracę implementacyjną.
  • 100azure-maestro
    Klasyfikuje zadanie, dobiera z katalogu agenta-specjalistę Azure albo zespół do czterech agentów równolegle i uruchamia go, a agentów live-guard zawsze wstrzymuje do potwierdzenia przez człowieka.
  • 100codex
    Deleguje zadania programistyczne do agenta OpenAI Codex CLI: budowanie funkcji, refaktoryzacja, przeglądy PR i hurtowe naprawianie zgłoszeń.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.