skillwiki 0.2.0-beta.2 → 0.2.0-beta.21
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 +1350 -172
- package/package.json +18 -5
- 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 +102 -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 +18 -1
|
@@ -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").
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-init
|
|
3
|
+
description: Bootstrap a CodeWiki vault — domain-aware SCHEMA.md, index.md, log.md, and ~/.skillwiki/.env binding. Use when starting a fresh vault.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# wiki-init
|
|
7
|
+
|
|
8
|
+
## When This Skill Activates
|
|
9
|
+
|
|
10
|
+
- User asks to create, build, or start a vault, wiki, or knowledge base.
|
|
11
|
+
- The resolved vault path (see step 0) does not yet contain SCHEMA.md.
|
|
12
|
+
|
|
13
|
+
## Pre-orientation reads
|
|
14
|
+
|
|
15
|
+
None for the first run.
|
|
16
|
+
|
|
17
|
+
## Steps
|
|
18
|
+
|
|
19
|
+
0. **Resolve target.** Run `skillwiki path --init-time` to see what target the CLI will pick. Confirm with the user, or override with `--target <dir>`.
|
|
20
|
+
1. Verify target is empty or has no SCHEMA.md.
|
|
21
|
+
2. Ask the domain question: "What knowledge domain will this vault cover? Be specific."
|
|
22
|
+
3. Propose a 10–15 tag taxonomy tailored to the domain. Confirm or accept the user's revision.
|
|
23
|
+
4. Ask the language question: "What language should generated page prose use? Default is `en`. Aliases like `chinese-traditional` or `zh-Hant` are accepted."
|
|
24
|
+
5. Run `skillwiki init --target <dir> --domain "<answer>" --taxonomy "<comma list>" --lang "<lang>"`.
|
|
25
|
+
6. **Suggest first sources.** Propose 3–5 initial sources (URLs, papers, articles) appropriate to the domain. Prompt the user to provide the first one to ingest, then hand off to wiki-ingest.
|
|
26
|
+
|
|
27
|
+
## Stop conditions
|
|
28
|
+
|
|
29
|
+
- Target non-empty and `--force` not consented.
|
|
30
|
+
- `~/.skillwiki/.env` already binds a different vault or language and `--force` not consented.
|
|
31
|
+
|
|
32
|
+
## Forbidden
|
|
33
|
+
|
|
34
|
+
- Modifying anything outside the target directory or `~/.skillwiki/.env`.
|
|
35
|
+
- Writing to `~/.hermes/.env` (read-only fallback).
|
|
36
|
+
- Running any LLM-driven content generation in this skill.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-lint
|
|
3
|
+
description: Vault health check via the umbrella `skillwiki lint` subcommand. Read-only by default; rotation requires explicit user consent.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# wiki-lint
|
|
7
|
+
|
|
8
|
+
## When This Skill Activates
|
|
9
|
+
|
|
10
|
+
- User asks for a vault health report, lint, or audit.
|
|
11
|
+
- Periodic maintenance.
|
|
12
|
+
|
|
13
|
+
## Pre-orientation reads
|
|
14
|
+
|
|
15
|
+
Standard four reads.
|
|
16
|
+
|
|
17
|
+
## Steps
|
|
18
|
+
|
|
19
|
+
0. Resolve vault: `skillwiki path` (record source for context).
|
|
20
|
+
1. Run `skillwiki lint <vault>`. Read the JSON.
|
|
21
|
+
2. Reason over findings; present grouped by severity with concrete suggested actions per kind.
|
|
22
|
+
3. If `log_rotate_needed` is present and the user consents, run `skillwiki log-rotate <vault> --apply`. Otherwise leave alone.
|
|
23
|
+
4. Append one `log.md` entry summarizing the lint counts (errors/warnings/info).
|
|
24
|
+
|
|
25
|
+
## Stop conditions
|
|
26
|
+
|
|
27
|
+
None — lint reports all findings even on per-page errors.
|
|
28
|
+
|
|
29
|
+
## Forbidden
|
|
30
|
+
|
|
31
|
+
- Auto-rotating logs.
|
|
32
|
+
- Auto-updating sha256 fields.
|
|
33
|
+
- Modifying any page beyond the lint summary entry in `log.md`.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-query
|
|
3
|
+
description: Search the vault and synthesize an answer with E2 4-signal ranking. Optional file to queries/ or comparisons/.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# wiki-query
|
|
7
|
+
|
|
8
|
+
## When This Skill Activates
|
|
9
|
+
|
|
10
|
+
- User asks a question that should be answered from vault contents.
|
|
11
|
+
- A vault is resolvable (see step 0).
|
|
12
|
+
|
|
13
|
+
## Output language
|
|
14
|
+
|
|
15
|
+
Run `skillwiki lang` at the start. Generate query-result 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 (SCHEMA, index, log, project context if applicable).
|
|
19
|
+
|
|
20
|
+
## Steps
|
|
21
|
+
0. **Resolve vault and language.** Run `skillwiki path` (fail if NO_VAULT_CONFIGURED) and `skillwiki lang`.
|
|
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: `npx skillwiki graph build <vault>`.
|
|
24
|
+
3. **Compute overlap.** `npx skillwiki overlap <vault>`.
|
|
25
|
+
4. **Score candidates** in prompt using the 4 signals:
|
|
26
|
+
- Direct wikilink: 3.0×
|
|
27
|
+
- Source overlap: 4.0× (read from overlap output)
|
|
28
|
+
- Adamic-Adar: 1.5× (read from graph output)
|
|
29
|
+
- Type affinity: 1.0×
|
|
30
|
+
5. **Read top candidates** in full (frontmatter + body).
|
|
31
|
+
6. **Synthesize answer** with explicit citations to the candidate pages.
|
|
32
|
+
7. **Optional file.** If user accepts: write to `queries/<slug>.md` or `comparisons/<slug>.md` with full frontmatter, validate, then update `index.md` then `log.md`.
|
|
33
|
+
|
|
34
|
+
## Stop conditions
|
|
35
|
+
- Zero matching pages.
|
|
36
|
+
- User declines to file.
|
|
37
|
+
|
|
38
|
+
## Forbidden
|
|
39
|
+
- Filing without `validate` passing.
|
|
40
|
+
- Skipping the orientation reads even for "quick" queries.
|
|
@@ -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.
|
package/templates/SCHEMA.md
CHANGED
|
@@ -49,5 +49,22 @@ Rule: every tag on every page MUST appear in this taxonomy. Add new tags here fi
|
|
|
49
49
|
|
|
50
50
|
- File names: lowercase-hyphenated, no spaces.
|
|
51
51
|
- Wikilinks in YAML: quoted, `"[[name]]"`. Body wikilinks: unquoted `[[name]]`.
|
|
52
|
-
- Citations in body: `^[raw/...]` markers; every entry in `sources:` MUST appear in body.
|
|
52
|
+
- Citations in body: `^[raw/...]` markers at paragraph-end; every entry in `sources:` MUST appear in body and in `## Sources` footer.
|
|
53
|
+
- Legacy inline `^[raw/...]` markers remain valid; `migrate-citations` converts them.
|
|
53
54
|
- sha256 in `raw/` frontmatter is computed by `skillwiki hash` over body bytes after closing `---`.
|
|
55
|
+
|
|
56
|
+
## Obsidian Integration
|
|
57
|
+
|
|
58
|
+
- **Attachment folder:** `raw/assets/` — binary assets (images, diagrams) live here.
|
|
59
|
+
Set Obsidian's "Attachment folder path" to `raw/assets` for automatic filing.
|
|
60
|
+
- **Dataview queries** (read-only; do not replace index.md):
|
|
61
|
+
|
|
62
|
+
```dataview
|
|
63
|
+
LIST WHERE type = "concept" AND contains(tags, "architecture")
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```dataview
|
|
67
|
+
TABLE updated, length(sources) AS sources
|
|
68
|
+
WHERE file.folder = "concepts"
|
|
69
|
+
SORT updated DESC
|
|
70
|
+
```
|