> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentictrust.com/llms.txt
> Use this file to discover all available pages before exploring further.

> Explores a web application's codebase, documentation, or live site to discover all navigable routes and produce a routes.csv file for Agentic Trust navigation. Use when the user asks to build, generate, create, or update a routes.csv, route map, sitemap, or navigation inventory for a client application.

# Build routes skill

# Build routes.csv

Generate a `routes.csv` for your application by exploring its documentation,
source code, or live UI. The CSV is uploaded to Agentic Trust's Navigation feature
so the agent can direct users to the right pages.

## Output format

```
name,path,description,parameters
dashboard_home,/dashboard,Main dashboard overview,
user_detail,/users/:userId,Individual user profile,userId:string
```

| Column        | Rules                                                                          |
| ------------- | ------------------------------------------------------------------------------ |
| `name`        | snake\_case, unique, descriptive (e.g. `settings_general`, `test_case_detail`) |
| `path`        | URL path with `:param` placeholders for dynamic segments                       |
| `description` | One-line plain-English summary of what the page shows or does                  |
| `parameters`  | Semi-colon-separated `paramName:type` pairs; empty if no dynamic segments      |

* Header row is always `name,path,description,parameters`
* No quoting unless a field contains a comma
* No trailing blank line
* Group related routes together (e.g. all dashboard\_\* routes, then all settings\_\*)

## How to use this skill

Install this file as an agent skill in your AI coding editor:

* **Cursor**: Save to `.cursor/skills/build-routes/SKILL.md` in your project
* **Codex**: Save to `.codex/skills/build-routes/SKILL.md`
* **Generic**: Place in `.agents/skills/build-routes/SKILL.md`

Then ask your AI agent: "Build a routes.csv for my app" and it will follow the
workflow below to discover and document all your routes.

## Discovery workflow

### Step 1 — Gather route sources (use all that apply)

#### A. Source code

Search the project for route definitions:

* **Next.js / App Router**: `app/**/page.tsx` files — each directory maps to a route
* **React Router**: search for `<Route path=`, `createBrowserRouter`, route config arrays
* **Vue Router**: search for `routes:` arrays in router config files
* **Angular**: search for `RouterModule.forRoot`, `Routes` type arrays
* **Generic**: search for URL path patterns across the codebase

#### B. Documentation

Look for any docs, README, or sitemap files that reference page URLs.

#### C. Live browser exploration

If the app is running:

1. Navigate to the app's root
2. Take a snapshot and identify navigation elements (sidebar, navbar, tabs, menus)
3. Click through each navigation item, recording the resulting URL path
4. Look for sub-navigation, tabs, and settings pages
5. Record dynamic-segment patterns (IDs in URLs become `:paramName` placeholders)

#### D. Existing routes.csv

If a `routes.csv` already exists, read it as a baseline. Preserve existing entries
unless they are clearly stale, and append newly discovered routes.

### Step 2 — Deduplicate and organize

1. Merge routes from all sources
2. Remove exact duplicates (same path)
3. For near-duplicates (same page, slightly different paths), keep the canonical one
4. Sort routes into logical groups:
   * Top-level / dashboard pages first
   * Feature area pages next
   * Settings / admin pages last
5. Assign a unique `name` to each route following snake\_case naming

### Step 3 — Write the CSV

Write the final CSV to `routes.csv` in the project root (or the location the user specifies).

### Step 4 — Validate

After writing, re-read the file and verify:

* [ ] Header is exactly `name,path,description,parameters`
* [ ] Every `name` is unique
* [ ] Every `path` starts with `/`
* [ ] Dynamic segments use `:paramName` syntax
* [ ] Parameters column matches the `:param` placeholders in the path
* [ ] No blank lines in the middle of the file

Report the total route count and any issues found.

## Tips

* Prefer breadth over depth — capture every navigable page, including sub-tabs and
  modals that have their own URL.
* When in doubt about a parameter type, default to `string`.
* If the app uses hash routing (`/#/path`), strip the `#` and record just the path portion.
* For apps with role-gated pages, include all pages regardless of role; add a note in
  the description (e.g. "Admin-only user management").
