@cleocode/cleo 2026.3.4 → 2026.3.7

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 (72) hide show
  1. package/dist/cli/index.js +2277 -609
  2. package/dist/cli/index.js.map +4 -4
  3. package/dist/mcp/index.js +1838 -443
  4. package/dist/mcp/index.js.map +4 -4
  5. package/package.json +1 -1
  6. package/packages/ct-skills/index.js +1 -1
  7. package/packages/ct-skills/package.json +0 -2
  8. package/packages/ct-skills/profiles/core.json +1 -1
  9. package/packages/ct-skills/profiles/full.json +4 -5
  10. package/packages/ct-skills/profiles/minimal.json +3 -3
  11. package/packages/ct-skills/profiles/recommended.json +2 -2
  12. package/packages/ct-skills/provider-skills-map.json +97 -0
  13. package/packages/ct-skills/skills/_shared/skill-chaining-patterns.md +23 -26
  14. package/packages/ct-skills/skills/_shared/testing-framework-config.md +9 -9
  15. package/packages/ct-skills/skills/ct-cleo/SKILL.md +21 -1
  16. package/packages/ct-skills/skills/ct-dev-workflow/SKILL.md +1 -1
  17. package/packages/ct-skills/skills/ct-documentor/SKILL.md +1 -1
  18. package/packages/ct-skills/skills/ct-epic-architect/SKILL.md +1 -1
  19. package/packages/ct-skills/skills/ct-orchestrator/SKILL.md +119 -43
  20. package/packages/ct-skills/skills/ct-orchestrator/orchestrator-prompt.txt +17 -0
  21. package/packages/ct-skills/skills/ct-orchestrator/references/orchestrator-patterns.md +1 -1
  22. package/packages/ct-skills/skills/ct-research-agent/SKILL.md +1 -1
  23. package/packages/ct-skills/skills/ct-spec-writer/SKILL.md +1 -1
  24. package/packages/ct-skills/skills/ct-task-executor/SKILL.md +1 -1
  25. package/packages/ct-skills/skills/ct-validator/SKILL.md +1 -1
  26. package/packages/ct-skills/skills/manifest.json +217 -947
  27. package/packages/ct-skills/skills.json +244 -3
  28. package/server.json +4 -4
  29. package/templates/CLEO-INJECTION.md +24 -0
  30. package/packages/ct-skills/protocols/agent-protocol.md +0 -260
  31. package/packages/ct-skills/protocols/artifact-publish.md +0 -587
  32. package/packages/ct-skills/protocols/consensus.md +0 -309
  33. package/packages/ct-skills/protocols/contribution.md +0 -375
  34. package/packages/ct-skills/protocols/decomposition.md +0 -352
  35. package/packages/ct-skills/protocols/implementation.md +0 -344
  36. package/packages/ct-skills/protocols/provenance.md +0 -600
  37. package/packages/ct-skills/protocols/release.md +0 -635
  38. package/packages/ct-skills/protocols/research.md +0 -248
  39. package/packages/ct-skills/protocols/specification.md +0 -287
  40. package/packages/ct-skills/protocols/testing.md +0 -346
  41. package/packages/ct-skills/protocols/validation.md +0 -229
  42. package/packages/ct-skills/skills/ct-gitbook/SKILL.md +0 -516
  43. package/packages/ct-skills/skills/ct-gitbook/assets/SUMMARY.md +0 -28
  44. package/packages/ct-skills/skills/ct-gitbook/assets/gitbook.yaml +0 -14
  45. package/packages/ct-skills/skills/ct-gitbook/references/api-sdk.md +0 -318
  46. package/packages/ct-skills/skills/ct-gitbook/references/auth-sso.md +0 -208
  47. package/packages/ct-skills/skills/ct-gitbook/references/change-requests.md +0 -169
  48. package/packages/ct-skills/skills/ct-gitbook/references/content-blocks.md +0 -230
  49. package/packages/ct-skills/skills/ct-gitbook/references/docs-sites.md +0 -202
  50. package/packages/ct-skills/skills/ct-gitbook/references/git-sync.md +0 -175
  51. package/packages/ct-skills/skills/ct-gitbook/references/llm-ready.md +0 -178
  52. package/packages/ct-skills/skills/ct-gitbook/references/migration.md +0 -263
  53. package/packages/ct-skills/skills/ct-library-implementer-bash/SKILL.md +0 -316
  54. package/packages/ct-skills/skills/ct-skill-lookup/SKILL.md +0 -179
  55. package/packages/ct-skills/skills/ct-test-writer-bats/SKILL.md +0 -347
  56. package/packages/ct-skills/skills/railway-platform/SKILL.md +0 -506
  57. package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-api.sh +0 -180
  58. package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-common.sh +0 -262
  59. package/packages/ct-skills/skills/railway-platform/references/01-getting-started.md +0 -149
  60. package/packages/ct-skills/skills/railway-platform/references/02-projects.md +0 -116
  61. package/packages/ct-skills/skills/railway-platform/references/03-services.md +0 -147
  62. package/packages/ct-skills/skills/railway-platform/references/04-deployments.md +0 -210
  63. package/packages/ct-skills/skills/railway-platform/references/05-databases.md +0 -142
  64. package/packages/ct-skills/skills/railway-platform/references/06-environments.md +0 -261
  65. package/packages/ct-skills/skills/railway-platform/references/07-domains.md +0 -139
  66. package/packages/ct-skills/skills/railway-platform/references/08-volumes.md +0 -533
  67. package/packages/ct-skills/skills/railway-platform/references/09-networking.md +0 -592
  68. package/packages/ct-skills/skills/railway-platform/references/10-cron.md +0 -488
  69. package/packages/ct-skills/skills/railway-platform/references/11-functions.md +0 -170
  70. package/packages/ct-skills/skills/railway-platform/references/12-monorepo.md +0 -294
  71. package/packages/ct-skills/skills/railway-platform/references/13-troubleshooting.md +0 -335
  72. package/packages/ct-skills/skills/railway-platform/references/14-railway-metal.md +0 -197
