@atlashub/smartstack-cli 3.30.0 → 3.31.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlashub/smartstack-cli",
3
- "version": "3.30.0",
3
+ "version": "3.31.0",
4
4
  "description": "SmartStack Claude Code automation toolkit - GitFlow, EF Core migrations, prompts and more",
5
5
  "author": {
6
6
  "name": "SmartStack",
@@ -287,8 +287,8 @@ Load ONLY relevant categories based on feature type:
287
287
 
288
288
  **Team mode workflow (Propose & Review):**
289
289
  1. Steps 00-02 execute inline in the main conversation (interactive with user)
290
- 2. After step-02 decomposition: `TeamCreate({ team_name: "ba-{appName}" })`
291
- 3. For each module: spawn autonomous agent, agent proposes complete specification, team lead presents to user for validation
290
+ 2. After step-02 decomposition: clean up old team data (§1a), then `TeamCreate({ team_name: "ba-{appName}" })` — **CRITICAL: capture the RETURNED team name** (may differ from requested)
291
+ 3. For each module: spawn autonomous agent using the **returned** team name, agent proposes complete specification, team lead presents to user for validation
292
292
  4. After all modules specified: spawn consolidation agent (steps 04a + 04b), present report for user approval (04c)
293
293
  5. After consolidation approved: spawn handoff agent (steps 05a + 05b + 05c)
294
294
  6. `TeamDelete()` cleanup
@@ -10,14 +10,34 @@
10
10
 
11
11
  After step-02 decomposition is complete and client has approved the module structure:
12
12
 
13
+ ### 1a. Clean Up Old Team Data (MANDATORY)
14
+
15
+ Before creating the team, clean up any leftover data from previous sessions to prevent stale task collisions:
16
+
17
+ ```bash
18
+ # Remove leftover task files from previous runs
19
+ rm -f ~/.claude/tasks/ba-{appName}/*.json 2>/dev/null
20
+ # Remove leftover team directory (TeamDelete may leave remnants)
21
+ rm -rf ~/.claude/teams/ba-{appName} 2>/dev/null
13
22
  ```
14
- TeamCreate({ team_name: "ba-{appName}" })
23
+
24
+ > **Why:** If a previous session used the same team name and crashed or was interrupted,
25
+ > leftover task files will be picked up by new agents, causing them to receive stale
26
+ > task_assignment notifications for wrong modules.
27
+
28
+ ### 1b. Create Team and Capture Actual Name
29
+
30
+ ```javascript
31
+ const result = TeamCreate({ team_name: "ba-{appName}" });
32
+ // CRITICAL: TeamCreate may return a DIFFERENT name than requested!
33
+ // Always use the RETURNED team_name, not the requested one.
34
+ const actualTeamName = result.team_name;
15
35
  ```
16
36
 
17
37
  Store team context for the session:
18
38
  ```javascript
19
39
  const teamContext = {
20
- teamName: "ba-{appName}",
40
+ teamName: actualTeamName, // ← RETURNED name, NOT "ba-{appName}"
21
41
  moduleOrder: metadata.workflow.moduleOrder,
22
42
  dependencyLayers: dependencyGraph.layers || null,
23
43
  currentModuleIdx: 0,
@@ -26,6 +46,9 @@ const teamContext = {
26
46
  };
27
47
  ```
28
48
 
49
+ > **WARNING:** NEVER hardcode `"ba-{appName}"` in subsequent calls.
50
+ > Always use `teamContext.teamName` (the actual name returned by TeamCreate).
51
+
29
52
  ---
30
53
 
31
54
  ## 2. Module Agent Spawn — Sequential by Topological Order
@@ -54,7 +77,7 @@ Before spawning, gather the context the agent needs:
54
77
  ```javascript
55
78
  Task({
56
79
  subagent_type: "general-purpose",
57
- team_name: "ba-{appName}",
80
+ team_name: teamContext.teamName, // ← ACTUAL name from TeamCreate result
58
81
  name: "mod-{moduleCode}",
59
82
  model: "opus",
60
83
  mode: "bypassPermissions",
@@ -257,7 +280,7 @@ Display: "═══ All modules specified — Starting consolidation ═══"
257
280
  ```javascript
258
281
  Task({
259
282
  subagent_type: "general-purpose",
260
- team_name: "ba-{appName}",
283
+ team_name: teamContext.teamName, // ← ACTUAL name from TeamCreate result
261
284
  name: "consolidation",
262
285
  model: "opus",
263
286
  mode: "bypassPermissions",
@@ -316,7 +339,7 @@ After approval → shutdown consolidation agent → proceed to §6.
316
339
  ```javascript
317
340
  Task({
318
341
  subagent_type: "general-purpose",
319
- team_name: "ba-{appName}",
342
+ team_name: teamContext.teamName, // ← ACTUAL name from TeamCreate result
320
343
  name: "handoff",
321
344
  model: "sonnet",
322
345
  mode: "bypassPermissions",
@@ -436,8 +459,9 @@ If the entire session crashes:
436
459
  1. User restarts `/business-analyse`
437
460
  2. Step-00 detects existing feature.json with `status: "decomposed"` or partial modules
438
461
  3. Reads `metadata.workflow.completedModules` to know which modules are done
439
- 4. Creates new team, spawns agent for next incomplete module
440
- 5. Continues normally
462
+ 4. **Cleans up old team/task data** (§1a cleanup step) before creating new team
463
+ 5. Creates new team (§1b — captures actual team name), spawns agent for next incomplete module
464
+ 6. Continues normally
441
465
 
442
466
  ---
443
467