Skip to content

Add @sightmap/next: seed, build, run-plan, and the SightkickTools component for Next.js - #1

Merged
chiplay merged 1 commit into
mainfrom
feat/next-package
Sep 5, 2026
Merged

Add @sightmap/next: seed, build, run-plan, and the SightkickTools component for Next.js#1
chiplay merged 1 commit into
mainfrom
feat/next-package

Conversation

@chiplay

@chiplay chiplay commented Sep 5, 2026

Copy link
Copy Markdown
Member

Stack 1/3 — the package. #2 adds the example app, #3 the write-up.

What this changes

Adds packages/next (@sightmap/next): three CLI commands and one React component, no runtime dependencies beyond next and react. Root npm test now runs its tests.

flowchart LR
  app["app/**/page.tsx"] -- "sightmap-next seed<br/>(one-shot, never overwrites)" --> corpus[".sightmap/*.yaml<br/>stability: stub"]
  corpus -- "curate against next dev<br/>(sightmap-authoring skill)" --> corpus2[".sightmap/ curated"]
  corpus2 --> build["sightmap-next build"]
  kick[".sightkick/tools.yaml"] --> build
  build --> wk["public/.well-known/<br/>sightmap.json · sightkick.json"]
  build --> rt["public/sightkick-runtime.js"]
  build --> init["webmcp.init.js"]
  wk & rt --> comp["&lt;SightkickTools/&gt;<br/>in app/layout.tsx"]
  comp --> mc["document.modelContext<br/>(WebMCP)"]
  init -- "agent-browser --init-script" --> mc
  plans["plans/*.plan.json"] -- "sightmap-next run-plan" --> ab["agent-browser webmcp invoke"] --> mc
Loading
Command / export Does
sightmap-next seed Walks the App Router (and Pages Router). Route groups vanish, [id]:id, [...slug]**; slots, intercepts, and _private folders are skipped. One feature file per top-level route with route:, source:, the layout chain as dependencies:, stability: stub. app/api route handlers become requests: seeds. Existing files are never touched.
sightmap-next build Runs sightmap export and sightkick build / sightkick runtime into public/, and concatenates runtime + IR into webmcp.init.js. Meant for "prebuild".
<SightkickTools ir={…}/> Registers the compiled tools on document.modelContext on every page; re-registers on client-side navigation; reuses a runtime an init script already booted.
sightmap-next run-plan Replays a stored plan (Sightkick's plan format and expectation vocabulary) through agent-browser webmcp invoke --json. --stamp records the feature-file and IR hashes; a later run refuses when either moved.

What seed writes for app/tasks/[id]/page.tsx under app/tasks/layout.tsx:

version: 1

views:
  - name: TasksById
    route: '/tasks/:id'
    stability: stub
    source: 'app/tasks/[id]/page.tsx'
    dependencies:
      - app/layout.tsx
      - app/tasks/layout.tsx
    description: 'Seeded from the Next.js router by sightmap-next. Curate against the running app, then drop stability: stub.'
    components: []

Why

app/sitemap.ts is the right analogy for the served half only: a deployed app describing itself at a well-known URL. It is the wrong analogy for the corpus, which the spec's authoring conventions make a curated authority with no build-time generator. So the derivable part (the route table) is a one-shot seed, the rest stays with the authoring loop, and the build step only publishes what is already in the repo.

run-plan exists because agent-browser 0.36.0 (2026-09-01) discovers and invokes WebMCP tools through Chrome's CDP WebMCP domain, which is the surface the Sightkick runtime registers on. That makes agent-browser a drop-in executor for Sightkick plans with no model in the loop at replay time.

Checklist

  • Commits are signed off (git commit -s)
  • npm test passes (5 tests); seeded YAML passes sightmap validate

🤖 Generated with Claude Code

https://claude.ai/code/session_013FZAbWuynKT4NqXFMwtoBA


Generated by Claude Code

…Next.js

- sightmap-next seed: one-shot scaffold of .sightmap/ view stubs from the App
  Router or Pages Router (route, page source, layout chain as dependencies,
  api route handlers as requests). Never overwrites a file.
- sightmap-next build: writes public/.well-known/{sightmap,sightkick}.json,
  public/sightkick-runtime.js, and webmcp.init.js for agent-browser
  --init-script, using the sightmap and sightkick CLIs.
- <SightkickTools/>: boots the Sightkick runtime from the root layout so each
  page registers its view-scoped tools on document.modelContext.
- sightmap-next run-plan: replays stored plans through agent-browser webmcp
  invoke and refuses to run when the feature file or compiled IR drifted.

Tests: node --test over the seeder against a fixture App Router tree.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FZAbWuynKT4NqXFMwtoBA
Signed-off-by: Claude <noreply@anthropic.com>
@chiplay chiplay changed the title Add @sightmap/next: seed, build, run-plan, and <SightkickTools/> for Next.js Add @sightmap/next: seed, build, run-plan, and the SightkickTools component for Next.js Sep 5, 2026
@chiplay
chiplay merged commit 46319cb into main Sep 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants