# Inspect the app

Read only. Run these from the app's root and note what you find.

```bash
git status --short
cat package.json                      # next, react, vite, scripts (dev, build, lint, typecheck)
ls app src/app pages src/pages 2>/dev/null
cat components.json 2>/dev/null       # aliases.components, aliases.lib, tailwind.css
cat tsconfig.json                     # compilerOptions.paths["@/*"]
grep -rln -- "--background\|--foreground\|@theme" --include=*.css . | grep -v node_modules
grep -rn "darkMode\|data-theme\|classList.*dark" --include=*.ts --include=*.tsx --include=*.js --include=*.css . | grep -v node_modules | head
grep -rliE "approv|confirm.*(tool|action)|tool.?call|plan.?step|agent" --include=*.tsx --include=*.ts app src components lib 2>/dev/null | head -20
grep -rn "getServerSession\|auth()\|currentUser\|getSession\|cookies()" --include=*.ts --include=*.tsx . | grep -v node_modules | head
```

## The note

Show the person this, filled in, before you change anything:

```text
Framework:        Next.js 16, App Router, no src/ (React 19)
shadcn:           components.json present; components → @/components, lib → @/lib
Tokens:           app/globals.css, CSS variables; dark mode by .dark class
Existing parts:   none for approval, plan or trace / <list what you found>
Server and auth:  route handlers in app/api; session from <how> / none yet
Git:              clean

Plan:
  add     components/agent-workflow.tsx, components/review-receipt-core.tsx,
          components/{plan-preview,approval-gate,progress-trace}*.tsx, components/tokens.css,
          lib/interaction-contract.ts, lib/agent-workflow-host.ts,
          app/agent-workflow/page.tsx, app/api/agent-workflow/route.ts
  change  <none> / <each existing file and why>
```

## components.json without `shadcn init`

`shadcn init` rewrites the global stylesheet and adds files the task does not need. If the app has no `components.json`, write this one, with the paths the app uses:

```json
{
  "$schema": "https://ui.shadcn.com/schema.json",
  "style": "new-york",
  "rsc": true,
  "tsx": true,
  "tailwind": { "config": "", "css": "app/globals.css", "baseColor": "neutral", "cssVariables": true, "prefix": "" },
  "iconLibrary": "lucide",
  "aliases": { "components": "@/components", "utils": "@/lib/utils", "ui": "@/components/ui", "lib": "@/lib", "hooks": "@/hooks" }
}
```

Set `rsc` to `false` outside Next.js. The registry files need the `@/*` path alias; if `tsconfig.json` has none, ask before adding it.
