@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/src/SKILL.md CHANGED
@@ -1,76 +1,79 @@
1
1
  # Docs
2
2
 
3
- Durable knowledge lives in **lakes**: **find** it (search, then read), or
4
- **record** one focused doc at the narrowest true scope. Call the `docs` tool;
5
- inside `execute` it is `tools.docs.docs_search(…)`, same verbs.
6
-
7
- ## Classes
8
-
9
- | Class | Where | Use it for | Writes |
10
- | ------------------ | --------------------------- | --------------------------------------- | ------------- |
11
- | **Instructions** | nested `README.md` | build, run, test, deploy this code | never |
12
- | **RepoContext** | `<repo>/docs` | this repo's traps, decisions, landmines | yes |
13
- | **MachineContext** | personal lake (`~/doclake`) | tooling and traps across your machines | yes |
14
- | **GlobalContext** | organisation lake | standards and integrations across repos | yes, reviewed |
15
- | **Wiki** | human-readable wiki | narrative for humans | read-only |
16
-
17
- Record at the **narrowest scope where the whole claim is true**. Two scopes
18
- means two docs; one omnibus doc is out of place everywhere.
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, one line each; a **`search`** ranks
23
- them, falling back to `Closest matches` and matching terms as **substrings** —
24
- so a typo finds nothing. Terms shorter than `MIN_TERM_LENGTH` (3) are dropped
25
- when longer terms exist; otherwise all query terms are kept. `help` lists the
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`: the root-relative path, or `lake:path` when several
29
- lakes exist. A README result is `instructions:path` and opens with the built-in
30
- `read`. Consult matching docs before a broad grep; a tie ranks repo,
31
- instructions, global, machine, wiki. Knowledge lakes exclude `plans/`,
32
- `requirements/` and `wiki/` at the root; wiki lakes exclude only
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
- Write to `<area>/<title>.md` under the right lake; `CONVENTION.md` is
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.** 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.
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
- One artifact per topic and class, never one dump; the compaction nudge shapes
48
- `Record with docs add:` blocks for this.
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
- Record through the typed `add`: metadata (`Area`, `Keywords`, `Summary`) and a
51
- body with an `H1` and a claim section — Facts, Inferred, Tested, Failed approaches, Open questions. Omit `path` to create `<Area>/<slug>.md`; pass `path` to replace **wholesale**, so omitted body content is lost and the near-twin reconcile is skipped. Refused: blank metadata, traversal, a non-`.md` or symlinked target, no claim section, and — only when `path` is omitted — a same-area near-twin.
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
- A doc is current or deleted; no `Status` or `Supersedes`. A failed attempt is
54
- valid knowledge when it records what was tried, why it failed, what is true now,
55
- and what not to retry.
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 GlobalContext or Wiki.
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 section, no
68
- hand-maintained `Date`, a distinctive identity, near-twins and broken relative
69
- links. Obsolete fields, long docs and missing roots are **notes**, not findings;
70
- wiki lakes are not validated. `add` enforces the structural rules at the write
71
- boundary; cross-document audits stay with `check`. `maxDocLines` (default 200,
72
- `0` disables) is a soft size signal, not a refusal.
73
-
74
- Run the project's tests and typecheck before proposing a commit, fixing
75
- failures rather than papering over them. Prepare the commit and **wait for
76
- explicit approval** — recording findings is not commit approval. Never push.
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.