with one click
ln-720-structure-migrator
// Scaffolds new or restructures existing projects to Clean Architecture. Use when setting up project structure.
// Scaffolds new or restructures existing projects to Clean Architecture. Use when setting up project structure.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | ln-720-structure-migrator |
| description | Scaffolds new or restructures existing projects to Clean Architecture. Use when setting up project structure. |
| license | MIT |
Paths: File paths (
references/,../ln-*) are relative to this skill directory.
Type: L2 Domain Coordinator Category: 7XX Project Bootstrap Parent: ln-700-project-bootstrap
Coordinates project restructuring to Clean Architecture. Mode-aware: delegates to workers with appropriate mode parameters based on CREATE/TRANSFORM pipeline.
| Aspect | Description |
|---|---|
| Input | Current project structure + mode (CREATE/TRANSFORM) from ln-700 |
| Output | Restructured project with Clean Architecture |
| Workers | See Workers table below |
| Worker | Role | CREATE mode | TRANSFORM mode |
|---|---|---|---|
| ln-721 | Frontend structure | SCAFFOLD (generate starter) | RESTRUCTURE (migrate monolith) |
| ln-722 | Backend generator | RUN (generate backend) | RUN (generate backend) |
| ln-723 | Seed data | GENERATE (from entities) | MIGRATE (from ORM schemas) |
| ln-724 | Artifact cleaner | SKIP (no artifacts) | CONDITIONAL (only if platform detected) |
Scope boundaries:
| Phase | Name | CREATE mode | TRANSFORM mode |
|---|---|---|---|
| 1 | Analyze | Receive target stack config | Scan structure, detect framework, map files |
| 2 | Plan | Calculate scaffold actions | Calculate moves, identify conflicts |
| 3 | Execute | Delegate: ln-721 SCAFFOLD ā ln-722 ā ln-723 GENERATE | Delegate: ln-724 (conditional) ā ln-721 RESTRUCTURE ā ln-722 ā ln-723 MIGRATE |
| 4 | Verify | Check file structure, validate configs | Run builds, check imports, validate structure |
src/frontend/
āāā public/
āāā src/
ā āāā components/
ā ā āāā layout/ # AppLayout, Header, Sidebar
ā ā āāā ui/ # Reusable UI components
ā āāā contexts/ # React contexts
ā āāā hooks/ # Custom hooks
ā āāā lib/ # Utilities, API clients
ā āāā pages/ # Page components
ā ā āāā {Feature}/ # Feature-specific files
ā āāā App.tsx
ā āāā main.tsx
ā āāā index.css
āāā package.json
āāā vite.config.ts
āāā tsconfig.json
src/
āāā {Project}.Api/
ā āāā Controllers/
ā āāā DTOs/
ā āāā Middleware/
ā āāā MockData/
ā āāā Extensions/
ā āāā Program.cs
ā āāā appsettings.json
āāā {Project}.Domain/
ā āāā Entities/
ā āāā Enums/
ā āāā Common/
āāā {Project}.Services/
ā āāā Interfaces/
āāā {Project}.Repositories/
ā āāā Interfaces/
āāā {Project}.Shared/
When to invoke: TRANSFORM mode AND platform artifacts detected (.replit, .stackblitzrc, sandbox.config.json, glitch.json).
Skip conditions: CREATE mode OR no platform config files found.
Context:
projectPath: /project
skipPreview: false
Options:
# ln-724 auto-detects platform, no need to specify
cleanConfigFiles: true
cleanDirectories: true
cleanPackages: true
cleanBuildConfig: true
cleanCodeComments: true
cleanGitignore: true
Context:
mode: SCAFFOLD | RESTRUCTURE # From pipeline mode
# SCAFFOLD mode:
targetPath: /project/src/frontend
projectName: MyApp
# RESTRUCTURE mode:
sourcePath: /project/client
targetPath: /project/src/frontend
framework: react
features:
- Dashboard
- Settings
- Profile
Options:
# RESTRUCTURE only:
splitMonolithicFiles: true
extractConstants: true
extractTypes: true
createComponentLibrary: true
Context:
projectName: MyApp
targetPath: /project/src
targetFramework: net10.0
features:
- Dashboard
- Users
Options:
createMockData: true
addSwagger: true
addHealthChecks: true
Context:
mode: MIGRATE | GENERATE # From pipeline mode
targetFormat: csharp | typescript | python | json | sql
# MIGRATE mode:
sourceORM: auto # Auto-detect (drizzle/prisma/typeorm/efcore/sqlalchemy/django)
sourcePath: /project/references/schema.ts
# GENERATE mode:
entities: # Optional ā if empty, starter template used
- name: User
fields: [id, name, email, role, createdAt]
- name: Role
fields: [id, name, description]
targetPath: /project/src/MyApp.Api/MockData
npm run build, dotnet build)Invocations:
Skill(skill: "ln-724-artifact-cleaner", args: "{projectPath}") # TRANSFORM only, conditional
Skill(skill: "ln-721-frontend-restructure", args: "{projectPath} --mode {SCAFFOLD|RESTRUCTURE}")
Skill(skill: "ln-722-backend-generator", args: "{projectPath}")
Skill(skill: "ln-723-seed-data-generator", args: "{projectPath} --mode {GENERATE|MIGRATE}")
TodoWrite format (mandatory):
- Invoke ln-724-artifact-cleaner (conditional TRANSFORM) (pending)
- Invoke ln-721-frontend-restructure (pending)
- Invoke ln-722-backend-generator (pending)
- Invoke ln-723-seed-data-generator (pending)
- Verify structure and builds (pending)
Host Skill Invocation: Skill(skill: "...", args: "...") is mandatory delegation.
SKILL.md, treat args as $ARGUMENTS, execute that skill workflow, then return here with its result/artifact.| Phase | Worker | Context |
|---|---|---|
| 3a | ln-724-artifact-cleaner | Shared (Skill tool) ā remove platform artifacts (TRANSFORM only, conditional) |
| 3b | ln-721-frontend-restructure | Shared (Skill tool) ā scaffold or restructure frontend |
| 3c | ln-722-backend-generator | Shared (Skill tool) ā generate backend project structure |
| 3d | ln-723-seed-data-generator | Shared (Skill tool) ā generate or migrate seed data |
All workers: Invoke via Skill tool ā workers see coordinator context.
CREATE mode:
TRANSFORM mode:
npm run build)dotnet build)| Risk | Detection | Mitigation |
|---|---|---|
| Uncommitted changes | git status not clean | Require clean working directory |
| Build failure (frontend) | npm run build fails | Rollback, delegate to ln-721 for fix |
| Build failure (backend) | dotnet build fails | Rollback, delegate to ln-722 for fix |
| Lost files | Files missing after migration | Restore from backup branch |
| Import errors | Module not found | Re-run import update phase |
| Partial migration | Worker fails mid-execution | Atomic: complete all or rollback all |
| Wrong worker mode | Mode mismatch | Validate mode parameter before delegation |
| File | Purpose |
|---|---|
references/clean_architecture_dotnet.md | .NET project structure template |
references/frontend_structure.md | React project structure template |
Optional reference: load references/meta_analysis_protocol.md only when the user asks for post-run meta-analysis or protocol-formatted run reflection.
Skill type: execution-orchestrator. When requested, run after all phases complete. Output to chat using the execution-orchestrator format.
Version: 3.0.0 Last Updated: 2026-02-07