Open-source spec · v1

Runtime context for agents using your web app.

sitemap.xml tells search engines how to crawl your site.
.sightmap/ teaches coding agents how your app works.

A sightmap is YAML checked into your repo. It maps views, components, and API routes to source files, so every agent gets the same context. Agents check it against the running app to keep it current.

The same date picker, as seen by a coding agent with and without a sightmap.
snapshot — without .sightmap/a11y
uid=1_0  RootWebArea "Book a flight"
uid=1_3  textbox "Departure date"
uid=1_8  button "Previous Month"
uid=1_9  button "Next Month"
uid=1_10 generic "July 2025"
uid=1_19 gridcell "Choose Tuesday, July 1st, 2025"
uid=1_20 gridcell "Choose Wednesday, July 2nd, 2025"
uid=1_21 gridcell "Choose Thursday, July 3rd, 2025"
…28 more gridcells…
snapshot — with .sightmap/a11y
[View: FlightSearch "/search"]
[Guide]
- DepartureDatePicker accepts typed YYYY-MM-DD
// skips opening the calendar
- Arrow keys navigate the grid; Enter selects; Esc closes
- Past dates render but are aria-disabled
- Range: 1st click = start, 2nd = end, 3rd resets

uid=1_0  RootWebArea "Book a flight"
uid=1_1  FlightSearchForm visible
uid=1_3    DepartureDatePicker [src: src/components/DatePicker.tsx] visible interactive
uid=1_4      date-input visible interactive
uid=1_8      prev-month visible interactive
uid=1_9      next-month visible interactive
uid=1_10     month-label "July 2025" visible
uid=1_19     day "Choose Tuesday, July 1st, 2025" visible interactive
…30 more days…

Every agent working on your app starts from scratch. It greps source, guesses which components render each screen, stuggles with runtime quirks, and moves on without leaving anything behind.

Agents record what they learn in a sightmap for the next agent to use.

Views, components, requests.

Views name your app's screens and routes. Components name the parts of each screen. Requests name the API routes your app calls. Define all three in YAML under .sightmap/. Sightmap-enabled tooling adds them to the agent's accessibility snapshot automatically.

01

Views

A view names a screen or route. When the current URL matches, the agent sees the view name and route at the top of its snapshot.

.sightmap/views.yamlyaml
version: 1

