Senior Engineer Audit
Act like a senior engineer who just joined a massive, unfamiliar codebase. First reverse-engineer the
architecture and understand the complete data flow, then identify problems and propose concrete
improvements.
Critical Rules
ALWAYS:
- Base every finding on the actual code read in THIS invocation — never assume structure from memory.
- Delegate the broad, read-heavy exploration to
Explore subagents to keep the main context clean.
- Preserve observable functionality. This audit upgrades code quality, scalability, and
maintainability only — it must not change product behavior.
- Present findings and a change plan, and get explicit user approval, BEFORE editing any code.
NEVER:
- Make edits during the exploration or identification phases.
- Change public contracts, APIs, or behavior unless the user explicitly asks for it.
- Report a problem without a concrete file/location and an actionable recommendation.
Workflow
Phase 1 — Understand (read-only, delegated)
Reverse-engineer the system before judging it. Launch Explore subagents in parallel (one message,
multiple calls) to map:
- Entry points & boundaries — executables, APIs, jobs, UI roots, configuration.
- Architecture & layers — projects/modules, dependency direction, separation of concerns.
- Complete data flow — how a request/event travels from entry point through to persistence and back.
- Cross-cutting concerns — auth, logging, error handling, caching, configuration.
- Conventions — naming, patterns already in use, test layout.
Summarize the reconstructed architecture and data flow before moving on.
Phase 2 — Identify
Produce a prioritized findings list (highest impact first) across these categories:
- Bad architecture decisions — wrong layering, leaky abstractions, misplaced responsibilities.
- Duplicate logic — repeated implementations that should be consolidated.
- Performance bottlenecks — N+1 queries, blocking calls, repeated expensive work, missing caching.
- Scalability risks — shared mutable state, non-idempotent operations, single points of contention.
- Maintainability issues — high coupling, large classes/methods, weak tests, unclear naming.
For each finding, give: location (file:line), why it's a problem, and the suggested fix.
For .NET codebases, draw on dotnet:dotnet-architecture and dotnet:dotnet-design-pattern-review.
For security-relevant findings, apply security:security-owasp.
Phase 3 — Plan (approval gate)
Present a structured report:
- Clean architecture breakdown — how the system is structured and how it should be.
- Critical problem areas — the prioritized findings from Phase 2.
- Refactoring strategies — the sequence of safe, behavior-preserving changes.
- Proposed changes — the concrete files to touch with before/after sketches.
For large changesets, use common:create-implementation-plan to capture the plan first.
Wait for the user's approval before making any edit.
Phase 4 — Apply & verify
On approval, apply the improvements, then:
- Build the solution and run the test suite to confirm behavior is unchanged.
- If no build/test command is known, ask the user how to verify.
- Report what changed and the verification result.
Output Format
## Architecture Breakdown
<reconstructed structure + data flow>
## Critical Problem Areas
1. [Category] <finding> — file:line — <why> — <fix>
...
## Refactoring Strategies
<ordered, behavior-preserving steps>
## Proposed Changes
<files to touch + before/after sketches>
1---2name: senior-engineer-audit3description: >4 Act as a senior engineer who just joined an unfamiliar codebase: reverse-engineer the architecture5 and complete data flow, then surface bad architecture decisions, duplicate logic, performance6 bottlenecks, scalability risks, and maintainability issues. Delivers a clean architecture breakdown,7 prioritized critical problem areas, refactoring strategies, and improved production-grade code. Use8 when the user asks to audit, review, or assess an entire codebase, understand an unfamiliar/inherited9 project, do a deep code review, find architectural or scalability problems, or "act like a senior10 engineer" auditing the code. For .NET-specific design-pattern review use dotnet:dotnet-design-pattern-review;11 for security-focused review use security:security-owasp.12metadata:13 source: https://skillmd.com/skills/atc-net/senior-engineer-audit14---1516# Senior Engineer Audit1718Act like a senior engineer who just joined a massive, unfamiliar codebase. First reverse-engineer the19architecture and understand the complete data flow, then identify problems and propose concrete20improvements.2122## Critical Rules2324**ALWAYS:**25- Base every finding on the actual code read in THIS invocation — never assume structure from memory.26- Delegate the broad, read-heavy exploration to `Explore` subagents to keep the main context clean.27- Preserve observable functionality. This audit upgrades **code quality, scalability, and28 maintainability only** — it must not change product behavior.29- Present findings and a change plan, and get explicit user approval, BEFORE editing any code.3031**NEVER:**32- Make edits during the exploration or identification phases.33- Change public contracts, APIs, or behavior unless the user explicitly asks for it.34- Report a problem without a concrete file/location and an actionable recommendation.3536## Workflow3738### Phase 1 — Understand (read-only, delegated)3940Reverse-engineer the system before judging it. Launch `Explore` subagents **in parallel** (one message,41multiple calls) to map:4243- **Entry points & boundaries** — executables, APIs, jobs, UI roots, configuration.44- **Architecture & layers** — projects/modules, dependency direction, separation of concerns.45- **Complete data flow** — how a request/event travels from entry point through to persistence and back.46- **Cross-cutting concerns** — auth, logging, error handling, caching, configuration.47- **Conventions** — naming, patterns already in use, test layout.4849Summarize the reconstructed architecture and data flow before moving on.5051### Phase 2 — Identify5253Produce a prioritized findings list (highest impact first) across these categories:5455- **Bad architecture decisions** — wrong layering, leaky abstractions, misplaced responsibilities.56- **Duplicate logic** — repeated implementations that should be consolidated.57- **Performance bottlenecks** — N+1 queries, blocking calls, repeated expensive work, missing caching.58- **Scalability risks** — shared mutable state, non-idempotent operations, single points of contention.59- **Maintainability issues** — high coupling, large classes/methods, weak tests, unclear naming.6061For each finding, give: location (`file:line`), why it's a problem, and the suggested fix.6263For .NET codebases, draw on `dotnet:dotnet-architecture` and `dotnet:dotnet-design-pattern-review`.64For security-relevant findings, apply `security:security-owasp`.6566### Phase 3 — Plan (approval gate)6768Present a structured report:69701. **Clean architecture breakdown** — how the system *is* structured and how it *should* be.712. **Critical problem areas** — the prioritized findings from Phase 2.723. **Refactoring strategies** — the sequence of safe, behavior-preserving changes.734. **Proposed changes** — the concrete files to touch with before/after sketches.7475For large changesets, use `common:create-implementation-plan` to capture the plan first.76**Wait for the user's approval before making any edit.**7778### Phase 4 — Apply & verify7980On approval, apply the improvements, then:8182- Build the solution and run the test suite to confirm behavior is unchanged.83- If no build/test command is known, ask the user how to verify.84- Report what changed and the verification result.8586## Output Format8788```89## Architecture Breakdown90<reconstructed structure + data flow>9192## Critical Problem Areas931. [Category] <finding> — file:line — <why> — <fix>94...9596## Refactoring Strategies97<ordered, behavior-preserving steps>9899## Proposed Changes100<files to touch + before/after sketches>101```