@geohar/opencode-cribsheet 0.5.2 → 0.5.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.
Files changed (2) hide show
  1. package/instructions.txt +45 -29
  2. package/package.json +1 -1
package/instructions.txt CHANGED
@@ -5,32 +5,48 @@
5
5
  (the plugins symlink this file). It directs *approach*; the MCP tool
6
6
  descriptions carry the mechanics. -->
7
7
 
8
- - **Consult memory first.** Before answering about a project, topic, or past decision
9
- — or exploring a codebase cold — `lookup`/`apropos` cribsheet first; the answer may
10
- already be stored, and more current than reasoning from scratch.
11
- - **Prefer the code index over grep/Read for understanding code.** The reflex to
12
- `grep`/`rg`/`Glob` for a symbol — or to open a file to see what it does — is the cue
13
- to reach for the index first; grep is the fallback when it misses, not the default.
14
- - *find code by concept or name* → `code_lookup "…in your own words"`, **not**
15
- `grep -r` (answers by intent + cross-file).
16
- - *understand a symbol + who uses it* → `code_dossier <symbol>`, **not** reading
17
- the whole file (one call: signature, description, callers/callees/references).
18
- - *trace calls* → `code_xref` / `code_graph`, **not** chains of greps.
19
- - *repo not indexed?* → that's the expected first step, not a dead end: **index it**
20
- — `project_index` (indexes the source in one call), then look up. Do NOT read
21
- files or grep instead; there's no shortcut, the utility comes from the index.
22
- - *which project?* → code tools act on ONE **current project**. Set it once for the
23
- codebase you're in (`use_project <name>`, or it's inferred from `project_path` on
24
- your first code call); reads then need no project args. To look up a **different**
25
- project (a related codebase you're referencing), you MUST name it: `project=<name>`
26
- or `project_path=<a path in that repo>`. (`project_path` ≠ your shell cwd — it just
27
- says which repo you mean.)
28
- E.g. not `grep -rn "def boolean"` then reading the file — `code_lookup "boolean path
29
- union/difference"` → `code_dossier` the top hit. (When you finally *get* a tricky
30
- symbol, `code_append <symbol> "…"` pins that understanding for next time.)
31
- - **Persist durably.** When a durable fact emerges (a decision, convention, gotcha,
32
- contract), `store` it — `lookup` first, `append`/`edit` over duplicating. **Name the
33
- project it's ABOUT** (writes require an explicit `project=`/`project_path=` — they
34
- won't inherit your current one): a fact about the repo you're in goes there, but
35
- cross-cutting/tooling knowledge (a CLI, an editor, a shared convention) belongs in
36
- `default` or that tool's own project. Say which project it landed in.
8
+ Three rules. Each fires on a **cue you can catch yourself in the middle of**, not on
9
+ a topic you have to remember to think about. That's deliberate: you will not remember
10
+ to "consult memory" — but you can notice your own hand reaching for `grep`.
11
+
12
+ ### 1. About to grep? That's the cue.
13
+
14
+ `grep` / `rg` / `Glob`, or opening a file to see what it does, is a **stop sign, not
15
+ an action**. At that exact moment:
16
+
17
+ | your next move was | do this instead |
18
+ |---|---|
19
+ | grep for a symbol — by name, or by hunch | `code_lookup "what it does, in your own words"` — answers by intent, across files |
20
+ | open the file to understand a symbol | `code_dossier <symbol>` — signature, description, callers, callees, references, in one call |
21
+ | chain greps to trace a caller | `code_xref` / `code_graph` |
22
+ | *(repo isn't indexed)* | `project_index` — one call, and the **expected first step**, not a dead end |
23
+
24
+ grep is the **fallback for when the index misses**. It is never the opening move.
25
+ There is no shortcut around indexing; the utility *is* the index.
26
+
27
+ **Catch yourself:** if you've read three files to answer one question, this rule
28
+ already fired and you walked past it. Stop where you are, `code_lookup`, redo it.
29
+
30
+ ### 2. About to answer from your own knowledge? Look it up first.
31
+
32
+ Cue: you're about to explain a project, a past decision, or a convention — or open a
33
+ codebase cold. `lookup` / `apropos` **before** you answer, not after. What's stored may
34
+ be more current than what you'd reconstruct, and *you can't tell which from the inside*:
35
+ a confident reconstruction feels exactly like a correct one.
36
+
37
+ ### 3. Just understood something? Store it before you move on.
38
+
39
+ Cue: the "ah, *that's* why" moment — a decision, convention, gotcha, or contract. The
40
+ moment passes; the note has to be written inside it. `lookup` first, then `append`/`edit`
41
+ over creating a near-duplicate.
42
+
43
+ Writes need an explicit `project=` — they do **not** inherit your current project. Name
44
+ the project the fact is *about*: the repo you're in, or `default` (or that tool's own
45
+ project) for cross-cutting knowledge like a CLI or editor convention. Say where it landed.
46
+ To pin a hard-won insight about a symbol: `code_append <symbol> "…"`.
47
+
48
+ <!-- Project selection for *reads*: code tools act on ONE current project — set it once
49
+ with `use_project <name>`, or it's inferred from `project_path` on your first code
50
+ call; reads then need no project args. To read a *different* project you must name it
51
+ (`project=` / `project_path=`). `project_path` means "which repo I mean" — it is not
52
+ your shell cwd. -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geohar/opencode-cribsheet",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "OpenCode plugin: run the crib (cribsheet) memory + code-index MCP server via sharedserver, register its endpoint, inject the reach-for-crib directive, and ship the /crib command. Stands down when a combiner already serves crib.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",