cc-mirror 1.0.3 → 1.1.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 (25) hide show
  1. package/README.md +168 -98
  2. package/dist/cc-mirror.mjs +807 -287
  3. package/dist/skills/multi-agent-orchestrator/SKILL.md +391 -0
  4. package/dist/skills/multi-agent-orchestrator/references/code-review.md +266 -0
  5. package/dist/skills/multi-agent-orchestrator/references/data-analysis.md +315 -0
  6. package/dist/skills/multi-agent-orchestrator/references/devops.md +309 -0
  7. package/dist/skills/multi-agent-orchestrator/references/documentation.md +310 -0
  8. package/dist/skills/multi-agent-orchestrator/references/domains/code-review.md +301 -0
  9. package/dist/skills/multi-agent-orchestrator/references/domains/data-analysis.md +347 -0
  10. package/dist/skills/multi-agent-orchestrator/references/domains/devops.md +340 -0
  11. package/dist/skills/multi-agent-orchestrator/references/domains/documentation.md +343 -0
  12. package/dist/skills/multi-agent-orchestrator/references/domains/project-management.md +370 -0
  13. package/dist/skills/multi-agent-orchestrator/references/domains/research.md +322 -0
  14. package/dist/skills/multi-agent-orchestrator/references/domains/software-development.md +269 -0
  15. package/dist/skills/multi-agent-orchestrator/references/domains/testing.md +313 -0
  16. package/dist/skills/multi-agent-orchestrator/references/examples.md +377 -0
  17. package/dist/skills/multi-agent-orchestrator/references/guide.md +327 -0
  18. package/dist/skills/multi-agent-orchestrator/references/patterns.md +441 -0
  19. package/dist/skills/multi-agent-orchestrator/references/project-management.md +345 -0
  20. package/dist/skills/multi-agent-orchestrator/references/research.md +285 -0
  21. package/dist/skills/multi-agent-orchestrator/references/software-development.md +242 -0
  22. package/dist/skills/multi-agent-orchestrator/references/testing.md +282 -0
  23. package/dist/skills/multi-agent-orchestrator/references/tools.md +454 -0
  24. package/dist/tui.mjs +1063 -405
  25. package/package.json +2 -2
