Agent skill for refactoring .NET applications into a React frontend + Python backend. Use for migrating/modernizing .NET apps (ASP.NET MVC, Web API, Blazor, Web Forms) to React + Python, or analyzing .NET codebases for migration planning.
Analyze .NET application — run the assessment script:
python scripts/assess_dotnet_app.py /path/to/dotnet/project
Outputs: project type, controllers, models, views, services, DB contexts, auth, NuGet packages.
Design target architecture (see references/architecture-patterns.md):
Initialize Python backend:
python scripts/init_python_backend.py <name> --framework fastapi --db-type postgresql
Framework choice: FastAPI (async, OpenAPI docs), Flask (lightweight), Django REST (full-featured with ORM/admin).
Migrate business logic: map .NET controllers → Python endpoints; translate C# classes, LINQ → Python/ORM queries, async/await patterns. See references/framework-equivalents.md.
Data access: map Entity Framework models → SQLAlchemy/Django ORM; convert queries and stored procedures. See references/orm-migration.md.
Auth: map ASP.NET Identity → JWT tokens or session auth; preserve role-based/policy authorization. See references/authentication-patterns.md.
Initialize React (Vite recommended):
npm create vite@latest frontend -- --template react-ts
See assets/react-project-template/ for recommended structure.
Convert Razor views to JSX (semi-automated):
python scripts/convert_razor_to_jsx.py ./Views --output ./frontend/src/components
Use assets/react-component-templates/ for production-ready Button, Input, and Modal components.
State management: Context API (small apps), Zustand (medium), Redux Toolkit (large); convert ViewBag/ViewData to component or global state.
Routing: replace ASP.NET routing with React Router; implement protected routes for authenticated pages.
API integration: React Query + axios with auth interceptors. See references/api-integration.md.
Forms: React Hook Form or Formik; client-side validation matching backend rules.
Generate ORM models:
python scripts/generate_migration.py /path/to/models --framework sqlalchemy --output ./migrations
Preserve relationships, constraints, indexes, and custom type mappings.
Apply migrations: Alembic (SQLAlchemy) or Django migrations.
references/deployment-guides/ for step-by-step Docker Compose and AWS guides. Use assets/docker-compose.yml and assets/nginx.conf.Order: backend first → frontend as endpoints become available → staging validation → cutover with rollback plan.
Key pitfalls:
Standards: PEP 8 + type hints + mypy (Python); ESLint + Prettier + TypeScript (React); 80%+ test coverage.
Performance: profile DB queries early; add Redis caching; paginate large datasets; use React.memo/useMemo and lazy loading.
| Script | Purpose |
|--------|---------|
| assess_dotnet_app.py | Generate migration inventory from .NET project |
| init_python_backend.py | Scaffold Python backend (FastAPI/Flask/Django) |
| generate_migration.py | Create ORM models from .NET Entity Framework models |
| convert_razor_to_jsx.py | Convert Razor views to React JSX |
references/)| File | Use When |
|------|---------|
| architecture-patterns.md | Planning architecture or choosing tech stack |
| framework-equivalents.md | Mapping .NET → Python technologies and packages |
| orm-migration.md | Entity Framework → SQLAlchemy/Django ORM |
| authentication-patterns.md | Implementing auth migration |
| api-integration.md | React–Python API client patterns |
| testing-strategies.md | Setting up tests and coverage |
| security-hardening-checklist.md | Pre-production security audit |
| troubleshooting-guide.md | Debugging migration and deployment issues |
| deployment-guides/docker-compose-deployment.md | Docker Compose deployment |
| deployment-guides/aws-deployment.md | AWS deployment (Elastic Beanstalk, EC2, ECS) |
assets/)| Asset | Purpose |
|-------|---------|
| react-project-template/ | React project structure guide |
| react-component-templates/ | Button, Input, Modal components with CSS |
| docker-compose.yml | Full-stack Docker setup (PostgreSQL, Redis, Nginx) |
| nginx.conf | Production Nginx reverse proxy |
| Dockerfile.dev | Development frontend Dockerfile with hot-reload |
| .env.example | Environment variables template |
| cicd-templates/ | GitHub Actions and GitLab CI/CD pipelines |
npx skills add manojsingh/dotnet-to-react-python-refactor下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer