@cleocode/cleo 2026.3.2 → 2026.3.6

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 (76) hide show
  1. package/README.md +1 -3
  2. package/dist/cli/index.js +7381 -3507
  3. package/dist/cli/index.js.map +4 -4
  4. package/dist/mcp/index.js +5792 -2097
  5. package/dist/mcp/index.js.map +4 -4
  6. package/package.json +4 -4
  7. package/packages/ct-skills/index.js +1 -1
  8. package/packages/ct-skills/package.json +0 -2
  9. package/packages/ct-skills/profiles/core.json +1 -1
  10. package/packages/ct-skills/profiles/full.json +4 -5
  11. package/packages/ct-skills/profiles/minimal.json +3 -3
  12. package/packages/ct-skills/profiles/recommended.json +2 -2
  13. package/packages/ct-skills/provider-skills-map.json +97 -0
  14. package/packages/ct-skills/skills/_shared/skill-chaining-patterns.md +23 -26
  15. package/packages/ct-skills/skills/_shared/testing-framework-config.md +9 -9
  16. package/packages/ct-skills/skills/ct-cleo/SKILL.md +21 -1
  17. package/packages/ct-skills/skills/ct-dev-workflow/SKILL.md +1 -1
  18. package/packages/ct-skills/skills/ct-documentor/SKILL.md +1 -1
  19. package/packages/ct-skills/skills/ct-epic-architect/SKILL.md +1 -1
  20. package/packages/ct-skills/skills/ct-grade/SKILL.md +214 -0
  21. package/packages/ct-skills/skills/ct-orchestrator/SKILL.md +119 -43
  22. package/packages/ct-skills/skills/ct-orchestrator/orchestrator-prompt.txt +17 -0
  23. package/packages/ct-skills/skills/ct-orchestrator/references/orchestrator-patterns.md +1 -1
  24. package/packages/ct-skills/skills/ct-research-agent/SKILL.md +1 -1
  25. package/packages/ct-skills/skills/ct-spec-writer/SKILL.md +1 -1
  26. package/packages/ct-skills/skills/ct-task-executor/SKILL.md +1 -1
  27. package/packages/ct-skills/skills/ct-validator/SKILL.md +1 -1
  28. package/packages/ct-skills/skills/manifest.json +217 -947
  29. package/packages/ct-skills/skills.json +244 -3
  30. package/templates/CLEO-INJECTION.md +37 -0
  31. package/templates/README.md +4 -4
  32. package/templates/cleo-gitignore +3 -11
  33. package/templates/git-hooks/pre-commit +1 -1
  34. package/packages/ct-skills/protocols/agent-protocol.md +0 -260
  35. package/packages/ct-skills/protocols/artifact-publish.md +0 -587
  36. package/packages/ct-skills/protocols/consensus.md +0 -309
  37. package/packages/ct-skills/protocols/contribution.md +0 -375
  38. package/packages/ct-skills/protocols/decomposition.md +0 -352
  39. package/packages/ct-skills/protocols/implementation.md +0 -344
  40. package/packages/ct-skills/protocols/provenance.md +0 -600
  41. package/packages/ct-skills/protocols/release.md +0 -635
  42. package/packages/ct-skills/protocols/research.md +0 -248
  43. package/packages/ct-skills/protocols/specification.md +0 -287
  44. package/packages/ct-skills/protocols/testing.md +0 -346
  45. package/packages/ct-skills/protocols/validation.md +0 -229
  46. package/packages/ct-skills/skills/ct-gitbook/SKILL.md +0 -516
  47. package/packages/ct-skills/skills/ct-gitbook/assets/SUMMARY.md +0 -28
  48. package/packages/ct-skills/skills/ct-gitbook/assets/gitbook.yaml +0 -14
  49. package/packages/ct-skills/skills/ct-gitbook/references/api-sdk.md +0 -318
  50. package/packages/ct-skills/skills/ct-gitbook/references/auth-sso.md +0 -208
  51. package/packages/ct-skills/skills/ct-gitbook/references/change-requests.md +0 -169
  52. package/packages/ct-skills/skills/ct-gitbook/references/content-blocks.md +0 -230
  53. package/packages/ct-skills/skills/ct-gitbook/references/docs-sites.md +0 -202
  54. package/packages/ct-skills/skills/ct-gitbook/references/git-sync.md +0 -175
  55. package/packages/ct-skills/skills/ct-gitbook/references/llm-ready.md +0 -178
  56. package/packages/ct-skills/skills/ct-gitbook/references/migration.md +0 -263
  57. package/packages/ct-skills/skills/ct-library-implementer-bash/SKILL.md +0 -316
  58. package/packages/ct-skills/skills/ct-skill-lookup/SKILL.md +0 -179
  59. package/packages/ct-skills/skills/ct-test-writer-bats/SKILL.md +0 -347
  60. package/packages/ct-skills/skills/railway-platform/SKILL.md +0 -506
  61. package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-api.sh +0 -180
  62. package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-common.sh +0 -262
  63. package/packages/ct-skills/skills/railway-platform/references/01-getting-started.md +0 -149
  64. package/packages/ct-skills/skills/railway-platform/references/02-projects.md +0 -116
  65. package/packages/ct-skills/skills/railway-platform/references/03-services.md +0 -147
  66. package/packages/ct-skills/skills/railway-platform/references/04-deployments.md +0 -210
  67. package/packages/ct-skills/skills/railway-platform/references/05-databases.md +0 -142
  68. package/packages/ct-skills/skills/railway-platform/references/06-environments.md +0 -261
  69. package/packages/ct-skills/skills/railway-platform/references/07-domains.md +0 -139
  70. package/packages/ct-skills/skills/railway-platform/references/08-volumes.md +0 -533
  71. package/packages/ct-skills/skills/railway-platform/references/09-networking.md +0 -592
  72. package/packages/ct-skills/skills/railway-platform/references/10-cron.md +0 -488
  73. package/packages/ct-skills/skills/railway-platform/references/11-functions.md +0 -170
  74. package/packages/ct-skills/skills/railway-platform/references/12-monorepo.md +0 -294
  75. package/packages/ct-skills/skills/railway-platform/references/13-troubleshooting.md +0 -335
  76. package/packages/ct-skills/skills/railway-platform/references/14-railway-metal.md +0 -197
