Project Architecture Deep Audit Skill
Purpose
Produce a complete, evidence-based architecture report for any repository with:
- Full top-down architecture mapping.
- Exploration of all major runtime paths (UI routes, API routes, background jobs, integration boundaries, data paths).
- API endpoint behavior matrix.
- Current user journey vs target user journey from product docs.
- Deep issue analysis with concrete, step-by-step fixes.
This skill is designed for portability and must not return a shallow overview.
Scope
You must analyze all of the following layers in order:
- Product intent and target behavior from project docs.
- Runtime architecture and dependencies.
- Frontend user-facing routes and UI states.
- API boundary layer (BFF/gateway/services) and auth/rate-limiting behavior.
- Backend endpoints and business-domain dependencies.
- Data layer (storage models, cache strategy, consistency boundaries).
- Background processing, pipelines, workers, schedulers, and model/inference paths (if present).
- End-to-end journey continuity and failure points.
Required Inputs
You must read enough files to establish evidence for every major path before making conclusions.
At minimum, discover and inspect files in these categories if they exist.
Product intent and setup
- Root docs: README*, CONTRIBUTING*, docs/*, architecture docs, product specs
- Runtime setup: compose/manifests, lockfiles, package manifests, env templates
User experience layer
- Entry pages/routes and their linked flows
- Shared layout/navigation components that affect user journey branching
- Error/loading/empty states for critical pages
API boundary layer
- Gateway/BFF handlers, controllers, route declarations, middleware
- Request/response schemas and validation modules
Backend and core domain
- App entrypoints, routers/controllers, service/domain modules
- Auth, permission, feature flag, or usage controls
Data and async processing
- Database models/migrations/repositories
- Jobs, workers, schedulers, pipelines, integration clients
- ML training/inference/explainability modules (when applicable)
If a category is expected but absent, explicitly note it as a finding.
Discovery Procedure (Portable)
Use this sequence to adapt to any stack.
- Detect major technologies and frameworks from manifests and entrypoints.
- Locate route declarations and endpoint registration points.
- Locate user entry routes and primary conversion flows.
- Locate domain services, data access boundaries, and async jobs.
- Build a dependency map from user action -> API -> domain -> data -> side effects.
- Verify assumptions with code evidence before writing findings.
Non-Negotiable Workflow
Follow this exact workflow every time.
Phase 1: Build top-down system map
- Extract promised behavior from product/docs.
- Map actual implemented modules by layer:
- Entry points
- User entry routes
- API boundary
- Data/ML internals
- Create a "promised vs implemented" baseline before issue analysis.
Phase 2: Enumerate all endpoints and paths
For each endpoint, document method, input contract, output contract, dependencies, and error paths.
You must include:
- Public user-facing routes
- Public/internal API endpoints
- Webhook/callback endpoints (if present)
- Health/readiness endpoints (if present)
For each endpoint, capture:
- Who calls it.
- Required preconditions.
- Fallback/error behavior.
- UX consequence if it fails.
Phase 3: User journey deep dive
Construct end-to-end journeys from user perspective.
Required journeys:
- Primary happy path from first entry to core value delivered.
- Billing/quota/permission denial path (if product has gating).
- Invalid input path for core action.
- Dependency outage path (backend/db/external API/model unavailable).
- Secondary/non-core navigation paths and their continuity.
For each journey, provide:
- Steps in order.
- API calls made at each step.
- Possible breakpoints.
- Current observed UX behavior.
Phase 4: Current vs target journey comparison
Use product docs/README as source of truth for desired product behavior.
Create a side-by-side analysis:
- Current behavior (what code does now).
- Target behavior (what README promises/vision implies).
- Gap.
- Severity (Critical, High, Medium, Low).
- Why this gap matters to real users/business goals.
Phase 5: Issue discovery and root-cause analysis
Analyze technical and product issues including:
- Broken route wiring
- Contract mismatches between frontend and backend
- Placeholder pages blocking key user value
- Non-persistent state limitations (cache/session/quota)
- Billing/checkout integration gaps (if applicable)
- Missing observability and resilience behavior
- Data pipeline/model readiness risk (if applicable)
- Security/configuration risks
Every issue must include:
- Evidence with exact file references.
- Root cause.
- User impact.
- Engineering impact.
- Reproduction path.
Phase 6: In-depth fix plans
For each issue, provide a detailed remediation plan:
- Immediate fix (minimal viable correction).
- Robust fix (production-grade).
- Exact files to modify.
- Suggested implementation sequence.
- Validation plan (manual + automated tests).
- Rollout risk and rollback strategy.
Required Output Format
Return output in this order.
1) Executive architecture summary
- One concise top-down summary of the full system as implemented now.
2) Full architecture map
- Layer-by-layer breakdown from UI down to DB/ML artifacts.
- Include data flow from player tag input to recommendation output.
3) Endpoint contract matrix
For every endpoint list:
- Path + method
- Caller
- Dependencies
- Success response shape
- Error cases
- Notes on mismatches or fragility
4) User journey matrix
For each required journey include:
- Step-by-step flow
- API touches
- UX states
- Failure states
5) Current vs desired experience
A table with columns:
- Capability
- Current behavior
- Desired behavior (docs/README)
- Gap
- Severity
6) Issues and deep fixes
For each issue:
- Issue title
- Severity
- Evidence
- Root cause
- User impact
- Step-by-step fix plan
- Test plan
7) Prioritized implementation roadmap
- Top-down sequence for fixes:
- Stabilize core flow
- Close product-vision gaps
- Production hardening
Each item must include:
- Objective
- Files
- Dependencies
- Definition of done
Quality Bar
Do not pass if any of these are true:
- You skipped major paths in the discovered architecture.
- You described architecture without endpoint contracts.
- You gave generic "improve X" advice without concrete file-level fixes.
- You did not compare current behavior to documented product promises.
- You did not describe user-visible failure modes.
Ground Rules
- Evidence only: do not invent behavior not supported by code/docs.
- Be explicit about uncertainty: "not found in code" when applicable.
- Prefer deterministic findings over assumptions.
- Keep recommendations implementation-ready.
- If the repository is large, prioritize core production paths first, then expand to supporting paths.
- If multiple services/repos are present, audit each service and then produce a cross-service integration map.
Optional Advanced Pass (if requested)
Include:
- Sequence diagrams for core journeys.
- A test coverage matrix by journey and endpoint.
- A migration plan from ephemeral state to persistent/reliable infrastructure where needed.
- A deployment-readiness checklist for the detected hosting/runtime topology.
Publishing Notes
For public distribution:
- Keep this skill free of repository-specific file paths.
- Keep trigger phrases broad and architecture-focused.
- Require evidence-linked findings to reduce hallucinated analysis.
- Keep output schema stable so downstream users can automate review consumption.
1---2name: review-architecture3description: Use when you need a complete top-down architecture audit of any codebase, including full exploration of major paths, endpoint mapping, current-vs-target user journeys from documentation, and deep issue remediation plans with step-by-step fixes. Trigger phrases: architecture audit, full codebase walkthrough, map all endpoints, user journey analysis, current vs desired product flow, find and fix project issues, end-to-end architecture review.4---56# Project Architecture Deep Audit Skill78## Purpose9Produce a complete, evidence-based architecture report for any repository with:101. Full top-down architecture mapping.112. Exploration of all major runtime paths (UI routes, API routes, background jobs, integration boundaries, data paths).123. API endpoint behavior matrix.134. Current user journey vs target user journey from product docs.145. Deep issue analysis with concrete, step-by-step fixes.1516This skill is designed for portability and must not return a shallow overview.1718## Scope19You must analyze all of the following layers in order:201. Product intent and target behavior from project docs.212. Runtime architecture and dependencies.223. Frontend user-facing routes and UI states.234. API boundary layer (BFF/gateway/services) and auth/rate-limiting behavior.245. Backend endpoints and business-domain dependencies.256. Data layer (storage models, cache strategy, consistency boundaries).267. Background processing, pipelines, workers, schedulers, and model/inference paths (if present).278. End-to-end journey continuity and failure points.2829## Required Inputs30You must read enough files to establish evidence for every major path before making conclusions.3132At minimum, discover and inspect files in these categories if they exist.3334### Product intent and setup35- Root docs: README*, CONTRIBUTING*, docs/*, architecture docs, product specs36- Runtime setup: compose/manifests, lockfiles, package manifests, env templates3738### User experience layer39- Entry pages/routes and their linked flows40- Shared layout/navigation components that affect user journey branching41- Error/loading/empty states for critical pages4243### API boundary layer44- Gateway/BFF handlers, controllers, route declarations, middleware45- Request/response schemas and validation modules4647### Backend and core domain48- App entrypoints, routers/controllers, service/domain modules49- Auth, permission, feature flag, or usage controls5051### Data and async processing52- Database models/migrations/repositories53- Jobs, workers, schedulers, pipelines, integration clients54- ML training/inference/explainability modules (when applicable)5556If a category is expected but absent, explicitly note it as a finding.5758## Discovery Procedure (Portable)59Use this sequence to adapt to any stack.60611. Detect major technologies and frameworks from manifests and entrypoints.622. Locate route declarations and endpoint registration points.633. Locate user entry routes and primary conversion flows.644. Locate domain services, data access boundaries, and async jobs.655. Build a dependency map from user action -> API -> domain -> data -> side effects.666. Verify assumptions with code evidence before writing findings.6768## Non-Negotiable Workflow69Follow this exact workflow every time.7071### Phase 1: Build top-down system map721. Extract promised behavior from product/docs.732. Map actual implemented modules by layer:74- Entry points75- User entry routes76- API boundary77- Data/ML internals783. Create a "promised vs implemented" baseline before issue analysis.7980### Phase 2: Enumerate all endpoints and paths81For each endpoint, document method, input contract, output contract, dependencies, and error paths.8283You must include:84- Public user-facing routes85- Public/internal API endpoints86- Webhook/callback endpoints (if present)87- Health/readiness endpoints (if present)8889For each endpoint, capture:901. Who calls it.912. Required preconditions.923. Fallback/error behavior.934. UX consequence if it fails.9495### Phase 3: User journey deep dive96Construct end-to-end journeys from user perspective.9798Required journeys:991. Primary happy path from first entry to core value delivered.1002. Billing/quota/permission denial path (if product has gating).1013. Invalid input path for core action.1024. Dependency outage path (backend/db/external API/model unavailable).1035. Secondary/non-core navigation paths and their continuity.104105For each journey, provide:1061. Steps in order.1072. API calls made at each step.1083. Possible breakpoints.1094. Current observed UX behavior.110111### Phase 4: Current vs target journey comparison112Use product docs/README as source of truth for desired product behavior.113114Create a side-by-side analysis:1151. Current behavior (what code does now).1162. Target behavior (what README promises/vision implies).1173. Gap.1184. Severity (Critical, High, Medium, Low).1195. Why this gap matters to real users/business goals.120121### Phase 5: Issue discovery and root-cause analysis122Analyze technical and product issues including:123- Broken route wiring124- Contract mismatches between frontend and backend125- Placeholder pages blocking key user value126- Non-persistent state limitations (cache/session/quota)127- Billing/checkout integration gaps (if applicable)128- Missing observability and resilience behavior129- Data pipeline/model readiness risk (if applicable)130- Security/configuration risks131132Every issue must include:1331. Evidence with exact file references.1342. Root cause.1353. User impact.1364. Engineering impact.1375. Reproduction path.138139### Phase 6: In-depth fix plans140For each issue, provide a detailed remediation plan:1411. Immediate fix (minimal viable correction).1422. Robust fix (production-grade).1433. Exact files to modify.1444. Suggested implementation sequence.1455. Validation plan (manual + automated tests).1466. Rollout risk and rollback strategy.147148## Required Output Format149Return output in this order.150151### 1) Executive architecture summary152- One concise top-down summary of the full system as implemented now.153154### 2) Full architecture map155- Layer-by-layer breakdown from UI down to DB/ML artifacts.156- Include data flow from player tag input to recommendation output.157158### 3) Endpoint contract matrix159For every endpoint list:160- Path + method161- Caller162- Dependencies163- Success response shape164- Error cases165- Notes on mismatches or fragility166167### 4) User journey matrix168For each required journey include:169- Step-by-step flow170- API touches171- UX states172- Failure states173174### 5) Current vs desired experience175A table with columns:176- Capability177- Current behavior178- Desired behavior (docs/README)179- Gap180- Severity181182### 6) Issues and deep fixes183For each issue:184- Issue title185- Severity186- Evidence187- Root cause188- User impact189- Step-by-step fix plan190- Test plan191192### 7) Prioritized implementation roadmap193- Top-down sequence for fixes:1941. Stabilize core flow1952. Close product-vision gaps1963. Production hardening197198Each item must include:199- Objective200- Files201- Dependencies202- Definition of done203204## Quality Bar205Do not pass if any of these are true:206- You skipped major paths in the discovered architecture.207- You described architecture without endpoint contracts.208- You gave generic "improve X" advice without concrete file-level fixes.209- You did not compare current behavior to documented product promises.210- You did not describe user-visible failure modes.211212## Ground Rules2131. Evidence only: do not invent behavior not supported by code/docs.2142. Be explicit about uncertainty: "not found in code" when applicable.2153. Prefer deterministic findings over assumptions.2164. Keep recommendations implementation-ready.2175. If the repository is large, prioritize core production paths first, then expand to supporting paths.2186. If multiple services/repos are present, audit each service and then produce a cross-service integration map.219220## Optional Advanced Pass (if requested)221Include:2221. Sequence diagrams for core journeys.2232. A test coverage matrix by journey and endpoint.2243. A migration plan from ephemeral state to persistent/reliable infrastructure where needed.2254. A deployment-readiness checklist for the detected hosting/runtime topology.226227## Publishing Notes228For public distribution:2291. Keep this skill free of repository-specific file paths.2302. Keep trigger phrases broad and architecture-focused.2313. Require evidence-linked findings to reduce hallucinated analysis.2324. Keep output schema stable so downstream users can automate review consumption.