@markstanden/opencode-docs-plugin 0.10.0 → 0.13.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 +72 -42
- package/README.md +198 -33
- package/package.json +2 -2
- package/src/SKILL.md +58 -58
- package/src/index.ts +1678 -208
package/src/SKILL.md
CHANGED
|
@@ -1,79 +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
|
|
39
|
-
|
|
40
|
-
1. **Read first, never duplicate.** Read the docs relevant to the task: the same
|
|
41
|
-
area, keyword hits on its entities, or links from touched docs.
|
|
42
|
-
2. **Choose one class** from the table — the narrowest that holds the claim.
|
|
43
|
-
3. **Reconcile, then add.** Edit before add; merge near-twins; split a bloated
|
|
44
|
-
doc per topic; after a split, merge or move, repoint inbound references and
|
|
45
|
-
delete the emptied doc — no superseded stubs.
|
|
42
|
+
Record to `<area>/<title>.md` under the right lake (`CONVENTION.md` is
|
|
43
|
+
authoritative):
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
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.
|
|
49
51
|
|
|
50
|
-
Record through the typed `add`: metadata (`Area`, `Keywords`, `Summary`)
|
|
51
|
-
body with an `H1` and a claim section — Facts, Inferred, Tested, Failed approaches, Open questions.
|
|
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.
|
|
52
54
|
|
|
53
|
-
A doc is current or deleted;
|
|
54
|
-
|
|
55
|
-
|
|
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.
|
|
56
58
|
|
|
57
|
-
Lead with the actionable fact,
|
|
58
|
-
|
|
59
|
-
|
|
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
69
|
`check` audits the **writable** knowledge lakes: front-matter, an `H1`, a claim
|
|
68
70
|
section, no hand-maintained `Date`, a distinctive identity, near-twins and broken
|
|
69
|
-
relative links. Obsolete fields, long docs
|
|
70
|
-
|
|
71
|
-
READMEs are not validated
|
|
72
|
-
large report is capped with an `and N more lines not shown` tail
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
failures rather than papering over them. Prepare the commit and **wait for
|
|
79
|
-
explicit approval** — recording findings is not commit approval. Never push.
|
|
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.
|