views:
  - name: FlightSearch
    route: /search
    description: Primary booking flow
    source: src/pages/FlightSearch.tsx

  - name: BookingConfirmation
    route: /bookings/*
    source: src/pages/Booking.tsx
what the agent seessnapshot
[View: FlightSearch "/search"]

uid=1_0 RootWebArea "Book a flight"
uid=1_1   main visible
uid=1_2     heading "Find your flight"
         

// on /bookings/42
[View: BookingConfirmation "/bookings/42"]
FieldTypeDescription
name requiredstringShown in the snapshot header
route requiredstringGlob pattern. * matches one segment, ** any depth. Most specific match wins; declaration order tiebreaks.
descriptionstringOptional, not surfaced at runtime — useful for humans reading the file
sourcestringRelative path to the source file
dependenciesstring[]Optional globs naming secondary files (hooks, stores, styles) whose changes should also trigger re-curation.
componentsComponent[]View-scoped components, merged additively with globals. Accepts { $ref: Name } to reference a globally-defined component.
requestsRequest[]View-scoped requests, merged additively with globals
02

Components

A component gives a CSS selector a semantic name. Agents see DepartureDatePicker instead of div.react-datepicker__day in every snapshot. Record runtime quirks in the memory field.

.sightmap/pages/flights.yamlyaml
version: 1

components:
  - name: DepartureDatePicker
    selector: '[data-picker="departure"]'
    source: src/components/DatePicker.tsx
    dependencies:
      - src/components/DatePicker.module.css
      - src/hooks/useDateRange.ts
    memory:
      - Accepts typed YYYY-MM-DD — skips the calendar
      - Arrow keys navigate; Enter selects; Esc closes
      - Past dates render but are aria-disabled
      - Range: 1st click = start, 2nd = end, 3rd resets
    children:
      - name: date-input
        selector: input
      - name: day-grid
        selector: '[role="grid"]'
      - name: day
        selector: '[role="gridcell"]'
what the agent seessnapshot
uid=1_3 DepartureDatePicker [src: src/components/DatePicker.tsx]
         visible interactive
uid=1_4   date-input visible interactive
uid=1_11  day-grid visible
uid=1_19    day "Choose Tuesday, July 1st, 2025"
           visible interactive
uid=1_20    day "Choose Wednesday, July 2nd, 2025"
           visible interactive
             
Selectors can be a list. Pass a YAML array when more than one CSS selector can identify a component, such as a class name or an ARIA role. Sightmap tries them in order; the first match wins.
Reference shared components by name. Inside a components: array, { $ref: SiteHeader } inserts a deep copy of a root-level component from any sightmap file. Define a header, footer, or chat widget once, then reference it from every view where it should appear. If the component is absent at runtime, drift checks can report it as attested but missing.
FieldTypeDescription
name requiredstringReplaces the generic a11y role in snapshots
selector requiredstring | string[]CSS selector, or a list of alternatives
sourcestringPath to the source file — rendered inline as [src: …]
dependenciesstring[]Optional globs naming supplementary files (styles, helpers) whose changes should trigger re-curation of this component. Curation-time metadata; not surfaced at runtime.
descriptionstringOptional, not surfaced at runtime
memorystring[]Notes that appear in the [Guide] section of every matched snapshot
childrenComponent[]Nested components; their selectors are scoped to the parent's subtree
03

Requests

Requests give API endpoints semantic names and optional request and response schemas. Sightmap-enabled clients show the name, source file, description, and expected fields alongside each matching request.

.sightmap/requests.yamlyaml
version: 1

requests:
  - name: SearchFlights
    route: /api/flights/search
    method: POST
    description: Search for available flights
    source: src/api/flights.ts
    request:
      fields:
        - name: origin
          type: string
          description: Origin airport code
        - name: destination
          type: string
        - name: date
          type: string
          description: YYYY-MM-DD
    response:
      fields:
        - name: flights
          type: array
        - name: total
          type: number
what the agent seesnetwork
# network list
reqid=1 SearchFlights POST /api/flights/search [200]
reqid=2 GET /assets/logo.png [200]

# network detail → reqid=1
### Sightmap: SearchFlights
Search for available flights
Source: src/api/flights.ts
Expected request fields:
- origin (string) — Origin airport code
- destination (string)
- date (string) — YYYY-MM-DD
Expected response fields:
- flights (array)
- total (number)
FieldTypeDescription
name requiredstringShown in network list and detail output
route requiredstringGlob pattern. Express-style :param segments convert to *.
methodstringOptional HTTP method filter (GET, POST, …)
descriptionstringWhat the endpoint does
sourcestringPath to the source file
requestobjectExpected payload: fields[] (name, type, description)
responseobjectExpected response: same shape as request
headersstring[]Notable header names to highlight in the detail view

Organize it your way.

Sightmap recursively loads and merges every *.yaml and *.yml file under .sightmap/. Split definitions by feature or view, or keep everything in one file.

your-project/tree
.sightmap/
├── components.yaml        # global NavBar, Footer
├── requests.yaml          # API endpoints
└── pages/
    ├── flights.yaml       # FlightSearch view + its components
    └── booking.yaml       # BookingConfirmation view

What agents learn, checked in.

Sightmap names views, components, and API routes. Agents add memory notes for quirks, invariants, and shortcuts that source code does not explain. Sightmap-enabled tooling puts those notes in a [Guide] at the top of each snapshot. The next agent starts with the context the last one recorded.

.sightmap/pages/flights.yamlyaml
version: 1

components:
  - name: DepartureDatePicker
    selector: '[data-picker="departure"]'
    source: src/components/DatePicker.tsx
    memory:
      - Accepts typed YYYY-MM-DD —
        skips opening the calendar entirely
      - Arrow keys navigate the grid;
        Enter selects; Esc closes
      - Past dates render but are aria-disabled —
        check before clicking
      - Range: 1st click = start, 2nd = end,
        3rd resets to new start
what the agent seessnapshot
[View: FlightSearch "/search"]
[Guide]
- DepartureDatePicker accepts typed YYYY-MM-DD
  // skips opening the calendar entirely
- Arrow keys navigate the grid;
  Enter selects; Esc closes
- Past dates render but are aria-disabled
- Range: 1st click = start, 2nd = end,
  3rd resets to new start

uid=1_0 RootWebArea "Book a flight"
uid=1_3   DepartureDatePicker visible interactive
         
01
One entry, shared across agents. Claude Code, Cursor, Codex, and other agents using Sightmap-enabled tooling read the same YAML entry.
02
Grows with each run. Each run can add notes for the next agent. App-specific knowledge stays in the repo after the session ends.
03
Reviewed like code. Memory entries are ordinary YAML. Review them in diffs and PRs, edit them when behavior changes, or roll them back when they are wrong.

Hand your agent the map.

Install the CLI, start a browser session, and have your agent map the running app into .sightmap/. Review and commit the YAML so every agent using Sightmap-enabled tooling starts with the same app context.

01

Install the CLI and skills

The sightmap CLI ships through npm as a prebuilt native binary, so you do not need Go. sightmap skills install adds the agent playbooks to your harness. .sightmap/ is plain YAML, with no framework adapter or build step.

your project rootshell
$ npm install -g @sightmap/sightmap
$ sightmap skills install
installed 2 sightmap skill(s) → ~/.agents/skills
  sightmap-authoring
  sightmap-browser
02

Start a session and iterate

browser start launches Chrome and a corpus server that reloads YAML changes. iterate snapshots a page and scores each interactive node: named (T1), inside a named component (T2), or orphaned (T3). Repeat until there are no orphans.

your project rootshell
$ sightmap browser start
 ready  port=7891  cdp=7892  pid=52441  tab=A1B2C3D4
$ sightmap iterate 'http://localhost:3000/'
[View: Home "http://localhost:3000/"]
[Coverage] (visible only)
87 interactive · 61 direct T1 (70%) · 21 scoped T2 (24%) · 5 orphaned T3 ✗

Run sightmap sel-probe '[data-testid="product-pod"]' to verify a selector before adding it.

03

Let the agent curate agent-driven

Point your agent at the app. The bundled sightmap-authoring skill walks routes, names orphaned components, and writes .sightmap/. Review the diff before committing it. The skill checks each definition against the running app before adding it.

to your agentprompt
> Bootstrap a sightmap for this app: start a
> session, iterate the main routes, and name
> components until coverage is clean.

Run sightmap validate and sightmap lint in CI. When the app changes, rerun iterate on the affected pages.