codebase-modernization

Migrates legacy .NET, React, and Azure codebases to security-first standards through phased incremental hardening.

1|Updated Aug 10, 2026
One-click install
npx skills add https://github.com/TheViziusGroup/vibe-engineering-skills --skill codebase-modernization-theviziusgroup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-modernization
Source: https://github.com/TheViziusGroup/vibe-engineering-skills/tree/main/plugins/security-first-dev/skills/codebase-modernization
Command: npx skills add https://github.com/TheViziusGroup/vibe-engineering-skills --skill codebase-modernization-theviziusgroup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Legacy codebases often contain hardcoded secrets, SQL injection vulnerabilities, missing authentication, and outdated auth flows, but fixing them with big-bang rewrites breaks production. This Skill provides a phased, triage-driven migration path that hardens existing .NET / React / Blazor / Azure codebases one safe PR at a time. ## Core Features & Use Cases - Phase 0 Assessment Protocol: Runs gitleaks, dependency scans, auth surface mapping, BOLA checks, and SQL injection audits, then produces a prioritized P0-P3 findings report before any code changes. - Security-Critical Migrations: Replaces hardcoded secrets with Key Vault and Managed Identity, migrates JWT validation to Microsoft.Identity.Web, moves tokens from localStorage to sessionStorage, and upgrades Implicit Grant to Authorization Code + PKCE. - Architecture & DevSecOps Modernization: Extracts business logic from controllers into services and repositories, adds characterization and security tests, and installs progressive CI/CD security gates (Gitleaks, Semgrep, Snyk, Trivy, Checkov). - Use Case: You inherit a .NET API with connection strings in appsettings.json, controllers without [Authorize], and string-interpolated SQL queries. The Skill triages the secrets as P0, parameterizes the queries as P1, and sequences each fix as a separate passing PR. ## Quick Start Use the codebase-modernization skill to assess this repository for security issues and produce a prioritized migration plan.

Frequently Asked Questions about codebase-modernization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a legacy .NET app to Microsoft Entra ID authentication?

Replace hand-rolled JWT bearer validation with Microsoft.Identity.Web using AddMicrosoftIdentityWebApi, then add role-based authorization policies. Migrate controller by controller, adding [Authorize] attributes in separate PRs, and switch React MSAL config from Implicit Grant to Authorization Code flow with PKCE.

How do I remove hardcoded secrets from a codebase safely?

Run gitleaks across full git history first, then have the credential owner rotate the secret before any code change. Replace connection strings with Azure Key Vault references and Managed Identity via DefaultAzureCredential, and clean git history with git filter-repo after the replacement PR merges.

What is the correct order to fix security issues in legacy code?

Follow a P0-P3 triage: P0 covers hardcoded secrets and missing authentication, P1 covers SQL injection, localStorage token storage, and permissive CORS, P2 covers Implicit Grant migration and Managed Identity adoption, and P3 covers architecture and test coverage debt.

How do I add tests to legacy code that has no test coverage?

Write characterization tests that document current behavior before refactoring, then add security tests for auth bypass, BOLA, and injection first. Set coverage gates at the current level plus 5 percent and ratchet upward each sprint rather than jumping to 80 percent.

Why is middleware order important in ASP.NET Core security?

If UseAuthorization runs before UseAuthentication, all requests are silently treated as unauthenticated, which is a P0 finding. The correct order places UseAuthentication before UseAuthorization, with UseRateLimiter after UseRouting and UseCors before authentication.

When should I not start architecture refactoring during modernization?

Do not start architecture refactoring while P0 through P2 security work remains outstanding, since refactoring carries the highest regression risk. Every extraction from controllers into services and repositories must be covered by tests written before and after the change.