memento-mori-jester 0.1.3

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Memento Mori Jester contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,313 @@
1
+ # Memento Mori Jester
2
+
3
+ [![CI](https://github.com/Martin123132/Memento-Mori/actions/workflows/ci.yml/badge.svg)](https://github.com/Martin123132/Memento-Mori/actions/workflows/ci.yml)
4
+ [![npm version](https://img.shields.io/npm/v/memento-mori-jester.svg)](https://www.npmjs.com/package/memento-mori-jester)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+
7
+ A local court-jester sidecar for AI coding agents. It reviews plans, shell commands, diffs, and final answers for overconfidence, missing verification, and obvious footguns.
8
+
9
+ It roasts the reasoning, not the human.
10
+
11
+ ## Try It
12
+
13
+ Run directly from GitHub now:
14
+
15
+ ```powershell
16
+ npx -y github:Martin123132/Memento-Mori command "git reset --hard"
17
+ ```
18
+
19
+ After npm publish:
20
+
21
+ ```powershell
22
+ npx -y memento-mori-jester@latest command "git reset --hard"
23
+ ```
24
+
25
+ Installed globally:
26
+
27
+ ```powershell
28
+ npm install -g memento-mori-jester
29
+ jester command "Remove-Item .\dist -Recurse -Force"
30
+ ```
31
+
32
+ From a local checkout:
33
+
34
+ ```powershell
35
+ git clone https://github.com/Martin123132/Memento-Mori.git
36
+ cd Memento-Mori
37
+ npm.cmd install
38
+ npm.cmd run build
39
+ node .\dist\cli.js command "git reset --hard"
40
+ ```
41
+
42
+ Expected vibe:
43
+
44
+ ```text
45
+ Jester verdict: BLOCK (100/100)
46
+ A dazzling command, if the desired outcome is court-sponsored regret.
47
+ ```
48
+
49
+ ## Setup Wizard
50
+
51
+ For a copy-pasteable MCP config and suggested agent instruction:
52
+
53
+ ```powershell
54
+ npx -y github:Martin123132/Memento-Mori init --package github:Martin123132/Memento-Mori
55
+ ```
56
+
57
+ For a starter kit that writes project files:
58
+
59
+ ```powershell
60
+ npx -y github:Martin123132/Memento-Mori bootstrap --preset node --package github:Martin123132/Memento-Mori
61
+ ```
62
+
63
+ After npm publish:
64
+
65
+ ```powershell
66
+ npx -y memento-mori-jester@latest init
67
+ npx -y memento-mori-jester@latest bootstrap --preset node
68
+ ```
69
+
70
+ For this local checkout before npm publish:
71
+
72
+ ```powershell
73
+ node .\dist\cli.js init --mode local
74
+ node .\dist\cli.js bootstrap --mode local --preset node
75
+ ```
76
+
77
+ `bootstrap` writes:
78
+
79
+ - `jester.config.json`
80
+ - `memento-mori.mcp.json`
81
+ - `MEMENTO_MORI.md`
82
+
83
+ It keeps existing files by default. Use `--force` to overwrite them, and `--hook pre-commit` or `--hook pre-push` to install managed git hooks at the same time.
84
+
85
+ Modes:
86
+
87
+ - `npx`: MCP clients launch the package through `npx -y memento-mori-jester@latest mcp-server`.
88
+ - `global`: MCP clients launch `memento-mori-jester-mcp`, assuming the package is globally installed.
89
+ - `local`: MCP clients launch the built `dist/server.js` in this checkout.
90
+
91
+ ## CLI
92
+
93
+ ```powershell
94
+ jester plan "I will just refactor auth and ship it"
95
+ jester command "git reset --hard"
96
+ git diff | jester diff --fail-on block
97
+ jester final --file .\final-answer.txt --tone professional
98
+ jester doctor
99
+ jester bootstrap --preset node
100
+ jester config init
101
+ jester install-hook pre-commit
102
+ jester mcp-config --mode npx
103
+ ```
104
+
105
+ The package-name binary works too:
106
+
107
+ ```powershell
108
+ memento-mori-jester plan "This should probably work"
109
+ ```
110
+
111
+ Tones:
112
+
113
+ - `gentle_stoic`
114
+ - `court_jester`
115
+ - `absolute_menace`
116
+ - `professional`
117
+
118
+ Risk tolerance:
119
+
120
+ - `low`
121
+ - `medium`
122
+ - `high`
123
+
124
+ ## Project Config
125
+
126
+ Create a config file in your repo:
127
+
128
+ ```powershell
129
+ jester config init
130
+ ```
131
+
132
+ The CLI and MCP server automatically search upward for `jester.config.json` or `.jester.json`.
133
+
134
+ Example:
135
+
136
+ ```json
137
+ {
138
+ "tone": "court_jester",
139
+ "intensity": 3,
140
+ "riskTolerance": "medium",
141
+ "hookFailOn": "block",
142
+ "blockedCommands": [
143
+ "git reset --hard",
144
+ "git clean -fd"
145
+ ],
146
+ "sensitiveDomains": [
147
+ "auth",
148
+ "billing",
149
+ "payments",
150
+ "production",
151
+ "customer data"
152
+ ],
153
+ "customRules": [
154
+ {
155
+ "id": "no-force-push-main",
156
+ "pattern": "git\\s+push\\s+--force(?:-with-lease)?\\s+origin\\s+main",
157
+ "severity": 5,
158
+ "title": "Force-push to main",
159
+ "detail": "This project treats force-pushing main as a stop-and-think event.",
160
+ "suggestedCheck": "Create a branch or use --force-with-lease only after confirming the protected branch policy.",
161
+ "kinds": ["command", "plan"]
162
+ }
163
+ ]
164
+ }
165
+ ```
166
+
167
+ Useful config commands:
168
+
169
+ ```powershell
170
+ jester config show
171
+ jester config show --json
172
+ jester config init --force
173
+ jester config init --preset node
174
+ jester config init --preset python
175
+ jester config init --preset security
176
+ jester config presets
177
+ jester config validate
178
+ jester config validate --json
179
+ jester plan "I will deploy-prod now" --config .\jester.config.json
180
+ jester command "git reset --hard" --no-config
181
+ ```
182
+
183
+ Presets layer extra rules on top of the default config:
184
+
185
+ - `node`: npm lifecycle scripts, publish/unpublish, package metadata.
186
+ - `python`: dependency files, migrations, pickle, eval/exec.
187
+ - `security`: lower risk tolerance, TLS/CORS checks, token/permission-sensitive areas.
188
+
189
+ ## Git Hooks
190
+
191
+ Install a pre-commit hook that reviews staged changes:
192
+
193
+ ```powershell
194
+ jester install-hook pre-commit
195
+ ```
196
+
197
+ Install a pre-push hook that reviews unpushed changes:
198
+
199
+ ```powershell
200
+ jester install-hook pre-push
201
+ ```
202
+
203
+ Hook commands:
204
+
205
+ ```powershell
206
+ jester hook-status
207
+ jester install-hook pre-commit --fail-on caution
208
+ jester install-hook pre-commit --mode local --force
209
+ jester uninstall-hook pre-commit
210
+ ```
211
+
212
+ Hooks refuse to overwrite or remove non-jester hooks unless you pass `--force`.
213
+
214
+ ## MCP Server
215
+
216
+ The MCP server exposes:
217
+
218
+ - `jester_review_plan`
219
+ - `jester_check_command`
220
+ - `jester_review_diff`
221
+ - `jester_final_answer_roast`
222
+
223
+ Generate config:
224
+
225
+ ```powershell
226
+ jester mcp-config --mode npx
227
+ jester mcp-config --mode global
228
+ jester mcp-config --mode local
229
+ ```
230
+
231
+ Default `npx` config:
232
+
233
+ ```json
234
+ {
235
+ "mcpServers": {
236
+ "memento-mori-jester": {
237
+ "command": "npx",
238
+ "args": [
239
+ "-y",
240
+ "memento-mori-jester@latest",
241
+ "mcp-server"
242
+ ]
243
+ }
244
+ }
245
+ }
246
+ ```
247
+
248
+ Suggested agent instruction:
249
+
250
+ ```text
251
+ Before risky commands, final answers, commits, or large edits, call the Memento Mori Jester. Treat BLOCK as requiring a changed plan, and CAUTION as requiring at least one concrete verification step.
252
+ ```
253
+
254
+ More setup examples:
255
+
256
+ - [Agent Setup](docs/AGENTS.md)
257
+ - [GitHub Actions](docs/GITHUB_ACTIONS.md)
258
+
259
+ ## Installer Scripts
260
+
261
+ People can run the scripts from the repo or raw GitHub URLs.
262
+
263
+ Windows:
264
+
265
+ ```powershell
266
+ powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1
267
+ ```
268
+
269
+ From GitHub:
270
+
271
+ ```powershell
272
+ iwr https://raw.githubusercontent.com/Martin123132/Memento-Mori/main/scripts/install.ps1 -OutFile install-jester.ps1
273
+ powershell -ExecutionPolicy Bypass -File .\install-jester.ps1
274
+ ```
275
+
276
+ macOS/Linux:
277
+
278
+ ```bash
279
+ bash ./scripts/install.sh
280
+ ```
281
+
282
+ From GitHub:
283
+
284
+ ```bash
285
+ curl -fsSL https://raw.githubusercontent.com/Martin123132/Memento-Mori/main/scripts/install.sh | bash
286
+ ```
287
+
288
+ Both scripts check Node 20+, run a smoke `doctor`, and print MCP config.
289
+
290
+ ## What It Catches
291
+
292
+ - Destructive commands such as recursive forced deletes, risky git cleanup, pipe-to-shell installs, broad database deletion, and over-broad permissions.
293
+ - Agent overconfidence in plans: "just", "obvious", "probably", "should work", and plans with no verification step.
294
+ - Diffs with removed tests, type suppressions, debug logs, temporary markers, sensitive domains, and large deletions.
295
+ - Final answers with "done/fixed/works" claims that do not mention evidence.
296
+ - Project-specific commands, domains, and regex rules from `jester.config.json`.
297
+
298
+ ## Publishing
299
+
300
+ The npm package name `memento-mori-jester` was available when checked on 2026-05-17.
301
+
302
+ Release checklist:
303
+
304
+ ```powershell
305
+ npm login
306
+ npm test
307
+ npm run pack:dry
308
+ npm publish
309
+ ```
310
+
311
+ GitHub: <https://github.com/Martin123132/Memento-Mori>
312
+
313
+ See [docs/RELEASE.md](docs/RELEASE.md).
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};