@atlashub/smartstack-cli 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.
- package/.documentation/agents.html +912 -0
- package/.documentation/apex.html +1014 -0
- package/.documentation/business-analyse.html +1074 -0
- package/.documentation/commands.html +676 -0
- package/.documentation/css/styles.css +2030 -0
- package/.documentation/efcore.html +2501 -0
- package/.documentation/gitflow.html +2053 -0
- package/.documentation/hooks.html +409 -0
- package/.documentation/index.html +319 -0
- package/.documentation/installation.html +458 -0
- package/.documentation/js/app.js +794 -0
- package/.documentation/test-web.html +509 -0
- package/README.md +90 -0
- package/config/default-config.json +86 -0
- package/config/settings.json +53 -0
- package/config/settings.local.example.json +16 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +38198 -0
- package/dist/index.js.map +1 -0
- package/package.json +86 -0
- package/templates/agents/action.md +36 -0
- package/templates/agents/efcore/conflicts.md +57 -0
- package/templates/agents/efcore/db-deploy.md +51 -0
- package/templates/agents/efcore/db-reset.md +59 -0
- package/templates/agents/efcore/db-seed.md +56 -0
- package/templates/agents/efcore/db-status.md +43 -0
- package/templates/agents/efcore/migration.md +85 -0
- package/templates/agents/efcore/rebase-snapshot.md +62 -0
- package/templates/agents/efcore/scan.md +60 -0
- package/templates/agents/efcore/squash.md +67 -0
- package/templates/agents/explore-codebase.md +65 -0
- package/templates/agents/explore-docs.md +97 -0
- package/templates/agents/fix-grammar.md +49 -0
- package/templates/agents/gitflow/abort.md +45 -0
- package/templates/agents/gitflow/cleanup.md +85 -0
- package/templates/agents/gitflow/commit.md +40 -0
- package/templates/agents/gitflow/exec.md +48 -0
- package/templates/agents/gitflow/finish.md +92 -0
- package/templates/agents/gitflow/init.md +139 -0
- package/templates/agents/gitflow/merge.md +62 -0
- package/templates/agents/gitflow/plan.md +42 -0
- package/templates/agents/gitflow/pr.md +78 -0
- package/templates/agents/gitflow/review.md +49 -0
- package/templates/agents/gitflow/start.md +61 -0
- package/templates/agents/gitflow/status.md +32 -0
- package/templates/agents/snipper.md +36 -0
- package/templates/agents/websearch.md +46 -0
- package/templates/commands/_resources/formatting-guide.md +124 -0
- package/templates/commands/ai-prompt.md +315 -0
- package/templates/commands/apex/1-analyze.md +100 -0
- package/templates/commands/apex/2-plan.md +145 -0
- package/templates/commands/apex/3-execute.md +171 -0
- package/templates/commands/apex/4-examine.md +116 -0
- package/templates/commands/apex/5-tasks.md +209 -0
- package/templates/commands/apex.md +76 -0
- package/templates/commands/application/create.md +362 -0
- package/templates/commands/application/templates-backend.md +463 -0
- package/templates/commands/application/templates-frontend.md +517 -0
- package/templates/commands/application/templates-i18n.md +478 -0
- package/templates/commands/application/templates-seed.md +362 -0
- package/templates/commands/application.md +303 -0
- package/templates/commands/business-analyse/1-init.md +269 -0
- package/templates/commands/business-analyse/2-discover.md +520 -0
- package/templates/commands/business-analyse/3-analyse.md +408 -0
- package/templates/commands/business-analyse/4-specify.md +598 -0
- package/templates/commands/business-analyse/5-validate.md +326 -0
- package/templates/commands/business-analyse/6-handoff.md +746 -0
- package/templates/commands/business-analyse/7-doc-html.md +602 -0
- package/templates/commands/business-analyse/bug.md +325 -0
- package/templates/commands/business-analyse/change-request.md +368 -0
- package/templates/commands/business-analyse/hotfix.md +200 -0
- package/templates/commands/business-analyse.md +559 -0
- package/templates/commands/controller/create.md +216 -0
- package/templates/commands/controller/postman-templates.md +528 -0
- package/templates/commands/controller/templates.md +600 -0
- package/templates/commands/controller.md +278 -0
- package/templates/commands/debug.md +95 -0
- package/templates/commands/documentation/module.md +202 -0
- package/templates/commands/documentation/templates.md +432 -0
- package/templates/commands/documentation.md +190 -0
- package/templates/commands/efcore/_env-check.md +153 -0
- package/templates/commands/efcore/conflicts.md +269 -0
- package/templates/commands/efcore/db-deploy.md +193 -0
- package/templates/commands/efcore/db-reset.md +426 -0
- package/templates/commands/efcore/db-seed.md +326 -0
- package/templates/commands/efcore/db-status.md +214 -0
- package/templates/commands/efcore/migration.md +388 -0
- package/templates/commands/efcore/rebase-snapshot.md +264 -0
- package/templates/commands/efcore/scan.md +202 -0
- package/templates/commands/efcore/squash.md +298 -0
- package/templates/commands/efcore.md +176 -0
- package/templates/commands/epct.md +69 -0
- package/templates/commands/explain.md +186 -0
- package/templates/commands/explore.md +45 -0
- package/templates/commands/feature-full.md +267 -0
- package/templates/commands/gitflow/1-init.md +1038 -0
- package/templates/commands/gitflow/10-start.md +768 -0
- package/templates/commands/gitflow/11-finish.md +323 -0
- package/templates/commands/gitflow/12-cleanup.md +276 -0
- package/templates/commands/gitflow/13-sync.md +216 -0
- package/templates/commands/gitflow/14-rebase.md +251 -0
- package/templates/commands/gitflow/2-status.md +167 -0
- package/templates/commands/gitflow/3-commit.md +194 -0
- package/templates/commands/gitflow/4-plan.md +145 -0
- package/templates/commands/gitflow/5-exec.md +147 -0
- package/templates/commands/gitflow/6-abort.md +344 -0
- package/templates/commands/gitflow/7-pull-request.md +226 -0
- package/templates/commands/gitflow/8-review.md +176 -0
- package/templates/commands/gitflow/9-merge.md +224 -0
- package/templates/commands/gitflow.md +128 -0
- package/templates/commands/implement.md +663 -0
- package/templates/commands/notification.md +129 -0
- package/templates/commands/oneshot.md +57 -0
- package/templates/commands/quick-search.md +72 -0
- package/templates/commands/review.md +106 -0
- package/templates/commands/utils/test-web-config.md +160 -0
- package/templates/commands/utils/test-web.md +151 -0
- package/templates/commands/workflow.md +193 -0
- package/templates/gitflow/config.json +138 -0
- package/templates/hooks/ef-migration-check.md +139 -0
- package/templates/hooks/hooks.json +15 -0
- package/templates/skills/ai-prompt/SKILL.md +778 -0
- package/templates/skills/application/SKILL.md +563 -0
- package/templates/skills/application/templates-backend.md +450 -0
- package/templates/skills/application/templates-frontend.md +531 -0
- package/templates/skills/application/templates-i18n.md +520 -0
- package/templates/skills/application/templates-seed.md +647 -0
- package/templates/skills/business-analyse/SKILL.md +191 -0
- package/templates/skills/business-analyse/questionnaire.md +283 -0
- package/templates/skills/business-analyse/templates-frd.md +477 -0
- package/templates/skills/business-analyse/templates-react.md +580 -0
- package/templates/skills/controller/SKILL.md +240 -0
- package/templates/skills/controller/postman-templates.md +614 -0
- package/templates/skills/controller/templates.md +1468 -0
- package/templates/skills/documentation/SKILL.md +133 -0
- package/templates/skills/documentation/templates.md +476 -0
- package/templates/skills/feature-full/SKILL.md +838 -0
- package/templates/skills/notification/SKILL.md +555 -0
- package/templates/skills/ui-components/SKILL.md +870 -0
- package/templates/skills/workflow/SKILL.md +582 -0
- package/templates/test-web/api-health.json +38 -0
- package/templates/test-web/minimal.json +19 -0
- package/templates/test-web/npm-package.json +46 -0
- package/templates/test-web/seo-check.json +54 -0
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlashub/smartstack-cli",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "SmartStack Claude Code automation toolkit - GitFlow, APEX, EF Core migrations, prompts and more",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "SmartStack",
|
|
7
|
+
"email": "contact@smartstack.app",
|
|
8
|
+
"url": "https://smartstack.app"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"private": false,
|
|
12
|
+
"type": "commonjs",
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"bin": {
|
|
16
|
+
"smartstack": "./dist/index.js",
|
|
17
|
+
"ss": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"templates",
|
|
22
|
+
"config",
|
|
23
|
+
".documentation"
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18.0.0"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"registry": "https://registry.npmjs.org",
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://dev.azure.com/AtlasHub/SmartStack/_git/SmartStack.cli"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://smartstack.app",
|
|
37
|
+
"keywords": [
|
|
38
|
+
"smartstack",
|
|
39
|
+
"claude",
|
|
40
|
+
"claude-code",
|
|
41
|
+
"gitflow",
|
|
42
|
+
"apex",
|
|
43
|
+
"efcore",
|
|
44
|
+
"entity-framework",
|
|
45
|
+
"migrations",
|
|
46
|
+
"cli",
|
|
47
|
+
"automation",
|
|
48
|
+
"anthropic",
|
|
49
|
+
"dotnet",
|
|
50
|
+
"prompts",
|
|
51
|
+
"ai-tools"
|
|
52
|
+
],
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "tsup --watch",
|
|
55
|
+
"build": "npx tsup",
|
|
56
|
+
"lint": "eslint src --ext .ts",
|
|
57
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
58
|
+
"prepublishOnly": "npm run build",
|
|
59
|
+
"test": "node --test",
|
|
60
|
+
"link": "npm run build && npm link",
|
|
61
|
+
"install:local": "npm run build && node dist/index.js install --local --force",
|
|
62
|
+
"install:global": "npm run build && node dist/index.js install --force",
|
|
63
|
+
"status:local": "node dist/index.js status --local --verbose",
|
|
64
|
+
"status:global": "node dist/index.js status --verbose"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"chalk": "^5.3.0",
|
|
68
|
+
"cli-table3": "^0.6.3",
|
|
69
|
+
"commander": "^12.0.0",
|
|
70
|
+
"fs-extra": "^11.2.0",
|
|
71
|
+
"inquirer": "^9.2.12",
|
|
72
|
+
"ora": "^8.0.1",
|
|
73
|
+
"zod": "^3.22.4"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@types/fs-extra": "^11.0.4",
|
|
77
|
+
"@types/inquirer": "^9.0.7",
|
|
78
|
+
"@types/node": "^20.10.6",
|
|
79
|
+
"@typescript-eslint/eslint-plugin": "^6.18.0",
|
|
80
|
+
"@typescript-eslint/parser": "^6.18.0",
|
|
81
|
+
"eslint": "^8.56.0",
|
|
82
|
+
"prettier": "^3.2.4",
|
|
83
|
+
"tsup": "^8.0.1",
|
|
84
|
+
"typescript": "^5.3.3"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: action
|
|
3
|
+
description: Conditional action executor - performs actions only when specific conditions are met
|
|
4
|
+
color: purple
|
|
5
|
+
model: haiku
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Batch conditional executor. Handle ≤5 tasks. VERIFY INDEPENDENTLY before each action.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. **VERIFY each item yourself** (never trust input):
|
|
13
|
+
- **Exports/Types**: Grep for `import.*{name}` in codebase
|
|
14
|
+
- **Files**: Check framework patterns via explore-docs, then Grep for imports
|
|
15
|
+
- **Dependencies**: Grep for `from 'pkg'` or `require('pkg')`
|
|
16
|
+
|
|
17
|
+
2. **Execute ONLY if verified unused**:
|
|
18
|
+
- If used → Skip with reason, continue next
|
|
19
|
+
- If unused → Execute action, confirm success
|
|
20
|
+
|
|
21
|
+
3. **Report**: Count executed, count skipped with reasons
|
|
22
|
+
|
|
23
|
+
## Rules
|
|
24
|
+
|
|
25
|
+
- **MANDATORY**: Verify each item independently using Grep/explore-docs
|
|
26
|
+
- **Skip if used**: Continue to next task
|
|
27
|
+
- **Max 5 tasks**: Process all in batch
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
"Verify and remove: lodash, axios, moment"
|
|
32
|
+
|
|
33
|
+
1. Grep `lodash` → Found in utils.ts → Skip
|
|
34
|
+
2. Grep `axios` → Not found → `pnpm remove axios` → Done
|
|
35
|
+
3. Grep `moment` → Not found → `pnpm remove moment` → Done
|
|
36
|
+
Report: "Removed 2/3: axios, moment. Skipped: lodash (used in utils.ts)"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: efcore-conflicts
|
|
3
|
+
description: EF Core conflict analyzer - BLOCKING if conflict detected
|
|
4
|
+
color: red
|
|
5
|
+
model: sonnet
|
|
6
|
+
tools: Bash, Glob, Read
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# EF Core Conflicts Agent
|
|
10
|
+
|
|
11
|
+
Analyzes migration conflicts between branches. **BLOCKING** if conflict detected.
|
|
12
|
+
|
|
13
|
+
## Mission
|
|
14
|
+
|
|
15
|
+
1. **Locate** ModelSnapshots (local + develop)
|
|
16
|
+
2. **Compare** differences
|
|
17
|
+
3. **Identify** conflict type
|
|
18
|
+
4. **Scan** other active branches
|
|
19
|
+
5. **Block** if HIGH or CRITICAL conflict
|
|
20
|
+
|
|
21
|
+
## Conflict Levels
|
|
22
|
+
|
|
23
|
+
| Level | Condition | Exit Code |
|
|
24
|
+
|-------|-----------|-----------|
|
|
25
|
+
| NONE | Snapshot = develop | 0 |
|
|
26
|
+
| LOW | Different tables | 0 |
|
|
27
|
+
| MEDIUM | FK to same table | 0 (warning) |
|
|
28
|
+
| HIGH | Same table modified | 1 (BLOCK) |
|
|
29
|
+
| CRITICAL | Same column | 1 (BLOCK) |
|
|
30
|
+
|
|
31
|
+
## Key Commands
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Compare snapshots
|
|
35
|
+
diff develop/Snapshot.cs local/Snapshot.cs
|
|
36
|
+
|
|
37
|
+
# Extract tables
|
|
38
|
+
grep -oE 'ToTable\("([^"]+)"' Snapshot.cs
|
|
39
|
+
|
|
40
|
+
# Extract columns
|
|
41
|
+
grep -oE 'Property<[^>]+>\("([^"]+)"' Snapshot.cs
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Required Output
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
STATUS: {OK|WARNING|CONFLICT}
|
|
48
|
+
EXIT CODE: {0|1}
|
|
49
|
+
|
|
50
|
+
If conflict:
|
|
51
|
+
RESOLUTION:
|
|
52
|
+
/efcore:rebase-snapshot
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Priority
|
|
56
|
+
|
|
57
|
+
Correctness > Speed. Never ignore HIGH/CRITICAL conflicts.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: efcore-db-deploy
|
|
3
|
+
description: EF Core database deploy - apply pending migrations
|
|
4
|
+
color: green
|
|
5
|
+
model: haiku
|
|
6
|
+
tools: Bash, Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# EF Core Database Deploy Agent
|
|
10
|
+
|
|
11
|
+
Applies pending migrations to the local database.
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
1. **Verify** appsettings.Local.json exists
|
|
16
|
+
2. **Count** pending migrations
|
|
17
|
+
3. **Apply** `dotnet ef database update`
|
|
18
|
+
4. **Confirm** success
|
|
19
|
+
|
|
20
|
+
## Commands
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Verify config
|
|
24
|
+
test -f appsettings.Local.json && echo "OK" || echo "MISSING"
|
|
25
|
+
|
|
26
|
+
# Apply
|
|
27
|
+
dotnet ef database update --verbose
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Output Format
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
DB DEPLOY
|
|
34
|
+
Config: appsettings.Local.json
|
|
35
|
+
Applied: {n} migration(s)
|
|
36
|
+
Status: {success|error}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Error Handling
|
|
40
|
+
|
|
41
|
+
If connection error:
|
|
42
|
+
```
|
|
43
|
+
ERROR: Database connection failed
|
|
44
|
+
→ Verify SQL Server is running
|
|
45
|
+
→ Verify appsettings.Local.json
|
|
46
|
+
→ /efcore:db-reset to create DB
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Priority
|
|
50
|
+
|
|
51
|
+
Speed > Verbosity. Minimal output if successful.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: efcore-db-reset
|
|
3
|
+
description: EF Core database reset - drop and recreate (DESTRUCTIVE)
|
|
4
|
+
color: red
|
|
5
|
+
model: sonnet
|
|
6
|
+
tools: Bash, Glob, Read
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# EF Core Database Reset Agent
|
|
10
|
+
|
|
11
|
+
**WARNING: Destructive operation - deletes all data!**
|
|
12
|
+
|
|
13
|
+
> **CLAUDE INSTRUCTION:** The `AskUserQuestion({...})` blocks are instructions to use the `AskUserQuestion` tool **interactively**. You MUST execute the tool with these parameters to get the user's response BEFORE continuing.
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
|
|
17
|
+
1. **CONFIRM** with user (mandatory)
|
|
18
|
+
2. **Backup** optional before deletion
|
|
19
|
+
3. **Drop** database
|
|
20
|
+
4. **Recreate** with all migrations
|
|
21
|
+
5. **Seed** optional
|
|
22
|
+
|
|
23
|
+
## Mandatory Confirmation
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
AskUserQuestion({
|
|
27
|
+
question: "DELETE the database? (data loss)",
|
|
28
|
+
options: ["Yes, delete", "No, cancel"]
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Commands
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Drop
|
|
36
|
+
dotnet ef database drop --force
|
|
37
|
+
|
|
38
|
+
# Recreate
|
|
39
|
+
dotnet ef database update
|
|
40
|
+
|
|
41
|
+
# Backup (optional)
|
|
42
|
+
sqlcmd -S $SERVER -E -Q "BACKUP DATABASE [$DB] TO DISK='backup.bak'"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Output Format
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
DB RESET
|
|
49
|
+
Action: Drop + Recreate
|
|
50
|
+
Backup: {path|none}
|
|
51
|
+
Migrations: {n} applied
|
|
52
|
+
Status: {success|error}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Safety
|
|
56
|
+
|
|
57
|
+
- ALWAYS ask for confirmation
|
|
58
|
+
- Propose backup
|
|
59
|
+
- Block if ASPNETCORE_ENVIRONMENT=Production
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: efcore-db-seed
|
|
3
|
+
description: EF Core database seed - populate test data
|
|
4
|
+
color: yellow
|
|
5
|
+
model: haiku
|
|
6
|
+
tools: Bash, Glob, Read
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# EF Core Database Seed Agent
|
|
10
|
+
|
|
11
|
+
Populates the database with test data.
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
1. **Detect** available seeding method:
|
|
16
|
+
- SQL Script: `scripts/seed.sql`
|
|
17
|
+
- HasData: in configurations
|
|
18
|
+
- CLI: `--seed` argument
|
|
19
|
+
2. **Execute** the found method
|
|
20
|
+
3. **Verify** insertion
|
|
21
|
+
|
|
22
|
+
## Detection
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# SQL Script
|
|
26
|
+
test -f scripts/seed.sql && echo "sql-script"
|
|
27
|
+
|
|
28
|
+
# HasData
|
|
29
|
+
grep -r "\.HasData(" --include="*.cs" && echo "hasdata"
|
|
30
|
+
|
|
31
|
+
# CLI seed
|
|
32
|
+
grep -q "\-\-seed" Program.cs && echo "cli-seed"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Execution
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# SQL Script
|
|
39
|
+
sqlcmd -S $SERVER -E -d $DATABASE -i scripts/seed.sql
|
|
40
|
+
|
|
41
|
+
# CLI
|
|
42
|
+
dotnet run -- --seed
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Output Format
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
DB SEED
|
|
49
|
+
Method: {sql-script|hasdata|cli}
|
|
50
|
+
Status: {success|error}
|
|
51
|
+
Records: {n} inserted (if available)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Priority
|
|
55
|
+
|
|
56
|
+
Speed > Detail. Execute without too many questions.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: efcore-db-status
|
|
3
|
+
description: EF Core database status - fast migration state check
|
|
4
|
+
color: blue
|
|
5
|
+
model: haiku
|
|
6
|
+
tools: Bash, Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# EF Core Database Status Agent
|
|
10
|
+
|
|
11
|
+
Fast check of EF Core migration state.
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
1. **Detect** EF Core project (*.csproj with EntityFrameworkCore)
|
|
16
|
+
2. **List** migrations with `dotnet ef migrations list`
|
|
17
|
+
3. **Count** applied vs pending
|
|
18
|
+
4. **Verify** 1 migration per feature rule
|
|
19
|
+
5. **Output** compact summary
|
|
20
|
+
|
|
21
|
+
## Commands
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Migrations
|
|
25
|
+
dotnet ef migrations list --no-build 2>/dev/null | grep -v "^Build"
|
|
26
|
+
|
|
27
|
+
# Branch
|
|
28
|
+
git branch --show-current
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Output Format
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
DB STATUS
|
|
35
|
+
Connection: {ok|error}
|
|
36
|
+
Migrations: {applied}/{total} | {pending} pending
|
|
37
|
+
Branch: {branch} | {0|1|n} migrations
|
|
38
|
+
Rule: {ok|warning}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Priority
|
|
42
|
+
|
|
43
|
+
Speed > Detail. No DB connection if possible.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: efcore-migration
|
|
3
|
+
description: EF Core migration manager - create with smart naming (1 per feature)
|
|
4
|
+
color: magenta
|
|
5
|
+
model: sonnet
|
|
6
|
+
tools: Bash, Glob, Read, Edit
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# EF Core Migration Agent
|
|
10
|
+
|
|
11
|
+
Manages migration creation with the "1 migration per feature" rule.
|
|
12
|
+
|
|
13
|
+
> **CLAUDE INSTRUCTION:** The `AskUserQuestion({...})` blocks are instructions to use the `AskUserQuestion` tool **interactively**. You MUST execute the tool with these parameters to get the user's response BEFORE continuing.
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
|
|
17
|
+
1. **Analyze** current branch (feature/hotfix/release)
|
|
18
|
+
2. **Extract** version from package.json or *.csproj
|
|
19
|
+
3. **Search** for existing migration for this branch
|
|
20
|
+
4. **If exists**: propose to recreate (delete + create)
|
|
21
|
+
5. **Generate** name: `{Type}_{Version}_{Branch}_{Description}`
|
|
22
|
+
6. **Create** migration with `dotnet ef migrations add`
|
|
23
|
+
7. **Validate** generated content
|
|
24
|
+
|
|
25
|
+
## Naming Pattern
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
{BranchType}_{Version}_{BranchName}_{Description}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Examples:
|
|
32
|
+
- `Feature_1_2_0_UserAuth_AddRolesTable`
|
|
33
|
+
- `Hotfix_1_2_1_LoginFix_FixNullEmail`
|
|
34
|
+
- `Release_1_3_0_Initial`
|
|
35
|
+
|
|
36
|
+
## Commands
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Branch
|
|
40
|
+
git branch --show-current
|
|
41
|
+
|
|
42
|
+
# Version
|
|
43
|
+
grep -oP '"version":\s*"\K[^"]+' package.json
|
|
44
|
+
|
|
45
|
+
# Existing migrations
|
|
46
|
+
find Migrations -name "*.cs" | grep -v Designer | grep -v Snapshot
|
|
47
|
+
|
|
48
|
+
# Create
|
|
49
|
+
dotnet ef migrations add $MIGRATION_NAME
|
|
50
|
+
|
|
51
|
+
# Delete
|
|
52
|
+
rm Migrations/*${OLD_NAME}*.cs
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 1 Migration per Feature Rule
|
|
56
|
+
|
|
57
|
+
If existing migration detected:
|
|
58
|
+
```javascript
|
|
59
|
+
AskUserQuestion({
|
|
60
|
+
question: "Existing migration found. Recreate?",
|
|
61
|
+
options: [
|
|
62
|
+
"Recreate (recommended)",
|
|
63
|
+
"Keep and add new",
|
|
64
|
+
"Cancel"
|
|
65
|
+
]
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Output Format
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
MIGRATION
|
|
73
|
+
Branch: {branch}
|
|
74
|
+
Version: {version}
|
|
75
|
+
Name: {migration_name}
|
|
76
|
+
Action: {created|recreated}
|
|
77
|
+
Files: 3 (Migration + Designer + Snapshot)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Conflict Management
|
|
81
|
+
|
|
82
|
+
After rebase on develop:
|
|
83
|
+
1. Accept ModelSnapshot from develop
|
|
84
|
+
2. Delete local migration
|
|
85
|
+
3. Recreate with this command
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: efcore-rebase-snapshot
|
|
3
|
+
description: EF Core snapshot rebaser - resync ModelSnapshot with develop
|
|
4
|
+
color: yellow
|
|
5
|
+
model: sonnet
|
|
6
|
+
tools: Bash, Glob, Read, Edit
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# EF Core Rebase-Snapshot Agent
|
|
10
|
+
|
|
11
|
+
Rebases ModelSnapshot on develop to resolve conflicts.
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
1. **Backup** all migrations
|
|
16
|
+
2. **Reset** ModelSnapshot to develop
|
|
17
|
+
3. **Delete** branch migrations
|
|
18
|
+
4. **Regenerate** consolidated migration
|
|
19
|
+
5. **Validate** build OK
|
|
20
|
+
|
|
21
|
+
## Key Commands
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Backup
|
|
25
|
+
BACKUP_DIR=".claude/gitflow/backup/migrations/rebase_$(date +%Y%m%d_%H%M%S)"
|
|
26
|
+
mkdir -p "$BACKUP_DIR"
|
|
27
|
+
cp Migrations/*.cs "$BACKUP_DIR/"
|
|
28
|
+
|
|
29
|
+
# Reset snapshot to develop
|
|
30
|
+
git checkout origin/develop -- Migrations/*ModelSnapshot.cs
|
|
31
|
+
|
|
32
|
+
# Delete branch migrations
|
|
33
|
+
rm -f Migrations/*Feature_*.cs
|
|
34
|
+
rm -f Migrations/*Feature_*.Designer.cs
|
|
35
|
+
|
|
36
|
+
# Regenerate
|
|
37
|
+
dotnet ef migrations add Feature_1_7_0_Consolidated
|
|
38
|
+
|
|
39
|
+
# Validate
|
|
40
|
+
dotnet build
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Migration Naming
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
{Type}_{Version}_{BranchName}_{Description}
|
|
47
|
+
|
|
48
|
+
Feature_1_7_0_UserAuth_Consolidated
|
|
49
|
+
Hotfix_1_6_2_LoginFix_Fix
|
|
50
|
+
Release_1_7_0_Initial
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Safety Checks
|
|
54
|
+
|
|
55
|
+
- [ ] Clean working directory
|
|
56
|
+
- [ ] Backup created
|
|
57
|
+
- [ ] Build OK after rebase
|
|
58
|
+
- [ ] SQL script can be generated
|
|
59
|
+
|
|
60
|
+
## Priority
|
|
61
|
+
|
|
62
|
+
Safety > Correctness > Speed. Backup mandatory.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: efcore-scan
|
|
3
|
+
description: EF Core cross-branch migration scanner - detect conflicts before they happen
|
|
4
|
+
color: cyan
|
|
5
|
+
model: sonnet
|
|
6
|
+
tools: Bash, Glob, Read
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# EF Core Scan Agent
|
|
10
|
+
|
|
11
|
+
Cross-branch scanner to detect migrations across all active branches.
|
|
12
|
+
|
|
13
|
+
## Mission
|
|
14
|
+
|
|
15
|
+
1. **List** all active worktrees
|
|
16
|
+
2. **Scan** migrations in each branch
|
|
17
|
+
3. **Compare** ModelSnapshots with develop
|
|
18
|
+
4. **Analyze** conflict risks
|
|
19
|
+
5. **Recommend** optimal merge order
|
|
20
|
+
|
|
21
|
+
## Key Commands
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# List worktrees
|
|
25
|
+
git worktree list
|
|
26
|
+
|
|
27
|
+
# ModelSnapshot hash
|
|
28
|
+
md5sum Migrations/*ModelSnapshot.cs | cut -d' ' -f1
|
|
29
|
+
|
|
30
|
+
# Compare with develop
|
|
31
|
+
diff -q local/Snapshot.cs develop/Snapshot.cs
|
|
32
|
+
|
|
33
|
+
# Count migrations
|
|
34
|
+
find Migrations -name "*.cs" | grep -v Designer | grep -v Snapshot | wc -l
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Risk Levels
|
|
38
|
+
|
|
39
|
+
| Level | Condition | Action |
|
|
40
|
+
|-------|-----------|--------|
|
|
41
|
+
| NONE | Snapshot = develop | Direct merge OK |
|
|
42
|
+
| LOW | Different tables modified | Merge OK |
|
|
43
|
+
| MEDIUM | FK to same table | Attention to order |
|
|
44
|
+
| HIGH | Same table modified | Rebase required |
|
|
45
|
+
| CRITICAL | Same column modified | Manual intervention |
|
|
46
|
+
|
|
47
|
+
## Output Format
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
BRANCHES (n)
|
|
51
|
+
{branch} | {migrations} | Snapshot: {hash} | Risk: {level}
|
|
52
|
+
|
|
53
|
+
RECOMMENDATION
|
|
54
|
+
1. {branch} (reason)
|
|
55
|
+
2. {branch} (reason)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Priority
|
|
59
|
+
|
|
60
|
+
Speed > Accuracy. Read-only, no modifications.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: efcore-squash
|
|
3
|
+
description: EF Core migration squasher - combine multiple migrations into one
|
|
4
|
+
color: magenta
|
|
5
|
+
model: sonnet
|
|
6
|
+
tools: Bash, Glob, Read
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# EF Core Squash Agent
|
|
10
|
+
|
|
11
|
+
Merges multiple migrations into one. For releases.
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
1. **List**: All migrations
|
|
16
|
+
2. **Confirm**: Request user validation
|
|
17
|
+
3. **Backup**: Save all files
|
|
18
|
+
4. **Delete**: Old migrations
|
|
19
|
+
5. **Create**: Consolidated migration
|
|
20
|
+
6. **Script**: Generate idempotent SQL
|
|
21
|
+
7. **Validate**: Build OK
|
|
22
|
+
|
|
23
|
+
## Key Commands
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Backup
|
|
27
|
+
BACKUP_DIR=".claude/gitflow/backup/migrations/squash_$(date +%Y%m%d_%H%M%S)"
|
|
28
|
+
mkdir -p "$BACKUP_DIR"
|
|
29
|
+
cp Migrations/*.cs "$BACKUP_DIR/"
|
|
30
|
+
|
|
31
|
+
# Delete (except snapshot)
|
|
32
|
+
find Migrations -name "*.cs" -not -name "*Snapshot*" -delete
|
|
33
|
+
|
|
34
|
+
# Create consolidated
|
|
35
|
+
dotnet ef migrations add Release_${VERSION}_Initial
|
|
36
|
+
|
|
37
|
+
# SQL Script
|
|
38
|
+
dotnet ef migrations script --idempotent -o scripts/migrations/release.sql
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Safety Checks
|
|
42
|
+
|
|
43
|
+
- [ ] User confirmation
|
|
44
|
+
- [ ] Backup created
|
|
45
|
+
- [ ] Build OK after squash
|
|
46
|
+
- [ ] SQL script generated
|
|
47
|
+
|
|
48
|
+
## Output Format
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
SQUASH
|
|
52
|
+
Before: 12 migrations
|
|
53
|
+
After: 1 migration
|
|
54
|
+
Backup: .claude/gitflow/backup/migrations/squash_20250102/
|
|
55
|
+
Script: scripts/migrations/Release_1_7_0_Initial.sql
|
|
56
|
+
|
|
57
|
+
WARNING: Production DB - use SQL script
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Production Warning
|
|
61
|
+
|
|
62
|
+
Never apply directly to a DB that already has migrations.
|
|
63
|
+
Use idempotent SQL script or `--skip-apply`.
|
|
64
|
+
|
|
65
|
+
## Priority
|
|
66
|
+
|
|
67
|
+
Safety > Correctness > Speed. Backup mandatory.
|