@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,521 @@
1
+ ---
2
+ name: ct-contribution
3
+ description: >-
4
+ Guided workflow for multi-agent consensus contributions.
5
+ Use when user says "/contribution", "contribution protocol", "submit contribution",
6
+ "consensus workflow", "multi-agent decision", "create contribution",
7
+ "contribution start", "contribution submit", "detect conflicts",
8
+ "weighted consensus", "decision tracking", "conflict resolution".
9
+ version: 1.0.0
10
+ tier: 3
11
+ core: false
12
+ category: meta
13
+ protocol: contribution
14
+ dependencies: []
15
+ sharedResources:
16
+ - subagent-protocol-base
17
+ compatibility:
18
+ - claude-code
19
+ - cursor
20
+ - windsurf
21
+ - gemini-cli
22
+ license: MIT
23
+ ---
24
+
25
+ # Contribution Protocol Skill
26
+
27
+ You are a contribution protocol agent. Your role is to guide multi-agent consensus workflows through structured decision documentation, conflict detection, and consensus computation using JSON-first formats.
28
+
29
+ ## Overview
30
+
31
+ The Contribution Protocol enables:
32
+ - **Machine-parseable decisions** with confidence scores
33
+ - **Evidence-based rationale** with traceable references
34
+ - **Automated conflict detection** across parallel sessions
35
+ - **Weighted consensus computation** for multi-agent agreement
36
+
37
+ ### When to Use
38
+
39
+ | Scenario | Use Contribution Protocol? | Rationale |
40
+ |----------|---------------------------|-----------|
41
+ | Multi-agent research (2+ sessions) | **Yes** | Structured conflict detection |
42
+ | Consensus-building on architecture | **Yes** | Weighted voting, evidence tracking |
43
+ | RCASD-IVTR+C pipeline integration | **Yes** | JSON format enables automation |
44
+ | Single-agent research | No | Simpler research manifest sufficient |
45
+ | Quick decision with no alternatives | No | Protocol overhead not justified |
46
+
47
+ ---
48
+
49
+ ## Commands
50
+
51
+ ### `/contribution start <epic-id>`
52
+
53
+ Initialize contribution tracking for an epic.
54
+
55
+ **Usage**:
56
+ ```
57
+ /contribution start T2204
58
+ /contribution start T2204 --label rcsd-contrib
59
+ ```
60
+
61
+ **Workflow**:
62
+ 1. Verify epic exists and is active
63
+ 2. Create contribution task under epic
64
+ 3. Initialize contribution directories
65
+ 4. Generate contribution ID
66
+ 5. Return task ID and setup instructions
67
+
68
+ **Parameters**:
69
+ | Parameter | Description | Default |
70
+ |-----------|-------------|---------|
71
+ | `<epic-id>` | Parent epic task ID | Required |
72
+ | `--label` | Marker label for discovery | `consensus-source` |
73
+ | `--agent` | Agent identifier | Current agent |
74
+
75
+ ### `/contribution submit`
76
+
77
+ Validate and submit the current contribution.
78
+
79
+ **Usage**:
80
+ ```
81
+ /contribution submit
82
+ /contribution submit --task T2215
83
+ ```
84
+
85
+ **Workflow**:
86
+ 1. Validate contribution JSON against schema
87
+ 2. Compute checksum for integrity
88
+ 3. Append entry to CONTRIBUTIONS.jsonl manifest
89
+ 4. Update task notes with contribution reference
90
+ 5. Mark contribution status as `complete`
91
+ 6. Return submission confirmation
92
+
93
+ **Parameters**:
94
+ | Parameter | Description | Default |
95
+ |-----------|-------------|---------|
96
+ | `--task` | Contribution task ID | Current focused task |
97
+ | `--dry-run` | Validate without submitting | false |
98
+
99
+ ### `/contribution conflicts [epic-id]`
100
+
101
+ Detect conflicts between contributions for an epic.
102
+
103
+ **Usage**:
104
+ ```
105
+ /contribution conflicts T2204
106
+ /contribution conflicts --severity high
107
+ ```
108
+
109
+ **Workflow**:
110
+ 1. Load all contributions for epic
111
+ 2. Group decisions by questionId
112
+ 3. Compare answers for semantic conflicts
113
+ 4. Classify conflict type and severity
114
+ 5. Return conflict report with resolution suggestions
115
+
116
+ **Parameters**:
117
+ | Parameter | Description | Default |
118
+ |-----------|-------------|---------|
119
+ | `[epic-id]` | Epic to analyze | Current scope |
120
+ | `--severity` | Filter by severity | all |
121
+
122
+ **Output**:
123
+ ```json
124
+ {
125
+ "epicId": "T2204",
126
+ "conflictCount": 2,
127
+ "conflicts": [
128
+ {
129
+ "questionId": "ARCH-001",
130
+ "severity": "high",
131
+ "positions": [
132
+ {"agentId": "opus-1", "answer": "Position A", "confidence": 0.85},
133
+ {"agentId": "sonnet-1", "answer": "Position B", "confidence": 0.75}
134
+ ]
135
+ }
136
+ ]
137
+ }
138
+ ```
139
+
140
+ ### `/contribution status [epic-id]`
141
+
142
+ Show contribution progress and consensus status.
143
+
144
+ **Usage**:
145
+ ```
146
+ /contribution status
147
+ /contribution status T2204
148
+ ```
149
+
150
+ **Workflow**:
151
+ 1. Query manifest for epic contributions
152
+ 2. Calculate completion statistics
153
+ 3. Identify pending conflicts
154
+ 4. Show consensus progress per question
155
+ 5. Return status summary
156
+
157
+ **Output**:
158
+ ```json
159
+ {
160
+ "epicId": "T2204",
161
+ "totalContributions": 3,
162
+ "complete": 2,
163
+ "partial": 1,
164
+ "blocked": 0,
165
+ "conflictsPending": 2,
166
+ "questionsAnswered": 5,
167
+ "consensusReady": false
168
+ }
169
+ ```
170
+
171
+ ---
172
+
173
+ ## Workflow Guides
174
+
175
+ ### Starting a New Contribution
176
+
177
+ ```bash
178
+ # 1. Verify epic exists
179
+ ct show T2204
180
+
181
+ # 2. Initialize contribution
182
+ /contribution start T2204 --label rcsd-contrib
183
+
184
+ # 3. Create contribution task (if not auto-created)
185
+ ct add "Session B: Architecture Analysis" \
186
+ --parent T2204 \
187
+ --labels consensus-source,research \
188
+ --phase core
189
+
190
+ # 4. Start task
191
+ ct start T2215
192
+
193
+ # 5. Create contribution directory
194
+ mkdir -p .cleo/contributions
195
+
196
+ # 6. Generate contribution ID
197
+ source lib/contribution-protocol.sh
198
+ CONTRIB_ID=$(contribution_generate_id)
199
+ echo "Contribution ID: $CONTRIB_ID"
200
+ ```
201
+
202
+ ### Writing a Contribution
203
+
204
+ Create `.cleo/contributions/T2215.json`:
205
+
206
+ ```json
207
+ {
208
+ "$schema": "https://cleo-dev.com/schemas/v2/contribution.schema.json",
209
+ "_meta": {
210
+ "contributionId": "contrib_a1b2c3d4",
211
+ "protocolVersion": "2.0.0",
212
+ "createdAt": "2026-01-26T14:00:00Z",
213
+ "agentId": "opus-1",
214
+ "consensusReady": false
215
+ },
216
+ "sessionId": "session_20260126_140000_abc123",
217
+ "epicId": "T2204",
218
+ "taskId": "T2215",
219
+ "markerLabel": "consensus-source",
220
+ "researchOutputs": [],
221
+ "decisions": [
222
+ {
223
+ "questionId": "ARCH-001",
224
+ "question": "Single file or split file architecture?",
225
+ "answer": "Single JSON file with internal sections",
226
+ "confidence": 0.85,
227
+ "rationale": "Simplifies atomic updates and validation",
228
+ "evidence": [
229
+ {
230
+ "file": "lib/file-ops.sh",
231
+ "section": "atomic_write function",
232
+ "type": "code"
233
+ }
234
+ ]
235
+ }
236
+ ],
237
+ "conflicts": [],
238
+ "status": "draft"
239
+ }
240
+ ```
241
+
242
+ ### Submitting a Contribution
243
+
244
+ ```bash
245
+ # 1. Validate contribution
246
+ /contribution submit --dry-run
247
+
248
+ # 2. Submit contribution
249
+ /contribution submit --task T2215
250
+
251
+ # 3. Complete task
252
+ ct complete T2215
253
+ ```
254
+
255
+ ### Detecting and Resolving Conflicts
256
+
257
+ ```bash
258
+ # 1. Check for conflicts
259
+ /contribution conflicts T2204
260
+
261
+ # 2. Review conflict details
262
+ jq '.conflicts[] | select(.severity == "high")' .cleo/contributions/CONTRIBUTIONS.jsonl
263
+
264
+ # 3. Add conflict resolution to contribution
265
+ # Edit .cleo/contributions/T2215.json to add:
266
+ {
267
+ "conflicts": [
268
+ {
269
+ "questionId": "ARCH-001",
270
+ "conflictId": "conflict_b2c3d4e5",
271
+ "severity": "high",
272
+ "conflictType": "contradiction",
273
+ "thisSession": {
274
+ "position": "Single file architecture",
275
+ "confidence": 0.85,
276
+ "evidence": [...]
277
+ },
278
+ "otherSession": {
279
+ "sessionId": "session_...",
280
+ "position": "Split file architecture",
281
+ "confidence": 0.75,
282
+ "evidence": [...]
283
+ },
284
+ "rationale": "Different priorities: simplicity vs parallelism",
285
+ "resolution": {
286
+ "status": "proposed",
287
+ "resolutionType": "merge",
288
+ "proposal": "Single file with future split option"
289
+ },
290
+ "requiresConsensus": true
291
+ }
292
+ ]
293
+ }
294
+
295
+ # 4. Re-submit with conflict documentation
296
+ /contribution submit
297
+ ```
298
+
299
+ ---
300
+
301
+ ## JSON Format Reference
302
+
303
+ > **Authoritative Specification**: [CONTRIBUTION-FORMAT-SPEC.md](../../docs/specs/CONTRIBUTION-FORMAT-SPEC.md)
304
+ >
305
+ > **JSON Schema**: [contribution.schema.json](../../schemas/contribution.schema.json)
306
+
307
+ ### Decision Object
308
+
309
+ ```json
310
+ {
311
+ "questionId": "RCSD-001",
312
+ "question": "The decision question being answered",
313
+ "answer": "Concrete, actionable decision (no hedging)",
314
+ "confidence": 0.85,
315
+ "rationale": "Reasoning with evidence references",
316
+ "evidence": [
317
+ {
318
+ "file": "lib/file-ops.sh",
319
+ "section": "atomic_write function",
320
+ "quote": "temp file -> validate -> backup -> rename",
321
+ "line": 142,
322
+ "type": "code"
323
+ }
324
+ ],
325
+ "uncertaintyNote": "Required if confidence < 0.7",
326
+ "alternatives": [
327
+ {
328
+ "option": "Alternative considered",
329
+ "reason": "Why not chosen"
330
+ }
331
+ ]
332
+ }
333
+ ```
334
+
335
+ ### Confidence Score Semantics
336
+
337
+ | Range | Level | Requirements |
338
+ |-------|-------|--------------|
339
+ | 0.90-1.00 | Very High | MUST have 2+ independent evidence sources |
340
+ | 0.70-0.89 | High | MUST have at least 1 evidence source |
341
+ | 0.50-0.69 | Medium | SHOULD include `uncertaintyNote` |
342
+ | 0.30-0.49 | Low | MUST include `uncertaintyNote` |
343
+ | 0.00-0.29 | Tentative | MUST include `uncertaintyNote`, SHOULD NOT use for critical decisions |
344
+
345
+ ### Conflict Severity
346
+
347
+ | Severity | Definition | Action |
348
+ |----------|------------|--------|
349
+ | `critical` | Mutually exclusive positions | MUST resolve before merge |
350
+ | `high` | Significant implementation impact | SHOULD resolve before merge |
351
+ | `medium` | Both approaches viable | MAY defer resolution |
352
+ | `low` | Minor preference differences | MAY accept either |
353
+
354
+ ---
355
+
356
+ ## Library Integration
357
+
358
+ The skill uses functions from `lib/contribution-protocol.sh`:
359
+
360
+ ### contribution_generate_id()
361
+
362
+ Generate unique contribution ID.
363
+
364
+ ```bash
365
+ source lib/contribution-protocol.sh
366
+ id=$(contribution_generate_id)
367
+ echo "$id" # contrib_a1b2c3d4
368
+ ```
369
+
370
+ ### contribution_validate_task()
371
+
372
+ Validate task against contribution protocol requirements.
373
+
374
+ ```bash
375
+ source lib/contribution-protocol.sh
376
+ result=$(contribution_validate_task "T2215" "T2204" "consensus-source")
377
+ echo "$result" | jq '.valid'
378
+ ```
379
+
380
+ ### contribution_get_injection()
381
+
382
+ Get injection block for subagent prompts.
383
+
384
+ ```bash
385
+ source lib/contribution-protocol.sh
386
+ injection=$(contribution_get_injection "T2204" "claudedocs/protocol.md")
387
+ ```
388
+
389
+ ### contribution_create_manifest_entry()
390
+
391
+ Create a contribution manifest entry.
392
+
393
+ ```bash
394
+ source lib/contribution-protocol.sh
395
+ entry=$(contribution_create_manifest_entry \
396
+ "$CLEO_SESSION" \
397
+ "T2204" \
398
+ "T2215" \
399
+ "opus-1"
400
+ )
401
+ echo "$entry" | jq '.'
402
+ ```
403
+
404
+ ---
405
+
406
+ ## Task System Integration
407
+
408
+ @skills/_shared/task-system-integration.md
409
+
410
+ ### Execution Sequence
411
+
412
+ 1. Read task: `{{TASK_SHOW_CMD}} {{TASK_ID}}`
413
+ 2. Start task: `{{TASK_START_CMD}} {{TASK_ID}}` (if not already started)
414
+ 3. Create/load contribution JSON
415
+ 4. Document decisions with evidence
416
+ 5. Check for conflicts with baseline
417
+ 6. Submit contribution to manifest
418
+ 7. Complete task: `{{TASK_COMPLETE_CMD}} {{TASK_ID}}`
419
+ 8. Return summary message
420
+
421
+ ---
422
+
423
+ ## Directory Structure
424
+
425
+ ```
426
+ .cleo/contributions/
427
+ ├── CONTRIBUTIONS.jsonl # Append-only manifest
428
+ ├── T2204.json # Individual contribution files
429
+ ├── T2205.json
430
+ └── archive/ # Completed epic contributions
431
+ └── T1000/
432
+ ├── CONTRIBUTIONS.jsonl
433
+ └── *.json
434
+ ```
435
+
436
+ ---
437
+
438
+ ## Manifest Query Patterns
439
+
440
+ ### All contributions for an epic
441
+
442
+ ```bash
443
+ jq -s '[.[] | select(.epicId == "T2204")]' .cleo/contributions/CONTRIBUTIONS.jsonl
444
+ ```
445
+
446
+ ### Contributions with conflicts
447
+
448
+ ```bash
449
+ jq -s '[.[] | select(.conflictCount > 0)]' .cleo/contributions/CONTRIBUTIONS.jsonl
450
+ ```
451
+
452
+ ### Latest contribution for a task
453
+
454
+ ```bash
455
+ jq -s '[.[] | select(.taskId == "T2215")] | sort_by(.updatedAt) | .[-1]' .cleo/contributions/CONTRIBUTIONS.jsonl
456
+ ```
457
+
458
+ ### Summary statistics
459
+
460
+ ```bash
461
+ jq -s '{
462
+ total: length,
463
+ complete: [.[] | select(.status == "complete")] | length,
464
+ partial: [.[] | select(.status == "partial")] | length,
465
+ blocked: [.[] | select(.status == "blocked")] | length,
466
+ totalConflicts: [.[].conflictCount] | add
467
+ }' .cleo/contributions/CONTRIBUTIONS.jsonl
468
+ ```
469
+
470
+ ---
471
+
472
+ ## Completion Checklist
473
+
474
+ - [ ] Epic exists and is active
475
+ - [ ] Contribution task created with correct parent and label
476
+ - [ ] Task started
477
+ - [ ] Contribution JSON created with valid schema
478
+ - [ ] All decisions include rationale and evidence
479
+ - [ ] Low confidence decisions include uncertainty notes
480
+ - [ ] Conflicts with baseline documented
481
+ - [ ] Contribution submitted to manifest
482
+ - [ ] Task completed
483
+
484
+ ---
485
+
486
+ ## Error Handling
487
+
488
+ ### Validation Errors
489
+
490
+ | Error Code | Message | Fix |
491
+ |------------|---------|-----|
492
+ | `CONTRIB-001` | Session ID mismatch | Use active CLEO session |
493
+ | `CONTRIB-002` | Missing marker label | Add label to task |
494
+ | `CONTRIB-005` | Missing decisions | Document all key questions |
495
+ | `CONTRIB-007` | Missing rationale/evidence | Complete decision objects |
496
+ | `CONTRIB-011` | Vague answer language | Use concrete, unambiguous answers |
497
+
498
+ ### Recovery Patterns
499
+
500
+ **Checksum mismatch**:
501
+ ```bash
502
+ # Recompute checksum
503
+ jq 'del(._meta.checksum)' .cleo/contributions/T2215.json | sha256sum | cut -c1-16
504
+ ```
505
+
506
+ **Missing baseline reference**:
507
+ ```bash
508
+ # Query for prior contributions
509
+ jq -s '[.[] | select(.epicId == "T2204")] | .[0]' .cleo/contributions/CONTRIBUTIONS.jsonl
510
+ ```
511
+
512
+ ---
513
+
514
+ ## Related Documentation
515
+
516
+ | Document | Relationship |
517
+ |----------|--------------|
518
+ | [CONTRIBUTION-FORMAT-SPEC.md](../../docs/specs/CONTRIBUTION-FORMAT-SPEC.md) | **Authoritative** for JSON format |
519
+ | [contribution.schema.json](../../schemas/contribution.schema.json) | **Authoritative** for JSON Schema |
520
+ | [CONTRIBUTION-PROTOCOL-GUIDE.md](../../docs/guides/CONTRIBUTION-PROTOCOL-GUIDE.md) | Usage guide with examples |
521
+ | [CONSENSUS-FRAMEWORK-SPEC.md](../../docs/specs/CONSENSUS-FRAMEWORK-SPEC.md) | Consensus voting thresholds |
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://cleo-dev.com/schemas/v2/contribution.schema.json",
3
+ "_meta": {
4
+ "contributionId": "{{CONTRIBUTION_ID}}",
5
+ "protocolVersion": "2.0.0",
6
+ "createdAt": "{{TIMESTAMP}}",
7
+ "completedAt": null,
8
+ "agentId": "{{AGENT_ID}}",
9
+ "checksum": null,
10
+ "consensusReady": false
11
+ },
12
+ "sessionId": "{{SESSION_ID}}",
13
+ "epicId": "{{EPIC_ID}}",
14
+ "taskId": "{{TASK_ID}}",
15
+ "markerLabel": "{{MARKER_LABEL}}",
16
+ "researchOutputs": [],
17
+ "decisions": [],
18
+ "conflicts": [],
19
+ "baselineReference": null,
20
+ "status": "draft"
21
+ }