From d6038a873403feadf2f8649541a37385f8cb382f Mon Sep 17 00:00:00 2001 From: Dean Stratakos <29683763+dastratakos@users.noreply.github.com> Date: Mon, 4 May 2026 13:26:09 -0700 Subject: [PATCH 1/2] chore(PLA-109): unify naming to stagereview across the repo Rename the CLI binary from stage-cli to stagereview and the internal workspace scope from @stage-cli/* to @stagereview/* so that the npm package name, binary name, and workspace scope all use one identity before the first publish. --- .agents/agents/code-architecture-reviewer.md | 4 ++-- .claude/agents/auto-error-resolver.md | 4 ++-- AGENTS.md | 14 +++++++------- README.md | 4 ++-- package.json | 4 ++-- packages/cli/package.json | 4 ++-- packages/cli/src/db/schema/chapter-run.ts | 2 +- packages/cli/src/index.ts | 2 +- packages/cli/src/routes/runs.ts | 2 +- packages/cli/src/routes/view-state.ts | 2 +- packages/cli/src/schema.ts | 8 ++++---- packages/cli/tsdown.config.ts | 2 +- packages/types/package.json | 2 +- packages/web/package.json | 4 ++-- .../components/chapter/chapter-navigator.tsx | 2 +- .../components/chapter/chapter-side-panel.tsx | 2 +- .../src/components/chapter/chapter-summary.tsx | 2 +- .../chapter/key-change-reference-tooltip.tsx | 2 +- .../components/prologue/prologue-section.tsx | 4 ++-- packages/web/src/lib/__tests__/fixtures.tsx | 2 +- .../__tests__/use-view-state-reads.test.tsx | 2 +- packages/web/src/lib/chapter-context.tsx | 2 +- .../web/src/lib/filter-files-for-chapter.ts | 2 +- .../web/src/lib/format-chapter-markdown.ts | 2 +- packages/web/src/lib/line-refs-by-file.ts | 2 +- packages/web/src/lib/sort-line-refs.ts | 2 +- packages/web/src/lib/use-chapters.ts | 2 +- packages/web/src/lib/use-view-state.ts | 2 +- .../web/src/routes/chapter-detail-page.tsx | 2 +- .../web/src/routes/chapters-index-page.tsx | 2 +- pnpm-lock.yaml | 4 ++-- skills/stage-chapters/SKILL.md | 18 +++++++++--------- 32 files changed, 57 insertions(+), 57 deletions(-) diff --git a/.agents/agents/code-architecture-reviewer.md b/.agents/agents/code-architecture-reviewer.md index 708f9ed..6bd9bd4 100644 --- a/.agents/agents/code-architecture-reviewer.md +++ b/.agents/agents/code-architecture-reviewer.md @@ -8,7 +8,7 @@ color: blue You are an expert software engineer specializing in code review and system architecture analysis. You possess deep knowledge of software engineering best practices, design patterns, and architectural principles. Your expertise spans the full technology stack of this project: TypeScript, React 19, Tailwind 4, shadcn/ui, Drizzle ORM on better-sqlite3, Commander, Vite, and Node.js (ESM, Node 20+). You have comprehensive understanding of: -- The project's purpose: a local-only CLI (`stage-cli`) that serves a chapter-style code-review UI from `127.0.0.1` +- The project's purpose: a local-only CLI (`stagereview`) that serves a chapter-style code-review UI from `127.0.0.1` - How the CLI, the local HTTP server, the Drizzle/SQLite layer, and the Vite/React web UI interact - The established coding standards and patterns documented in `AGENTS.md` - The testing strategy in `TESTING.md` @@ -45,7 +45,7 @@ When reviewing code, you will: 4. **Assess Architectural Fit**: - Evaluate which workspace package the code belongs in: `packages/cli` (CLI/server), `packages/web` (React UI), or `packages/types` (wire-format types shared between them) - Check for proper separation of concerns: routes in `packages/cli/src/routes/`, DB code in `packages/cli/src/db/`, ingestion schemas in `packages/cli/src/schema.ts` - - Ensure module boundaries are respected — `packages/web` and `packages/cli` may depend on `@stage-cli/types`, but never on each other + - Ensure module boundaries are respected — `packages/web` and `packages/cli` may depend on `@stagereview/types`, but never on each other - Validate that shared wire-format types live in `packages/types`, not duplicated across the CLI and web packages 5. **Review Specific Technologies**: diff --git a/.claude/agents/auto-error-resolver.md b/.claude/agents/auto-error-resolver.md index 63f3abf..4bd5cbc 100644 --- a/.claude/agents/auto-error-resolver.md +++ b/.claude/agents/auto-error-resolver.md @@ -81,8 +81,8 @@ pnpm typecheck # runs tsc --noEmit across every workspace package This is a pnpm workspace with three packages, each with its own `tsconfig.json`: - **CLI** (`packages/cli`): `pnpm --filter stagereview typecheck` -- **Types** (`packages/types`): `pnpm --filter @stage-cli/types typecheck` -- **Web UI** (`packages/web`): `pnpm --filter @stage-cli/web typecheck` +- **Types** (`packages/types`): `pnpm --filter @stagereview/types typecheck` +- **Web UI** (`packages/web`): `pnpm --filter @stagereview/web typecheck` `pnpm typecheck` from the workspace root runs all three (`pnpm -r typecheck`). If a hook has saved a command at `~/.claude/tsc-cache/*/tsc-commands.txt`, prefer that. diff --git a/AGENTS.md b/AGENTS.md index afd1c59..5576730 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,7 +35,7 @@ Components land under `packages/web/src/components/ui/` per `packages/web/compon ## Architecture -**pnpm workspace.** Three packages with real boundaries — no path-alias indirection. The published unit is `packages/cli` (npm name `stagereview`, binary `stage-cli`); the rest are private workspace deps that get inlined at build time. +**pnpm workspace.** Three packages with real boundaries — no path-alias indirection. The published unit is `packages/cli` (npm name `stagereview`, binary `stagereview`); the rest are private workspace deps that get inlined at build time. ``` pnpm-workspace.yaml # packages: ["packages/*"] @@ -43,7 +43,7 @@ packages/ cli/ # stagereview — published npm package src/ # CLI + local HTTP server (Node, ESM) index.ts # CLI entry (Commander) - show.ts # `stage-cli show ` implementation + show.ts # `stagereview show ` implementation server.ts # Plain Node http server with regex-compiled routes routes/ # API route handlers (one file per resource) runs/ # Chapter run import + processing @@ -52,12 +52,12 @@ packages/ __tests__/ # Vitest tests drizzle/ # Generated SQL migrations + meta journal drizzle.config.ts # Drizzle Kit config - tsdown.config.ts # CLI bundler config (inlines @stage-cli/types) - types/ # @stage-cli/types (private, TS-native) + tsdown.config.ts # CLI bundler config (inlines @stagereview/types) + types/ # @stagereview/types (private, TS-native) src/chapters.ts # Wire-format chapter/key-change schemas + shared HunkReference/LineRef src/view-state.ts # Wire-format view-state schema src/index.ts # Barrel re-export - web/ # @stage-cli/web (private) — built into ../cli/web-dist + web/ # @stagereview/web (private) — built into ../cli/web-dist src/components/ # UI components (shadcn/ui under components/ui/) src/lib/ # Frontend utilities + tests src/routes/ # SPA route components @@ -87,7 +87,7 @@ Plain Node `http` server bound to `127.0.0.1`. Route patterns use `:name` placeh ### Shared Types (`packages/types/`) -Wire-format types shared between the CLI's HTTP routes and the SPA. The package exports `.ts` source directly (no compile step) — `tsdown` and `vite` resolve TypeScript natively. The CLI bundle inlines this package via `deps.alwaysBundle` in `tsdown.config.ts`, so the published tarball never has a runtime require for `@stage-cli/types`. +Wire-format types shared between the CLI's HTTP routes and the SPA. The package exports `.ts` source directly (no compile step) — `tsdown` and `vite` resolve TypeScript natively. The CLI bundle inlines this package via `deps.alwaysBundle` in `tsdown.config.ts`, so the published tarball never has a runtime require for `@stagereview/types`. Building blocks like `HunkReference`, `LineRef`, and `DIFF_SIDE` live here; the strict ingestion schema (`ChaptersFileSchema`) stays in `packages/cli/src/schema.ts` and re-exports them. @@ -120,7 +120,7 @@ A `pre-commit` hook (husky + lint-staged) runs `biome check --write` against sta ## Package Naming -The published npm package is `stagereview` (lives in `packages/cli`); the CLI binary is `stage-cli`. Internal workspace packages use the `@stage-cli/*` scope (`@stage-cli/types`, `@stage-cli/web`) — they are private and never published. +The published npm package is `stagereview` (lives in `packages/cli`); the CLI binary is also `stagereview`. Internal workspace packages use the `@stagereview/*` scope (`@stagereview/types`, `@stagereview/web`) — they are private and never published. ## Testing diff --git a/README.md b/README.md index d569726..a080a58 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Chapter-style code review against your local git branch. Run it from your AI cod npm install -g stagereview ``` -This installs the `stage-cli` command. +This installs the `stagereview` command. Then add the skill to your agent: @@ -29,7 +29,7 @@ This breaks your branch's diff into reviewable "chapters". To open a generated chapters file directly: ```bash -stage-cli show path/to/chapters.json +stagereview show path/to/chapters.json ``` ## What it does diff --git a/package.json b/package.json index a1374be..f8111f0 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,8 @@ "node": ">=20" }, "scripts": { - "build": "pnpm --filter @stage-cli/web build && pnpm --filter stagereview build", - "dev:web": "pnpm --filter @stage-cli/web dev", + "build": "pnpm --filter @stagereview/web build && pnpm --filter stagereview build", + "dev:web": "pnpm --filter @stagereview/web dev", "test": "vitest run", "lint": "biome check .", "lint:fix": "biome check --write .", diff --git a/packages/cli/package.json b/packages/cli/package.json index 5fb2110..bd41c92 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -27,7 +27,7 @@ "type": "module", "main": "./dist/index.js", "bin": { - "stage-cli": "./dist/index.js" + "stagereview": "./dist/index.js" }, "files": [ "dist", @@ -53,7 +53,7 @@ "zod": "^4.3.6" }, "devDependencies": { - "@stage-cli/types": "workspace:*", + "@stagereview/types": "workspace:*", "@types/better-sqlite3": "^7.6.13", "@types/node": "^25.6.0", "drizzle-kit": "^0.31.10", diff --git a/packages/cli/src/db/schema/chapter-run.ts b/packages/cli/src/db/schema/chapter-run.ts index e7af734..de9eb84 100644 --- a/packages/cli/src/db/schema/chapter-run.ts +++ b/packages/cli/src/db/schema/chapter-run.ts @@ -1,4 +1,4 @@ -import type { Prologue } from "@stage-cli/types/prologue"; +import type { Prologue } from "@stagereview/types/prologue"; import { index, integer, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { SCOPE_KIND, WORKING_TREE_REF } from "../../schema.js"; import { baseColumns } from "./columns.js"; diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 0f735f7..54b8aba 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -4,7 +4,7 @@ import { show } from "./show.js"; const program = new Command(); -program.name("stage-cli").description("Chapter-style code review against your local git branch."); +program.name("stagereview").description("Chapter-style code review against your local git branch."); program .command("show") diff --git a/packages/cli/src/routes/runs.ts b/packages/cli/src/routes/runs.ts index 4243511..4d22506 100644 --- a/packages/cli/src/routes/runs.ts +++ b/packages/cli/src/routes/runs.ts @@ -1,4 +1,4 @@ -import type { Chapter, ChapterRun, KeyChange } from "@stage-cli/types/chapters"; +import type { Chapter, ChapterRun, KeyChange } from "@stagereview/types/chapters"; import { asc, eq, inArray } from "drizzle-orm"; import type { StageDb } from "../db/client.js"; import { chapter, chapterRun, keyChange } from "../db/schema/index.js"; diff --git a/packages/cli/src/routes/view-state.ts b/packages/cli/src/routes/view-state.ts index aeaa3c3..81bd1c3 100644 --- a/packages/cli/src/routes/view-state.ts +++ b/packages/cli/src/routes/view-state.ts @@ -1,4 +1,4 @@ -import { FileViewBodySchema } from "@stage-cli/types/view-state"; +import { FileViewBodySchema } from "@stagereview/types/view-state"; import { and, eq, inArray } from "drizzle-orm"; import type { StageDb } from "../db/client.js"; import { LOCAL_USER_ID } from "../db/local-user.js"; diff --git a/packages/cli/src/schema.ts b/packages/cli/src/schema.ts index 70b5910..2129e9e 100644 --- a/packages/cli/src/schema.ts +++ b/packages/cli/src/schema.ts @@ -1,9 +1,9 @@ -import { hunkReferenceSchema, lineRefSchema } from "@stage-cli/types/chapters"; -import { PrologueSchema } from "@stage-cli/types/prologue"; +import { hunkReferenceSchema, lineRefSchema } from "@stagereview/types/chapters"; +import { PrologueSchema } from "@stagereview/types/prologue"; import { z } from "zod"; -export type { DiffSide, HunkReference, LineRef } from "@stage-cli/types/chapters"; -export { DIFF_SIDE, hunkReferenceSchema, lineRefSchema } from "@stage-cli/types/chapters"; +export type { DiffSide, HunkReference, LineRef } from "@stagereview/types/chapters"; +export { DIFF_SIDE, hunkReferenceSchema, lineRefSchema } from "@stagereview/types/chapters"; export const SCOPE_KIND = { COMMITTED: "committed", diff --git a/packages/cli/tsdown.config.ts b/packages/cli/tsdown.config.ts index 851dcd2..4a4e354 100644 --- a/packages/cli/tsdown.config.ts +++ b/packages/cli/tsdown.config.ts @@ -12,5 +12,5 @@ export default defineConfig({ outExtensions: () => ({ js: ".js" }), // Inline workspace deps — they won't exist in the published package's // node_modules, so the bundle has to carry their source. - deps: { alwaysBundle: [/^@stage-cli\//] }, + deps: { alwaysBundle: [/^@stagereview\//] }, }); diff --git a/packages/types/package.json b/packages/types/package.json index 73091be..6e74e2a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,5 +1,5 @@ { - "name": "@stage-cli/types", + "name": "@stagereview/types", "version": "0.1.0", "private": true, "description": "Shared wire-format types for the stage-cli server and SPA.", diff --git a/packages/web/package.json b/packages/web/package.json index 77ece7f..4b69c1d 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,5 +1,5 @@ { - "name": "@stage-cli/web", + "name": "@stagereview/web", "version": "0.1.0", "private": true, "description": "stage-cli SPA bundled into the published CLI's web-dist/.", @@ -19,7 +19,7 @@ "@radix-ui/react-separator": "^1.1.8", "@radix-ui/react-slot": "^1.2.4", "@radix-ui/react-tooltip": "^1.2.8", - "@stage-cli/types": "workspace:*", + "@stagereview/types": "workspace:*", "@tanstack/react-query": "^5.100.7", "@tanstack/react-router": "^1.169.1", "class-variance-authority": "^0.7.1", diff --git a/packages/web/src/components/chapter/chapter-navigator.tsx b/packages/web/src/components/chapter/chapter-navigator.tsx index 3ef928e..7f4334e 100644 --- a/packages/web/src/components/chapter/chapter-navigator.tsx +++ b/packages/web/src/components/chapter/chapter-navigator.tsx @@ -1,4 +1,4 @@ -import type { Chapter } from "@stage-cli/types/chapters"; +import type { Chapter } from "@stagereview/types/chapters"; import { Link } from "@tanstack/react-router"; import { Check, diff --git a/packages/web/src/components/chapter/chapter-side-panel.tsx b/packages/web/src/components/chapter/chapter-side-panel.tsx index d6dcb88..5bef072 100644 --- a/packages/web/src/components/chapter/chapter-side-panel.tsx +++ b/packages/web/src/components/chapter/chapter-side-panel.tsx @@ -1,4 +1,4 @@ -import type { Chapter } from "@stage-cli/types/chapters"; +import type { Chapter } from "@stagereview/types/chapters"; import { useCallback, useEffect, useRef, useState } from "react"; import { LineCounts } from "@/components/shared/line-counts"; import { Markdown } from "@/components/ui/markdown"; diff --git a/packages/web/src/components/chapter/chapter-summary.tsx b/packages/web/src/components/chapter/chapter-summary.tsx index 73a2a9f..b4fb2f0 100644 --- a/packages/web/src/components/chapter/chapter-summary.tsx +++ b/packages/web/src/components/chapter/chapter-summary.tsx @@ -1,4 +1,4 @@ -import type { Chapter } from "@stage-cli/types/chapters"; +import type { Chapter } from "@stagereview/types/chapters"; import { Checkbox } from "@/components/ui/checkbox"; import { Markdown } from "@/components/ui/markdown"; import { cn } from "@/lib/utils"; diff --git a/packages/web/src/components/chapter/key-change-reference-tooltip.tsx b/packages/web/src/components/chapter/key-change-reference-tooltip.tsx index 27ba0cd..7752f24 100644 --- a/packages/web/src/components/chapter/key-change-reference-tooltip.tsx +++ b/packages/web/src/components/chapter/key-change-reference-tooltip.tsx @@ -1,4 +1,4 @@ -import type { HunkReference, LineRef } from "@stage-cli/types/chapters"; +import type { HunkReference, LineRef } from "@stagereview/types/chapters"; import type { ReactNode } from "react"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import { sortLineRefsByChapterOrder } from "@/lib/sort-line-refs"; diff --git a/packages/web/src/components/prologue/prologue-section.tsx b/packages/web/src/components/prologue/prologue-section.tsx index 8fc53ce..49f3779 100644 --- a/packages/web/src/components/prologue/prologue-section.tsx +++ b/packages/web/src/components/prologue/prologue-section.tsx @@ -1,5 +1,5 @@ -import type { FocusArea, FocusAreaSeverity, Prologue } from "@stage-cli/types/prologue"; -import { FOCUS_AREA_SEVERITY } from "@stage-cli/types/prologue"; +import type { FocusArea, FocusAreaSeverity, Prologue } from "@stagereview/types/prologue"; +import { FOCUS_AREA_SEVERITY } from "@stagereview/types/prologue"; import { Link } from "@tanstack/react-router"; import { AlertTriangle } from "lucide-react"; import { cn } from "@/lib/utils"; diff --git a/packages/web/src/lib/__tests__/fixtures.tsx b/packages/web/src/lib/__tests__/fixtures.tsx index abead60..0dc5c3a 100644 --- a/packages/web/src/lib/__tests__/fixtures.tsx +++ b/packages/web/src/lib/__tests__/fixtures.tsx @@ -2,7 +2,7 @@ // __tests__/ as a sibling of the test files so the cross-file scope rule // (per-file mock budget) stays obvious. -import type { ViewState } from "@stage-cli/types/view-state"; +import type { ViewState } from "@stagereview/types/view-state"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import type { ReactElement, ReactNode } from "react"; import { vi } from "vitest"; diff --git a/packages/web/src/lib/__tests__/use-view-state-reads.test.tsx b/packages/web/src/lib/__tests__/use-view-state-reads.test.tsx index e7d8ac6..84abc53 100644 --- a/packages/web/src/lib/__tests__/use-view-state-reads.test.tsx +++ b/packages/web/src/lib/__tests__/use-view-state-reads.test.tsx @@ -1,6 +1,6 @@ // @vitest-environment happy-dom -import type { ViewState } from "@stage-cli/types/view-state"; +import type { ViewState } from "@stagereview/types/view-state"; import { act, renderHook, waitFor } from "@testing-library/react"; import { afterEach, describe, expect, it, vi } from "vitest"; import { useViewState, viewStateQueryKey } from "../use-view-state"; diff --git a/packages/web/src/lib/chapter-context.tsx b/packages/web/src/lib/chapter-context.tsx index e51e8a6..d08e011 100644 --- a/packages/web/src/lib/chapter-context.tsx +++ b/packages/web/src/lib/chapter-context.tsx @@ -1,4 +1,4 @@ -import type { Chapter } from "@stage-cli/types/chapters"; +import type { Chapter } from "@stagereview/types/chapters"; import { createContext, type ReactNode, use, useMemo } from "react"; import { filterFilesForChapter } from "./filter-files-for-chapter"; import { useChapters } from "./use-chapters"; diff --git a/packages/web/src/lib/filter-files-for-chapter.ts b/packages/web/src/lib/filter-files-for-chapter.ts index 123352f..41de609 100644 --- a/packages/web/src/lib/filter-files-for-chapter.ts +++ b/packages/web/src/lib/filter-files-for-chapter.ts @@ -1,5 +1,5 @@ import { getSingularPatch } from "@pierre/diffs"; -import type { HunkReference } from "@stage-cli/types/chapters"; +import type { HunkReference } from "@stagereview/types/chapters"; import type { FileDiffEntry } from "./parse-diff"; import { fileDiffToPullRequestFile } from "./parse-diff"; diff --git a/packages/web/src/lib/format-chapter-markdown.ts b/packages/web/src/lib/format-chapter-markdown.ts index 0c1b10a..457275b 100644 --- a/packages/web/src/lib/format-chapter-markdown.ts +++ b/packages/web/src/lib/format-chapter-markdown.ts @@ -1,4 +1,4 @@ -import type { Chapter } from "@stage-cli/types/chapters"; +import type { Chapter } from "@stagereview/types/chapters"; import { FILE_STATUS, type PullRequestFile } from "./diff-types"; interface ChapterFileInput { diff --git a/packages/web/src/lib/line-refs-by-file.ts b/packages/web/src/lib/line-refs-by-file.ts index 9d3fdcc..c5108c2 100644 --- a/packages/web/src/lib/line-refs-by-file.ts +++ b/packages/web/src/lib/line-refs-by-file.ts @@ -1,4 +1,4 @@ -import type { LineRef } from "@stage-cli/types/chapters"; +import type { LineRef } from "@stagereview/types/chapters"; import type { AnnotatedLineRef } from "./diff-types"; // `externalId` (not `id`) because that's what view-state, the side panel, and diff --git a/packages/web/src/lib/sort-line-refs.ts b/packages/web/src/lib/sort-line-refs.ts index dc682f0..95c5d52 100644 --- a/packages/web/src/lib/sort-line-refs.ts +++ b/packages/web/src/lib/sort-line-refs.ts @@ -1,4 +1,4 @@ -import type { HunkReference, LineRef } from "@stage-cli/types/chapters"; +import type { HunkReference, LineRef } from "@stagereview/types/chapters"; import { DIFF_SIDE } from "./diff-types"; /** diff --git a/packages/web/src/lib/use-chapters.ts b/packages/web/src/lib/use-chapters.ts index 8bea36c..3b2527e 100644 --- a/packages/web/src/lib/use-chapters.ts +++ b/packages/web/src/lib/use-chapters.ts @@ -1,4 +1,4 @@ -import { type ChaptersResponse, ChaptersResponseSchema } from "@stage-cli/types/chapters"; +import { type ChaptersResponse, ChaptersResponseSchema } from "@stagereview/types/chapters"; import { skipToken, useQuery } from "@tanstack/react-query"; import { jsonFetch } from "@/lib/use-view-state"; diff --git a/packages/web/src/lib/use-view-state.ts b/packages/web/src/lib/use-view-state.ts index f494952..fa4e402 100644 --- a/packages/web/src/lib/use-view-state.ts +++ b/packages/web/src/lib/use-view-state.ts @@ -1,4 +1,4 @@ -import { type ViewState, ViewStateSchema } from "@stage-cli/types/view-state"; +import { type ViewState, ViewStateSchema } from "@stagereview/types/view-state"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useMemo } from "react"; diff --git a/packages/web/src/routes/chapter-detail-page.tsx b/packages/web/src/routes/chapter-detail-page.tsx index a25d5f4..5b753f5 100644 --- a/packages/web/src/routes/chapter-detail-page.tsx +++ b/packages/web/src/routes/chapter-detail-page.tsx @@ -1,4 +1,4 @@ -import type { Chapter, LineRef } from "@stage-cli/types/chapters"; +import type { Chapter, LineRef } from "@stagereview/types/chapters"; import { Link, useNavigate } from "@tanstack/react-router"; import { useCallback, useMemo, useRef, useState } from "react"; import { useHotkeys } from "react-hotkeys-hook"; diff --git a/packages/web/src/routes/chapters-index-page.tsx b/packages/web/src/routes/chapters-index-page.tsx index 41d2923..953a251 100644 --- a/packages/web/src/routes/chapters-index-page.tsx +++ b/packages/web/src/routes/chapters-index-page.tsx @@ -1,4 +1,4 @@ -import type { Chapter, HunkReference } from "@stage-cli/types/chapters"; +import type { Chapter, HunkReference } from "@stagereview/types/chapters"; import { Link } from "@tanstack/react-router"; import { ChevronRight, Circle, CircleCheck } from "lucide-react"; import { useCallback, useEffect, useMemo, useState } from "react"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 681706f..53cf24e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,7 +51,7 @@ importers: specifier: ^4.3.6 version: 4.4.2 devDependencies: - '@stage-cli/types': + '@stagereview/types': specifier: workspace:* version: link:../types '@types/better-sqlite3': @@ -109,7 +109,7 @@ importers: '@radix-ui/react-tooltip': specifier: ^1.2.8 version: 1.2.8(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5) - '@stage-cli/types': + '@stagereview/types': specifier: workspace:* version: link:../types '@tanstack/react-query': diff --git a/skills/stage-chapters/SKILL.md b/skills/stage-chapters/SKILL.md index e414a09..facbe15 100644 --- a/skills/stage-chapters/SKILL.md +++ b/skills/stage-chapters/SKILL.md @@ -6,16 +6,16 @@ user-invocable: true # stage-chapters -Generates a Stage chapter run for the current local git branch and opens it in a browser. The skill detects the base ref, computes the diff, generates chapters from it, writes a JSON file matching the `stage-cli` schema, and hands the file to `stage-cli show` to launch the SPA. +Generates a Stage chapter run for the current local git branch and opens it in a browser. The skill detects the base ref, computes the diff, generates chapters from it, writes a JSON file matching the `stagereview` schema, and hands the file to `stagereview show` to launch the SPA. ## Prerequisites Run these checks before any other work. If either fails, stop with the error message — do not continue. -1. **`stage-cli` is installed.** Run `which stage-cli`. If it exits non-zero, instruct the user: +1. **`stagereview` is installed.** Run `which stagereview`. If it exits non-zero, instruct the user: ``` - stage-cli is not installed. Run: + stagereview is not installed. Run: npm install -g stagereview @@ -244,11 +244,11 @@ Compute a unique temp path. The trailing `XXXXXX` (with no suffix after) is requ TMPFILE=$(mktemp "${TMPDIR:-/tmp}/stage-chapters.XXXXXX") ``` -`stage-cli show` reads JSON regardless of file extension, so the missing `.json` suffix is fine. +`stagereview show` reads JSON regardless of file extension, so the missing `.json` suffix is fine. The `${TMPDIR:-/tmp}` fallback matters on macOS, where `os.tmpdir()` resolves to `/var/folders/...` but `$TMPDIR` is not always set in every shell. Avoid `date +%s%N` — the `%N` (nanoseconds) format is a GNU extension and on macOS BSD `date` it emits a literal `N`, breaking uniqueness. -Write a JSON file at `"$TMPFILE"` matching the shape below. The file must validate against `ChaptersFileSchema` in `packages/cli/src/schema.ts`; mismatched fields will be rejected by `stage-cli show`. +Write a JSON file at `"$TMPFILE"` matching the shape below. The file must validate against `ChaptersFileSchema` in `packages/cli/src/schema.ts`; mismatched fields will be rejected by `stagereview show`. High-level shape: @@ -344,12 +344,12 @@ Field rules: ## Step 6 — Display generated chapters -Hand the file to `stage-cli`: +Hand the file to `stagereview`: ```bash -stage-cli show "$TMPFILE" +stagereview show "$TMPFILE" ``` -`stage-cli show` validates the JSON, inserts a new `chapter_run` plus chapters and key changes into the local SQLite database, boots a loopback HTTP server, and opens the browser to the new run. The command stays running and serves the SPA until the user kills it with Ctrl+C — invoke it as the final command in the workflow rather than expecting it to print a value and exit. +`stagereview show` validates the JSON, inserts a new `chapter_run` plus chapters and key changes into the local SQLite database, boots a loopback HTTP server, and opens the browser to the new run. The command stays running and serves the SPA until the user kills it with Ctrl+C — invoke it as the final command in the workflow rather than expecting it to print a value and exit. -Do not pass a `runId` and do not call a separate `stage-cli ingest`. `show ` does ingestion and serving in one step. +Do not pass a `runId` and do not call a separate `stagereview ingest`. `show ` does ingestion and serving in one step. From 5bfaa1e0c8427ce526c4f3cf544a57095d6896ca Mon Sep 17 00:00:00 2001 From: Dean Stratakos <29683763+dastratakos@users.noreply.github.com> Date: Mon, 4 May 2026 13:42:37 -0700 Subject: [PATCH 2/2] fix(PLA-109): rename stage-cli to stagereview in web UI error message --- packages/web/src/app/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web/src/app/index.tsx b/packages/web/src/app/index.tsx index 06b76fa..9c25bac 100644 --- a/packages/web/src/app/index.tsx +++ b/packages/web/src/app/index.tsx @@ -14,7 +14,7 @@ function NoRunSelected() {

No run selected

The URL is missing a /runs/<runId> path. Open the app via{" "} - stage-cli show <path>. + stagereview show <path>.