@vintasoftware/pr-review-canvas 0.1.0

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.
Files changed (157) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +192 -0
  3. package/bin/pr-review.mjs +5 -0
  4. package/docs/reference.md +340 -0
  5. package/package.json +74 -0
  6. package/pr-review.config.example.yml +68 -0
  7. package/prompts/chat-seed.md +64 -0
  8. package/prompts/generation-format.md +255 -0
  9. package/prompts/generation-strict.md +34 -0
  10. package/prompts/generation-surfacing.md +67 -0
  11. package/prompts/layers-default.md +13 -0
  12. package/prompts/quality-standards.md +32 -0
  13. package/skills/pr-review-canvas/SKILL.md +177 -0
  14. package/src/acpx/acpx.ts +530 -0
  15. package/src/acpx/agents.ts +85 -0
  16. package/src/acpx/events.ts +216 -0
  17. package/src/acpx/ndjson.ts +69 -0
  18. package/src/acpx/preflight.ts +44 -0
  19. package/src/canvas/export.ts +95 -0
  20. package/src/canvas/import.ts +138 -0
  21. package/src/canvas/name.ts +55 -0
  22. package/src/canvas/zip.ts +123 -0
  23. package/src/chat/chat-manager.ts +389 -0
  24. package/src/chat/context.ts +160 -0
  25. package/src/chat/seed.ts +71 -0
  26. package/src/chat/threads.ts +114 -0
  27. package/src/cli.ts +199 -0
  28. package/src/commands.ts +424 -0
  29. package/src/config.ts +142 -0
  30. package/src/contract/api.ts +190 -0
  31. package/src/contract/canvas-manifest.ts +29 -0
  32. package/src/contract/chat.ts +76 -0
  33. package/src/contract/comments.ts +96 -0
  34. package/src/contract/discovery.ts +20 -0
  35. package/src/contract/generation-context.ts +77 -0
  36. package/src/contract/keys.ts +14 -0
  37. package/src/contract/links.ts +5 -0
  38. package/src/contract/mermaid-fences.ts +4 -0
  39. package/src/contract/review-artifact.ts +324 -0
  40. package/src/contract/settings.ts +144 -0
  41. package/src/contract/state.ts +46 -0
  42. package/src/contract/validation.ts +43 -0
  43. package/src/git/diff-collector.ts +151 -0
  44. package/src/git/git.ts +115 -0
  45. package/src/git/lang.ts +1 -0
  46. package/src/git/materialize.ts +79 -0
  47. package/src/git/patch-lines.ts +60 -0
  48. package/src/github/attachments.ts +288 -0
  49. package/src/github/capabilities.ts +112 -0
  50. package/src/github/comments.ts +132 -0
  51. package/src/github/gh.ts +196 -0
  52. package/src/github/post-comment.ts +104 -0
  53. package/src/github/post-review.ts +44 -0
  54. package/src/github/pr.ts +133 -0
  55. package/src/github/review-body.ts +72 -0
  56. package/src/github/threads.ts +63 -0
  57. package/src/paths.ts +10 -0
  58. package/src/project-config.ts +219 -0
  59. package/src/prompt-files.ts +26 -0
  60. package/src/review/diagram-nodes.ts +227 -0
  61. package/src/review/doctor.ts +139 -0
  62. package/src/review/glob.ts +33 -0
  63. package/src/review/install-skill.ts +107 -0
  64. package/src/review/normalize.ts +209 -0
  65. package/src/review/prepare.ts +165 -0
  66. package/src/review/prompt.ts +233 -0
  67. package/src/review/publish.ts +209 -0
  68. package/src/review/skill-command.ts +4 -0
  69. package/src/review/test-paths.ts +32 -0
  70. package/src/review/text-length.ts +15 -0
  71. package/src/review/trim-caps.ts +114 -0
  72. package/src/review/validate-folds.ts +110 -0
  73. package/src/review/validate.ts +520 -0
  74. package/src/server/app.ts +46 -0
  75. package/src/server/bundle.ts +266 -0
  76. package/src/server/capped-body.ts +62 -0
  77. package/src/server/context.ts +174 -0
  78. package/src/server/env.ts +7 -0
  79. package/src/server/errors.ts +65 -0
  80. package/src/server/html.ts +140 -0
  81. package/src/server/node-server.ts +42 -0
  82. package/src/server/routes/api.ts +256 -0
  83. package/src/server/routes/chat-routes.ts +221 -0
  84. package/src/server/routes/pages.ts +64 -0
  85. package/src/server/routes/review-routes.ts +245 -0
  86. package/src/server/routes/static.ts +114 -0
  87. package/src/server/security.ts +104 -0
  88. package/src/server/sse.ts +67 -0
  89. package/src/store/atomic-json.ts +68 -0
  90. package/src/store/canvas-store.ts +120 -0
  91. package/src/store/data-dir.ts +29 -0
  92. package/src/store/derived-store.ts +93 -0
  93. package/src/store/pr-store.ts +69 -0
  94. package/src/store/settings-store.ts +152 -0
  95. package/src/store/state-store.ts +121 -0
  96. package/static/js/anchors.js +141 -0
  97. package/static/js/api.js +542 -0
  98. package/static/js/app.js +418 -0
  99. package/static/js/ask.js +35 -0
  100. package/static/js/chat-context.js +137 -0
  101. package/static/js/chat-scroll.js +114 -0
  102. package/static/js/chat.js +843 -0
  103. package/static/js/code-folds.js +200 -0
  104. package/static/js/commands.js +110 -0
  105. package/static/js/comment-link.js +37 -0
  106. package/static/js/composer.js +241 -0
  107. package/static/js/contract-types.d.ts +59 -0
  108. package/static/js/deep-link.js +160 -0
  109. package/static/js/diagram.js +582 -0
  110. package/static/js/diff-decorations.js +204 -0
  111. package/static/js/diff-renderer.js +860 -0
  112. package/static/js/dom.js +145 -0
  113. package/static/js/download.js +52 -0
  114. package/static/js/empty-state.js +161 -0
  115. package/static/js/errors.js +135 -0
  116. package/static/js/fences.js +90 -0
  117. package/static/js/header.js +134 -0
  118. package/static/js/hunks.js +62 -0
  119. package/static/js/import-zone.js +95 -0
  120. package/static/js/interactions.js +952 -0
  121. package/static/js/keyboard.js +131 -0
  122. package/static/js/keys.js +97 -0
  123. package/static/js/lang.js +54 -0
  124. package/static/js/layers.js +596 -0
  125. package/static/js/links.js +150 -0
  126. package/static/js/markdown.js +232 -0
  127. package/static/js/mermaid-fences.js +55 -0
  128. package/static/js/nav.js +91 -0
  129. package/static/js/overview.js +85 -0
  130. package/static/js/points.js +247 -0
  131. package/static/js/progress.js +49 -0
  132. package/static/js/proposed-comment.js +133 -0
  133. package/static/js/quick-questions.js +216 -0
  134. package/static/js/regenerate.js +69 -0
  135. package/static/js/review-session.js +257 -0
  136. package/static/js/scroll-spy.js +66 -0
  137. package/static/js/selection.js +193 -0
  138. package/static/js/settings.js +206 -0
  139. package/static/js/signoff.js +171 -0
  140. package/static/js/skin.js +56 -0
  141. package/static/js/store.js +35 -0
  142. package/static/js/theme.js +56 -0
  143. package/static/js/threads.js +78 -0
  144. package/static/js/vendor.d.ts +15 -0
  145. package/static/styles/base.css +223 -0
  146. package/static/styles/chat-tools.css +130 -0
  147. package/static/styles/chat.css +140 -0
  148. package/static/styles/commands.css +156 -0
  149. package/static/styles/diff.css +258 -0
  150. package/static/styles/header.css +114 -0
  151. package/static/styles/layout.css +123 -0
  152. package/static/styles/panels.css +152 -0
  153. package/static/styles/responsive.css +80 -0
  154. package/static/styles/review-actions.css +124 -0
  155. package/static/styles/review.css +473 -0
  156. package/static/styles/skin-github.css +356 -0
  157. package/static/styles.css +14 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Vinta Software
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,192 @@
1
+ # PR Review Canvas
2
+
3
+ Review a GitHub pull request canvas: layers by topic, with grouped diffs, attention points, comments,
4
+ and an optional AI chat. Everything runs locally at **http://localhost:3010**.
5
+
6
+ ## Quick start: author generates, reviewers review
7
+
8
+ ### Author side
9
+
10
+ Each PR author should generate a canvas and attach its zip to the **PR description** before
11
+ requesting review. After the project setup below, run the installed skill in Claude Code or Codex:
12
+
13
+ ```text
14
+ /pr-review-canvas 123
15
+ ```
16
+
17
+ Replace **123** with your PR number. The skill reads the PR, generates and validates the canvas,
18
+ then returns a local review URL and the exported zip's path. Open the URL to check the canvas.
19
+
20
+ The skill ends with upload instructions. If you're happy with the produced canvas, edit the PR
21
+ description in GitHub's UI, drag the zip into the editor, wait for the upload to finish, and save.
22
+ Uploading the zip is a manual browser step due to restrictions of GitHub's API.
23
+
24
+ ### Review side
25
+
26
+ Start the canvas server from the project you want to review:
27
+
28
+ ```bash
29
+ pr-review serve
30
+ ```
31
+
32
+ Open **http://localhost:3010**, enter a PR number, and leave the terminal running while you
33
+ review. Stop the server with **Ctrl+C**. To use another port, run `pr-review serve --port 3011`.
34
+
35
+ ## Install
36
+
37
+ You need Node.js 22+, npm, Git, and [GitHub CLI](https://cli.github.com).
38
+ Sign in to GitHub with `gh auth login`.
39
+
40
+ Install the command globally once, for use in any project:
41
+
42
+ ```bash
43
+ npm install -g @vintasoftware/pr-review-canvas
44
+ ```
45
+
46
+ The npm installation command will be available after the first release.
47
+
48
+ ## Set up a project
49
+
50
+ ```bash
51
+ cd /path/to/your-project
52
+ pr-review install-skill
53
+ pr-review doctor --all-checks
54
+ ```
55
+
56
+ `install-skill` sets up **both Claude Code and Codex** in one command: `.claude/skills/pr-review-canvas`
57
+ and `.agents/skills/pr-review-canvas`, respectively. It also adds `.pr-review/settings.yml` to the
58
+ project's `.gitignore`. Restart your coding agent if the skill
59
+ does not appear. Repeat this setup for each project you want to review.
60
+
61
+ `doctor` checks Git, your GitHub remote, the GitHub CLI and its login, write access to the local
62
+ canvas directory, and whether the skill is installed. It prints a JSON report with a result for
63
+ each check and suggested fixes for failures. `doctor --all-checks` also checks that `acpx` runs and
64
+ reports its version. Exit code `0` means all checks passed.
65
+
66
+ ### Optional: AI Chat install
67
+
68
+ To ask questions about a PR inside the canvas, install `acpx` globally:
69
+
70
+ ```bash
71
+ npm install -g acpx
72
+ acpx --version
73
+ pr-review doctor --all-checks
74
+ ```
75
+
76
+ Install and sign in to either Claude Code or Codex on the same machine. Start (or restart)
77
+ the review server, then choose your agent in **settings**. The chat uses that agent's account.
78
+ You can review canvases without installing `acpx`.
79
+
80
+ ## Advanced usage
81
+
82
+ See the [CLI and configuration reference](docs/reference.md) for detailed options and troubleshooting.
83
+
84
+ ### Export an existing canvas
85
+
86
+ ```bash
87
+ pr-review export --pr 123
88
+ ```
89
+
90
+ The command prints the zip's absolute path. Both `export` and `publish` save locally; neither
91
+ uploads an attachment to GitHub.
92
+
93
+ The zip contains `manifest.json` and `review.json`: the PR description, file/hunk metadata,
94
+ and generated review notes. Check these before sharing, since they can contain private
95
+ information. Each reviewer gets source diffs from their own clone; chat history stays local.
96
+
97
+ ### Update an outdated canvas
98
+
99
+ After pushing new commits, run `/pr-review-canvas 123` again. To rewrite a canvas for the
100
+ same commit, run `/pr-review-canvas 123 --force`. Replace the zip in the PR description.
101
+ Reviewers click **refresh**.
102
+
103
+ When the saved canvas describes a different PR head, **Canvas is outdated** appears at
104
+ the top. You can still read the older canvas, with its commit and distance shown; posting
105
+ from that view is disabled. Click **refresh** to check GitHub for changes and a newer zip.
106
+
107
+ ## Configuration
108
+
109
+ ### User-local preferences
110
+
111
+ Your appearance and AI Chat preferences are saved in `.pr-review/settings.yml` in your local
112
+ project directory. This file is ignored by Git, so each teammate can use their own settings.
113
+
114
+ Use **skin** and **theme** in the header to change the appearance.
115
+
116
+ For AI Chat, open **settings**, choose Claude Code or Codex, and optionally enter a model ID.
117
+ Leave the model blank to use the agent's default. You can also adjust the reply timeout and
118
+ maximum turns. Click **Test agent** to check the connection, then **save**.
119
+
120
+ Switching agents starts a new thread and keeps earlier threads. Server flags `--agent` and
121
+ `--model` override your saved chat preferences for that run.
122
+
123
+ ### Shared project settings
124
+
125
+ Edit `pr-review.config.yml` at the repository root and commit it to share settings with your team.
126
+ It controls review rules, layers, generation mode, test file patterns, prompt templates, and
127
+ whether AI Chat is enabled. The settings dialog displays this configuration; edit the file to
128
+ change it. See the [configuration reference](docs/reference.md#project-config).
129
+
130
+ Canvas generation follows the [skill's model rules](skills/pr-review-canvas/SKILL.md#model-choice).
131
+
132
+ ### Project prompt templates
133
+
134
+ A global install reads `pr-review.config.yml` from the project root. Use its `prompts`
135
+ map to replace individual templates with files you keep in the project's Git repository:
136
+
137
+ ```yaml
138
+ prompts:
139
+ generation-format.md: review-prompts/generation-format.md
140
+ generation-surfacing.md: review-prompts/generation-surfacing.md
141
+ chat-seed.md: review-prompts/chat-seed.md
142
+ ```
143
+
144
+ To start from the installed templates (for an npm global install):
145
+
146
+ ```bash
147
+ mkdir -p review-prompts
148
+ cp "$(npm root -g)/@vintasoftware/pr-review-canvas/prompts/"*.md review-prompts/
149
+ ```
150
+
151
+ Edit the copies and add entries only for the templates you want to override. Commit
152
+ `pr-review.config.yml` and the referenced files together. Paths resolve from the project
153
+ root, including when running from a subdirectory or using `--repo`. Absolute paths also
154
+ work for personal templates shared across projects. Omitted entries use the installed
155
+ package's defaults; a configured file that cannot be read causes an error.
156
+
157
+ The six supported keys are `generation-format.md` (schema and output rules),
158
+ `generation-strict.md` and `generation-surfacing.md` (mode wrappers),
159
+ `quality-standards.md` (bundled code standards), `layers-default.md` (taxonomy prose),
160
+ and `chat-seed.md` (the opening AI Chat instructions). `generation.mode` still selects
161
+ the wrapper. The rulebook still takes precedence over code standards, and configured
162
+ layers and caps still supply the template data.
163
+
164
+ Each file replaces a whole template. Preserve its `{{TOKENS}}`, including `{{FORMAT}}`
165
+ in generation wrappers, to keep the generated context and output contract. Unknown
166
+ generation tokens fail rendering. Chat leaves unknown tokens as written. Prompt edits
167
+ do not change the output schema or validation rules enforced by the tool. Overrides
168
+ remain yours across tool upgrades; compare them with new bundled templates when upgrading.
169
+
170
+ Run `prepare` again to apply generation edits (use `--force` for an existing canvas).
171
+ Restart the server after changing the config; chat template edits apply to new threads.
172
+
173
+ ## Contributing
174
+
175
+ In a clone of this tool, use pnpm for the shared lockfile and development checks:
176
+
177
+ ```bash
178
+ corepack pnpm --version
179
+ corepack pnpm install --frozen-lockfile
180
+ corepack pnpm exec playwright install --with-deps chromium
181
+ corepack pnpm verify
182
+ corepack pnpm start --repo /path/to/your-project
183
+ ```
184
+
185
+ Run `pr-review --help` for CLI commands. Local data goes in the project's `.pr-review/`
186
+ directory; keep it out of Git.
187
+
188
+ See [Publishing to npm](docs/publishing.md) for release checks and first-publish instructions.
189
+
190
+ ## License
191
+
192
+ Licensed under the [Apache License 2.0](LICENSE).
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { tsImport } from 'tsx/esm/api'
3
+
4
+ const cli = await tsImport('../src/cli.ts', import.meta.url)
5
+ process.exitCode = await cli.main(process.argv.slice(2))