@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,433 @@
1
+ {
2
+ "$schema": "https://cleo-dev.com/schemas/v1/placeholders.schema.json",
3
+ "_meta": {
4
+ "version": "1.0.0",
5
+ "description": "Canonical registry of all template placeholders used in orchestrator protocol and skill templates",
6
+ "lastUpdated": "2026-01-26",
7
+ "tokenFormat": "{{TOKEN_NAME}}"
8
+ },
9
+ "required": [
10
+ {
11
+ "token": "TASK_ID",
12
+ "type": "string",
13
+ "pattern": "^T[0-9]+$",
14
+ "example": "T1234",
15
+ "description": "CLEO task ID"
16
+ },
17
+ {
18
+ "token": "DATE",
19
+ "type": "string",
20
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
21
+ "example": "2026-01-19",
22
+ "description": "ISO date (YYYY-MM-DD)",
23
+ "default": "$(date +%Y-%m-%d)"
24
+ },
25
+ {
26
+ "token": "TOPIC_SLUG",
27
+ "type": "string",
28
+ "pattern": "^[a-zA-Z0-9_-]+$",
29
+ "example": "auth-token-rotation",
30
+ "description": "Slugified topic name (lowercase, hyphenated, URL-safe)"
31
+ }
32
+ ],
33
+ "context": [
34
+ {
35
+ "token": "EPIC_ID",
36
+ "type": "string",
37
+ "pattern": "^T[0-9]+$",
38
+ "example": "T1000",
39
+ "description": "Parent epic ID",
40
+ "default": ""
41
+ },
42
+ {
43
+ "token": "SESSION_ID",
44
+ "type": "string",
45
+ "pattern": "^session_[0-9]{8}_[0-9]{6}_[a-f0-9]+$",
46
+ "example": "session_20260119_143500_abc123",
47
+ "description": "Current CLEO session ID",
48
+ "default": ""
49
+ },
50
+ {
51
+ "token": "RESEARCH_ID",
52
+ "type": "string",
53
+ "example": "auth-token-2026-01-19",
54
+ "description": "Research entry ID for manifest",
55
+ "default": ""
56
+ },
57
+ {
58
+ "token": "TITLE",
59
+ "type": "string",
60
+ "example": "Authentication Token Rotation",
61
+ "description": "Human-readable title",
62
+ "default": ""
63
+ },
64
+ {
65
+ "token": "OUTPUT_DIR",
66
+ "type": "path",
67
+ "example": "claudedocs/agent-outputs",
68
+ "description": "Output directory path for agent artifacts",
69
+ "default": "claudedocs/agent-outputs"
70
+ },
71
+ {
72
+ "token": "MANIFEST_PATH",
73
+ "type": "path",
74
+ "example": "claudedocs/agent-outputs/MANIFEST.jsonl",
75
+ "description": "Path to MANIFEST.jsonl file",
76
+ "default": "claudedocs/agent-outputs/MANIFEST.jsonl"
77
+ }
78
+ ],
79
+ "taskCommands": {
80
+ "_comment": "CLEO task system command tokens - enables portability",
81
+ "tokens": [
82
+ {
83
+ "token": "TASK_SHOW_CMD",
84
+ "default": "cleo show",
85
+ "description": "Command to show task details"
86
+ },
87
+ {
88
+ "token": "TASK_START_CMD",
89
+ "default": "cleo start",
90
+ "description": "Command to start working on task"
91
+ },
92
+ {
93
+ "token": "TASK_CURRENT_CMD",
94
+ "default": "cleo current",
95
+ "description": "Command to show current task"
96
+ },
97
+ {
98
+ "token": "TASK_COMPLETE_CMD",
99
+ "default": "cleo complete",
100
+ "description": "Command to complete task"
101
+ },
102
+ {
103
+ "token": "TASK_LINK_CMD",
104
+ "default": "cleo research link",
105
+ "description": "Command to link research to task"
106
+ },
107
+ {
108
+ "token": "TASK_LIST_CMD",
109
+ "default": "cleo list",
110
+ "description": "Command to list tasks"
111
+ },
112
+ {
113
+ "token": "TASK_FIND_CMD",
114
+ "default": "cleo find",
115
+ "description": "Command to find tasks"
116
+ },
117
+ {
118
+ "token": "TASK_ADD_CMD",
119
+ "default": "cleo add",
120
+ "description": "Command to add task"
121
+ },
122
+ {
123
+ "token": "SESSION_LIST_CMD",
124
+ "default": "cleo session list",
125
+ "description": "Command to list sessions"
126
+ },
127
+ {
128
+ "token": "SESSION_START_CMD",
129
+ "default": "cleo session start",
130
+ "description": "Command to start session"
131
+ },
132
+ {
133
+ "token": "SESSION_END_CMD",
134
+ "default": "cleo session end",
135
+ "description": "Command to end session"
136
+ },
137
+ {
138
+ "token": "DASH_CMD",
139
+ "default": "cleo dash",
140
+ "description": "Command to show dashboard"
141
+ },
142
+ {
143
+ "token": "RESEARCH_LIST_CMD",
144
+ "default": "cleo research list",
145
+ "description": "Command to list research entries"
146
+ },
147
+ {
148
+ "token": "RESEARCH_SHOW_CMD",
149
+ "default": "cleo research show",
150
+ "description": "Command to show research entry details"
151
+ },
152
+ {
153
+ "token": "RESEARCH_PENDING_CMD",
154
+ "default": "cleo research pending",
155
+ "description": "Command to show pending research followups"
156
+ },
157
+ {
158
+ "token": "RESEARCH_INJECT_CMD",
159
+ "default": "cleo research inject",
160
+ "description": "Command to inject subagent protocol block (supports --clipboard flag)"
161
+ },
162
+ {
163
+ "token": "SESSION_GC_CMD",
164
+ "default": "cleo session gc",
165
+ "description": "Command for session garbage collection (supports --include-active flag)"
166
+ },
167
+ {
168
+ "token": "TASK_EXISTS_CMD",
169
+ "default": "cleo exists",
170
+ "description": "Command to check if task ID exists (exit code 0/1)"
171
+ },
172
+ {
173
+ "token": "TASK_PHASE_CMD",
174
+ "default": "cleo phase show",
175
+ "description": "Command to show current project phase"
176
+ },
177
+ {
178
+ "token": "TASK_TREE_CMD",
179
+ "default": "cleo list --tree",
180
+ "description": "Command to show task hierarchy tree (use --parent for subtree)"
181
+ }
182
+ ]
183
+ },
184
+ "manifest": {
185
+ "_comment": "Tokens used when constructing MANIFEST.jsonl entries",
186
+ "tokens": [
187
+ {
188
+ "token": "MANIFEST_ID",
189
+ "type": "string",
190
+ "example": "topic-2026-01-19",
191
+ "description": "Unique manifest entry ID"
192
+ },
193
+ {
194
+ "token": "MANIFEST_FILE",
195
+ "type": "string",
196
+ "example": "2026-01-19_topic-slug.md",
197
+ "description": "Output filename"
198
+ },
199
+ {
200
+ "token": "MANIFEST_TITLE",
201
+ "type": "string",
202
+ "example": "Research on Topic",
203
+ "description": "Entry title"
204
+ },
205
+ {
206
+ "token": "MANIFEST_STATUS",
207
+ "type": "enum",
208
+ "enum": ["complete", "partial", "blocked"],
209
+ "default": "complete",
210
+ "description": "Entry status"
211
+ },
212
+ {
213
+ "token": "MANIFEST_TOPICS",
214
+ "type": "array",
215
+ "example": ["auth", "security"],
216
+ "description": "Topic tags"
217
+ },
218
+ {
219
+ "token": "MANIFEST_FINDINGS",
220
+ "type": "array",
221
+ "example": ["Finding 1", "Finding 2"],
222
+ "description": "Key findings (3-7 items)"
223
+ },
224
+ {
225
+ "token": "LINKED_TASKS",
226
+ "type": "array",
227
+ "example": ["T1234", "T1235"],
228
+ "description": "Related CLEO task IDs"
229
+ },
230
+ {
231
+ "token": "NEEDS_FOLLOWUP",
232
+ "type": "array",
233
+ "default": [],
234
+ "description": "Tasks requiring follow-up"
235
+ }
236
+ ]
237
+ },
238
+ "taskContext": {
239
+ "_comment": "Task-specific tokens populated by orchestrator from CLEO task data",
240
+ "tokens": [
241
+ {
242
+ "token": "TASK_TITLE",
243
+ "type": "string",
244
+ "example": "Implement login endpoint",
245
+ "description": "Task title from CLEO (task.title)",
246
+ "source": "task.title"
247
+ },
248
+ {
249
+ "token": "TASK_NAME",
250
+ "type": "string",
251
+ "example": "Implement login endpoint",
252
+ "description": "Alias for TASK_TITLE (for backward compatibility)",
253
+ "source": "task.title"
254
+ },
255
+ {
256
+ "token": "TASK_DESCRIPTION",
257
+ "type": "string",
258
+ "example": "Create POST /api/login endpoint with JWT authentication...",
259
+ "description": "Task description from CLEO (task.description)",
260
+ "source": "task.description"
261
+ },
262
+ {
263
+ "token": "TASK_INSTRUCTIONS",
264
+ "type": "string",
265
+ "example": "Create POST /api/login endpoint with JWT authentication...",
266
+ "description": "Task instructions (defaults to task.description, can be custom)",
267
+ "source": "task.description"
268
+ },
269
+ {
270
+ "token": "TOPICS_JSON",
271
+ "type": "array",
272
+ "example": "[\"auth\", \"api\", \"security\"]",
273
+ "description": "Task labels as JSON array",
274
+ "source": "task.labels"
275
+ },
276
+ {
277
+ "token": "DEPENDS_LIST",
278
+ "type": "string",
279
+ "example": "T1001, T1002",
280
+ "description": "Comma-separated dependency IDs",
281
+ "source": "task.depends",
282
+ "default": ""
283
+ },
284
+ {
285
+ "token": "ACCEPTANCE_CRITERIA",
286
+ "type": "string",
287
+ "example": "Tests pass, API responds with valid JWT",
288
+ "description": "Acceptance criteria (extracted from description or default)",
289
+ "default": "Task completed successfully per description"
290
+ },
291
+ {
292
+ "token": "DELIVERABLES_LIST",
293
+ "type": "string",
294
+ "example": "1. API endpoint\\n2. Unit tests\\n3. Documentation",
295
+ "description": "List of deliverables (extracted from description or default)",
296
+ "default": "Implementation per task description"
297
+ },
298
+ {
299
+ "token": "MANIFEST_SUMMARIES",
300
+ "type": "string",
301
+ "example": "Previous research found: auth tokens should rotate every 24h",
302
+ "description": "Context from previous subagent manifest entries",
303
+ "default": ""
304
+ },
305
+ {
306
+ "token": "NEXT_TASK_IDS",
307
+ "type": "string",
308
+ "example": "T1003, T1004",
309
+ "description": "Follow-up task IDs to add to needs_followup",
310
+ "default": ""
311
+ }
312
+ ]
313
+ },
314
+ "skillSpecific": {
315
+ "epicArchitect": [
316
+ {
317
+ "token": "FEATURE_SLUG",
318
+ "type": "string",
319
+ "example": "user-authentication",
320
+ "description": "Slugified feature name"
321
+ },
322
+ {
323
+ "token": "FEATURE_NAME",
324
+ "type": "string",
325
+ "example": "User Authentication",
326
+ "description": "Human-readable feature name"
327
+ },
328
+ {
329
+ "token": "FEATURE_DESCRIPTION",
330
+ "type": "string",
331
+ "example": "Implement JWT-based authentication...",
332
+ "description": "Full description from epic"
333
+ }
334
+ ],
335
+ "validator": [
336
+ {
337
+ "token": "TEST_SCOPE",
338
+ "type": "enum",
339
+ "enum": ["unit", "integration", "e2e"],
340
+ "description": "Test scope to execute"
341
+ },
342
+ {
343
+ "token": "TARGET_PATH",
344
+ "type": "path",
345
+ "example": "src/auth/",
346
+ "description": "Path to validate"
347
+ }
348
+ ],
349
+ "taskExecutor": [
350
+ {
351
+ "token": "TASK_TITLE",
352
+ "type": "string",
353
+ "example": "Implement login endpoint",
354
+ "description": "Task title (from taskContext.TASK_TITLE)",
355
+ "inherits": "taskContext.TASK_TITLE"
356
+ },
357
+ {
358
+ "token": "TASK_NAME",
359
+ "type": "string",
360
+ "example": "Implement login endpoint",
361
+ "description": "Alias for TASK_TITLE (from taskContext.TASK_NAME)",
362
+ "inherits": "taskContext.TASK_NAME"
363
+ },
364
+ {
365
+ "token": "TASK_DESCRIPTION",
366
+ "type": "string",
367
+ "example": "Create POST /api/login with JWT auth...",
368
+ "description": "Task description (from taskContext.TASK_DESCRIPTION)",
369
+ "inherits": "taskContext.TASK_DESCRIPTION"
370
+ },
371
+ {
372
+ "token": "TASK_INSTRUCTIONS",
373
+ "type": "string",
374
+ "example": "1. Create endpoint\\n2. Add JWT validation\\n3. Return token",
375
+ "description": "Execution instructions (from taskContext.TASK_INSTRUCTIONS)",
376
+ "inherits": "taskContext.TASK_INSTRUCTIONS"
377
+ },
378
+ {
379
+ "token": "DELIVERABLES_LIST",
380
+ "type": "string",
381
+ "example": "1. API endpoint\\n2. Unit tests\\n3. Documentation",
382
+ "description": "Expected outputs (from taskContext.DELIVERABLES_LIST)",
383
+ "inherits": "taskContext.DELIVERABLES_LIST"
384
+ },
385
+ {
386
+ "token": "ACCEPTANCE_CRITERIA",
387
+ "type": "string",
388
+ "example": "Tests pass, API responds with valid JWT",
389
+ "description": "Completion criteria (from taskContext.ACCEPTANCE_CRITERIA)",
390
+ "inherits": "taskContext.ACCEPTANCE_CRITERIA"
391
+ },
392
+ {
393
+ "token": "DEPENDS_LIST",
394
+ "type": "string",
395
+ "example": "T1001, T1002",
396
+ "description": "Completed dependencies (from taskContext.DEPENDS_LIST)",
397
+ "inherits": "taskContext.DEPENDS_LIST"
398
+ },
399
+ {
400
+ "token": "TOPICS_JSON",
401
+ "type": "array",
402
+ "example": "[\"auth\", \"api\"]",
403
+ "description": "Task labels as JSON (from taskContext.TOPICS_JSON)",
404
+ "inherits": "taskContext.TOPICS_JSON"
405
+ },
406
+ {
407
+ "token": "MANIFEST_SUMMARIES",
408
+ "type": "string",
409
+ "example": "Previous: auth tokens rotate every 24h",
410
+ "description": "Context from previous agents (from taskContext.MANIFEST_SUMMARIES)",
411
+ "inherits": "taskContext.MANIFEST_SUMMARIES"
412
+ },
413
+ {
414
+ "token": "NEXT_TASK_IDS",
415
+ "type": "string",
416
+ "example": "T1003, T1004",
417
+ "description": "Follow-up task IDs (from taskContext.NEXT_TASK_IDS)",
418
+ "inherits": "taskContext.NEXT_TASK_IDS"
419
+ }
420
+ ]
421
+ },
422
+ "conventions": {
423
+ "naming": "ALL_CAPS with underscores for multi-word names",
424
+ "format": "Enclosed in double curly braces: {{TOKEN_NAME}}",
425
+ "validation": {
426
+ "string": "Non-empty UTF-8 text",
427
+ "date": "ISO 8601 (YYYY-MM-DD)",
428
+ "path": "Unix path with valid characters",
429
+ "enum": "Exact match required",
430
+ "array": "Valid JSON array"
431
+ }
432
+ }
433
+ }
@@ -0,0 +1,237 @@
1
+ # Skill Chaining Patterns
2
+
3
+ This reference defines patterns for multi-level skill invocation and context propagation across agent boundaries.
4
+
5
+ ---
6
+
7
+ ## Pattern Overview
8
+
9
+ | Pattern | Description | Use Case |
10
+ |---------|-------------|----------|
11
+ | Single-level | Orchestrator spawns one skill | Simple task delegation |
12
+ | Skill chaining | Skill invokes other skills | Workflow orchestration |
13
+ | Multi-level | Subagent becomes orchestrator | Complex nested workflows |
14
+
15
+ ---
16
+
17
+ ## Pattern 1: Single-Level Spawning
18
+
19
+ The orchestrator delegates work to a subagent via `orchestrate.spawn` with skill injection.
20
+
21
+ ### Flow
22
+
23
+ ```
24
+ ┌─────────────────┐
25
+ │ ORCHESTRATOR │
26
+ │ (ct-orchestrator)
27
+ └────────┬────────┘
28
+ │ orchestrate.spawn → provider adapter
29
+
30
+ ┌─────────────────┐
31
+ │ SUBAGENT │
32
+ │ (ct-research-agent)
33
+ └─────────────────┘
34
+ ```
35
+
36
+ ### Implementation
37
+
38
+ ```
39
+ # 1. Generate fully-resolved spawn prompt via MCP
40
+ mutate({ domain: "orchestrate", operation: "spawn", params: { taskId: "T1234" }})
41
+
42
+ # 2. Provider adapter executes the prompt using its native mechanism
43
+ # - Claude Code: Task tool with cleo-subagent type
44
+ # - OpenCode: config-driven agent spawn
45
+ # - Codex: SDK agent creation
46
+ # - Others: file-based prompt handoff
47
+ ```
48
+
49
+ ### Context Propagation
50
+
51
+ - **Input**: Task ID, skill template, previous manifest key_findings
52
+ - **Output**: Manifest entry with key_findings for next agent
53
+ - **Response**: "Research complete. See MANIFEST.jsonl for summary."
54
+
55
+ ---
56
+
57
+ ## Pattern 2: Skill Chaining
58
+
59
+ A skill invokes other skills to complete workflow phases. The loaded skill maintains context while delegating specialized work.
60
+
61
+ ### Example: ct-documentor
62
+
63
+ ```
64
+ ┌─────────────────────┐
65
+ │ ct-documentor │ ← Loaded by user request
66
+ │ (Documentation │
67
+ │ Specialist) │
68
+ └─────────┬───────────┘
69
+
70
+ ┌─────┴─────┬────────────┐
71
+ ▼ ▼ ▼
72
+ ┌───────┐ ┌────────┐ ┌─────────┐
73
+ │lookup │ │ write │ │ review │
74
+ │(Phase │ │(Phase │ │(Phase │
75
+ │ 1) │ │ 3) │ │ 4) │
76
+ └───────┘ └────────┘ └─────────┘
77
+ ```
78
+
79
+ ### Skill Invocation Methods
80
+
81
+ ```markdown
82
+ # Via Skill tool (programmatic)
83
+ Skill(skill="ct-docs-lookup")
84
+ Skill(skill="ct-docs-write")
85
+ Skill(skill="ct-docs-review")
86
+
87
+ # Via slash command (user-facing)
88
+ /ct-docs-lookup
89
+ /ct-docs-write
90
+ /ct-docs-review
91
+ ```
92
+
93
+ ### When to Use Skill Chaining
94
+
95
+ | Scenario | Pattern |
96
+ |----------|---------|
97
+ | Workflow has distinct phases | Chain skills for each phase |
98
+ | Skills share common context | Parent skill maintains state |
99
+ | Quality gates between phases | Invoke review skill before completion |
100
+ | Specialized expertise needed | Delegate to domain-specific skill |
101
+
102
+ ### Context Management
103
+
104
+ **Within skill chain (same agent)**:
105
+ - Skills share the agent's context window
106
+ - State persists between skill invocations
107
+ - No manifest needed for internal handoffs
108
+
109
+ **Across agent boundaries**:
110
+ - Use manifest for key_findings only
111
+ - Write detailed output to files
112
+ - Return minimal response to preserve parent context
113
+
114
+ ---
115
+
116
+ ## Pattern 3: Multi-Level Orchestration
117
+
118
+ A subagent can itself become an orchestrator, spawning further subagents for complex nested workflows.
119
+
120
+ ### Flow
121
+
122
+ ```
123
+ ┌─────────────────────┐
124
+ │ ORCHESTRATOR │ Level 0: Main workflow
125
+ │ (ct-orchestrator) │
126
+ └─────────┬───────────┘
127
+ │ orchestrate.spawn
128
+
129
+ ┌─────────────────────┐
130
+ │ SUB-ORCHESTRATOR │ Level 1: Epic decomposition
131
+ │ (ct-epic-architect) │
132
+ └─────────┬───────────┘
133
+ │ orchestrate.spawn
134
+
135
+ ┌─────────────────────┐
136
+ │ WORKER AGENT │ Level 2: Task execution
137
+ │ (ct-task-executor) │
138
+ └─────────────────────┘
139
+ ```
140
+
141
+ ### Guidelines for Multi-Level
142
+
143
+ 1. **Depth limit**: SHOULD NOT exceed 3 levels (diminishing returns)
144
+ 2. **Context budget**: Each level MUST stay under 10K tokens
145
+ 3. **Manifest propagation**: Each level writes to shared manifest
146
+ 4. **Response contract**: Each level returns only summary message
147
+
148
+ ### When Multi-Level is Appropriate
149
+
150
+ | Use Case | Levels | Structure |
151
+ |----------|--------|-----------|
152
+ | Simple research | 1 | Orchestrator → Researcher |
153
+ | Epic planning | 2 | Orchestrator → Architect → Executor |
154
+ | Complex pipeline | 3 | Orchestrator → Coordinator → Workers |
155
+
156
+ ---
157
+
158
+ ## Context Boundary Rules
159
+
160
+ ### Rule 1: Manifest for Handoffs (MUST)
161
+
162
+ ```json
163
+ // Subagent appends ONE line to MANIFEST.jsonl
164
+ {"id":"topic-2026-01-20","key_findings":["Finding 1","Finding 2"],"needs_followup":["T1235"]}
165
+ ```
166
+
167
+ Parent reads only key_findings, not full research files.
168
+
169
+ ### Rule 2: Minimal Response (MUST)
170
+
171
+ ```
172
+ Subagent MUST return ONLY: "Research complete. See MANIFEST.jsonl for summary."
173
+ Subagent MUST NOT return research content in response.
174
+ ```
175
+
176
+ ### Rule 3: File-Based Details (MUST)
177
+
178
+ Detailed findings go to output files, not manifest or response:
179
+ - Full analysis → `{{OUTPUT_DIR}}/YYYY-MM-DD_topic.md`
180
+ - Summary only → `MANIFEST.jsonl` key_findings array
181
+
182
+ ### Rule 4: Token Injection (SHOULD)
183
+
184
+ All tokens are resolved before prompt injection via `orchestrate.spawn`:
185
+
186
+ ```
187
+ # Required tokens for all subagents
188
+ TASK_ID # Current task identifier
189
+ DATE # Execution date (YYYY-MM-DD)
190
+ TOPIC_SLUG # URL-safe topic name
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Anti-Patterns
196
+
197
+ | Pattern | Problem | Solution |
198
+ |---------|---------|----------|
199
+ | Reading full files at parent | Context explosion | Use manifest key_findings |
200
+ | Returning research content | Context bloat | Return summary message only |
201
+ | Parallel subagent spawning | Race conditions | Sequential spawning only |
202
+ | Deep nesting (4+ levels) | Coordination overhead | Flatten to 3 levels max |
203
+ | Skipping manifest entry | Lost handoff | Always append manifest |
204
+
205
+ ---
206
+
207
+ ## Implementation Checklist
208
+
209
+ Before spawning subagent:
210
+ - [ ] Identify appropriate skill for task type
211
+ - [ ] Prepare token context (TASK_ID, DATE, TOPIC_SLUG)
212
+ - [ ] Use `orchestrate.spawn` to generate fully-resolved prompt
213
+ - [ ] Verify token resolution is complete (`tokenResolution.fullyResolved`)
214
+
215
+ Before chaining to another skill:
216
+ - [ ] Determine if skill shares context (same agent) or needs delegation
217
+ - [ ] For same-agent: Use `Skill(skill="name")` or `/skill-name`
218
+ - [ ] For new agent: Use `orchestrate.spawn` with full protocol injection
219
+
220
+ Before completion:
221
+ - [ ] Verify manifest entry appended
222
+ - [ ] Confirm output file written
223
+ - [ ] Return ONLY the summary message
224
+
225
+ ---
226
+
227
+ ## Reference Skills
228
+
229
+ | Skill | Demonstrates |
230
+ |-------|--------------|
231
+ | `ct-orchestrator` | Single-level spawning via orchestrate.spawn |
232
+ | `ct-documentor` | Skill chaining (lookup → write → review) |
233
+ | `ct-epic-architect` | Potential multi-level orchestration |
234
+
235
+ See also:
236
+ - @skills/_shared/subagent-protocol-base.md
237
+ - @skills/_shared/task-system-integration.md