skillwiki 0.2.0-beta.3 → 0.2.0-beta.31
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/auto-update-bg.js +43 -0
- package/dist/chunk-XM5IYZX7.js +45 -0
- package/dist/cli.js +1514 -172
- package/package.json +19 -5
- package/skills/.claude-plugin/plugin.json +3 -2
- package/skills/bin/skillwiki +5 -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 +9 -2
- package/skills/proj-decide/SKILL.md +1 -1
- package/skills/proj-distill/SKILL.md +26 -4
- package/skills/proj-work/SKILL.md +20 -1
- package/skills/using-skillwiki/SKILL.md +122 -0
- package/skills/wiki-adapter-prd/SKILL.md +87 -0
- package/skills/wiki-archive/SKILL.md +43 -0
- package/skills/wiki-audit/SKILL.md +1 -1
- package/skills/wiki-crystallize/SKILL.md +1 -1
- package/skills/wiki-ingest/SKILL.md +15 -4
- package/skills/wiki-lint/SKILL.md +1 -1
- package/skills/wiki-query/SKILL.md +2 -2
- package/skills/wiki-reingest/SKILL.md +54 -0
- package/templates/SCHEMA.md +18 -1
package/package.json
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillwiki",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.31",
|
|
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
15
|
"build": "tsup && rm -rf ./skills && cp -r ../skills ./skills",
|
|
9
16
|
"test": "vitest run",
|
|
10
17
|
"test:watch": "vitest",
|
|
11
|
-
"typecheck": "tsc --noEmit"
|
|
18
|
+
"typecheck": "tsc --noEmit",
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
12
20
|
},
|
|
13
21
|
"dependencies": {
|
|
14
22
|
"commander": "^12.1.0",
|
|
@@ -23,5 +31,11 @@
|
|
|
23
31
|
"typescript": "^5.7.0",
|
|
24
32
|
"vitest": "^2.1.0"
|
|
25
33
|
},
|
|
26
|
-
"
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/karlorz/llm-wiki.git"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=20"
|
|
40
|
+
}
|
|
27
41
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillwiki",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.2.0-beta.31",
|
|
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).",
|
|
5
6
|
"author": {
|
|
6
7
|
"name": "karlorz",
|
|
7
8
|
"url": "https://github.com/karlorz"
|
|
@@ -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
|
package/skills/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skillwiki/skills",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-beta.31",
|
|
4
4
|
"private": true,
|
|
5
|
-
"files": [
|
|
5
|
+
"files": [
|
|
6
|
+
"wiki-*",
|
|
7
|
+
"proj-*",
|
|
8
|
+
"using-skillwiki",
|
|
9
|
+
".claude-plugin",
|
|
10
|
+
"hooks",
|
|
11
|
+
"README.md"
|
|
12
|
+
]
|
|
6
13
|
}
|
|
@@ -13,7 +13,7 @@ Standard four + project context.
|
|
|
13
13
|
|
|
14
14
|
## Steps
|
|
15
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. `
|
|
16
|
+
2. `skillwiki validate <adr>`. If non-zero, STOP.
|
|
17
17
|
3. **Generalization check.** If the decision applies beyond this project, create a `concepts/` page with `provenance: project` (or `mixed` if research-informed).
|
|
18
18
|
4. Apply writes: ADR → (optional) concept page → vault `index.md` → vault `log.md` and project `log.md`.
|
|
19
19
|
|
|
@@ -12,10 +12,32 @@ description: 2-step distillation (E4) — analyze project compound entry, then g
|
|
|
12
12
|
Standard four + project context.
|
|
13
13
|
|
|
14
14
|
## Steps (E4 — 2-step pattern)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
`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`.
|
|
19
41
|
|
|
20
42
|
## Stop conditions
|
|
21
43
|
- No clear universal pattern.
|
|
@@ -16,10 +16,29 @@ Standard four + project context (project README, last ~5 work logs).
|
|
|
16
16
|
1. Determine `kind:` (feature | issue | refactor | decision) and slug.
|
|
17
17
|
2. Create folder `projects/{slug}/work/YYYY-MM-DD-{work-slug}/`.
|
|
18
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 `
|
|
19
|
+
4. Validate work-item frontmatter via `skillwiki validate <spec.md>`. If non-zero, STOP.
|
|
20
20
|
5. Manage status transitions: `planned` → `in-progress` → `completed` (set `completed:` date) or `abandoned`.
|
|
21
21
|
6. Append vault `log.md` entry on creation and on each status transition.
|
|
22
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
|
+
|
|
23
42
|
## Stop conditions
|
|
24
43
|
- `validate` non-zero.
|
|
25
44
|
- Conflicting work folder name.
|
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
## Vault Structure
|
|
29
|
+
|
|
30
|
+
A skillwiki vault has two layers:
|
|
31
|
+
|
|
32
|
+
**Layer 1 — Raw (`raw/`):** Immutable source material. Never modify after ingest.
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
raw/
|
|
36
|
+
├── articles/ # Web articles, clippings
|
|
37
|
+
├── papers/ # PDFs, arxiv papers
|
|
38
|
+
├── transcripts/ # Meeting notes, interviews
|
|
39
|
+
└── assets/ # Images, diagrams referenced by sources
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Raw frontmatter:
|
|
43
|
+
```yaml
|
|
44
|
+
---
|
|
45
|
+
source_url: https://…
|
|
46
|
+
ingested: YYYY-MM-DD
|
|
47
|
+
sha256: # computed by skillwiki hash over body bytes after closing ---
|
|
48
|
+
---
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Layer 2 — Agent-owned pages:** `entities/`, `concepts/`, `comparisons/`, `queries/`, `meta/`, `projects/`. Citations use `^[raw/articles/source-file.md]` markers at paragraph-end.
|
|
52
|
+
|
|
53
|
+
## Skill Map
|
|
54
|
+
|
|
55
|
+
| Skill | When to Invoke |
|
|
56
|
+
|-------|----------------|
|
|
57
|
+
| `wiki-init` | Bootstrap a new vault — SCHEMA.md, index.md, log.md, ~/.skillwiki/.env |
|
|
58
|
+
| `wiki-ingest` | Convert URLs, files, or pasted text into typed-knowledge pages |
|
|
59
|
+
| `wiki-query` | Search the vault and synthesize an answer with ranked results |
|
|
60
|
+
| `wiki-lint` | Vault health check (stale pages, oversized pages, log rotation) |
|
|
61
|
+
| `wiki-crystallize` | Distill the current working session into a typed-knowledge page |
|
|
62
|
+
| `wiki-audit` | Verify raw provenance references and source frontmatter integrity |
|
|
63
|
+
| `wiki-archive` | Archive a typed-knowledge page — move to `_archive/`, remove from index |
|
|
64
|
+
| `wiki-reingest` | Detect drift in raw sources (sha256 comparison) and re-ingest updated content |
|
|
65
|
+
| `wiki-adapter-prd` | Map foreign PRD formats (CodeStable, RFC, AIDE, Hermes) into vault pages |
|
|
66
|
+
| `proj-init` | Bootstrap a project workspace (README, requirements, architecture) |
|
|
67
|
+
| `proj-work` | Open or run a work item under a project's work/ directory |
|
|
68
|
+
| `proj-distill` | Distill project compound entries into vault concept pages |
|
|
69
|
+
| `proj-decide` | Write an Architectural Decision Record (ADR) |
|
|
70
|
+
|
|
71
|
+
## CLI Backbone
|
|
72
|
+
|
|
73
|
+
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.
|
|
74
|
+
|
|
75
|
+
Key CLI subcommands: `init`, `lint`, `config`, `doctor`, `path`, `lang`, `install`, `graph build`, `archive`, `drift`.
|
|
76
|
+
|
|
77
|
+
Run `skillwiki doctor` to diagnose setup issues. Run `skillwiki config list` to see current configuration.
|
|
78
|
+
|
|
79
|
+
## Typical Workflow
|
|
80
|
+
|
|
81
|
+
1. **Init** (`wiki-init`) — create vault, set domain and taxonomy
|
|
82
|
+
2. **Ingest** (`wiki-ingest`) — add sources, build pages
|
|
83
|
+
3. **Query** (`wiki-query`) — search and synthesize answers
|
|
84
|
+
4. **Lint** (`wiki-lint`) — periodic health checks
|
|
85
|
+
5. **Crystallize** (`wiki-crystallize`) — save session insights as pages
|
|
86
|
+
6. **Audit** (`wiki-audit`) — verify source integrity
|
|
87
|
+
|
|
88
|
+
For longer-running project work, use `proj-init` → `proj-work` → `proj-distill` / `proj-decide`.
|
|
89
|
+
|
|
90
|
+
Maintenance: **Archive** (`wiki-archive`) superseded pages, **Drift** (`wiki-reingest`) to detect stale sources, **Adapter** (`wiki-adapter-prd`) for foreign PRD format ingestion.
|
|
91
|
+
|
|
92
|
+
## Multi-Wiki Profiles
|
|
93
|
+
|
|
94
|
+
skillwiki supports named wiki profiles for working with multiple vaults. Set `WIKI_DEFAULT` to control which wiki all skills target by default.
|
|
95
|
+
|
|
96
|
+
**Manage profiles:**
|
|
97
|
+
- `skillwiki config set wiki.<name>.path <dir>` — register a profile
|
|
98
|
+
- `skillwiki config set default <name>` — set active profile
|
|
99
|
+
- `skillwiki config list --profiles` — list all profiles
|
|
100
|
+
- `skillwiki --wiki <name> lint` — override per-command
|
|
101
|
+
|
|
102
|
+
**Project-local override:** Place a `./skillwiki/.env` in a project root to bind that project to a specific wiki. Skills will use it automatically when running from that directory.
|
|
103
|
+
|
|
104
|
+
## PRD Bridge — Redirect Spec/Plan Output to Vault
|
|
105
|
+
|
|
106
|
+
When skillwiki is installed, **all spec and plan documents must land in the vault**, not in repo-local directories like `docs/superpowers/`. This applies to any PRD/design skill (superpowers:brainstorming, superpowers:writing-plans, CodeStable, AIDE, Hermes, etc.).
|
|
107
|
+
|
|
108
|
+
**Rule:** Before a PRD skill writes a spec or plan file, redirect its save path:
|
|
109
|
+
1. Resolve the vault path: `skillwiki path`
|
|
110
|
+
2. If the cwd is inside a project (check for `projects/{slug}/` via `skillwiki path --init-time` or look for `./skillwiki/.env`), use that project's work directory
|
|
111
|
+
3. Create or locate the work item via `proj-work`, which emits redirect paths for `spec.md` and `plan.md`
|
|
112
|
+
4. Pass those vault paths to the PRD skill as its save location
|
|
113
|
+
|
|
114
|
+
**Concrete overrides for superpowers:**
|
|
115
|
+
- `superpowers:brainstorming` step 6: override `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` → vault work-item `spec.md` path from `proj-work`
|
|
116
|
+
- `superpowers:writing-plans` header: override `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md` → vault work-item `plan.md` path from `proj-work`
|
|
117
|
+
|
|
118
|
+
Both skills say "User preferences for spec location override this default" — the vault work-item path IS the override.
|
|
119
|
+
|
|
120
|
+
**If no project context exists** (standalone vault, not inside a project), save specs/plans directly under the vault root with the PRD skill's default naming, e.g. `<vault>/specs/YYYY-MM-DD-<slug>.md`.
|
|
121
|
+
|
|
122
|
+
**Never create `docs/superpowers/` in any repo.**
|
|
@@ -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,43 @@
|
|
|
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. Run `skillwiki lint [vault]` — check for broken wikilinks from other pages that still reference the archived page. If found, update those pages to point to the replacement or remove the stale link.
|
|
28
|
+
5. Append a `log.md` entry: `## [{date}] archive | {relPath} → _archive/{subdir}/`.
|
|
29
|
+
|
|
30
|
+
## Reversibility
|
|
31
|
+
|
|
32
|
+
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.
|
|
33
|
+
|
|
34
|
+
## Stop conditions
|
|
35
|
+
|
|
36
|
+
- `skillwiki archive` returns non-zero exit code (page not found, already archived, invalid vault).
|
|
37
|
+
- User declines to proceed.
|
|
38
|
+
|
|
39
|
+
## Forbidden
|
|
40
|
+
|
|
41
|
+
- Archiving `raw/` files (N9 — raw is immutable).
|
|
42
|
+
- Archiving without user confirmation.
|
|
43
|
+
- Deleting files (archive moves, never deletes).
|
|
@@ -19,7 +19,7 @@ Standard four reads.
|
|
|
19
19
|
|
|
20
20
|
## Steps
|
|
21
21
|
0. **Resolve vault and language.** Run `skillwiki path` (fail if NO_VAULT_CONFIGURED) and `skillwiki lang`.
|
|
22
|
-
1. `
|
|
22
|
+
1. `skillwiki audit <page>`. Read the JSON report.
|
|
23
23
|
2. Reason over the report:
|
|
24
24
|
- For each unresolved marker: suggest ingesting the missing source or correcting the path.
|
|
25
25
|
- For each `unused_sources` entry: suggest adding a body marker or removing from `sources:`.
|
|
@@ -22,7 +22,7 @@ Standard four reads. If cwd is inside `projects/{slug}/`, also read project READ
|
|
|
22
22
|
1. Identify type: entity / concept / comparison / query / summary.
|
|
23
23
|
2. Set `provenance:`. Default `research`. If in project context: `project` with `provenance_projects: ["[[slug]]"]`.
|
|
24
24
|
3. Compose the page with citations pre-attached. Reuse existing `raw/` sources where possible.
|
|
25
|
-
4. `
|
|
25
|
+
4. `skillwiki validate <page>`. If non-zero, STOP.
|
|
26
26
|
5. Apply writes: page → `index.md` → `log.md`.
|
|
27
27
|
|
|
28
28
|
## Stop conditions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wiki-ingest
|
|
3
|
-
description: Convert URLs, files, or pasted text into typed-knowledge pages with raw provenance.
|
|
3
|
+
description: Convert URLs, files, or pasted text into typed-knowledge pages with raw provenance. Supports single and batch mode.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# wiki-ingest
|
|
@@ -23,11 +23,11 @@ Run `skillwiki lang` at the start. Generate page-body prose, narrative sections,
|
|
|
23
23
|
|
|
24
24
|
## Steps (in order — N6, N7, N8)
|
|
25
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 `
|
|
26
|
+
1. **Guard.** For each URL: run `skillwiki fetch-guard <url>`. If exit ≠ 0, STOP and surface the error. Do not retry.
|
|
27
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 `
|
|
28
|
+
3. **Hash.** Write the raw file (frontmatter + body). Run `skillwiki hash <raw-file>` and embed the result in raw frontmatter `sha256:`.
|
|
29
29
|
4. **Generate page(s).** Compose typed-knowledge page(s) with citations pre-attached (`^[raw/...]` markers).
|
|
30
|
-
5. **Validate.** For each generated page: run `
|
|
30
|
+
5. **Validate.** For each generated page: run `skillwiki validate <page>`. If exit ≠ 0, STOP — do not write index/log.
|
|
31
31
|
6. **Apply writes in order.** raw → page(s) → `index.md` → `log.md`.
|
|
32
32
|
7. **Confidence flag.** If only one source is cited, set `confidence: low`.
|
|
33
33
|
|
|
@@ -45,3 +45,14 @@ Run `skillwiki lang` at the start. Generate page-body prose, narrative sections,
|
|
|
45
45
|
- Skipping `fetch-guard`.
|
|
46
46
|
- Updating `index.md` or `log.md` before all pages validate.
|
|
47
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").
|
|
@@ -18,7 +18,7 @@ Standard four reads.
|
|
|
18
18
|
|
|
19
19
|
0. Resolve vault: `skillwiki path` (record source for context).
|
|
20
20
|
1. Run `skillwiki lint <vault>`. Read the JSON.
|
|
21
|
-
2. Reason over findings; present grouped by severity with concrete suggested actions per kind.
|
|
21
|
+
2. Reason over findings; present grouped by severity with concrete suggested actions per kind. If the CLI was recently updated with new lint checks, re-running lint on the full vault may flag pre-existing pages that predate the new rule — treat these as legitimate findings, not false positives.
|
|
22
22
|
3. If `log_rotate_needed` is present and the user consents, run `skillwiki log-rotate <vault> --apply`. Otherwise leave alone.
|
|
23
23
|
4. Append one `log.md` entry summarizing the lint counts (errors/warnings/info).
|
|
24
24
|
|
|
@@ -20,8 +20,8 @@ Standard four reads (SCHEMA, index, log, project context if applicable).
|
|
|
20
20
|
## Steps
|
|
21
21
|
0. **Resolve vault and language.** Run `skillwiki path` (fail if NO_VAULT_CONFIGURED) and `skillwiki lang`.
|
|
22
22
|
1. **Determine scope.** Ask the user once if ambiguous: vault | current project | project+concepts.
|
|
23
|
-
2. **Refresh graph.** If `.skillwiki/graph.json` is missing or older than 24h: `
|
|
24
|
-
3. **Compute overlap.** `
|
|
23
|
+
2. **Refresh graph.** If `.skillwiki/graph.json` is missing or older than 24h: `skillwiki graph build <vault>`.
|
|
24
|
+
3. **Compute overlap.** `skillwiki overlap <vault>`.
|
|
25
25
|
4. **Score candidates** in prompt using the 4 signals:
|
|
26
26
|
- Direct wikilink: 3.0×
|
|
27
27
|
- Source overlap: 4.0× (read from overlap output)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-reingest
|
|
3
|
+
description: Detect and act on source drift. Runs skillwiki drift, reviews changes, archives old raw + ingests new content.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# wiki-reingest
|
|
7
|
+
|
|
8
|
+
## When This Skill Activates
|
|
9
|
+
|
|
10
|
+
- User wants to check if any vault sources have changed since ingestion.
|
|
11
|
+
- Periodic drift check during lint or maintenance cycles.
|
|
12
|
+
- User explicitly asks to re-ingest a specific source.
|
|
13
|
+
|
|
14
|
+
## Output language
|
|
15
|
+
|
|
16
|
+
Run `skillwiki lang` at the start. Generate log entries in the resolved language.
|
|
17
|
+
|
|
18
|
+
## Pre-orientation reads
|
|
19
|
+
|
|
20
|
+
Standard four reads (SCHEMA, index, log, project context if applicable).
|
|
21
|
+
|
|
22
|
+
## Steps
|
|
23
|
+
|
|
24
|
+
0. Resolve vault: `skillwiki path` and `skillwiki lang`.
|
|
25
|
+
1. Run `skillwiki drift [vault]`. Read the JSON output.
|
|
26
|
+
2. Present findings grouped by status:
|
|
27
|
+
- **drifted:** Source content has changed. Show stored vs current sha256.
|
|
28
|
+
- **fetch_failed:** Could not re-fetch. Show error details.
|
|
29
|
+
- **unchanged:** No action needed.
|
|
30
|
+
3. For each drifted source, ask the user: archive old + ingest new, or skip?
|
|
31
|
+
4. If the user approves re-ingest for a source:
|
|
32
|
+
a. Run `skillwiki archive <raw-path>` to archive the old raw file.
|
|
33
|
+
b. Follow the `wiki-ingest` skill to ingest the updated content as a new raw file.
|
|
34
|
+
c. Update any concept/entity pages that cite the old source to reference the new one.
|
|
35
|
+
5. Append a `log.md` entry summarizing: scanned, drifted, re-ingested, skipped.
|
|
36
|
+
|
|
37
|
+
## N9 Compliance
|
|
38
|
+
|
|
39
|
+
Raw files are immutable (N9). Re-ingest never modifies an existing raw file. Instead:
|
|
40
|
+
- Archive the old raw file (moves to `_archive/raw/`).
|
|
41
|
+
- Create a new raw file with updated content and new sha256.
|
|
42
|
+
- This preserves full provenance history.
|
|
43
|
+
|
|
44
|
+
## Stop conditions
|
|
45
|
+
|
|
46
|
+
- `skillwiki drift` returns non-zero exit code other than DRIFT_DETECTED.
|
|
47
|
+
- User declines all re-ingest actions.
|
|
48
|
+
- No raw sources have `source_url` (nothing to check).
|
|
49
|
+
|
|
50
|
+
## Forbidden
|
|
51
|
+
|
|
52
|
+
- Modifying files in `raw/` directly (N9).
|
|
53
|
+
- Re-ingesting without user approval for each drifted source.
|
|
54
|
+
- Skipping the drift check and assuming sources have changed.
|