cc-mirror 1.2.1 → 1.4.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.
@@ -154,6 +154,7 @@ Before anything, sense the vibe:
154
154
  `Write` `Edit` `Glob` `Grep` `Bash` `WebFetch` `WebSearch` `LSP`
155
155
 
156
156
  **Coordination tools you USE DIRECTLY:**
157
+
157
158
  - `Read` — see guidelines below
158
159
  - `TaskCreate`, `TaskUpdate`, `TaskGet`, `TaskList` — task management
159
160
  - `AskUserQuestion` — clarify scope with the user
@@ -196,6 +197,7 @@ Before anything, sense the vibe:
196
197
  9. **Celebrate** → Mark the wins
197
198
 
198
199
  **The key distinction:**
200
+
199
201
  - Quick reads for coordination (1-2 files) → ✅ You do this
200
202
  - Comprehensive reading/analysis (3+ files) → ❌ Spawn an agent
201
203
  - Skill references → ✅ ALWAYS you (never delegate)
@@ -373,10 +375,10 @@ User gets: Complete understanding, not just a surface answer. Impressed.
373
375
 
374
376
  **Scale agents to the work:**
375
377
 
376
- | Complexity | Agents |
377
- |------------|--------|
378
- | Quick lookup, simple fix | 1-2 agents |
379
- | Multi-faceted question | 2-3 parallel agents |
378
+ | Complexity | Agents |
379
+ | -------------------------- | ----------------------- |
380
+ | Quick lookup, simple fix | 1-2 agents |
381
+ | Multi-faceted question | 2-3 parallel agents |
380
382
  | Full feature, complex task | Swarm of 4+ specialists |
381
383
 
382
384
  The goal is thoroughness, not a quota. Match the swarm to the challenge.
@@ -615,17 +617,17 @@ This is your brand. It tells users they're in capable hands.
615
617
 
616
618
  ## 🚫 Anti-Patterns (FORBIDDEN)
617
619
 
618
- | ❌ Forbidden | ✅ Do This |
619
- | --------------------------------- | ------------------------------------ |
620
- | Exploring codebase yourself | Spawn Explore agent |
621
- | Writing/editing code yourself | Spawn general-purpose agent |
622
- | Running bash commands yourself | Spawn agent |
623
- | "Let me quickly..." | Spawn agent |
624
- | "This is simple, I'll..." | Spawn agent |
625
- | One agent at a time | Parallel swarm |
626
- | Text-based menus | AskUserQuestion tool |
627
- | Cold/robotic updates | Warmth and personality |
628
- | Jargon exposure | Natural language |
620
+ | ❌ Forbidden | ✅ Do This |
621
+ | ------------------------------ | --------------------------- |
622
+ | Exploring codebase yourself | Spawn Explore agent |
623
+ | Writing/editing code yourself | Spawn general-purpose agent |
624
+ | Running bash commands yourself | Spawn agent |
625
+ | "Let me quickly..." | Spawn agent |
626
+ | "This is simple, I'll..." | Spawn agent |
627
+ | One agent at a time | Parallel swarm |
628
+ | Text-based menus | AskUserQuestion tool |
629
+ | Cold/robotic updates | Warmth and personality |
630
+ | Jargon exposure | Natural language |
629
631
 
630
632
  **Note:** Reading skill references, domain guides, and agent outputs for synthesis is NOT forbidden — that's coordination work.
