wellactually 0.0.0-stage → 0.11.0-rc.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.
Files changed (77) hide show
  1. package/.claude-plugin/plugin.json +20 -0
  2. package/.codex-plugin/mcp.json +13 -0
  3. package/.codex-plugin/plugin.json +16 -0
  4. package/LICENSE +202 -0
  5. package/README.md +236 -2
  6. package/assets/README.md +5 -0
  7. package/assets/illustration-dark.png +0 -0
  8. package/assets/illustration-light.png +0 -0
  9. package/dist/opencode.mjs +4178 -0
  10. package/dist/pi.mjs +4155 -0
  11. package/dist/review.mjs +47082 -0
  12. package/dist/tui.mjs +3847 -0
  13. package/dist/web/card/card.html +32 -0
  14. package/dist/web/inbox/index.html +3666 -0
  15. package/dist/web/offline/offline.css +2 -0
  16. package/dist/web/offline/offline.js +1 -0
  17. package/dist/web/offline-ssr/offline-ssr.cjs +21910 -0
  18. package/dist/web/rule/rule.css +3 -0
  19. package/dist/web/rule/rule.js +0 -0
  20. package/dist/web/rule-ssr/rule-ssr.cjs +30873 -0
  21. package/dist/wellactually-hook.mjs +5964 -0
  22. package/dist/wellactually-log.mjs +52 -0
  23. package/dist/wellactually-worker.mjs +4227 -0
  24. package/dist/wellactually.mjs +51815 -0
  25. package/docs/releasing-review.md +103 -0
  26. package/hooks/hooks.json +73 -0
  27. package/opencode/skills/wellactually-apply-review-fixes/SKILL.md +35 -0
  28. package/opencode/skills/wellactually-audit/SKILL.md +139 -0
  29. package/opencode/skills/wellactually-disable/SKILL.md +23 -0
  30. package/opencode/skills/wellactually-enable/SKILL.md +19 -0
  31. package/opencode/skills/wellactually-login/SKILL.md +18 -0
  32. package/opencode/skills/wellactually-post-findings/SKILL.md +77 -0
  33. package/opencode/skills/wellactually-review/SKILL.md +173 -0
  34. package/opencode/skills/wellactually-review/aggregator.md +24 -0
  35. package/opencode/skills/wellactually-review/claude-code.md +47 -0
  36. package/opencode/skills/wellactually-review/codex.md +30 -0
  37. package/opencode/skills/wellactually-review/filter-principles.md +32 -0
  38. package/opencode/skills/wellactually-review/finding-writing.md +39 -0
  39. package/opencode/skills/wellactually-review/findings.md +51 -0
  40. package/opencode/skills/wellactually-review/gather-information.md +61 -0
  41. package/opencode/skills/wellactually-review/opencode.md +7 -0
  42. package/opencode/skills/wellactually-review/pi.md +10 -0
  43. package/opencode/skills/wellactually-review/prepare-working-tree.md +5 -0
  44. package/opencode/skills/wellactually-review/queue-reviewer.md +55 -0
  45. package/opencode/skills/wellactually-review/queue-session.md +13 -0
  46. package/opencode/skills/wellactually-review/reviewer.md +122 -0
  47. package/opencode/skills/wellactually-review/scripts/review.mjs +1 -0
  48. package/opencode/skills/wellactually-review/splitter.md +26 -0
  49. package/opencode/skills/wellactually-review/verification-worker.md +40 -0
  50. package/opencode/skills/wellactually-review/verifier.md +35 -0
  51. package/opencode/skills/wellactually-sync/SKILL.md +16 -0
  52. package/package.json +53 -4
  53. package/skills/apply-review-fixes/SKILL.md +33 -0
  54. package/skills/audit/SKILL.md +137 -0
  55. package/skills/disable/SKILL.md +21 -0
  56. package/skills/enable/SKILL.md +17 -0
  57. package/skills/login/SKILL.md +16 -0
  58. package/skills/post-findings/SKILL.md +75 -0
  59. package/skills/review/SKILL.md +171 -0
  60. package/skills/review/aggregator.md +24 -0
  61. package/skills/review/claude-code.md +47 -0
  62. package/skills/review/codex.md +30 -0
  63. package/skills/review/filter-principles.md +32 -0
  64. package/skills/review/finding-writing.md +39 -0
  65. package/skills/review/findings.md +51 -0
  66. package/skills/review/gather-information.md +61 -0
  67. package/skills/review/opencode.md +7 -0
  68. package/skills/review/pi.md +10 -0
  69. package/skills/review/prepare-working-tree.md +5 -0
  70. package/skills/review/queue-reviewer.md +55 -0
  71. package/skills/review/queue-session.md +13 -0
  72. package/skills/review/reviewer.md +122 -0
  73. package/skills/review/scripts/review.mjs +1 -0
  74. package/skills/review/splitter.md +26 -0
  75. package/skills/review/verification-worker.md +40 -0
  76. package/skills/review/verifier.md +35 -0
  77. package/skills/sync/SKILL.md +14 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "wellactually",
