@atlashub/smartstack-cli 3.41.0 → 3.42.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 +1 -1
- package/templates/agents/efcore/conflicts.md +1 -2
- package/templates/agents/efcore/db-deploy.md +1 -4
- package/templates/agents/efcore/db-reset.md +1 -4
- package/templates/agents/efcore/db-seed.md +0 -3
- package/templates/agents/efcore/db-status.md +0 -4
- package/templates/agents/efcore/migration.md +0 -6
- package/templates/agents/efcore/rebase-snapshot.md +0 -7
- package/templates/agents/efcore/scan.md +1 -2
- package/templates/agents/efcore/squash.md +0 -7
- package/templates/skills/efcore/SKILL.md +31 -99
package/package.json
CHANGED
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
name: efcore-db-deploy
|
|
3
3
|
description: EF Core database deploy - apply pending migrations
|
|
4
4
|
color: green
|
|
5
|
-
model:
|
|
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
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
name: efcore-db-reset
|
|
3
3
|
description: EF Core database reset - drop and recreate (DESTRUCTIVE)
|
|
4
4
|
color: red
|
|
5
|
-
model:
|
|
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
|
|
@@ -4,10 +4,6 @@ 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
|
|
@@ -4,12 +4,6 @@ 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
|
|
@@ -4,13 +4,6 @@ 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
|
|
@@ -4,13 +4,6 @@ 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
|
|
@@ -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
|
|
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
|
|
44
|
+
**ROUTING: ALWAYS delegate to Task agent. Never execute inline.**
|
|
84
45
|
|
|
85
|
-
|
|
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 |
|
|
90
|
-
|
|
91
|
-
| `db-status` | `
|
|
92
|
-
| `db-deploy` | `
|
|
93
|
-
| `db-reset` | `
|
|
94
|
-
| `db-seed` | `
|
|
95
|
-
| `migration` | `
|
|
96
|
-
| `squash` | `
|
|
97
|
-
| `rebase-snapshot` | `
|
|
98
|
-
| `scan` |
|
|
99
|
-
| `conflicts` |
|
|
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
|
-
|
|
60
|
+
**Delegation template:**
|
|
102
61
|
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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. **
|
|
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>
|