Skip to main content
Glama
marvkr

Better Design

Build a Feature Map

build-feature-map
Read-onlyIdempotent

Builds 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

NameRequiredDescriptionDefault
filesYesEvery file path in the repository, relative to its root, as printed by `git ls-files`.
contextNoOptional. 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.
productNoThe product's name, stored at the top of the map.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds real behavior: the output is only a 'first draft', it is deterministic from the file list, and it structurally cannot see dialogs, emails or background jobs because those have no route. It also assigns the persistence step to the caller rather than the tool, consistent with readOnlyHint=true.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and the when-to-use trigger are front-loaded in the first sentence, and the middle paragraph explains the derivation compactly. The 'If the file does not exist, call build-feature-map first' clause inside build-feature-map's own description is slightly self-referential clutter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description carries the return-value burden, and it does: it explains the map's structure (screens, flows, steps), tells the agent to write it to .better-design/feature-map.json, and pairs the draft with a user-confirmation step. Nothing needed to call it correctly is absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so `files`, `context` and `product` are already documented; the baseline of 3 applies. The description reinforces how to populate `files` ('run `git ls-files` and pass every path') but says nothing about `context` or `product`, so it adds little beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and output: 'Draft a map of the product's features and flows from the repository's file list.' It also enumerates the derivation rules (routes → screens, nested route chains → flows, shared-name components → steps), which lets an agent distinguish it from read-feature-map and update-feature-map without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states exactly when to reach for this tool ('whenever a request names a user flow or a product area') with three concrete examples, gives the prerequisite ('Read .better-design/feature-map.json and pass it to read-feature-map'), and a fallback ('If the file does not exist, call build-feature-map first'). It also routes follow-up work to update-feature-map with the specific op to use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.