From 48dc0feee9eb3ace0b9ebf9f228b021250f4548f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kope=C4=87?= Date: Wed, 15 Jul 2026 13:31:37 +0200 Subject: [PATCH] Add ckb-onboard-me skill (guided wiki tour) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Read-only skill: given a topic, resolve it to an anchor page via the cascade, walk the graph edges (2 hops, ~8-page cap) — falling back to link-following when no edges exist — order the pages pedagogically (prerequisites first, then the topic, then what builds on it), and print a numbered reading tour with per-page "what you'll find" notes. Co-Authored-By: Claude Opus 4.8 --- .agents/skills/ckb-onboard-me/SKILL.md | 143 +++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 .agents/skills/ckb-onboard-me/SKILL.md diff --git a/.agents/skills/ckb-onboard-me/SKILL.md b/.agents/skills/ckb-onboard-me/SKILL.md new file mode 100644 index 0000000..8ea47d0 --- /dev/null +++ b/.agents/skills/ckb-onboard-me/SKILL.md @@ -0,0 +1,143 @@ +--- +name: ckb-onboard-me +description: Given a topic, walk the wiki knowledge graph and print a guided reading order — a mini tour. Produces a short overview of the topic plus the best sequence of wiki pages to read and what you'll find in each, ordered so prerequisites come before the pages that build on them. Use when the user says "onboard me on X", "give me a reading order for X", "where do I start with X", "walk me through X", "mini tour of X", "guided tour of X", or "what should I read to understand X". +--- + +# Onboard me (guided wiki tour) skill + +## Purpose + +Turn a topic into a **reading order**: a short scene-setting overview followed +by an ordered list of wiki pages to read, each with a one-line note on what +you'll find there and why it comes at that point. It's a mini onboarding tour +built by walking the knowledge graph outward from the topic, so a newcomer +learns things in a sensible order — foundations first, then the topic itself, +then what builds on it. + +This skill is **read-only**. It never writes to `wiki/`, so it does not touch +`wiki/log.md`. It synthesizes a route through existing knowledge; it does not +add new claims. If the wiki has nothing on the topic, say so — don't invent a +tour. + +## Trigger phrases + +Use this skill when the user says things like: +- "onboard me on X" / "get me up to speed on X" +- "where do I start with X" / "what should I read to understand X" +- "give me a reading order for X" / "reading list for X" +- "walk me through X" / "mini tour of X" / "guided tour of X" + +## How to run this skill + +### Step 1 — Resolve the topic to a starting page + +Read the cheap indexes first, in cascade order (first match wins): + +1. `wiki/index.md` — match the topic against the **Use when** column. +2. `wiki/entities/index.md` — match against entity titles and their `tldr`. +3. If nothing local matches, check each `linked//` index, then each + `libs//` index (alphabetical). The local `wiki/` always wins if both + have a candidate. + +Pick the single best-matching page as the **anchor** of the tour. + +- **No match anywhere** — tell the user the wiki has nothing on that topic + yet. Offer the closest 2–3 pages by title/`tldr` if any are vaguely related, + and suggest running Ingest to add the material. Do not fabricate a tour. +- **Several equally good anchors** — list them (title + `tldr`) and ask which + one to start from, or offer to build a short tour that covers all of them. + +### Step 2 — Walk the graph outward from the anchor + +Read `wiki/graph/edges.json`. Edges are typed relationships between entity +pages (`uses`, `depends_on`, `caused`, `contradicts`, `supersedes`) with a +`source` and a `target`. Starting from the anchor, do a breadth-first walk: + +- Collect every page directly connected to the anchor (anchor is `source` or + `target` of the edge). +- Follow one more hop out from those pages. **Stop at 2 hops** — a tour is a + route, not the whole map. Keep a visited set so cycles don't loop. +- Cap the tour at roughly **8 pages**. If the 2-hop neighbourhood is larger, + keep the pages closest to the anchor and highest `confidence` / + `retention: high`, and tell the user you trimmed it (say how many were left + out) rather than silently dropping them. + +**If `edges.json` is missing or empty** (no ingest has extracted edges yet), +fall back to link-following: read the anchor page and collect the pages it +links to via `[[wikilinks]]` and `[markdown](path.md)` links, then one hop out +from those. Same 2-hop, ~8-page, visited-set rules apply. Note in the output +that ordering came from page links rather than the typed graph. + +### Step 3 — Order the pages pedagogically + +The reading order is the whole point — don't just dump the neighbourhood. +Order by dependency direction, not by hop distance alone: + +1. **Foundations first.** A page the anchor `depends_on` or `uses` is a + prerequisite — it comes *before* the anchor. Recurse: a prerequisite's own + prerequisites come before it. +2. **The anchor** — the topic itself, once its groundwork is laid. +3. **Builds-on / related** — pages that `depend_on` or `use` the anchor, or + are related without a clear dependency, come after. These are "where to go + next." +4. Put `contradicts` / `superseded_by` links near the page they qualify, with + a note that they offer a competing or newer view. + +Within a tier, order by `confidence` then `last_updated` (higher/newer first) +so the most solid reading comes first. Read each page's `tldr` (frontmatter) +to write its one-line "what you'll find" — only open the body if the `tldr` is +missing or too thin to describe the page. + +### Step 4 — Print the tour + +Print to chat (this skill produces a message, not a file). Use this shape: + +```markdown +## Guided tour: [Topic] + +[2–3 sentence overview: what the topic is and what this tour will teach you, +synthesized from the anchor page's tldr and its immediate context.] + +**Reading order:** + +1. **[Page title](wiki/entities/foo.md)** — *foundation.* [what you'll find, + and why it's first — e.g. "the concept everything here builds on."] +2. **[Page title](wiki/entities/bar.md)** — *the core.* [what you'll find.] +3. **[Page title](wiki/entities/baz.md)** — *builds on it.* [what you'll find.] + ... + +**After this you'll understand:** [one line on the payoff — what the reader +can do or reason about once they've read the sequence.] +``` + +Rules for the output: +- Use clickable markdown links to the actual pages (project-root-relative, + e.g. `wiki/entities/foo.md`), so the reader can jump straight in. +- Label each step with its role in the tour (*foundation* / *core* / + *builds on it* / *alternative view*) so the ordering logic is visible. +- Keep each "what you'll find" to one line, drawn from the page's `tldr`. +- If pages came from `linked/` or `libs/`, link them with their full cascade + path and mark them as upstream. + +### Step 5 — Offer follow-ups + +Close with a short offer: to go deeper on any single step, to widen the tour +(3+ hops), or to start a different topic. Don't act on these unless asked. + +## Edge cases + +- **Anchor has no edges and no outgoing links** — the tour is just the anchor. + Print its overview and say it's currently a standalone page with no mapped + connections; suggest an Ingest may add links later. +- **Topic spans several disconnected clusters** — if the graph walk finds two + unrelated groups, present them as two short mini-tours under one topic rather + than forcing a single misleading sequence. +- **Broken edge (points to a missing page)** — skip it silently in the tour, + but mention at the end that the graph has a dangling edge so the user can run + Lint. Do not fabricate the missing page. +- **Very fresh material in `workload/` not yet in the wiki** — this skill tours + `wiki/` only. If the user expects a topic that was just discussed but not yet + ingested, note that it isn't in the wiki yet and point them at Ingest. +- **Upstream-only topic** — if the anchor lives in `linked/`/`libs/` with no + local overlay, build the tour from the upstream KB's own index/links and mark + every step as upstream/read-only.