skillwiki 0.2.0-beta.1 → 0.2.0-beta.10
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/dist/cli.js +721 -134
- package/package.json +19 -6
- package/skills/.claude-plugin/plugin.json +24 -0
- package/skills/README.md +10 -0
- package/skills/hooks/hooks.json +16 -0
- package/skills/hooks/run-hook.cmd +43 -0
- package/skills/hooks/session-start +29 -0
- package/skills/package.json +13 -0
- package/skills/proj-decide/SKILL.md +24 -0
- package/skills/proj-distill/SKILL.md +48 -0
- package/skills/proj-init/SKILL.md +29 -0
- package/skills/proj-work/SKILL.md +48 -0
- package/skills/using-skillwiki/SKILL.md +65 -0
- package/skills/wiki-adapter-prd/SKILL.md +87 -0
- package/skills/wiki-archive/SKILL.md +42 -0
- package/skills/wiki-audit/SKILL.md +33 -0
- package/skills/wiki-crystallize/SKILL.md +34 -0
- package/skills/wiki-ingest/SKILL.md +58 -0
- package/skills/wiki-init/SKILL.md +36 -0
- package/skills/wiki-lint/SKILL.md +33 -0
- package/skills/wiki-query/SKILL.md +40 -0
- package/skills/wiki-reingest/SKILL.md +54 -0
- package/templates/SCHEMA.md +16 -0
package/package.json
CHANGED
|
@@ -1,27 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillwiki",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.10",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"bin": {
|
|
6
|
-
|
|
5
|
+
"bin": {
|
|
6
|
+
"skillwiki": "dist/cli.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"templates",
|
|
11
|
+
"skills",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
7
14
|
"scripts": {
|
|
8
|
-
"build": "tsup",
|
|
15
|
+
"build": "tsup && rm -rf ./skills && cp -r ../skills ./skills",
|
|
9
16
|
"test": "vitest run",
|
|
10
17
|
"test:watch": "vitest",
|
|
11
18
|
"typecheck": "tsc --noEmit"
|
|
12
19
|
},
|
|
13
20
|
"dependencies": {
|
|
14
|
-
"@skillwiki/shared": "*",
|
|
15
21
|
"commander": "^12.1.0",
|
|
16
22
|
"js-yaml": "^4.1.0",
|
|
17
23
|
"zod": "^3.23.0"
|
|
18
24
|
},
|
|
19
25
|
"devDependencies": {
|
|
26
|
+
"@skillwiki/shared": "*",
|
|
20
27
|
"@types/js-yaml": "^4.0.9",
|
|
21
28
|
"@types/node": "^20.12.0",
|
|
22
29
|
"tsup": "^8.3.0",
|
|
23
30
|
"typescript": "^5.7.0",
|
|
24
31
|
"vitest": "^2.1.0"
|
|
25
32
|
},
|
|
26
|
-
"
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/karlorz/llm-wiki.git"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=20"
|
|
39
|
+
}
|
|
27
40
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skillwiki",
|
|
3
|
+
"version": "0.2.0-beta.10",
|
|
4
|
+
"skills": "./",
|
|
5
|
+
"description": "Project-aware Karpathy-style knowledge base for Claude Code: 11 prompt-only skills (wiki-*, proj-*, using-skillwiki) backed by the deterministic `skillwiki` CLI (8 subcommands, JSON-by-default).",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "karlorz",
|
|
8
|
+
"url": "https://github.com/karlorz"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/karlorz/llm-wiki",
|
|
11
|
+
"repository": "https://github.com/karlorz/llm-wiki",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"knowledge-base",
|
|
15
|
+
"wiki",
|
|
16
|
+
"obsidian",
|
|
17
|
+
"claude-code",
|
|
18
|
+
"skills",
|
|
19
|
+
"karpathy",
|
|
20
|
+
"markdown",
|
|
21
|
+
"research",
|
|
22
|
+
"rag-alternative"
|
|
23
|
+
]
|
|
24
|
+
}
|
package/skills/README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# @skillwiki/skills
|
|
2
|
+
|
|
3
|
+
Prompt-only Markdown skills for Claude Code. Installed via `skillwiki install`.
|
|
4
|
+
|
|
5
|
+
| Namespace | Skills |
|
|
6
|
+
|---|---|
|
|
7
|
+
| `wiki-*` | `wiki-init`, `wiki-ingest`, `wiki-query`, `wiki-lint`, `wiki-crystallize`, `wiki-audit` |
|
|
8
|
+
| `proj-*` | `proj-init`, `proj-work`, `proj-distill`, `proj-decide` |
|
|
9
|
+
|
|
10
|
+
Each subdirectory holds one `SKILL.md`. No build step.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
: << 'CMDBLOCK'
|
|
2
|
+
@echo off
|
|
3
|
+
REM Cross-platform polyglot wrapper for hook scripts.
|
|
4
|
+
REM On Windows: cmd.exe runs the batch portion, which finds and calls bash.
|
|
5
|
+
REM On Unix: the shell interprets this as a script (: is a no-op in bash).
|
|
6
|
+
REM
|
|
7
|
+
REM Hook scripts use extensionless filenames (e.g. "session-start" not
|
|
8
|
+
REM "session-start.sh") so Claude Code's Windows auto-detection -- which
|
|
9
|
+
REM prepends "bash" to any command containing .sh -- doesn't interfere.
|
|
10
|
+
|
|
11
|
+
if "%~1"=="" (
|
|
12
|
+
echo run-hook.cmd: missing script name >&2
|
|
13
|
+
exit /b 1
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
set "HOOK_DIR=%~dp0"
|
|
17
|
+
|
|
18
|
+
REM Try Git for Windows bash in standard locations
|
|
19
|
+
if exist "C:\Program Files\Git\bin\bash.exe" (
|
|
20
|
+
"C:\Program Files\Git\bin\bash.exe" "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
|
|
21
|
+
exit /b %ERRORLEVEL%
|
|
22
|
+
)
|
|
23
|
+
if exist "C:\Program Files (x86)\Git\bin\bash.exe" (
|
|
24
|
+
"C:\Program Files (x86)\Git\bin\bash.exe" "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
|
|
25
|
+
exit /b %ERRORLEVEL%
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
REM Try bash on PATH
|
|
29
|
+
where bash >nul 2>nul
|
|
30
|
+
if %ERRORLEVEL% equ 0 (
|
|
31
|
+
bash "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
|
|
32
|
+
exit /b %ERRORLEVEL%
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
REM No bash found - exit silently
|
|
36
|
+
exit /b 0
|
|
37
|
+
CMDBLOCK
|
|
38
|
+
|
|
39
|
+
# Unix: run the named script directly
|
|
40
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
41
|
+
SCRIPT_NAME="$1"
|
|
42
|
+
shift
|
|
43
|
+
exec bash "${SCRIPT_DIR}/${SCRIPT_NAME}" "$@"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# SessionStart hook for skillwiki plugin
|
|
3
|
+
# Injects using-skillwiki SKILL.md content into every conversation.
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(cd "$(dirname "$0")/.." && pwd)}"
|
|
8
|
+
|
|
9
|
+
skill_content=$(cat "${PLUGIN_ROOT}/using-skillwiki/SKILL.md" 2>/dev/null || echo "Error reading using-skillwiki skill")
|
|
10
|
+
|
|
11
|
+
# Escape string for JSON embedding using bash parameter substitution.
|
|
12
|
+
# Each ${s//old/new} is a single C-level pass.
|
|
13
|
+
escape_for_json() {
|
|
14
|
+
local s="$1"
|
|
15
|
+
s="${s//\\/\\\\}"
|
|
16
|
+
s="${s//\"/\\\"}"
|
|
17
|
+
s="${s//$'\n'/\\n}"
|
|
18
|
+
s="${s//$'\r'/\\r}"
|
|
19
|
+
s="${s//$'\t'/\\t}"
|
|
20
|
+
printf '%s' "$s"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
skill_escaped=$(escape_for_json "$skill_content")
|
|
24
|
+
session_context="<EXTREMELY_IMPORTANT>\nYou have skillwiki.\n\n**Below is the full content of your 'skillwiki:using-skillwiki' skill - your introduction to the skillwiki skills. For all other skills, use the 'Skill' tool:**\n\n${skill_escaped}\n</EXTREMELY_IMPORTANT>"
|
|
25
|
+
|
|
26
|
+
# Uses printf instead of heredoc to work around bash 5.3+ heredoc hang.
|
|
27
|
+
printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context"
|
|
28
|
+
|
|
29
|
+
exit 0
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: proj-decide
|
|
3
|
+
description: Write an Architectural Decision Record (ADR). If the decision generalizes, also create a concepts/ page.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# proj-decide
|
|
7
|
+
|
|
8
|
+
## When to invoke
|
|
9
|
+
- User commits to an architectural decision worth recording for future reference.
|
|
10
|
+
|
|
11
|
+
## Pre-orientation reads
|
|
12
|
+
Standard four + project context.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
1. Compose the ADR in `projects/{slug}/architecture/YYYY-MM-DD-{adr-slug}.md`. Frontmatter: kind=decision, status=in-progress or completed, project link.
|
|
16
|
+
2. `npx skillwiki validate <adr>`. If non-zero, STOP.
|
|
17
|
+
3. **Generalization check.** If the decision applies beyond this project, create a `concepts/` page with `provenance: project` (or `mixed` if research-informed).
|
|
18
|
+
4. Apply writes: ADR → (optional) concept page → vault `index.md` → vault `log.md` and project `log.md`.
|
|
19
|
+
|
|
20
|
+
## Stop conditions
|
|
21
|
+
- `validate` non-zero on either page.
|
|
22
|
+
|
|
23
|
+
## Forbidden
|
|
24
|
+
- Filing the concept page without explicit `provenance:`.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: proj-distill
|
|
3
|
+
description: 2-step distillation (E4) — analyze project compound entry, then generate a vault concept page with provenance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# proj-distill
|
|
7
|
+
|
|
8
|
+
## When to invoke
|
|
9
|
+
- A project compound entry captures a pattern that generalizes beyond the project.
|
|
10
|
+
|
|
11
|
+
## Pre-orientation reads
|
|
12
|
+
Standard four + project context.
|
|
13
|
+
|
|
14
|
+
## Steps (E4 — 2-step pattern)
|
|
15
|
+
|
|
16
|
+
### Source selection
|
|
17
|
+
|
|
18
|
+
Check `projects/{slug}/compound/` first. If empty, fall back to retro
|
|
19
|
+
entries in vault `log.md` (lines matching `## [YYYY-MM-DD] retro`).
|
|
20
|
+
|
|
21
|
+
When reading retros as source material:
|
|
22
|
+
- Collect all retros for the project, focusing on entries with
|
|
23
|
+
`Generalize?: yes`.
|
|
24
|
+
- Group by recurring theme (≥2 occurrences across cycles).
|
|
25
|
+
- Each group becomes a candidate concept outline.
|
|
26
|
+
|
|
27
|
+
1. **Step 1 — Analyze.** Read the source compound entry + linked work
|
|
28
|
+
items (or retro groups from log.md). Output a candidate concept
|
|
29
|
+
outline. STOP if no clear universal pattern is found — surface the
|
|
30
|
+
reasoning instead of forcing a page.
|
|
31
|
+
2. **Step 2 — Generate.** Compose the vault concept page with
|
|
32
|
+
`provenance: project` and
|
|
33
|
+
`provenance_projects: ["[[slug]]"]`. Validate with
|
|
34
|
+
`npx skillwiki validate`.
|
|
35
|
+
3. **Backlink.** Set `promoted_to: "[[concept-slug]]"` on the source
|
|
36
|
+
compound entry. For retro-sourced distillation, skip backlink (log.md
|
|
37
|
+
entries are append-only) and instead add `sources:` citing the vault
|
|
38
|
+
log with date range.
|
|
39
|
+
4. **Apply writes in order.** Vault concept page → backlink update →
|
|
40
|
+
project `log.md` → vault `index.md` → vault `log.md`.
|
|
41
|
+
|
|
42
|
+
## Stop conditions
|
|
43
|
+
- No clear universal pattern.
|
|
44
|
+
- `validate` non-zero on either page.
|
|
45
|
+
|
|
46
|
+
## Forbidden
|
|
47
|
+
- Skipping Step 1 (no direct generation).
|
|
48
|
+
- Updating index/logs before `validate` passes.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: proj-init
|
|
3
|
+
description: Bootstrap a project workspace at projects/{slug}/ with README, requirements/, architecture/, work/, compound/.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# proj-init
|
|
7
|
+
|
|
8
|
+
## When to invoke
|
|
9
|
+
- User starts a new project that should live inside the vault.
|
|
10
|
+
|
|
11
|
+
## Pre-orientation reads
|
|
12
|
+
Standard four reads (vault SCHEMA, index, log) — no project context yet.
|
|
13
|
+
|
|
14
|
+
## Inputs
|
|
15
|
+
- Slug (lowercase, hyphenated).
|
|
16
|
+
- One-line intent.
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
1. Verify `projects/{slug}/` does not exist.
|
|
20
|
+
2. Create folders: `projects/{slug}/{requirements,architecture,work,compound}/`.
|
|
21
|
+
3. Render `projects/{slug}/README.md` from `project-README.md` template, filling `{{slug}}` and `{{date}}`.
|
|
22
|
+
4. Update vault `index.md` "Projects" section: add `- [[projects/{slug}]]`.
|
|
23
|
+
5. Append vault `log.md` entry: "Project {slug} initialized."
|
|
24
|
+
|
|
25
|
+
## Stop conditions
|
|
26
|
+
- `projects/{slug}/` already exists.
|
|
27
|
+
|
|
28
|
+
## Forbidden
|
|
29
|
+
- Modifying any other project's files.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: proj-work
|
|
3
|
+
description: Open or run a work item under projects/{slug}/work/YYYY-MM-DD-{slug}/. Redirects brainstorming/writing-plans output paths.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# proj-work
|
|
7
|
+
|
|
8
|
+
## When to invoke
|
|
9
|
+
- User starts a feature, issue, refactor, or decision inside an existing project.
|
|
10
|
+
- Brainstorming or writing-plans skills would otherwise default-write outside the project tree.
|
|
11
|
+
|
|
12
|
+
## Pre-orientation reads
|
|
13
|
+
Standard four + project context (project README, last ~5 work logs).
|
|
14
|
+
|
|
15
|
+
## Steps
|
|
16
|
+
1. Determine `kind:` (feature | issue | refactor | decision) and slug.
|
|
17
|
+
2. Create folder `projects/{slug}/work/YYYY-MM-DD-{work-slug}/`.
|
|
18
|
+
3. Override default output paths for any nested skill: `spec.md`, `plan.md`, and `log.md` are written here, not at vault root.
|
|
19
|
+
4. Validate work-item frontmatter via `npx skillwiki validate <spec.md>`. If non-zero, STOP.
|
|
20
|
+
5. Manage status transitions: `planned` → `in-progress` → `completed` (set `completed:` date) or `abandoned`.
|
|
21
|
+
6. Append vault `log.md` entry on creation and on each status transition.
|
|
22
|
+
|
|
23
|
+
## Redirect Output
|
|
24
|
+
|
|
25
|
+
After step 3 (output path override), emit redirect paths for the active PRD skill:
|
|
26
|
+
|
|
27
|
+
> Work item created: projects/{slug}/work/YYYY-MM-DD-{work-slug}/
|
|
28
|
+
>
|
|
29
|
+
> Redirect paths for PRD skills:
|
|
30
|
+
> spec → <vault-root>/projects/{slug}/work/YYYY-MM-DD-{work-slug}/spec.md
|
|
31
|
+
> plan → <vault-root>/projects/{slug}/work/YYYY-MM-DD-{work-slug}/plan.md
|
|
32
|
+
>
|
|
33
|
+
> Pass these paths to your PRD skill (superpowers:brainstorming, superpowers:writing-plans,
|
|
34
|
+
> CodeStable, or any other). Files land in the vault natively — no separate ingest needed.
|
|
35
|
+
|
|
36
|
+
Rules:
|
|
37
|
+
- Emit redirect paths as the first output after folder creation, before any PRD skill runs.
|
|
38
|
+
- Resolve `<vault-root>` via `skillwiki path` (never hardcode).
|
|
39
|
+
- proj-work does NOT invoke any PRD skill — it provides paths only.
|
|
40
|
+
- If the PRD skill cannot accept custom save paths, fall back to manual `wiki-ingest`.
|
|
41
|
+
|
|
42
|
+
## Stop conditions
|
|
43
|
+
- `validate` non-zero.
|
|
44
|
+
- Conflicting work folder name.
|
|
45
|
+
|
|
46
|
+
## Forbidden
|
|
47
|
+
- Writing spec/plan files outside the work folder.
|
|
48
|
+
- Marking `status: completed` without a `completed:` date.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-skillwiki
|
|
3
|
+
description: Invoke at session start or when knowledge-base tasks arise — maps all wiki-*/proj-* skills and teaches the skillwiki CLI workflow
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<SUBAGENT-STOP>
|
|
7
|
+
If you were dispatched as a subagent to execute a specific task, skip this skill.
|
|
8
|
+
</SUBAGENT-STOP>
|
|
9
|
+
|
|
10
|
+
# using-skillwiki
|
|
11
|
+
|
|
12
|
+
You have skillwiki — a project-aware Karpathy-style knowledge base for Claude Code.
|
|
13
|
+
|
|
14
|
+
## When to Use These Skills
|
|
15
|
+
|
|
16
|
+
Invoke a skillwiki skill when the user:
|
|
17
|
+
- Wants to create, build, or start a vault/wiki/knowledge base
|
|
18
|
+
- Mentions ingesting sources, reading URLs into notes, converting content
|
|
19
|
+
- Asks to search, query, or find information in their vault
|
|
20
|
+
- Wants a health check or lint on their vault
|
|
21
|
+
- Mentions crystallizing a session into a note
|
|
22
|
+
- Talks about project workspaces, ADRs, or distillation
|
|
23
|
+
- Wants to archive or clean up old vault pages
|
|
24
|
+
- Needs to detect source drift or re-ingest updated content
|
|
25
|
+
- Has a spec/plan in a non-skillwiki format (CodeStable, RFC, AIDE)
|
|
26
|
+
- Asks about their skillwiki configuration or setup health
|
|
27
|
+
|
|
28
|
+
## Skill Map
|
|
29
|
+
|
|
30
|
+
| Skill | When to Invoke |
|
|
31
|
+
|-------|----------------|
|
|
32
|
+
| `wiki-init` | Bootstrap a new vault — SCHEMA.md, index.md, log.md, ~/.skillwiki/.env |
|
|
33
|
+
| `wiki-ingest` | Convert URLs, files, or pasted text into typed-knowledge pages |
|
|
34
|
+
| `wiki-query` | Search the vault and synthesize an answer with ranked results |
|
|
35
|
+
| `wiki-lint` | Vault health check (stale pages, oversized pages, log rotation) |
|
|
36
|
+
| `wiki-crystallize` | Distill the current working session into a typed-knowledge page |
|
|
37
|
+
| `wiki-audit` | Verify raw provenance references and source frontmatter integrity |
|
|
38
|
+
| `wiki-archive` | Archive a typed-knowledge page — move to `_archive/`, remove from index |
|
|
39
|
+
| `wiki-reingest` | Detect drift in raw sources (sha256 comparison) and re-ingest updated content |
|
|
40
|
+
| `wiki-adapter-prd` | Map foreign PRD formats (CodeStable, RFC, AIDE, Hermes) into vault pages |
|
|
41
|
+
| `proj-init` | Bootstrap a project workspace (README, requirements, architecture) |
|
|
42
|
+
| `proj-work` | Open or run a work item under a project's work/ directory |
|
|
43
|
+
| `proj-distill` | Distill project compound entries into vault concept pages |
|
|
44
|
+
| `proj-decide` | Write an Architectural Decision Record (ADR) |
|
|
45
|
+
|
|
46
|
+
## CLI Backbone
|
|
47
|
+
|
|
48
|
+
All skills are backed by the `skillwiki` CLI — a deterministic tool with no LLM calls. It handles path resolution, config management, validation, and linting. Skills invoke it via Bash for the mechanical parts and use Claude for the creative parts.
|
|
49
|
+
|
|
50
|
+
Key CLI subcommands: `init`, `lint`, `config`, `doctor`, `path`, `lang`, `install`, `graph build`, `archive`, `drift`.
|
|
51
|
+
|
|
52
|
+
Run `skillwiki doctor` to diagnose setup issues. Run `skillwiki config list` to see current configuration.
|
|
53
|
+
|
|
54
|
+
## Typical Workflow
|
|
55
|
+
|
|
56
|
+
1. **Init** (`wiki-init`) — create vault, set domain and taxonomy
|
|
57
|
+
2. **Ingest** (`wiki-ingest`) — add sources, build pages
|
|
58
|
+
3. **Query** (`wiki-query`) — search and synthesize answers
|
|
59
|
+
4. **Lint** (`wiki-lint`) — periodic health checks
|
|
60
|
+
5. **Crystallize** (`wiki-crystallize`) — save session insights as pages
|
|
61
|
+
6. **Audit** (`wiki-audit`) — verify source integrity
|
|
62
|
+
|
|
63
|
+
For longer-running project work, use `proj-init` → `proj-work` → `proj-distill` / `proj-decide`.
|
|
64
|
+
|
|
65
|
+
Maintenance: **Archive** (`wiki-archive`) superseded pages, **Drift** (`wiki-reingest`) to detect stale sources, **Adapter** (`wiki-adapter-prd`) for foreign PRD format ingestion.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-adapter-prd
|
|
3
|
+
description: Map foreign PRD formats (CodeStable, RFCs, structured markdown) into skillwiki raw + typed-knowledge pages.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# wiki-adapter-prd
|
|
7
|
+
|
|
8
|
+
## When This Skill Activates
|
|
9
|
+
|
|
10
|
+
- User provides a document or URL in a non-skillwiki PRD format and wants it captured in the vault.
|
|
11
|
+
- User mentions CodeStable, RFC, AIDE, or another structured design document format.
|
|
12
|
+
- A foreign spec/plan needs to be normalized into the vault's raw + concept structure.
|
|
13
|
+
|
|
14
|
+
## Output language
|
|
15
|
+
|
|
16
|
+
Run `skillwiki lang` at the start. Generate page prose in the resolved language. Frontmatter keys, file names, and structural markers stay English.
|
|
17
|
+
|
|
18
|
+
## Pre-orientation reads
|
|
19
|
+
|
|
20
|
+
Standard four reads (SCHEMA, index, log, project context if applicable).
|
|
21
|
+
|
|
22
|
+
## Recognized PRD Formats
|
|
23
|
+
|
|
24
|
+
| Format | Structural cues |
|
|
25
|
+
|--------|----------------|
|
|
26
|
+
| CodeStable | `REQ-NNN` requirement IDs, `## Requirements` / `## Architecture` headers |
|
|
27
|
+
| RFC | `## Motivation` / `## Proposal` / `## Drawbacks` headers |
|
|
28
|
+
| AIDE directives | Specific YAML frontmatter keys (`aide-*`) |
|
|
29
|
+
| Hermes spec | `N1`–`N18` normative requirement markers |
|
|
30
|
+
| Generic structured | Clear `##` section hierarchy with requirements, decisions, or designs |
|
|
31
|
+
|
|
32
|
+
If the format is unrecognized, treat as generic structured markdown and map by section hierarchy.
|
|
33
|
+
|
|
34
|
+
## Mapping Strategy
|
|
35
|
+
|
|
36
|
+
### Raw capture (verbatim)
|
|
37
|
+
|
|
38
|
+
- Write the full source document to `raw/articles/<slug>.md` with RawSourceSchema frontmatter (`sha256`, `source_url`, `ingested`, `ingested_by: "wiki-ingest"`).
|
|
39
|
+
- If the source is a URL, run `skillwiki fetch-guard <url>` first.
|
|
40
|
+
- Run `skillwiki hash <raw-file>` to compute sha256.
|
|
41
|
+
|
|
42
|
+
### Knowledge extraction
|
|
43
|
+
|
|
44
|
+
Map source sections to typed-knowledge pages:
|
|
45
|
+
|
|
46
|
+
| Source section | Target type | Notes |
|
|
47
|
+
|----------------|-------------|-------|
|
|
48
|
+
| Requirements list | `concepts/` or `entities/` | Each major requirement becomes its own page or a section in a compound page |
|
|
49
|
+
| Architecture decisions | `concepts/` | Map to concept pages with `tags: [architecture]` |
|
|
50
|
+
| Motivation / context | `entities/` | Capture as entity pages describing the system or component |
|
|
51
|
+
| Trade-offs / comparisons | `comparisons/` | Create comparison pages when the source weighs alternatives |
|
|
52
|
+
| Action items / next steps | Skip | Not knowledge — track in project work items instead |
|
|
53
|
+
|
|
54
|
+
### Cross-reference handling
|
|
55
|
+
|
|
56
|
+
- Requirement IDs (`REQ-NNN`, `N1`–`N18`) → preserve as frontmatter tags or inline references.
|
|
57
|
+
- Internal links within the source → convert to `[[wikilinks]]` where corresponding pages exist.
|
|
58
|
+
- External URLs → keep as-is in body text.
|
|
59
|
+
|
|
60
|
+
## Steps
|
|
61
|
+
|
|
62
|
+
0. Resolve vault and language: `skillwiki path` and `skillwiki lang`.
|
|
63
|
+
1. Classify the input format using the structural cues above.
|
|
64
|
+
2. If URL source: run `skillwiki fetch-guard <url>`, then fetch.
|
|
65
|
+
3. Write raw capture: frontmatter + full body → `raw/articles/<slug>.md`.
|
|
66
|
+
4. Run `skillwiki hash <raw-file>`, embed sha256.
|
|
67
|
+
5. Generate typed-knowledge pages following the mapping strategy.
|
|
68
|
+
6. For each page: run `skillwiki validate <page>`. If any fails, STOP.
|
|
69
|
+
7. Write pages, then update `index.md` and `log.md`.
|
|
70
|
+
|
|
71
|
+
## Provenance defaults
|
|
72
|
+
|
|
73
|
+
- `provenance: research` (external PRD sources).
|
|
74
|
+
- `sources: ["^[raw/articles/<slug>.md]"]` on every generated page.
|
|
75
|
+
|
|
76
|
+
## Stop conditions
|
|
77
|
+
|
|
78
|
+
- `fetch-guard` non-zero.
|
|
79
|
+
- `validate` non-zero on any page.
|
|
80
|
+
- sha256 already exists for the same source (skip — already ingested).
|
|
81
|
+
|
|
82
|
+
## Forbidden
|
|
83
|
+
|
|
84
|
+
- Skipping `fetch-guard` for URL sources.
|
|
85
|
+
- Writing index/log before all pages validate.
|
|
86
|
+
- Modifying existing raw files (N9).
|
|
87
|
+
- Auto-generating pages for action items, timelines, or process steps — those are project management, not knowledge.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-archive
|
|
3
|
+
description: Archive a superseded typed-knowledge page. Moves page to _archive/, removes from index.md, logs the action.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# wiki-archive
|
|
7
|
+
|
|
8
|
+
## When This Skill Activates
|
|
9
|
+
|
|
10
|
+
- User wants to retire, supersede, or remove a typed-knowledge page from active use.
|
|
11
|
+
- A page has been replaced by a newer version and should be kept for reference but excluded from lint and queries.
|
|
12
|
+
|
|
13
|
+
## Output language
|
|
14
|
+
|
|
15
|
+
Run `skillwiki lang` at the start. Generate log entries in the resolved language.
|
|
16
|
+
|
|
17
|
+
## Pre-orientation reads
|
|
18
|
+
|
|
19
|
+
Standard four reads (SCHEMA, index, log, project context if applicable).
|
|
20
|
+
|
|
21
|
+
## Steps
|
|
22
|
+
|
|
23
|
+
0. Resolve vault: `skillwiki path` and `skillwiki lang`.
|
|
24
|
+
1. Identify the target page. Confirm with the user which page to archive (show full relPath).
|
|
25
|
+
2. Run `skillwiki archive <page> [vault]`. Read the JSON output.
|
|
26
|
+
3. Verify with `skillwiki index-check [vault]` — confirm no ghost entries remain.
|
|
27
|
+
4. Append a `log.md` entry: `## [{date}] archive | {relPath} → _archive/{subdir}/`.
|
|
28
|
+
|
|
29
|
+
## Reversibility
|
|
30
|
+
|
|
31
|
+
Archiving is reversible: move the file back from `_archive/` to its original directory and re-add the wikilink entry to `index.md`. No data is deleted.
|
|
32
|
+
|
|
33
|
+
## Stop conditions
|
|
34
|
+
|
|
35
|
+
- `skillwiki archive` returns non-zero exit code (page not found, already archived, invalid vault).
|
|
36
|
+
- User declines to proceed.
|
|
37
|
+
|
|
38
|
+
## Forbidden
|
|
39
|
+
|
|
40
|
+
- Archiving `raw/` files (N9 — raw is immutable).
|
|
41
|
+
- Archiving without user confirmation.
|
|
42
|
+
- Deleting files (archive moves, never deletes).
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-audit
|
|
3
|
+
description: Verify per-page that every ^[raw/...] resolves and sources frontmatter matches the body.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# wiki-audit
|
|
7
|
+
|
|
8
|
+
## When This Skill Activates
|
|
9
|
+
|
|
10
|
+
- User asks for a per-page audit or invokes a pre-merge gate.
|
|
11
|
+
- A vault is resolvable (see step 0).
|
|
12
|
+
|
|
13
|
+
## Output language
|
|
14
|
+
|
|
15
|
+
Run `skillwiki lang` at the start. Generate audit narrative and `--human` summaries in the resolved language. Frontmatter keys, file names, schema headers, index/log structural lines, citation markers, and wikilink slugs MUST stay English.
|
|
16
|
+
|
|
17
|
+
## Pre-orientation reads
|
|
18
|
+
Standard four reads.
|
|
19
|
+
|
|
20
|
+
## Steps
|
|
21
|
+
0. **Resolve vault and language.** Run `skillwiki path` (fail if NO_VAULT_CONFIGURED) and `skillwiki lang`.
|
|
22
|
+
1. `npx skillwiki audit <page>`. Read the JSON report.
|
|
23
|
+
2. Reason over the report:
|
|
24
|
+
- For each unresolved marker: suggest ingesting the missing source or correcting the path.
|
|
25
|
+
- For each `unused_sources` entry: suggest adding a body marker or removing from `sources:`.
|
|
26
|
+
- For each `missing_from_sources` entry: suggest adding to `sources:`.
|
|
27
|
+
3. Append one `log.md` entry summarizing the audit and any suggested follow-ups.
|
|
28
|
+
|
|
29
|
+
## Stop conditions
|
|
30
|
+
None — audit always completes.
|
|
31
|
+
|
|
32
|
+
## Forbidden
|
|
33
|
+
- Auto-applying suggested fixes (audit is observation-only).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-crystallize
|
|
3
|
+
description: Distill the current working session into a typed-knowledge page with provenance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# wiki-crystallize
|
|
7
|
+
|
|
8
|
+
## When This Skill Activates
|
|
9
|
+
|
|
10
|
+
- User asks to crystallize, consolidate, or promote draft material into typed-knowledge pages.
|
|
11
|
+
- A vault is resolvable (see step 0).
|
|
12
|
+
|
|
13
|
+
## Output language
|
|
14
|
+
|
|
15
|
+
Run `skillwiki lang` at the start. Generate consolidated page prose and `--human` summaries in the resolved language. Frontmatter keys, file names, schema headers, index/log structural lines, citation markers, and wikilink slugs MUST stay English.
|
|
16
|
+
|
|
17
|
+
## Pre-orientation reads
|
|
18
|
+
Standard four reads. If cwd is inside `projects/{slug}/`, also read project README and recent work logs.
|
|
19
|
+
|
|
20
|
+
## Steps
|
|
21
|
+
0. **Resolve vault and language.** Run `skillwiki path` (fail if NO_VAULT_CONFIGURED) and `skillwiki lang`.
|
|
22
|
+
1. Identify type: entity / concept / comparison / query / summary.
|
|
23
|
+
2. Set `provenance:`. Default `research`. If in project context: `project` with `provenance_projects: ["[[slug]]"]`.
|
|
24
|
+
3. Compose the page with citations pre-attached. Reuse existing `raw/` sources where possible.
|
|
25
|
+
4. `npx skillwiki validate <page>`. If non-zero, STOP.
|
|
26
|
+
5. Apply writes: page → `index.md` → `log.md`.
|
|
27
|
+
|
|
28
|
+
## Stop conditions
|
|
29
|
+
- `validate` non-zero.
|
|
30
|
+
- Missing `provenance:` for project-context runs.
|
|
31
|
+
|
|
32
|
+
## Forbidden
|
|
33
|
+
- Filing without explicit `provenance:`.
|
|
34
|
+
- Updating `index.md` before `validate` passes.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-ingest
|
|
3
|
+
description: Convert URLs, files, or pasted text into typed-knowledge pages with raw provenance. Supports single and batch mode.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# wiki-ingest
|
|
7
|
+
|
|
8
|
+
## When This Skill Activates
|
|
9
|
+
|
|
10
|
+
- User shares a URL, paste, or local file to capture in the vault.
|
|
11
|
+
- The output target is `entities/`, `concepts/`, `comparisons/`, or `queries/`.
|
|
12
|
+
- A vault is resolvable (see step 0).
|
|
13
|
+
|
|
14
|
+
## Output language
|
|
15
|
+
|
|
16
|
+
Run `skillwiki lang` at the start. Generate page-body prose, narrative sections, and `--human` summaries in the resolved language. Frontmatter keys, file names, schema headers, index/log structural lines, citation markers, and wikilink slugs MUST stay English.
|
|
17
|
+
|
|
18
|
+
## Pre-orientation reads (mandatory before any write)
|
|
19
|
+
1. `SCHEMA.md`
|
|
20
|
+
2. `index.md`
|
|
21
|
+
3. Last 20–30 entries of `log.md`
|
|
22
|
+
4. (Project context only) `projects/{slug}/README.md` and last ~5 work-item logs.
|
|
23
|
+
|
|
24
|
+
## Steps (in order — N6, N7, N8)
|
|
25
|
+
0. **Resolve vault and language.** Run `skillwiki path` (fail if NO_VAULT_CONFIGURED) and `skillwiki lang`. Use the resolved vault path for all writes; use the canonical language for all generated prose.
|
|
26
|
+
1. **Guard.** For each URL: run `npx skillwiki fetch-guard <url>`. If exit ≠ 0, STOP and surface the error. Do not retry.
|
|
27
|
+
2. **Fetch.** Use `web_fetch` (or read local file) under Layer 2 controls (the CLI Layer 2 fetcher applies in tests; in skill runtime use `web_fetch` directly and treat any error as STOP).
|
|
28
|
+
3. **Hash.** Write the raw file (frontmatter + body). Run `npx skillwiki hash <raw-file>` and embed the result in raw frontmatter `sha256:`.
|
|
29
|
+
4. **Generate page(s).** Compose typed-knowledge page(s) with citations pre-attached (`^[raw/...]` markers).
|
|
30
|
+
5. **Validate.** For each generated page: run `npx skillwiki validate <page>`. If exit ≠ 0, STOP — do not write index/log.
|
|
31
|
+
6. **Apply writes in order.** raw → page(s) → `index.md` → `log.md`.
|
|
32
|
+
7. **Confidence flag.** If only one source is cited, set `confidence: low`.
|
|
33
|
+
|
|
34
|
+
## Provenance defaults
|
|
35
|
+
- Default `provenance: research`.
|
|
36
|
+
- If cwd is inside `projects/{slug}/`, set `provenance: project` and add `provenance_projects: ["[[slug]]"]`.
|
|
37
|
+
|
|
38
|
+
## Stop conditions
|
|
39
|
+
- `fetch-guard` non-zero.
|
|
40
|
+
- Fetch timeout / size limit exceeded.
|
|
41
|
+
- `validate` non-zero on any page.
|
|
42
|
+
- sha256 already exists in vault for the same source.
|
|
43
|
+
|
|
44
|
+
## Forbidden
|
|
45
|
+
- Skipping `fetch-guard`.
|
|
46
|
+
- Updating `index.md` or `log.md` before all pages validate.
|
|
47
|
+
- Modifying any existing file in `raw/`.
|
|
48
|
+
|
|
49
|
+
## Batch Mode
|
|
50
|
+
|
|
51
|
+
When the user provides multiple sources (a directory of files, a list of URLs, or a multi-document input):
|
|
52
|
+
|
|
53
|
+
1. **Loop per source.** Execute steps 1–5 for each source individually (guard → fetch → hash → generate → validate).
|
|
54
|
+
2. **Accumulate, don't write yet.** Collect all raw files and pages in memory. Do not write `index.md` or `log.md` until every source has validated.
|
|
55
|
+
3. **Fail fast.** If any page fails validation, STOP. Report all failures. Do not write index/log for any source.
|
|
56
|
+
4. **Deduplication.** Before writing each raw file, check `sha256` against existing vault raw sources. Skip sources whose content is already present.
|
|
57
|
+
5. **Single index/log update.** After all sources validate, write all raw files and pages, then update `index.md` and `log.md` once.
|
|
58
|
+
6. **Progress.** After each source completes validation, report progress (e.g., "Validated 3/10 sources").
|