@@ -1,309 +0,0 @@
1
- # Consensus Protocol
2
-
3
- **Provenance**: @task T3155, @epic T3147
4
- **Version**: 1.0.1
5
- **Type**: Conditional Protocol
6
- **Max Active**: 3 protocols (including base)
7
-
8
- ---
9
-
10
- ## Trigger Conditions
11
-
12
- This protocol activates when the task involves:
13
-
14
- | Trigger | Keywords | Context |
15
- |---------|----------|---------|
16
- | Decision Making | "vote", "decide", "choose", "select" | Multi-option choice |
17
- | Agreement | "consensus", "agree", "alignment" | Stakeholder coordination |
18
- | Conflict Resolution | "resolve", "dispute", "conflict" | Opposing positions |
19
- | Validation | "validate claim", "verify assertion" | Evidence-based judgment |
20
-
21
- **Explicit Override**: `--protocol consensus` flag on task creation.
22
-
23
- ---
24
-
25
- ## Requirements (RFC 2119)
26
-
27
- ### MUST
28
-
29
- | Requirement | Description |
30
- |-------------|-------------|
31
- | CONS-001 | MUST use structured voting format |
32
- | CONS-002 | MUST document rationale for each position |
33
- | CONS-003 | MUST include confidence scores (0.0-1.0) |
34
- | CONS-004 | MUST cite evidence supporting positions |
35
- | CONS-005 | MUST flag conflicts with severity levels |
36
- | CONS-006 | MUST escalate to HITL when threshold not reached |
37
- | CONS-007 | MUST set `agent_type: "analysis"` in manifest |
38
-
39
- ### SHOULD
40
-
41
- | Requirement | Description |
42
- |-------------|-------------|
43
- | CONS-010 | SHOULD present multiple perspectives |
44
- | CONS-011 | SHOULD identify hidden assumptions |
45
- | CONS-012 | SHOULD document rejected alternatives |
46
- | CONS-013 | SHOULD include uncertainty notes for low confidence |
47
-
48
- ### MAY
49
-
50
- | Requirement | Description |
51
- |-------------|-------------|
52
- | CONS-020 | MAY propose compromise positions |
53
- | CONS-021 | MAY defer non-critical decisions |
54
- | CONS-022 | MAY request additional research |
55
-
56
- ---
57
-
58
- ## Output Format
59
-
60
- ### Voting Structure
61
-
62
- ```json
63
- {
64
- "questionId": "CONS-001",
65
- "question": "Decision question being answered",
66
- "options": [
67
- {
68
- "option": "Option A description",
69
- "vote": "accept|reject|abstain",
70
- "confidence": 0.85,
71
- "rationale": "Why this position",
72
- "evidence": [{"file": "path", "section": "name", "type": "code"}]
73
- }
74
- ],
75
- "verdict": "PROVEN|REFUTED|CONTESTED|INSUFFICIENT_EVIDENCE",
76
- "consensusThreshold": 0.8,
77
- "actualConsensus": 0.75
78
- }
79
- ```
80
-
81
- ### Verdict Thresholds
82
-
83
- | Verdict | Threshold | Evidence Requirement |
84
- |---------|-----------|---------------------|
85
- | **PROVEN** | 3/5 agents OR 50%+ weighted confidence | Reproducible evidence |
86
- | **REFUTED** | Counter-evidence invalidates | Counter-proof exists |
87
- | **CONTESTED** | 3/5 split after 2 challenge rounds | Document both sides |
88
- | **INSUFFICIENT_EVIDENCE** | Cannot reach verdict | Request investigation |
89
-
90
- ### Conflict Structure
91
-
92
- ```json
93
- {
94
- "conflictId": "conflict_a1b2c3d4",
95
- "severity": "critical|high|medium|low",
96
- "conflictType": "contradiction|partial-overlap|scope-difference|priority-difference",
97
- "positions": [
98
- {"agentId": "opus-1", "position": "Position A", "confidence": 0.85},
99
- {"agentId": "sonnet-1", "position": "Position B", "confidence": 0.75}
100
- ],
101
- "resolution": {
102
- "status": "pending|proposed|accepted|rejected",
103
- "resolutionType": "merge|choose-a|choose-b|new|defer|escalate"
104
- }
105
- }
106
- ```
107
-
108
- ### File Output
109
-
110
- ```markdown
111
- # Consensus Report: {Decision Title}
112
-
113
- **Task**: T####
114
- **Date**: YYYY-MM-DD
115
- **Status**: complete|partial|blocked
116
- **Agent Type**: analysis
117
-
118
- ---
119
-
120
- ## Decision Question
121
-
122
- {Clear statement of what needs to be decided}
123
-
124
- ## Options Evaluated
125
-
126
- ### Option A: {Name}
127
-
128
- **Confidence**: X.XX
129
- **Rationale**: {Why this option}
130
- **Evidence**: {Citations}
131
- **Pros**: {Advantages}
132
- **Cons**: {Disadvantages}
133
-
134
- ### Option B: {Name}
135
-
136
- {Same structure}
137
-
138
- ## Voting Matrix
139
-
140
- | Agent | Option A | Option B | Confidence | Notes |
141
- |-------|----------|----------|------------|-------|
142
- | opus-1 | Accept | - | 0.85 | {Rationale} |
143
- | sonnet-1 | - | Accept | 0.70 | {Rationale} |
144
-
145
- ## Verdict
146
-
147
- **Result**: {PROVEN|REFUTED|CONTESTED|INSUFFICIENT_EVIDENCE}
148
- **Consensus**: {X}% weighted agreement
149
- **Recommendation**: {Final recommendation}
150
-
151
- ## Conflicts
152
-
153
- {If any conflicts exist}
154
-
155
- ## Next Steps
156
-
157
- 1. {Action item}
158
- ```
159
-
160
- ### Manifest Entry
161
-
162
- @skills/_shared/manifest-operations.md
163
-
164
- Use `cleo research add` to create the manifest entry:
165
-
166
- ```bash
167
- cleo research add \
168
- --title "Consensus: Decision Title" \
169
- --file "YYYY-MM-DD_consensus.md" \
170
- --topics "consensus,decision" \
171
- --findings "Verdict reached,Option A selected,80% confidence" \
172
- --status complete \
173
- --task T#### \
174
- --actionable \
175
- --agent-type analysis
176
- ```
177
-
178
- ---
179
-
180
- ## Integration Points
181
-
182
- ### Base Protocol
183
-
184
- - Inherits task lifecycle (start, execute, complete)
185
- - Inherits manifest append requirement
186
- - Inherits error handling patterns
187
-
188
- ### Protocol Interactions
189
-
190
- | Combined With | Behavior |
191
- |---------------|----------|
192
- | research | Research provides evidence for voting |
193
- | specification | Consensus resolves spec ambiguities |
194
- | contribution | Consensus validates contributions |
195
-
196
- ### HITL Escalation
197
-
198
- | Condition | Action |
199
- |-----------|--------|
200
- | Contested verdict (3/5 split) | Present conflict to user |
201
- | Critical severity conflict | Immediate escalation |
202
- | Insufficient evidence | Request user guidance |
203
- | Unanimous suspicious consensus | Verify with user |
204
-
205
- ---
206
-
207
- ## Example
208
-
209
- **Task**: Decide on codebase map architecture
210
-
211
- **Manifest Entry Command**:
212
- ```bash
213
- cleo research add \
214
- --title "Consensus: Codebase Map Architecture" \
215
- --file "2026-01-26_arch-consensus.md" \
216
- --topics "architecture,consensus,codebase-map" \
217
- --findings "Single file selected over split,4/5 agents agree,Atomic operations priority" \
218
- --status complete \
219
- --task T2216 \
220
- --epic T2204 \
221
- --actionable \
222
- --needs-followup T2217 \
223
- --agent-type analysis
224
- ```
225
-
226
- ---
227
-
228
- ## Integration
229
-
230
- ### Implementation Location
231
-
232
- **Library**: `lib/contribution-protocol.sh`
233
-
234
- **Primary Function**: `contribution_compute_consensus(epic_id, [manifest_path])`
235
- - Loads complete contributions for epic
236
- - Groups decisions by question ID across contributions
237
- - Runs weighted voting per question
238
- - Classifies: unanimous/majority = resolved, split = unresolved
239
- - Flags unresolved questions for HITL review
240
-
241
- **Supporting Functions**:
242
- - `contribution_weighted_vote(votes_json)` - Calculates weighted consensus
243
- - `contribution_create_synthesis(consensus_json, epic_id)` - Creates Markdown synthesis
244
-
245
- ### CLI Usage
246
-
247
- **Note**: No dedicated `cleo consensus` command exists yet. Consensus computation is invoked programmatically through the contribution workflow.
248
-
249
- **Programmatic Usage**:
250
- ```bash
251
- source lib/contribution-protocol.sh
252
-
253
- # Compute consensus for an epic
254
- consensus=$(contribution_compute_consensus "T2679")
255
-
256
- # Extract resolved/unresolved questions
257
- resolved=$(echo "$consensus" | jq '.resolvedQuestions')
258
- unresolved=$(echo "$consensus" | jq '.unresolvedQuestions')
259
- ```
260
-
261
- ### Orchestrator Integration
262
-
263
- **Spawn Context**: When spawning consensus agents via orchestrator:
264
-
265
- ```bash
266
- # Orchestrator detects consensus protocol from task labels
267
- protocol_type=$(_osp_skill_to_protocol "ct-validator") # Returns "consensus"
268
-
269
- # Validates consensus requirements before spawn
270
- validate_consensus_protocol "$task_id" "$manifest_entry" "$voting_matrix" "false"
271
-
272
- # Blocks spawn if:
273
- # - Voting matrix has <2 options (CONS-001)
274
- # - Confidence scores invalid (CONS-003)
275
- # - Top confidence below 50% threshold (CONS-004)
276
- # - agent_type not "analysis" (CONS-007)
277
- ```
278
-
279
- **Exit Codes**:
280
- - `EXIT_PROTOCOL_CONSENSUS` (61) - Consensus protocol violation
281
- - `EXIT_PROTOCOL_GENERIC` (67) - Generic protocol error
282
-
283
- ### Validation Hook
284
-
285
- **Function**: `validate_consensus_protocol(task_id, manifest_entry, voting_matrix, strict)`
286
-
287
- **Location**: `lib/protocol-validation.sh`
288
-
289
- **Validates**:
290
- - CONS-001: ≥2 options in voting matrix
291
- - CONS-003: Confidence scores 0.0-1.0
292
- - CONS-004: Top confidence ≥50% threshold
293
- - CONS-007: agent_type = "analysis"
294
-
295
- ---
296
-
297
- ## Anti-Patterns
298
-
299
- | Pattern | Why Avoid |
300
- |---------|-----------|
301
- | Accepting unanimous consensus without scrutiny | May indicate groupthink |
302
- | Skipping evidence citations | Decisions lack foundation |
303
- | Binary voting without confidence | Loses nuance |
304
- | Ignoring minority positions | May miss valid concerns |
305
- | Premature escalation | Wastes human attention |
306
-
307
- ---
308
-
309
- *Protocol Version 1.0.0 - Consensus Protocol*
@@ -1,375 +0,0 @@
1
- # Contribution Protocol
2
-
3
- **Provenance**: @task T3155, @epic T3147
4
- **Version**: 1.1.1
5
- **Type**: Cross-Cutting Protocol
6
- **Applies To**: All RCSD-IVTR stages
7
- **Max Active**: 3 protocols (including base)
8
-
9
- > **Cross-Cutting Nature**: This protocol applies across ALL stages of RCSD-IVTR.
10
- > Unlike stage-specific protocols (research, consensus, etc.), contribution
11
- > tracking is active whenever multi-agent coordination or attribution is needed.
12
-
13
- ---
14
-
15
- ## Trigger Conditions
16
-
17
- This protocol activates when the task involves:
18
-
19
- | Trigger | Keywords | Context |
20
- |---------|----------|---------|
21
- | Shared File Modification | Modifying CLAUDE.md, AGENTS.md, shared configs | Multi-session files |
22
- | PR Creation | "pull request", "PR", "merge request" | Code review workflow |
23
- | Cross-Session Work | Multiple agents on same epic | Coordination needed |
24
- | Audit Trail | Provenance, attribution, tracking | Accountability |
25
-
26
- **Explicit Override**: `--protocol contribution` flag on task creation.
27
-
28
- ---
29
-
30
- ## Requirements (RFC 2119)
31
-
32
- ### MUST
33
-
34
- | Requirement | Description |
35
- |-------------|-------------|
36
- | CONT-001 | MUST follow commit message conventions |
37
- | CONT-002 | MUST include provenance tags in code comments |
38
- | CONT-003 | MUST pass all validation gates before merge |
39
- | CONT-004 | MUST document decisions with rationale |
40
- | CONT-005 | MUST flag conflicts with other sessions |
41
- | CONT-006 | MUST write contribution record to manifest |
42
- | CONT-007 | MUST set `agent_type: "implementation"` in manifest |
43
-
44
- ### SHOULD
45
-
46
- | Requirement | Description |
47
- |-------------|-------------|
48
- | CONT-010 | SHOULD include test coverage for changes |
49
- | CONT-011 | SHOULD link to related tasks and research |
50
- | CONT-012 | SHOULD document rejected alternatives |
51
- | CONT-013 | SHOULD request review for significant changes |
52
-
53
- ### MAY
54
-
55
- | Requirement | Description |
56
- |-------------|-------------|
57
- | CONT-020 | MAY batch related changes into single contribution |
58
- | CONT-021 | MAY defer documentation updates |
59
- | CONT-022 | MAY propose follow-up improvements |
60
-
61
- ---
62
-
63
- ## Output Format
64
-
65
- ### Commit Message Format
66
-
67
- ```
68
- <type>(<scope>): <summary>
69
-
70
- <body>
71
-
72
- <footer>
73
-
74
- Co-Authored-By: <agent-id> <noreply@anthropic.com>
75
- Task: T####
76
- Session: session_YYYYMMDD_HHMMSS_######
77
- ```
78
-
79
- **Types**: `feat`, `fix`, `docs`, `test`, `refactor`, `chore`, `perf`
80
-
81
- ### Provenance Tag Format
82
-
83
- ```javascript
84
- /**
85
- * @task T####
86
- * @session session_YYYYMMDD_HHMMSS_######
87
- * @agent opus-1
88
- * @date YYYY-MM-DD
89
- */
90
- ```
91
-
92
- ```bash
93
- # Task: T####
94
- # Session: session_YYYYMMDD_HHMMSS_######
95
- # Agent: opus-1
96
- ```
97
-
98
- ### Contribution Record
99
-
100
- ```json
101
- {
102
- "$schema": "https://cleo-dev.com/schemas/v1/contribution.schema.json",
103
- "_meta": {
104
- "contributionId": "contrib_a1b2c3d4",
105
- "createdAt": "2026-01-26T14:00:00Z",
106
- "agentId": "opus-1"
107
- },
108
- "sessionId": "session_20260126_140000_abc123",
109
- "epicId": "T2308",
110
- "taskId": "T2315",
111
- "markerLabel": "feature-contrib",
112
- "decisions": [
113
- {
114
- "questionId": "IMPL-001",
115
- "question": "Decision made during implementation",
116
- "answer": "Concrete decision value",
117
- "confidence": 0.85,
118
- "rationale": "Why this decision",
119
- "evidence": [{"file": "path", "section": "name", "type": "code"}]
120
- }
121
- ],
122
- "conflicts": [],
123
- "status": "complete"
124
- }
125
- ```
126
-
127
- ### Validation Gates
128
-
129
- | Gate | Check | Required |
130
- |------|-------|----------|
131
- | Schema | JSON Schema validation | MUST pass |
132
- | Tests | All tests pass | MUST pass |
133
- | Lint | Code style compliance | SHOULD pass |
134
- | Security | No secrets committed | MUST pass |
135
- | Conflicts | No unresolved conflicts | MUST resolve |
136
-
137
- ### File Output
138
-
139
- ```markdown
140
- # Contribution: {Title}
141
-
142
- **Task**: T####
143
- **Date**: YYYY-MM-DD
144
- **Status**: complete|partial|blocked
145
- **Agent Type**: implementation
146
-
147
- ---
148
-
149
- ## Summary
150
-
151
- {2-3 sentence summary of contribution}
152
-
153
- ## Changes
154
-
155
- ### Files Modified
156
-
157
- | File | Type | Lines Changed |
158
- |------|------|---------------|
159
- | {path} | {added|modified|deleted} | +X/-Y |
160
-
161
- ### Decisions Made
162
-
163
- | ID | Decision | Rationale |
164
- |----|----------|-----------|
165
- | IMPL-001 | {Decision} | {Why} |
166
-
167
- ## Validation Results
168
-
169
- | Gate | Status | Notes |
170
- |------|--------|-------|
171
- | Tests | Pass | All 42 tests pass |
172
- | Lint | Pass | No warnings |
173
- | Schema | Pass | Valid JSON |
174
-
175
- ## Conflicts
176
-
177
- {If any, document with resolution}
178
-
179
- ## Review Checklist
180
-
181
- - [ ] Code follows style guide
182
- - [ ] Tests added/updated
183
- - [ ] Documentation updated
184
- - [ ] No breaking changes (or documented)
185
- ```
186
-
187
- ### Manifest Entry
188
-
189
- @skills/_shared/manifest-operations.md
190
-
191
- Use `cleo research add` to create the manifest entry:
192
-
193
- ```bash
194
- cleo research add \
195
- --title "Contribution: Feature Name" \
196
- --file "YYYY-MM-DD_contribution.md" \
197
- --topics "contribution,feature" \
198
- --findings "3 files modified,Tests passing,No conflicts" \
199
- --status complete \
200
- --task T#### \
201
- --not-actionable \
202
- --agent-type implementation
203
- ```
204
-
205
- ---
206
-
207
- ## Implementation Integration
208
-
209
- ### Automatic Tracking
210
-
211
- **Status**: Not yet implemented
212
-
213
- **Planned**: Integrate with `cleo complete` to automatically track contributions
214
- - Detect PR/merge commits in task completion
215
- - Extract contribution metadata from commit messages
216
- - Append to `.cleo/contributions/CONTRIBUTIONS.jsonl`
217
- - Link contribution to completed task
218
-
219
- **Future CLI**:
220
- ```bash
221
- cleo complete T1234 # Auto-detects contribution if task has linked PR
222
- ```
223
-
224
- ### Manual Tracking
225
-
226
- **Status**: Not yet implemented
227
-
228
- **Planned**: Dedicated contribution tracking command
229
-
230
- **Future CLI**:
231
- ```bash
232
- cleo contribution track --task T1234 --pr-number 456
233
- cleo contribution list --epic T2000
234
- cleo contribution show T1234-contrib
235
- ```
236
-
237
- ### Implementation Location
238
-
239
- **Library**: `lib/contribution-protocol.sh`
240
-
241
- **Key Functions** (for future integration):
242
- - `contribution_create()` - Record contribution metadata
243
- - `contribution_track_from_task()` - Extract contribution from task
244
- - `contribution_validate()` - Validate contribution structure
245
- - `contribution_compute_consensus()` - Compute consensus from contributions
246
-
247
- ### Current State
248
-
249
- Contribution protocol is **specification-only** (no enforcement yet). Implementation tracking requires:
250
- 1. Git integration for PR detection
251
- 2. Contribution manifest system
252
- 3. CLI commands for manual tracking
253
- 4. Orchestrator integration for multi-agent contributions
254
-
255
- **Validation**: See `validate_contribution_protocol()` in `lib/protocol-validation.sh`
256
- - CONT-002: Provenance tags required
257
- - CONT-003: Tests must pass
258
- - CONT-007: agent_type = "implementation"
259
- - Exit code: `EXIT_PROTOCOL_CONTRIBUTION` (65)
260
-
261
- ---
262
-
263
- ## Integration Points
264
-
265
- ### Base Protocol
266
-
267
- - Inherits task lifecycle (start, execute, complete)
268
- - Inherits manifest append requirement
269
- - Inherits error handling patterns
270
-
271
- ### Protocol Interactions
272
-
273
- | Combined With | Behavior |
274
- |---------------|----------|
275
- | implementation | Contribution tracks implementation work |
276
- | consensus | Consensus resolves contribution conflicts |
277
- | release | Contribution records feed release notes |
278
-
279
- ### Conflict Detection
280
-
281
- | Conflict Type | Detection | Resolution |
282
- |---------------|-----------|------------|
283
- | Same file edit | File path collision | Merge or choose |
284
- | Semantic conflict | Decision contradiction | Consensus protocol |
285
- | Dependency conflict | Breaking change | Escalate to HITL |
286
-
287
- ---
288
-
289
- ## Example
290
-
291
- **Task**: Implement session binding for multi-agent support
292
-
293
- **Commit**:
294
- ```
295
- feat(session): Add session binding for multi-agent support
296
-
297
- Implements session isolation per agent with TTY binding
298
- for terminal-based sessions and env var fallback for
299
- headless operations.
300
-
301
- - Add session binding file management
302
- - Implement CLEO_SESSION env var support
303
- - Add session switch command
304
-
305
- Co-Authored-By: opus-1 <noreply@anthropic.com>
306
- Task: T2315
307
- Session: session_20260126_140000_abc123
308
- ```
309
-
310
- **Manifest Entry**:
311
- ```json
312
- {"id":"T2315-session-binding","file":"2026-01-26_session-binding.md","title":"Contribution: Session Binding","date":"2026-01-26","status":"complete","agent_type":"implementation","topics":["session","multi-agent","binding"],"key_findings":["TTY binding implemented","Env var fallback added","4 new tests"],"actionable":false,"needs_followup":[],"linked_tasks":["T2315","T2308"]}
313
- ```
314
-
315
- ---
316
-
317
- ## Provenance Validation
318
-
319
- ### Overview
320
-
321
- Contribution protocol inherits provenance requirements from implementation protocol (IMPL-003), with identical enforcement mechanisms.
322
-
323
- **Requirement**: CONT-002 = IMPL-003 (Provenance tags required)
324
-
325
- ### Pre-Commit Hook
326
-
327
- Same as Implementation Protocol:
328
- - Extract @task tags from commit diff
329
- - Calculate provenance coverage: 100% new, 80% existing, 50% legacy
330
- - Block commit if thresholds not met
331
- - Exit code: `EXIT_PROTOCOL_CONTRIBUTION` (65)
332
-
333
- ### Runtime Validation
334
-
335
- **Current**: Available via `validate_contribution_protocol()` in `lib/protocol-validation.sh`
336
-
337
- **Planned CLI**: `cleo contribution validate [--task TASK_ID]`
338
-
339
- **Checks**:
340
- - CONT-002: Provenance tags present
341
- - CONT-003: Tests pass
342
- - CONT-007: agent_type = "implementation"
343
-
344
- ### Shared Thresholds
345
-
346
- Identical to implementation protocol:
347
-
348
- | Code Category | Provenance Requirement |
349
- |---------------|------------------------|
350
- | New code | 100% |
351
- | Existing code | 80% |
352
- | Legacy code | 50% |
353
-
354
- ### Enforcement Points
355
-
356
- 1. **Pre-commit**: Shared with implementation protocol
357
- 2. **Pre-merge**: PR validation checks provenance
358
- 3. **Runtime**: `cleo complete` validates contribution tasks
359
- 4. **Orchestrator**: Validates before spawning contribution agents
360
-
361
- ---
362
-
363
- ## Anti-Patterns
364
-
365
- | Pattern | Why Avoid |
366
- |---------|-----------|
367
- | Committing without provenance | Breaks audit trail |
368
- | Skipping validation gates | Quality regression |
369
- | Ignoring conflicts | Creates merge debt |
370
- | Large unfocused commits | Hard to review/revert |
371
- | Missing decision documentation | Lost context |
372
-
373
- ---
374
-
375
- *Protocol Version 1.0.0 - Contribution Protocol*