@atlashub/smartstack-cli 3.41.0 → 3.43.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.41.0",
3
+ "version": "3.43.0",
4
4
  "description": "SmartStack Claude Code automation toolkit - GitFlow, EF Core migrations, prompts and more",
5
5
  "author": {
6
6
  "name": "SmartStack",
@@ -2,9 +2,8 @@
2
2
  name: efcore-conflicts
3
3
  description: EF Core conflict analyzer - BLOCKING if conflict detected
4
4
  color: red
5
- model: sonnet
5
+ model: haiku
6
6
  tools: Bash, Glob, Read
7
- mcp: mcp__smartstack__check_migrations
8
7
  ---
9
8
 
10
9
  # EF Core Conflicts Agent
@@ -2,18 +2,19 @@
2
2
  name: efcore-db-deploy
3
3
  description: EF Core database deploy - apply pending migrations
4
4
  color: green
5
- model: sonnet
5
+ model: haiku
6
6
  tools: Bash, Glob
7
- steps:
8
- - steps/shared/step-00-init.md
9
- - steps/db/step-deploy.md
10
7
  ---
11
8
 
12
9
  # EF Core Database Deploy Agent
13
10
 
14
11
  Applies pending migrations to the local database.
15
12
 
16
- **Progressive Steps:** Load `steps/db/step-deploy.md` for detailed instructions.
13
+ ## FORBIDDEN
14
+
15
+ - **NEVER** create, delete, modify, or recreate migrations (`dotnet ef migrations add/remove` is FORBIDDEN)
16
+ - **NEVER** modify `.cs` files in the Migrations directory
17
+ - This agent ONLY runs `dotnet ef database update` to apply existing migrations
17
18
 
18
19
  ## WSL Preflight (MANDATORY - run BEFORE any git command)
19
20
 
@@ -2,18 +2,20 @@
2
2
  name: efcore-db-reset
3
3
  description: EF Core database reset - drop and recreate (DESTRUCTIVE)
4
4
  color: red
5
- model: sonnet
5
+ model: haiku
6
6
  tools: Bash, Glob, Read
7
- steps:
8
- - steps/shared/step-00-init.md
9
- - steps/db/step-reset.md
10
7
  ---
11
8
 
12
9
  # EF Core Database Reset Agent
13
10
 
14
11
  **WARNING: Destructive operation - deletes all data!**
15
12
 
16
- **Progressive Steps:** Load `steps/db/step-reset.md` for detailed instructions.
13
+ ## FORBIDDEN
14
+
15
+ - **NEVER** create, delete, modify, or recreate migrations (`dotnet ef migrations add/remove` is FORBIDDEN)
16
+ - **NEVER** modify `.cs` files in the Migrations directory
17
+ - **NEVER** run `dotnet ef migrations` commands of any kind
18
+ - This agent ONLY operates on the **database**, not on migration files
17
19
 
18
20
  ## WSL Preflight (MANDATORY - run BEFORE any git command)
19
21
 
@@ -4,16 +4,17 @@ description: EF Core database seed - populate test data
4
4
  color: yellow
5
5
  model: haiku
6
6
  tools: Bash, Glob, Read
7
- steps:
8
- - steps/shared/step-00-init.md
9
- - steps/db/step-seed.md
10
7
  ---
11
8
 
12
9
  # EF Core Database Seed Agent
13
10
 
14
11
  Populates the database with test data.
15
12
 
16
- **Progressive Steps:** Load `steps/db/step-seed.md` for detailed instructions.
13
+ ## FORBIDDEN
14
+
15
+ - **NEVER** create, delete, modify, or recreate migrations (`dotnet ef migrations add/remove` is FORBIDDEN)
16
+ - **NEVER** drop or recreate the database (`dotnet ef database drop` is FORBIDDEN)
17
+ - This agent ONLY seeds data into an existing database
17
18
 
18
19
  ## WSL Preflight (MANDATORY - run BEFORE any git command)
19
20
 
@@ -4,17 +4,17 @@ description: EF Core database status - fast migration state check
4
4
  color: blue
5
5
  model: haiku
6
6
  tools: Bash, Glob
7
- mcp: mcp__smartstack__check_migrations
8
- steps:
9
- - steps/shared/step-00-init.md
10
- - steps/db/step-status.md
11
7
  ---
12
8
 
13
9
  # EF Core Database Status Agent
14
10
 
15
11
  Fast check of EF Core migration state using **SmartStack MCP**.
16
12
 
17
- **Progressive Steps:** Load `steps/db/step-status.md` for detailed instructions.
13
+ ## FORBIDDEN
14
+
15
+ - **NEVER** create, delete, modify, or recreate migrations
16
+ - **NEVER** modify the database (`dotnet ef database update/drop` is FORBIDDEN)
17
+ - This agent is READ-ONLY: it only checks status, never modifies anything
18
18
 
19
19
  ## WSL Preflight (MANDATORY - run BEFORE any git command)
20
20
 
@@ -4,20 +4,12 @@ description: EF Core migration manager - orchestrates MCP for naming (1 per feat
4
4
  color: magenta
5
5
  model: sonnet
6
6
  tools: Bash, Glob, Read, Edit
7
- steps:
8
- - steps/shared/step-00-init.md
9
- - steps/migration/step-00-init.md
10
- - steps/migration/step-01-check.md
11
- - steps/migration/step-02-create.md
12
- - steps/migration/step-03-validate.md
13
7
  ---
14
8
 
15
9
  # EF Core Migration Agent
16
10
 
17
11
  Orchestrates migration creation with the "1 migration per feature" rule.
18
12
 
19
- **Progressive Steps:** Load `steps/migration/` for detailed instructions.
20
-
21
13
  ## WSL Preflight (MANDATORY - run BEFORE any git command)
22
14
 
23
15
  ```bash
@@ -4,21 +4,12 @@ description: EF Core snapshot rebaser - resync ModelSnapshot with develop
4
4
  color: yellow
5
5
  model: sonnet
6
6
  tools: Bash, Glob, Read, Edit
7
- steps:
8
- - steps/shared/step-00-init.md
9
- - steps/rebase-snapshot/step-00-init.md
10
- - steps/rebase-snapshot/step-01-backup.md
11
- - steps/rebase-snapshot/step-02-fetch.md
12
- - steps/rebase-snapshot/step-03-create.md
13
- - steps/rebase-snapshot/step-04-validate.md
14
7
  ---
15
8
 
16
9
  # EF Core Rebase-Snapshot Agent
17
10
 
18
11
  Rebases ModelSnapshot on develop to resolve conflicts.
19
12
 
20
- **Progressive Steps:** Load `steps/rebase-snapshot/` for detailed instructions.
21
-
22
13
  ## WSL Preflight (MANDATORY - run BEFORE any git command)
23
14
 
24
15
  ```bash
@@ -2,9 +2,8 @@
2
2
  name: efcore-scan
3
3
  description: EF Core cross-branch migration scanner - detect conflicts before they happen
4
4
  color: cyan
5
- model: sonnet
5
+ model: haiku
6
6
  tools: Bash, Glob, Read
7
- mcp: mcp__smartstack__check_migrations
8
7
  ---
9
8
 
10
9
  # EF Core Scan Agent
@@ -4,21 +4,12 @@ description: EF Core migration squasher - combine multiple migrations into one
4
4
  color: magenta
5
5
  model: sonnet
6
6
  tools: Bash, Glob, Read
7
- steps:
8
- - steps/shared/step-00-init.md
9
- - steps/squash/step-00-init.md
10
- - steps/squash/step-01-backup.md
11
- - steps/squash/step-02-fetch.md
12
- - steps/squash/step-03-create.md
13
- - steps/squash/step-04-validate.md
14
7
  ---
15
8
 
16
9
  # EF Core Squash Agent
17
10
 
18
11
  Consolidates multiple migrations into a single one, retrieving both the ModelSnapshot **AND the migrations** from the parent branch.
19
12
 
20
- **Progressive Steps:** Load `steps/squash/` for detailed instructions.
21
-
22
13
  ## WSL Preflight (MANDATORY - run BEFORE any git command)
23
14
 
24
15
  ```bash
@@ -8,10 +8,9 @@ disable-model-invocation: true
8
8
  ## Current state (auto-injected)
9
9
  - Preflight: !`if [ -f .git ] && grep -q '^gitdir: [A-Za-z]:' .git 2>/dev/null && grep -qi microsoft /proc/version 2>/dev/null; then p=$(sed 's/^gitdir: //' .git | tr -d '\r\n'); d=$(echo "${p:0:1}" | tr A-Z a-z); r="${p:2}"; r="${r//\\//}"; printf 'gitdir: %s\n' "$(realpath -m --relative-to="$(pwd)" "/mnt/$d$r")" > .git && echo "repaired"; else echo "ok"; fi`
10
10
  - Branch: !`git branch --show-current 2>/dev/null || echo "UNAVAILABLE"`
11
- - Recent migrations: _(detected in step-00-init)_
12
11
 
13
12
  <objective>
14
- Manage EF Core migrations and database operations with progressive step loading, MCP validation, and DbContext auto-detection.
13
+ Manage EF Core migrations and database operations. **ALWAYS delegate to Task agents** for fast execution.
15
14
  </objective>
16
15
 
17
16
  <quick_start>
@@ -33,88 +32,48 @@ Manage EF Core migrations and database operations with progressive step loading,
33
32
  ```
34
33
  </quick_start>
35
34
 
36
- <parameters>
37
-
38
- <subcommands>
39
- | Command | Description | Steps |
40
- |---------|-------------|-------|
41
- | `db-status` | Display migrations and database status | steps/db/status/ |
42
- | `db-deploy` | Apply pending migrations | steps/db/deploy/ |
43
- | `db-reset` | Drop + recreate database | steps/db/reset/ |
44
- | `db-seed` | Populate with test data | steps/db/seed/ |
45
- | `migration` | Create/recreate migration | steps/migration/ |
46
- | `squash` | Consolidate migrations | steps/squash/ |
47
- | `rebase-snapshot` | Sync snapshot with parent | steps/rebase-snapshot/ |
48
- | `scan` | Scan for conflicts | (MCP-centric) |
49
- | `conflicts` | Analyze conflicts | (MCP-centric) |
50
- </subcommands>
51
-
52
35
  <flags>
53
36
  | Flag | Description |
54
37
  |------|-------------|
55
38
  | `--context <name>` | Specify DbContext (CoreDbContext/ExtensionsDbContext) |
56
- | `--env <name>` | Use appsettings.{name}.json |
57
- | `--verbose` | Show detailed output |
58
39
  | `--force` | Skip confirmations |
59
- | `--dry-run` | Preview without executing |
60
40
  </flags>
61
41
 
62
- </parameters>
63
-
64
- <state_variables>
65
- **Shared state across all steps:**
66
-
67
- | Variable | Type | Description |
68
- |----------|------|-------------|
69
- | `{command}` | string | Current subcommand |
70
- | `{dbcontext}` | string | CoreDbContext or ExtensionsDbContext |
71
- | `{dbcontext_type}` | string | "core" or "extensions" |
72
- | `{schema}` | string | Database schema |
73
- | `{infra_project}` | string | Path to Infrastructure project |
74
- | `{startup_project}` | string | Path to API/Web project |
75
- | `{migrations_dir}` | string | Path to Migrations folder |
76
- | `{base_branch}` | string | Parent branch (develop/main) |
77
- | `{branch_type}` | string | feature/release/hotfix |
78
- | `{auto_mode}` | boolean | Skip confirmations |
79
- </state_variables>
80
-
81
42
  <entry_point>
82
43
 
83
- **ROUTING LOGIC:**
44
+ **ROUTING: ALWAYS delegate to Task agent. Never execute inline.**
84
45
 
85
- 1. Parse command and flags from input
86
- 2. Load shared init step: `steps/shared/step-00-init.md`
87
- 3. Route to command-specific steps:
46
+ Parse the command from `$ARGUMENTS` and delegate to the matching agent:
88
47
 
89
- | Command | Route To |
90
- |---------|----------|
91
- | `db-status` | `steps/db/step-status.md` |
92
- | `db-deploy` | `steps/db/step-deploy.md` |
93
- | `db-reset` | `steps/db/step-reset.md` |
94
- | `db-seed` | `steps/db/step-seed.md` |
95
- | `migration` | `steps/migration/step-00-init.md` |
96
- | `squash` | `steps/squash/step-00-init.md` |
97
- | `rebase-snapshot` | `steps/rebase-snapshot/step-00-init.md` |
98
- | `scan` | Use `commands/efcore/scan.md` (MCP-centric, no steps) |
99
- | `conflicts` | Use `commands/efcore/conflicts.md` (MCP-centric, no steps) |
48
+ | Command | Task Agent (`subagent_type`) | Model | Description |
49
+ |---------|----------------------------|-------|-------------|
50
+ | `db-status` | `efcore-db-status` | haiku | Fast migration state check |
51
+ | `db-deploy` | `efcore-db-deploy` | haiku | Apply pending migrations |
52
+ | `db-reset` | `efcore-db-reset` | haiku | Drop + recreate database |
53
+ | `db-seed` | `efcore-db-seed` | haiku | Populate with test data |
54
+ | `migration` | `efcore-migration` | sonnet | Create/recreate migration (MCP) |
55
+ | `squash` | `efcore-squash` | sonnet | Consolidate migrations (MCP) |
56
+ | `rebase-snapshot` | `efcore-rebase-snapshot` | sonnet | Sync snapshot with parent (MCP) |
57
+ | `scan` | `efcore-scan` | haiku | Cross-branch conflict scan |
58
+ | `conflicts` | `efcore-conflicts` | haiku | Conflict analysis |
100
59
 
101
- </entry_point>
60
+ **Delegation template:**
102
61
 
103
- <shared_functions>
104
- **Always load first:** `steps/shared/step-00-init.md`
62
+ ```
63
+ Task(
64
+ subagent_type: "{agent_name}",
65
+ prompt: "Execute /efcore {command} in {cwd}. Branch: {branch}. Flags: {flags}",
66
+ mode: "bypassPermissions"
67
+ )
68
+ ```
105
69
 
106
- This step provides:
107
- - `detect_efcore_project()` - Find EF Core project files
108
- - `detect_dbcontext()` - Auto-detect Core vs Extensions
109
- - `detect_environment()` - Load connection string
110
- - `determine_base_branch()` - Find parent branch
111
- - `block_production()` - Safety check
70
+ **Pass to agent prompt:**
71
+ - Current working directory (absolute path)
72
+ - Current branch name
73
+ - Any flags (--context, --force)
74
+ - User's description (for migration command)
112
75
 
113
- **MCP Integration:**
114
- - `mcp__smartstack__suggest_migration` - Generate compliant names
115
- - `mcp__smartstack__check_migrations` - Analyze conflicts
116
- - `mcp__smartstack__validate_conventions` - Validate structure
117
- </shared_functions>
76
+ </entry_point>
118
77
 
119
78
  <dual_dbcontext>
120
79
  SmartStack uses **two separate DbContexts**:
@@ -123,12 +82,6 @@ SmartStack uses **two separate DbContexts**:
123
82
  |---------|-----------|--------|---------------|
124
83
  | `core` | `CoreDbContext` | `core` | `core.__EFMigrationsHistory` |
125
84
  | `extensions` | `ExtensionsDbContext` | `extensions` | `extensions.__EFMigrationsHistory` |
126
-
127
- **Auto-detection priority:**
128
- 1. SmartStack.Domain exists → CoreDbContext
129
- 2. Client with SmartStack NuGet → ExtensionsDbContext
130
- 3. Code scan for DbContext classes
131
- 4. Ask user if ambiguous
132
85
  </dual_dbcontext>
133
86
 
134
87
  <naming_convention>
@@ -136,33 +89,12 @@ SmartStack uses **two separate DbContexts**:
136
89
 
137
90
  Pattern: `{context}_v{version}_{sequence}_{Description}`
138
91
 
139
- Examples:
140
- - `core_v1.9.0_001_AddUserRoles`
141
- - `extensions_v1.2.0_001_AddCustomFields`
142
-
143
- **FORBIDDEN:** Manual name calculation. Always use MCP.
92
+ **FORBIDDEN:** Manual name calculation. Always use `mcp__smartstack__suggest_migration`.
144
93
  </naming_convention>
145
94
 
146
95
  <safety_rules>
147
- 1. **Backup MANDATORY** for destructive operations
96
+ 1. **Backup MANDATORY** for destructive operations (db-reset, squash)
148
97
  2. **Production BLOCKED** - Never run on production
149
98
  3. **1 migration per feature** - Recreate, don't accumulate
150
- 4. **Snapshot + Migrations** - Always recover BOTH from parent
151
- 5. **MCP for naming** - Never hardcode migration names
99
+ 4. **MCP for naming** - Never hardcode migration names
152
100
  </safety_rules>
153
-
154
- <execution_rules>
155
- - **Load one step at a time** - Progressive loading
156
- - **State persists** - Variables carry across steps
157
- - **Follow next_step** - Each step defines next
158
- - **MCP validation** - Use SmartStack tools
159
- - **Safety > Correctness > Speed**
160
- </execution_rules>
161
-
162
- <success_criteria>
163
- - DbContext correctly detected
164
- - Migrations created with MCP naming
165
- - Database operations succeed
166
- - Parent migrations preserved (for squash/rebase)
167
- - Build passes after changes
168
- </success_criteria>