lithermes-ai 0.5.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 (133) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +245 -0
  3. package/README_Ko-KR.md +245 -0
  4. package/assets/lithermes-plugin/NOTICE.md +37 -0
  5. package/assets/lithermes-plugin/README.md +40 -0
  6. package/assets/lithermes-plugin/__init__.py +179 -0
  7. package/assets/lithermes-plugin/core.py +853 -0
  8. package/assets/lithermes-plugin/litgoal/__init__.py +10 -0
  9. package/assets/lithermes-plugin/litgoal/cli.py +133 -0
  10. package/assets/lithermes-plugin/litgoal/hook.py +48 -0
  11. package/assets/lithermes-plugin/litgoal/model.py +171 -0
  12. package/assets/lithermes-plugin/litgoal/runtime.py +273 -0
  13. package/assets/lithermes-plugin/litgoal/store.py +93 -0
  14. package/assets/lithermes-plugin/litgoal/tools.py +228 -0
  15. package/assets/lithermes-plugin/payload-version.json +471 -0
  16. package/assets/lithermes-plugin/plugin.yaml +9 -0
  17. package/assets/lithermes-plugin/skills/ai-slop-remover/SKILL.md +142 -0
  18. package/assets/lithermes-plugin/skills/comment-checker/SKILL.md +50 -0
  19. package/assets/lithermes-plugin/skills/debugging/SKILL.md +116 -0
  20. package/assets/lithermes-plugin/skills/debugging/references/methodology/00-setup.md +108 -0
  21. package/assets/lithermes-plugin/skills/debugging/references/methodology/02-investigate.md +121 -0
  22. package/assets/lithermes-plugin/skills/debugging/references/methodology/04-oracle-triple.md +136 -0
  23. package/assets/lithermes-plugin/skills/debugging/references/methodology/05-escalate.md +69 -0
  24. package/assets/lithermes-plugin/skills/debugging/references/methodology/06-fix.md +116 -0
  25. package/assets/lithermes-plugin/skills/debugging/references/methodology/08-qa.md +94 -0
  26. package/assets/lithermes-plugin/skills/debugging/references/methodology/09-cleanup.md +164 -0
  27. package/assets/lithermes-plugin/skills/debugging/references/methodology/partial-runtime-evidence.md +229 -0
  28. package/assets/lithermes-plugin/skills/debugging/references/runtimes/bundled-js-binary.md +415 -0
  29. package/assets/lithermes-plugin/skills/debugging/references/runtimes/go.md +252 -0
  30. package/assets/lithermes-plugin/skills/debugging/references/runtimes/native-binary.md +484 -0
  31. package/assets/lithermes-plugin/skills/debugging/references/runtimes/node.md +260 -0
  32. package/assets/lithermes-plugin/skills/debugging/references/runtimes/python.md +248 -0
  33. package/assets/lithermes-plugin/skills/debugging/references/runtimes/rust.md +234 -0
  34. package/assets/lithermes-plugin/skills/debugging/references/tools/ghidra.md +212 -0
  35. package/assets/lithermes-plugin/skills/debugging/references/tools/playwright-cli.md +194 -0
  36. package/assets/lithermes-plugin/skills/debugging/references/tools/pwndbg.md +263 -0
  37. package/assets/lithermes-plugin/skills/debugging/references/tools/pwntools.md +265 -0
  38. package/assets/lithermes-plugin/skills/frontend-ui-ux/SKILL.md +77 -0
  39. package/assets/lithermes-plugin/skills/lit-plan/SKILL.md +374 -0
  40. package/assets/lithermes-plugin/skills/litgoal/.gitkeep +0 -0
  41. package/assets/lithermes-plugin/skills/litgoal/SKILL.md +207 -0
  42. package/assets/lithermes-plugin/skills/litwork/SKILL.md +262 -0
  43. package/assets/lithermes-plugin/skills/lsp/SKILL.md +53 -0
  44. package/assets/lithermes-plugin/skills/programming/SKILL.md +463 -0
  45. package/assets/lithermes-plugin/skills/programming/references/go/README.md +90 -0
  46. package/assets/lithermes-plugin/skills/programming/references/go/backend-stack.md +641 -0
  47. package/assets/lithermes-plugin/skills/programming/references/go/bootstrap.md +328 -0
  48. package/assets/lithermes-plugin/skills/programming/references/go/bubbletea-v2.md +360 -0
  49. package/assets/lithermes-plugin/skills/programming/references/go/cobra-stack.md +468 -0
  50. package/assets/lithermes-plugin/skills/programming/references/go/concurrency.md +362 -0
  51. package/assets/lithermes-plugin/skills/programming/references/go/data-modeling.md +329 -0
  52. package/assets/lithermes-plugin/skills/programming/references/go/error-handling.md +359 -0
  53. package/assets/lithermes-plugin/skills/programming/references/go/golangci-strict.md +236 -0
  54. package/assets/lithermes-plugin/skills/programming/references/go/grpc-connect.md +375 -0
  55. package/assets/lithermes-plugin/skills/programming/references/go/libraries.md +337 -0
  56. package/assets/lithermes-plugin/skills/programming/references/go/one-liners.md +202 -0
  57. package/assets/lithermes-plugin/skills/programming/references/go/sqlc-pgx.md +471 -0
  58. package/assets/lithermes-plugin/skills/programming/references/go/testing.md +467 -0
  59. package/assets/lithermes-plugin/skills/programming/references/go/type-patterns.md +298 -0
  60. package/assets/lithermes-plugin/skills/programming/references/python/README.md +314 -0
  61. package/assets/lithermes-plugin/skills/programming/references/python/async-anyio.md +442 -0
  62. package/assets/lithermes-plugin/skills/programming/references/python/data-modeling.md +233 -0
  63. package/assets/lithermes-plugin/skills/programming/references/python/data-processing.md +133 -0
  64. package/assets/lithermes-plugin/skills/programming/references/python/error-handling.md +218 -0
  65. package/assets/lithermes-plugin/skills/programming/references/python/fastapi-stack.md +316 -0
  66. package/assets/lithermes-plugin/skills/programming/references/python/httpx2-optimization.md +360 -0
  67. package/assets/lithermes-plugin/skills/programming/references/python/libraries.md +307 -0
  68. package/assets/lithermes-plugin/skills/programming/references/python/one-liners.md +268 -0
  69. package/assets/lithermes-plugin/skills/programming/references/python/orjson-stack.md +378 -0
  70. package/assets/lithermes-plugin/skills/programming/references/python/pydantic-ai.md +285 -0
  71. package/assets/lithermes-plugin/skills/programming/references/python/pyproject-strict.md +232 -0
  72. package/assets/lithermes-plugin/skills/programming/references/python/textual-tui.md +201 -0
  73. package/assets/lithermes-plugin/skills/programming/references/python/type-patterns.md +176 -0
  74. package/assets/lithermes-plugin/skills/programming/references/rust/README.md +317 -0
  75. package/assets/lithermes-plugin/skills/programming/references/rust/async-tokio.md +299 -0
  76. package/assets/lithermes-plugin/skills/programming/references/rust/axum-stack.md +467 -0
  77. package/assets/lithermes-plugin/skills/programming/references/rust/cargo-strict.md +317 -0
  78. package/assets/lithermes-plugin/skills/programming/references/rust/clap-stack.md +409 -0
  79. package/assets/lithermes-plugin/skills/programming/references/rust/concurrency.md +375 -0
  80. package/assets/lithermes-plugin/skills/programming/references/rust/libraries.md +439 -0
  81. package/assets/lithermes-plugin/skills/programming/references/rust/one-liners.md +291 -0
  82. package/assets/lithermes-plugin/skills/programming/references/rust/proptest-insta.md +429 -0
  83. package/assets/lithermes-plugin/skills/programming/references/rust/type-state.md +354 -0
  84. package/assets/lithermes-plugin/skills/programming/references/rust/unsafe-discipline.md +250 -0
  85. package/assets/lithermes-plugin/skills/programming/references/rust/zero-cost-safety.md +527 -0
  86. package/assets/lithermes-plugin/skills/programming/references/rust-ub/README.md +289 -0
  87. package/assets/lithermes-plugin/skills/programming/references/rust-ub/miri-sanitizers-loom.md +411 -0
  88. package/assets/lithermes-plugin/skills/programming/references/rust-ub/ub-taxonomy.md +269 -0
  89. package/assets/lithermes-plugin/skills/programming/references/typescript/README.md +195 -0
  90. package/assets/lithermes-plugin/skills/programming/references/typescript/backend-hono.md +672 -0
  91. package/assets/lithermes-plugin/skills/programming/references/typescript/bootstrap.md +199 -0
  92. package/assets/lithermes-plugin/skills/programming/references/typescript/data-modeling.md +202 -0
  93. package/assets/lithermes-plugin/skills/programming/references/typescript/error-handling.md +169 -0
  94. package/assets/lithermes-plugin/skills/programming/references/typescript/tsconfig-strict.md +152 -0
  95. package/assets/lithermes-plugin/skills/programming/references/typescript/type-patterns.md +196 -0
  96. package/assets/lithermes-plugin/skills/programming/scripts/go/check-no-excuse-rules.sh +173 -0
  97. package/assets/lithermes-plugin/skills/programming/scripts/go/new-project.py +138 -0
  98. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/.editorconfig +13 -0
  99. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/.golangci.yml +95 -0
  100. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/AGENTS.md.tmpl +24 -0
  101. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/README.md.tmpl +12 -0
  102. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/Taskfile.yml +40 -0
  103. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/ci.yml +37 -0
  104. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/config.go +24 -0
  105. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/gitignore +15 -0
  106. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/main.go.tmpl +22 -0
  107. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/run.go +15 -0
  108. package/assets/lithermes-plugin/skills/programming/scripts/python/check-no-excuse-rules.py +687 -0
  109. package/assets/lithermes-plugin/skills/programming/scripts/python/new-project.py +172 -0
  110. package/assets/lithermes-plugin/skills/programming/scripts/python/new-script.py +116 -0
  111. package/assets/lithermes-plugin/skills/programming/scripts/rust/check-no-excuse-rules.py +296 -0
  112. package/assets/lithermes-plugin/skills/programming/scripts/rust/check-no-excuse-rules.sh +158 -0
  113. package/assets/lithermes-plugin/skills/programming/scripts/rust/new-project.py +175 -0
  114. package/assets/lithermes-plugin/skills/programming/scripts/typescript/check-no-excuse-rules.ts +282 -0
  115. package/assets/lithermes-plugin/skills/programming/scripts/typescript/new-project.ts +177 -0
  116. package/assets/lithermes-plugin/skills/refactor/SKILL.md +770 -0
  117. package/assets/lithermes-plugin/skills/remove-ai-slops/SKILL.md +335 -0
  118. package/assets/lithermes-plugin/skills/review-work/SKILL.md +562 -0
  119. package/assets/lithermes-plugin/skills/rules/SKILL.md +41 -0
  120. package/assets/lithermes-plugin/skills/start-work/SKILL.md +332 -0
  121. package/bin/lithermes.js +8 -0
  122. package/cover.png +0 -0
  123. package/package.json +39 -0
  124. package/src/cli.js +129 -0
  125. package/src/lib/check.js +94 -0
  126. package/src/lib/config.js +170 -0
  127. package/src/lib/files.js +65 -0
  128. package/src/lib/hermesDiscovery.js +50 -0
  129. package/src/lib/hud.js +121 -0
  130. package/src/lib/install.js +159 -0
  131. package/src/lib/patch.js +153 -0
  132. package/src/lib/skins.js +113 -0
  133. package/src/lib/spinner.js +104 -0
