Skip to content

Commit dbe8f81

Browse files
mpstatonclaude
andcommitted
doc(reminders): a hard denylist — Libraries We Do Not Use, Ever
Codifies the standing rule after a stale `require('ws')` in scripts/prove-didi-auth.mjs blocked a one-property change for three rounds. Rules: never assume a library is installed, never install to fix a script, prefer platform built-ins (Node's global WebSocket). `ws` is the first denylist row; flags prove-didi-auth.mjs as a known offender to rewrite off the native WebSocket. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UYTYu4MAFZ7iyr2VTo2kq
1 parent 3760a9d commit dbe8f81

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: "Libraries We Do Not Use — Ever"
3+
lede: "A hard denylist of packages this codebase has removed on purpose. Do not import them, do not assume they are installed, do not re-add them."
4+
date_created: 2026-08-02
5+
date_modified: 2026-08-02
6+
authors:
7+
- Michael Staton
8+
augmented_with:
9+
- Claude Code on Claude Opus 4.8
10+
semantic_version: 0.0.0.1
11+
status: Active
12+
tags:
13+
- Reminder
14+
- Dependencies
15+
- Augment-It
16+
---
17+
18+
# Libraries We Do Not Use — Ever
19+
20+
## Why Care?
21+
22+
Packages on this list were **removed deliberately** — they caused real
23+
errors and were replaced with hand-rolled code or a platform built-in.
24+
Re-importing one, or *assuming* it's installed, silently reintroduces the
25+
exact problem it was removed to fix. On 2026-08-02 a one-property backend
26+
change was blocked for three rounds because a helper script still had a
27+
stale `require('ws')` in it — the library had already been ripped out, so
28+
the script crashed with `Cannot find module 'ws'` the moment it ran.
29+
30+
## The rules
31+
32+
1. **Never assume a library is installed.** Check `package.json` (and that
33+
it actually resolves) before importing anything.
34+
2. **Never install a library** to make a script work. If a dependency is
35+
missing, that is usually a signal it was removed on purpose — ask, or
36+
hand-roll it. See [[feedback_minimal_dependencies_hand_roll]].
37+
3. **Prefer platform built-ins.** Node ≥ 22 has a global `WebSocket` and
38+
global `fetch` — use those, not packages.
39+
40+
## The denylist
41+
42+
| Package | Why it's banned | Use instead |
43+
|---|---|---|
44+
| `ws` | Removed for causing errors. Any script still importing it is stale and will crash with `Cannot find module 'ws'`. | Node's built-in global `WebSocket` (Node ≥ 18/22), or hand-rolled WebSocket handling. |
45+
46+
<!-- When another library gets removed, add a row here AND update the
47+
memory pointer in ~/.claude/.../memory/MEMORY.md. Keep this list the
48+
single source of truth. -->
49+
50+
## Known offenders to fix when next touched
51+
52+
- `scripts/prove-didi-auth.mjs` — still does `require('ws')` at the top.
53+
It needs rewriting onto the native global `WebSocket` (which does not
54+
take a `ws`-style `headers` option, so the `didi_session` cookie has to
55+
be carried a different way) before it can run again.
56+
57+
## See also
58+
59+
- [[feedback_minimal_dependencies_hand_roll]] — the standing rule this
60+
reminder makes concrete.

0 commit comments

Comments
 (0)