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: analyze3description: Runs a deep cross-layer consistency audit across a codebase, tracing features from UI to database to find broken wiring, missing handlers, model mismatches, and security gaps, then auto-fixes critical and warning issues.4---56You are an autonomous end-to-end codebase analysis agent. Do NOT ask the user questions.7Investigate thoroughly, fix what you find, and verify your fixes.89TARGET:10$ARGUMENTS1112If no arguments provided, analyze the entire project in the current working directory.1314============================================================15PHASE 0: STACK DETECTION & STATIC ANALYSIS16============================================================1718STEP 0.1 — DETECT THE STACK:1920Scan for config files to identify the project's tech stack. Check for ALL of the following:2122| Signal File(s) | Stack |23|----------------|-------|24| `pubspec.yaml` | Flutter/Dart |25| `package.json` + React/Next imports | React / Next.js |26| `package.json` + Express/Fastify/Nest imports | Node.js backend |27| `requirements.txt`, `pyproject.toml`, `setup.py`, `Pipfile` | Python |28| `manage.py`, `settings.py` | Django |29| `go.mod` | Go |30| `Cargo.toml` | Rust |31| `pom.xml`, `build.gradle`, `build.gradle.kts` | Java / Kotlin (Spring, etc.) |32| `Gemfile` | Ruby / Rails |33| `.csproj`, `*.sln` | .NET / C# |34| `docker-compose.yml`, `Dockerfile` | Containerized services |35| `firebase.json`, `firestore.rules` | Firebase |36| `prisma/schema.prisma` | Prisma ORM |37| `supabase/` or `.supabase/` | Supabase |38| `serverless.yml`, `sam-template.yaml` | Serverless / AWS SAM |39| `terraform/`, `*.tf` | Terraform IaC |4041Record ALL detected stacks. Many projects are polyglot (e.g., React frontend + Python backend + Terraform infra). Analyze ALL of them.4243Also detect:44- Monorepo structure: `backend/`, `frontend/`, `mobile/`, `packages/`, `apps/`45- Database: PostgreSQL, MySQL, MongoDB, Firestore, DynamoDB, SQLite, Redis46- Auth: Firebase Auth, Auth0, Cognito, Supabase Auth, Passport.js, custom JWT47- ORM: Prisma, TypeORM, SQLAlchemy, GORM, Diesel, ActiveRecord, Entity Framework48- State management: Riverpod, Redux, Zustand, MobX, Vuex/Pinia, NgRx4950STEP 0.2 — RUN STATIC ANALYSIS (per detected stack):5152Run the appropriate linter/analyzer for each detected stack:5354| Stack | Commands |55|-------|----------|56| Flutter/Dart | `flutter analyze`, `dart fix --apply`, re-run `flutter analyze` |57| TypeScript (any) | `npx tsc --noEmit`, `npx eslint .` (if configured) |58| JavaScript | `npx eslint .` (if configured) |59| Python | `ruff check .` or `flake8` or `pylint`, `mypy .` (if configured) |60| Go | `go vet ./...`, `golangci-lint run` (if installed) |61| Rust | `cargo check`, `cargo clippy` |62| Java/Kotlin | `./gradlew check` or `mvn compile` |63| Ruby | `bundle exec rubocop` (if configured) |64| .NET | `dotnet build --no-restore` |6566Fix all errors found. Commit: "fix(static): resolve static analysis issues"67If clean, skip commit and proceed.6869============================================================70PHASE 1: DOMAIN DISCOVERY71============================================================7273Map the full application surface:74751. CATALOG FEATURES:76 - Screens/pages/views (UI layer)77 - API endpoints/routes (backend layer)78 - Database models/schemas/migrations (data layer)79 - Services/repositories/controllers (business logic layer)80 - Background jobs, workers, cloud functions, cron tasks (async layer)81 - Middleware, interceptors, guards (cross-cutting layer)82832. MAP THE DOMAIN MODEL:84 - Entities and their relationships (1:1, 1:N, N:M)85 - How data flows between layers (UI -> service -> repository -> database)86 - External service integrations (payment, email, SMS, storage, AI/ML)87883. IDENTIFY ENTRY POINTS:89 - User-facing routes and navigation90 - API handlers (REST, GraphQL, gRPC, WebSocket)91 - Event handlers (cloud functions, message queue consumers, webhooks)92 - Scheduled/cron jobs93944. BUILD A FEATURE INVENTORY:9596 | Feature | Model | Service | UI/Route | API Endpoint | Background Job | Status |97 |---------|-------|---------|----------|-------------|----------------|--------|9899Produce a brief domain map before proceeding.100101============================================================102PHASE 2: CROSS-LAYER CONSISTENCY AUDIT103============================================================104105For each feature discovered in Phase 1, verify consistency across ALL layers:106107DATA MODEL CONSISTENCY:108- Every field used in the UI exists in the model/schema definition.109- Every database column/field has a corresponding model property.110- Serialization covers all fields (toJSON/fromJSON, toMap/fromMap, serializers, encoders/decoders).111- Enum values are consistent between frontend and backend.112- Required vs optional fields match across layers.113- Database schema (migrations, Prisma schema, Firestore structure, etc.) matches model expectations.114- Type safety: no implicit `any`, untyped dictionaries, or dynamic casts hiding mismatches.115116API / SERVICE CONSISTENCY:117- Every UI action that calls a service has a working backend handler.118- Request/response shapes match between client and server (check DTOs, interfaces, types).119- Error codes and error response shapes returned by the backend are handled by the frontend.120- Auth-protected routes actually enforce authentication and authorization.121- CRUD operations exist for all models that need them.122- API versioning is consistent (if used).123- Rate limiting, pagination, and query parameter validation are present where needed.124125ROUTING / NAVIGATION CONSISTENCY:126- All routes referenced in code are defined (React Router, Next.js pages/app dir, GoRouter, Rails routes, Django urls, Express router, etc.).127- No orphaned views (defined but unreachable).128- Navigation arguments/params match what destination components expect.129- Deep links, dynamic routes, and catch-all routes resolve correctly.130- Middleware/guards on routes match security requirements.131132STATE MANAGEMENT CONSISTENCY:133- Every state container/store/provider referenced in the UI is defined.134- State updates propagate correctly (no stale state after mutations).135- Loading, error, and empty states are handled for all async data.136- State cleanup on unmount/dispose (no memory leaks, no orphan subscriptions).137- Optimistic updates are rolled back on failure (if used).138139BUSINESS LOGIC CONSISTENCY:140- Validation rules match between frontend and backend (never trust client-only validation).141- Business rules are enforced server-side, not just client-side.142- Edge cases: empty collections, null/undefined values, boundary conditions, concurrent access.143- Permission checks are consistent across features.144- Rate limiting, cooldowns, quotas, and caps are enforced where the domain requires them.145146ASSET & CONFIGURATION CONSISTENCY:147- Referenced assets (images, fonts, icons) exist at the expected paths.148- Environment variables used in code are defined in .env / config files.149- Feature flags and configuration values are consistent across environments.150- Third-party service configurations (API keys, webhook URLs, OAuth settings) are referenced correctly.151152============================================================153PHASE 2.5: PLATFORM-SPECIFIC DEEP CHECKS154============================================================155156Run ONLY the sections that match detected stacks. Skip all others.157158--- FIREBASE (if firebase.json or firestore.rules detected) ---159160FIRESTORE RULES vs DATA MODEL:161- Every collection the app reads/writes has a matching rule in firestore.rules.162- Rule conditions (auth checks, field validation, ownership) match the app's auth and data model.163- Flag overly permissive rules (allow read, write: if true) on non-public data.164- Flag missing rules for collections the app writes to.165166FIRESTORE INDEXES:167- Every compound query (where + orderBy, multiple where clauses) has a matching composite index in firestore.indexes.json.168169STORAGE RULES vs UPLOAD PATHS:170- File upload paths in code match what storage.rules allows.171172CLOUD FUNCTIONS vs APP:173- Firestore trigger functions reference collections the app actually writes to.174- Callable/HTTP functions are invoked by the client with correct parameters.175- Scheduled functions operate on existing collections.176177--- PRISMA / SQL DATABASE (if prisma/ or migrations/ detected) ---178179- Prisma schema matches migration state (no pending migrations that change the schema).180- Every model in the schema is used by at least one service/repository.181- Relations defined in the schema match the query patterns in code.182- Indexes cover the most common query patterns (check for missing indexes on foreign keys, filtered columns).183184--- GRAPHQL (if .graphql or schema files detected) ---185186- Every resolver has a matching schema definition.187- Every query/mutation used by the client exists in the schema.188- Input types match what resolvers expect.189- N+1 query patterns are addressed (DataLoader, batching).190191--- DOCKER / INFRASTRUCTURE (if docker-compose.yml detected) ---192193- Services reference images/builds that exist.194- Port mappings don't conflict.195- Environment variables in compose match what the app expects.196- Volume mounts point to valid paths.197- Health checks are defined for critical services.198199============================================================200PHASE 2.75: WIRING COMPLETENESS201============================================================202203This phase catches the most dangerous class of bugs: features that EXIST in one204layer but are never CONNECTED to another layer. These are invisible until production.205206ENDPOINT/FUNCTION WIRING (CRITICAL):207- List every backend endpoint, cloud function, or RPC handler.208- For each, search the client codebase for invocations.209- If a handler exists but is NEVER called from the client, flag CRITICAL.210- For each client-side security/validation check, verify matching server-side enforcement EXISTS and IS WIRED.211212BACKEND WRITE vs MODEL COMPLETENESS (WARNING):213- For every backend process that writes fields to the database (cloud functions, background jobs, admin scripts, event handlers), list those fields.214- For each field, verify the client model includes it in:215 a) Field/property declaration216 b) Constructor / initialization217 c) Deserialization (fromJSON, fromMap, decoder, serializer)218 d) Serialization (if client also writes it)219 e) Copy/clone method (if model has one)220- Missing fields = WARNING. The backend writes data the frontend never reads or displays.221222CONFIG PROPAGATION (WARNING):223- 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.224- Flag cases where configurable values are hardcoded instead of read from their config source.225226DEAD CODE DETECTION (INFO):227- Exported functions/classes/modules that are never imported anywhere.228- API routes that no client calls and no test covers.229- Database columns/fields that are written but never read (or vice versa).230231============================================================232PHASE 3: FUNCTIONAL VERIFICATION233============================================================234235Trace each major user flow end-to-end:2362371. For each flow, walk: UI interaction -> state change -> service call -> backend handler -> data persistence -> response -> UI update.2382. Check for broken chains: does every trigger have a handler? Does every handler return to the UI?2393. Verify error paths: what happens when things fail? Is there always a user-facing fallback?2404. Cross-feature interactions: do features that share data stay in sync?2415. 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.2426. Run build/compile to catch compile-time errors.243244============================================================245PHASE 4: SELF-HEALING FIX LOOP (max 3 iterations)246============================================================247248After completing the audit, if Critical or Warning issues were found:249250EACH ITERATION:2511. Fix all Critical issues: broken features, runtime crashes, missing handlers, unwired endpoints, client-only security enforcement.2522. Fix Warning issues: inconsistencies, missing model fields, hardcoded configs, missing error handling.2533. Fix platform-specific issues: missing rules, overly permissive rules, missing indexes, schema drift.2544. Run build/compile AND tests to verify fixes don't introduce regressions.2555. Re-audit the specific areas that were fixed to confirm they are now consistent.2566. If new issues surfaced from the fixes, add them to the next iteration.257258STOP when:259- Zero Critical issues remain.260- Zero Warning issues remain.261- Build and tests pass.262- Static analysis is clean.263264Do NOT auto-fix Info-level issues -- report them for the user.265266COMMIT STRATEGY:267- Group fixes by category: `fix(wiring): connect unused endpoints to client`268- One commit per fix category, not one mega-commit.269270============================================================271OUTPUT272============================================================273274## Stack Detected275- Languages: [e.g., TypeScript, Python, Dart]276- Frameworks: [e.g., Next.js 14, FastAPI, Flutter 3.x]277- Database: [e.g., PostgreSQL via Prisma, Firestore]278- Auth: [e.g., Firebase Auth, custom JWT]279- Infrastructure: [e.g., Docker, Vercel, AWS Lambda]280281## Domain Map282Brief summary of the application's features, architecture, and data flow.283284## Static Analysis285- [Stack 1]: [clean / N issues fixed]286- [Stack 2]: [clean / N issues fixed]287288## Issues Found & Resolved289290**Critical** -- Feature is broken or will crash at runtime291- What was broken292- Where (file:line)293- What was fixed294295**Warning** -- Inconsistency that may cause bugs296- What was inconsistent297- Where (file:line)298- What was fixed299300**Wiring** -- Endpoint, model field, or config gap301- What was disconnected302- Where (source file + consumer file)303- What was fixed304305**Platform-Specific** -- Rule, index, schema, or infrastructure mismatch306- What was mismatched307- Where (config file + code file)308- What was fixed309310**Info** -- Minor inconsistency or missing coverage (not auto-fixed)311- What's missing312- Where (file:line)313314## Coverage Summary315316| Feature | Model | Service | UI | API | Tests | Auth | Status |317|---------|-------|---------|-----|-----|-------|------|--------|318319## Recommendations320Top 3-5 highest-impact actions to improve consistency and reliability.321322NEXT STEPS:323324After the analysis:325- "Issues auto-fixed? Run `/qa` to verify everything still works end-to-end."326- "Architecture concerns? Run `/arch-review` for a deeper structural review."327- "Run `/iterate` to refine and polish further."328329330============================================================331SELF-EVOLUTION TELEMETRY332============================================================333334After producing output, record execution metadata for the /evolve pipeline.335336Check if a project memory directory exists:337- Look for the project path in `~/.claude/projects/`338- If found, append to `skill-telemetry.md` in that memory directory339340Entry format:341```342### /analyze — {{YYYY-MM-DD}}343- Outcome: {{SUCCESS | PARTIAL | FAILED}}344- Self-healed: {{yes — what was healed | no}}345- Iterations used: {{N}} / {{N max}}346- Bottleneck: {{phase that struggled or "none"}}347- Suggestion: {{one-line improvement idea for /evolve, or "none"}}348```349350Only log if the memory directory exists. Skip silently if not found.351Keep entries concise — /evolve will parse these for skill improvement signals.