@patimweb/pi-outline-wiki 1.0.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/.node-version ADDED
@@ -0,0 +1 @@
1
+ 26.5.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Patrick Weppelmann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,199 @@
1
+ # pi-outline-wiki
2
+
3
+ ![pi.dev connected to Outline](screenshot.png)
4
+
5
+ Outline wiki extension for the [pi coding agent](https://github.com/earendil-works/pi).
6
+
7
+ Search, read, write, organise and comment on documents in your [Outline](https://www.getoutline.com/) knowledge base directly from your pi session. Credentials are stored locally in `~/.pi/outline-config.json`.
8
+
9
+ Works with Outline cloud (`yourteam.getoutline.com`) and with self-hosted installations.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ # Install from npm
15
+ pi install npm:@patimweb/pi-outline-wiki
16
+
17
+ # Install from local path during development
18
+ pi install /path/to/pi-outline-wiki
19
+ ```
20
+
21
+ ## Quick Start
22
+
23
+ 1. In Outline, go to **Settings -> API & Apps** and create an API key (it starts with `ol_api_`).
24
+ 2. Configure the workspace with the `outline_setup` tool.
25
+ 3. Ask pi anything about your wiki, or use `/wiki <topic>`.
26
+
27
+ ```
28
+ outline_setup:
29
+ name: work
30
+ url: https://acme.getoutline.com
31
+ apiKey: ol_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
32
+ ```
33
+
34
+ `outline_setup` verifies the connection immediately and reports the workspace and the authenticated user, so a typo in the URL or key surfaces right away.
35
+
36
+ The `url` is forgiving: a bare host, a trailing slash, a pasted `/api` base or the `/mcp` endpoint from Outline's MCP docs are all normalised to the workspace root.
37
+
38
+ ## Tools
39
+
40
+ | Tool | Description |
41
+ |------|-------------|
42
+ | `outline_setup` | Configure workspace URL and API key. Must be called first. |
43
+ | `outline_status` | Show configured profiles and verify the active key still works. |
44
+ | `outline_profile` | List, switch, or delete workspace profiles (multi-workspace support). |
45
+ | `outline_collections` | List collections with their ids. |
46
+ | `outline_structure` | Show the nested document tree of one collection. |
47
+ | `outline_search` | Full-text search with optional collection, status and date filters. |
48
+ | `outline_list` | Browse documents: recent, by collection, by parent, or your drafts. |
49
+ | `outline_read` | Read a document's markdown body, optionally with children or saved to a file. |
50
+ | `outline_create` | Create a document in a collection or under a parent document. |
51
+ | `outline_update` | Replace, append to, or prepend to a document; rename it; publish a draft. |
52
+ | `outline_move` | Move a document into another collection or under another parent. |
53
+ | `outline_archive` | Archive, restore, or unpublish a document. |
54
+ | `outline_delete` | Move a document to the trash, or delete it permanently. |
55
+ | `outline_comments` | Read comment threads on a document, nested by reply. |
56
+ | `outline_comment` | Post a comment or reply on a document. |
57
+ | `outline_export` | Export a document or a whole collection to local markdown files. |
58
+
59
+ ### Searching
60
+
61
+ `outline_search` runs Outline's full-text search and returns matching documents with a snippet and their ids. Read the full body with `outline_read`.
62
+
63
+ ```yaml
64
+ outline_search:
65
+ query: postgres failover
66
+ # collectionId: <id> # restrict to one collection
67
+ # statusFilter: [published, archived]
68
+ # dateFilter: month # only recently updated documents
69
+ ```
70
+
71
+ Archived documents are excluded unless you ask for them via `statusFilter`.
72
+
73
+ ### Reading
74
+
75
+ `outline_read` takes the document id (uuid) or the slug from an Outline URL. Long pages are truncated at 20,000 characters by default so a single wiki page cannot eat the whole context window.
76
+
77
+ ```yaml
78
+ outline_read:
79
+ id: deploy-runbook-aBc123XyZ
80
+ # maxChars: 0 # 0 = no truncation
81
+ # includeChildren: true # also list child documents
82
+ # saveDir: ./docs # additionally write the full page to a .md file
83
+ ```
84
+
85
+ ### Writing
86
+
87
+ `outline_create` publishes into a collection by default. Pass `parentDocumentId` to nest a page, or `publish: false` to keep it as a personal draft.
88
+
89
+ ```yaml
90
+ outline_create:
91
+ title: Payment service failover
92
+ collectionId: <id>
93
+ text: |
94
+ Summary of what this page is for.
95
+
96
+ ## Steps
97
+ 1. ...
98
+ ```
99
+
100
+ Do not repeat the title as a top-level heading in `text` -- Outline renders the title separately.
101
+
102
+ ### Updating without losing content
103
+
104
+ `outline_update` defaults to `mode: replace`, which overwrites the whole body. Use `append` or `prepend` to add to a page without reading and re-sending it.
105
+
106
+ ```yaml
107
+ # Add a dated entry to a decision log
108
+ outline_update:
109
+ id: <id>
110
+ mode: append
111
+ text: |
112
+ ## Switched to connection pooling - 2026-09-02
113
+ ...
114
+ ```
115
+
116
+ `mode: prepend` is the right choice for newest-first logs and for adding a notice at the top of a page.
117
+
118
+ ### Retiring pages
119
+
120
+ `outline_archive` keeps a page searchable and restorable; it is the reversible option and should be preferred over deleting.
121
+
122
+ ```yaml
123
+ outline_archive:
124
+ id: <id>
125
+ # action: archive | restore | unpublish
126
+ ```
127
+
128
+ `outline_delete` moves a page to the trash (restore it with `outline_archive` action `restore`). `permanent: true` erases it and cannot be undone.
129
+
130
+ ### Exporting into your repository
131
+
132
+ `outline_export` writes markdown files directly to disk, which is far cheaper than reading page after page through the model.
133
+
134
+ ```yaml
135
+ outline_export:
136
+ targetDir: ./docs/wiki
137
+ collectionId: <id> # or documentId: <id>
138
+ # includeChildren: true # with documentId
139
+ # limit: 50
140
+ ```
141
+
142
+ ## Commands
143
+
144
+ | Command | Description |
145
+ |---------|-------------|
146
+ | `/wiki <topic>` | Search the wiki and summarise what it says, with citations. |
147
+ | `/wiki-capture [focus]` | Write the durable knowledge from this session into the wiki. |
148
+
149
+ ## Skills
150
+
151
+ The package ships three skills that teach the agent how to use the wiki well, not just which tools exist:
152
+
153
+ | Skill | Purpose |
154
+ |-------|---------|
155
+ | `outline-wiki` | Research the wiki before answering questions about internal systems, conventions and decisions. |
156
+ | `outline-doc-writing` | Where a page belongs, how to structure it, and how to update it without destroying other people's work. |
157
+ | `outline-knowledge-capture` | Turn what was worked out in a session into a durable page: decision records, incident findings, gotchas. |
158
+
159
+ ## Configuration
160
+
161
+ Credentials are persisted to `~/.pi/outline-config.json`, written atomically with mode `0600`. The `outline_setup` tool creates the file. You can also write it by hand:
162
+
163
+ ```json
164
+ {
165
+ "profiles": {
166
+ "work": {
167
+ "url": "https://acme.getoutline.com",
168
+ "apiKey": "ol_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
169
+ }
170
+ },
171
+ "activeProfile": "work"
172
+ }
173
+ ```
174
+
175
+ ### Multiple workspaces
176
+
177
+ Every workspace is stored under a profile name. The first profile becomes active automatically; use `outline_profile` to list, switch, or delete profiles. Every read and write tool also accepts a one-off `profile` parameter.
178
+
179
+ ### Self-hosted instances
180
+
181
+ Point `url` at your installation, e.g. `https://wiki.example.com` or `http://localhost:3000`. If your instance uses a self-signed certificate, set `insecureTls: true` in `outline_setup`. This disables certificate validation for the whole pi process, so only use it when you have no alternative -- `outline_status` warns while it is active.
182
+
183
+ ### Permissions
184
+
185
+ The extension acts as the user who owns the API key. It can only see and change what that user can see and change in Outline, so scoping access is a matter of which account the key belongs to.
186
+
187
+ ## Development
188
+
189
+ ```bash
190
+ npm install
191
+ npm test
192
+ npm run test:coverage
193
+ ```
194
+
195
+ The code follows a data-oriented layout: plain immutable data in `src/types.ts`, all HTTP isolated in `src/clients/outline-client.ts`, pure display functions in `src/formatting/formatters.ts`, and one module per tool in `src/tools/`.
196
+
197
+ ## License
198
+
199
+ MIT
package/index.ts ADDED
@@ -0,0 +1,128 @@
1
+ /**
2
+ * pi Outline Wiki Extension
3
+ *
4
+ * Gives pi read and write access to an Outline wiki
5
+ * (https://www.getoutline.com) through Outline's REST API.
6
+ *
7
+ * Tools:
8
+ * - outline_setup: Configure workspace URL and API key
9
+ * - outline_status: Show configuration and verify the connection
10
+ * - outline_profile: List, switch or delete workspace profiles
11
+ * - outline_collections: List collections with their ids
12
+ * - outline_structure: Show the nested document tree of a collection
13
+ * - outline_search: Full-text search across the wiki
14
+ * - outline_list: Browse documents, children or drafts
15
+ * - outline_read: Read a document's markdown body
16
+ * - outline_create: Create a new document
17
+ * - outline_update: Replace, append to or prepend to a document
18
+ * - outline_move: Re-file a document into another collection or parent
19
+ * - outline_archive: Archive, restore or unpublish a document
20
+ * - outline_delete: Trash or permanently delete a document
21
+ * - outline_comments: Read comment threads on a document
22
+ * - outline_comment: Post a comment or reply
23
+ * - outline_export: Save documents to local markdown files
24
+ *
25
+ * Data-oriented design:
26
+ * - All domain data is represented as plain immutable interfaces (types.ts)
27
+ * - I/O is isolated in the client module (clients/)
28
+ * - Pure formatting functions convert data to display strings (formatting/)
29
+ * - Each tool is a single-responsibility module (tools/)
30
+ * - Configuration is managed as mutable state with file persistence (config.ts)
31
+ */
32
+
33
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
34
+
35
+ import { loadConfig, getConfig } from "./src/config.ts";
36
+ import { OutlineSetupTool } from "./src/tools/outline-setup.ts";
37
+ import { OutlineStatusTool } from "./src/tools/outline-status.ts";
38
+ import { OutlineProfileTool } from "./src/tools/outline-profile.ts";
39
+ import { OutlineCollectionsTool } from "./src/tools/outline-collections.ts";
40
+ import { OutlineStructureTool } from "./src/tools/outline-structure.ts";
41
+ import { OutlineSearchTool } from "./src/tools/outline-search.ts";
42
+ import { OutlineListTool } from "./src/tools/outline-list.ts";
43
+ import { OutlineReadTool } from "./src/tools/outline-read.ts";
44
+ import { OutlineCreateTool } from "./src/tools/outline-create.ts";
45
+ import { OutlineUpdateTool } from "./src/tools/outline-update.ts";
46
+ import { OutlineMoveTool } from "./src/tools/outline-move.ts";
47
+ import { OutlineArchiveTool } from "./src/tools/outline-archive.ts";
48
+ import { OutlineDeleteTool } from "./src/tools/outline-delete.ts";
49
+ import { OutlineCommentsTool } from "./src/tools/outline-comments.ts";
50
+ import { OutlineCommentTool } from "./src/tools/outline-comment.ts";
51
+ import { OutlineExportTool } from "./src/tools/outline-export.ts";
52
+
53
+ const NOT_CONFIGURED =
54
+ "Outline not configured. Use the outline_setup tool with your workspace URL and an API key.";
55
+
56
+ export default function (pi: ExtensionAPI) {
57
+ // Load saved config on startup
58
+ loadConfig();
59
+
60
+ // Register all tools
61
+ pi.registerTool(OutlineSetupTool);
62
+ pi.registerTool(OutlineStatusTool);
63
+ pi.registerTool(OutlineProfileTool);
64
+ pi.registerTool(OutlineCollectionsTool);
65
+ pi.registerTool(OutlineStructureTool);
66
+ pi.registerTool(OutlineSearchTool);
67
+ pi.registerTool(OutlineListTool);
68
+ pi.registerTool(OutlineReadTool);
69
+ pi.registerTool(OutlineCreateTool);
70
+ pi.registerTool(OutlineUpdateTool);
71
+ pi.registerTool(OutlineMoveTool);
72
+ pi.registerTool(OutlineArchiveTool);
73
+ pi.registerTool(OutlineDeleteTool);
74
+ pi.registerTool(OutlineCommentsTool);
75
+ pi.registerTool(OutlineCommentTool);
76
+ pi.registerTool(OutlineExportTool);
77
+
78
+ // Look something up in the wiki without spelling out the tool call
79
+ pi.registerCommand("wiki", {
80
+ description: "Search the Outline wiki and summarise what it says",
81
+ handler: async (args, ctx) => {
82
+ if (!getConfig()) {
83
+ ctx.ui.notify(NOT_CONFIGURED, "error");
84
+ return;
85
+ }
86
+
87
+ const query = args.trim();
88
+ if (!query) {
89
+ ctx.ui.notify("Usage: /wiki <what you are looking for>", "info");
90
+ return;
91
+ }
92
+
93
+ pi.sendUserMessage(
94
+ `Search our Outline wiki for "${query}" using outline_search, read the most relevant document(s) with outline_read, and summarise what the wiki says. Cite each document by title and id, and say so plainly if the wiki has nothing on it.`,
95
+ { deliverAs: "steer" },
96
+ );
97
+ ctx.ui.notify(`Searching the wiki for "${query}"...`, "info");
98
+ },
99
+ });
100
+
101
+ // Write the session's outcome back into the wiki
102
+ pi.registerCommand("wiki-capture", {
103
+ description: "Write what we worked out in this session into the Outline wiki",
104
+ handler: async (args, ctx) => {
105
+ if (!getConfig()) {
106
+ ctx.ui.notify(NOT_CONFIGURED, "error");
107
+ return;
108
+ }
109
+
110
+ const hint = args.trim();
111
+ pi.sendUserMessage(
112
+ [
113
+ "Capture the durable knowledge from this session in our Outline wiki.",
114
+ hint ? `Focus on: ${hint}.` : "",
115
+ "First use outline_search to check whether a page on this already exists.",
116
+ "If it does, extend it with outline_update (mode append) instead of creating a duplicate.",
117
+ "If it does not, use outline_collections to pick the right collection and create the page with outline_create.",
118
+ "Write what a colleague would need in six months: the decision, why, and what was ruled out -- not a transcript.",
119
+ "Show me the page title and URL when you are done.",
120
+ ]
121
+ .filter(Boolean)
122
+ .join(" "),
123
+ { deliverAs: "steer" },
124
+ );
125
+ ctx.ui.notify("Asking the agent to write this up in the wiki...", "info");
126
+ },
127
+ });
128
+ }
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@patimweb/pi-outline-wiki",
3
+ "version": "1.0.0",
4
+ "description": "Outline wiki extension for the pi coding agent. Search, read, write, organise and comment on Outline documents from your pi session.",
5
+ "keywords": [
6
+ "pi-package",
7
+ "pi-extension",
8
+ "outline",
9
+ "wiki",
10
+ "knowledge-base",
11
+ "documentation"
12
+ ],
13
+ "author": "Patrick Weppelmann",
14
+ "license": "MIT",
15
+ "type": "module",
16
+ "engines": {
17
+ "node": ">=26.0.0"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/Smotherer007/pi-outline-wiki.git"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/Smotherer007/pi-outline-wiki/issues"
25
+ },
26
+ "scripts": {
27
+ "build": "echo 'No build step defined'",
28
+ "test": "node --experimental-test-module-mocks --experimental-test-coverage --test 'tests/**/*.test.ts'",
29
+ "test:watch": "node --experimental-test-module-mocks --test --watch 'tests/**/*.test.ts'",
30
+ "test:coverage": "node --experimental-test-module-mocks --experimental-test-coverage --test 'tests/**/*.test.ts'"
31
+ },
32
+ "dependencies": {
33
+ "typebox": "^1.2.8"
34
+ },
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "devDependencies": {
39
+ "@semantic-release/git": "^10.0.0",
40
+ "semantic-release": "^25.0.0"
41
+ },
42
+ "pi": {
43
+ "extensions": [
44
+ "./index.ts"
45
+ ],
46
+ "skills": [
47
+ "./skills"
48
+ ],
49
+ "image": "https://raw.githubusercontent.com/Smotherer007/pi-outline-wiki/main/screenshot.png"
50
+ }
51
+ }
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ branches: ["main", { name: "next", prerelease: true }],
3
+ plugins: [
4
+ "@semantic-release/commit-analyzer",
5
+ "@semantic-release/release-notes-generator",
6
+ "@semantic-release/npm",
7
+ [
8
+ "@semantic-release/git",
9
+ {
10
+ assets: ["package.json", "package-lock.json"],
11
+ message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
12
+ }
13
+ ],
14
+ "@semantic-release/github"
15
+ ]
16
+ };
package/screenshot.png ADDED
Binary file
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: outline-doc-writing
3
+ description: Write and edit documents in the Outline wiki so they are findable, correct and safe to change. Use whenever creating a new wiki page, updating an existing one, restructuring a collection, or when the user asks to "document this in the wiki", "write it up in Outline", "update the runbook" or "add a page". Covers where a page belongs, how to structure it, how to update without destroying other people's work, and when to comment instead of edit.
4
+ allowed-tools: outline_collections, outline_structure, outline_search, outline_list, outline_read, outline_create, outline_update, outline_move, outline_archive, outline_comment
5
+ ---
6
+
7
+ # Writing in the Outline wiki
8
+
9
+ A wiki page you write is read by people who were not in this session. Write
10
+ for them.
11
+
12
+ ## Before you create anything
13
+
14
+ 1. `outline_search` for the topic. **Extending an existing page is almost
15
+ always better than adding a second one.** Duplicates are how wikis die.
16
+ 2. If nothing exists, `outline_collections` then `outline_structure` on the
17
+ likely collection, so the new page lands where people will look for it.
18
+ 3. If the right home is ambiguous, ask the user which collection rather than
19
+ picking one at random.
20
+
21
+ ## Where a page goes
22
+
23
+ - A new topic in an existing area: `outline_create` with
24
+ `parentDocumentId` set to the area's index page.
25
+ - A genuinely new area: `outline_create` with `collectionId` only.
26
+ - Unsure, or the content is still rough: `publish: false` creates a private
27
+ draft. Tell the user it is a draft and how to publish it.
28
+
29
+ ## Structure that survives
30
+
31
+ Outline renders the title separately, so **do not repeat the title as an H1**
32
+ in the body. Start with a one- or two-sentence summary of what the page is
33
+ for, then headings.
34
+
35
+ Shapes that work:
36
+
37
+ - **Reference / convention page:** summary, the rule, examples of right and
38
+ wrong, exceptions, who to ask.
39
+ - **Runbook:** when to use it, prerequisites, numbered steps with the exact
40
+ commands, how to verify it worked, how to roll back, escalation contact.
41
+ - **Decision record:** context, the decision, alternatives considered and why
42
+ they lost, consequences, date and participants.
43
+ - **Overview / index:** what lives in this area, one line per child page,
44
+ links to them.
45
+
46
+ Write plainly. Prefer short paragraphs and real commands in fenced code
47
+ blocks over prose describing commands. Date anything time-sensitive
48
+ explicitly ("as of 2026-09") so a future reader can judge its age.
49
+
50
+ ## Updating without collateral damage
51
+
52
+ `outline_update` with the default `mode: replace` **overwrites the entire
53
+ body**. Only replace after `outline_read`, and only when you are genuinely
54
+ rewriting the page.
55
+
56
+ - Adding a new section, entry or note: `mode: append`.
57
+ - Adding a notice or a newest-first log entry: `mode: prepend`.
58
+ - Fixing a typo in a long page: read it, then replace with the corrected
59
+ full text.
60
+
61
+ Never silently rewrite someone else's page to say something different. If you
62
+ disagree with existing content, or if a change is a judgement call the team
63
+ should make, `outline_comment` on the page instead of editing it.
64
+
65
+ ## Retiring pages
66
+
67
+ `outline_archive` is the right tool for a page that is obsolete - it stays
68
+ searchable and can be restored. `outline_delete` is for pages that should
69
+ never have existed, and permanent deletion only when the user explicitly asks
70
+ for it.
71
+
72
+ `outline_move` re-files a page and takes its children with it; use it when
73
+ the content is fine but the location is wrong.
74
+
75
+ ## Finish the job
76
+
77
+ After writing, tell the user the page title, its id and its URL, and say in
78
+ one line what you put there. If you created a draft, say that too.
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: outline-knowledge-capture
3
+ description: Turn what was worked out in a coding session into a durable Outline wiki page - architecture decisions, debugging findings, incident write-ups, setup and runbook steps, or gotchas that cost real time. Use when the user says "write this up", "document this decision", "capture this in the wiki", "add this to our docs", "so we don't hit this again", or after any session that produced knowledge which is not obvious from the code alone.
4
+ allowed-tools: outline_collections, outline_structure, outline_search, outline_read, outline_create, outline_update, outline_comment
5
+ ---
6
+
7
+ # Capturing session knowledge in Outline
8
+
9
+ Sessions produce two kinds of output: the change to the code, and the
10
+ understanding that made the change possible. The second one is lost unless
11
+ someone writes it down. That is what this is for.
12
+
13
+ ## What is worth capturing
14
+
15
+ Write it up when the finding is **durable and non-obvious**:
16
+
17
+ - a decision with alternatives that were rejected for reasons
18
+ - a root cause that took real effort to find
19
+ - an environment or setup step that is not in any README
20
+ - a constraint that is invisible in the code ("the vendor API rate-limits
21
+ per organisation, not per key")
22
+ - a workaround and the condition under which it can be removed
23
+
24
+ Do not write up: routine changes the diff already explains, transcripts of
25
+ what you tried, or anything you would have to invent details for.
26
+
27
+ ## Procedure
28
+
29
+ 1. **Check for an existing home.** `outline_search` with the system or
30
+ component name. A decision about the payments service belongs on or under
31
+ the payments page, not in a new orphan document.
32
+ 2. **Extend before you create.** If a relevant page exists, `outline_read` it
33
+ and add a dated section with `outline_update` `mode: append`.
34
+ 3. **Otherwise create.** `outline_collections` -> `outline_structure` ->
35
+ `outline_create` under the right parent.
36
+ 4. **Report back** with the title, id and URL.
37
+
38
+ ## What to write
39
+
40
+ Answer the four questions a future colleague will actually have:
41
+
42
+ - **What was the situation?** One paragraph of context, with dates and
43
+ version or commit references where they matter.
44
+ - **What did we decide or find?** The conclusion, stated plainly and up front.
45
+ - **Why?** The reasoning, and what was ruled out. This is the part that
46
+ cannot be reconstructed from the repository later.
47
+ - **What now?** Consequences, follow-ups, and how to tell if this stops being
48
+ true.
49
+
50
+ Include the concrete artefacts: the exact error message, the command that
51
+ reproduces it, the file paths, the ticket or PR link. A page that says "we
52
+ fixed a timeout issue" helps nobody.
53
+
54
+ ## Templates
55
+
56
+ **Decision (append to the component's page, or a new child page)**
57
+
58
+ ```
59
+ ## <Decision> - <YYYY-MM-DD>
60
+
61
+ **Context.** <what forced the choice>
62
+ **Decision.** <what we chose>
63
+ **Alternatives.** <option: why it lost>
64
+ **Consequences.** <what this makes easy, what it makes hard, what to revisit>
65
+ ```
66
+
67
+ **Debugging / incident finding**
68
+
69
+ ```
70
+ ## <Symptom> - <YYYY-MM-DD>
71
+
72
+ **Symptom.** <what was observed, with the exact error>
73
+ **Root cause.** <the actual mechanism>
74
+ **Fix.** <what was changed, with paths or PR link>
75
+ **How to spot it again.** <the signal that identifies this failure mode>
76
+ ```
77
+
78
+ **Gotcha**
79
+
80
+ ```
81
+ ## <Short name>
82
+
83
+ <One paragraph: what surprises people, and what to do instead.>
84
+ ```
85
+
86
+ ## Tone and honesty
87
+
88
+ Write in the team's voice, not as a report about an AI session - drop
89
+ "I asked", "the agent", "in this conversation". State facts you verified;
90
+ mark anything uncertain as uncertain. If a conclusion is genuinely a
91
+ judgement call the team still has to make, `outline_comment` the open
92
+ question on the page rather than writing it up as settled.
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: outline-wiki
3
+ description: Research the team's Outline wiki before answering questions about internal systems, conventions, decisions, runbooks or onboarding. Use whenever a question is about "how we do it here" rather than about general knowledge or the code in front of you - for example architecture decisions, deployment steps, naming conventions, ownership, incident history, or anything the user refers to as "the wiki", "our docs", "Confluence-style notes" or Outline. Also use it to check whether the wiki already covers something before writing a new page.
4
+ allowed-tools: outline_status, outline_collections, outline_structure, outline_search, outline_list, outline_read, outline_comments, outline_export
5
+ ---
6
+
7
+ # Researching the Outline wiki
8
+
9
+ The wiki is the team's memory. Code says what the system does; the wiki says
10
+ why, who owns it, and what was already tried. Read it before guessing.
11
+
12
+ ## When to reach for it
13
+
14
+ Use the wiki when the answer depends on this organisation:
15
+
16
+ - "How do we deploy X?" / "What is our release process?"
17
+ - "Why did we choose Y?" / "Is there a decision record for this?"
18
+ - "Who owns service Z?"
19
+ - "What is our convention for naming / branching / logging?"
20
+ - The user mentions a page, a runbook, an ADR, or onboarding notes.
21
+
22
+ Do **not** use it for general programming questions, or for facts that the
23
+ repository in front of you answers directly.
24
+
25
+ ## The loop
26
+
27
+ 1. **Search, do not browse.** `outline_search` with two or three distinctive
28
+ nouns. "postgres failover" beats "how does our database failover work".
29
+ 2. **Read the top hits.** The search snippet is not the answer.
30
+ `outline_read` on the one or two most promising ids.
31
+ 3. **Follow the structure.** If a page looks like an index, use
32
+ `outline_read` with `includeChildren: true`, or `outline_structure` on its
33
+ collection, to see what sits under it.
34
+ 4. **Answer with citations.** Name the document title and id you used, so the
35
+ user can open it. If several pages disagree, say so and give the update
36
+ dates - wikis rot.
37
+
38
+ ## Search that actually finds things
39
+
40
+ - Start broad, then filter. Only add `collectionId` after
41
+ `outline_collections` told you which collection is relevant.
42
+ - If a search returns nothing, try a synonym, an acronym, and the spelled-out
43
+ form before concluding the wiki is silent. Teams write "k8s" and
44
+ "Kubernetes" in different pages.
45
+ - Recent-work questions ("what changed lately?") are `outline_list`, not
46
+ `outline_search`.
47
+ - Something that existed but is gone is usually archived, not deleted:
48
+ re-run the search with `statusFilter: ["published", "archived"]`.
49
+
50
+ ## Ids
51
+
52
+ Every tool takes a document id. Ids come from search, list or structure
53
+ output - never invent one. An Outline URL like
54
+ `https://acme.getoutline.com/doc/runbook-deploy-aBc123XyZ` also works: pass
55
+ the trailing `runbook-deploy-aBc123XyZ` slug as `id`.
56
+
57
+ ## Honesty rules
58
+
59
+ - If the wiki has nothing on the topic, say "the wiki does not cover this"
60
+ rather than filling the gap with plausible-sounding invention.
61
+ - Distinguish what the wiki claims from what you verified in the code. A page
62
+ last updated two years ago is a hypothesis, not a fact.
63
+ - Check `outline_comments` on a page before treating it as settled; open
64
+ questions and corrections often live in the comments, not the body.
65
+
66
+ ## Pulling content into the repo
67
+
68
+ When the user wants wiki content available offline or in the repository, use
69
+ `outline_export` with a `targetDir` instead of reading page after page
70
+ through the model - it writes markdown files directly and costs no context.