@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.
Files changed (171) hide show
  1. package/dispatch-config.json +404 -0
  2. package/index.d.ts +178 -0
  3. package/index.js +405 -0
  4. package/package.json +14 -0
  5. package/profiles/core.json +7 -0
  6. package/profiles/full.json +10 -0
  7. package/profiles/minimal.json +7 -0
  8. package/profiles/recommended.json +7 -0
  9. package/provider-skills-map.json +97 -0
  10. package/skills/_shared/cleo-style-guide.md +84 -0
  11. package/skills/_shared/manifest-operations.md +810 -0
  12. package/skills/_shared/placeholders.json +433 -0
  13. package/skills/_shared/skill-chaining-patterns.md +237 -0
  14. package/skills/_shared/subagent-protocol-base.md +223 -0
  15. package/skills/_shared/task-system-integration.md +232 -0
  16. package/skills/_shared/testing-framework-config.md +110 -0
  17. package/skills/ct-cleo/SKILL.md +490 -0
  18. package/skills/ct-cleo/references/anti-patterns.md +19 -0
  19. package/skills/ct-cleo/references/loom-lifecycle.md +136 -0
  20. package/skills/ct-cleo/references/orchestrator-constraints.md +55 -0
  21. package/skills/ct-cleo/references/session-protocol.md +162 -0
  22. package/skills/ct-codebase-mapper/SKILL.md +82 -0
  23. package/skills/ct-contribution/SKILL.md +521 -0
  24. package/skills/ct-contribution/templates/contribution-init.json +21 -0
  25. package/skills/ct-dev-workflow/SKILL.md +423 -0
  26. package/skills/ct-docs-lookup/SKILL.md +66 -0
  27. package/skills/ct-docs-review/SKILL.md +175 -0
  28. package/skills/ct-docs-write/SKILL.md +108 -0
  29. package/skills/ct-documentor/SKILL.md +231 -0
  30. package/skills/ct-epic-architect/SKILL.md +305 -0
  31. package/skills/ct-epic-architect/references/bug-epic-example.md +172 -0
  32. package/skills/ct-epic-architect/references/commands.md +201 -0
  33. package/skills/ct-epic-architect/references/feature-epic-example.md +210 -0
  34. package/skills/ct-epic-architect/references/migration-epic-example.md +244 -0
  35. package/skills/ct-epic-architect/references/output-format.md +92 -0
  36. package/skills/ct-epic-architect/references/patterns.md +284 -0
  37. package/skills/ct-epic-architect/references/refactor-epic-example.md +412 -0
  38. package/skills/ct-epic-architect/references/research-epic-example.md +226 -0
  39. package/skills/ct-epic-architect/references/shell-escaping.md +86 -0
  40. package/skills/ct-epic-architect/references/skill-aware-execution.md +195 -0
  41. package/skills/ct-grade/SKILL.md +230 -0
  42. package/skills/ct-grade/agents/analysis-reporter.md +203 -0
  43. package/skills/ct-grade/agents/blind-comparator.md +157 -0
  44. package/skills/ct-grade/agents/scenario-runner.md +134 -0
  45. package/skills/ct-grade/eval-viewer/__pycache__/generate_grade_review.cpython-314.pyc +0 -0
  46. package/skills/ct-grade/eval-viewer/generate_grade_review.py +1138 -0
  47. package/skills/ct-grade/eval-viewer/generate_grade_viewer.py +544 -0
  48. package/skills/ct-grade/eval-viewer/generate_review.py +283 -0
  49. package/skills/ct-grade/eval-viewer/grade-review.html +1574 -0
  50. package/skills/ct-grade/eval-viewer/viewer.html +219 -0
  51. package/skills/ct-grade/evals/evals.json +94 -0
  52. package/skills/ct-grade/references/ab-test-methodology.md +150 -0
  53. package/skills/ct-grade/references/domains.md +137 -0
  54. package/skills/ct-grade/references/grade-spec.md +236 -0
  55. package/skills/ct-grade/references/scenario-playbook.md +234 -0
  56. package/skills/ct-grade/references/token-tracking.md +120 -0
  57. package/skills/ct-grade/scripts/__pycache__/audit_analyzer.cpython-314.pyc +0 -0
  58. package/skills/ct-grade/scripts/__pycache__/run_ab_test.cpython-314.pyc +0 -0
  59. package/skills/ct-grade/scripts/__pycache__/run_all.cpython-314.pyc +0 -0
  60. package/skills/ct-grade/scripts/__pycache__/token_tracker.cpython-314.pyc +0 -0
  61. package/skills/ct-grade/scripts/audit_analyzer.py +279 -0
  62. package/skills/ct-grade/scripts/generate_report.py +283 -0
  63. package/skills/ct-grade/scripts/run_ab_test.py +504 -0
  64. package/skills/ct-grade/scripts/run_all.py +287 -0
  65. package/skills/ct-grade/scripts/setup_run.py +183 -0
  66. package/skills/ct-grade/scripts/token_tracker.py +630 -0
  67. package/skills/ct-grade-v2-1/SKILL.md +237 -0
  68. package/skills/ct-grade-v2-1/agents/analysis-reporter.md +203 -0
  69. package/skills/ct-grade-v2-1/agents/blind-comparator.md +157 -0
  70. package/skills/ct-grade-v2-1/agents/scenario-runner.md +179 -0
  71. package/skills/ct-grade-v2-1/evals/evals.json +74 -0
  72. package/skills/ct-grade-v2-1/grade-viewer/__pycache__/build_op_stats.cpython-314.pyc +0 -0
  73. package/skills/ct-grade-v2-1/grade-viewer/__pycache__/generate_grade_review.cpython-314.pyc +0 -0
  74. package/skills/ct-grade-v2-1/grade-viewer/build_op_stats.py +174 -0
  75. package/skills/ct-grade-v2-1/grade-viewer/eval-analysis.json +41 -0
  76. package/skills/ct-grade-v2-1/grade-viewer/eval-report.md +34 -0
  77. package/skills/ct-grade-v2-1/grade-viewer/generate_grade_review.py +1023 -0
  78. package/skills/ct-grade-v2-1/grade-viewer/generate_grade_viewer.py +548 -0
  79. package/skills/ct-grade-v2-1/grade-viewer/grade-review-eval.html +613 -0
  80. package/skills/ct-grade-v2-1/grade-viewer/grade-review.html +1532 -0
  81. package/skills/ct-grade-v2-1/grade-viewer/viewer.html +620 -0
  82. package/skills/ct-grade-v2-1/manifest-entry.json +31 -0
  83. package/skills/ct-grade-v2-1/references/ab-testing.md +233 -0
  84. package/skills/ct-grade-v2-1/references/domains-ssot.md +156 -0
  85. package/skills/ct-grade-v2-1/references/grade-spec-v2.md +167 -0
  86. package/skills/ct-grade-v2-1/references/playbook-v2.md +393 -0
  87. package/skills/ct-grade-v2-1/references/token-tracking.md +202 -0
  88. package/skills/ct-grade-v2-1/scripts/generate_report.py +419 -0
  89. package/skills/ct-grade-v2-1/scripts/run_ab_test.py +493 -0
  90. package/skills/ct-grade-v2-1/scripts/run_scenario.py +396 -0
  91. package/skills/ct-grade-v2-1/scripts/setup_run.py +207 -0
  92. package/skills/ct-grade-v2-1/scripts/token_tracker.py +175 -0
  93. package/skills/ct-memory/SKILL.md +84 -0
  94. package/skills/ct-orchestrator/INSTALL.md +61 -0
  95. package/skills/ct-orchestrator/README.md +69 -0
  96. package/skills/ct-orchestrator/SKILL.md +380 -0
  97. package/skills/ct-orchestrator/manifest-entry.json +19 -0
  98. package/skills/ct-orchestrator/orchestrator-prompt.txt +17 -0
  99. package/skills/ct-orchestrator/references/SUBAGENT-PROTOCOL-BLOCK.md +66 -0
  100. package/skills/ct-orchestrator/references/autonomous-operation.md +167 -0
  101. package/skills/ct-orchestrator/references/lifecycle-gates.md +98 -0
  102. package/skills/ct-orchestrator/references/orchestrator-compliance.md +271 -0
  103. package/skills/ct-orchestrator/references/orchestrator-handoffs.md +85 -0
  104. package/skills/ct-orchestrator/references/orchestrator-patterns.md +164 -0
  105. package/skills/ct-orchestrator/references/orchestrator-recovery.md +113 -0
  106. package/skills/ct-orchestrator/references/orchestrator-spawning.md +271 -0
  107. package/skills/ct-orchestrator/references/orchestrator-tokens.md +180 -0
  108. package/skills/ct-research-agent/SKILL.md +226 -0
  109. package/skills/ct-skill-creator/.cleo/.context-state.json +13 -0
  110. package/skills/ct-skill-creator/.cleo/logs/cleo.2026-03-07.1.log +24 -0
  111. package/skills/ct-skill-creator/.cleo/tasks.db +0 -0
  112. package/skills/ct-skill-creator/SKILL.md +356 -0
  113. package/skills/ct-skill-creator/agents/analyzer.md +276 -0
  114. package/skills/ct-skill-creator/agents/comparator.md +204 -0
  115. package/skills/ct-skill-creator/agents/grader.md +225 -0
  116. package/skills/ct-skill-creator/assets/eval_review.html +146 -0
  117. package/skills/ct-skill-creator/eval-viewer/__pycache__/generate_review.cpython-314.pyc +0 -0
  118. package/skills/ct-skill-creator/eval-viewer/generate_review.py +471 -0
  119. package/skills/ct-skill-creator/eval-viewer/viewer.html +1325 -0
  120. package/skills/ct-skill-creator/manifest-entry.json +17 -0
  121. package/skills/ct-skill-creator/references/dynamic-context.md +228 -0
  122. package/skills/ct-skill-creator/references/frontmatter.md +83 -0
  123. package/skills/ct-skill-creator/references/invocation-control.md +165 -0
  124. package/skills/ct-skill-creator/references/output-patterns.md +86 -0
  125. package/skills/ct-skill-creator/references/provider-deployment.md +175 -0
  126. package/skills/ct-skill-creator/references/schemas.md +430 -0
  127. package/skills/ct-skill-creator/references/workflows.md +28 -0
  128. package/skills/ct-skill-creator/scripts/__init__.py +1 -0
  129. package/skills/ct-skill-creator/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
  130. package/skills/ct-skill-creator/scripts/__pycache__/aggregate_benchmark.cpython-314.pyc +0 -0
  131. package/skills/ct-skill-creator/scripts/__pycache__/generate_report.cpython-314.pyc +0 -0
  132. package/skills/ct-skill-creator/scripts/__pycache__/improve_description.cpython-314.pyc +0 -0
  133. package/skills/ct-skill-creator/scripts/__pycache__/init_skill.cpython-314.pyc +0 -0
  134. package/skills/ct-skill-creator/scripts/__pycache__/quick_validate.cpython-314.pyc +0 -0
  135. package/skills/ct-skill-creator/scripts/__pycache__/run_eval.cpython-314.pyc +0 -0
  136. package/skills/ct-skill-creator/scripts/__pycache__/run_loop.cpython-314.pyc +0 -0
  137. package/skills/ct-skill-creator/scripts/__pycache__/utils.cpython-314.pyc +0 -0
  138. package/skills/ct-skill-creator/scripts/aggregate_benchmark.py +401 -0
  139. package/skills/ct-skill-creator/scripts/generate_report.py +326 -0
  140. package/skills/ct-skill-creator/scripts/improve_description.py +247 -0
  141. package/skills/ct-skill-creator/scripts/init_skill.py +306 -0
  142. package/skills/ct-skill-creator/scripts/package_skill.py +110 -0
  143. package/skills/ct-skill-creator/scripts/quick_validate.py +97 -0
  144. package/skills/ct-skill-creator/scripts/run_eval.py +310 -0
  145. package/skills/ct-skill-creator/scripts/run_loop.py +328 -0
  146. package/skills/ct-skill-creator/scripts/utils.py +47 -0
  147. package/skills/ct-skill-validator/SKILL.md +178 -0
  148. package/skills/ct-skill-validator/agents/ecosystem-checker.md +151 -0
  149. package/skills/ct-skill-validator/assets/valid-skill-example.md +13 -0
  150. package/skills/ct-skill-validator/evals/eval_set.json +14 -0
  151. package/skills/ct-skill-validator/evals/evals.json +52 -0
  152. package/skills/ct-skill-validator/manifest-entry.json +20 -0
  153. package/skills/ct-skill-validator/references/cleo-ecosystem-rules.md +163 -0
  154. package/skills/ct-skill-validator/references/validation-rules.md +168 -0
  155. package/skills/ct-skill-validator/scripts/__init__.py +0 -0
  156. package/skills/ct-skill-validator/scripts/__pycache__/audit_body.cpython-314.pyc +0 -0
  157. package/skills/ct-skill-validator/scripts/__pycache__/check_ecosystem.cpython-314.pyc +0 -0
  158. package/skills/ct-skill-validator/scripts/__pycache__/generate_validation_report.cpython-314.pyc +0 -0
  159. package/skills/ct-skill-validator/scripts/__pycache__/validate.cpython-314.pyc +0 -0
  160. package/skills/ct-skill-validator/scripts/audit_body.py +242 -0
  161. package/skills/ct-skill-validator/scripts/check_ecosystem.py +169 -0
  162. package/skills/ct-skill-validator/scripts/check_manifest.py +172 -0
  163. package/skills/ct-skill-validator/scripts/generate_validation_report.py +442 -0
  164. package/skills/ct-skill-validator/scripts/validate.py +422 -0
  165. package/skills/ct-spec-writer/SKILL.md +189 -0
  166. package/skills/ct-stickynote/README.md +14 -0
  167. package/skills/ct-stickynote/SKILL.md +46 -0
  168. package/skills/ct-task-executor/SKILL.md +296 -0
  169. package/skills/ct-validator/SKILL.md +216 -0
  170. package/skills/manifest.json +469 -0
  171. package/skills.json +281 -0