@@ -0,0 +1,262 @@
1
+ ---
2
+ name: litwork
3
+ description: Hermes-native Litwork directive for /lit and /lit-loop execution.
4
+ ---
5
+
6
+ # LitHermes Litwork
7
+
8
+ > **Hermes-native overrides (authoritative — read first).** Hermes has **no
9
+ > model-facing goal tools**: do **not** call `create_goal`, `get_goal`, or
10
+ > `update_goal` (they do not exist). LitHermes binds the native standing `/goal`
11
+ > for you via the session goal manager; track success criteria + evidence with the
12
+ > durable LitHermes goal tools (`goal_set`, `goal_add_criterion`, `goal_evidence`,
13
+ > `goal_criterion_status`, `goal_complete`) and inspect with `hermes lithermes goal
14
+ > status`. Wherever the prose below says "Call `create_goal`" or "open a `# Goal`
15
+ > block", treat the goal as already bound and use `goal_set` for the durable
16
+ > criteria layer instead. To run a reviewer/worker lane use the native **`delegate_task`**
17
+ > tool (single child, or a `tasks:[{goal, context}]` batch) — inline the reviewer's
18
+ > mandate as the child's goal/context rather than naming any foreign agent type.
19
+
20
+ This skill provides the Hermes-native Litwork prompt discipline.
21
+ Use it when the user invokes `lit`, `litwork`, `/lit`, `/lit-loop`, `/lit-plan`, `/litwork-loop`, or `/litwork-plan` in Hermes.
22
+
23
+ LitHermes command mapping:
24
+
25
+ - `/lit` and `/lit-loop` start the execution loop and forward the task back to Hermes.
26
+ - `/lit-plan` creates a plan artifact and forwards the goal bootstrap back to Hermes.
27
+ - `/lit_loop` and `/lit_plan` are gateway-friendly aliases for Telegram-style dispatch.
28
+ - Run evidence should stay under `.hermes/lithermes/runs/<run-id>/` when the command creates a run.
29
+
30
+ <litwork-mode>
31
+
32
+ **MANDATORY**: First user-visible line this turn MUST be exactly:
33
+ `LITWORK MODE ENABLED!`
34
+
35
+ [CODE RED] Maximum precision. Outcome-first. Evidence-driven.
36
+
37
+ # Role
38
+ Expert coding agent. Plan obsessively. Ship verified work. No process
39
+ narration.
40
+
41
+ # Goal
42
+ Deliver EXACTLY what the user asked, end-to-end working, proven by
43
+ (a) a test written test-first that went RED→GREEN and (b) a manual-QA
44
+ scenario you actually run against the real surface (HTTP call / tmux /
45
+ browser use / computer use — see the channel table below) with the
46
+ artifact captured. Both gates, every change, no exceptions.
47
+ TESTS ALONE NEVER PROVE DONE. A green suite means the unit-level
48
+ contract holds; it does NOT mean the user-facing feature works. Every
49
+ criterion needs its own real-usage scenario, built fresh and exercised
50
+ through one of the four channels, every time.
51
+
52
+ # Manual-QA channels (PICK ONE PER CRITERION — ACTUALLY RUN IT)
53
+ For every criterion, build a real-usage scenario through ONE of these
54
+ four channels and run it yourself before declaring the criterion done.
55
+ The full test suite being green is NEVER verification on its own.
56
+
57
+ 1. HTTP call — hit the live endpoint with `curl -i` (or a
58
+ Playwright APIRequestContext); capture status line + headers +
59
+ body.
60
+ 2. tmux — `tmux new-session -d -s lit-qa-<criterion>`, drive with
61
+ `send-keys`, dump via `tmux capture-pane -pS -E -`; transcript
62
+ is the artifact.
63
+ 3. Browser use — drive the real page via Playwright / puppeteer /
64
+ Chromium; capture action log + screenshot path.
65
+ 4. Computer use — OS-level GUI automation (computer-use agent,
66
+ AppleScript, xdotool, etc.) against the running app; capture
67
+ action log + screenshot.
68
+
69
+ Auxiliary surfaces (pure CLI stdout / DB state diff / parsed config
70
+ dump) are valid evidence when the criterion is genuinely CLI- or
71
+ data-shaped, but they do NOT replace a channel scenario for any
72
+ user-facing behavior. `--dry-run`, printing the command, "should
73
+ respond", and "looks correct" never count.
74
+
75
+ # Bootstrap (DO ALL THREE BEFORE ANY OTHER WORK — NO SKIPPING)
76
+
77
+ ## 1. Bind the goal with binding success criteria
78
+ The native standing `/goal` is already bound for you by LitHermes (do NOT call
79
+ `create_goal` — it does not exist in Hermes). Declare the durable success
80
+ criteria with `goal_set` (objective + 3+ criteria). Goals are unlimited; never
81
+ invent a numeric budget or limit.
82
+ The criteria MUST list, upfront:
83
+ - The user-visible deliverable in one line.
84
+ - 3+ realistic QA scenarios: happy path, edge cases (boundary / empty /
85
+ malformed / concurrent), adjacent-surface regression checks named by
86
+ file + function.
87
+ - Each scenario MUST be paired with an automated test (unit /
88
+ integration / e2e — whichever exercises the real surface) named by
89
+ file + test id, written BEFORE the implementation.
90
+ - For each scenario, TWO pieces of evidence are required and BOTH
91
+ must be captured:
92
+ 1. RED→GREEN proof: the failing-test output BEFORE the change and
93
+ the passing-test output AFTER (test id + assertion message in
94
+ both). Tests added AFTER the green code do NOT satisfy this.
95
+ 2. Channel scenario artifact — name which Manual-QA channel
96
+ (HTTP call / tmux / browser use / computer use) the scenario
97
+ uses, run it yourself, capture the artifact named in the channel
98
+ table above.
99
+ Tests are the FLOOR (required, never sufficient); the channel
100
+ scenario is the CEILING (also required, every criterion, every
101
+ time). "tests pass" alone is NEVER done.
102
+
103
+ These scenarios are the contract. You are not done until every one of
104
+ them PASSES with its evidence captured.
105
+
106
+ ## 2. Open the durable notepad
107
+ Run: `NOTE=$(mktemp -t lit-$(date +%Y%m%d-%H%M%S).XXXXXX.md)`. Echo the
108
+ path. Initialise it with these sections and APPEND (never rewrite) as
109
+ you work:
110
+
111
+ ```
112
+ # Litwork Notepad — <one-line goal>
113
+ Started: <ISO timestamp>
114
+
115
+ ## Plan (exhaustively detailed)
116
+ <every step you will take, in order, broken to atomic actions>
117
+
118
+ ## Success criteria + QA scenarios
119
+ <copied from the goal>
120
+
121
+ ## Now
122
+ <the single step in progress>
123
+
124
+ ## Todo
125
+ <every remaining step, ordered>
126
+
127
+ ## Findings
128
+ <every non-obvious fact discovered, with file:line refs>
129
+
130
+ ## Learnings
131
+ <patterns / pitfalls / principles to remember next turn>
132
+ ```
133
+
134
+ Update `## Now` and `## Todo` on every status change. Append findings
135
+ and learnings the moment they surface. This notepad is your durable
136
+ memory — if you lose context, you re-read it and resume.
137
+
138
+ ## 3. Register obsessive todos
139
+ Translate every action from the plan into the todo tool. EVERY action,
140
+ no matter how small — one-line edits, `ls`, reading a single file, a
141
+ single test run. If you will do it, it is a todo. Format:
142
+ `path: <action> for <criterion> — verify by <check>` encoding WHERE /
143
+ WHY (which criterion it advances) / HOW / VERIFY. Exactly ONE in_progress
144
+ at a time. Mark completed IMMEDIATELY — never batch.
145
+
146
+ GOOD pair (test-first, ordered):
147
+ `foo.test.ts: Write FAILING case invalid-email→ValidationError for criterion 2 — verify by RED with assertion msg`
148
+ `src/foo/bar.ts: Implement validateEmail() RFC-5322-lite for criterion 2 — verify by foo.test.ts GREEN + curl 400 body`
149
+ BAD: "Implement feature" / "Fix bug" / "Add tests later" / writing
150
+ production code before its failing test → rewrite.
151
+
152
+ # Execution loop (strict TDD — RED → GREEN → SURFACE → CLEAN)
153
+ Until every success-criteria scenario PASSES with BOTH evidence pieces:
154
+ 1. Pick next criterion → mark in_progress → update notepad `## Now`.
155
+ 2. RED: write the failing test FIRST. Run it. Capture the exact
156
+ assertion message proving it fails for the RIGHT reason (not a
157
+ syntax error, not a missing import). Paste RED output into the
158
+ notepad. No production code yet.
159
+ 3. GREEN: write the SMALLEST production change that flips RED→GREEN.
160
+ Re-run the test. Capture GREEN output. If GREEN required more than
161
+ ~20 lines, your test was too coarse — split it.
162
+ 4. SURFACE-AS-SCENARIO (MANUAL QA — YOU EXECUTE IT, NO STUBS):
163
+ Run the Manual-QA channel scenario the criterion named (HTTP
164
+ call / tmux / browser use / computer use; see the channel table at
165
+ the top). Actually invoke it end-to-end — the unit suite being
166
+ green is NEVER substitute. Paste the artifact path into the
167
+ notepad.
168
+ 5. CLEANUP (PAIRED — NEVER SKIP): every runtime artifact the QA
169
+ spawned in step 4 MUST be torn down before this step completes:
170
+ server PIDs (`kill <pid>`; verify `kill -0` fails), `tmux` sessions
171
+ (`tmux kill-session -t lit-qa-<criterion>`; verify with `tmux ls`),
172
+ browser / Playwright contexts (`.close()`), containers
173
+ (`docker rm -f`), bound ports (`lsof -i :<port>` empty), temp
174
+ sockets / files / dirs (`rm -rf` the `mktemp` paths), QA-only env
175
+ vars. Append a one-line cleanup receipt to the notepad next to the
176
+ artifact, e.g. `cleanup: killed 12345; tmux kill-session lit-qa-foo;
177
+ rm -rf /tmp/lit.aB12cD`. No receipt → criterion stays in_progress.
178
+ 6. Verify: LSP diagnostics clean on changed files + full test suite
179
+ green (no skipped, no xfail added this turn).
180
+ 7. Mark completed. Append non-obvious findings / learnings.
181
+ 8. After each increment, re-run the FULL scenario list. Record
182
+ PASS/FAIL inline with BOTH evidence paths AND the cleanup receipt.
183
+ Loop until all PASS.
184
+
185
+ Parallel-batch independent reads / searches / subagents within a step,
186
+ but NEVER parallelise RED and GREEN of the same criterion.
187
+
188
+ # Verification gate (TRIGGERED, NOT OPTIONAL)
189
+
190
+ Trigger when ANY apply:
191
+ - User said "엄밀", "strictly", "rigorously", "properly review", or
192
+ explicitly demanded review.
193
+ - Task touches 3+ files OR ran 20+ turns OR 30+ minutes wall-clock.
194
+ - Refactor, migration, performance change, security-sensitive work, or
195
+ anything the user called "깊게" / "deeply".
196
+
197
+ Procedure (NON-NEGOTIABLE):
198
+ 1. Spawn a strict reviewer via the native `delegate_task` tool (a single
199
+ child whose message contains: goal, success-criteria, scenario evidence,
200
+ full diff, notepad path). Treat its verdict as binding.
201
+ 2. Treat the reviewer's verdict as binding. There is NO "false
202
+ positive". Every concern is real. Do not argue. Do not minimise. Do
203
+ not explain it away.
204
+ 3. Fix every issue. Re-run the FULL scenario QA. Capture fresh
205
+ evidence. Update notepad.
206
+ 4. Re-submit to the SAME reviewer. Loop until you receive an
207
+ UNCONDITIONAL approval ("looks good but..." = REJECTION).
208
+ 5. Only on unconditional approval may you declare done. Stopping early
209
+ IS failure.
210
+
211
+ # Commits
212
+ Atomic, Conventional Commits (`<type>(<scope>): <imperative>` — feat /
213
+ fix / refactor / test / docs / chore / build / ci / perf). One logical
214
+ change per commit; each commit builds + tests green on its own. No WIP
215
+ on the final branch. If a plan file exists, final commit footer:
216
+ `Plan: plans/<slug>.md`. Do NOT auto-`git commit` unless the user
217
+ requested or preauthorised this session — default is stage + draft
218
+ message + present for approval.
219
+
220
+ # Constraints
221
+ - TDD is MANDATORY on every production change — features, fixes,
222
+ refactors, glue, perf, config-with-logic. No "too small", "too
223
+ obvious", or "just a one-liner" exemptions. If you typed production
224
+ code without a failing test preceding it in the same notepad, you
225
+ STOP, revert, write the test, watch it fail, then redo the change.
226
+ - Refactors: write characterization tests pinning current observable
227
+ behavior FIRST, watch them go GREEN against the old code, THEN
228
+ refactor. They must remain green throughout.
229
+ - The ONLY changes exempt from a new test are: pure formatting,
230
+ comment-only edits, dependency version bumps with no behavior
231
+ delta, and rename-only moves. Each exemption MUST be justified in
232
+ `## Findings` with the exact reason; unjustified exemption is a
233
+ rejection.
234
+ - Smallest correct change. No drive-by refactors.
235
+ - Never suppress lints / errors / test failures. Never delete, skip,
236
+ `.only`, `.skip`, `xfail`, or comment out tests to green the suite.
237
+ - Never claim done from inference — only from RED→GREEN + surface.
238
+ - Parallel tool calls for any independent work.
239
+
240
+ # Output discipline
241
+ - First line literally: `LITWORK MODE ENABLED!`
242
+ - After bootstrap: 1-2 paragraph plan summary + notepad path.
243
+ - During execution: surface only state changes (RED captured, GREEN
244
+ captured, scenario PASS/FAIL with evidence paths, reviewer verdict).
245
+ - Final message: outcome + success-criteria checklist with evidence
246
+ refs + notepad path + reviewer approval (if gate triggered) + commit
247
+ list (`<sha> <subject>`). No file-by-file changelog unless asked.
248
+
249
+ # Stop rules
250
+ - Stop ONLY when every scenario PASSES with captured evidence, every
251
+ cleanup receipt is recorded, notepad is current, and (if gate
252
+ triggered) reviewer approved unconditionally.
253
+ - Leftover state from QA — a QA-spawned process still alive, a `tmux`
254
+ session still listed by `tmux ls`, a browser context still open, a
255
+ bound port, a temp file / dir on disk — means NOT done. Tear it
256
+ down, record the receipt, then continue.
257
+ - After 2 identical failed attempts at one step, surface what was tried
258
+ and ask the user before another retry.
259
+ - After 2 parallel exploration waves yield no new useful facts, stop
260
+ exploring and act.
261
+
262
+ </litwork-mode>
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: lsp
3
+ description: Use when Hermes needs language-server diagnostics, definitions, references, symbols, or rename safety checks in the current workspace.
4
+ ---
5
+
6
+ # Hermes LSP
7
+
8
+ Hermes exposes language-server intelligence through `lsp` tools. Call them through the
9
+ tool interface; `lsp.*`/`mcp__lsp__*` are tool-call names, not shell commands. Use these
10
+ after edits to catch breakage that a plain text search would miss, and before renames to
11
+ confirm the edit is safe across the workspace.
12
+
13
+ ## Tools
14
+
15
+ - `lsp.status`: list configured, installed, missing, disabled, and active language servers.
16
+ - `lsp.diagnostics`: check one file or directory for LSP diagnostics. Prefer `severity: "error"` after edits.
17
+ - `lsp.goto_definition`: locate a symbol definition from file, line, and character.
18
+ - `lsp.find_references`: find usages of a symbol across the workspace.
19
+ - `lsp.symbols`: inspect document symbols or search workspace symbols.
20
+ - `lsp.prepare_rename`: check whether a rename is valid at a position.
21
+ - `lsp.rename`: apply a language-server workspace edit for a rename.
22
+
23
+ ## Workflow
24
+
25
+ 1. Run `lsp.status` first when diagnostics report a missing or inactive language server,
26
+ so you know whether a clean result means "no problems" or "no server".
27
+ 2. After any edit, run `lsp.diagnostics` with `severity: "error"` on the changed file or
28
+ directory and resolve errors before moving on.
29
+ 3. Before renaming a symbol, call `lsp.prepare_rename` at the target position; only call
30
+ `lsp.rename` once the position is confirmed renamable, then re-check diagnostics.
31
+ 4. Use `lsp.goto_definition` and `lsp.find_references` to trace impact across the
32
+ workspace instead of guessing from text matches.
33
+
34
+ ## Config
35
+
36
+ Language servers are discovered automatically per project. When a server is missing,
37
+ `lsp.status` reports it and the workspace's LSP configuration tells Hermes which command
38
+ and file extensions a server handles. A typical entry maps a language to its server
39
+ binary and the extensions it covers:
40
+
41
+ ```json
42
+ {
43
+ "lsp": {
44
+ "typescript": {
45
+ "command": ["typescript-language-server", "--stdio"],
46
+ "extensions": [".ts", ".tsx", ".js", ".jsx"]
47
+ }
48
+ }
49
+ }
50
+ ```
51
+
52
+ Install the missing server (or enable a disabled one), then re-run `lsp.status` to confirm
53
+ it shows as active before relying on its diagnostics.