clearctx 3.0.0 → 3.2.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.
- package/CHANGELOG.md +33 -0
- package/README.md +41 -3
- package/bin/setup.js +61 -1
- package/package.json +3 -2
- package/skills/api-design/SKILL.md +796 -0
- package/skills/devops/SKILL.md +1043 -0
- package/skills/index.json +53 -0
- package/skills/nodejs-backend/SKILL.md +853 -0
- package/skills/postgresql/SKILL.md +315 -0
- package/skills/react-frontend/SKILL.md +683 -0
- package/skills/security/SKILL.md +1000 -0
- package/skills/testing-qa/SKILL.md +842 -0
- package/skills/typescript/SKILL.md +932 -0
- package/src/channel-hub.js +341 -0
- package/src/mcp-server.js +630 -3
- package/src/notebook-store.js +391 -0
- package/src/prompts.js +156 -2
- package/src/skill-registry.js +182 -0
- package/src/stream-session.js +22 -2
- package/src/user-escalation.js +330 -0
- package/STRATEGY.md +0 -485
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to clearctx will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [3.2.0] - 2026-02-15
|
|
6
|
+
### Added
|
|
7
|
+
- **Cognition Layer** — Think-Plan-Execute cognitive protocol for workers
|
|
8
|
+
- Communication Channels — 5 new tools: `channel_create`, `channel_post`, `channel_subscribe`, `channel_read`, `channel_list`
|
|
9
|
+
- Project Notebook — 4 new tools: `notebook_write`, `notebook_read`, `notebook_search`, `notebook_list`
|
|
10
|
+
- User Escalation — 2 new tools: `ask_user`, `user_respond`
|
|
11
|
+
- 6-phase cognitive protocol injected into worker system prompts
|
|
12
|
+
- 5 default channels: `#design-decisions`, `#blockers`, `#discoveries`, `#conventions`, `#questions`
|
|
13
|
+
- 7 notebook categories: research, decision, gotcha, pattern, plan, investigation, reference
|
|
14
|
+
- Orchestrator Rule 9: Surface worker questions to the user
|
|
15
|
+
- 3 new modules: `src/channel-hub.js`, `src/notebook-store.js`, `src/user-escalation.js`
|
|
16
|
+
- 15 new enforcement tests (73 total, 100% pass rate)
|
|
17
|
+
- Updated all 3 sources of truth (prompts.js, ORCHESTRATOR-CLAUDE.md, setup.js)
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- Total MCP tools: 71 → 82
|
|
21
|
+
- Total tests: 58 → 73
|
|
22
|
+
|
|
23
|
+
## [3.1.0] - 2026-02-15
|
|
24
|
+
### Added
|
|
25
|
+
- Expertise skills system with 8 bundled domain skills: postgresql, nodejs-backend, react-frontend, testing-qa, api-design, devops, security, typescript
|
|
26
|
+
- 3 new MCP tools: skill_list, skill_get, skill_detect (68 → 71 tools)
|
|
27
|
+
- Auto-detection of relevant skills from task description keywords
|
|
28
|
+
- Role-based skill fallback in team_spawn (e.g., role "backend" → nodejs-backend + api-design)
|
|
29
|
+
- Skill injection via team_spawn `skills` parameter
|
|
30
|
+
- Rule 8: Use expertise skills for domain work (added to orchestrator guide)
|
|
31
|
+
- 9 new tests in Skills System group (49 → 58 tests)
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
- ENAMETOOLONG on Windows when injecting skills: system prompts now written to temp files and passed via --append-system-prompt-file instead of CLI args
|
|
35
|
+
- Role-based fallback no longer triggers when skills: [] is explicitly passed (opt-out)
|
|
36
|
+
- getWorkerContext edge case: Worker Context as last section in SKILL.md now extracted correctly
|
|
37
|
+
|
|
5
38
|
## [3.0.0] - 2026-02-15
|
|
6
39
|
### BREAKING CHANGES
|
|
7
40
|
- Renamed package from `claude-multi-session` to `clearctx`
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://github.com/)
|
|
5
5
|
[](https://nodejs.org)
|
|
6
6
|
|
|
7
|
-
> Multi-session orchestration system for Claude Code CLI. Spawn parallel workers that coordinate via artifacts and phase gates.
|
|
7
|
+
> Multi-session orchestration system for Claude Code CLI. Spawn parallel workers that coordinate via artifacts and phase gates. 82 MCP tools. 8 bundled expertise skills. Cognition Layer. v3.2.0.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -39,7 +39,7 @@ After installing, run the setup wizard to register the MCP server with Claude Co
|
|
|
39
39
|
clearctx setup
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
This adds
|
|
42
|
+
This adds 82 native tools to Claude Code (spawn_session, delegate_task, skill_detect, etc.) so Claude can manage sessions directly — no Bash commands needed.
|
|
43
43
|
|
|
44
44
|
**Non-interactive options:**
|
|
45
45
|
```bash
|
|
@@ -450,7 +450,7 @@ Add to your Claude Code MCP config (`~/.claude/settings.json` or project `.claud
|
|
|
450
450
|
{
|
|
451
451
|
"mcpServers": {
|
|
452
452
|
"multi-session": {
|
|
453
|
-
"command": "
|
|
453
|
+
"command": "ctx-mcp"
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
456
|
}
|
|
@@ -505,6 +505,28 @@ Once configured, Claude sees these tools:
|
|
|
505
505
|
|------|-------------|
|
|
506
506
|
| `batch_spawn` | Spawn multiple sessions in parallel |
|
|
507
507
|
|
|
508
|
+
**Expertise Skills:**
|
|
509
|
+
| Tool | Description |
|
|
510
|
+
|------|-------------|
|
|
511
|
+
| `skill_list` | List all available expertise skills |
|
|
512
|
+
| `skill_get` | Read a skill's full content (conventions, patterns, anti-patterns) |
|
|
513
|
+
| `skill_detect` | Auto-detect relevant skills from a task description |
|
|
514
|
+
|
|
515
|
+
**Cognition Layer:**
|
|
516
|
+
| Tool | Description |
|
|
517
|
+
|------|-------------|
|
|
518
|
+
| `channel_create` | Create a topic-based communication channel |
|
|
519
|
+
| `channel_post` | Post a message to a team channel |
|
|
520
|
+
| `channel_subscribe` | Subscribe a session to a channel |
|
|
521
|
+
| `channel_read` | Read messages from a channel |
|
|
522
|
+
| `channel_list` | List all channels with subscriber counts |
|
|
523
|
+
| `notebook_write` | Write or append to a shared notebook entry |
|
|
524
|
+
| `notebook_read` | Read a notebook entry with all entries |
|
|
525
|
+
| `notebook_search` | Search notebook by content, title, or tags |
|
|
526
|
+
| `notebook_list` | List notebook entries with filters |
|
|
527
|
+
| `ask_user` | Ask the human user a question (worker escalation) |
|
|
528
|
+
| `user_respond` | Relay the human's answer to a worker |
|
|
529
|
+
|
|
508
530
|
### How Claude Uses It
|
|
509
531
|
|
|
510
532
|
With MCP configured, Claude can autonomously:
|
|
@@ -633,6 +655,21 @@ clearctx team-replay pre-graphql --overrides '{"build-auth-api":{"inputs":{"cont
|
|
|
633
655
|
|
|
634
656
|
---
|
|
635
657
|
|
|
658
|
+
## Cognition Layer (v3.2.0)
|
|
659
|
+
|
|
660
|
+
Workers now follow a **Think-Plan-Execute cognitive protocol** that teaches them to orient before coding, research ambiguities, share plans before implementing, document discoveries, and self-review before delivering.
|
|
661
|
+
|
|
662
|
+
### Communication Channels (5 tools)
|
|
663
|
+
Persistent topic-based discussions. 5 default channels: `#design-decisions`, `#blockers`, `#discoveries`, `#conventions`, `#questions`. Workers post plans and discoveries to channels so teammates stay informed without orchestrator relay.
|
|
664
|
+
|
|
665
|
+
### Project Notebook (4 tools)
|
|
666
|
+
Shared knowledge scratchpad with 7 categories: research, decision, gotcha, pattern, plan, investigation, reference. Multiple workers can append to the same note, enabling collaborative knowledge building.
|
|
667
|
+
|
|
668
|
+
### User Escalation (2 tools)
|
|
669
|
+
Workers can ask the human user questions when genuinely stuck on ambiguous decisions that can't be resolved by checking artifacts, conventions, channels, notebook, or asking teammates. The orchestrator relays answers.
|
|
670
|
+
|
|
671
|
+
---
|
|
672
|
+
|
|
636
673
|
## Layer 1: Chat (8 MCP Tools)
|
|
637
674
|
|
|
638
675
|
Sessions can communicate directly without routing through the orchestrator.
|
|
@@ -1004,3 +1041,4 @@ clearctx team-replay pre-work --overrides overrides.json
|
|
|
1004
1041
|
## License
|
|
1005
1042
|
|
|
1006
1043
|
MIT
|
|
1044
|
+
|
package/bin/setup.js
CHANGED
|
@@ -178,6 +178,57 @@ This shows which workers actually read the conventions. If a worker is missing,
|
|
|
178
178
|
|
|
179
179
|
NEVER trust a worker's self-reported completion — verify the artifact exists yourself.
|
|
180
180
|
|
|
181
|
+
### Rule 8: Use expertise skills for domain work
|
|
182
|
+
|
|
183
|
+
When spawning workers, assign relevant expertise skills to improve output quality:
|
|
184
|
+
|
|
185
|
+
1. Call \`skill_detect\` with the task description to auto-match skills
|
|
186
|
+
2. Pass matched skills to \`team_spawn\` via the \`skills\` parameter:
|
|
187
|
+
\`\`\`
|
|
188
|
+
team_spawn({
|
|
189
|
+
name: "db-dev",
|
|
190
|
+
role: "database",
|
|
191
|
+
skills: ["postgresql"],
|
|
192
|
+
prompt: "Create the database schema..."
|
|
193
|
+
})
|
|
194
|
+
\`\`\`
|
|
195
|
+
3. Override auto-detection with explicit skills when you know better
|
|
196
|
+
4. Workers with skills produce higher-quality, convention-compliant output
|
|
197
|
+
5. Available skills: postgresql, nodejs-backend, react-frontend, testing-qa, api-design, devops, security, typescript
|
|
198
|
+
|
|
199
|
+
**Role-based fallback:** If you don't specify skills but provide a role, the system auto-detects relevant skills:
|
|
200
|
+
- database → postgresql
|
|
201
|
+
- backend → nodejs-backend, api-design
|
|
202
|
+
- frontend → react-frontend
|
|
203
|
+
- QA/testing → testing-qa
|
|
204
|
+
- devops → devops
|
|
205
|
+
- security → security
|
|
206
|
+
- fullstack → nodejs-backend, react-frontend, typescript
|
|
207
|
+
|
|
208
|
+
### Rule 9: Surface worker questions to the user
|
|
209
|
+
|
|
210
|
+
Workers can ask the human user questions via \`ask_user\` when genuinely stuck on ambiguous decisions that can't be resolved by checking artifacts, conventions, channels, notebook, or asking teammates.
|
|
211
|
+
|
|
212
|
+
- After spawning workers, periodically check for pending questions: use \`user_list_pending\` to see unanswered escalations
|
|
213
|
+
- When you see a pending question, present it to the user clearly with the worker's context
|
|
214
|
+
- After the user answers, relay it with \`user_respond\`
|
|
215
|
+
- Do NOT answer on behalf of the user — relay their actual response
|
|
216
|
+
- If multiple questions are pending, prioritize by priority level (urgent > high > normal > low)
|
|
217
|
+
|
|
218
|
+
## Cognition Layer (v3.2.0)
|
|
219
|
+
|
|
220
|
+
Workers now follow a **Think-Plan-Execute cognitive protocol** that teaches them to orient before coding, research ambiguities, share plans in channels before implementing, document discoveries in the notebook, and self-review before delivering. This reduces convention mismatches, duplicate work, and silent failures.
|
|
221
|
+
|
|
222
|
+
Three new subsystems support this:
|
|
223
|
+
|
|
224
|
+
| Category | Tools | Purpose |
|
|
225
|
+
|----------|-------|---------|
|
|
226
|
+
| **Channels** | \`channel_create\`, \`channel_post\`, \`channel_read\`, \`channel_subscribe\`, \`channel_list\` | Persistent topic-based discussion. Default channels: \`#design-decisions\`, \`#blockers\`, \`#discoveries\`, \`#conventions\`, \`#questions\` |
|
|
227
|
+
| **Notebook** | \`notebook_write\`, \`notebook_read\`, \`notebook_search\`, \`notebook_list\` | Shared knowledge scratchpad for research, gotchas, patterns, plans, and investigations |
|
|
228
|
+
| **User Escalation** | \`ask_user\`, \`user_respond\` | Worker-to-human escalation for genuinely ambiguous decisions. Workers ask, orchestrator relays answer |
|
|
229
|
+
|
|
230
|
+
**Orchestrator role:** Monitor channels (\`channel_read\`) and notebook (\`notebook_list\`, \`notebook_read\`) to stay informed. Check \`user_list_pending\` for unanswered worker questions and relay answers with \`user_respond\`. You do NOT need to post to channels yourself — workers handle their own collaboration.
|
|
231
|
+
|
|
181
232
|
## Auto-Behaviors (v2.7.0)
|
|
182
233
|
|
|
183
234
|
These happen automatically — no action needed from you or the workers:
|
|
@@ -186,8 +237,9 @@ These happen automatically — no action needed from you or the workers:
|
|
|
186
237
|
- **Inbox enforcement**: Workers are blocked from using artifact/contract tools until they call \`team_check_inbox\`
|
|
187
238
|
- **File ownership tracking**: \`artifact_publish\` auto-registers file ownership from \`files\`/\`filesCreated\`/\`filesModified\` arrays in artifact data
|
|
188
239
|
- **Convention completeness check**: \`phase_gate\` warns if \`shared-conventions\` artifact is missing or has incomplete fields
|
|
240
|
+
- **Skills System**: When you provide a \`role\` to \`team_spawn\` without explicit \`skills\`, the system auto-detects relevant expertise skills based on the role (e.g., "database" → postgresql, "backend" → nodejs-backend + api-design). You can override this by passing explicit \`skills\` array.
|
|
189
241
|
|
|
190
|
-
## Quick Reference (
|
|
242
|
+
## Quick Reference (82 tools)
|
|
191
243
|
|
|
192
244
|
| You want to... | Use this tool |
|
|
193
245
|
|----------------|---------------|
|
|
@@ -202,6 +254,14 @@ These happen automatically — no action needed from you or the workers:
|
|
|
202
254
|
| Check who read an artifact | \`artifact_readers\` |
|
|
203
255
|
| Check file ownership (Rule 6) | \`check_file_owner\` |
|
|
204
256
|
| Register file ownership | \`register_files\` |
|
|
257
|
+
| Auto-detect skills for a task | \`skill_detect\` |
|
|
258
|
+
| List available skills | \`skill_list\` |
|
|
259
|
+
| Read a skill's content | \`skill_get\` |
|
|
260
|
+
| Spawn worker with skills | \`team_spawn\` with \`skills\` parameter |
|
|
261
|
+
| Monitor team discussions | \`channel_read\`, \`channel_list\` |
|
|
262
|
+
| Monitor shared knowledge | \`notebook_read\`, \`notebook_list\` |
|
|
263
|
+
| Check pending user questions | \`user_list_pending\` |
|
|
264
|
+
| Relay user's answer to worker | \`user_respond\` |
|
|
205
265
|
| Clean up between runs | \`team_reset\` |
|
|
206
266
|
|
|
207
267
|
### When NOT to Delegate
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clearctx",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Multi-session orchestrator for Claude Code CLI — spawn, control, pause, resume, and send multiple inputs to Claude Code sessions programmatically",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"parallel-tasks",
|
|
32
32
|
"workflow-automation"
|
|
33
33
|
],
|
|
34
|
-
"author": "",
|
|
34
|
+
"author": "RevanthThota55 <revanththota55@gmail.com>",
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=18.0.0"
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"files": [
|
|
40
40
|
"src/",
|
|
41
41
|
"bin/",
|
|
42
|
+
"skills/",
|
|
42
43
|
"README.md",
|
|
43
44
|
"CHANGELOG.md",
|
|
44
45
|
"STRATEGY.md",
|