From 336f3c72de52c1c2096111e42e5c6d87194fc536 Mon Sep 17 00:00:00 2001 From: beo3000 Date: Sat, 21 Mar 2026 10:14:18 +0100 Subject: [PATCH] feat: add batch orchestration rules Co-Authored-By: Claude Opus 4.6 (1M context) --- rules/batch-orchestration.md | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 rules/batch-orchestration.md diff --git a/rules/batch-orchestration.md b/rules/batch-orchestration.md new file mode 100644 index 0000000..27261d7 --- /dev/null +++ b/rules/batch-orchestration.md @@ -0,0 +1,38 @@ +# Batch Orchestration Rules + +## Orchestrator Constraints +- The orchestrator only reads task.md and subagent summaries — never full output files +- The orchestrator only processes tasks from the active phase (defined in CLAUDE.md "Aktiver Scope") +- Shared state files (status.md, decisions-log.md, task.md) are only written by the orchestrator, never by subagents +- Phase-specific shared artifacts (e.g., capabilities-inventory.md) are updated only by the orchestrator during consolidation +- The orchestrator never triggers /project:phase-transition or starts tasks from the next phase +- When all DoD items of the active phase are complete: hard stop, inform user +- Missing batch parameters (items, checkpoint mode) are always queried interactively before starting + +## Subagent Constraints +- Each subagent writes only its own assigned output file +- Subagents never write to task.md, status.md, decisions-log.md, or CLAUDE.md +- Each subagent returns a 2-3 sentence summary as its return value + +## Task Parsing +- The orchestrator parses the first section in task.md that contains ### sub-headings with - [ ] checkboxes (the work section) +- Flat checkbox lists without sub-headings are treated as Definition of Done and ignored for dispatching +- Tasks under the same ### heading form a parallelization group (can run concurrently) +- Tasks under different ### headings are sequential (Group N+1 starts after Group N completes and checkpoint passes) + +## Context Loading +- Base context (always): project rules of active phase + status.md +- Phase-specific context: follow phase rules if they define context requirements (e.g., discovery-waves.md) +- Task-specific context: if task declares (context: file1, file2), load those; otherwise load output files from prior groups +- Prefer condensed documents over raw sources + +## Checkpoint Modes +- after-each (default): pause after each group, show summaries, wait for user input +- after-batch:N: run N groups, then pause +- at-end: run all groups, consolidated review at end +- Phase boundary: always a hard stop regardless of selected mode + +## Error Handling +- On subagent failure: mark task as failed in checkpoint summary, do not block other parallel tasks in the same group +- Failed tasks stay - [ ] in task.md (not marked as completed) +- Failures are reported at the next checkpoint with the error details