@@ -0,0 +1,454 @@
1
+ # Orchestration Tools Reference
2
+
3
+ ```
4
+ ┌─────────────────────────────────────────────────────────────┐
5
+ │ Your toolkit for turning ambitious requests into reality. │
6
+ │ Master these tools, and complex work becomes effortless. │
7
+ └─────────────────────────────────────────────────────────────┘
8
+ ```
9
+
10
+ ## Table of Contents
11
+
12
+ 1. [AskUserQuestion (Most Important)](#askuserquestion)
13
+ 2. [Agent Types](#agent-types)
14
+ 3. [Task Tool](#task-tool)
15
+ 4. [Subagent Prompting Guide](#subagent-prompting-guide)
16
+ 5. [TaskOutput Tool](#taskoutput-tool)
17
+ 6. [Task Management](#task-management)
18
+ 7. [Agent-Task Workflow](#agent-task-workflow)
19
+
20
+ ---
21
+
22
+ ## AskUserQuestion
23
+
24
+ **Your most important tool.** When you need user input, ALWAYS use this tool. Never present text-only menus.
25
+
26
+ ### Why This Tool Matters
27
+
28
+ ```
29
+ ┌──────────────────────────────────────────────────┐
30
+ │ Text menu: vs AskUserQuestion: │
31
+ │ │
32
+ │ "Pick one: [Visual buttons] │
33
+ │ 1. Option A [Rich descriptions] │
34
+ │ 2. Option B [One click to pick] │
35
+ │ 3. Option C" [Multiple questions] │
36
+ │ │
37
+ │ Slow, error-prone Fast, delightful │
38
+ └──────────────────────────────────────────────────┘
39
+ ```
40
+
41
+ ### Anatomy of Excellent Questions
42
+
43
+ ```python
44
+ AskUserQuestion(questions=[
45
+ {
46
+ "question": "What's the primary goal for this feature?",
47
+ "header": "Goal", # Short label (max 12 chars)
48
+ "options": [
49
+ {
50
+ "label": "Performance (Recommended)",
51
+ "description": "Optimize for speed. Best when handling high traffic."
52
+ },
53
+ {
54
+ "label": "Simplicity",
55
+ "description": "Keep it straightforward. Easier to maintain long-term."
56
+ },
57
+ {
58
+ "label": "Flexibility",
59
+ "description": "Make it configurable. Good when requirements may change."
60
+ }
61
+ ],
62
+ "multiSelect": False # True if multiple can be selected
63
+ }
64
+ ])
65
+ ```
66
+
67
+ ### The Golden Rules
68
+
69
+ | Rule | Why |
70
+ | ------------------------------- | -------------------------------------------------------- |
71
+ | **2-4 options per question** | Too few = not helpful. Too many = overwhelming. |
72
+ | **Recommended first** | Guide users toward the best choice with "(Recommended)" |
73
+ | **Rich descriptions** | Help users make informed decisions quickly |
74
+ | **Multiple questions together** | Gather all context upfront, then execute with confidence |
75
+ | **Never text menus** | Always use the tool. No exceptions. |
76
+
77
+ ### Multi-Question Patterns
78
+
79
+ When you need multiple dimensions of input, ask them together:
80
+
81
+ ```python
82
+ AskUserQuestion(questions=[
83
+ {
84
+ "question": "What authentication approach fits your app?",
85
+ "header": "Auth",
86
+ "options": [
87
+ {"label": "JWT (Recommended)", "description": "Stateless tokens, great for APIs"},
88
+ {"label": "Sessions", "description": "Server-side state, simpler for web apps"},
89
+ {"label": "OAuth only", "description": "Social logins, no password management"}
90
+ ],
91
+ "multiSelect": False
92
+ },
93
+ {
94
+ "question": "Which features do you need?",
95
+ "header": "Features",
96
+ "options": [
97
+ {"label": "Email/password login", "description": "Traditional registration flow"},
98
+ {"label": "Password reset", "description": "Email-based recovery"},
99
+ {"label": "Remember me", "description": "Persistent sessions across visits"},
100
+ {"label": "Rate limiting", "description": "Prevent brute force attacks"}
101
+ ],
102
+ "multiSelect": True # Multiple can be selected
103
+ }
104
+ ])
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Agent Types
110
+
111
+ ```
112
+ ┌─────────────────────────────────────────────────────────────┐
113
+ │ Choose the right agent for the job: │
114
+ │ │
115
+ │ 🔍 Explore → Finding things, understanding codebase │
116
+ │ 📋 Plan → Designing approaches, architecture │
117
+ │ 🔧 general-purpose → Building, implementing, executing │
118
+ │ 📚 claude-code-guide → Questions about Claude Code │
119
+ └─────────────────────────────────────────────────────────────┘
120
+ ```
121
+
122
+ | Agent Type | Best For | Strengths |
123
+ | ------------------- | --------------------------------------------- | ------------------------------- |
124
+ | `Explore` | Finding files, patterns, understanding code | Fast, focused, low-cost |
125
+ | `Plan` | Architecture decisions, implementation design | Systematic analysis, trade-offs |
126
+ | `general-purpose` | Implementation, complex multi-step work | Full tool access, autonomous |
127
+ | `claude-code-guide` | Claude Code feature questions | Documentation expertise |
128
+
129
+ ### Quick Selection Guide
130
+
131
+ | User Says | Agent Type |
132
+ | ----------------------------------- | ------------------- |
133
+ | "Find X" / "Where is Y" | `Explore` |
134
+ | "How should we implement X" | `Plan` |
135
+ | "Build X" / "Fix Y" / "Implement Z" | `general-purpose` |
136
+ | "Can Claude Code do X" | `claude-code-guide` |
137
+
138
+ ---
139
+
140
+ ## Task Tool
141
+
142
+ Spawn an agent to handle work. This is how you delegate.
143
+
144
+ **Remember:** Subagents do NOT inherit skills. They only know what you tell them in the prompt. You are the conductor — they are the musicians.
145
+
146
+ ### Parameters
147
+
148
+ | Parameter | Required | Description |
149
+ | ------------------- | -------- | ---------------------------------------------- |
150
+ | `subagent_type` | Yes | Agent type to spawn |
151
+ | `prompt` | Yes | Detailed instructions for the agent |
152
+ | `description` | Yes | Short 3-5 word summary |
153
+ | `run_in_background` | **Yes** | **ALWAYS set to True** for async orchestration |
154
+ | `model` | No | Override model (haiku, sonnet, opus) |
155
+
156
+ ### Background Agents: The Default
157
+
158
+ **ALWAYS use `run_in_background=True`.** This is the foundation of powerful orchestration.
159
+
160
+ ```python
161
+ # Correct: Background agents (ALWAYS)
162
+ Task(subagent_type="Explore", prompt="...", run_in_background=True)
163
+ Task(subagent_type="general-purpose", prompt="...", run_in_background=True)
164
+ ```
165
+
166
+ ### The Notification System
167
+
168
+ When background agents complete, you receive automatic notifications:
169
+
170
+ ```xml
171
+ <agent-notification>
172
+ <agent-id>abc123</agent-id>
173
+ <output-file>/tmp/claude/.../tasks/abc123.output</output-file>
174
+ <status>completed</status>
175
+ <summary>Agent "PR Review" completed.</summary>
176
+ </agent-notification>
177
+ ```
178
+
179
+ **This enables true async orchestration:**
180
+
181
+ - Launch multiple agents
182
+ - Continue working OR update the user
183
+ - Notifications arrive as agents complete
184
+ - Process results, launch more agents as needed
185
+
186
+ ### Your Freedom After Launching
187
+
188
+ | Situation | What To Do |
189
+ | ---------------------------- | ------------------------------------------------- |
190
+ | More independent work exists | Continue working, notifications arrive when ready |
191
+ | Nothing else right now | Update user on status, yield turn |
192
+ | User should see progress | Show active work in signature |
193
+ | Waiting on specific result | Work on other things until that notification |
194
+
195
+ ### Reading Agent Results
196
+
197
+ When notification arrives, read the output file:
198
+
199
+ ```python
200
+ Read(file_path="/tmp/claude/.../tasks/abc123.output")
201
+ ```
202
+
203
+ Or use TaskOutput:
204
+
205
+ ```python
206
+ TaskOutput(task_id="abc123")
207
+ ```
208
+
209
+ ### Model Selection
210
+
211
+ | Task Complexity | Model | Why |
212
+ | ---------------------- | --------------- | ---------------------------- |
213
+ | Simple search/patterns | `haiku` | Fast and cheap |
214
+ | Standard exploration | `haiku` | Sufficient for most searches |
215
+ | Complex exploration | `sonnet` | Needs reasoning |
216
+ | Simple implementation | `haiku` | Pattern-based work |
217
+ | Complex implementation | `sonnet` | Design decisions needed |
218
+ | Architecture/planning | `sonnet`/`opus` | Complex trade-offs |
219
+ | Security review | `sonnet` | Careful analysis |
220
+
221
+ ### Parallelism Strategy
222
+
223
+ | Priority | Approach |
224
+ | ------------ | ------------------------------------------------ |
225
+ | **Speed** | Parallelize with sonnet, accept higher cost |
226
+ | **Cost** | Sequential haiku where possible |
227
+ | **Balanced** | Haiku for exploration, sonnet for implementation |
228
+
229
+ ---
230
+
231
+ ## Subagent Prompting Guide
232
+
233
+ Your agents are only as good as your prompts. Invest in clear instructions.
234
+
235
+ ### The Four Elements
236
+
237
+ Every agent prompt should include:
238
+
239
+ ```
240
+ ┌─────────────────────────────────────────────────────────────┐
241
+ │ 1. CONTEXT → What's the bigger picture? │
242
+ │ 2. SCOPE → What exactly should this agent do? │
243
+ │ 3. CONSTRAINTS → What rules or patterns to follow? │
244
+ │ 4. OUTPUT → What should the agent return? │
245
+ └─────────────────────────────────────────────────────────────┘
246
+ ```
247
+
248
+ ### Example: Implementation Prompt
249
+
250
+ ```
251
+ Context: Building a Todo app with Express backend and SQLite.
252
+ The users table exists in server/src/db/database.js.
253
+
254
+ Task: Create server/src/routes/auth.js with:
255
+ - POST /signup - Create user, hash password with bcrypt, return JWT
256
+ - POST /login - Verify credentials, return JWT
257
+
258
+ Constraints:
259
+ - Use the existing db from database.js
260
+ - JWT secret from process.env.JWT_SECRET
261
+ - Follow existing code patterns
262
+
263
+ Return: Confirm files created and summarize implementation.
264
+ ```
265
+
266
+ ### Example: Exploration Prompt
267
+
268
+ ```
269
+ Find all files related to user authentication.
270
+
271
+ Look for:
272
+ - Route handlers for login/signup/logout
273
+ - Middleware that checks authentication
274
+ - Session or token management
275
+ - User model or schema
276
+
277
+ Return: List of files with brief description of each.
278
+ ```
279
+
280
+ ### Prompt Anti-Patterns
281
+
282
+ | Bad | Problem | Good |
283
+ | -------------------- | ----------------- | --------------------------------------------------- |
284
+ | "Fix the bug" | Which bug? Where? | "Fix the 401 error after password reset in auth.js" |
285
+ | "Build the frontend" | Too broad | Split into: components, routing, state, API |
286
+ | "Implement auth" | No constraints | Specify: framework, token type, file locations |
287
+ | "Check the code" | No focus | "Review for SQL injection, return severity ratings" |
288
+
289
+ ### Scoping Work
290
+
291
+ | Scope | Approach |
292
+ | ------------------------ | -------------------- |
293
+ | 1 file | One agent |
294
+ | 2-3 related files | One agent |
295
+ | Multiple unrelated files | Parallel agents |
296
+ | Full feature (5+ files) | Decompose into tasks |
297
+
298
+ ---
299
+
300
+ ## TaskOutput Tool
301
+
302
+ Retrieve results from background agents.
303
+
304
+ ```python
305
+ # Wait for completion
306
+ result = TaskOutput(task_id="abc123")
307
+
308
+ # Check without waiting
309
+ result = TaskOutput(task_id="abc123", block=False)
310
+
311
+ # Wait with timeout
312
+ result = TaskOutput(task_id="abc123", timeout=60000)
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Task Management
318
+
319
+ **Always use TaskCreate for multi-step work.** This is how you track and coordinate.
320
+
321
+ ### TaskCreate
322
+
323
+ ```python
324
+ TaskCreate(
325
+ subject="Implement user authentication",
326
+ description="JWT-based auth with login/logout endpoints, password hashing..."
327
+ )
328
+ ```
329
+
330
+ ### TaskUpdate
331
+
332
+ ```python
333
+ # Set dependency
334
+ TaskUpdate(taskId="2", addBlockedBy=["1"])
335
+
336
+ # Add progress note
337
+ TaskUpdate(taskId="1", addComment={
338
+ "author": "orchestrator",
339
+ "content": "Schema design complete"
340
+ })
341
+
342
+ # Mark done
343
+ TaskUpdate(taskId="1", status="resolved")
344
+ ```
345
+
346
+ ### TaskList & TaskGet
347
+
348
+ ```python
349
+ TaskList() # See all tasks with status
350
+ TaskGet(taskId="1") # Get full details of one task
351
+ ```
352
+
353
+ ---
354
+
355
+ ## Agent-Task Workflow
356
+
357
+ The complete flow for orchestrated execution:
358
+
359
+ ```
360
+ ┌─────────────────────────────────────────────────────────────┐
361
+ │ 1. DECOMPOSE │
362
+ │ TaskCreate → TaskCreate → TaskCreate │
363
+ │ │
364
+ │ 2. SET DEPENDENCIES │
365
+ │ TaskUpdate(addBlockedBy=[...]) │
366
+ │ │
367
+ │ 3. FIND READY WORK │
368
+ │ TaskList() → find tasks with empty blockedBy │
369
+ │ │
370
+ │ 4. SPAWN BACKGROUND AGENTS │
371
+ │ Task(..., run_in_background=True) ← ALWAYS background │
372
+ │ │
373
+ │ 5. CONTINUE OR YIELD │
374
+ │ More work? Continue. Otherwise update user, yield. │
375
+ │ │
376
+ │ 6. PROCESS NOTIFICATIONS │
377
+ │ <agent-notification> arrives → Read results │
378
+ │ Mark TaskUpdate(status="resolved") │
379
+ │ │
380
+ │ 7. REPEAT │
381
+ │ Back to step 3 until all done │
382
+ └─────────────────────────────────────────────────────────────┘
383
+ ```
384
+
385
+ ### Example Flow
386
+
387
+ ```python
388
+ # 1. Decompose
389
+ TaskCreate(subject="Setup database schema", description="...")
390
+ TaskCreate(subject="Implement auth routes", description="...")
391
+ TaskCreate(subject="Build auth middleware", description="...")
392
+
393
+ # 2. Dependencies
394
+ TaskUpdate(taskId="2", addBlockedBy=["1"])
395
+ TaskUpdate(taskId="3", addBlockedBy=["2"])
396
+
397
+ # 3. Find ready (task 1 is unblocked)
398
+ TaskList()
399
+
400
+ # 4. Spawn background agent (ALWAYS background)
401
+ Task(subagent_type="general-purpose",
402
+ description="Setup database",
403
+ prompt="Create SQLite database with users table...",
404
+ run_in_background=True)
405
+
406
+ # 5. Update user and yield (or continue other work)
407
+ "Setting up the database schema..."
408
+ # ─── ◈ Orchestrating ── Database Setup ──
409
+
410
+ # 6. Notification arrives
411
+ # <agent-notification>
412
+ # <agent-id>xyz789</agent-id>
413
+ # <status>completed</status>
414
+ # </agent-notification>
415
+
416
+ # Read results, mark complete
417
+ Read(file_path="...output file...")
418
+ TaskUpdate(taskId="1", status="resolved")
419
+
420
+ # 7. Repeat - task 2 now unblocked
421
+ TaskList()
422
+ # Launch next agent...
423
+ ```
424
+
425
+ ---
426
+
427
+ ## Best Practices Summary
428
+
429
+ ```
430
+ ┌─────────────────────────────────────────────────────────────┐
431
+ │ │
432
+ │ ✓ ALWAYS use run_in_background=True for agents │
433
+ │ ✓ Always use AskUserQuestion for user input │
434
+ │ ✓ Decompose before spawning agents │
435
+ │ ✓ Set dependencies explicitly │
436
+ │ ✓ Launch multiple background agents in single message │
437
+ │ ✓ Rich, detailed prompts for agents │
438
+ │ ✓ Process notifications as they arrive │
439
+ │ ✓ Mark tasks resolved immediately when done │
440
+ │ ✓ Show active work in signature │
441
+ │ │
442
+ │ ✗ Never use foreground (blocking) agents │
443
+ │ ✗ Never use text menus for choices │
444
+ │ ✗ Never run independent work sequentially │
445
+ │ ✗ Never give vague prompts to agents │
446
+ │ │
447
+ └─────────────────────────────────────────────────────────────┘
448
+ ```
449
+
450
+ ---
451
+
452
+ ```
453
+ ─── ◈ Tools Reference Complete ──────────────────
454
+ ```