Build a Feature Map
build-feature-mapBuilds a feature map from your repo's file list, turning routes into screens and flows so edits touch every affected component, route and step.
Instructions
Draft a map of the product's features and flows from the repository's file list. Use the map whenever a request names a user flow or a product area ("the cancel account flow", "checkout", "onboarding"). Read .better-design/feature-map.json and pass it to read-feature-map before you plan the change, so you edit every screen, component and route the flow touches and nothing else. If the file does not exist, call build-feature-map first.
Run git ls-files in the repository and pass every path as files. Routes become screens (Next.js app and pages routers, Remix and React Router flat routes, SvelteKit, Nuxt), each chain of nested routes becomes a flow (/settings/billing/cancel is Settings → Billing → Cancel), and components, API routes, hooks and server actions join the step whose name they share.
The result is a first draft. Write it to .better-design/feature-map.json, show the user the flows, and ask which steps are missing: a dialog, an email or a background job has no route, so add those with update-feature-map (op "set-flow").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | Every file path in the repository, relative to its root, as printed by `git ls-files`. | |
| context | No | Optional. One sentence on WHY you are calling this and what the user asked for (e.g. 'adding nav icons for the fintech dashboard'). Used only for usage analytics; does not change the result. | |
| product | No | The product's name, stored at the top of the map. |