@atlashub/smartstack-cli 1.14.2 → 1.16.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/dist/index.js +183 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/agents/efcore/migration.md +37 -25
- package/templates/agents/mcp-healthcheck.md +161 -0
- package/templates/hooks/mcp-check.md +64 -0
- package/templates/skills/application/SKILL.md +50 -4
- package/templates/skills/application/steps/step-00-init.md +153 -0
- package/templates/skills/application/steps/step-01-navigation.md +144 -0
- package/templates/skills/application/steps/step-02-permissions.md +159 -0
- package/templates/skills/application/steps/step-03-roles.md +158 -0
- package/templates/skills/application/steps/step-04-backend.md +202 -0
- package/templates/skills/application/steps/step-05-frontend.md +218 -0
- package/templates/skills/application/steps/step-06-migration.md +190 -0
- package/templates/skills/mcp/SKILL.md +246 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: efcore-migration
|
|
3
|
-
description: EF Core migration manager -
|
|
3
|
+
description: EF Core migration manager - orchestrates MCP for naming (1 per feature)
|
|
4
4
|
color: magenta
|
|
5
5
|
model: sonnet
|
|
6
6
|
tools: Bash, Glob, Read, Edit
|
|
@@ -8,10 +8,24 @@ tools: Bash, Glob, Read, Edit
|
|
|
8
8
|
|
|
9
9
|
# EF Core Migration Agent
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Orchestrates migration creation with the "1 migration per feature" rule.
|
|
12
|
+
|
|
13
|
+
> **IMPORTANT:** Cet agent **ORCHESTRE** uniquement. Le nommage est **DÉLÉGUÉ AU MCP**.
|
|
12
14
|
|
|
13
15
|
> **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
16
|
|
|
17
|
+
## Principe : Délégation au MCP
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
21
|
+
│ Agent (CLI) │─────▶│ MCP │─────▶│ dotnet ef │
|
|
22
|
+
│ Orchestre │ │ Génère le nom │ │ Crée migration │
|
|
23
|
+
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**INTERDIT :** Calculer le nom de migration dans cet agent.
|
|
27
|
+
**OBLIGATOIRE :** Appeler `mcp__smartstack__suggest_migration` pour obtenir le nom.
|
|
28
|
+
|
|
15
29
|
## Dual DbContext Architecture
|
|
16
30
|
|
|
17
31
|
SmartStack uses two separate DbContexts with separate migration histories:
|
|
@@ -29,53 +43,51 @@ SmartStack uses two separate DbContexts with separate migration histories:
|
|
|
29
43
|
## Workflow
|
|
30
44
|
|
|
31
45
|
1. **Detect** DbContext type (Core vs Extensions)
|
|
32
|
-
2. **
|
|
33
|
-
3. **
|
|
46
|
+
2. **Ask** user for migration description
|
|
47
|
+
3. **Call MCP** `mcp__smartstack__suggest_migration` with description and context
|
|
34
48
|
4. **Search** for existing migration for this branch
|
|
35
49
|
5. **If exists**: propose to recreate (delete + create)
|
|
36
|
-
6. **
|
|
37
|
-
7. **
|
|
38
|
-
|
|
50
|
+
6. **Create** migration with `dotnet ef migrations add <MCP_NAME> --context {DbContext}`
|
|
51
|
+
7. **Validate** generated content
|
|
52
|
+
|
|
53
|
+
## Naming : Délégation MCP
|
|
39
54
|
|
|
40
|
-
|
|
55
|
+
**TOUJOURS appeler le MCP pour le nommage :**
|
|
41
56
|
|
|
42
57
|
```
|
|
43
|
-
{
|
|
58
|
+
mcp__smartstack__suggest_migration({
|
|
59
|
+
description: "<user_description>",
|
|
60
|
+
context: "core" | "extensions"
|
|
61
|
+
})
|
|
44
62
|
```
|
|
45
63
|
|
|
46
|
-
|
|
47
|
-
- `core_v1.8.0_001_CreateAuthUsers`
|
|
48
|
-
- `core_v1.8.0_002_AddEntraSync`
|
|
64
|
+
Le MCP retourne le nom complet conforme : `{context}_v{version}_{sequence}_{Description}`
|
|
49
65
|
|
|
50
|
-
**
|
|
66
|
+
**Exemples de noms générés par le MCP :**
|
|
67
|
+
- `core_v1.8.0_001_CreateAuthUsers`
|
|
51
68
|
- `ext_v1.0.0_001_CreateOrders`
|
|
52
|
-
- `ext_v1.0.0_002_AddOrderItems`
|
|
53
69
|
|
|
54
70
|
## Commands
|
|
55
71
|
|
|
56
72
|
```bash
|
|
57
|
-
# Branch
|
|
58
|
-
git branch --show-current
|
|
59
|
-
|
|
60
|
-
# Version
|
|
61
|
-
grep -oP '"version":\s*"\K[^"]+' package.json
|
|
62
|
-
|
|
63
73
|
# Existing migrations for Core
|
|
64
74
|
find Migrations -name "core_*.cs" | grep -v Designer | grep -v Snapshot
|
|
65
75
|
|
|
66
76
|
# Existing migrations for Extensions
|
|
67
77
|
find Persistence/Migrations -name "ext_*.cs" | grep -v Designer | grep -v Snapshot
|
|
68
78
|
|
|
69
|
-
# Create Core migration
|
|
70
|
-
dotnet ef migrations add $
|
|
79
|
+
# Create Core migration (use MCP_NAME from suggest_migration)
|
|
80
|
+
dotnet ef migrations add $MCP_NAME --context CoreDbContext -o Persistence/Migrations
|
|
71
81
|
|
|
72
|
-
# Create Extensions migration
|
|
73
|
-
dotnet ef migrations add $
|
|
82
|
+
# Create Extensions migration (use MCP_NAME from suggest_migration)
|
|
83
|
+
dotnet ef migrations add $MCP_NAME --context ExtensionsDbContext -o Persistence/Migrations
|
|
74
84
|
|
|
75
|
-
# Delete
|
|
85
|
+
# Delete existing migration
|
|
76
86
|
rm Persistence/Migrations/*${OLD_NAME}*.cs
|
|
77
87
|
```
|
|
78
88
|
|
|
89
|
+
> **Note:** `$MCP_NAME` est obtenu via l'appel MCP, jamais calculé localement.
|
|
90
|
+
|
|
79
91
|
## Context Detection
|
|
80
92
|
|
|
81
93
|
If unable to auto-detect:
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcp-healthcheck
|
|
3
|
+
description: Verifies MCP server availability, version and configuration before operations
|
|
4
|
+
color: cyan
|
|
5
|
+
model: haiku
|
|
6
|
+
tools: Bash, Read, Write, Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# MCP Health Check Agent
|
|
10
|
+
|
|
11
|
+
Validates that SmartStack MCP is properly configured and up-to-date before any operation.
|
|
12
|
+
|
|
13
|
+
## Status File
|
|
14
|
+
|
|
15
|
+
Location: `.claude/mcp-status.json`
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"lastCheck": "2024-01-15T10:30:00Z",
|
|
20
|
+
"mcpVersion": "1.5.0",
|
|
21
|
+
"mcpPath": "D:\\01 - projets\\SmartStack.mcp",
|
|
22
|
+
"status": "ok",
|
|
23
|
+
"tools": ["validate_conventions", "scaffold_extension", "check_migrations", "..."]
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Workflow
|
|
28
|
+
|
|
29
|
+
### 1. Check Status File Age
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Read last check timestamp
|
|
33
|
+
cat .claude/mcp-status.json 2>/dev/null | grep lastCheck
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Decision:**
|
|
37
|
+
- File missing → Full check required
|
|
38
|
+
- Last check > 7 days → Full check required
|
|
39
|
+
- Last check ≤ 7 days → Quick validation only
|
|
40
|
+
|
|
41
|
+
### 2. Quick Validation (≤ 7 days)
|
|
42
|
+
|
|
43
|
+
Test MCP connectivity with a lightweight call:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Call: mcp__smartstack__validate_conventions with checks=["tables"]
|
|
47
|
+
Expected: Response without connection error
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If fails → Run full check
|
|
51
|
+
|
|
52
|
+
### 3. Full Check (> 7 days or missing)
|
|
53
|
+
|
|
54
|
+
#### 3.1 Verify MCP Server Configuration
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Check Claude Code MCP config
|
|
58
|
+
cat ~/.claude/settings.json | grep -A 20 "smartstack"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### 3.2 Test MCP Tools Availability
|
|
62
|
+
|
|
63
|
+
Call each critical tool to verify availability:
|
|
64
|
+
|
|
65
|
+
| Tool | Test Call |
|
|
66
|
+
|------|-----------|
|
|
67
|
+
| `validate_conventions` | `checks=["tables"]` |
|
|
68
|
+
| `suggest_migration` | `description="test"` |
|
|
69
|
+
| `check_migrations` | (no params) |
|
|
70
|
+
|
|
71
|
+
#### 3.3 Check MCP Version
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Read MCP package.json
|
|
75
|
+
cat "D:\\01 - projets\\SmartStack.mcp\\package.json" | grep version
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### 3.4 Compare with Latest Release
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Check npm registry for latest version
|
|
82
|
+
npm view @anthropic/smartstack-mcp version 2>/dev/null || echo "Not published"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 4. Update Status File
|
|
86
|
+
|
|
87
|
+
```javascript
|
|
88
|
+
Write(".claude/mcp-status.json", {
|
|
89
|
+
lastCheck: new Date().toISOString(),
|
|
90
|
+
mcpVersion: "<detected_version>",
|
|
91
|
+
mcpPath: "<configured_path>",
|
|
92
|
+
status: "ok" | "error",
|
|
93
|
+
tools: ["<available_tools>"],
|
|
94
|
+
errors: ["<any_errors>"] // if status = error
|
|
95
|
+
})
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Output Format
|
|
99
|
+
|
|
100
|
+
### Success
|
|
101
|
+
```
|
|
102
|
+
MCP HEALTH CHECK
|
|
103
|
+
Status: ✓ OK
|
|
104
|
+
Version: 1.5.0 (latest)
|
|
105
|
+
Last check: 2024-01-15
|
|
106
|
+
Tools available: 12/12
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Warning (outdated)
|
|
110
|
+
```
|
|
111
|
+
MCP HEALTH CHECK
|
|
112
|
+
Status: ⚠️ UPDATE AVAILABLE
|
|
113
|
+
Current: 1.4.0
|
|
114
|
+
Latest: 1.5.0
|
|
115
|
+
Action: Run `cd SmartStack.mcp && git pull`
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Error
|
|
119
|
+
```
|
|
120
|
+
MCP HEALTH CHECK
|
|
121
|
+
Status: ❌ ERROR
|
|
122
|
+
Issue: MCP server not responding
|
|
123
|
+
Action: Verify MCP configuration in Claude Code settings
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Integration
|
|
127
|
+
|
|
128
|
+
This agent should be called:
|
|
129
|
+
1. **Before any MCP-dependent operation** (scaffold, validate, migrate)
|
|
130
|
+
2. **On CLI installation/update**
|
|
131
|
+
3. **Manually via `/mcp:healthcheck`**
|
|
132
|
+
|
|
133
|
+
## Caching Logic
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
┌─────────────────────┐
|
|
137
|
+
│ Operation Start │
|
|
138
|
+
└──────────┬──────────┘
|
|
139
|
+
▼
|
|
140
|
+
┌─────────────────────┐
|
|
141
|
+
│ Read mcp-status.json│
|
|
142
|
+
└──────────┬──────────┘
|
|
143
|
+
▼
|
|
144
|
+
┌──────────────┐
|
|
145
|
+
│ File exists? │
|
|
146
|
+
└──────┬───────┘
|
|
147
|
+
│
|
|
148
|
+
No ───┼─── Yes
|
|
149
|
+
│ │
|
|
150
|
+
▼ ▼
|
|
151
|
+
┌──────────────────┐
|
|
152
|
+
│ > 7 days old? │
|
|
153
|
+
└──────┬───────────┘
|
|
154
|
+
│
|
|
155
|
+
Yes ──┼─── No
|
|
156
|
+
│ │
|
|
157
|
+
▼ ▼
|
|
158
|
+
┌──────────────┐ ┌──────────────┐
|
|
159
|
+
│ Full Check │ │ Quick Check │
|
|
160
|
+
└──────────────┘ └──────────────┘
|
|
161
|
+
```
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Quick MCP availability check before MCP tool calls
|
|
3
|
+
trigger: tool-use
|
|
4
|
+
match: mcp__smartstack__*
|
|
5
|
+
blocking: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MCP Quick Check (Low Token)
|
|
9
|
+
|
|
10
|
+
Lightweight pre-check before MCP calls. Reads cache only, no LLM processing.
|
|
11
|
+
|
|
12
|
+
## Script
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
#!/bin/bash
|
|
16
|
+
STATUS_FILE=".claude/mcp-status.json"
|
|
17
|
+
MAX_AGE_DAYS=7
|
|
18
|
+
|
|
19
|
+
# Create .claude if missing
|
|
20
|
+
mkdir -p .claude
|
|
21
|
+
|
|
22
|
+
# Check if status file exists
|
|
23
|
+
if [ ! -f "$STATUS_FILE" ]; then
|
|
24
|
+
echo "⚠️ MCP: First use - run /mcp:healthcheck"
|
|
25
|
+
exit 0
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# Check file age (cross-platform)
|
|
29
|
+
if command -v stat &> /dev/null; then
|
|
30
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
31
|
+
FILE_AGE=$(( ($(date +%s) - $(stat -f %m "$STATUS_FILE")) / 86400 ))
|
|
32
|
+
else
|
|
33
|
+
FILE_AGE=$(( ($(date +%s) - $(stat -c %Y "$STATUS_FILE")) / 86400 ))
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
if [ "$FILE_AGE" -gt "$MAX_AGE_DAYS" ]; then
|
|
37
|
+
echo "⚠️ MCP: Cache expired ($FILE_AGE days) - run /mcp:healthcheck"
|
|
38
|
+
fi
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# Check last status
|
|
42
|
+
STATUS=$(grep -o '"status":\s*"[^"]*"' "$STATUS_FILE" 2>/dev/null | cut -d'"' -f4)
|
|
43
|
+
if [ "$STATUS" = "error" ]; then
|
|
44
|
+
echo "❌ MCP: Last check failed - run /mcp:healthcheck"
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
exit 0
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Behavior
|
|
52
|
+
|
|
53
|
+
| Condition | Output | Blocks? |
|
|
54
|
+
|-----------|--------|---------|
|
|
55
|
+
| No cache file | Warning message | No |
|
|
56
|
+
| Cache > 7 days | Warning message | No |
|
|
57
|
+
| Last status = error | Error message | Yes |
|
|
58
|
+
| All OK | Silent (no output) | No |
|
|
59
|
+
|
|
60
|
+
## Token Cost
|
|
61
|
+
|
|
62
|
+
- **Normal case (cache valid):** 0 tokens (pure bash, no LLM)
|
|
63
|
+
- **Warning case:** ~10 tokens (displays message)
|
|
64
|
+
- **Full healthcheck:** ~100-200 tokens (only when explicitly called)
|
|
@@ -13,6 +13,39 @@ description: |
|
|
|
13
13
|
|
|
14
14
|
**Reference:** [_shared.md](../_shared.md) for architecture, permissions, i18n
|
|
15
15
|
|
|
16
|
+
## ENTRY POINT
|
|
17
|
+
|
|
18
|
+
> **FIRST ACTION:** Load `steps/step-00-init.md`
|
|
19
|
+
|
|
20
|
+
This skill uses progressive step loading. Each step calls MCP tools for generation.
|
|
21
|
+
|
|
22
|
+
## STEP FILES
|
|
23
|
+
|
|
24
|
+
| Step | File | MCP Tool Called |
|
|
25
|
+
|------|------|-----------------|
|
|
26
|
+
| 00 | `steps/step-00-init.md` | `validate_conventions` (MCP check) |
|
|
27
|
+
| 01 | `steps/step-01-navigation.md` | `scaffold_navigation` |
|
|
28
|
+
| 02 | `steps/step-02-permissions.md` | `generate_permissions` |
|
|
29
|
+
| 03 | `steps/step-03-roles.md` | `scaffold_role_permissions` |
|
|
30
|
+
| 04 | `steps/step-04-backend.md` | `scaffold_extension` |
|
|
31
|
+
| 05 | `steps/step-05-frontend.md` | `scaffold_api_client`, `scaffold_routes` |
|
|
32
|
+
| 06 | `steps/step-06-migration.md` | `suggest_migration` |
|
|
33
|
+
|
|
34
|
+
## MCP INTEGRATION
|
|
35
|
+
|
|
36
|
+
> **CRITICAL:** This skill MUST use MCP tools for all generation.
|
|
37
|
+
> Templates in this folder are for REFERENCE ONLY - never use them directly.
|
|
38
|
+
|
|
39
|
+
| MCP Tool | Purpose |
|
|
40
|
+
|----------|---------|
|
|
41
|
+
| `mcp__smartstack__scaffold_navigation` | Navigation entity + translations |
|
|
42
|
+
| `mcp__smartstack__generate_permissions` | Permissions.cs + HasData |
|
|
43
|
+
| `mcp__smartstack__scaffold_role_permissions` | Role-permission mappings |
|
|
44
|
+
| `mcp__smartstack__scaffold_extension` | Entity, Service, Controller, DTOs |
|
|
45
|
+
| `mcp__smartstack__scaffold_api_client` | TypeScript API client |
|
|
46
|
+
| `mcp__smartstack__scaffold_routes` | React Router configuration |
|
|
47
|
+
| `mcp__smartstack__suggest_migration` | Migration name suggestion |
|
|
48
|
+
|
|
16
49
|
## WHEN THIS SKILL ACTIVATES
|
|
17
50
|
|
|
18
51
|
| Trigger | Example |
|
|
@@ -134,7 +167,20 @@ await _workflowService.TriggerAsync("{entity}.created", new Dictionary<string, o
|
|
|
134
167
|
|
|
135
168
|
## ASSOCIATED FILES
|
|
136
169
|
|
|
137
|
-
|
|
138
|
-
- [
|
|
139
|
-
- [
|
|
140
|
-
- [
|
|
170
|
+
### Step Files (ACTIVE - Use These)
|
|
171
|
+
- [steps/step-00-init.md](steps/step-00-init.md) - Initialize parameters
|
|
172
|
+
- [steps/step-01-navigation.md](steps/step-01-navigation.md) - Generate navigation
|
|
173
|
+
- [steps/step-02-permissions.md](steps/step-02-permissions.md) - Generate permissions
|
|
174
|
+
- [steps/step-03-roles.md](steps/step-03-roles.md) - Assign roles
|
|
175
|
+
- [steps/step-04-backend.md](steps/step-04-backend.md) - Generate backend
|
|
176
|
+
- [steps/step-05-frontend.md](steps/step-05-frontend.md) - Generate frontend
|
|
177
|
+
- [steps/step-06-migration.md](steps/step-06-migration.md) - Create migration
|
|
178
|
+
|
|
179
|
+
### Templates (REFERENCE ONLY - Do Not Use Directly)
|
|
180
|
+
> These templates are kept for documentation purposes.
|
|
181
|
+
> All generation is done via MCP tools in step files.
|
|
182
|
+
|
|
183
|
+
- [templates-backend.md](templates-backend.md) - Backend patterns reference
|
|
184
|
+
- [templates-frontend.md](templates-frontend.md) - Frontend patterns reference
|
|
185
|
+
- [templates-i18n.md](templates-i18n.md) - i18n structure reference
|
|
186
|
+
- [templates-seed.md](templates-seed.md) - Seed data patterns reference
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-00-init
|
|
3
|
+
description: Initialize application/module creation - parse parameters and validate context
|
|
4
|
+
next_step: steps/step-01-navigation.md
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Step 0: Initialization
|
|
8
|
+
|
|
9
|
+
## MANDATORY EXECUTION RULES
|
|
10
|
+
|
|
11
|
+
- NEVER skip parameter validation
|
|
12
|
+
- ALWAYS detect the navigation level from user request
|
|
13
|
+
- ALWAYS validate MCP availability before proceeding
|
|
14
|
+
- YOU ARE AN INITIALIZER, not an executor
|
|
15
|
+
- FORBIDDEN to call MCP tools until init is complete
|
|
16
|
+
|
|
17
|
+
## YOUR TASK
|
|
18
|
+
|
|
19
|
+
Initialize the application/module creation by parsing parameters, detecting level, and validating the SmartStack context.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## EXECUTION SEQUENCE
|
|
24
|
+
|
|
25
|
+
### 1. Detect Navigation Level
|
|
26
|
+
|
|
27
|
+
From user request, identify the level:
|
|
28
|
+
|
|
29
|
+
| Hint in Request | → Level | Parent Required |
|
|
30
|
+
|-----------------|---------|-----------------|
|
|
31
|
+
| "context", "workspace", "nouveau contexte" | context | No |
|
|
32
|
+
| "application", "app", "nouvelle application" | application | Yes (context) |
|
|
33
|
+
| "module", "feature", "nouveau module" | module | Yes (context.application) |
|
|
34
|
+
| "section", "tab", "nouvelle section" | section | Yes (context.app.module) |
|
|
35
|
+
|
|
36
|
+
### 2. Extract Parameters
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
# Required
|
|
40
|
+
level: context | application | module | section
|
|
41
|
+
code: kebab-case (e.g., "products", "order-management")
|
|
42
|
+
labels:
|
|
43
|
+
fr: "Label français"
|
|
44
|
+
en: "English label"
|
|
45
|
+
it: "Etichetta italiana"
|
|
46
|
+
de: "Deutsche Bezeichnung"
|
|
47
|
+
icon: Lucide icon name (e.g., "Package", "ShoppingCart")
|
|
48
|
+
displayOrder: number
|
|
49
|
+
|
|
50
|
+
# Conditional (required for non-context levels)
|
|
51
|
+
parentPath: "context.application.module" (dot-separated)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 3. Validate MCP Availability
|
|
55
|
+
|
|
56
|
+
**CRITICAL:** Before proceeding, verify SmartStack MCP is available:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
Call: mcp__smartstack__validate_conventions
|
|
60
|
+
Args: { checks: ["all"] }
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If MCP call fails:
|
|
64
|
+
- Display warning: "SmartStack MCP not available"
|
|
65
|
+
- Provide manual instructions instead of automated generation
|
|
66
|
+
- Do NOT proceed with step files
|
|
67
|
+
|
|
68
|
+
### 4. Build Full Path
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
{full_path} = {parentPath}.{code} (if parentPath exists)
|
|
72
|
+
{full_path} = {code} (if context level)
|
|
73
|
+
|
|
74
|
+
Example:
|
|
75
|
+
level: module
|
|
76
|
+
parentPath: erp.sales
|
|
77
|
+
code: products
|
|
78
|
+
→ full_path: erp.sales.products
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 5. Infer Descriptions (if not provided)
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
descriptions:
|
|
85
|
+
fr: "Gestion de {labels.fr}"
|
|
86
|
+
en: "{labels.en} management"
|
|
87
|
+
it: "Gestione di {labels.it}"
|
|
88
|
+
de: "Verwaltung von {labels.de}"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 6. Show Summary
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
## Application Skill: {level} - {code}
|
|
95
|
+
|
|
96
|
+
| Parameter | Value |
|
|
97
|
+
|-----------|-------|
|
|
98
|
+
| Level | {level} |
|
|
99
|
+
| Code | {code} |
|
|
100
|
+
| Full Path | {full_path} |
|
|
101
|
+
| Parent | {parentPath} |
|
|
102
|
+
| Icon | {icon} |
|
|
103
|
+
| Display Order | {displayOrder} |
|
|
104
|
+
|
|
105
|
+
### Labels
|
|
106
|
+
| Language | Label |
|
|
107
|
+
|----------|-------|
|
|
108
|
+
| FR | {labels.fr} |
|
|
109
|
+
| EN | {labels.en} |
|
|
110
|
+
| IT | {labels.it} |
|
|
111
|
+
| DE | {labels.de} |
|
|
112
|
+
|
|
113
|
+
→ Proceeding to navigation generation...
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## STATE VARIABLES TO PERSIST
|
|
119
|
+
|
|
120
|
+
| Variable | Description |
|
|
121
|
+
|----------|-------------|
|
|
122
|
+
| `{level}` | context, application, module, or section |
|
|
123
|
+
| `{code}` | kebab-case identifier |
|
|
124
|
+
| `{full_path}` | Complete navigation path |
|
|
125
|
+
| `{parent_path}` | Parent path (null for context) |
|
|
126
|
+
| `{labels}` | Object with fr, en, it, de |
|
|
127
|
+
| `{descriptions}` | Object with fr, en, it, de |
|
|
128
|
+
| `{icon}` | Lucide icon name |
|
|
129
|
+
| `{display_order}` | Numeric display order |
|
|
130
|
+
| `{mcp_available}` | Boolean - MCP connectivity status |
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## SUCCESS METRICS
|
|
135
|
+
|
|
136
|
+
- Level correctly detected
|
|
137
|
+
- All required parameters extracted
|
|
138
|
+
- MCP availability verified
|
|
139
|
+
- Full path computed correctly
|
|
140
|
+
- Summary displayed
|
|
141
|
+
- Proceeded to step-01-navigation.md
|
|
142
|
+
|
|
143
|
+
## FAILURE MODES
|
|
144
|
+
|
|
145
|
+
- Missing required parameters (ask user)
|
|
146
|
+
- Invalid level detection (clarify with user)
|
|
147
|
+
- MCP not available (provide manual instructions)
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## NEXT STEP
|
|
152
|
+
|
|
153
|
+
After showing initialization summary, proceed to `./step-01-navigation.md`
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-01-navigation
|
|
3
|
+
description: Generate navigation entity seeds using MCP scaffold_navigation
|
|
4
|
+
prev_step: steps/step-00-init.md
|
|
5
|
+
next_step: steps/step-02-permissions.md
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 1: Navigation Generation
|
|
9
|
+
|
|
10
|
+
## MANDATORY EXECUTION RULES
|
|
11
|
+
|
|
12
|
+
- ALWAYS use MCP `scaffold_navigation` tool - NEVER use templates
|
|
13
|
+
- NEVER generate code manually - let MCP handle it
|
|
14
|
+
- ALWAYS verify the output includes translations for 4 languages
|
|
15
|
+
- YOU ARE AN ORCHESTRATOR calling MCP, not a generator
|
|
16
|
+
|
|
17
|
+
## YOUR TASK
|
|
18
|
+
|
|
19
|
+
Call the SmartStack MCP `scaffold_navigation` tool to generate:
|
|
20
|
+
1. Navigation entity HasData() code
|
|
21
|
+
2. NavigationTranslation entries (4 languages)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## AVAILABLE STATE
|
|
26
|
+
|
|
27
|
+
From step-00-init:
|
|
28
|
+
|
|
29
|
+
| Variable | Description |
|
|
30
|
+
|----------|-------------|
|
|
31
|
+
| `{level}` | context, application, module, or section |
|
|
32
|
+
| `{code}` | kebab-case identifier |
|
|
33
|
+
| `{full_path}` | Complete navigation path |
|
|
34
|
+
| `{parent_path}` | Parent path (null for context) |
|
|
35
|
+
| `{labels}` | Object with fr, en, it, de |
|
|
36
|
+
| `{descriptions}` | Object with fr, en, it, de |
|
|
37
|
+
| `{icon}` | Lucide icon name |
|
|
38
|
+
| `{display_order}` | Numeric display order |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## EXECUTION SEQUENCE
|
|
43
|
+
|
|
44
|
+
### 1. Call MCP scaffold_navigation
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
Tool: mcp__smartstack__scaffold_navigation
|
|
48
|
+
Args:
|
|
49
|
+
level: "{level}"
|
|
50
|
+
code: "{code}"
|
|
51
|
+
parentPath: "{parent_path}" # Omit if level is "context"
|
|
52
|
+
labels:
|
|
53
|
+
fr: "{labels.fr}"
|
|
54
|
+
en: "{labels.en}"
|
|
55
|
+
it: "{labels.it}"
|
|
56
|
+
de: "{labels.de}"
|
|
57
|
+
descriptions:
|
|
58
|
+
fr: "{descriptions.fr}"
|
|
59
|
+
en: "{descriptions.en}"
|
|
60
|
+
it: "{descriptions.it}"
|
|
61
|
+
de: "{descriptions.de}"
|
|
62
|
+
icon: "{icon}"
|
|
63
|
+
displayOrder: {display_order}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 2. Parse MCP Response
|
|
67
|
+
|
|
68
|
+
The tool returns:
|
|
69
|
+
- Navigation entity GUID (deterministic)
|
|
70
|
+
- HasData() code for NavigationXxxConfiguration.cs
|
|
71
|
+
- HasData() code for NavigationTranslationConfiguration.cs
|
|
72
|
+
- SeedData class template (optional)
|
|
73
|
+
|
|
74
|
+
### 3. Present Output to User
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
## Navigation Seeds Generated
|
|
78
|
+
|
|
79
|
+
**Entity:** {level} - {code}
|
|
80
|
+
**GUID:** {generated_guid}
|
|
81
|
+
**Path:** {full_path}
|
|
82
|
+
|
|
83
|
+
### Files to Update
|
|
84
|
+
|
|
85
|
+
1. **{NavigationLevelConfiguration}.cs**
|
|
86
|
+
[Show HasData code from MCP response]
|
|
87
|
+
|
|
88
|
+
2. **NavigationTranslationConfiguration.cs**
|
|
89
|
+
[Show translation HasData code from MCP response]
|
|
90
|
+
|
|
91
|
+
### Recommended: Create SeedData Class
|
|
92
|
+
|
|
93
|
+
[Show SeedData class from MCP response]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 4. Store Generated GUID
|
|
97
|
+
|
|
98
|
+
**CRITICAL:** Store the navigation entity GUID for use in step-02-permissions:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
{navigation_guid} = [GUID from MCP response]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This GUID will be referenced when creating permissions.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## MCP RESPONSE HANDLING
|
|
109
|
+
|
|
110
|
+
### Success Case
|
|
111
|
+
|
|
112
|
+
If MCP returns successfully:
|
|
113
|
+
- Extract and display all HasData code
|
|
114
|
+
- Store `{navigation_guid}` for next step
|
|
115
|
+
- Proceed to step-02-permissions.md
|
|
116
|
+
|
|
117
|
+
### Error Case
|
|
118
|
+
|
|
119
|
+
If MCP call fails:
|
|
120
|
+
- Display error message
|
|
121
|
+
- Suggest manual alternatives
|
|
122
|
+
- Do NOT proceed automatically
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## SUCCESS METRICS
|
|
127
|
+
|
|
128
|
+
- MCP scaffold_navigation called successfully
|
|
129
|
+
- Navigation entity GUID obtained
|
|
130
|
+
- HasData code displayed to user
|
|
131
|
+
- Translation code displayed (4 languages)
|
|
132
|
+
- Proceeded to step-02-permissions.md
|
|
133
|
+
|
|
134
|
+
## FAILURE MODES
|
|
135
|
+
|
|
136
|
+
- MCP call failed (display error, stop)
|
|
137
|
+
- Missing parent path for non-context level (return to step-00)
|
|
138
|
+
- Invalid level (return to step-00)
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## NEXT STEP
|
|
143
|
+
|
|
144
|
+
After displaying navigation seeds, proceed to `./step-02-permissions.md`
|