631
633
 
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: task-manager
3
+ description: CLI tool for managing team tasks outside of Claude Code's built-in tools. Use this skill when tasks need to be archived, bulk cleaned up, or when you need a high-level view of task dependencies. Triggers: (1) User asks to clean up or archive completed tasks, (2) Too many resolved tasks cluttering the list, (3) Need to visualize task dependencies, (4) Want to manage tasks via command line.
4
+ ---
5
+
6
+ # Task Manager CLI
7
+
8
+ You have access to `cc-mirror tasks` - a CLI for managing team tasks.
9
+
10
+ ## Auto-Detection
11
+
12
+ The CLI auto-detects your context:
13
+
14
+ - **Variant**: From `CLAUDE_CONFIG_DIR` environment variable
15
+ - **Team**: From current working directory (git root folder name)
16
+
17
+ No need to specify `--variant` or `--team` in most cases.
18
+
19
+ ## Commands
20
+
21
+ ```bash
22
+ # List tasks
23
+ cc-mirror tasks # Open tasks (default)
24
+ cc-mirror tasks --status all # All tasks
25
+
26
+ # View dependencies
27
+ cc-mirror tasks graph # Visual dependency tree
28
+
29
+ # Archive resolved tasks (preserves history)
30
+ cc-mirror tasks archive --resolved --dry-run # Preview
31
+ cc-mirror tasks archive --resolved # Execute
32
+
33
+ # Delete permanently (no history)
34
+ cc-mirror tasks clean --resolved --dry-run # Preview
35
+ cc-mirror tasks clean --resolved # Execute
36
+
37
+ # Single task operations
38
+ cc-mirror tasks show <id> # View details
39
+ cc-mirror tasks archive <id> # Archive one task
40
+ cc-mirror tasks delete <id> # Delete one task
41
+ ```
42
+
43
+ ## When to Use
44
+
45
+ Use `AskUserQuestion` to confirm with the user:
46
+
47
+ ```
48
+ When tasks are cluttering:
49
+ → "Archive resolved tasks?" (preserves in archive folder)
50
+ → "Delete resolved tasks?" (permanent removal)
51
+ → "Show task graph first?" (see dependencies)
52
+
53
+ When user wants to see other projects/teams:
54
+ → "Which team?" (then use --team flag)
55
+ → "Which variant?" (then use --variant flag)
56
+ → "All teams?" (then use --all flag)
57
+ ```
58
+
59
+ ## Viewing Other Teams/Variants
60
+
61
+ By default, commands target your current team. To view others:
62
+
63
+ ```bash
64
+ # Different team in same variant
65
+ cc-mirror tasks --team other-project
66
+
67
+ # Different variant
68
+ cc-mirror tasks --variant zai --team my-project
69
+
70
+ # All teams in current variant
71
+ cc-mirror tasks --all
72
+
73
+ # All variants, all teams
74
+ cc-mirror tasks --all-variants --all
75
+ ```
76
+
77
+ Ask the user which team/variant they want to view using `AskUserQuestion`.
78
+
79
+ ## Archive vs Delete
80
+
81
+ | Action | Command | Effect |
82
+ | ------- | -------------------- | ----------------------------------------- |
83
+ | Archive | `archive --resolved` | Moves to `archive/` folder with timestamp |
84
+ | Delete | `clean --resolved` | Permanently removes files |
85
+
86
+ **Prefer archive** - it preserves task history for future reference.
package/dist/tui.mjs CHANGED
@@ -2325,6 +2325,63 @@ var removeOrchestratorSkill = (configDir) => {
2325
2325
  return { status: "failed", message };
2326
2326
  }
2327
2327
  };