@@ -1,347 +0,0 @@
1
- ---
2
- name: ct-test-writer-bats
3
- description: BATS (Bash Automated Testing System) test creation for comprehensive integration and unit testing. Creates idempotent tests with happy path, error handling, and edge case coverage. Includes fixture creation and JSON output validation. Use when writing tests, creating test suites, adding test coverage, or validating bash implementations. Triggers on test writing tasks, test coverage needs, or BATS test creation.
4
- version: 2.0.0
5
- tier: 2
6
- core: false
7
- category: specialist
8
- protocol: testing
9
- dependencies: []
10
- sharedResources:
11
- - subagent-protocol-base
12
- - task-system-integration
13
- compatibility:
14
- - claude-code
15
- - cursor
16
- - windsurf
17
- - gemini-cli
18
- license: MIT
19
- ---
20
-
21
- # Test Writer (BATS) Context Injection
22
-
23
- **Protocol**: @protocols/implementation.md
24
- **Type**: Context Injection (cleo-subagent)
25
- **Version**: 2.0.0
26
-
27
- ---
28
-
29
- ## Purpose
30
-
31
- Context injection for test writing tasks spawned via cleo-subagent. Provides domain expertise for creating comprehensive integration and unit tests using the BATS (Bash Automated Testing System) framework.
32
-
33
- ---
34
-
35
- ## Capabilities
36
-
37
- 1. **Integration Tests** - Test command workflows end-to-end
38
- 2. **Unit Tests** - Test individual functions
39
- 3. **Fixture Creation** - Create test data and mocks
40
- 4. **Error Case Testing** - Verify error handling
41
-
42
- ---
43
-
44
- ## Task System Integration
45
-
46
- @skills/_shared/task-system-integration.md
47
-
48
- ### Execution Sequence
49
-
50
- 1. Read task: `{{TASK_SHOW_CMD}} {{TASK_ID}}`
51
- 2. Start task: `{{TASK_START_CMD}} {{TASK_ID}}` (if not already started by orchestrator)
52
- 3. Create test file(s) in appropriate tests/ subdirectory
53
- 4. Run tests and verify they pass
54
- 5. Write output file and append manifest
55
- 6. Complete task: `{{TASK_COMPLETE_CMD}} {{TASK_ID}}`
56
- 7. Return summary message
57
-
58
- ---
59
-
60
- ## Subagent Protocol
61
-
62
- @skills/_shared/subagent-protocol-base.md
63
-
64
- ### Output Requirements
65
-
66
- 1. MUST create test file in appropriate tests/ subdirectory
67
- 2. MUST run tests and verify they pass
68
- 3. MUST append ONE line to: `{{MANIFEST_PATH}}`
69
- 4. MUST return ONLY: "Tests complete. See MANIFEST.jsonl for summary."
70
- 5. MUST NOT return full test content in response
71
-
72
- ---
73
-
74
- ## BATS Test Structure
75
-
76
- ### Directory Layout
77
-
78
- ```
79
- tests/
80
- ├── integration/ # End-to-end workflow tests
81
- │ └── {feature}.bats
82
- ├── unit/ # Individual function tests
83
- │ └── {module}.bats
84
- ├── fixtures/ # Test data
85
- │ └── {feature}/
86
- ├── test_helper/ # BATS support libraries
87
- │ ├── bats-support/
88
- │ └── bats-assert/
89
- └── run-all-tests.sh # Test runner
90
- ```
91
-
92
- ### Basic Test File
93
-
94
- ```bash
95
- #!/usr/bin/env bats
96
-
97
- # Load test helpers
98
- load '../test_helper/bats-support/load'
99
- load '../test_helper/bats-assert/load'
100
-
101
- # Setup runs before each test
102
- setup() {
103
- export TEST_DIR=$(mktemp -d)
104
- cd "$TEST_DIR"
105
- # Initialize test environment
106
- }
107
-
108
- # Teardown runs after each test
109
- teardown() {
110
- cd /
111
- rm -rf "$TEST_DIR"
112
- }
113
-
114
- @test "descriptive test name that explains what is tested" {
115
- # Arrange
116
- # ... setup test conditions
117
-
118
- # Act
119
- run command_under_test
120
-
121
- # Assert
122
- assert_success
123
- assert_output --partial "expected output"
124
- }
125
-
126
- @test "error case: handles missing input gracefully" {
127
- run command_under_test --missing-required-arg
128
- assert_failure
129
- assert_output --partial "error"
130
- }
131
- ```
132
-
133
- ---
134
-
135
- ## BATS Assertions
136
-
137
- ### Status Assertions
138
-
139
- ```bash
140
- assert_success # Exit code 0
141
- assert_failure # Exit code non-zero
142
- assert_equal "$actual" "$expected"
143
- ```
144
-
145
- ### Output Assertions
146
-
147
- ```bash
148
- assert_output "exact match"
149
- assert_output --partial "substring"
150
- assert_output --regexp "pattern.*match"
151
- refute_output --partial "should not contain"
152
- ```
153
-
154
- ### File Assertions
155
-
156
- ```bash
157
- assert [ -f "$file" ] # File exists
158
- assert [ -d "$dir" ] # Directory exists
159
- assert [ -s "$file" ] # File is not empty
160
- ```
161
-
162
- ---
163
-
164
- ## Test Categories
165
-
166
- ### 1. Happy Path Tests
167
-
168
- Test normal successful operations:
169
-
170
- ```bash
171
- @test "command succeeds with valid input" {
172
- run {{CLI_CMD}} add "Test task"
173
- assert_success
174
- assert_output --partial "T"
175
- }
176
- ```
177
-
178
- ### 2. Error Handling Tests
179
-
180
- Test all error conditions:
181
-
182
- ```bash
183
- @test "command fails with invalid task ID" {
184
- run {{CLI_CMD}} show INVALID
185
- assert_failure
186
- assert_output --partial "not found"
187
- }
188
- ```
189
-
190
- ### 3. Edge Case Tests
191
-
192
- Test boundary conditions:
193
-
194
- ```bash
195
- @test "handles empty input gracefully" {
196
- run {{CLI_CMD}} add ""
197
- assert_failure
198
- }
199
-
200
- @test "handles very long input" {
201
- local long_title=$(printf 'x%.0s' {1..1000})
202
- run {{CLI_CMD}} add "$long_title"
203
- # Verify behavior
204
- }
205
- ```
206
-
207
- ### 4. Integration Tests
208
-
209
- Test workflows across commands:
210
-
211
- ```bash
212
- @test "full workflow: create, update, complete task" {
213
- # Create
214
- run {{CLI_CMD}} add "Test task"
215
- assert_success
216
- local task_id=$(echo "$output" | jq -r '.task.id')
217
-
218
- # Update
219
- run {{CLI_CMD}} update "$task_id" --priority high
220
- assert_success
221
-
222
- # Complete
223
- run {{CLI_CMD}} complete "$task_id"
224
- assert_success
225
- }
226
- ```
227
-
228
- ---
229
-
230
- ## Test Isolation
231
-
232
- ### CRITICAL: Tests MUST be idempotent
233
-
234
- ```bash
235
- setup() {
236
- # Always use temp directory
237
- export TEST_DIR=$(mktemp -d)
238
- cd "$TEST_DIR"
239
-
240
- # Initialize fresh project (project-specific)
241
- {{CLI_CMD}} init test-project --yes 2>/dev/null || true
242
- }
243
-
244
- teardown() {
245
- # Always clean up
246
- cd /
247
- rm -rf "$TEST_DIR"
248
- }
249
- ```
250
-
251
- ### Never:
252
- - Modify files outside TEST_DIR
253
- - Depend on global state
254
- - Assume test execution order
255
- - Leave artifacts after test
256
-
257
- ---
258
-
259
- ## JSON Output Testing
260
-
261
- ```bash
262
- @test "JSON output has correct structure" {
263
- run {{CLI_CMD}} list
264
- assert_success
265
-
266
- # Validate JSON
267
- echo "$output" | jq -e '._meta' > /dev/null
268
- echo "$output" | jq -e '.tasks' > /dev/null
269
- }
270
-
271
- @test "JSON contains expected fields" {
272
- {{CLI_CMD}} add "Test"
273
- run {{CLI_CMD}} list
274
-
275
- local task=$(echo "$output" | jq '.tasks[0]')
276
- assert [ "$(echo "$task" | jq -r '.id')" != "null" ]
277
- assert [ "$(echo "$task" | jq -r '.title')" = "Test" ]
278
- }
279
- ```
280
-
281
- ---
282
-
283
- ## Running Tests
284
-
285
- ```bash
286
- # Run single test file
287
- bats tests/integration/{feature}.bats
288
-
289
- # Run all tests
290
- ./tests/run-all-tests.sh
291
-
292
- # Run with verbose output
293
- bats --verbose-run tests/integration/{feature}.bats
294
-
295
- # Run specific test
296
- bats tests/integration/{feature}.bats --filter "test name"
297
- ```
298
-
299
- ---
300
-
301
- ## Manifest Entry Format
302
-
303
- ```json
304
- {"id":"tests-{{FEATURE_SLUG}}-{{DATE}}","file":"{{DATE}}_tests-{{FEATURE_SLUG}}.md","title":"Tests: {{FEATURE_NAME}}","date":"{{DATE}}","status":"complete","agent_type":"implementation","topics":["tests","bats","{{DOMAIN}}"],"key_findings":["Created {{N}} tests: {{X}} happy path, {{Y}} error handling, {{Z}} integration","All tests pass","Coverage: {{LIST_OF_SCENARIOS}}"],"actionable":false,"needs_followup":[],"linked_tasks":["{{TASK_ID}}"]}
305
- ```
306
-
307
- ---
308
-
309
- ## Completion Checklist
310
-
311
- Before returning, verify:
312
-
313
- - [ ] Task started via `{{TASK_START_CMD}}` (if not already started)
314
- - [ ] Test file created in correct location (tests/unit/ or tests/integration/)
315
- - [ ] Tests are idempotent (use temp directories)
316
- - [ ] Happy path tests included
317
- - [ ] Error handling tests included
318
- - [ ] All tests pass when run
319
- - [ ] Manifest entry appended
320
- - [ ] Task completed via `{{TASK_COMPLETE_CMD}}`
321
- - [ ] Return summary message only
322
-
323
- ---
324
-
325
- ## Anti-Patterns to Avoid
326
-
327
- | Anti-Pattern | Problem | Solution |
328
- |--------------|---------|----------|
329
- | **Non-idempotent tests** | Tests affect each other | Always use temp directories |
330
- | **Missing teardown** | Artifacts left behind | Always clean up in teardown |
331
- | **Hardcoded paths** | Tests fail in different environments | Use `$TEST_DIR` and relative paths |
332
- | **Order-dependent tests** | Tests fail when run in isolation | Each test must be independent |
333
- | **Missing error cases** | Only happy path covered | Test all error conditions |
334
- | **Vague test names** | Unclear what's being tested | Use descriptive names explaining behavior |
335
- | **Testing implementation** | Fragile tests | Test behavior, not implementation details |
336
-
337
- ---
338
-
339
- ## Token Reference
340
-
341
- ### CLI Token (Required for portability)
342
-
343
- | Token | Default | Description |
344
- |-------|---------|-------------|
345
- | `{{CLI_CMD}}` | `cleo` | CLI command being tested |
346
-
347
- When testing a specific CLI tool, replace `{{CLI_CMD}}` with the actual command (e.g., `cleo`, `git`, `npm`).