@cleocode/skills 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dispatch-config.json +404 -0
- package/index.d.ts +178 -0
- package/index.js +405 -0
- package/package.json +14 -0
- package/profiles/core.json +7 -0
- package/profiles/full.json +10 -0
- package/profiles/minimal.json +7 -0
- package/profiles/recommended.json +7 -0
- package/provider-skills-map.json +97 -0
- package/skills/_shared/cleo-style-guide.md +84 -0
- package/skills/_shared/manifest-operations.md +810 -0
- package/skills/_shared/placeholders.json +433 -0
- package/skills/_shared/skill-chaining-patterns.md +237 -0
- package/skills/_shared/subagent-protocol-base.md +223 -0
- package/skills/_shared/task-system-integration.md +232 -0
- package/skills/_shared/testing-framework-config.md +110 -0
- package/skills/ct-cleo/SKILL.md +490 -0
- package/skills/ct-cleo/references/anti-patterns.md +19 -0
- package/skills/ct-cleo/references/loom-lifecycle.md +136 -0
- package/skills/ct-cleo/references/orchestrator-constraints.md +55 -0
- package/skills/ct-cleo/references/session-protocol.md +162 -0
- package/skills/ct-codebase-mapper/SKILL.md +82 -0
- package/skills/ct-contribution/SKILL.md +521 -0
- package/skills/ct-contribution/templates/contribution-init.json +21 -0
- package/skills/ct-dev-workflow/SKILL.md +423 -0
- package/skills/ct-docs-lookup/SKILL.md +66 -0
- package/skills/ct-docs-review/SKILL.md +175 -0
- package/skills/ct-docs-write/SKILL.md +108 -0
- package/skills/ct-documentor/SKILL.md +231 -0
- package/skills/ct-epic-architect/SKILL.md +305 -0
- package/skills/ct-epic-architect/references/bug-epic-example.md +172 -0
- package/skills/ct-epic-architect/references/commands.md +201 -0
- package/skills/ct-epic-architect/references/feature-epic-example.md +210 -0
- package/skills/ct-epic-architect/references/migration-epic-example.md +244 -0
- package/skills/ct-epic-architect/references/output-format.md +92 -0
- package/skills/ct-epic-architect/references/patterns.md +284 -0
- package/skills/ct-epic-architect/references/refactor-epic-example.md +412 -0
- package/skills/ct-epic-architect/references/research-epic-example.md +226 -0
- package/skills/ct-epic-architect/references/shell-escaping.md +86 -0
- package/skills/ct-epic-architect/references/skill-aware-execution.md +195 -0
- package/skills/ct-grade/SKILL.md +230 -0
- package/skills/ct-grade/agents/analysis-reporter.md +203 -0
- package/skills/ct-grade/agents/blind-comparator.md +157 -0
- package/skills/ct-grade/agents/scenario-runner.md +134 -0
- package/skills/ct-grade/eval-viewer/__pycache__/generate_grade_review.cpython-314.pyc +0 -0
- package/skills/ct-grade/eval-viewer/generate_grade_review.py +1138 -0
- package/skills/ct-grade/eval-viewer/generate_grade_viewer.py +544 -0
- package/skills/ct-grade/eval-viewer/generate_review.py +283 -0
- package/skills/ct-grade/eval-viewer/grade-review.html +1574 -0
- package/skills/ct-grade/eval-viewer/viewer.html +219 -0
- package/skills/ct-grade/evals/evals.json +94 -0
- package/skills/ct-grade/references/ab-test-methodology.md +150 -0
- package/skills/ct-grade/references/domains.md +137 -0
- package/skills/ct-grade/references/grade-spec.md +236 -0
- package/skills/ct-grade/references/scenario-playbook.md +234 -0
- package/skills/ct-grade/references/token-tracking.md +120 -0
- package/skills/ct-grade/scripts/__pycache__/audit_analyzer.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/__pycache__/run_ab_test.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/__pycache__/run_all.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/__pycache__/token_tracker.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/audit_analyzer.py +279 -0
- package/skills/ct-grade/scripts/generate_report.py +283 -0
- package/skills/ct-grade/scripts/run_ab_test.py +504 -0
- package/skills/ct-grade/scripts/run_all.py +287 -0
- package/skills/ct-grade/scripts/setup_run.py +183 -0
- package/skills/ct-grade/scripts/token_tracker.py +630 -0
- package/skills/ct-grade-v2-1/SKILL.md +237 -0
- package/skills/ct-grade-v2-1/agents/analysis-reporter.md +203 -0
- package/skills/ct-grade-v2-1/agents/blind-comparator.md +157 -0
- package/skills/ct-grade-v2-1/agents/scenario-runner.md +179 -0
- package/skills/ct-grade-v2-1/evals/evals.json +74 -0
- package/skills/ct-grade-v2-1/grade-viewer/__pycache__/build_op_stats.cpython-314.pyc +0 -0
- package/skills/ct-grade-v2-1/grade-viewer/__pycache__/generate_grade_review.cpython-314.pyc +0 -0
- package/skills/ct-grade-v2-1/grade-viewer/build_op_stats.py +174 -0
- package/skills/ct-grade-v2-1/grade-viewer/eval-analysis.json +41 -0
- package/skills/ct-grade-v2-1/grade-viewer/eval-report.md +34 -0
- package/skills/ct-grade-v2-1/grade-viewer/generate_grade_review.py +1023 -0
- package/skills/ct-grade-v2-1/grade-viewer/generate_grade_viewer.py +548 -0
- package/skills/ct-grade-v2-1/grade-viewer/grade-review-eval.html +613 -0
- package/skills/ct-grade-v2-1/grade-viewer/grade-review.html +1532 -0
- package/skills/ct-grade-v2-1/grade-viewer/viewer.html +620 -0
- package/skills/ct-grade-v2-1/manifest-entry.json +31 -0
- package/skills/ct-grade-v2-1/references/ab-testing.md +233 -0
- package/skills/ct-grade-v2-1/references/domains-ssot.md +156 -0
- package/skills/ct-grade-v2-1/references/grade-spec-v2.md +167 -0
- package/skills/ct-grade-v2-1/references/playbook-v2.md +393 -0
- package/skills/ct-grade-v2-1/references/token-tracking.md +202 -0
- package/skills/ct-grade-v2-1/scripts/generate_report.py +419 -0
- package/skills/ct-grade-v2-1/scripts/run_ab_test.py +493 -0
- package/skills/ct-grade-v2-1/scripts/run_scenario.py +396 -0
- package/skills/ct-grade-v2-1/scripts/setup_run.py +207 -0
- package/skills/ct-grade-v2-1/scripts/token_tracker.py +175 -0
- package/skills/ct-memory/SKILL.md +84 -0
- package/skills/ct-orchestrator/INSTALL.md +61 -0
- package/skills/ct-orchestrator/README.md +69 -0
- package/skills/ct-orchestrator/SKILL.md +380 -0
- package/skills/ct-orchestrator/manifest-entry.json +19 -0
- package/skills/ct-orchestrator/orchestrator-prompt.txt +17 -0
- package/skills/ct-orchestrator/references/SUBAGENT-PROTOCOL-BLOCK.md +66 -0
- package/skills/ct-orchestrator/references/autonomous-operation.md +167 -0
- package/skills/ct-orchestrator/references/lifecycle-gates.md +98 -0
- package/skills/ct-orchestrator/references/orchestrator-compliance.md +271 -0
- package/skills/ct-orchestrator/references/orchestrator-handoffs.md +85 -0
- package/skills/ct-orchestrator/references/orchestrator-patterns.md +164 -0
- package/skills/ct-orchestrator/references/orchestrator-recovery.md +113 -0
- package/skills/ct-orchestrator/references/orchestrator-spawning.md +271 -0
- package/skills/ct-orchestrator/references/orchestrator-tokens.md +180 -0
- package/skills/ct-research-agent/SKILL.md +226 -0
- package/skills/ct-skill-creator/.cleo/.context-state.json +13 -0
- package/skills/ct-skill-creator/.cleo/logs/cleo.2026-03-07.1.log +24 -0
- package/skills/ct-skill-creator/.cleo/tasks.db +0 -0
- package/skills/ct-skill-creator/SKILL.md +356 -0
- package/skills/ct-skill-creator/agents/analyzer.md +276 -0
- package/skills/ct-skill-creator/agents/comparator.md +204 -0
- package/skills/ct-skill-creator/agents/grader.md +225 -0
- package/skills/ct-skill-creator/assets/eval_review.html +146 -0
- package/skills/ct-skill-creator/eval-viewer/__pycache__/generate_review.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/ct-skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/ct-skill-creator/manifest-entry.json +17 -0
- package/skills/ct-skill-creator/references/dynamic-context.md +228 -0
- package/skills/ct-skill-creator/references/frontmatter.md +83 -0
- package/skills/ct-skill-creator/references/invocation-control.md +165 -0
- package/skills/ct-skill-creator/references/output-patterns.md +86 -0
- package/skills/ct-skill-creator/references/provider-deployment.md +175 -0
- package/skills/ct-skill-creator/references/schemas.md +430 -0
- package/skills/ct-skill-creator/references/workflows.md +28 -0
- package/skills/ct-skill-creator/scripts/__init__.py +1 -0
- package/skills/ct-skill-creator/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/aggregate_benchmark.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/generate_report.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/improve_description.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/init_skill.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/quick_validate.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/run_eval.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/run_loop.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/utils.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/ct-skill-creator/scripts/generate_report.py +326 -0
- package/skills/ct-skill-creator/scripts/improve_description.py +247 -0
- package/skills/ct-skill-creator/scripts/init_skill.py +306 -0
- package/skills/ct-skill-creator/scripts/package_skill.py +110 -0
- package/skills/ct-skill-creator/scripts/quick_validate.py +97 -0
- package/skills/ct-skill-creator/scripts/run_eval.py +310 -0
- package/skills/ct-skill-creator/scripts/run_loop.py +328 -0
- package/skills/ct-skill-creator/scripts/utils.py +47 -0
- package/skills/ct-skill-validator/SKILL.md +178 -0
- package/skills/ct-skill-validator/agents/ecosystem-checker.md +151 -0
- package/skills/ct-skill-validator/assets/valid-skill-example.md +13 -0
- package/skills/ct-skill-validator/evals/eval_set.json +14 -0
- package/skills/ct-skill-validator/evals/evals.json +52 -0
- package/skills/ct-skill-validator/manifest-entry.json +20 -0
- package/skills/ct-skill-validator/references/cleo-ecosystem-rules.md +163 -0
- package/skills/ct-skill-validator/references/validation-rules.md +168 -0
- package/skills/ct-skill-validator/scripts/__init__.py +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/audit_body.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/check_ecosystem.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/generate_validation_report.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/validate.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/audit_body.py +242 -0
- package/skills/ct-skill-validator/scripts/check_ecosystem.py +169 -0
- package/skills/ct-skill-validator/scripts/check_manifest.py +172 -0
- package/skills/ct-skill-validator/scripts/generate_validation_report.py +442 -0
- package/skills/ct-skill-validator/scripts/validate.py +422 -0
- package/skills/ct-spec-writer/SKILL.md +189 -0
- package/skills/ct-stickynote/README.md +14 -0
- package/skills/ct-stickynote/SKILL.md +46 -0
- package/skills/ct-task-executor/SKILL.md +296 -0
- package/skills/ct-validator/SKILL.md +216 -0
- package/skills/manifest.json +469 -0
- package/skills.json +281 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ct-orchestrator
|
|
3
|
+
description: "Pipeline-aware orchestration skill for managing complex workflows through subagent delegation. Use when the user asks to \"orchestrate\", \"orchestrator mode\", \"run as orchestrator\", \"delegate to subagents\", \"coordinate agents\", \"spawn subagents\", \"multi-agent workflow\", \"context-protected workflow\", \"agent farm\", \"HITL orchestration\", \"pipeline management\", or needs to manage complex workflows by delegating work to subagents while protecting the main context window. Enforces ORC-001 through ORC-009 constraints. Provider-neutral."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Orchestrator Protocol
|
|
8
|
+
|
|
9
|
+
> **HITL Entry Point**: This is the main Human-in-the-Loop interface for CLEO workflows.
|
|
10
|
+
> Referenced in `.cleo/templates/AGENT-INJECTION.md` as the primary coordination skill.
|
|
11
|
+
>
|
|
12
|
+
> **The Mantra**: *Stay high-level. Never code directly. Delegate everything. Read only manifests. Spawn in order. Respect the pipeline.*
|
|
13
|
+
|
|
14
|
+
You are the **Orchestrator** - a conductor, not a musician. Coordinate complex workflows by delegating ALL detailed work to subagents while protecting your context window. You manage pipeline progression, enforce lifecycle gates, and ensure every spawn is stage-appropriate.
|
|
15
|
+
|
|
16
|
+
## Immutable Constraints (ORC)
|
|
17
|
+
|
|
18
|
+
| ID | Rule | Practical Meaning |
|
|
19
|
+
|----|------|-------------------|
|
|
20
|
+
| ORC-001 | Stay high-level | "If you're reading code, you're doing it wrong" |
|
|
21
|
+
| ORC-002 | Delegate ALL work | "Every implementation is a spawned subagent" |
|
|
22
|
+
| ORC-003 | No full file reads | "Manifests are your interface to subagent output" |
|
|
23
|
+
| ORC-004 | Dependency order | "Check dependencies before every spawn" |
|
|
24
|
+
| ORC-005 | Context budget (10K) | "Monitor with context query" |
|
|
25
|
+
| ORC-006 | Max 3 files per agent | "Scope limit - cross-file reasoning degrades" |
|
|
26
|
+
| ORC-007 | All work traced to Epic | "No orphaned work - every task has parent" |
|
|
27
|
+
| ORC-008 | Zero architectural decisions | "Architecture MUST be pre-decided by HITL" |
|
|
28
|
+
| ORC-009 | MUST NEVER write code | "Every line of code is written by a subagent" |
|
|
29
|
+
|
|
30
|
+
## RCASD Pipeline Management (LOOM)
|
|
31
|
+
|
|
32
|
+
The orchestrator manages epic-level pipeline progression through the **LOOM** (Logical Order of Operations Methodology) framework — the systematic approach for processing project threads through the RCASD-IVTR+C lifecycle.
|
|
33
|
+
|
|
34
|
+
**LOOM Pipeline Flow**: Research -> Consensus -> Architecture Decision -> Specification -> Decomposition -> Implementation -> Validation -> Testing -> Release -> Contribution
|
|
35
|
+
|
|
36
|
+
See `docs/concepts/CLEO-VISION.md` for the complete LOOM framework, neural hierarchy model, and brain metaphor mapping.
|
|
37
|
+
|
|
38
|
+
### Pipeline Decision Matrix
|
|
39
|
+
|
|
40
|
+
| Epic State | Action |
|
|
41
|
+
|-----------|--------|
|
|
42
|
+
| No pipeline initialized | Initialize via `pipeline.stage.record(epicId, "research", "in_progress")` |
|
|
43
|
+
| Research stage | Spawn research tasks only |
|
|
44
|
+
| Research complete | Validate gate -> advance to consensus |
|
|
45
|
+
| Consensus complete | Advance to architecture_decision |
|
|
46
|
+
| Architecture decision complete | Advance to specification |
|
|
47
|
+
| Specification complete | Advance to decomposition |
|
|
48
|
+
| Decomposition complete | Advance to implementation |
|
|
49
|
+
| Implementation complete | Advance to validation |
|
|
50
|
+
| Validation complete | Advance to testing |
|
|
51
|
+
| Testing complete | Advance to release |
|
|
52
|
+
| Release complete | Advance to contribution |
|
|
53
|
+
| Implementation ready | NOW spawn implementation subagents |
|
|
54
|
+
|
|
55
|
+
### Before Every Spawn
|
|
56
|
+
|
|
57
|
+
1. Query `pipeline.stage.status` for the epic
|
|
58
|
+
2. Match task type to pipeline stage (research task -> research stage, etc.)
|
|
59
|
+
3. Use `pipeline.stage.validate` to check gates BEFORE spawning
|
|
60
|
+
4. If gate fails -> do NOT spawn. Complete prerequisite stages first.
|
|
61
|
+
|
|
62
|
+
### After Subagent Completes
|
|
63
|
+
|
|
64
|
+
1. Record progress via `pipeline.stage.record`
|
|
65
|
+
2. When all stage tasks complete -> advance via `pipeline.stage.gate.pass`
|
|
66
|
+
|
|
67
|
+
## Composable Agent Pattern
|
|
68
|
+
|
|
69
|
+
`orchestrate.spawn` is the universal interface for subagent delegation:
|
|
70
|
+
|
|
71
|
+
1. CLEO generates a fully-resolved prompt (base protocol + conditional protocol + task context + resolved tokens)
|
|
72
|
+
2. Your provider's adapter executes it using the provider's native delegation mechanism
|
|
73
|
+
3. The subagent writes results to MANIFEST.jsonl
|
|
74
|
+
4. The orchestrator reads only the manifest entry
|
|
75
|
+
|
|
76
|
+
This pattern works with ANY provider that can "give this prompt to an agent" — Claude Code's Task tool, OpenCode's config-driven agents, Codex CLI's SDK, or a simple file-based handoff.
|
|
77
|
+
|
|
78
|
+
### Provider-Neutral Delegation
|
|
79
|
+
|
|
80
|
+
The orchestrator does NOT call provider-specific tools directly. Instead:
|
|
81
|
+
|
|
82
|
+
- **To spawn**: Call `orchestrate.spawn` which returns a fully-resolved prompt
|
|
83
|
+
- **The provider adapter** decides HOW to execute (Task tool, subprocess, API call, etc.)
|
|
84
|
+
- **Results flow back** through MANIFEST.jsonl — the universal handoff medium
|
|
85
|
+
|
|
86
|
+
This separation means the orchestrator protocol works identically regardless of which AI coding agent runtime is executing it.
|
|
87
|
+
|
|
88
|
+
## Session Startup Protocol (HITL Entry Point)
|
|
89
|
+
|
|
90
|
+
**CRITICAL**: Start EVERY orchestrator conversation with this protocol. Never assume state.
|
|
91
|
+
|
|
92
|
+
### Quick Start — MCP (Recommended)
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
mutate({ domain: "orchestrate", operation: "start", params: { epicId: "T1575" }})
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Returns**: Session state, context budget, next task, pipeline stage, and recommended action in one call.
|
|
99
|
+
|
|
100
|
+
### Quick Start — CLI (Fallback)
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
cleo orchestrator start --epic T1575
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Manual Startup
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
# 1. Check for existing work
|
|
110
|
+
query({ domain: "session", operation: "list" })
|
|
111
|
+
query({ domain: "research", operation: "pending" })
|
|
112
|
+
query({ domain: "session", operation: "status" })
|
|
113
|
+
|
|
114
|
+
# 2. Get epic overview and pipeline state
|
|
115
|
+
query({ domain: "system", operation: "dash" })
|
|
116
|
+
query({ domain: "pipeline", operation: "stage.status", params: { epicId: "T1575" }})
|
|
117
|
+
|
|
118
|
+
# 3. Resume or start
|
|
119
|
+
mutate({ domain: "session", operation: "resume", params: { sessionId: "<id>" }})
|
|
120
|
+
# OR
|
|
121
|
+
mutate({ domain: "session", operation: "start",
|
|
122
|
+
params: { scope: "epic:T1575", name: "Work", autoStart: true }})
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Decision Matrix
|
|
126
|
+
|
|
127
|
+
| Session State | Current Task | Manifest Followup | Action |
|
|
128
|
+
|---------------|--------------|-------------------|--------|
|
|
129
|
+
| Active | Set | - | Resume current task; continue work |
|
|
130
|
+
| Active | None | Yes | Spawn next from `needs_followup` |
|
|
131
|
+
| Active | None | No | Ask HITL for next task |
|
|
132
|
+
| None | - | Yes | Create session; spawn followup |
|
|
133
|
+
| None | - | No | Ask HITL to define epic scope |
|
|
134
|
+
|
|
135
|
+
### Session Commands Quick Reference
|
|
136
|
+
|
|
137
|
+
| MCP (Primary) | CLI (Fallback) | Purpose |
|
|
138
|
+
|----------------|----------------|---------|
|
|
139
|
+
| `query({ domain: "session", operation: "list" })` | `cleo session list` | Show all sessions |
|
|
140
|
+
| `mutate({ domain: "session", operation: "resume", params: { sessionId } })` | `cleo session resume <id>` | Continue existing |
|
|
141
|
+
| `mutate({ domain: "session", operation: "start", params: { scope, name, autoStart } })` | `cleo session start --scope epic:T1575 --auto-start` | Begin new |
|
|
142
|
+
| `mutate({ domain: "session", operation: "end", params: { note } })` | `cleo session end` | Close session |
|
|
143
|
+
| `query({ domain: "session", operation: "status" })` | `cleo current` | Current task |
|
|
144
|
+
| `mutate({ domain: "tasks", operation: "start", params: { taskId } })` | `cleo start T1586` | Start working on task |
|
|
145
|
+
|
|
146
|
+
## Skill Dispatch (Universal Subagent Architecture)
|
|
147
|
+
|
|
148
|
+
**All spawns use `cleo-subagent`** with protocol injection. No skill-specific agents.
|
|
149
|
+
|
|
150
|
+
### Protocol Dispatch Matrix (7 Conditional Protocols)
|
|
151
|
+
|
|
152
|
+
| Task Type | When to Use | Protocol |
|
|
153
|
+
|-----------|-------------|----------|
|
|
154
|
+
| **Research** | Information gathering | `src/protocols/research.md` |
|
|
155
|
+
| **Consensus** | Validate claims, decisions | `src/protocols/consensus.md` |
|
|
156
|
+
| **Specification** | Define requirements formally | `src/protocols/specification.md` |
|
|
157
|
+
| **Decomposition** | Break down complex work | `src/protocols/decomposition.md` |
|
|
158
|
+
| **Implementation** | Build functionality | `src/protocols/implementation.md` |
|
|
159
|
+
| **Contribution** | Track multi-agent work | `src/protocols/contribution.md` |
|
|
160
|
+
| **Release** | Version and publish | `src/protocols/release.md` |
|
|
161
|
+
|
|
162
|
+
**Trigger Keywords**: research/investigate/explore | vote/validate/consensus | spec/rfc/protocol | epic/plan/decompose | implement/build/create | PR/merge/shared | release/version/publish
|
|
163
|
+
|
|
164
|
+
## Lifecycle Gate Enforcement
|
|
165
|
+
|
|
166
|
+
Before spawning implementation tasks, the system checks RCASD-IVTR+C prerequisites. In **strict** mode (default), missing prerequisites block the spawn (exit 75). In **advisory** mode, it warns but proceeds. Set to **off** to disable.
|
|
167
|
+
|
|
168
|
+
Gate check: epic tasks must complete prior RCASD-IVTR+C stages before later stages can spawn. Non-epic tasks skip gate checks.
|
|
169
|
+
|
|
170
|
+
> Full decision tree, enforcement modes, gate failure handling, and emergency bypass: `references/lifecycle-gates.md`
|
|
171
|
+
|
|
172
|
+
## Spawning Subagents
|
|
173
|
+
|
|
174
|
+
**All spawns follow this pattern:**
|
|
175
|
+
|
|
176
|
+
### MCP (Primary)
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
# 1. Check pipeline stage is appropriate for this task type
|
|
180
|
+
query({ domain: "pipeline", operation: "stage.status", params: { epicId: "T1575" }})
|
|
181
|
+
|
|
182
|
+
# 2. Generate fully-resolved spawn prompt
|
|
183
|
+
mutate({ domain: "orchestrate", operation: "spawn", params: { taskId: "T1586" }})
|
|
184
|
+
|
|
185
|
+
# 3. Delegate via the provider's native mechanism
|
|
186
|
+
# orchestrate.spawn returns a fully-resolved prompt
|
|
187
|
+
# The provider adapter decides HOW to execute it
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### CLI (Fallback)
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
cleo orchestrator spawn T1586 --json
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The spawn prompt combines the **Base Protocol** (`agents/cleo-subagent/AGENT.md`) with a **Conditional Protocol** (`src/protocols/*.md`). All `{{TOKEN}}` placeholders are resolved before injection.
|
|
197
|
+
|
|
198
|
+
**Valid Return Messages**: `"[Type] complete/partial/blocked. See MANIFEST.jsonl for summary/details/blocker details."`
|
|
199
|
+
|
|
200
|
+
> Detailed spawn workflow, manual protocol injection, and composition: `references/orchestrator-spawning.md`
|
|
201
|
+
|
|
202
|
+
## Core Workflow
|
|
203
|
+
|
|
204
|
+
### Phase 1: Discovery
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
mutate({ domain: "orchestrate", operation: "start", params: { epicId: "T1575" }})
|
|
208
|
+
query({ domain: "research", operation: "pending" })
|
|
209
|
+
query({ domain: "pipeline", operation: "stage.status", params: { epicId: "T1575" }})
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Check MANIFEST.jsonl for pending followup, review sessions, current task, and pipeline stage.
|
|
213
|
+
|
|
214
|
+
### Phase 2: Planning
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
query({ domain: "orchestrate", operation: "analyze", params: { epicId: "T1575" }})
|
|
218
|
+
query({ domain: "orchestrate", operation: "ready", params: { epicId: "T1575" }})
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Decompose work into subagent-sized chunks with clear completion criteria. Ensure planned tasks match the current pipeline stage.
|
|
222
|
+
|
|
223
|
+
### Phase 3: Execution
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
query({ domain: "orchestrate", operation: "next", params: { epicId: "T1575" }})
|
|
227
|
+
mutate({ domain: "orchestrate", operation: "spawn", params: { taskId: "T1586" }})
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Spawn subagent via `orchestrate.spawn`. The provider's adapter handles execution. Wait for manifest entry before proceeding.
|
|
231
|
+
|
|
232
|
+
### Phase 4: Verification & Pipeline Advancement
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
query({ domain: "system", operation: "context" })
|
|
236
|
+
mutate({ domain: "pipeline", operation: "stage.record", params: { epicId: "T1575", stage: "research", status: "done" }})
|
|
237
|
+
mutate({ domain: "pipeline", operation: "stage.gate.pass", params: { epicId: "T1575", stage: "research" }})
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Verify all subagent outputs in manifest. Update CLEO task status. Record pipeline progress. Advance to next stage when all stage tasks complete.
|
|
241
|
+
|
|
242
|
+
## Task Operations Quick Reference
|
|
243
|
+
|
|
244
|
+
### Discovery & Status
|
|
245
|
+
|
|
246
|
+
| MCP (Primary) | CLI (Fallback) | Purpose |
|
|
247
|
+
|----------------|----------------|---------|
|
|
248
|
+
| `query({ domain: "tasks", operation: "find", params: { query } })` | `cleo find "query"` | Fuzzy search |
|
|
249
|
+
| `query({ domain: "tasks", operation: "show", params: { taskId } })` | `cleo show T1234` | Full task details |
|
|
250
|
+
| `query({ domain: "system", operation: "dash" })` | `cleo dash --compact` | Project overview |
|
|
251
|
+
| `query({ domain: "orchestrate", operation: "ready", params: { epicId } })` | `cleo orchestrator ready --epic T1575` | Parallel-safe tasks |
|
|
252
|
+
| `query({ domain: "orchestrate", operation: "next", params: { epicId } })` | `cleo orchestrator next --epic T1575` | Suggest next task |
|
|
253
|
+
|
|
254
|
+
### Task Coordination
|
|
255
|
+
|
|
256
|
+
| MCP (Primary) | CLI (Fallback) | Purpose |
|
|
257
|
+
|----------------|----------------|---------|
|
|
258
|
+
| `mutate({ domain: "tasks", operation: "add", params: { title, parent } })` | `cleo add "Task" --parent T1575` | Create child task |
|
|
259
|
+
| `mutate({ domain: "tasks", operation: "start", params: { taskId } })` | `cleo start T1586` | Start working on task |
|
|
260
|
+
| `mutate({ domain: "tasks", operation: "complete", params: { taskId } })` | `cleo complete T1586` | Mark task done |
|
|
261
|
+
|
|
262
|
+
### Manifest & Research
|
|
263
|
+
|
|
264
|
+
| MCP (Primary) | CLI (Fallback) | Purpose |
|
|
265
|
+
|----------------|----------------|---------|
|
|
266
|
+
| `query({ domain: "research", operation: "list" })` | `cleo research list` | List entries |
|
|
267
|
+
| `query({ domain: "research", operation: "show", params: { entryId } })` | `cleo research show <id>` | Entry summary (~500 tokens) |
|
|
268
|
+
| `query({ domain: "research", operation: "pending" })` | `cleo research pending` | Followup items |
|
|
269
|
+
| `mutate({ domain: "research", operation: "link", params: { taskId, entryId } })` | `cleo research link T1586 <id>` | Link research to task |
|
|
270
|
+
|
|
271
|
+
### Pipeline Operations
|
|
272
|
+
|
|
273
|
+
| MCP (Primary) | CLI (Fallback) | Purpose |
|
|
274
|
+
|----------------|----------------|---------|
|
|
275
|
+
| `query({ domain: "pipeline", operation: "stage.status", params: { epicId } })` | `cleo pipeline status --epic T1575` | Current pipeline stage |
|
|
276
|
+
| `mutate({ domain: "pipeline", operation: "stage.record", params: { epicId, stage, status } })` | `cleo pipeline record T1575 research done` | Record stage progress |
|
|
277
|
+
| `query({ domain: "pipeline", operation: "stage.validate", params: { epicId, stage } })` | `cleo pipeline validate T1575 implementation` | Check gate before spawn |
|
|
278
|
+
| `mutate({ domain: "pipeline", operation: "stage.gate.pass", params: { epicId, stage } })` | `cleo pipeline gate-pass T1575 research` | Advance pipeline stage |
|
|
279
|
+
|
|
280
|
+
**Context Budget Rule**: Stay under 10K tokens. Use `cleo research list` over reading full files.
|
|
281
|
+
|
|
282
|
+
## Handoff Chain Protocol
|
|
283
|
+
|
|
284
|
+
Content flows between subagents via **manifest-mediated handoffs**, not through orchestrator context. The orchestrator reads only `key_findings` from MANIFEST.jsonl, includes them in the next spawn prompt with a file path reference, and the next subagent reads the full file directly if needed.
|
|
285
|
+
|
|
286
|
+
**Key rules**: Never read full subagent output — read manifests only. Never read full output files. Always include `key_findings` + file path in handoff prompts. Subagents read files directly; orchestrator reads only manifests.
|
|
287
|
+
|
|
288
|
+
> Full handoff architecture, constraints (HNDOFF-001 through HNDOFF-005), prompt template, and anti-patterns: `references/orchestrator-handoffs.md`
|
|
289
|
+
|
|
290
|
+
## Common HITL Patterns
|
|
291
|
+
|
|
292
|
+
| Pattern | When to Use | Key Operations |
|
|
293
|
+
|---------|-------------|----------------|
|
|
294
|
+
| Starting Fresh Epic | New feature work | `tasks.add`, `session.start`, `pipeline.stage.record`, `orchestrate.spawn` |
|
|
295
|
+
| Resuming Interrupted Work | New conversation | `orchestrate.start`, `pipeline.stage.status`, `research.pending` |
|
|
296
|
+
| Handling Manifest Followups | Subagent left TODOs | `research.pending`, `tasks.add` |
|
|
297
|
+
| Parallel Execution | Independent tasks in same wave | `orchestrate.analyze`, `orchestrate.ready` |
|
|
298
|
+
| Pipeline-Aware Orchestration | Multi-stage epics | `pipeline.stage.status`, `pipeline.stage.validate`, `pipeline.stage.gate.pass` |
|
|
299
|
+
| Quality Gates | Verification required | `check.schema`, `pipeline.stage.validate` |
|
|
300
|
+
| Release | Ship a version | `release.create`, `release.ship` |
|
|
301
|
+
|
|
302
|
+
> Full executable workflows for each pattern: `references/orchestrator-patterns.md`
|
|
303
|
+
|
|
304
|
+
## Autonomous Mode (AUTO-*)
|
|
305
|
+
|
|
306
|
+
When operating without continuous HITL oversight, the orchestrator follows additional constraints: single coordination point (AUTO-001), manifest-only reads (AUTO-002), separate decomposition (AUTO-003), verify before next spawn (AUTO-004), wave-order spawning (AUTO-005), followup task creation for partial/blocked (AUTO-006), handoff at 80% context (HNDOFF-001), and read last handoff before resuming (CONT-001).
|
|
307
|
+
|
|
308
|
+
**Scope boundaries**: Autonomous for task execution, dependency resolution, manifest writes, wave-order spawning, pipeline stage advancement. Requires HITL for architectural decisions, scope expansion, destructive operations, cross-epic work, git push to main.
|
|
309
|
+
|
|
310
|
+
> Full autonomous constraints, workflow, scope boundaries, and injection templates: `references/autonomous-operation.md`
|
|
311
|
+
|
|
312
|
+
## Anti-Patterns (MUST NOT)
|
|
313
|
+
|
|
314
|
+
1. **MUST NOT** read full research files — use manifest summaries
|
|
315
|
+
2. **MUST NOT** spawn parallel subagents without checking dependencies
|
|
316
|
+
3. **MUST NOT** implement code directly — delegate via `orchestrate.spawn`
|
|
317
|
+
4. **MUST NOT** exceed 10K context tokens
|
|
318
|
+
5. **MUST NOT** skip protocol injection when spawning subagents
|
|
319
|
+
6. **MUST NOT** spawn tasks out of dependency order
|
|
320
|
+
7. **MUST NOT** spawn skill-specific agents — use cleo-subagent with protocol injection
|
|
321
|
+
8. **MUST NOT** spawn with unresolved tokens (check `tokenResolution.fullyResolved`)
|
|
322
|
+
9. **MUST NOT** write, edit, or implement code directly
|
|
323
|
+
10. **MUST NOT** spawn tasks that don't match the current pipeline stage
|
|
324
|
+
11. **MUST NOT** skip pipeline gate validation before spawning
|
|
325
|
+
|
|
326
|
+
## Tool Boundaries (MANDATORY)
|
|
327
|
+
|
|
328
|
+
| Rule | Rationale |
|
|
329
|
+
|------|-----------|
|
|
330
|
+
| **MUST NOT** implement code directly | Delegate via `orchestrate.spawn` — all implementation is subagent work |
|
|
331
|
+
| **MUST NOT** read full subagent output | Read manifests only — subagent output stays in subagent context |
|
|
332
|
+
| **MUST** use `orchestrate.spawn` for all delegation | Single spawn mechanism; returns fully-resolved prompt for provider adapter |
|
|
333
|
+
| **MUST** check pipeline stage before spawning | Ensure task type matches current RCASD stage |
|
|
334
|
+
|
|
335
|
+
**Subagents read full files. Orchestrator reads only manifests.**
|
|
336
|
+
|
|
337
|
+
## JSDoc Provenance Requirements
|
|
338
|
+
|
|
339
|
+
All code changes MUST include provenance tags:
|
|
340
|
+
|
|
341
|
+
```javascript
|
|
342
|
+
/**
|
|
343
|
+
* @task T1234
|
|
344
|
+
* @epic T1200
|
|
345
|
+
* @why Business rationale (1 sentence)
|
|
346
|
+
* @what Technical summary (1 sentence)
|
|
347
|
+
*/
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## References
|
|
353
|
+
|
|
354
|
+
| Topic | Reference |
|
|
355
|
+
|-------|-----------|
|
|
356
|
+
| Spawn workflow | `references/orchestrator-spawning.md` |
|
|
357
|
+
| Protocol compliance | `references/orchestrator-compliance.md` |
|
|
358
|
+
| Token injection | `references/orchestrator-tokens.md` |
|
|
359
|
+
| Error recovery | `references/orchestrator-recovery.md` |
|
|
360
|
+
| Autonomous mode | `references/autonomous-operation.md` |
|
|
361
|
+
| Lifecycle gates | `references/lifecycle-gates.md` |
|
|
362
|
+
| HITL patterns | `references/orchestrator-patterns.md` |
|
|
363
|
+
| Handoff chains | `references/orchestrator-handoffs.md` |
|
|
364
|
+
|
|
365
|
+
## Shared References
|
|
366
|
+
|
|
367
|
+
@skills/_shared/task-system-integration.md
|
|
368
|
+
@skills/_shared/subagent-protocol-base.md
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## External Documentation
|
|
373
|
+
|
|
374
|
+
- [AUTONOMOUS-ORCHESTRATION-SPEC.md](../../docs/specs/AUTONOMOUS-ORCHESTRATION-SPEC.md) - Autonomous mode
|
|
375
|
+
- [PROJECT-LIFECYCLE-SPEC.md](../../docs/specs/PROJECT-LIFECYCLE-SPEC.md) - Full lifecycle
|
|
376
|
+
- [PROTOCOL-STACK-SPEC.md](../../docs/specs/PROTOCOL-STACK-SPEC.md) - 7 conditional protocols
|
|
377
|
+
- [RCSD-PIPELINE-SPEC.md](../../docs/specs/RCSD-PIPELINE-SPEC.md) - RCASD-IVTR+C pipeline
|
|
378
|
+
- [ORCHESTRATOR-VISION.md](../../docs/ORCHESTRATOR-VISION.md) - Core philosophy
|
|
379
|
+
- [ORCHESTRATOR-PROTOCOL.md](../../docs/guides/ORCHESTRATOR-PROTOCOL.md) - Practical workflows
|
|
380
|
+
- [orchestrator.md](../../docs/commands/orchestrator.md) - CLI command reference
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ct-orchestrator",
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Pipeline-aware orchestration skill for managing complex workflows through subagent delegation.",
|
|
5
|
+
"path": "packages/ct-skills/skills/ct-orchestrator",
|
|
6
|
+
"status": "active",
|
|
7
|
+
"tier": 0,
|
|
8
|
+
"core": true,
|
|
9
|
+
"category": "core",
|
|
10
|
+
"protocol": "agent-protocol",
|
|
11
|
+
"mvi_scope": "orchestrator",
|
|
12
|
+
"requires_tiers": ["minimal", "standard", "orchestrator"],
|
|
13
|
+
"dependencies": [],
|
|
14
|
+
"sharedResources": ["subagent-protocol-base", "task-system-integration"],
|
|
15
|
+
"compatibility": ["claude-code", "cursor", "windsurf", "gemini-cli", "opencode", "codex-cli"],
|
|
16
|
+
"token_budget": 8000,
|
|
17
|
+
"capabilities": ["multi-agent-coordination", "wave-planning", "context-protection", "hitl-orchestration"],
|
|
18
|
+
"constraints": ["requires-agent-runtime"]
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
You are an orchestrator. You MUST NOT implement code directly.
|
|
2
|
+
|
|
3
|
+
Delegate ALL work to subagents via CLEO's orchestrate.spawn operation.
|
|
4
|
+
The spawn operation generates a fully-resolved prompt; your provider's
|
|
5
|
+
adapter decides HOW to execute it.
|
|
6
|
+
|
|
7
|
+
Manage the RCASD-IVTR+C pipeline for your epic. Before spawning any
|
|
8
|
+
subagent, check pipeline gates via pipeline.stage.validate. Do not
|
|
9
|
+
spawn implementation work until research, specification, and
|
|
10
|
+
decomposition stages are complete.
|
|
11
|
+
|
|
12
|
+
Read only manifests, never full subagent outputs. Subagents write
|
|
13
|
+
to MANIFEST.jsonl; you read key_findings from manifest entries.
|
|
14
|
+
|
|
15
|
+
Each subagent MUST stay under 185,000 tokens. If approaching that
|
|
16
|
+
limit, the subagent MUST create a handoff and a new agent carries
|
|
17
|
+
the work forward.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Subagent Protocol Block
|
|
2
|
+
|
|
3
|
+
Copy and include this block in EVERY subagent prompt spawned via Task tool.
|
|
4
|
+
|
|
5
|
+
## Standard Protocol Block
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
## SUBAGENT PROTOCOL (RFC 2119 - MANDATORY)
|
|
9
|
+
|
|
10
|
+
OUTPUT REQUIREMENTS:
|
|
11
|
+
1. MUST write findings to: {{OUTPUT_DIR}}/YYYY-MM-DD_{topic}.md
|
|
12
|
+
2. MUST append ONE line to: {{OUTPUT_DIR}}/MANIFEST.jsonl
|
|
13
|
+
3. MUST return ONLY: "Research complete. See MANIFEST.jsonl for summary."
|
|
14
|
+
4. MUST NOT return research content in response.
|
|
15
|
+
|
|
16
|
+
MANIFEST ENTRY FORMAT:
|
|
17
|
+
{"id":"YYYY-MM-DD_{topic}","timestamp":"ISO8601","task_id":"TXXXX","agent":"agent-name","status":"complete","key_findings":["finding1","finding2"],"needs_followup":["next-task-id"],"file":"YYYY-MM-DD_{topic}.md"}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
When spawning a subagent via Task tool:
|
|
23
|
+
|
|
24
|
+
1. Start with the protocol block above
|
|
25
|
+
2. Add task context (epic, dependencies, previous findings)
|
|
26
|
+
3. Define specific deliverables
|
|
27
|
+
4. Set clear completion criteria
|
|
28
|
+
|
|
29
|
+
## Example Subagent Prompt
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
You are the {ROLE} subagent. Your job is to complete CLEO task {TASK_ID}.
|
|
33
|
+
|
|
34
|
+
## SUBAGENT PROTOCOL (RFC 2119 - MANDATORY)
|
|
35
|
+
OUTPUT REQUIREMENTS:
|
|
36
|
+
1. MUST write findings to: {{OUTPUT_DIR}}/YYYY-MM-DD_{topic}.md
|
|
37
|
+
2. MUST append ONE line to: {{OUTPUT_DIR}}/MANIFEST.jsonl
|
|
38
|
+
3. MUST return ONLY: "Research complete. See MANIFEST.jsonl for summary."
|
|
39
|
+
4. MUST NOT return research content in response.
|
|
40
|
+
|
|
41
|
+
## CONTEXT
|
|
42
|
+
- Epic: {EPIC_ID} ({EPIC_TITLE})
|
|
43
|
+
- Your Task: {TASK_ID} ({TASK_TITLE})
|
|
44
|
+
- Depends on: {DEPENDENCY_IDS}
|
|
45
|
+
|
|
46
|
+
## REFERENCE FROM PREVIOUS RESEARCH (key_findings):
|
|
47
|
+
{PREVIOUS_KEY_FINDINGS}
|
|
48
|
+
|
|
49
|
+
## YOUR TASK
|
|
50
|
+
{DETAILED_INSTRUCTIONS}
|
|
51
|
+
|
|
52
|
+
BEGIN EXECUTION.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Manifest Entry Schema
|
|
56
|
+
|
|
57
|
+
| Field | Type | Required | Description |
|
|
58
|
+
|-------|------|----------|-------------|
|
|
59
|
+
| id | string | Yes | Unique identifier (YYYY-MM-DD_{topic}) |
|
|
60
|
+
| timestamp | string | Yes | ISO 8601 timestamp |
|
|
61
|
+
| task_id | string | Yes | CLEO task ID (e.g., T1599) |
|
|
62
|
+
| agent | string | Yes | Agent identifier |
|
|
63
|
+
| status | string | Yes | "complete" or "partial" |
|
|
64
|
+
| key_findings | array | Yes | Summary points (max 5) |
|
|
65
|
+
| needs_followup | array | No | Task IDs requiring followup |
|
|
66
|
+
| file | string | Yes | Output filename |
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Autonomous Operation Quick Reference
|
|
2
|
+
|
|
3
|
+
**Spec**: [AUTONOMOUS-ORCHESTRATION-SPEC.md](../../../docs/specs/AUTONOMOUS-ORCHESTRATION-SPEC.md)
|
|
4
|
+
|
|
5
|
+
## Corrected Injection Template
|
|
6
|
+
|
|
7
|
+
Use this protocol block when operating autonomously:
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
## Autonomous Orchestration Protocol
|
|
11
|
+
|
|
12
|
+
### IMMUTABLE CONSTRAINTS
|
|
13
|
+
|
|
14
|
+
| ID | Level | Rule |
|
|
15
|
+
|----|-------|------|
|
|
16
|
+
| AUTO-001 | MUST | Spawn ALL subagents (subagents MUST NOT spawn other subagents) |
|
|
17
|
+
| AUTO-002 | MUST | Read manifest `key_findings` for handoff (NOT full output files) |
|
|
18
|
+
| AUTO-003 | MUST | Decomposition is separate from orchestration |
|
|
19
|
+
| AUTO-004 | MUST | Verify manifest entry BEFORE spawning next agent |
|
|
20
|
+
| AUTO-005 | MUST | Compute dependency waves; spawn in wave order |
|
|
21
|
+
| AUTO-006 | MUST | Handle partial/blocked by creating followup tasks |
|
|
22
|
+
| CTX-002 | MUST | Auto-stop at 80% context; generate handoff |
|
|
23
|
+
| SESS-001 | MUST | Start with `cleo session list` |
|
|
24
|
+
| TOOL-001 | MUST NOT | Use TaskOutput tool (read manifest key_findings only) |
|
|
25
|
+
|
|
26
|
+
### WORKFLOW
|
|
27
|
+
|
|
28
|
+
1. **Session**: `cleo session list` → resume OR start with `--scope epic:T####`
|
|
29
|
+
2. **Waves**: `cleo orchestrator analyze T####` → compute dependency waves
|
|
30
|
+
3. **Spawn Loop**:
|
|
31
|
+
- Spawn subagent via Task tool (subagent_type: cleo-subagent)
|
|
32
|
+
- Wait for return message
|
|
33
|
+
- Verify: `cleo research show <id>` → manifest entry exists
|
|
34
|
+
- Link: `cleo research link T#### <id>`
|
|
35
|
+
- Check wave dependencies before next spawn
|
|
36
|
+
4. **Context**: `cleo context` before each spawn → check threshold
|
|
37
|
+
5. **End**: `cleo session end --note "Wave N complete, next: T####"`
|
|
38
|
+
|
|
39
|
+
### PROHIBITED
|
|
40
|
+
|
|
41
|
+
- Subagent spawning subagents
|
|
42
|
+
- Reading full output files (use manifest summaries)
|
|
43
|
+
- Using TaskOutput tool to read subagent results (use manifest summaries only)
|
|
44
|
+
- Skipping manifest verification between spawns
|
|
45
|
+
- Continuing past 80% context without handoff
|
|
46
|
+
- Spawning out of dependency wave order
|
|
47
|
+
- Making architectural decisions without HITL
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Common Corrections
|
|
51
|
+
|
|
52
|
+
| Wrong Pattern | Correct Pattern | Constraint |
|
|
53
|
+
|---------------|-----------------|------------|
|
|
54
|
+
| "subagent hands off to subagent" | Orchestrator spawns ALL agents | AUTO-001 |
|
|
55
|
+
| "NEVER read Task Output" | Read manifest summaries only | AUTO-002 |
|
|
56
|
+
| "epic-architect creates full chain" | Decomposition is spawned subagent | AUTO-003 |
|
|
57
|
+
| Skip verification between spawns | Verify manifest before next spawn | AUTO-004 |
|
|
58
|
+
| No wave ordering | Use `cleo orchestrator analyze` | AUTO-005 |
|
|
59
|
+
| "Read TaskOutput for results" | Read manifest key_findings only | TOOL-001 |
|
|
60
|
+
|
|
61
|
+
## Decision Trees
|
|
62
|
+
|
|
63
|
+
### Should I Continue Autonomously?
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
┌─────────────────────────────────────────────┐
|
|
67
|
+
│ Is this an architectural decision? │
|
|
68
|
+
└─────────────────────┬───────────────────────┘
|
|
69
|
+
│
|
|
70
|
+
┌───────────┴───────────┐
|
|
71
|
+
│ YES │ NO
|
|
72
|
+
▼ ▼
|
|
73
|
+
┌───────────┐ ┌─────────────────────────┐
|
|
74
|
+
│ STOP │ │ Is context >= 80%? │
|
|
75
|
+
│ HITL Gate │ └───────────┬─────────────┘
|
|
76
|
+
└───────────┘ │
|
|
77
|
+
┌───────────┴───────────┐
|
|
78
|
+
│ YES │ NO
|
|
79
|
+
▼ ▼
|
|
80
|
+
┌───────────┐ ┌─────────────────────┐
|
|
81
|
+
│ Generate │ │ Are all dependencies│
|
|
82
|
+
│ Handoff │ │ in wave resolved? │
|
|
83
|
+
└───────────┘ └───────────┬─────────┘
|
|
84
|
+
│
|
|
85
|
+
┌───────────┴───────────┐
|
|
86
|
+
│ YES │ NO
|
|
87
|
+
▼ ▼
|
|
88
|
+
┌───────────┐ ┌───────────┐
|
|
89
|
+
│ CONTINUE │ │ WAIT for │
|
|
90
|
+
│ Spawn next│ │ blocking │
|
|
91
|
+
└───────────┘ │ tasks │
|
|
92
|
+
└───────────┘
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### When to Generate Handoff?
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
TRIGGER CONDITIONS (generate handoff if ANY):
|
|
99
|
+
├─ Context usage >= 80%
|
|
100
|
+
├─ User requests stop
|
|
101
|
+
├─ HITL gate reached (architectural decision)
|
|
102
|
+
├─ Wave boundary AND user requested pause
|
|
103
|
+
├─ Unrecoverable error
|
|
104
|
+
└─ Scope complete (all tasks done)
|
|
105
|
+
|
|
106
|
+
HANDOFF CONTENTS:
|
|
107
|
+
├─ session_id, epic_id, timestamp
|
|
108
|
+
├─ stop_reason (context_limit, wave_complete, hitl_gate, error, scope_complete)
|
|
109
|
+
├─ progress (completed_tasks, current_wave, waves_remaining)
|
|
110
|
+
├─ resume (command, next_tasks, blockers)
|
|
111
|
+
└─ context_snapshot (usage_percent, tokens_remaining)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### How to Resume from Handoff?
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# 1. Read last handoff
|
|
118
|
+
cleo research list --type handoff --limit 1
|
|
119
|
+
|
|
120
|
+
# 2. Verify session exists
|
|
121
|
+
cleo session status <session_id>
|
|
122
|
+
|
|
123
|
+
# 3. Check for concurrent modifications
|
|
124
|
+
cleo session list --scope epic:<epic_id>
|
|
125
|
+
|
|
126
|
+
# 4. Resume if clear
|
|
127
|
+
cleo session resume <session_id>
|
|
128
|
+
|
|
129
|
+
# 5. Continue from next_tasks
|
|
130
|
+
cleo orchestrator next --epic <epic_id>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Exit Codes
|
|
134
|
+
|
|
135
|
+
| Code | Constant | Meaning | Recovery |
|
|
136
|
+
|------|----------|---------|----------|
|
|
137
|
+
| 64 | EXIT_AUTONOMOUS_BOUNDARY | HITL gate reached | Wait for human decision |
|
|
138
|
+
| 65 | EXIT_HANDOFF_REQUIRED | Must generate handoff | Generate handoff, then stop |
|
|
139
|
+
| 66 | EXIT_RESUME_FAILED | Resume failed | Verify session/handoff state |
|
|
140
|
+
| 67 | EXIT_CONCURRENT_SESSION | Scope conflict | Wait or use different scope |
|
|
141
|
+
|
|
142
|
+
## Scope Boundaries
|
|
143
|
+
|
|
144
|
+
### Autonomous (proceed without HITL)
|
|
145
|
+
|
|
146
|
+
- Task execution within epic scope
|
|
147
|
+
- Dependency resolution and wave computation
|
|
148
|
+
- Manifest writing and status updates
|
|
149
|
+
- Spawning subagents in wave order
|
|
150
|
+
- Creating followup tasks for partial/blocked
|
|
151
|
+
- Small scope adjustments within epic
|
|
152
|
+
|
|
153
|
+
### Requires HITL
|
|
154
|
+
|
|
155
|
+
- Architectural decisions
|
|
156
|
+
- Scope expansion beyond epic
|
|
157
|
+
- Force/destructive operations
|
|
158
|
+
- Breaking changes
|
|
159
|
+
- Cross-epic work
|
|
160
|
+
- New epic creation
|
|
161
|
+
- Git push to main/master
|
|
162
|
+
|
|
163
|
+
## Manifest Entry for Handoff
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{"type":"session_handoff","timestamp":"2026-01-27T14:30:00Z","session_id":"session_20260127_143000_abc123","epic_id":"T1575","stop_reason":"context_limit","progress":{"completed_tasks":["T1576","T1577"],"current_wave":2,"waves_remaining":3},"resume":{"command":"cleo session resume session_20260127_143000_abc123","next_tasks":["T1579","T1580"],"blockers":[]},"context_snapshot":{"usage_percent":78,"tokens_remaining":22000},"agent_type":"handoff"}
|
|
167
|
+
```
|