dotnet-to-react-python-refactor

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.

16 stars

Best use case

dotnet-to-react-python-refactor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using dotnet-to-react-python-refactor should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/dotnet-to-react-python-refactor/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/dotnet-to-react-python-refactor/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/dotnet-to-react-python-refactor/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How dotnet-to-react-python-refactor Compares

Feature / Agentdotnet-to-react-python-refactorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# .NET to React + Python Refactor Agent

## Core Workflow

### Phase 1: Assessment & Architecture Planning

1. **Analyze .NET application** — run the assessment script:
   ```bash
   python scripts/assess_dotnet_app.py /path/to/dotnet/project
   ```
   Outputs: project type, controllers, models, views, services, DB contexts, auth, NuGet packages.

2. **Design target architecture** (see `references/architecture-patterns.md`):
   - Frontend: React SPA (routing, state management, UI framework)
   - Backend: Python REST API (FastAPI/Flask/Django) + ORM
   - Auth: JWT, OAuth2, or session-based
   - Data: same DB or migration strategy

### Phase 2: Backend Migration (.NET → Python)

1. **Initialize Python backend**:
   ```bash
   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).

2. **Migrate business logic**: map .NET controllers → Python endpoints; translate C# classes, LINQ → Python/ORM queries, async/await patterns. See `references/framework-equivalents.md`.

3. **Data access**: map Entity Framework models → SQLAlchemy/Django ORM; convert queries and stored procedures. See `references/orm-migration.md`.

4. **Auth**: map ASP.NET Identity → JWT tokens or session auth; preserve role-based/policy authorization. See `references/authentication-patterns.md`.

### Phase 3: Frontend Migration (.NET Views → React)

1. **Initialize React** (Vite recommended):
   ```bash
   npm create vite@latest frontend -- --template react-ts
   ```
   See `assets/react-project-template/` for recommended structure.

2. **Convert Razor views** to JSX (semi-automated):
   ```bash
   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.

3. **State management**: Context API (small apps), Zustand (medium), Redux Toolkit (large); convert ViewBag/ViewData to component or global state.

4. **Routing**: replace ASP.NET routing with React Router; implement protected routes for authenticated pages.

5. **API integration**: React Query + axios with auth interceptors. See `references/api-integration.md`.

6. **Forms**: React Hook Form or Formik; client-side validation matching backend rules.

### Phase 4: Data Layer Migration

1. **Generate ORM models**:
   ```bash
   python scripts/generate_migration.py /path/to/models --framework sqlalchemy --output ./migrations
   ```

2. **Preserve** relationships, constraints, indexes, and custom type mappings.

3. **Apply migrations**: Alembic (SQLAlchemy) or Django migrations.

### Phase 5: Testing & Validation

- **Backend** (pytest): unit tests, endpoint integration tests, auth flows, error handling.
- **Frontend** (Jest + RTL): component tests; Cypress/Playwright for E2E.
- **Data integrity**: compare query results between .NET and Python; validate CRUD and cascading deletes.

### Phase 6: Deployment

1. **Environment**: configure env vars, secrets, and per-environment configs (dev/staging/prod).
2. **Backend**: Gunicorn/Uvicorn + Nginx reverse proxy; health checks and DB connection pooling.
3. **Frontend**: production build → static hosting (Netlify, Vercel, S3+CloudFront); CDN for assets.
4. **Cutover strategy**: Big Bang (fast, higher risk) | Strangler Fig (incremental, lower risk) | Parallel Run.
5. See `references/deployment-guides/` for step-by-step Docker Compose and AWS guides. Use `assets/docker-compose.yml` and `assets/nginx.conf`.

## Execution Guidelines

**Order**: backend first → frontend as endpoints become available → staging validation → cutover with rollback plan.

**Key pitfalls**:
- N+1 queries: Python ORM lazy loading differs from Entity Framework
- Async/await: C# and Python semantics differ
- Timezones: standardize on UTC
- Decimal precision: map carefully for financial calculations

**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.

## Quick Reference

### Scripts

| 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 |

### Reference Docs (`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 (`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 |

Related Skills

enterprise-python

16
from diegosouzapw/awesome-omni-skill

Enterprise-ready Python development incorporating Kaizen (continuous improvement) and Monozukuri (meticulous craftsmanship) principles. Use this skill when building Python applications, APIs, CLI tools, data pipelines, automation scripts, or when the user requests clean, efficient, fast, simple, elegant, enterprise-grade, bulletproof, or production-ready Python code. This skill enforces modern Python 3.12+ best practices, type safety, testing patterns, security, and performance optimization.

dotnet-windbg-debugging

16
from diegosouzapw/awesome-omni-skill

Debugs Windows apps via WinDbg MCP. Crash, hang, high-CPU, and memory triage from dumps or live attach.

dotnet-webapi

16
from diegosouzapw/awesome-omni-skill

Build ASP.NET Core Web APIs with .NET 10 (C# 14.0). Supports project scaffolding, CRUD operations, Entity Framework integration, dependency injection, testing with xUnit, Docker containerization, and following 2025 best practices. Use when creating REST APIs, microservices, backend services, implementing CRUD operations, setting up Entity Framework, adding authentication/authorization, or containerizing .NET applications. Triggers on .NET, ASP.NET Core, C#, Web API, REST API, microservices, dotnet, csharp development tasks.

dotnet-testing

16
from diegosouzapw/awesome-omni-skill

Write and run .NET tests following TDD principles. Use when writing tests, implementing TDD workflow, verifying test coverage, or debugging test failures.

dotnet-maui

16
from diegosouzapw/awesome-omni-skill

.NET MAUI component and application patterns Triggers on: **/*.xaml, **/*.cs

dotnet-framework

16
from diegosouzapw/awesome-omni-skill

Guidance for working with .NET Framework projects. Includes project structure, C# language version, NuGet management, and best practices. Triggers on: **/*.csproj, **/*.cs

dotnet-framework-4-8-expert

16
from diegosouzapw/awesome-omni-skill

Expert .NET Framework 4.8 specialist mastering legacy enterprise applications. Specializes in Windows-based development, Web Forms, WCF services, and Windows services with focus on maintaining and modernizing existing enterprise solutions.

dotnet-backend-patterns

16
from diegosouzapw/awesome-omni-skill

Master C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuratio...

dotnet-aspire

16
from diegosouzapw/awesome-omni-skill

Adds .NET Aspire cloud-native orchestration to existing .NET solutions. Analyzes solution structure to identify services (APIs, web apps, workers), creates AppHost and ServiceDefaults projects, configures service discovery, adds NuGet packages, and sets up distributed application orchestration. Use when adding Aspire to .NET solutions or creating new cloud-ready distributed applications.

dotnet-aspire-patterns

16
from diegosouzapw/awesome-omni-skill

Orchestrates .NET Aspire apps. AppHost, service discovery, components, dashboard, health checks.

dotnet-advisor

16
from diegosouzapw/awesome-omni-skill

Routes .NET/C# work to domain skills. Loads coding-standards for code paths.

developing-with-python

16
from diegosouzapw/awesome-omni-skill

Python 3.11+ development with type hints, async patterns, FastAPI, and pytest. Use for backend services, CLI tools, data processing, and API development.