3
+ "version": "0.11.0-rc.2",
4
+ "description": "Runs the principles on your Well Actually advisory board while your agent works, and lets it author and rate them.",
5
+ "author": {
6
+ "name": "Pascal Welsch"
7
+ },
8
+ "mcpServers": {
9
+ "wellactually": {
10
+ "command": "node",
11
+ "env": {
12
+ "WELLACTUALLY_REVIEW_HOST": "claude"
13
+ },
14
+ "args": [
15
+ "${CLAUDE_PLUGIN_ROOT}/dist/wellactually.mjs",
16
+ "mcp"
17
+ ]
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "mcpServers": {
3
+ "wellactually": {
4
+ "command": "node",
5
+ "args": [
6
+ "./dist/wellactually.mjs",
7
+ "mcp"
8
+ ],
9
+ "cwd": ".",
10
+ "env": { "WELLACTUALLY_REVIEW_HOST": "codex" }
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "wellactually",
3
+ "version": "0.11.0-rc.2",
4
+ "description": "Runs the principles on your Well Actually advisory board while your agent works, and lets it author and rate them.",
5
+ "author": {
6
+ "name": "Pascal Welsch"
7
+ },
8
+ "skills": "./skills/",
9
+ "mcpServers": "./.codex-plugin/mcp.json",
10
+ "interface": {
11
+ "displayName": "Well Actually",
12
+ "shortDescription": "Engineering principles from the experts you choose.",
13
+ "developerName": "Pascal Welsch",
14
+ "category": "Productivity"
15
+ }
16
+ }
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 Pascal Welsch
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 CHANGED
@@ -1,3 +1,237 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <img src="assets/illustration-light.png" width="420" alt="An experienced developer raises one finger over the shoulder of a coding robot">
3
+ </p>
2
4
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
5
+ <h1 align="center">Well Actually</h1>
6
+
7
+ <p align="center">
8
+ Experts correct LLMs:<br>
9
+ <em>"Well actually, there's a better way to do this in [insert technology]."</em>
10
+ </p>
11
+
12
+ Your coding agent is a capable generalist.
13
+ It has not spent years in your framework, your niche or closed source enterprise software.
14
+ Well Actually brings what the experts there have learned into your agent.
15
+
16
+ Principles are not hard rules like a linter's.
17
+ They are advice, like an expert glancing over a diff who has seen a pattern go wrong twenty times: it is most likely wrong again, and there is a better way.
18
+ Your agent hears it and decides.
19
+
20
+ A principle is advice plus a detector.
21
+ The detector looks at what your agent just did, and when it finds something, the agent reads the advice.
22
+ Unlike a rules file, nothing sits in your agent's context up front: advice only enters it when it applies.
23
+ Anyone can publish principles on [the Well Actually registry](https://wellactually.dev), and you choose whose principles sit on your advisory board.
24
+
25
+ ## Install
26
+
27
+ The plugin needs [Node](https://nodejs.org) 20 or newer and nothing else.
28
+ Check with `node --version` before you install it, because without Node no principle reaches your agent.
29
+
30
+ Claude Code:
31
+
32
+ ```text
33
+ /plugin marketplace add passsy/wellactually
34
+ /plugin install wellactually@wellactually
35
+ /wellactually:login
36
+ ```
37
+
38
+ The last line connects this machine to your advisory board and downloads it.
39
+
40
+ Claude Code leaves auto-update off for marketplaces outside Anthropic's own.
41
+ To get new releases of the plugin, type `/plugin`, open the Marketplaces tab, select `wellactually` and choose Enable auto-update.
42
+
43
+ Codex:
44
+
45
+ ```bash
46
+ codex plugin marketplace add passsy/wellactually
47
+ ```
48
+
49
+ ```bash
50
+ codex plugin add wellactually@wellactually
51
+ ```
52
+
53
+ Then open Codex, type `/hooks` and press `t` to trust the plugin's hooks, then type `$wellactually:login`.
54
+ Codex does not run a new plugin's hooks until you trust them, so no principle reaches the agent before that.
55
+
56
+ OpenCode:
57
+
58
+ ```bash
59
+ opencode plugin add 'github:passsy/wellactually#path:opencode'
60
+ ```
61
+
62
+ Then open OpenCode and type `@wellactually-login`.
63
+ `opencode plugin add` needs OpenCode 2.
64
+ OpenCode 1 from version 1.18.29 runs the plugin too, from a clone of this repository, as [the install guide](https://wellactually.dev/docs/getting-started/install#opencode) shows, and there the skill is `/wellactually-login`.
65
+
66
+ pi:
67
+
68
+ ```bash
69
+ pi install git:github.com/passsy/wellactually
70
+ ```
71
+
72
+ Then open pi and type `/skill:wellactually-login`.
73
+
74
+ ### CI and cloud agents
75
+
76
+ A CI runner or a cloud agent starts on a fresh machine every run, where nobody can confirm a login code.
77
+ Create a token on [your advisory board](https://wellactually.dev/advisory-board) under connected machines, and store it as the secret `WELLACTUALLY_TOKEN` where the agent runs.
78
+ The plugin and the `wellactually` command then sign in with it and never write it to disk.
79
+ Run `wellactually sync`, or the plugin's sync skill, at the start of the run, so the advisory board is there before the agent works.
80
+ Ratings the agent gives reach the experts as they do from your own machine.
81
+ Revoke the token on the website to stop it.
82
+
83
+ When a newer release of the plugin is out, it tells you at the start of a session, at most once a day, with the command that updates it in your agent.
84
+ Set `WELLACTUALLY_UPDATE_CHECK=0` to turn that off.
85
+
86
+ ## What it does on your machine
87
+
88
+ - When your agent writes or reads a file, gets a prompt or is about to run a shell command, a hook shows that one input to the detectors on your advisory board.
89
+ - A detector that finds something puts its expert's advice in front of the agent, once per session in full and as a pointer after that.
90
+ - The hook never uses the network.
91
+ It reads the principles `sync` downloaded earlier.
92
+ - `sync` runs when a session starts.
93
+ It downloads what is new on your advisory board and reports counts, see "What leaves your machine".
94
+ - Once a day, in the background, it reads the version of the newest release of the plugin from this repository on GitHub.
95
+
96
+ ## Detectors are other people's code
97
+
98
+ So they are contained.
99
+
100
+ - A detector runs in a QuickJS WebAssembly isolate.
101
+ It gets its input as JSON and returns findings as JSON.
102
+ There is no network and no process inside.
103
+ - It can read text files on your machine and cannot change any.
104
+ Without a network there is nowhere to send them, and the next point keeps them out of your agent's context.
105
+ - It has 100 ms and 32 MB.
106
+ One that exceeds either is stopped and reported, and your agent carries on.
107
+ - Whatever a detector reports must occur word for word in its input, or the finding is dropped.
108
+ A detector cannot compose text for your agent at runtime.
109
+ - Each download is checked against its content hash before it is stored.
110
+ - Updates to principles are automatic.
111
+ What an expert on your advisory board releases runs from your next sync, so follow the experts you trust.
112
+ You can switch off any single principle, or unfollow the expert.
113
+
114
+ The code that does this is public: [`packages/core/src/detector/sandbox.ts`](packages/core/src/detector/sandbox.ts) is the isolate, and [`packages/cli/src/board/board.ts`](packages/cli/src/board/board.ts) runs an advisory board.
115
+
116
+ ## What leaves your machine
117
+
118
+ - How often each principle fired: a day, a hash and a count.
119
+ - A rating, when your agent gives one: the principle's hash and `up`, `down` or `not_applicable`.
120
+ - Review selections, suggestions and completed fixes: the principle and pinned
121
+ revision, event time, an opaque deduplication ID, and priority for suggestions
122
+ and fixes. Reviews do not send helpfulness ratings.
123
+
124
+ No path, file content, prompt, command or finding is sent.
125
+ The daily look for a newer release of the plugin is a plain download from GitHub and sends nothing.
126
+ Ask your agent to switch reporting off, and it turns these reports off.
127
+
128
+ ## Review a change
129
+
130
+ The `review` skill checks changes, files, folders and projects against your advisory board, including principles without detectors. Git is optional.
131
+ Read-only reviewers work through queues of applicable principles. An aggregator
132
+ merges duplicate findings into one finding with multiple occurrences. Proof
133
+ workers then investigate the findings in isolated worktrees. The report states
134
+ coverage, executable proof and limitations; a finding need not have a test to
135
+ be useful.
136
+
137
+ Run `/wellactually:review` in Claude Code or `$wellactually:review` in Codex with a synced advisory board.
138
+ Reviews use subagents where supported.
139
+ The findings inbox keeps your accept, reject, note and fixed decisions locally.
140
+ Posting accepted findings to the PR is a separate explicit action.
141
+
142
+ The forthcoming npm distribution is built and tested from the same sources for
143
+ all four hosts. The current Git installation commands above remain active until
144
+ the registry rollout is complete; see [the release sequence](docs/releasing-review.md).
145
+
146
+ ## Write a principle
147
+
148
+ A principle is a directory, and its name is the principle's id:
149
+
150
+ ```text
151
+ avoid-late/
152
+ principle.md the advice: a heading, one sentence of summary, then the rest
153
+ detector.ts a handler per event it reacts to: onWrite, onRead, onDelete, onPrompt, onCommand, onOutput
154
+ detector.test.ts the tests: what the detector reports for an event
155
+ ```
156
+
157
+ A detector reads `onWrite({ globs: ["**/*.dart"], *detect(event) { ... yield { line: written.line }; } })`.
158
+ A test reads `expect(detect(write("lib/user.dart", code))).toEqual([{ line: 2 }])`.
159
+ The tests must pass, make the detector fire at least once, and show it staying quiet at least once.
160
+ [Pascal's principles](https://wellactually.dev/e/passsy) on the registry are examples to read.
161
+
162
+ Write one in the browser on [wellactually.dev](https://wellactually.dev/studio/new), with nothing installed, or ask your agent.
163
+ The plugin gives it tools to create a principle, run its tests, try it on a file, probe a repository and publish it.
164
+ Building a principle needs esbuild, which the plugin does not carry, so install the SDK in the repository that holds your principles, which brings it:
165
+
166
+ ```bash
167
+ npm install --save-dev github:passsy/wellactually#sdk vitest
168
+ ```
169
+
170
+ `npm test` then runs the principles' tests with vitest.
171
+
172
+ A detector may import `@wellactually/sdk/v4`, which is in `packages/sdk`, its own files, and packages from npm that its `package.json` names.
173
+ The `v4` is the detector API version it is written against.
174
+ Version 4 added the lines a write removed, `event.removed`, and `onDelete` for a deleted file.
175
+ A principle written against `v3` keeps running as it was.
176
+
177
+ ## What is in here
178
+
179
+ | Path | What it is |
180
+ | ----------------- | ------------------------------------------------------------------------------------- |
181
+ | `hooks`, `skills` | The plugin: when the hook runs, and the skills such as `login`, `sync` and `audit`. |
182
+ | `dist` | The command as one file, built from `packages/cli`. The plugin runs it. |
183
+ | `opencode` | The plugin for OpenCode, with its own copy of the command and the skills. |
184
+ | `packages/core` | Builds, checks and runs principles: the isolate, the bundler and the tests. |
185
+ | `packages/sdk` | The types and helpers a detector may import. |
186
+ | `packages/cli` | The command the plugin runs: the hook, the advisory board and the MCP server. |
187
+ | `evaluator` | Checks with real agents that the framing around advice moves them the right way. |
188
+ | `scripts` | Builds `dist` and `opencode`, sets the version of a release, writes the `sdk` branch. |
189
+
190
+ The registry is not in this repository.
191
+
192
+ ## Build it yourself
193
+
194
+ ```bash
195
+ npm install
196
+ ```
197
+
198
+ ```bash
199
+ npm test
200
+ ```
201
+
202
+ ```bash
203
+ npm run build
204
+ ```
205
+
206
+ `npm run build` writes `dist/wellactually.mjs`, the file the plugin runs, and next to it `opencode.mjs` and `pi.mjs`, the plugins of OpenCode and pi.
207
+ It also copies the command and the skills into `opencode`, which OpenCode installs on its own.
208
+ Both folders are committed, because an agent installs a plugin from git without building it.
209
+
210
+ ## Release
211
+
212
+ ```bash
213
+ node scripts/version.mjs 0.9.29
214
+ ```
215
+
216
+ ```bash
217
+ npm run build
218
+ ```
219
+
220
+ Commit the result as `Release 0.9.29` and push it.
221
+ Agents update the plugin from `main`.
222
+
223
+ The SDK is released to the `sdk` branch, from a checkout of it next to this one:
224
+
225
+ ```bash
226
+ git worktree add ../wellactually-sdk sdk
227
+ ```
228
+
229
+ ```bash
230
+ node scripts/release-sdk.mjs ../wellactually-sdk
231
+ ```
232
+
233
+ Then commit it there as `Release 0.9.29` and push the `sdk` branch.
234
+
235
+ ## License
236
+
237
+ [Apache License 2.0](LICENSE)
@@ -0,0 +1,5 @@
1
+ # assets
2
+
3
+ The illustration at the top of the README.
4
+
5
+ GitHub shows `illustration-dark.png` in its dark theme and `illustration-light.png` in its light theme.
Binary file
Binary file