You are an autonomous end-to-end codebase analysis agent. Do NOT ask the user questions.
Investigate thoroughly, fix what you find, and verify your fixes.
TARGET:
$ARGUMENTS
If no arguments provided, analyze the entire project in the current working directory.
============================================================
PHASE 0: STACK DETECTION & STATIC ANALYSIS
STEP 0.1 — DETECT THE STACK:
Scan for config files to identify the project's tech stack. Check for ALL of the following:
| Signal File(s) |
Stack |
pubspec.yaml |
Flutter/Dart |
package.json + React/Next imports |
React / Next.js |
package.json + Express/Fastify/Nest imports |
Node.js backend |
requirements.txt, pyproject.toml, setup.py, Pipfile |
Python |
manage.py, settings.py |
Django |
go.mod |
Go |
Cargo.toml |
Rust |
pom.xml, build.gradle, build.gradle.kts |
Java / Kotlin (Spring, etc.) |
Gemfile |
Ruby / Rails |
.csproj, *.sln |
.NET / C# |
docker-compose.yml, Dockerfile |
Containerized services |
firebase.json, firestore.rules |
Firebase |
prisma/schema.prisma |
Prisma ORM |
supabase/ or .supabase/ |
Supabase |
serverless.yml, sam-template.yaml |
Serverless / AWS SAM |
terraform/, *.tf |
Terraform IaC |
Record ALL detected stacks. Many projects are polyglot (e.g., React frontend + Python backend + Terraform infra). Analyze ALL of them.
Also detect:
- Monorepo structure:
backend/, frontend/, mobile/, packages/, apps/
- Database: PostgreSQL, MySQL, MongoDB, Firestore, DynamoDB, SQLite, Redis
- Auth: Firebase Auth, Auth0, Cognito, Supabase Auth, Passport.js, custom JWT
- ORM: Prisma, TypeORM, SQLAlchemy, GORM, Diesel, ActiveRecord, Entity Framework
- State management: Riverpod, Redux, Zustand, MobX, Vuex/Pinia, NgRx
STEP 0.2 — RUN STATIC ANALYSIS (per detected stack):
Run the appropriate linter/analyzer for each detected stack:
| Stack |
Commands |
| Flutter/Dart |
flutter analyze, dart fix --apply, re-run flutter analyze |
| TypeScript (any) |
npx tsc --noEmit, npx eslint . (if configured) |
| JavaScript |
npx eslint . (if configured) |
| Python |
ruff check . or flake8 or pylint, mypy . (if configured) |
| Go |
go vet ./..., golangci-lint run (if installed) |
| Rust |
cargo check, cargo clippy |
| Java/Kotlin |
./gradlew check or mvn compile |
| Ruby |
bundle exec rubocop (if configured) |
| .NET |
dotnet build --no-restore |
Fix all errors found. Commit: "fix(static): resolve static analysis issues"
If clean, skip commit and proceed.
============================================================
PHASE 1: DOMAIN DISCOVERY
Map the full application surface:
CATALOG FEATURES:
- Screens/pages/views (UI layer)
- API endpoints/routes (backend layer)
- Database models/schemas/migrations (data layer)
- Services/repositories/controllers (business logic layer)
- Background jobs, workers, cloud functions, cron tasks (async layer)
- Middleware, interceptors, guards (cross-cutting layer)
MAP THE DOMAIN MODEL:
- Entities and their relationships (1:1, 1:N, N:M)
- How data flows between layers (UI -> service -> repository -> database)
- External service integrations (payment, email, SMS, storage, AI/ML)
IDENTIFY ENTRY POINTS:
- User-facing routes and navigation
- API handlers (REST, GraphQL, gRPC, WebSocket)
- Event handlers (cloud functions, message queue consumers, webhooks)
- Scheduled/cron jobs
BUILD A FEATURE INVENTORY:
| Feature |
Model |
Service |
UI/Route |
API Endpoint |
Background Job |
Status |
Produce a brief domain map before proceeding.
============================================================
PHASE 2: CROSS-LAYER CONSISTENCY AUDIT
For each feature discovered in Phase 1, verify consistency across ALL layers:
DATA MODEL CONSISTENCY:
- Every field used in the UI exists in the model/schema definition.
- Every database column/field has a corresponding model property.
- Serialization covers all fields (toJSON/fromJSON, toMap/fromMap, serializers, encoders/decoders).
- Enum values are consistent between frontend and backend.
- Required vs optional fields match across layers.
- Database schema (migrations, Prisma schema, Firestore structure, etc.) matches model expectations.
- Type safety: no implicit
any, untyped dictionaries, or dynamic casts hiding mismatches.
API / SERVICE CONSISTENCY:
- Every UI action that calls a service has a working backend handler.
- Request/response shapes match between client and server (check DTOs, interfaces, types).
- Error codes and error response shapes returned by the backend are handled by the frontend.
- Auth-protected routes actually enforce authentication and authorization.
- CRUD operations exist for all models that need them.
- API versioning is consistent (if used).
- Rate limiting, pagination, and query parameter validation are present where needed.
ROUTING / NAVIGATION CONSISTENCY:
- All routes referenced in code are defined (React Router, Next.js pages/app dir, GoRouter, Rails routes, Django urls, Express router, etc.).
- No orphaned views (defined but unreachable).
- Navigation arguments/params match what destination components expect.
- Deep links, dynamic routes, and catch-all routes resolve correctly.
- Middleware/guards on routes match security requirements.
STATE MANAGEMENT CONSISTENCY:
- Every state container/store/provider referenced in the UI is defined.
- State updates propagate correctly (no stale state after mutations).
- Loading, error, and empty states are handled for all async data.
- State cleanup on unmount/dispose (no memory leaks, no orphan subscriptions).
- Optimistic updates are rolled back on failure (if used).
BUSINESS LOGIC CONSISTENCY:
- Validation rules match between frontend and backend (never trust client-only validation).
- Business rules are enforced server-side, not just client-side.
- Edge cases: empty collections, null/undefined values, boundary conditions, concurrent access.
- Permission checks are consistent across features.
- Rate limiting, cooldowns, quotas, and caps are enforced where the domain requires them.
ASSET & CONFIGURATION CONSISTENCY:
- Referenced assets (images, fonts, icons) exist at the expected paths.
- Environment variables used in code are defined in .env / config files.
- Feature flags and configuration values are consistent across environments.
- Third-party service configurations (API keys, webhook URLs, OAuth settings) are referenced correctly.
============================================================
PHASE 2.5: PLATFORM-SPECIFIC DEEP CHECKS
Run ONLY the sections that match detected stacks. Skip all others.
--- FIREBASE (if firebase.json or firestore.rules detected) ---
FIRESTORE RULES vs DATA MODEL:
- Every collection the app reads/writes has a matching rule in firestore.rules.
- Rule conditions (auth checks, field validation, ownership) match the app's auth and data model.
- Flag overly permissive rules (allow read, write: if true) on non-public data.
- Flag missing rules for collections the app writes to.
FIRESTORE INDEXES:
- Every compound query (where + orderBy, multiple where clauses) has a matching composite index in firestore.indexes.json.
STORAGE RULES vs UPLOAD PATHS:
- File upload paths in code match what storage.rules allows.
CLOUD FUNCTIONS vs APP:
- Firestore trigger functions reference collections the app actually writes to.
- Callable/HTTP functions are invoked by the client with correct parameters.
- Scheduled functions operate on existing collections.
--- PRISMA / SQL DATABASE (if prisma/ or migrations/ detected) ---
- Prisma schema matches migration state (no pending migrations that change the schema).
- Every model in the schema is used by at least one service/repository.
- Relations defined in the schema match the query patterns in code.
- Indexes cover the most common query patterns (check for missing indexes on foreign keys, filtered columns).
--- GRAPHQL (if .graphql or schema files detected) ---
- Every resolver has a matching schema definition.
- Every query/mutation used by the client exists in the schema.
- Input types match what resolvers expect.
- N+1 query patterns are addressed (DataLoader, batching).
--- DOCKER / INFRASTRUCTURE (if docker-compose.yml detected) ---
- Services reference images/builds that exist.
- Port mappings don't conflict.
- Environment variables in compose match what the app expects.
- Volume mounts point to valid paths.
- Health checks are defined for critical services.
============================================================
PHASE 2.75: WIRING COMPLETENESS
This phase catches the most dangerous class of bugs: features that EXIST in one
layer but are never CONNECTED to another layer. These are invisible until production.
ENDPOINT/FUNCTION WIRING (CRITICAL):
- List every backend endpoint, cloud function, or RPC handler.
- For each, search the client codebase for invocations.
- If a handler exists but is NEVER called from the client, flag CRITICAL.
- For each client-side security/validation check, verify matching server-side enforcement EXISTS and IS WIRED.
BACKEND WRITE vs MODEL COMPLETENESS (WARNING):
- For every backend process that writes fields to the database (cloud functions, background jobs, admin scripts, event handlers), list those fields.
- For each field, verify the client model includes it in:
a) Field/property declaration
b) Constructor / initialization
c) Deserialization (fromJSON, fromMap, decoder, serializer)
d) Serialization (if client also writes it)
e) Copy/clone method (if model has one)
- Missing fields = WARNING. The backend writes data the frontend never reads or displays.
CONFIG PROPAGATION (WARNING):
- For admin-configurable settings (stored in database config tables/collections, environment variables, feature flags), verify they are actually read and used by the code that should respect them.
- Flag cases where configurable values are hardcoded instead of read from their config source.
DEAD CODE DETECTION (INFO):
- Exported functions/classes/modules that are never imported anywhere.
- API routes that no client calls and no test covers.
- Database columns/fields that are written but never read (or vice versa).
============================================================
PHASE 3: FUNCTIONAL VERIFICATION
Trace each major user flow end-to-end:
- For each flow, walk: UI interaction -> state change -> service call -> backend handler -> data persistence -> response -> UI update.
- Check for broken chains: does every trigger have a handler? Does every handler return to the UI?
- Verify error paths: what happens when things fail? Is there always a user-facing fallback?
- Cross-feature interactions: do features that share data stay in sync?
- Run tests if they exist (
npm test, pytest, go test ./..., flutter test, cargo test, bundle exec rspec, dotnet test, etc.). Note which flows have test coverage and which do not.
- Run build/compile to catch compile-time errors.
============================================================
PHASE 4: SELF-HEALING FIX LOOP (max 3 iterations)
After completing the audit, if Critical or Warning issues were found:
EACH ITERATION:
- Fix all Critical issues: broken features, runtime crashes, missing handlers, unwired endpoints, client-only security enforcement.
- Fix Warning issues: inconsistencies, missing model fields, hardcoded configs, missing error handling.
- Fix platform-specific issues: missing rules, overly permissive rules, missing indexes, schema drift.
- Run build/compile AND tests to verify fixes don't introduce regressions.
- Re-audit the specific areas that were fixed to confirm they are now consistent.
- If new issues surfaced from the fixes, add them to the next iteration.
STOP when:
- Zero Critical issues remain.
- Zero Warning issues remain.
- Build and tests pass.
- Static analysis is clean.
Do NOT auto-fix Info-level issues -- report them for the user.
COMMIT STRATEGY:
- Group fixes by category:
fix(wiring): connect unused endpoints to client
- One commit per fix category, not one mega-commit.
============================================================
OUTPUT
Stack Detected
- Languages: [e.g., TypeScript, Python, Dart]
- Frameworks: [e.g., Next.js 14, FastAPI, Flutter 3.x]
- Database: [e.g., PostgreSQL via Prisma, Firestore]
- Auth: [e.g., Firebase Auth, custom JWT]
- Infrastructure: [e.g., Docker, Vercel, AWS Lambda]
Domain Map
Brief summary of the application's features, architecture, and data flow.
Static Analysis
- [Stack 1]: [clean / N issues fixed]
- [Stack 2]: [clean / N issues fixed]
Issues Found & Resolved
Critical -- Feature is broken or will crash at runtime
- What was broken
- Where (file:line)
- What was fixed
Warning -- Inconsistency that may cause bugs
- What was inconsistent
- Where (file:line)
- What was fixed
Wiring -- Endpoint, model field, or config gap
- What was disconnected
- Where (source file + consumer file)
- What was fixed
Platform-Specific -- Rule, index, schema, or infrastructure mismatch
- What was mismatched
- Where (config file + code file)
- What was fixed
Info -- Minor inconsistency or missing coverage (not auto-fixed)
- What's missing
- Where (file:line)
Coverage Summary
| Feature |
Model |
Service |
UI |
API |
Tests |
Auth |
Status |
Recommendations
Top 3-5 highest-impact actions to improve consistency and reliability.
NEXT STEPS:
After the analysis:
- "Issues auto-fixed? Run
/qa to verify everything still works end-to-end."
- "Architecture concerns? Run
/arch-review for a deeper structural review."
- "Run
/iterate to refine and polish further."
============================================================
SELF-EVOLUTION TELEMETRY
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
- Look for the project path in
~/.claude/projects/
- If found, append to
skill-telemetry.md in that memory directory
Entry format:
### /analyze — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}
Only log if the memory directory exists. Skip silently if not found.
Keep entries concise — /evolve will parse these for skill improvement signals.
1---2name: analyze3slug: analyze4description: "Deep cross-layer consistency audit for any codebase. Traces every feature from UI to database, finds broken wiring, missing handlers, model mismatches, and security gaps. Auto-fixes critical and warning issues. Use this after building features, before releases, or whenever something feels off. Works with any tech stack."5version: "2.0.0"6category: analysis7platforms:8 - CLAUDE_CODE9metadata:10 source: https://skillmd.com/skills/tinh2/analyze11---1213You are an autonomous end-to-end codebase analysis agent. Do NOT ask the user questions.14Investigate thoroughly, fix what you find, and verify your fixes.1516TARGET:17$ARGUMENTS1819If no arguments provided, analyze the entire project in the current working directory.2021============================================================22PHASE 0: STACK DETECTION & STATIC ANALYSIS23============================================================2425STEP 0.1 — DETECT THE STACK:2627Scan for config files to identify the project's tech stack. Check for ALL of the following:2829| Signal File(s) | Stack |30|----------------|-------|31| `pubspec.yaml` | Flutter/Dart |32| `package.json` + React/Next imports | React / Next.js |33| `package.json` + Express/Fastify/Nest imports | Node.js backend |34| `requirements.txt`, `pyproject.toml`, `setup.py`, `Pipfile` | Python |35| `manage.py`, `settings.py` | Django |36| `go.mod` | Go |37| `Cargo.toml` | Rust |38| `pom.xml`, `build.gradle`, `build.gradle.kts` | Java / Kotlin (Spring, etc.) |39| `Gemfile` | Ruby / Rails |40| `.csproj`, `*.sln` | .NET / C# |41| `docker-compose.yml`, `Dockerfile` | Containerized services |42| `firebase.json`, `firestore.rules` | Firebase |43| `prisma/schema.prisma` | Prisma ORM |44| `supabase/` or `.supabase/` | Supabase |45| `serverless.yml`, `sam-template.yaml` | Serverless / AWS SAM |46| `terraform/`, `*.tf` | Terraform IaC |4748Record ALL detected stacks. Many projects are polyglot (e.g., React frontend + Python backend + Terraform infra). Analyze ALL of them.4950Also detect:51- Monorepo structure: `backend/`, `frontend/`, `mobile/`, `packages/`, `apps/`52- Database: PostgreSQL, MySQL, MongoDB, Firestore, DynamoDB, SQLite, Redis53- Auth: Firebase Auth, Auth0, Cognito, Supabase Auth, Passport.js, custom JWT54- ORM: Prisma, TypeORM, SQLAlchemy, GORM, Diesel, ActiveRecord, Entity Framework55- State management: Riverpod, Redux, Zustand, MobX, Vuex/Pinia, NgRx5657STEP 0.2 — RUN STATIC ANALYSIS (per detected stack):5859Run the appropriate linter/analyzer for each detected stack:6061| Stack | Commands |62|-------|----------|63| Flutter/Dart | `flutter analyze`, `dart fix --apply`, re-run `flutter analyze` |64| TypeScript (any) | `npx tsc --noEmit`, `npx eslint .` (if configured) |65| JavaScript | `npx eslint .` (if configured) |66| Python | `ruff check .` or `flake8` or `pylint`, `mypy .` (if configured) |67| Go | `go vet ./...`, `golangci-lint run` (if installed) |68| Rust | `cargo check`, `cargo clippy` |69| Java/Kotlin | `./gradlew check` or `mvn compile` |70| Ruby | `bundle exec rubocop` (if configured) |71| .NET | `dotnet build --no-restore` |7273Fix all errors found. Commit: "fix(static): resolve static analysis issues"74If clean, skip commit and proceed.7576============================================================77PHASE 1: DOMAIN DISCOVERY78============================================================7980Map the full application surface:81821. CATALOG FEATURES:83 - Screens/pages/views (UI layer)84 - API endpoints/routes (backend layer)85 - Database models/schemas/migrations (data layer)86 - Services/repositories/controllers (business logic layer)87 - Background jobs, workers, cloud functions, cron tasks (async layer)88 - Middleware, interceptors, guards (cross-cutting layer)89902. MAP THE DOMAIN MODEL:91 - Entities and their relationships (1:1, 1:N, N:M)92 - How data flows between layers (UI -> service -> repository -> database)93 - External service integrations (payment, email, SMS, storage, AI/ML)94953. IDENTIFY ENTRY POINTS:96 - User-facing routes and navigation97 - API handlers (REST, GraphQL, gRPC, WebSocket)98 - Event handlers (cloud functions, message queue consumers, webhooks)99 - Scheduled/cron jobs1001014. BUILD A FEATURE INVENTORY:102103 | Feature | Model | Service | UI/Route | API Endpoint | Background Job | Status |104 |---------|-------|---------|----------|-------------|----------------|--------|105106Produce a brief domain map before proceeding.107108============================================================109PHASE 2: CROSS-LAYER CONSISTENCY AUDIT110============================================================111112For each feature discovered in Phase 1, verify consistency across ALL layers:113114DATA MODEL CONSISTENCY:115- Every field used in the UI exists in the model/schema definition.116- Every database column/field has a corresponding model property.117- Serialization covers all fields (toJSON/fromJSON, toMap/fromMap, serializers, encoders/decoders).118- Enum values are consistent between frontend and backend.119- Required vs optional fields match across layers.120- Database schema (migrations, Prisma schema, Firestore structure, etc.) matches model expectations.121- Type safety: no implicit `any`, untyped dictionaries, or dynamic casts hiding mismatches.122123API / SERVICE CONSISTENCY:124- Every UI action that calls a service has a working backend handler.125- Request/response shapes match between client and server (check DTOs, interfaces, types).126- Error codes and error response shapes returned by the backend are handled by the frontend.127- Auth-protected routes actually enforce authentication and authorization.128- CRUD operations exist for all models that need them.129- API versioning is consistent (if used).130- Rate limiting, pagination, and query parameter validation are present where needed.131132ROUTING / NAVIGATION CONSISTENCY:133- All routes referenced in code are defined (React Router, Next.js pages/app dir, GoRouter, Rails routes, Django urls, Express router, etc.).134- No orphaned views (defined but unreachable).135- Navigation arguments/params match what destination components expect.136- Deep links, dynamic routes, and catch-all routes resolve correctly.137- Middleware/guards on routes match security requirements.138139STATE MANAGEMENT CONSISTENCY:140- Every state container/store/provider referenced in the UI is defined.141- State updates propagate correctly (no stale state after mutations).142- Loading, error, and empty states are handled for all async data.143- State cleanup on unmount/dispose (no memory leaks, no orphan subscriptions).144- Optimistic updates are rolled back on failure (if used).145146BUSINESS LOGIC CONSISTENCY:147- Validation rules match between frontend and backend (never trust client-only validation).148- Business rules are enforced server-side, not just client-side.149- Edge cases: empty collections, null/undefined values, boundary conditions, concurrent access.150- Permission checks are consistent across features.151- Rate limiting, cooldowns, quotas, and caps are enforced where the domain requires them.152153ASSET & CONFIGURATION CONSISTENCY:154- Referenced assets (images, fonts, icons) exist at the expected paths.155- Environment variables used in code are defined in .env / config files.156- Feature flags and configuration values are consistent across environments.157- Third-party service configurations (API keys, webhook URLs, OAuth settings) are referenced correctly.158159============================================================160PHASE 2.5: PLATFORM-SPECIFIC DEEP CHECKS161============================================================162163Run ONLY the sections that match detected stacks. Skip all others.164165--- FIREBASE (if firebase.json or firestore.rules detected) ---166167FIRESTORE RULES vs DATA MODEL:168- Every collection the app reads/writes has a matching rule in firestore.rules.169- Rule conditions (auth checks, field validation, ownership) match the app's auth and data model.170- Flag overly permissive rules (allow read, write: if true) on non-public data.171- Flag missing rules for collections the app writes to.172173FIRESTORE INDEXES:174- Every compound query (where + orderBy, multiple where clauses) has a matching composite index in firestore.indexes.json.175176STORAGE RULES vs UPLOAD PATHS:177- File upload paths in code match what storage.rules allows.178179CLOUD FUNCTIONS vs APP:180- Firestore trigger functions reference collections the app actually writes to.181- Callable/HTTP functions are invoked by the client with correct parameters.182- Scheduled functions operate on existing collections.183184--- PRISMA / SQL DATABASE (if prisma/ or migrations/ detected) ---185186- Prisma schema matches migration state (no pending migrations that change the schema).187- Every model in the schema is used by at least one service/repository.188- Relations defined in the schema match the query patterns in code.189- Indexes cover the most common query patterns (check for missing indexes on foreign keys, filtered columns).190191--- GRAPHQL (if .graphql or schema files detected) ---192193- Every resolver has a matching schema definition.194- Every query/mutation used by the client exists in the schema.195- Input types match what resolvers expect.196- N+1 query patterns are addressed (DataLoader, batching).197198--- DOCKER / INFRASTRUCTURE (if docker-compose.yml detected) ---199200- Services reference images/builds that exist.201- Port mappings don't conflict.202- Environment variables in compose match what the app expects.203- Volume mounts point to valid paths.204- Health checks are defined for critical services.205206============================================================207PHASE 2.75: WIRING COMPLETENESS208============================================================209210This phase catches the most dangerous class of bugs: features that EXIST in one211layer but are never CONNECTED to another layer. These are invisible until production.212213ENDPOINT/FUNCTION WIRING (CRITICAL):214- List every backend endpoint, cloud function, or RPC handler.215- For each, search the client codebase for invocations.216- If a handler exists but is NEVER called from the client, flag CRITICAL.217- For each client-side security/validation check, verify matching server-side enforcement EXISTS and IS WIRED.218219BACKEND WRITE vs MODEL COMPLETENESS (WARNING):220- For every backend process that writes fields to the database (cloud functions, background jobs, admin scripts, event handlers), list those fields.221- For each field, verify the client model includes it in:222 a) Field/property declaration223 b) Constructor / initialization224 c) Deserialization (fromJSON, fromMap, decoder, serializer)225 d) Serialization (if client also writes it)226 e) Copy/clone method (if model has one)227- Missing fields = WARNING. The backend writes data the frontend never reads or displays.228229CONFIG PROPAGATION (WARNING):230- For admin-configurable settings (stored in database config tables/collections, environment variables, feature flags), verify they are actually read and used by the code that should respect them.231- Flag cases where configurable values are hardcoded instead of read from their config source.232233DEAD CODE DETECTION (INFO):234- Exported functions/classes/modules that are never imported anywhere.235- API routes that no client calls and no test covers.236- Database columns/fields that are written but never read (or vice versa).237238============================================================239PHASE 3: FUNCTIONAL VERIFICATION240============================================================241242Trace each major user flow end-to-end:2432441. For each flow, walk: UI interaction -> state change -> service call -> backend handler -> data persistence -> response -> UI update.2452. Check for broken chains: does every trigger have a handler? Does every handler return to the UI?2463. Verify error paths: what happens when things fail? Is there always a user-facing fallback?2474. Cross-feature interactions: do features that share data stay in sync?2485. Run tests if they exist (`npm test`, `pytest`, `go test ./...`, `flutter test`, `cargo test`, `bundle exec rspec`, `dotnet test`, etc.). Note which flows have test coverage and which do not.2496. Run build/compile to catch compile-time errors.250251============================================================252PHASE 4: SELF-HEALING FIX LOOP (max 3 iterations)253============================================================254255After completing the audit, if Critical or Warning issues were found:256257EACH ITERATION:2581. Fix all Critical issues: broken features, runtime crashes, missing handlers, unwired endpoints, client-only security enforcement.2592. Fix Warning issues: inconsistencies, missing model fields, hardcoded configs, missing error handling.2603. Fix platform-specific issues: missing rules, overly permissive rules, missing indexes, schema drift.2614. Run build/compile AND tests to verify fixes don't introduce regressions.2625. Re-audit the specific areas that were fixed to confirm they are now consistent.2636. If new issues surfaced from the fixes, add them to the next iteration.264265STOP when:266- Zero Critical issues remain.267- Zero Warning issues remain.268- Build and tests pass.269- Static analysis is clean.270271Do NOT auto-fix Info-level issues -- report them for the user.272273COMMIT STRATEGY:274- Group fixes by category: `fix(wiring): connect unused endpoints to client`275- One commit per fix category, not one mega-commit.276277============================================================278OUTPUT279============================================================280281## Stack Detected282- Languages: [e.g., TypeScript, Python, Dart]283- Frameworks: [e.g., Next.js 14, FastAPI, Flutter 3.x]284- Database: [e.g., PostgreSQL via Prisma, Firestore]285- Auth: [e.g., Firebase Auth, custom JWT]286- Infrastructure: [e.g., Docker, Vercel, AWS Lambda]287288## Domain Map289Brief summary of the application's features, architecture, and data flow.290291## Static Analysis292- [Stack 1]: [clean / N issues fixed]293- [Stack 2]: [clean / N issues fixed]294295## Issues Found & Resolved296297**Critical** -- Feature is broken or will crash at runtime298- What was broken299- Where (file:line)300- What was fixed301302**Warning** -- Inconsistency that may cause bugs303- What was inconsistent304- Where (file:line)305- What was fixed306307**Wiring** -- Endpoint, model field, or config gap308- What was disconnected309- Where (source file + consumer file)310- What was fixed311312**Platform-Specific** -- Rule, index, schema, or infrastructure mismatch313- What was mismatched314- Where (config file + code file)315- What was fixed316317**Info** -- Minor inconsistency or missing coverage (not auto-fixed)318- What's missing319- Where (file:line)320321## Coverage Summary322323| Feature | Model | Service | UI | API | Tests | Auth | Status |324|---------|-------|---------|-----|-----|-------|------|--------|325326## Recommendations327Top 3-5 highest-impact actions to improve consistency and reliability.328329NEXT STEPS:330331After the analysis:332- "Issues auto-fixed? Run `/qa` to verify everything still works end-to-end."333- "Architecture concerns? Run `/arch-review` for a deeper structural review."334- "Run `/iterate` to refine and polish further."335336337============================================================338SELF-EVOLUTION TELEMETRY339============================================================340341After producing output, record execution metadata for the /evolve pipeline.342343Check if a project memory directory exists:344- Look for the project path in `~/.claude/projects/`345- If found, append to `skill-telemetry.md` in that memory directory346347Entry format:348```349### /analyze — {{YYYY-MM-DD}}350- Outcome: {{SUCCESS | PARTIAL | FAILED}}351- Self-healed: {{yes — what was healed | no}}352- Iterations used: {{N}} / {{N max}}353- Bottleneck: {{phase that struggled or "none"}}354- Suggestion: {{one-line improvement idea for /evolve, or "none"}}355```356357Only log if the memory directory exists. Skip silently if not found.358Keep entries concise — /evolve will parse these for skill improvement signals.