@@ -0,0 +1,490 @@
1
+ ---
2
+ name: ct-cleo
3
+ description: CLEO task management protocol - session, task, and workflow guidance. Use when managing tasks, sessions, or multi-agent workflows with the CLEO MCP protocol.
4
+ ---
5
+
6
+ # CLEO Protocol Guide
7
+
8
+ CLEO is the task management protocol for AI coding agents. It provides structured task tracking, session management, and multi-agent coordination with anti-hallucination validation.
9
+
10
+ **Operation set**: 164 operations (97 query + 67 mutate) across 10 canonical domains.
11
+
12
+ ## MCP-First Workflow
13
+
14
+ MCP is the **primary** entry point. Use `query` for reads and `mutate` for writes.
15
+
16
+ ### Tier-0 Read Operations (`query`) — Always Available
17
+
18
+ | Domain | Operation | Description |
19
+ |--------|-----------|-------------|
20
+ | `tasks` | `show` | Get task details (`params: { taskId }`) |
21
+ | `tasks` | `find` | Search tasks (`params: { query }` or `{ id }`) |
22
+ | `tasks` | `next` | Auto-select highest-priority next task |
23
+ | `tasks` | `plan` | Composite planning view: upcoming tasks, blockers, dependencies |
24
+ | `tasks` | `current` | Show currently active (started) task |
25
+ | `session` | `status` | Current session state — **mandatory first call** |
26
+ | `session` | `handoff.show` | Resume prior context from last session |
27
+ | `session` | `briefing.show` | Composite cold-start briefing (status + handoff combined) |
28
+ | `memory` | `find` | Search brain for past observations, decisions, patterns (`params: { query }`) |
29
+ | `admin` | `version` | CLEO version number |
30
+ | `admin` | `health` | Installation health check |
31
+ | `admin` | `dash` | Project dashboard — mandatory efficiency sequence step 2 |
32
+ | `admin` | `help` | Discover available operations; use `{tier:2}` to reveal advanced ops |
33
+ | `tools` | `skill.list` | List all installed agent skills |
34
+ | `tools` | `provider.list` | List all known LLM/agent providers |
35
+ | `tools` | `provider.detect` | Detect currently active provider |
36
+
37
+ ### Tier-1 Read Operations (`query`) — After Session Init
38
+
39
+ | Domain | Operation | Description |
40
+ |--------|-----------|-------------|
41
+ | `tasks` | `list` | List direct children (`params: { parentId }`) — **requires parentId filter; prefer tasks.find for discovery** |
42
+ | `tasks` | `tree` | Full subtask hierarchy (`params: { taskId }`) |
43
+ | `tasks` | `analyze` | Leverage-sorted task discovery |
44
+ | `tasks` | `blockers` | Tasks blocking a specific task (`params: { taskId }`) |
45
+ | `tasks` | `depends` | Full dependency graph for a task (`params: { taskId }`) |
46
+ | `session` | `list` | List sessions (prefer `session.find` for discovery) |
47
+ | `session` | `decision.log` | Recorded decisions for the current session |
48
+ | `session` | `find` | Search sessions (`params: { query }`) |
49
+ | `session` | `show` | Full session record (`params: { sessionId }`) |
50
+ | `session` | `context.drift` | Inspect context drift during long sessions |
51
+ | `memory` | `timeline` | Context around an anchor entry (`params: { anchorId }`) |
52
+ | `memory` | `fetch` | Batch-fetch brain entries (`params: { ids: [...] }`) |
53
+ | `memory` | `decision.find` | Search stored decisions (`params: { query, taskId? }`) |
54
+ | `memory` | `pattern.find` | Search stored patterns (`params: { query, type? }`) |
55
+ | `memory` | `learning.find` | Search stored learnings (`params: { query, minConfidence? }`) |
56
+ | `orchestrate` | `analyze` | Dependency wave analysis (`params: { epicId }`) |
57
+ | `orchestrate` | `ready` | Tasks ready to spawn (`params: { epicId }`) |
58
+ | `orchestrate` | `next` | Next task suggestion (`params: { epicId }`) |
59
+ | `orchestrate` | `status` | Current orchestration state |
60
+ | `check` | `schema` | Validate task data schema integrity |
61
+ | `check` | `protocol` | Protocol compliance for a task (`params: { taskId, protocolType? }`) |
62
+ | `check` | `task` | Validate task fields (`params: { taskId }`) |
63
+ | `check` | `compliance.summary` | Overall compliance summary |
64
+ | `check` | `test` | Test status or coverage (`params: { format: "status" | "coverage" }`) |
65
+ | `check` | `gate.status` | Lifecycle gate status |
66
+ | `pipeline` | `stage.status` | Pipeline stage for epic (`params: { epicId }`) |
67
+ | `pipeline` | `stage.validate` | Validate gate before advancing |
68
+ | `pipeline` | `manifest.show` | Read manifest entry (`params: { id }`) |
69
+ | `pipeline` | `manifest.list` | List manifest entries (`params: { filter?: "pending" }`) |
70
+ | `pipeline` | `manifest.find` | Search manifest entries (`params: { query }`) |
71
+ | `nexus` | `status` | Check if nexus is initialized |
72
+ | `nexus` | `list` | List registered projects |
73
+ | `admin` | `config.show` | Inspect current configuration |
74
+ | `admin` | `adr.find` | Search architecture decision records |
75
+ | `tools` | `skill.show` | Skill details (`params: { skillId }`) |
76
+ | `sticky` | `list` | List sticky notes (`params: { status?, tag? }`) |
77
+ | `sticky` | `show` | Show sticky details (`params: { stickyId }`) |
78
+
79
+ ### Tier-0 Write Operations (`mutate`) — Always Available
80
+
81
+ | Domain | Operation | Description |
82
+ |--------|-----------|-------------|
83
+ | `tasks` | `add` | Create task (`params: { title, description, parentId?, status? }`) |
84
+ | `tasks` | `update` | Update task (`params: { taskId, title?, status?, notes? }`) |
85
+ | `tasks` | `complete` | Mark task done (`params: { taskId }`) |
86
+ | `tasks` | `start` | Start working on a task (`params: { taskId }`) |
87
+ | `tasks` | `stop` | Stop working on current task |
88
+ | `session` | `start` | Start session (`params: { scope }`) — scope is **required** |
89
+ | `session` | `end` | End session (`params: { note? }`) |
90
+ | `memory` | `observe` | Save observation to brain (`params: { text, title? }`) |
91
+
92
+ ### Tier-1 Write Operations (`mutate`) — After Session Init
93
+
94
+ | Domain | Operation | Description |
95
+ |--------|-----------|-------------|
96
+ | `tasks` | `cancel` | Cancel task (`params: { taskId }`) |
97
+ | `tasks` | `archive` | Archive completed task (`params: { taskId }`) |
98
+ | `tasks` | `restore` | Restore from done/archive (`params: { taskId, from: "done" \| "archive" }`) |
99
+ | `tasks` | `delete` | Hard delete — irreversible (`params: { taskId }`) |
100
+ | `tasks` | `reparent` | Move to different parent (`params: { taskId, newParentId }`) |
101
+ | `tasks` | `reorder` | Reorder tasks within their parent (`params: { taskId, position }`) |
102
+ | `session` | `resume` | Resume a prior session (`params: { sessionId }`) |
103
+ | `session` | `suspend` | Pause session without ending it |
104
+ | `session` | `record.decision` | Record a session decision (`params: { text, rationale }`) |
105
+ | `session` | `record.assumption` | Record a session assumption (`params: { text }`) |
106
+ | `admin` | `context.inject` | Inject protocol content into context (`params: { protocolType }`) — **moved from session domain** |
107
+ | `memory` | `link` | Link memory entry to task (`params: { memoryId, taskId }`) |
108
+ | `memory` | `decision.store` | Store structured decision (`params: { decision, rationale, taskId, alternatives? }`) |
109
+ | `memory` | `pattern.store` | Store recurring pattern (`params: { name, type, impact, success, antiPattern? }`) |
110
+ | `memory` | `learning.store` | Store a learning (`params: { text, confidence, taskId? }`) |
111
+ | `orchestrate` | `start` | Start orchestrating an epic (`params: { epicId }`) |
112
+ | `orchestrate` | `spawn` | Spawn prep for a task (`params: { taskId, skillIds? }`) |
113
+ | `orchestrate` | `spawn.execute` | Execute spawn via adapter registry (`params: { taskId }`) |
114
+ | `orchestrate` | `handoff` | Hand off context to subagent (`params: { taskId, context }`) |
115
+ | `orchestrate` | `validate` | Pre-spawn gate check (`params: { taskId }`) |
116
+ | `orchestrate` | `parallel` | Run parallel agent wave (`params: { action: "start" \| "end", waveId? }`) |
117
+ | `check` | `test.run` | Run tests |
118
+ | `check` | `gate.set` | Set or reset a lifecycle gate |
119
+ | `pipeline` | `stage.record` | Record pipeline stage progress |
120
+ | `pipeline` | `stage.gate.pass` | Pass a pipeline gate (`params: { stageId, gateId }`) |
121
+ | `pipeline` | `stage.gate.fail` | Fail a gate with reason (`params: { stageId, gateId, reason }`) |
122
+ | `pipeline` | `manifest.append` | Append manifest entry (`params: { entry }`) — **MANDATORY per BASE protocol** |
123
+ | `pipeline` | `phase.set` | Set pipeline phase (`params: { phaseId, action: "start" \| "complete" }`) |
124
+ | `pipeline` | `release.ship` | Ship a release (`params: { step? }`) |
125
+ | `admin` | `config.set` | Update configuration (`params: { key, value }`) |
126
+ | `tools` | `skill.install` | Install a skill (`params: { skillId }`) |
127
+ | `tools` | `skill.uninstall` | Uninstall a skill (`params: { skillId }`) |
128
+ | `tools` | `skill.refresh` | Bulk update all installed skills |
129
+ | `sticky` | `add` | Create sticky note (`params: { content, tags?, color?, priority? }`) |
130
+ | `sticky` | `convert` | Convert to task/memory (`params: { stickyId, targetType }`) |
131
+ | `sticky` | `archive` | Archive sticky (`params: { stickyId }`) |
132
+ | `sticky` | `purge` | Permanently delete sticky notes (`params: { stickyId }`) |
133
+
134
+ ---
135
+
136
+ ## Canonical Decision Tree
137
+
138
+ Every agent MUST use this tree to select the minimum-cost operation path.
139
+
140
+ ### Entry Point: Session Start (MANDATORY)
141
+
142
+ ```
143
+ Agent starts work
144
+
145
+ ├── STEP 1: query session.status
146
+ │ ├── Active session exists
147
+ │ │ └── query session.handoff.show → resume prior context, then STEP 2
148
+ │ └── No active session
149
+ │ └── mutate session.start {scope: "task:TXXX" | "epic:TXXX"}
150
+
151
+ ├── STEP 2: query admin.dash → project overview, active epic, blockers
152
+
153
+ ├── STEP 3: query tasks.current → is a task already in progress?
154
+ │ ├── Yes → continue that task (skip STEP 4)
155
+ │ └── No → STEP 4
156
+
157
+ └── STEP 4: query tasks.next → what to work on next
158
+ └── query tasks.show {taskId} → full task requirements
159
+ ```
160
+
161
+ **Anti-pattern blocked**: Never skip `session.status`. Resuming without `handoff.show` loses prior context and causes duplicate work.
162
+
163
+ ---
164
+
165
+ ### Goal: Discover Work
166
+
167
+ ```
168
+ I need to find what to work on
169
+
170
+ ├── What should I do next (auto-selected)?
171
+ │ └── query tasks.next [tier 0]
172
+ │ └── query tasks.show {taskId} [tier 0] → full details
173
+
174
+ ├── I know keywords — search for a specific task
175
+ │ └── query tasks.find {query: "..."} [tier 0]
176
+ │ ├── Found one match → query tasks.show {taskId}
177
+ │ └── Need to browse children of a known parent
178
+ │ └── query tasks.list {parentId: "TXXX"} [tier 1] ← ONLY with parentId filter
179
+ │ ANTI-PATTERN: tasks.list with no parentId = full dump, never do this
180
+
181
+ ├── I need a prioritized planning view (upcoming tasks, blockers, dependencies)
182
+ │ └── query tasks.plan [tier 0]
183
+
184
+ ├── I need the full task hierarchy under a parent
185
+ │ └── (discover via tasks.find first, then)
186
+ │ └── query tasks.tree {taskId} [tier 1] → subtask hierarchy
187
+
188
+ ├── I need to see what's blocking a task
189
+ │ └── query tasks.blockers {taskId} [tier 1]
190
+
191
+ └── I need leverage-sorted discovery (highest-impact tasks first)
192
+ └── query tasks.analyze [tier 1]
193
+ ```
194
+
195
+ ---
196
+
197
+ ### Goal: Memory Operations
198
+
199
+ ```
200
+ I need to save or recall information across sessions
201
+
202
+ ├── Save an observation right now (free-form)
203
+ │ └── mutate memory.observe {text, title?} [tier 0]
204
+
205
+ ├── Search for something I or a prior agent observed
206
+ │ └── query memory.find {query: "..."} [tier 0] ← ALWAYS start here (cheap)
207
+ │ └── Found interesting IDs → query memory.timeline {anchorId} [tier 1]
208
+ │ └── Need full content → query memory.fetch {ids: [...]} [tier 1]
209
+ │ 3-LAYER PATTERN: find → timeline → fetch (never skip to fetch directly)
210
+
211
+ ├── Save a structured decision (with rationale, alternatives, taskId)
212
+ │ └── mutate memory.decision.store {decision, rationale, taskId, alternatives?} [tier 1]
213
+ │ └── Recall: query memory.decision.find {query, taskId?} [tier 1]
214
+
215
+ └── Associate a memory entry with a task (research linking protocol)
216
+ └── mutate memory.link {memoryId, taskId} [tier 1]
217
+ ```
218
+
219
+ **Anti-pattern blocked**: Never call `memory.fetch` without first calling `memory.find`. Fetching without filtering returns all entries (expensive).
220
+
221
+ ---
222
+
223
+ ### Goal: Multi-Agent Coordination
224
+
225
+ ```
226
+ I need to coordinate agent work (orchestrator role)
227
+
228
+ ├── I am the orchestrator — start coordinating an epic
229
+ │ └── mutate orchestrate.start {epicId} [tier 1]
230
+ │ └── query orchestrate.status [tier 1] → current orchestration state
231
+
232
+ ├── Spawn a subagent for a task
233
+ │ └── (1) mutate orchestrate.validate {taskId} [tier 1] → pre-spawn gate check
234
+ │ (2) mutate orchestrate.spawn {taskId, skillIds?} [tier 1] → spawn prep
235
+
236
+ └── I am a subagent — complete my work and report
237
+ └── mutate pipeline.manifest.append {entry} [tier 1] ← MANDATORY per BASE protocol
238
+ mutate tasks.complete {taskId} [tier 0]
239
+ ```
240
+
241
+ **Subagent BASE protocol**: Every subagent MUST append one entry to MANIFEST.jsonl via `pipeline.manifest.append` BEFORE calling `tasks.complete`. Omitting this is a protocol violation (exit code 62).
242
+
243
+ ---
244
+
245
+ ### Goal: Track Session Context
246
+
247
+ ```
248
+ I need to manage session lifecycle or read session state
249
+
250
+ ├── Check whether a session is active
251
+ │ └── query session.status [tier 0] ← FIRST, always
252
+
253
+ ├── Resume prior context after a restart
254
+ │ └── query session.handoff.show [tier 0]
255
+
256
+ ├── Get a composite cold-start briefing (combines status + handoff)
257
+ │ └── query session.briefing.show [tier 0]
258
+
259
+ ├── Start a new session
260
+ │ └── mutate session.start {scope: "task:TXXX" | "epic:TXXX"} [tier 0]
261
+ │ RULE: scope is required — no unscoped sessions
262
+
263
+ ├── End the current session (triggers debrief + handoff generation)
264
+ │ └── mutate session.end [tier 0]
265
+
266
+ └── Browse past sessions
267
+ └── query session.find {query: "..."} [tier 1] ← NOT session.list unfiltered
268
+ └── Full session record: query session.show {sessionId} [tier 1]
269
+ ```
270
+
271
+ ---
272
+
273
+ ### Goal: Discover Available Skills
274
+
275
+ ```
276
+ I need to know what skills or providers are available
277
+
278
+ ├── List all installed skills (cold-start safe)
279
+ │ └── query tools.skill.list [tier 0]
280
+ │ └── Detail on a specific skill: query tools.skill.show {skillId} [tier 1]
281
+
282
+ └── Detect active provider
283
+ └── query tools.provider.detect [tier 0]
284
+ ```
285
+
286
+ ---
287
+
288
+ ### Goal: System Information
289
+
290
+ ```
291
+ I need system or configuration info
292
+
293
+ ├── What is the overall project state?
294
+ │ └── query admin.dash [tier 0] ← mandatory efficiency sequence step 2
295
+
296
+ ├── What operations are available at this tier?
297
+ │ └── query admin.help [tier 0] → tier 0 + tier 1 ops
298
+ │ └── query admin.help {tier:2} → reveals tier-2 ops + escalation hints
299
+
300
+ └── Inspect configuration
301
+ └── query admin.config.show [tier 1]
302
+ ```
303
+
304
+ ---
305
+
306
+ ## CLI Fallback
307
+
308
+ When MCP tools are unavailable, use `ct` (alias for `cleo`).
309
+
310
+ ```bash
311
+ ct find "query" # Search (99% less context than list)
312
+ ct find --id T1234 # Search by ID
313
+ ct show T1234 # Full task details
314
+ ct add "Task title" # Create task
315
+ ct complete T1234 # Complete task
316
+ ct start T1234 # Start working on task
317
+ ct dash # Project overview (admin.dash equivalent)
318
+
319
+ ct sticky add "Quick note" # Create sticky note
320
+ ct sticky list # List active stickies
321
+ ct sticky show SN-001 # Show sticky details
322
+ ```
323
+
324
+ ---
325
+
326
+ ## Task Discovery (Context Efficiency)
327
+
328
+ **MUST** use efficient commands — `find` for discovery, `show` for details:
329
+
330
+ - `list` includes full notes arrays (huge context cost)
331
+ - `find` returns minimal fields only (99% less context)
332
+ - Use `show` only when you need full details for a specific task
333
+
334
+ ### Context Bloat Anti-Patterns
335
+
336
+ | Anti-Pattern | Token Cost | Efficient Alternative | Savings |
337
+ |-------------|-----------|----------------------|---------|
338
+ | `tasks.list` (no parentId filter) | 2000-5000 | `tasks.find {query: "..."}` | 80-90% |
339
+ | `admin.help {tier:2}` first call | 2000+ | `admin.help` (tier 0 default) | 60-75% |
340
+ | `tasks.show` for every task | 400 x N | `tasks.find` then `show` for 1-2 | 70-90% |
341
+ | `memory.fetch` without `memory.find` | large | `memory.find` → filter → `memory.fetch` | 80% |
342
+ | `session.list` unfiltered | 300 x N | `session.status` first, then `session.find` if needed | 90% |
343
+ | Reading full epic tree | 1000-3000 | `tasks.next` for suggestions | 80% |
344
+
345
+ ---
346
+
347
+ ## Anti-Pattern Reference
348
+
349
+ | Bad Pattern | Correct Pattern | Why |
350
+ |-------------|----------------|-----|
351
+ | `research.list` | `pipeline.manifest.list` | research domain is defunct |
352
+ | `research.show` | `pipeline.manifest.show` | research domain is defunct |
353
+ | `research.link` / `cleo research link` | `memory.link` (MCP) | research domain is defunct |
354
+ | `system.dash` | `admin.dash` | system domain is defunct |
355
+ | `system.context` | `admin.context` | system domain is defunct |
356
+ | `skills.list` | `tools.skill.list` | skills domain is defunct |
357
+ | `skills.show` | `tools.skill.show` | skills domain is defunct |
358
+ | `tasks.list` (no filter) | `tasks.find {query: "..."}` | list returns ALL tasks + notes |
359
+ | `tasks.reopen` | `tasks.restore {from: "done"}` | reopen is deprecated verb |
360
+ | `tasks.unarchive` | `tasks.restore {from: "archive"}` | unarchive is deprecated verb |
361
+ | `tasks.promote` | `tasks.reparent {newParentId: null}` | promote is deprecated verb |
362
+ | `memory.brain.search` | `memory.find` | old operation name (cutover T5241) |
363
+ | `memory.brain.observe` | `memory.observe` | old operation name (cutover T5241) |
364
+ | `session.context.inject` | `admin.context.inject` | operation moved domains (reads filesystem, is an admin/bootstrap op) |
365
+ | `memory.fetch` without `memory.find` | `memory.find` → filter → `memory.fetch` | fetch without filter returns everything |
366
+ | Completing task without manifest append | `pipeline.manifest.append` then `tasks.complete` | BASE protocol violation (exit 62) |
367
+ | Skipping `session.status` at start | Always check `session.status` first | loses prior context, causes duplicate work |
368
+
369
+ ---
370
+
371
+ ## Progressive Disclosure
372
+
373
+ Load only what you need. Escalate tiers when the task demands it:
374
+
375
+ **Stay at Tier 0** (default — 80% of work):
376
+ - Single task execution (implement, fix, test)
377
+ - Task discovery and status updates
378
+ - Session start/end
379
+
380
+ **Escalate to Tier 1** when:
381
+ - Managing pipeline stages or manifest entries
382
+ - Running validation/compliance checks
383
+ - Working with memory (timeline, fetch, decisions, patterns)
384
+ - Orchestrating multi-agent workflows
385
+
386
+ **Escalate to Tier 2** when (via `admin.help {tier:2}` first):
387
+ - WarpChain pipeline operations (`pipeline.chain.*`)
388
+ - Behavioral grading (`check.grade`)
389
+ - Cross-project nexus deep queries (`nexus.resolve`, `nexus.graph`)
390
+ - Data export/import (`admin.export`, `admin.import`)
391
+
392
+ ---
393
+
394
+ ## Session Protocol
395
+
396
+ Sessions track work context across agent interactions.
397
+
398
+ ### Quick Start
399
+
400
+ ```bash
401
+ # 1. CHECK session state first (always)
402
+ ct session status
403
+
404
+ # 2. RESUME or START
405
+ ct session resume <id>
406
+ # OR (only if no suitable session):
407
+ ct session start --scope epic:T001
408
+
409
+ # 3. WORK
410
+ ct current / ct next / ct complete T005 / ct start T006
411
+
412
+ # 4. END (ALWAYS when stopping)
413
+ ct complete <id>
414
+ ct session end
415
+ ```
416
+
417
+ ### MCP Session Operations
418
+
419
+ ```javascript
420
+ query({ domain: "session", operation: "status" })
421
+ query({ domain: "session", operation: "handoff.show" })
422
+ mutate({ domain: "session", operation: "start", params: { scope: "epic:T001" }})
423
+ mutate({ domain: "session", operation: "end", params: { note: "Progress" }})
424
+ ```
425
+
426
+ ---
427
+
428
+ ## Error Handling
429
+
430
+ **CRITICAL: NEVER ignore exit codes. Failed commands = tasks NOT created/updated.**
431
+
432
+ After EVERY command:
433
+ 1. Exit code `0` = success, `1-22` = error, `100+` = special (not error)
434
+ 2. JSON `"success": false` = operation failed
435
+ 3. Execute `error.fix` — copy-paste-ready fix command
436
+
437
+ | Exit | Code | Fix |
438
+ |:----:|------|-----|
439
+ | 4 | `E_NOT_FOUND` | Use `ct find` to verify |
440
+ | 6 | `E_VALIDATION_*` | Check field lengths, escape `$` as `\$` |
441
+ | 10 | `E_PARENT_NOT_FOUND` | Verify with `ct find <parent-id>` |
442
+ | 11 | `E_DEPTH_EXCEEDED` | Max depth 3 (epic->task->subtask) |
443
+ | 12 | `E_SIBLING_LIMIT` | Max 7 siblings per parent |
444
+ | 62 | `MANIFEST_ENTRY_MISSING` | Subagent must call `pipeline.manifest.append` before `tasks.complete` |
445
+
446
+ ---
447
+
448
+ ## RCASD-IVTR+C Lifecycle (LOOM)
449
+
450
+ **LOOM** (Logical Order of Operations Methodology) is the systematic framework for how CLEO processes project threads through the RCASD-IVTR+C pipeline. See `docs/concepts/CLEO-VISION.md` for the complete LOOM framework.
451
+
452
+ **Lifecycle**: See `references/loom-lifecycle.md` for gate enforcement and subagent architecture.
453
+
454
+ ## Pipeline Awareness
455
+
456
+ Epics follow the RCASD-IVTR+C lifecycle managed through pipeline stages. Use `pipeline.stage.status` to check where an epic is in its lifecycle:
457
+
458
+ | Stage | Purpose |
459
+ |-------|---------|
460
+ | `research` | Information gathering and analysis |
461
+ | `consensus` | Validate claims and decisions |
462
+ | `architecture_decision` | ADR and specification |
463
+ | `specification` | Formal requirements |
464
+ | `decomposition` | Task breakdown |
465
+ | `implementation` | Build functionality |
466
+ | `validation` | Verify against criteria |
467
+ | `testing` | Test coverage |
468
+ | `release` | Version and publish |
469
+ | `contribution` | Multi-agent consensus tracking |
470
+
471
+ ---
472
+
473
+ ## Time Estimates Prohibited
474
+
475
+ - **MUST NOT** estimate hours, days, weeks, or temporal duration
476
+ - **MUST** use relative sizing: `small` / `medium` / `large`
477
+ - **SHOULD** describe scope, complexity, dependencies when asked
478
+
479
+ ---
480
+
481
+ ## References
482
+
483
+ For detailed guidance on specific topics, see:
484
+
485
+ - **Session Protocol**: `references/session-protocol.md`
486
+ - **LOOM Lifecycle**: `references/loom-lifecycle.md`
487
+ - **Anti-Patterns**: `references/anti-patterns.md`
488
+ - **Operation Constitution**: `docs/specs/CLEO-OPERATION-CONSTITUTION.md`
489
+ - **Verb Standards**: `docs/specs/VERB-STANDARDS.md`
490
+ - **Decision Tree source**: `.cleo/agent-outputs/T5610-decision-tree.md`
@@ -0,0 +1,19 @@
1
+ # Anti-Patterns
2
+
3
+ ## Orchestrator Anti-Patterns
4
+
5
+ | Pattern | Problem | Solution |
6
+ |---------|---------|----------|
7
+ | Reading full files | Context bloat | Read manifest summaries only |
8
+ | Implementing code | Role violation | Delegate to cleo-subagent |
9
+ | Parallel spawns | Race conditions | Sequential per dependency wave |
10
+ | Unresolved tokens | Subagent failure | Verify `tokenResolution.fullyResolved` |
11
+
12
+ ## Subagent Anti-Patterns
13
+
14
+ | Pattern | Problem | Solution |
15
+ |---------|---------|----------|
16
+ | Returning content | Context bloat | Return only summary message |
17
+ | Pretty-printed JSON | Invalid manifest | Single-line JSON |
18
+ | Loading skills via `@` | Cannot resolve | Skills injected by orchestrator |
19
+ | Skipping task start | Protocol violation | Always `cleo start` first |
@@ -0,0 +1,136 @@
1
+ # LOOM Lifecycle (Detailed)
2
+
3
+ **LOOM** (Logical Order of Operations Methodology) is the systematic framework for how CLEO processes project threads through the RCASD-IVTR+C pipeline. This document details the lifecycle stages and gate enforcement.
4
+
5
+ See `docs/concepts/CLEO-VISION.md` for the complete LOOM framework, neural hierarchy model, and brain metaphor mapping.
6
+
7
+ ## Pipeline Stages
8
+
9
+ ```
10
+ LOOM (RCASD-IVTR+C) PIPELINE:
11
+
12
+ RCASD (Planning Phase):
13
+ Research -> Consensus -> Architecture Decision -> Specification -> Decomposition
14
+ |
15
+ v
16
+ IVTR (Execution Phase):
17
+ Implementation -> Validation -> Testing -> Release
18
+
19
+ +C (Cross-Cutting):
20
+ Contribution (applies across all stages)
21
+ ```
22
+
23
+ Each stage has a **lifecycle gate**. Entering a later stage requires prior stages to be `completed` or `skipped`. Gate enforcement mode is configured in `.cleo/config.json` (`strict` | `advisory` | `off`).
24
+
25
+ ## Conditional Protocols (9 Types)
26
+
27
+ | Protocol | Keywords | Use Case |
28
+ |----------|----------|----------|
29
+ | Research | research, investigate, explore | Information gathering |
30
+ | Consensus | vote, validate, decide | Multi-agent decisions |
31
+ | Specification | spec, rfc, design | Document creation |
32
+ | Decomposition | epic, plan, decompose | Task breakdown |
33
+ | Implementation | implement, build, create | Code execution |
34
+ | Contribution | PR, merge, shared | Work attribution |
35
+ | Release | release, version, publish | Version management |
36
+ | Artifact Publish | publish, artifact, package | Artifact distribution |
37
+ | Provenance | provenance, attestation, SLSA | Supply chain integrity |
38
+
39
+ ## Lifecycle Gate Enforcement
40
+
41
+ CLEO enforces LOOM (RCASD-IVTR+C) lifecycle progression through automatic gate checks at spawn time.
42
+
43
+ ```
44
+ research --+---> consensus --+---> architecture_decision --+---> specification --+---> decomposition
45
+ | | | |
46
+ | GATE | GATE | GATE | GATE
47
+ | | | |
48
+ +-----------------+------------------------------+--------------------+---> implementation --+---> release
49
+ |
50
+ validation/testing
51
+ ```
52
+
53
+ | Enforcement Mode | On Gate Failure | Default |
54
+ |------------------|-----------------|---------|
55
+ | `strict` | Blocks spawn with exit 75 | yes |
56
+ | `advisory` | Warns but proceeds | |
57
+ | `off` | Skips all checks | |
58
+
59
+ ### Emergency Bypass
60
+
61
+ ```bash
62
+ cleo config set lifecycleEnforcement.mode off
63
+ # ... emergency work ...
64
+ cleo config set lifecycleEnforcement.mode strict
65
+ ```
66
+
67
+ ## Architecture Overview
68
+
69
+ CLEO implements a **2-tier universal subagent architecture**:
70
+
71
+ ```
72
+ Tier 0: ORCHESTRATOR (ct-orchestrator)
73
+ |
74
+ +-- Coordinates complex workflows
75
+ +-- Spawns subagents via Task tool
76
+ +-- Pre-resolves ALL tokens before spawn
77
+ +-- Reads only manifest summaries (not full content)
78
+ |
79
+ v
80
+ Tier 1: CLEO-SUBAGENT (universal executor)
81
+ |
82
+ +-- Receives fully-resolved prompts
83
+ +-- Loads skill via protocol injection
84
+ +-- Executes delegated work
85
+ +-- Outputs: file + manifest entry + summary
86
+ ```
87
+
88
+ **Core Principle**: One universal subagent type (`cleo-subagent`) with context-specific protocols -- NOT skill-specific agents.
89
+
90
+ ## Protocol Stack
91
+
92
+ Every spawn combines two layers:
93
+
94
+ ```
95
+ +------------------------------------------+
96
+ | CONDITIONAL PROTOCOL (task-specific) |
97
+ | - research.md, implementation.md, etc. |
98
+ +------------------------------------------+
99
+ | BASE PROTOCOL (always loaded) |
100
+ | - Lifecycle, output format, constraints |
101
+ +------------------------------------------+
102
+ ```
103
+
104
+ ## Subagent (cleo-subagent)
105
+
106
+ ### Constraints (BASE)
107
+
108
+ | ID | Rule | Enforcement |
109
+ |----|------|-------------|
110
+ | BASE-001 | MUST append ONE line to MANIFEST.jsonl | Required |
111
+ | BASE-002 | MUST NOT return content in response | Required |
112
+ | BASE-003 | MUST complete task via `cleo complete` | Required |
113
+ | BASE-004 | MUST write output file before manifest | Required |
114
+ | BASE-005 | MUST start a task before beginning work | Required |
115
+ | BASE-006 | MUST NOT fabricate information | Required |
116
+ | BASE-007 | SHOULD link research to task | Recommended |
117
+
118
+ ### Subagent Lifecycle
119
+
120
+ ```
121
+ SPAWN -> INJECT -> EXECUTE -> OUTPUT -> RETURN
122
+ ```
123
+
124
+ 1. **SPAWN**: Orchestrator invokes Task tool
125
+ 2. **INJECT**: Subagent receives base protocol + conditional protocol
126
+ 3. **EXECUTE**: Follow skill-specific instructions
127
+ 4. **OUTPUT**: Write file + append manifest entry
128
+ 5. **RETURN**: Completion signal only (no content)
129
+
130
+ ### Return Messages
131
+
132
+ | Status | Message |
133
+ |--------|---------|
134
+ | Complete | `[Type] complete. See MANIFEST.jsonl for summary.` |
135
+ | Partial | `[Type] partial. See MANIFEST.jsonl for details.` |
136
+ | Blocked | `[Type] blocked. See MANIFEST.jsonl for blocker details.` |