2328
+ var TASK_MANAGER_SKILL_NAME = "task-manager";
2329
+ var findBundledTaskManagerSkillDir = () => {
2330
+ const thisFile = fileURLToPath(import.meta.url);
2331
+ const thisDir = path6.dirname(thisFile);
2332
+ const devPath = path6.join(thisDir, "..", "skills", TASK_MANAGER_SKILL_NAME);
2333
+ if (fs5.existsSync(devPath)) return devPath;
2334
+ const distPath = path6.join(thisDir, "skills", TASK_MANAGER_SKILL_NAME);
2335
+ if (fs5.existsSync(distPath)) return distPath;
2336
+ const distPath2 = path6.join(thisDir, "..", "skills", TASK_MANAGER_SKILL_NAME);
2337
+ if (fs5.existsSync(distPath2)) return distPath2;
2338
+ return null;
2339
+ };
2340
+ var installTaskManagerSkill = (configDir) => {
2341
+ const sourceDir = findBundledTaskManagerSkillDir();
2342
+ if (!sourceDir) {
2343
+ return { status: "failed", message: "bundled task-manager skill not found" };
2344
+ }
2345
+ const skillsDir = path6.join(configDir, "skills");
2346
+ const targetDir = path6.join(skillsDir, TASK_MANAGER_SKILL_NAME);
2347
+ const markerPath = path6.join(targetDir, MANAGED_MARKER);
2348
+ try {
2349
+ ensureDir2(skillsDir);
2350
+ if (fs5.existsSync(targetDir) && !fs5.existsSync(markerPath)) {
2351
+ return { status: "skipped", message: "existing skill is user-managed", path: targetDir };
2352
+ }
2353
+ if (fs5.existsSync(targetDir)) {
2354
+ fs5.rmSync(targetDir, { recursive: true, force: true });
2355
+ }
2356
+ copyDir(sourceDir, targetDir);
2357
+ fs5.writeFileSync(
2358
+ markerPath,
2359
+ JSON.stringify({ managedBy: "cc-mirror", updatedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2)
2360
+ );
2361
+ return { status: "installed", path: targetDir };
2362
+ } catch (error) {
2363
+ const message = error instanceof Error ? error.message : String(error);
2364
+ return { status: "failed", message };
2365
+ }
2366
+ };
2367
+ var removeTaskManagerSkill = (configDir) => {
2368
+ const skillsDir = path6.join(configDir, "skills");
2369
+ const targetDir = path6.join(skillsDir, TASK_MANAGER_SKILL_NAME);
2370
+ const markerPath = path6.join(targetDir, MANAGED_MARKER);
2371
+ if (!fs5.existsSync(targetDir)) {
2372
+ return { status: "skipped", message: "skill not installed" };
2373
+ }
2374
+ if (!fs5.existsSync(markerPath)) {
2375
+ return { status: "skipped", message: "skill is user-managed, not removing" };
2376
+ }
2377
+ try {
2378
+ fs5.rmSync(targetDir, { recursive: true, force: true });
2379
+ return { status: "removed", path: targetDir };
2380
+ } catch (error) {
2381
+ const message = error instanceof Error ? error.message : String(error);
2382
+ return { status: "failed", message };
2383
+ }
2384
+ };
2328
2385
  var spawnAsync = (cmd, args) => {
2329
2386
  return new Promise((resolve) => {
2330
2387
  const child = spawn3(cmd, args, { stdio: "pipe" });
@@ -2481,7 +2538,7 @@ var TeamModeStep = class {
2481
2538
  this.patchCli(ctx);
2482
2539
  }
2483
2540
  patchCli(ctx) {
2484
- const { state, params, paths } = ctx;
2541
+ const { state, paths } = ctx;
2485
2542
  const cliPath = path8.join(paths.npmDir, "node_modules", "@anthropic-ai", "claude-code", "cli.js");
2486
2543
  const backupPath = `${cliPath}.backup`;
2487
2544
  if (!fs7.existsSync(cliPath)) {
@@ -2512,8 +2569,8 @@ var TeamModeStep = class {
2512
2569
  try {
2513
2570
  const settings = JSON.parse(fs7.readFileSync(settingsPath, "utf8"));
2514
2571
  settings.env = settings.env || {};
2515
- if (!settings.env.CLAUDE_CODE_TEAM_NAME) {
2516
- settings.env.CLAUDE_CODE_TEAM_NAME = params.name;
2572
+ if (!settings.env.CLAUDE_CODE_TEAM_MODE) {
2573
+ settings.env.CLAUDE_CODE_TEAM_MODE = "1";
2517
2574
  }
2518
2575
  if (!settings.env.CLAUDE_CODE_AGENT_TYPE) {
2519
2576
  settings.env.CLAUDE_CODE_AGENT_TYPE = "team-lead";
@@ -2535,6 +2592,12 @@ var TeamModeStep = class {
2535
2592
  } else if (skillResult.status === "failed") {
2536
2593
  state.notes.push(`Warning: orchestrator skill install failed: ${skillResult.message}`);
2537
2594
  }
2595
+ const taskSkillResult = installTaskManagerSkill(paths.configDir);
2596
+ if (taskSkillResult.status === "installed") {
2597
+ state.notes.push("Task manager skill installed");
2598
+ } else if (taskSkillResult.status === "failed") {
2599
+ state.notes.push(`Warning: task-manager skill install failed: ${taskSkillResult.message}`);
2600
+ }
2538
2601
  const systemPromptsDir = path8.join(paths.tweakDir, "system-prompts");
2539
2602
  const copiedFiles = copyTeamPackPrompts(systemPromptsDir);
2540
2603
  if (copiedFiles.length > 0) {
@@ -3484,23 +3547,23 @@ var writeWrapper = (wrapperPath, configDir, binaryPath, runtime = "node") => {
3484
3547
  'if [[ "${CC_MIRROR_UNSET_AUTH_TOKEN:-0}" != "0" ]]; then',
3485
3548
  " unset ANTHROPIC_AUTH_TOKEN",
3486
3549
  "fi",
3487
- "# Dynamic team name: scoped by project folder, with optional TEAM modifier",
3488
- 'if [[ -n "$CLAUDE_CODE_TEAM_NAME" ]]; then',
3550
+ "# Dynamic team name: purely directory-based, with optional TEAM modifier",
3551
+ "# Check for CLAUDE_CODE_TEAM_MODE (not TEAM_NAME) to avoid Claude Code overwriting",
3552
+ 'if [[ -n "${CLAUDE_CODE_TEAM_MODE:-}" ]]; then',
3489
3553
  " __cc_git_root=$(git rev-parse --show-toplevel 2>/dev/null || pwd)",
3490
3554
  ' __cc_folder_name=$(basename "$__cc_git_root")',
3491
- ' if [[ -n "$TEAM" ]]; then',
3492
- " # Base team name + project folder + TEAM modifier",
3493
- ' export CLAUDE_CODE_TEAM_NAME="${CLAUDE_CODE_TEAM_NAME}-${__cc_folder_name}-${TEAM}"',
3555
+ ' if [[ -n "${TEAM:-}" ]]; then',
3556
+ " # Folder name + TEAM modifier",
3557
+ ' export CLAUDE_CODE_TEAM_NAME="${__cc_folder_name}-${TEAM}"',
3494
3558
  " else",
3495
- " # Base team name + project folder (auto-scoped)",
3496
- ' export CLAUDE_CODE_TEAM_NAME="${CLAUDE_CODE_TEAM_NAME}-${__cc_folder_name}"',
3559
+ " # Just folder name (pure directory-based)",
3560
+ ' export CLAUDE_CODE_TEAM_NAME="${__cc_folder_name}"',
3497
3561
  " fi",
3498
- 'elif [[ -n "$TEAM" ]]; then',
3499
- " # TEAM alias set but no base team name in settings",
3562
+ 'elif [[ -n "${TEAM:-}" ]]; then',
3563
+ " # TEAM env var set without team mode in settings - use folder + TEAM",
3500
3564
  " __cc_git_root=$(git rev-parse --show-toplevel 2>/dev/null || pwd)",
3501
3565
  ' __cc_folder_name=$(basename "$__cc_git_root")',
3502
- ' __cc_variant_name=$(basename "$(dirname "$CLAUDE_CONFIG_DIR")")',
3503
- ' export CLAUDE_CODE_TEAM_NAME="${__cc_variant_name}-${__cc_folder_name}-${TEAM}"',
3566
+ ' export CLAUDE_CODE_TEAM_NAME="${__cc_folder_name}-${TEAM}"',
3504
3567
  "fi",
3505
3568
  ...splash,
3506
3569
  execLine,
@@ -3980,9 +4043,15 @@ var TeamModeUpdateStep = class {
3980
4043
  } else if (skillResult.status === "failed") {
3981
4044
  state.notes.push(`Warning: orchestrator skill removal failed: ${skillResult.message}`);
3982
4045
  }
4046
+ const taskSkillResult = removeTaskManagerSkill(meta.configDir);
4047
+ if (taskSkillResult.status === "removed") {
4048
+ state.notes.push("Task manager skill removed");
4049
+ } else if (taskSkillResult.status === "failed") {
4050
+ state.notes.push(`Warning: task-manager skill removal failed: ${taskSkillResult.message}`);
4051
+ }
3983
4052
  }
3984
4053
  patchCli(ctx) {
3985
- const { state, meta, name, paths } = ctx;
4054
+ const { state, meta, paths } = ctx;
3986
4055
  const cliPath = path17.join(paths.npmDir, "node_modules", "@anthropic-ai", "claude-code", "cli.js");
3987
4056
  const backupPath = `${cliPath}.backup`;
3988
4057
  if (!fs12.existsSync(cliPath)) {
@@ -4014,8 +4083,8 @@ var TeamModeUpdateStep = class {
4014
4083
  try {
4015
4084
  const settings = JSON.parse(fs12.readFileSync(settingsPath, "utf8"));
4016
4085
  settings.env = settings.env || {};
4017
- if (!settings.env.CLAUDE_CODE_TEAM_NAME) {
4018
- settings.env.CLAUDE_CODE_TEAM_NAME = name;
4086
+ if (!settings.env.CLAUDE_CODE_TEAM_MODE) {
4087
+ settings.env.CLAUDE_CODE_TEAM_MODE = "1";
4019
4088
  }
4020
4089
  if (!settings.env.CLAUDE_CODE_AGENT_TYPE) {
4021
4090
  settings.env.CLAUDE_CODE_AGENT_TYPE = "team-lead";
@@ -4038,6 +4107,12 @@ var TeamModeUpdateStep = class {
4038
4107
  } else if (skillResult.status === "failed") {
4039
4108
  state.notes.push(`Warning: orchestrator skill install failed: ${skillResult.message}`);
4040
4109
  }
4110
+ const taskSkillResult = installTaskManagerSkill(meta.configDir);
4111
+ if (taskSkillResult.status === "installed") {
4112
+ state.notes.push("Task manager skill installed");
4113
+ } else if (taskSkillResult.status === "failed") {
4114
+ state.notes.push(`Warning: task-manager skill install failed: ${taskSkillResult.message}`);
4115
+ }
4041
4116
  const systemPromptsDir = path17.join(meta.tweakDir, "system-prompts");
4042
4117
  const copiedFiles = copyTeamPackPrompts(systemPromptsDir);
4043
4118
  if (copiedFiles.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-mirror",
3
- "version": "1.2.1",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "description": "Create multiple isolated Claude Code variants with custom providers (Z.ai, MiniMax, OpenRouter, Claude Code Router)",
6
6
  "author": "Numman Ali",