plan-review 0.2.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,9 +10,11 @@ export interface Transport {
10
10
  export declare class HttpTransport implements Transport {
11
11
  private doc;
12
12
  private submitHandler;
13
+ private sessionSaveHandler;
13
14
  private server;
14
15
  sendDocument(doc: PlanDocument): void;
15
16
  onReviewSubmit(handler: (comments: ReviewComment[]) => void): void;
17
+ onSessionSave(handler: (comments: ReviewComment[], activeSection: string | null) => void): void;
16
18
  start(port: number): Promise<{
17
19
  url: string;
18
20
  }>;
package/dist/transport.js CHANGED
@@ -3,6 +3,7 @@ import { getAssetHtml } from './server/assets.js';
3
3
  export class HttpTransport {
4
4
  doc = null;
5
5
  submitHandler = null;
6
+ sessionSaveHandler = null;
6
7
  server = null;
7
8
  sendDocument(doc) {
8
9
  this.doc = doc;
@@ -10,6 +11,9 @@ export class HttpTransport {
10
11
  onReviewSubmit(handler) {
11
12
  this.submitHandler = handler;
12
13
  }
14
+ onSessionSave(handler) {
15
+ this.sessionSaveHandler = handler;
16
+ }
13
17
  async start(port) {
14
18
  if (!this.doc)
15
19
  throw new Error('No document set');
@@ -17,6 +21,7 @@ export class HttpTransport {
17
21
  getDocument: () => this.doc,
18
22
  onSubmit: (comments) => this.submitHandler?.(comments),
19
23
  getAssetHtml: () => getAssetHtml(),
24
+ onSessionSave: (comments, activeSection) => this.sessionSaveHandler?.(comments, activeSection),
20
25
  });
21
26
  return startServer(this.server, port);
22
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AASlD,MAAM,OAAO,aAAa;IAChB,GAAG,GAAwB,IAAI,CAAC;IAChC,aAAa,GAAi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AAC;IAErC,YAAY,CAAC,GAAiB;QAC5B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,cAAc,CAAC,OAA4C;QACzD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IAC/B,CAAC;IAED,aAAa,CAAC,OAA0E;QACtF,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAY;QACtB,IAAI,CAAC,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAElD,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC;YAC/B,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAI;YAC5B,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC;YACtD,YAAY,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE;YAClC,aAAa,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;SAC/F,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YACzC,MAAM,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;CACF"}
package/dist/types.d.ts CHANGED
@@ -18,16 +18,17 @@ export interface Section {
18
18
  relatedFiles?: string[];
19
19
  verification?: string;
20
20
  }
21
+ export interface LineAnchor {
22
+ type: 'lines';
23
+ startLine: number;
24
+ endLine: number;
25
+ lineTexts: string[];
26
+ }
21
27
  export interface ReviewComment {
22
28
  sectionId: string;
23
29
  text: string;
24
30
  timestamp: Date;
25
- anchor?: {
26
- type: 'section' | 'range';
27
- startOffset?: number;
28
- endOffset?: number;
29
- selectedText?: string;
30
- };
31
+ anchor?: LineAnchor;
31
32
  }
32
33
  export type OutputTarget = 'stdout' | 'clipboard' | 'file' | 'claude';
33
34
  export type SplitStrategy = 'heading' | 'separator' | 'auto';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plan-review",
3
- "version": "0.2.0",
3
+ "version": "1.0.2",
4
4
  "description": "Interactive CLI for reviewing AI-generated markdown plans",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,10 +8,11 @@
8
8
  "plan-review": "dist/index.js"
9
9
  },
10
10
  "files": [
11
- "dist"
11
+ "dist",
12
+ "skills"
12
13
  ],
13
14
  "scripts": {
14
- "build": "tsc && node scripts/build-browser.js",
15
+ "build": "tsc && tsc --project tsconfig.browser.json --noEmit && node scripts/build-browser.js",
15
16
  "build:browser": "node scripts/build-browser.js",
16
17
  "dev:browser": "node scripts/build-browser.js --watch",
17
18
  "dev": "tsx src/index.ts",
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: plan-review
3
+ description: Use when the user asks to review a plan, start plan review, or says "I want to review this plan". Triggers on plan review requests for markdown implementation plans, specs, or design docs. Builds and runs the plan-review browser UI, feeds review output back into the conversation.
4
+ ---
5
+
6
+ # Plan Review
7
+
8
+ Launch the plan-review browser UI for interactive review of markdown plans, then feed the structured review output back into this session.
9
+
10
+ ## Prerequisites
11
+
12
+ The `plan-review` CLI must be installed or available at `~/desenv/personal/plan-review/`. If not built, run `npm run build` first.
13
+
14
+ ## Process
15
+
16
+ 1. **Identify the plan file.** If the user specified a file, use it. If not, look for the most recent file matching `docs/superpowers/plans/*.md` in the current working directory. If multiple candidates exist, ask which one.
17
+
18
+ 2. **Build if needed.** Check if `dist/index.js` exists in the plan-review project. If not:
19
+ ```bash
20
+ cd ~/desenv/personal/plan-review && npm run build
21
+ ```
22
+
23
+ 3. **Run the review.** Launch in browser mode with stdout output:
24
+ ```bash
25
+ node ~/desenv/personal/plan-review/dist/index.js <plan-file> --browser -o stdout
26
+ ```
27
+ This opens the browser review UI. The command blocks until the user submits their review, then prints structured review output to stdout.
28
+
29
+ 4. **Read the output.** The review output is structured markdown with the user's comments anchored to specific sections. Read it and present a summary to the user.
30
+
31
+ 5. **Act on feedback.** Ask the user what they want to do with the review:
32
+ - Address the comments (modify the plan or code)
33
+ - Save the review to a file
34
+ - Continue discussion about specific comments
35
+
36
+ ## Important
37
+
38
+ - The `--browser` flag opens a three-panel review UI (TOC + content + comments).
39
+ - The `-o stdout` flag ensures the review output comes back to this session.
40
+ - The command will block until the user clicks "Submit Review" in the browser.
41
+ - If the user has an existing session for this plan, they'll be prompted to resume.
42
+ - Use `--fresh` flag if the user explicitly wants to start a clean review.