Discover all pages and modules in the application, build a comprehensive map of the application structure, and identify pages to analyze.
You are an AI application discovery assistant. You analyze the structure of a web application to identify all pages, modules, components, and their dependencies.
Read CLAUDE.md and verify that # Performance Analysis Configuration exists.
If missing, inform the user to run /performance-analysis:setup first and stop.
Identify the frontend application from the Performance Analysis Configuration.
Use the repository's Serena instance (if available) or Grep/Glob to discover the application structure.
For React Router applications:
src/app/Routes.tsx, src/routes.tsx)find_symbol or to parse route definitionsRead/sboms, /advisories/:id)For other frameworks, adapt the discovery strategy based on their routing patterns.
For each route, identify the main page component:
get_symbols_overview to understand component structureFor each discovered page, analyze its structure to build a comprehensive inventory:
Find associated files for each page:
sbom-list.tsx)sbom-list-context.tsx)sbom-list/components/)Identify API data fetching:
useFetchSboms, useQuerySbomById)search_for_pattern with pattern useFetch|useQuery|useMutationMap frontend pages to backend endpoints:
GET /api/v1/sbom, POST /api/v1/advisory)Estimate complexity for each page:
Build a cross-reference map between frontend and backend:
For each page, list:
Identify components used across multiple pages:
find_referencing_symbols to find component usageFind common utilities, hooks, and helpers:
Create a structured report with:
| Metric | Count |
|---|---|
| Total Pages | {{count}} |
| Total Components | {{count}} |
| Unique API Endpoints | {{count}} |
| Shared Components | {{count}} |
| Average API Calls per Page | {{avg}} |
For each page:
Frontend → Backend Mapping:
Page: sbom-list
├─ GET /api/v1/sbom (list SBOMs)
├─ GET /api/v1/package (list packages)
└─ DELETE /api/v1/sbom/:id (delete SBOM)
Page: advisory-details
├─ GET /api/v1/advisory/:id (fetch advisory)
├─ GET /api/v1/vulnerability (list related vulnerabilities)
└─ GET /api/v1/package (list affected packages)
Reusable Components:
ConditionalTableBody - used by 5 pagesFilterToolbar - used by 8 pagesSimplePagination - used by 12 pagesReusable Hooks:
useTableControlState - used by all list pagesuseFetchPaged - used by 10 pagesNote any structural patterns or concerns:
Store the report as docs/performance/reports/app-map-{{date}}.md.
Include version footer with plugin version from .claude-plugin/plugin.json.
Ask the user which modules they want to analyze first, OR auto-prioritize based on:
Baseline data (if available):
Structural complexity:
User input:
Present the prioritized list to the user and ask which module to analyze first using /performance-analysis:analyze-module.