@markstanden/opencode-docs-plugin 0.9.0 → 0.12.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.
- package/CONVENTION.md +76 -42
- package/README.md +187 -38
- package/package.json +2 -2
- package/src/SKILL.md +60 -57
- package/src/index.ts +1549 -168
package/src/SKILL.md
CHANGED
|
@@ -1,76 +1,79 @@
|
|
|
1
1
|
# Docs
|
|
2
2
|
|
|
3
|
-
Durable knowledge lives in **lakes**: **find** it
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
| **
|
|
12
|
-
| **
|
|
13
|
-
| **
|
|
14
|
-
| **
|
|
15
|
-
| **Wiki**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
Durable knowledge lives in **lakes**: **find** it, or **record** one focused
|
|
4
|
+
doc at the narrowest justified scope. Call the `docs` tool; inside `execute`
|
|
5
|
+
it is `tools.docs.docs_search(…)`, same verbs.
|
|
6
|
+
|
|
7
|
+
## Scopes
|
|
8
|
+
|
|
9
|
+
| Scope | Config | Where | Use it for | Writes |
|
|
10
|
+
| ---------------- | --------- | --------------------------- | --------------------------------- | ------------- |
|
|
11
|
+
| **Repository** | `repo` | `<repo>/docs` | this repo's traps and decisions | yes |
|
|
12
|
+
| **Personal** | `machine` | personal lake (`~/doclake`) | a person's devices and setup | yes |
|
|
13
|
+
| **Organisation** | `global` | organisation lake | shared standards and integrations | yes, reviewed |
|
|
14
|
+
| **Instructions** | implicit | nested `README.md` | build, run, test, deploy | never |
|
|
15
|
+
| **Wiki** | `wiki` | human-readable wiki | narrative for humans | read-only |
|
|
16
|
+
|
|
17
|
+
Place by dependency: this repo's code or decisions → Repository; a person's
|
|
18
|
+
device, account or setup (a named host counts) → Personal; an established
|
|
19
|
+
shared rule → Organisation, boundary stated — reusability alone is not
|
|
20
|
+
ownership; operational steps → the README workflow; human narrative → the
|
|
21
|
+
wiki's owners. Split only for claims with different owners; unresolved
|
|
22
|
+
ownership stays an explicit proposal, never a guessed destination.
|
|
23
|
+
|
|
24
|
+
`help` lists each lake's scope and description; `add` writes the sole writable
|
|
25
|
+
lake without `lake`, else refuses with candidates — pass `lake`.
|
|
19
26
|
|
|
20
27
|
## Find it
|
|
21
28
|
|
|
22
|
-
A **blank `search`** lists recent docs
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
when longer terms exist; otherwise all query terms are kept.
|
|
26
|
-
lakes and ranking.
|
|
29
|
+
A **blank `search`** lists recent docs; a **`search`** ranks them, matching
|
|
30
|
+
terms as **substrings** (a typo finds nothing) and falling back to
|
|
31
|
+
`Closest matches`. Terms shorter than `MIN_TERM_LENGTH` (3) are dropped
|
|
32
|
+
when longer terms exist; otherwise all query terms are kept.
|
|
27
33
|
|
|
28
|
-
Open the match with `read
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
dot-directories and `node_modules`.
|
|
34
|
+
Open the match with `read` (root-relative, or `lake:path`); a README
|
|
35
|
+
result is `instructions:path` for the built-in `read`. Consult
|
|
36
|
+
matching docs before a broad grep; a tie ranks repo, instructions, global,
|
|
37
|
+
machine, wiki. Knowledge lakes exclude `plans/`, `requirements/` and `wiki/`
|
|
38
|
+
at the root; wiki lakes only dot-directories and `node_modules`.
|
|
34
39
|
|
|
35
40
|
## Record it
|
|
36
41
|
|
|
37
|
-
|
|
38
|
-
authoritative
|
|
42
|
+
Record to `<area>/<title>.md` under the right lake (`CONVENTION.md` is
|
|
43
|
+
authoritative):
|
|
39
44
|
|
|
40
|
-
1. **Read first, never duplicate
|
|
41
|
-
|
|
42
|
-
2. **Choose one
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
delete the emptied doc — no superseded stubs.
|
|
45
|
+
1. **Read first, never duplicate:** the same area, keyword hits on its
|
|
46
|
+
entities, or links from touched docs.
|
|
47
|
+
2. **Choose one scope** from the table — the narrowest that holds the claim;
|
|
48
|
+
one artifact per topic and scope.
|
|
49
|
+
3. **Reconcile, then add:** edit before add; merge near-twins; split per topic,
|
|
50
|
+
repoint references, delete the emptied doc — no superseded stubs.
|
|
46
51
|
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
Record through the typed `add`: metadata (`Area`, `Keywords`, `Summary`) plus a
|
|
53
|
+
body with an `H1` and a claim section — Facts, Inferred, Tested, Failed approaches, Open questions. `mode:"create"` writes a new doc (never overwrites; near-twins refuse unless `allowNearTwinReason` explains the distinction). `mode:"replace"` wholesale-replaces the doc at `path` against your `expectedRevision` (omitted content is lost; a missing target or stale token refuses, never creates). Refused always: blank metadata, traversal, a non-`.md` or symlinked target, no claim section.
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
A doc is current or deleted; a failed attempt is valid knowledge (what was
|
|
56
|
+
tried, why it failed, what is true now). Knowledge reads and writes end with a
|
|
57
|
+
`docs: revision` line: the replace token.
|
|
52
58
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
and
|
|
56
|
-
|
|
57
|
-
Lead with the actionable fact, keeping the reason, limits and evidence that
|
|
58
|
-
affect using it; drop chronology, repeated conclusions and empty sections. Keep
|
|
59
|
-
the service names, errors, paths and commands someone will search for. A
|
|
59
|
+
Lead with the actionable fact, its reason, limits and evidence; drop
|
|
60
|
+
chronology and empty sections. Keep the
|
|
61
|
+
service names, errors, paths and commands someone will search for; the
|
|
60
62
|
`Summary` decides whether to open the file.
|
|
61
63
|
|
|
62
64
|
Never record secrets, credentials, tokens or customer data — name the vault or
|
|
63
|
-
variable, never the value — and no personal data in
|
|
65
|
+
variable, never the value — and no personal data in Organisation or Wiki.
|
|
64
66
|
|
|
65
67
|
## Check it
|
|
66
68
|
|
|
67
|
-
`check` audits the lakes: front-matter, an `H1`, a claim
|
|
68
|
-
hand-maintained `Date`, a distinctive identity, near-twins and broken
|
|
69
|
-
links. Obsolete fields, long docs
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
`check` audits the **writable** knowledge lakes: front-matter, an `H1`, a claim
|
|
70
|
+
section, no hand-maintained `Date`, a distinctive identity, near-twins and broken
|
|
71
|
+
relative links. Obsolete fields, long docs (`maxDocLines`, default 200, `0`
|
|
72
|
+
disables) and missing roots are **notes**, not findings. Read-only lakes, wiki
|
|
73
|
+
lakes and READMEs are searched but not validated; skipped lakes are named, a
|
|
74
|
+
very large report is capped with an `and N more lines not shown` tail. `add`
|
|
75
|
+
enforces the structural rules at the write boundary; cross-document audits
|
|
76
|
+
stay with `check`.
|
|
77
|
+
|
|
78
|
+
Run the project's tests and typecheck before proposing a commit; prepare it
|
|
79
|
+
and **wait for explicit approval** — recording is not approval. Never push.
|