with one click
sc-document
// Search, read, create, and update documents in an Outline wiki. Use when the user wants to manage documentation stored in the configured Outline workspace.
// Search, read, create, and update documents in an Outline wiki. Use when the user wants to manage documentation stored in the configured Outline workspace.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | SC-document |
| description | Search, read, create, and update documents in an Outline wiki. Use when the user wants to manage documentation stored in the configured Outline workspace. |
You help the user manage documentation in an Outline wiki instance. This skill supports full CRUD operations: search, read, create, and update.
Environment variables are read from the .env file in the repository root:
| Variable | Required | Description |
|---|---|---|
OUTLINE_API_KEY | Yes | Bearer token for API authentication |
OUTLINE_API_URL | Yes | Base API URL (e.g., https://myteam.getoutline.com/api) |
OUTLINE_COLLECTION_ID | No | Default collection to scope operations |
Before making any API call, read the configuration:
$envFile = Get-Content ".env" -ErrorAction Stop
$apiKey = ($envFile | Where-Object { $_ -match "^OUTLINE_API_KEY=" }) -replace "^OUTLINE_API_KEY=", ""
$apiUrl = ($envFile | Where-Object { $_ -match "^OUTLINE_API_URL=" }) -replace "^OUTLINE_API_URL=", ""
$collectionId = ($envFile | Where-Object { $_ -match "^OUTLINE_COLLECTION_ID=" }) -replace "^OUTLINE_COLLECTION_ID=", ""
Validate that OUTLINE_API_KEY and OUTLINE_API_URL are set. If missing, tell
the user to add them to .env.
All requests use Bearer token auth:
Authorization: Bearer <OUTLINE_API_KEY>
Content-Type: application/json
Helper for headers:
$headers = @{
Authorization = "Bearer $apiKey"
"Content-Type" = "application/json"
}
$body = @{ query = "<search term>" } | ConvertTo-Json
$response = Invoke-RestMethod -Uri "$apiUrl/documents.search" `
-Method POST -Headers $headers -Body $body
$response.data | ForEach-Object { "$($_.document.title) — $($_.document.id)" }
Optional body parameters:
collectionId — limit to a specific collectionlimit — max results (default 25)offset — pagination offsetdateFilter — "day", "week", "month", "year"includeArchived — boolean$body = @{ id = "<document-id>" } | ConvertTo-Json
$response = Invoke-RestMethod -Uri "$apiUrl/documents.info" `
-Method POST -Headers $headers -Body $body
$response.data.text # Markdown content
$body = @{
title = "<document title>"
text = "<markdown content>"
collectionId = $collectionId # or a specific collection ID
publish = $true # set $false to create as draft
} | ConvertTo-Json -Depth 10
$response = Invoke-RestMethod -Uri "$apiUrl/documents.create" `
-Method POST -Headers $headers -Body $body
Write-Output "Created: $($response.data.title) — $($response.data.id)"
Optional parameters:
parentDocumentId — create as a child of another documenttemplateId — use an existing document as templatetemplate — boolean, mark this document as a template$body = @{
id = "<document-id>"
title = "<new title>" # optional
text = "<new content>" # optional — full replacement
} | ConvertTo-Json -Depth 10
$response = Invoke-RestMethod -Uri "$apiUrl/documents.update" `
-Method POST -Headers $headers -Body $body
Write-Output "Updated: $($response.data.title)"
Optional parameters:
append — boolean, if $true appends text instead of replacingpublish — boolean, publish a draftdone — boolean, mark task as done$body = @{} | ConvertTo-Json
$response = Invoke-RestMethod -Uri "$apiUrl/collections.list" `
-Method POST -Headers $headers -Body $body
$response.data | ForEach-Object { "$($_.name) — $($_.id)" }
$body = @{ collectionId = "<collection-id>" } | ConvertTo-Json
$response = Invoke-RestMethod -Uri "$apiUrl/documents.list" `
-Method POST -Headers $headers -Body $body
$response.data | ForEach-Object { "$($_.title) — $($_.id)" }
$body = @{ id = "<document-id>" } | ConvertTo-Json
$response = Invoke-RestMethod -Uri "$apiUrl/documents.delete" `
-Method POST -Headers $headers -Body $body
Write-Output "Archived document."
Outline soft-deletes by default (moves to archive). Use
permanent = $truein the body for permanent deletion — ask for user confirmation first.
.env.Invoke-RestMethod.When the user asks to "document" something (a module, a decision, a process):
OUTLINE_COLLECTION_ID default).<OUTLINE_API_URL without /api>/doc/<slug>-<id>When the user asks to update a document:
| HTTP Status | Meaning | Action |
|---|---|---|
| 401 | Unauthorized | API key expired or invalid. Ask user to regenerate at Outline settings → API. |
| 403 | Forbidden | User doesn't have permission for this collection/document. |
| 404 | Not Found | Document or collection deleted/archived. |
| 429 | Rate Limited | Wait and retry. Outline rate limits to ~120 req/min. |
| Situation | Action |
|---|---|
.env missing | Tell user to create .env with required OUTLINE_* variables |
OUTLINE_API_URL missing | Ask user for their Outline instance URL |
| No search results | Suggest broadening query or listing collections first |
| Collection not found | List available collections and ask user to pick one |
text field.ranking score and context snippet.collectionId to narrow search scope when the workspace is large.https://<instance>/doc/<slug>-<id>