skillwiki 0.9.61 → 0.9.63
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/{chunk-FU462DVS.js → chunk-TUFQZ5K4.js} +1182 -518
- package/dist/cli.js +1133 -412
- package/dist/skillwiki-mcp.js +1 -1
- package/package.json +1 -1
- package/skills/.claude-plugin/plugin.json +2 -2
- package/skills/.codex-plugin/plugin.json +3 -3
- package/skills/README.md +6 -0
- package/skills/agents/wiki-ingest.md +30 -37
- package/skills/agents/wiki-query.md +13 -3
- package/skills/package.json +1 -1
- package/skills/skills/using-skillwiki/SKILL.md +31 -2
- package/skills/skills/wiki-archive/SKILL.md +18 -4
- package/skills/skills/wiki-ingest/SKILL.md +23 -27
- package/skills/skills/wiki-query/SKILL.md +11 -2
- package/skills/skills/wiki-remove/SKILL.md +96 -0
- package/skills/using-skillwiki/SKILL.md +31 -2
- package/skills/wiki-archive/SKILL.md +18 -4
- package/skills/wiki-ingest/SKILL.md +23 -27
- package/skills/wiki-query/SKILL.md +11 -2
- package/skills/wiki-remove/SKILL.md +96 -0
|
@@ -18,23 +18,36 @@ Run `skillwiki lang` at the start. Generate log entries in the resolved language
|
|
|
18
18
|
|
|
19
19
|
Standard four reads (SCHEMA, index, log, project context if applicable).
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Probe
|
|
22
|
+
|
|
23
|
+
Same matrix as `using-skillwiki` → **CLI probe and failsafe**: PRIMARY (`skillwiki archive`), FAILSAFE-GIT (hand tombstone + `git mv` to `_archive/` + push), or FAIL CLOSED.
|
|
24
|
+
|
|
25
|
+
## Steps (PRIMARY)
|
|
22
26
|
|
|
23
27
|
0. Resolve vault: `skillwiki path` and `skillwiki lang`.
|
|
24
28
|
1. Identify the target page. Confirm with the user which page to archive (show full relPath).
|
|
25
|
-
2. Run `skillwiki archive <page> [vault]`. On a vault-sync leaf host where S3 stale originals must be pruned, use `skillwiki archive <page> [vault] --remote seaweed-wiki:cloud/wiki --remote-delete --max-remote-deletes 1` only when that remote path deletion is explicitly intended. Read the JSON output.
|
|
29
|
+
2. Run `skillwiki archive <page> [vault]`. On a vault-sync leaf host where S3 stale originals must be pruned, use `skillwiki archive <page> [vault] --remote seaweed-wiki:cloud/wiki --remote-delete --max-remote-deletes 1` only when that remote path deletion is explicitly intended. Read the JSON output. Successful archive **always** writes a live-path tombstone under `meta/delete-intents/` so snapshot cannot resurrect the live key.
|
|
26
30
|
3. Verify with `skillwiki index-check [vault]` — confirm no ghost entries remain.
|
|
27
31
|
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
32
|
5. **Raw file archiving (N9 Reingest Protocol only):** When archiving a `raw/` file due to content drift, update ALL `^[raw/...]` citation markers and `sources:` frontmatter entries that reference the old path. Change `raw/articles/foo.md` to `_archive/raw/articles/foo.md` in every referencing page. Verify with `skillwiki audit` that no broken markers remain.
|
|
29
33
|
6. Append a `log.md` entry: `## [{date}] archive | {relPath} → _archive/{subdir}/`.
|
|
34
|
+
7. Commit/push so tombstone + archive land on private `main`.
|
|
35
|
+
|
|
36
|
+
## FAILSAFE-GIT (no skillwiki)
|
|
37
|
+
|
|
38
|
+
1. Confirm path. Write `meta/delete-intents/<slug>.json` with `action: "archive"`, `source: "failsafe-git"`, schema `vault-delete-intent/v1`.
|
|
39
|
+
2. `git mv` live path → `_archive/<same relPath>` (create dirs as needed); update `index.md` if typed.
|
|
40
|
+
3. Commit with `Delete-Intent` / `Delete-Source: failsafe-git` trailers; push to private `main`.
|
|
41
|
+
4. Optional single-path `rclone deletefile` for the **live** path if remote configured.
|
|
30
42
|
|
|
31
43
|
## Reversibility
|
|
32
44
|
|
|
33
|
-
Archiving is locally reversible: move the file back from `_archive/` to its original directory
|
|
45
|
+
Archiving is locally reversible: move the file back from `_archive/` to its original directory, re-add the wikilink entry to `index.md`, and **delete the matching tombstone** under `meta/delete-intents/`. If `--remote-delete` was used, the stale active-path object is pruned from the remote after the archive move, but the archived copy remains and a restore will republish the active path on the next push once the tombstone is cleared.
|
|
34
46
|
|
|
35
47
|
## Stop conditions
|
|
36
48
|
|
|
37
49
|
- `skillwiki archive` returns non-zero exit code (page not found, already archived, invalid vault).
|
|
50
|
+
- FAIL CLOSED when neither CLI nor private git/gh access is available.
|
|
38
51
|
- User declines to proceed.
|
|
39
52
|
|
|
40
53
|
## Forbidden
|
|
@@ -42,4 +55,5 @@ Archiving is locally reversible: move the file back from `_archive/` to its orig
|
|
|
42
55
|
- Archiving `raw/` files outside the N9 Reingest Protocol (raw is immutable except during content-drift reingestion).
|
|
43
56
|
- Archiving raw files without updating all `^[raw/...]` citation markers that reference them.
|
|
44
57
|
- Archiving without user confirmation.
|
|
45
|
-
- Deleting local vault files
|
|
58
|
+
- Deleting local vault files with bare `rm` / bare `git rm` without a delete-intent tombstone (causes snapshot resurrection).
|
|
59
|
+
- Remote stale-path pruning only via explicit `skillwiki archive --remote ... --remote-delete` (PRIMARY) or bounded single-path rclone in FAILSAFE-GIT.
|
|
@@ -14,29 +14,26 @@ Run `skillwiki lang` at the start. Generate page-body prose, narrative sections,
|
|
|
14
14
|
2. `index.md`
|
|
15
15
|
3. Last 20–30 entries of `log.md`
|
|
16
16
|
4. (Project context only) `projects/{slug}/README.md` and last ~5 work-item logs.
|
|
17
|
-
## Steps (in order —
|
|
17
|
+
## Steps (in order — deterministic raw capture and shared publication)
|
|
18
18
|
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.
|
|
19
19
|
1. **Guard.** For each URL: run `skillwiki fetch-guard <url>`. If exit ≠ 0, STOP and surface the error. Do not retry.
|
|
20
20
|
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).
|
|
21
21
|
- **Portable local-source rule:** follow `using-skillwiki` → Portable Source References. Do not use `source_url: file:///...` as the canonical durable reference; prefer commit-pinned GitHub `blob/<commit>/<path>` when resolvable, else empty `source_url` plus portable repo-relative prose.
|
|
22
|
-
3. **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
7. **Validate.** For each generated page: run `skillwiki validate <page>`. If exit ≠ 0, STOP — do not write index/log.
|
|
38
|
-
8. **Apply writes in order.** raw → page(s) → `index.md` → `log.md`.
|
|
39
|
-
9. **Confidence flag.** If only one source is cited, set `confidence: low`.
|
|
22
|
+
3. **Stage pasted text as a file source.** `skillwiki ingest` accepts a readable local source file or HTTP(S) URL; it does **not** accept literal pasted text. For a paste, stage the exact text in a temporary file outside the vault, then pass its path to the normal command:
|
|
23
|
+
```bash
|
|
24
|
+
skillwiki ingest <staged-paste-path> \
|
|
25
|
+
--vault <resolved-vault> \
|
|
26
|
+
--type <entity|concept|comparison|query> \
|
|
27
|
+
--title "<title>" \
|
|
28
|
+
--tags "<tag1,tag2>" \
|
|
29
|
+
--provenance <research|project>
|
|
30
|
+
```
|
|
31
|
+
Record the staged path and exact command inputs before execution. If ingestion or typed-page publication fails, retain the staged source and exact command inputs for retry. Remove the staged file only after `skillwiki ingest` exits 0 after typed-page publication; confirm the non-dry-run result reports its raw path, typed path, and publisher operation. Do not stage pasted text inside the vault.
|
|
32
|
+
4. **Identity guard.** Before writing raw files, ensure the target raw filename/title, `source_url`, fetched H1/title, and early body subject agree. If `skillwiki ingest` reports `INGEST_VALIDATION_FAILED` with `source identity conflict`, STOP. Do not fix by renaming after the fact; choose the correct title/source pair or ask the user.
|
|
33
|
+
5. **Sensitive content guard.** Before writing or filing any vault page, scan the source and generated body for live credentials, access keys, tokens, passwords, cookies, bearer headers, or private keys. Redact generated prose before writing. If the source itself must remain raw and contains a live secret, STOP instead of preserving it.
|
|
34
|
+
6. **Feature-detect publication.** Run `skillwiki page publish --help`. If unavailable, fail closed and leave typed output unpublished; update the active SkillWiki CLI/plugin channel first.
|
|
35
|
+
7. **Ingest and publish.** Use `skillwiki ingest` for deterministic source capture and typed-page publication. The command writes an immutable raw source first and delegates the typed page, taxonomy, index, and structural log entry to the shared page publisher. Supply the resolved vault, type, title, tags, and provenance through the command options.
|
|
36
|
+
8. **Recovery.** Never create the final typed page or edit index.md/log.md directly. A raw-only result after publication failure is valid recovery state. Keep the exact command inputs and retry; do not delete or overwrite the raw source.
|
|
40
37
|
## Provenance defaults
|
|
41
38
|
- Default `provenance: research`.
|
|
42
39
|
- If cwd is inside `projects/{slug}/`, set `provenance: project` and add `provenance_projects: ["[[slug]]"]`.
|
|
@@ -50,20 +47,19 @@ Raw ephemeral data (market feeds, logs, transient JSON) must be written to the *
|
|
|
50
47
|
- Fetch timeout / size limit exceeded.
|
|
51
48
|
- `INGEST_VALIDATION_FAILED` with `source identity conflict`.
|
|
52
49
|
- Source or generated content contains unredacted live credentials or other authenticating secrets.
|
|
53
|
-
- `
|
|
50
|
+
- `skillwiki page publish --help` is unavailable.
|
|
51
|
+
- `skillwiki ingest` returns nonzero; retain any raw-only result for retry.
|
|
54
52
|
- sha256 already exists in vault for the same source.
|
|
55
53
|
## Forbidden
|
|
56
54
|
- Skipping `fetch-guard`.
|
|
57
|
-
-
|
|
55
|
+
- Creating a final typed page or editing `index.md`/`log.md` directly.
|
|
58
56
|
- Modifying any existing file in `raw/`.
|
|
59
57
|
- Writing raw ephemeral data directly to cloud-mounted wiki paths (`~/wiki/`).
|
|
60
58
|
- Writing host-local absolute paths as canonical durable source references (see `using-skillwiki` → Portable Source References).
|
|
61
59
|
- Writing `[[wikilinks]]` to pages that don't exist in the vault. Before linking, verify the target exists: check `index.md` or `ls` the target directory. If the target doesn't exist yet, use plain text instead of a wikilink.
|
|
62
60
|
## Batch Mode
|
|
63
61
|
When the user provides multiple sources (a directory of files, a list of URLs, or a multi-document input):
|
|
64
|
-
1. **Loop per source.** Execute steps 1–
|
|
65
|
-
2. **
|
|
66
|
-
3. **
|
|
67
|
-
4. **
|
|
68
|
-
5. **Single index/log update.** After all sources validate, write all raw files and pages, then update `index.md` and `log.md` once.
|
|
69
|
-
6. **Progress.** After each source completes validation, report progress (e.g., "Validated 3/10 sources").
|
|
62
|
+
1. **Loop per source.** Execute steps 1–8 for each source individually, using one `skillwiki ingest` command per source.
|
|
63
|
+
2. **Fail fast.** If an ingest command returns nonzero, STOP and report the retained raw-only state, if any, with its exact retry inputs.
|
|
64
|
+
3. **Deduplication.** Let `skillwiki ingest` preserve immutable raw capture and skip sources whose content is already present.
|
|
65
|
+
4. **Progress.** After each source completes, report the raw path, typed path or recovery state, and publisher operation ID.
|
|
@@ -23,7 +23,15 @@ Standard four reads (SCHEMA, index, log, project context if applicable).
|
|
|
23
23
|
5. **Read top candidates** in full (frontmatter + body).
|
|
24
24
|
6. **Synthesize answer** with explicit citations to the candidate pages.
|
|
25
25
|
7. **Sensitive content guard.** Before filing any query or comparison page, scan the generated body for live credentials, access keys, tokens, passwords, cookies, bearer headers, or private keys. Redact before writing. If the answer depends on preserving a live secret, STOP and ask for a redacted source or explicit rotation/remediation direction.
|
|
26
|
-
8. **Optional file.** If user accepts
|
|
26
|
+
8. **Optional file.** If the user accepts, first run `skillwiki page publish --help`. If it is unavailable, fail closed and leave the result unpublished. Otherwise:
|
|
27
|
+
1. Resolve the vault and create a temporary directory outside the vault.
|
|
28
|
+
2. Write the complete query/comparison page to `<temp>/page.md`, including final frontmatter, citations, Sources footer, and Decision Closeout.
|
|
29
|
+
3. Run `skillwiki page publish <temp>/page.md <vault> --target queries/<slug>.md` (or `comparisons/<slug>.md`) and inspect the dry-run.
|
|
30
|
+
4. Run the identical command with `--write` only when dry-run succeeds.
|
|
31
|
+
5. On any nonzero result, retain the draft path and STOP; do not edit the final target, index.md, or log.md directly.
|
|
32
|
+
6. Remove the temporary directory only after the publisher returns complete success.
|
|
33
|
+
|
|
34
|
+
If the filed page is a research/evaluation answer, recommendation, or comparison, end it with:
|
|
27
35
|
```markdown
|
|
28
36
|
## Decision Closeout
|
|
29
37
|
|
|
@@ -41,6 +49,7 @@ Use exactly one disposition. This is a prompt convention only; do not add CLI en
|
|
|
41
49
|
When a wiki page (especially a work item `tasks.md`) claims that fixes were applied, features were completed, or files were removed — **verify on disk before accepting the claim**. In one incident, a `tasks.md` marked 6 items DONE but 5 were not actually applied: a script claimed "removed" was still 2020 bytes on disk, a crontab claimed "updated to 30min" was still `*/10`, and a build target claimed "verified has consumers" had no web server serving it.
|
|
42
50
|
**Rule**: After reading a work item that declares completion, run at least one verification command per critical claim (check file existence, grep a config, inspect a crontab). Documents can drift from reality — the filesystem is the source of truth.
|
|
43
51
|
## Forbidden
|
|
44
|
-
- Filing without `
|
|
52
|
+
- Filing without the `skillwiki page publish` dry-run passing.
|
|
53
|
+
- Directly creating a final typed page or separately editing `index.md` or `log.md` for its publication.
|
|
45
54
|
- Skipping the orientation reads even for "quick" queries.
|
|
46
55
|
- Writing live credentials, access keys, tokens, passwords, cookies, bearer headers, private keys, or other authenticating secrets to the vault.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-remove
|
|
3
|
+
description: Hard-delete a vault path with a durable delete-intent tombstone so S3+snapshot cannot resurrect it. Prefer skillwiki remove; if CLI missing, failsafe-git via private GitHub.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# wiki-remove
|
|
7
|
+
|
|
8
|
+
## When This Skill Activates
|
|
9
|
+
|
|
10
|
+
- User wants to permanently remove a vault path (not archive-for-reference).
|
|
11
|
+
- Cleanup of stale pages that should not return via snapshot resurrection.
|
|
12
|
+
- User says hard delete, remove for real, stop resurrecting.
|
|
13
|
+
|
|
14
|
+
## Output language
|
|
15
|
+
|
|
16
|
+
If `skillwiki` is available: run `skillwiki lang` at the start. Otherwise default to English log prose.
|
|
17
|
+
|
|
18
|
+
## Pre-orientation
|
|
19
|
+
|
|
20
|
+
Read SCHEMA/index only as needed. Confirm full vault-relative path with the user before delete.
|
|
21
|
+
|
|
22
|
+
## Probe (required)
|
|
23
|
+
|
|
24
|
+
1. `command -v skillwiki && skillwiki remove --help`
|
|
25
|
+
2. `git -C <vault> rev-parse --is-inside-work-tree` and `git remote get-url origin` (expect private `karlorz/wiki` / fleet `vault_remote`)
|
|
26
|
+
3. Auth: `gh auth status` **or** `git ls-remote origin HEAD`
|
|
27
|
+
|
|
28
|
+
| Result | Mode |
|
|
29
|
+
|--------|------|
|
|
30
|
+
| skillwiki OK | **PRIMARY** |
|
|
31
|
+
| skillwiki fail, git/gh + private repo OK | **FAILSAFE-GIT** |
|
|
32
|
+
| neither | **FAIL CLOSED** — stop; never bare `rm` for fleet effect |
|
|
33
|
+
|
|
34
|
+
Do not auto `npm install -g skillwiki` in headless/goal/satellite sessions.
|
|
35
|
+
|
|
36
|
+
## PRIMARY steps
|
|
37
|
+
|
|
38
|
+
1. Resolve vault: `skillwiki path`.
|
|
39
|
+
2. Confirm path with user.
|
|
40
|
+
3. On a vault-sync leaf when S3 prune is intentional:
|
|
41
|
+
`skillwiki remove <page> [vault] --remote seaweed-wiki:cloud/wiki --remote-delete --max-remote-deletes 1 --reason "<text>"`
|
|
42
|
+
Otherwise: `skillwiki remove <page> [vault] --reason "<text>"`
|
|
43
|
+
4. Read JSON: expect `tombstone_path` under `meta/delete-intents/`, `removed` set.
|
|
44
|
+
5. Commit + push via normal wiki-sync / git (tombstone + deletion must reach private `main` for durability).
|
|
45
|
+
6. Report MODE=primary, paths, and whether remote-delete ran.
|
|
46
|
+
|
|
47
|
+
## FAILSAFE-GIT steps (no skillwiki CLI)
|
|
48
|
+
|
|
49
|
+
Agent **must** have git (and preferably gh) access to private vault remote.
|
|
50
|
+
|
|
51
|
+
1. Confirm path with user. Set `PATH_REL` (vault-relative, no `..`).
|
|
52
|
+
2. Write tombstone `meta/delete-intents/<slug>.json` where slug is path with `/` → `__`, e.g. `summaries/foo.md` → `summaries__foo.md.json`:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"schema": "vault-delete-intent/v1",
|
|
57
|
+
"path": "PATH_REL",
|
|
58
|
+
"action": "remove",
|
|
59
|
+
"created": "ISO-8601-UTC",
|
|
60
|
+
"host": "SKILLWIKI_HOST_ID-or-unknown",
|
|
61
|
+
"actor": "agent-failsafe-git",
|
|
62
|
+
"reason": "user requested remove; skillwiki CLI unavailable",
|
|
63
|
+
"source": "failsafe-git",
|
|
64
|
+
"expires": null
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
3. Delete local file at `PATH_REL` (and index line for `[[slug]]` if typed page).
|
|
69
|
+
4. `git add` tombstone + path change; commit with trailers:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
Delete-Intent: PATH_REL
|
|
73
|
+
Delete-Source: failsafe-git
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
5. `git pull --rebase origin main` (or merge fallback per vault-sync ADR) then **`git push origin HEAD:main`**. Require successful push before claiming durable success.
|
|
77
|
+
6. Optional: if `rclone` and `WIKI_REMOTE` exist: `rclone deletefile "$WIKI_REMOTE/PATH_REL"` (single path only).
|
|
78
|
+
7. Report `MODE=failsafe-git`, commit SHA, `S3_PRUNE=done|deferred`.
|
|
79
|
+
|
|
80
|
+
## Stop conditions
|
|
81
|
+
|
|
82
|
+
- User declines.
|
|
83
|
+
- FAIL CLOSED (no CLI and no private git access).
|
|
84
|
+
- Push to private wiki fails.
|
|
85
|
+
- Path invalid or under `_archive/` without explicit restore/remove policy.
|
|
86
|
+
|
|
87
|
+
## Forbidden
|
|
88
|
+
|
|
89
|
+
- Bare `rm` / bare `git rm` without tombstone.
|
|
90
|
+
- Force-push.
|
|
91
|
+
- Unbounded `rclone sync` / mass remote delete.
|
|
92
|
+
- Claiming fleet delete complete without tombstone on `origin/main` (and push success).
|
|
93
|
+
|
|
94
|
+
## Reversibility
|
|
95
|
+
|
|
96
|
+
Hard remove is not locally reversible from `_archive`. Restore requires re-authoring content and deleting the tombstone file under `meta/delete-intents/`, then normal push.
|