skillwiki 0.9.62 → 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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runSkillwikiMcpStdio
4
- } from "./chunk-2PENIQ3A.js";
4
+ } from "./chunk-TUFQZ5K4.js";
5
5
  import "./chunk-7I2TPIV5.js";
6
6
 
7
7
  // src/mcp-entry.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.9.62",
3
+ "version": "0.9.63",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "skillwiki": "dist/cli.js",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.9.62",
3
+ "version": "0.9.63",
4
4
  "skills": "./",
5
- "description": "Project-aware Karpathy-style knowledge base for Claude Code: 18 prompt-only skills (wiki-*, proj-*, using-skillwiki) backed by the deterministic `skillwiki` CLI.",
5
+ "description": "Project-aware Karpathy-style knowledge base for Claude Code: 19 prompt-only skills (wiki-*, proj-*, using-skillwiki) backed by the deterministic `skillwiki` CLI.",
6
6
  "author": {
7
7
  "name": "karlorz",
8
8
  "url": "https://github.com/karlorz"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.9.62",
4
- "description": "Project-aware Karpathy-style knowledge base for Codex with 18 prompt-only skills backed by the deterministic skillwiki CLI.",
3
+ "version": "0.9.63",
4
+ "description": "Project-aware Karpathy-style knowledge base for Codex with 19 prompt-only skills backed by the deterministic skillwiki CLI.",
5
5
  "author": {
6
6
  "name": "karlorz",
7
7
  "url": "https://github.com/karlorz"
@@ -22,7 +22,7 @@
22
22
  "interface": {
23
23
  "displayName": "SkillWiki",
24
24
  "shortDescription": "Project-aware wiki skills for Codex agents",
25
- "longDescription": "18 prompt-only skills (wiki-*, proj-*, using-skillwiki) for deterministic, project-aware knowledge workflows.",
25
+ "longDescription": "19 prompt-only skills (wiki-*, proj-*, using-skillwiki) for deterministic, project-aware knowledge workflows.",
26
26
  "developerName": "karlorz",
27
27
  "category": "Productivity",
28
28
  "capabilities": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillwiki/skills",
3
- "version": "0.9.62",
3
+ "version": "0.9.63",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",
@@ -27,6 +27,7 @@ Invoke a skillwiki skill when the user:
27
27
  - Talks about project workspaces, ADRs, or distillation
28
28
  - Wants to quickly capture an idea, bug, task, or note without interrupting their workflow
29
29
  - Wants to archive or clean up old vault pages
30
+ - Wants to hard-delete a vault path without snapshot resurrection (`wiki-remove`)
30
31
  - Needs to detect source drift or re-ingest updated content
31
32
  - Has a spec/plan in a non-skillwiki format (CodeStable, RFC, AIDE)
32
33
  - Asks about their skillwiki configuration or setup health
@@ -74,6 +75,18 @@ path, run publisher dry-run, then run the same command with `--write`.
74
75
  - Non-typed project work items and immutable raw sources keep their existing
75
76
  workflows.
76
77
 
78
+ ## CLI probe and failsafe (vault-mutating skills)
79
+
80
+ Vault fleets that combine S3 + GitHub need an explicit delete-intent path. Prefer the skillwiki CLI; when it is missing, agents that still have **git/gh access to the private vault remote** use **FAILSAFE-GIT**.
81
+
82
+ 1. Prefer `skillwiki <subcommand> --help` when the skill requires the CLI.
83
+ 2. If skillwiki is missing/unusable but `git` (and optionally `gh`) can reach the private vault remote (`fleet.yaml` `vault_remote` / `origin` → `karlorz/wiki`):
84
+ - Use **FAILSAFE-GIT** documented in the skill (tombstone under `meta/delete-intents/` + commit + push). Applies to `wiki-remove` and intentional archive/delete paths.
85
+ 3. If neither skillwiki nor git/gh private-repo access works: **FAIL CLOSED**.
86
+ Never bare `rm` / bare `git rm` as a fleet delete (snapshot will resurrect from S3).
87
+ 4. Do not auto `npm install -g` skillwiki in headless/goal/satellite sessions.
88
+ 5. Delete-intent schema: `vault-delete-intent/v1` JSON under `meta/delete-intents/` (see `wiki-remove`). Git is SSOT for path absence; S3 is a working cache.
89
+
77
90
  ## Portable Source References
78
91
  The vault is shared across hosts, so host-local absolute paths are not durable source identity.
79
92
 
@@ -99,7 +112,8 @@ The vault is shared across hosts, so host-local absolute paths are not durable s
99
112
  | `wiki-lint` | Vault health and lint checks; use `health` for whole-system reports and `lint --summary` for bounded lint buckets |
100
113
  | `wiki-crystallize` | Distill the current working session into a typed-knowledge page |
101
114
  | `wiki-audit` | Verify raw provenance references and source frontmatter integrity |
102
- | `wiki-archive` | Archive a typed-knowledge page — move to `_archive/`, remove from index |
115
+ | `wiki-archive` | Archive a typed-knowledge page — move to `_archive/`, remove from index (writes delete-intent) |
116
+ | `wiki-remove` | Hard-delete a path with delete-intent tombstone; failsafe-git if CLI missing |
103
117
  | `wiki-reingest` | Detect drift in raw sources (sha256 comparison) and re-ingest updated content |
104
118
  | `wiki-add-task` | Quick-capture ideas, bugs, tasks, notes into `raw/transcripts/` without leaving the current workflow |
105
119
  | `wiki-adapter-prd` | Map foreign PRD formats (CodeStable, RFC, AIDE, Hermes) into vault pages |
@@ -135,7 +149,7 @@ Use `prd_layer` + `prd_pipeline` from `.claude/dev-loop.config.md` as source of
135
149
 
136
150
  ## CLI Backbone
137
151
  All skills are backed by the `skillwiki` CLI — a deterministic tool with no LLM calls. It handles path resolution, config management, validation, health reporting, and linting. Skills invoke it via Bash for the mechanical parts and use Claude for the creative parts.
138
- Key CLI subcommands: `init`, `health`, `lint`, `config`, `doctor`, `path`, `lang`, `install`, `fleet context`, `fleet validate`, `graph build`, `archive`, `drift`, `compound`, `tag-sync`, `tag reconcile`, `page publish`, `sync status`, `seed`, `stale`, `observe`, `canvas generate`.
152
+ Key CLI subcommands: `init`, `health`, `lint`, `config`, `doctor`, `path`, `lang`, `install`, `fleet context`, `fleet validate`, `graph build`, `archive`, `remove`, `drift`, `compound`, `tag-sync`, `tag reconcile`, `page publish`, `sync status`, `seed`, `stale`, `observe`, `canvas generate`.
139
153
  Run `skillwiki health <vault> --out /tmp/skillwiki-health.json --no-fail` for a bounded whole-system report that includes doctor, lint, vault-sync, query-readiness, source-freshness, risk flags, and self-check coverage. Run `skillwiki lint <vault> --summary` for lint-only bucket counts with capped examples and details commands. Run `skillwiki doctor` to diagnose setup/runtime issues only. Run `skillwiki config list` to see current configuration.
140
154
 
141
155
  ## Runtime Host Context and Fleet Freshness
@@ -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
- ## Steps
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 and re-add the wikilink entry to `index.md`. 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.
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 directly (archive moves locally; remote stale-path pruning is only allowed through the explicit `skillwiki archive --remote ... --remote-delete --max-remote-deletes 1` path).
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.
@@ -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.
@@ -27,6 +27,7 @@ Invoke a skillwiki skill when the user:
27
27
  - Talks about project workspaces, ADRs, or distillation
28
28
  - Wants to quickly capture an idea, bug, task, or note without interrupting their workflow
29
29
  - Wants to archive or clean up old vault pages
30
+ - Wants to hard-delete a vault path without snapshot resurrection (`wiki-remove`)
30
31
  - Needs to detect source drift or re-ingest updated content
31
32
  - Has a spec/plan in a non-skillwiki format (CodeStable, RFC, AIDE)
32
33
  - Asks about their skillwiki configuration or setup health
@@ -74,6 +75,18 @@ path, run publisher dry-run, then run the same command with `--write`.
74
75
  - Non-typed project work items and immutable raw sources keep their existing
75
76
  workflows.
76
77
 
78
+ ## CLI probe and failsafe (vault-mutating skills)
79
+
80
+ Vault fleets that combine S3 + GitHub need an explicit delete-intent path. Prefer the skillwiki CLI; when it is missing, agents that still have **git/gh access to the private vault remote** use **FAILSAFE-GIT**.
81
+
82
+ 1. Prefer `skillwiki <subcommand> --help` when the skill requires the CLI.
83
+ 2. If skillwiki is missing/unusable but `git` (and optionally `gh`) can reach the private vault remote (`fleet.yaml` `vault_remote` / `origin` → `karlorz/wiki`):
84
+ - Use **FAILSAFE-GIT** documented in the skill (tombstone under `meta/delete-intents/` + commit + push). Applies to `wiki-remove` and intentional archive/delete paths.
85
+ 3. If neither skillwiki nor git/gh private-repo access works: **FAIL CLOSED**.
86
+ Never bare `rm` / bare `git rm` as a fleet delete (snapshot will resurrect from S3).
87
+ 4. Do not auto `npm install -g` skillwiki in headless/goal/satellite sessions.
88
+ 5. Delete-intent schema: `vault-delete-intent/v1` JSON under `meta/delete-intents/` (see `wiki-remove`). Git is SSOT for path absence; S3 is a working cache.
89
+
77
90
  ## Portable Source References
78
91
  The vault is shared across hosts, so host-local absolute paths are not durable source identity.
79
92
 
@@ -99,7 +112,8 @@ The vault is shared across hosts, so host-local absolute paths are not durable s
99
112
  | `wiki-lint` | Vault health and lint checks; use `health` for whole-system reports and `lint --summary` for bounded lint buckets |
100
113
  | `wiki-crystallize` | Distill the current working session into a typed-knowledge page |
101
114
  | `wiki-audit` | Verify raw provenance references and source frontmatter integrity |
102
- | `wiki-archive` | Archive a typed-knowledge page — move to `_archive/`, remove from index |
115
+ | `wiki-archive` | Archive a typed-knowledge page — move to `_archive/`, remove from index (writes delete-intent) |
116
+ | `wiki-remove` | Hard-delete a path with delete-intent tombstone; failsafe-git if CLI missing |
103
117
  | `wiki-reingest` | Detect drift in raw sources (sha256 comparison) and re-ingest updated content |
104
118
  | `wiki-add-task` | Quick-capture ideas, bugs, tasks, notes into `raw/transcripts/` without leaving the current workflow |
105
119
  | `wiki-adapter-prd` | Map foreign PRD formats (CodeStable, RFC, AIDE, Hermes) into vault pages |
@@ -135,7 +149,7 @@ Use `prd_layer` + `prd_pipeline` from `.claude/dev-loop.config.md` as source of
135
149
 
136
150
  ## CLI Backbone
137
151
  All skills are backed by the `skillwiki` CLI — a deterministic tool with no LLM calls. It handles path resolution, config management, validation, health reporting, and linting. Skills invoke it via Bash for the mechanical parts and use Claude for the creative parts.
138
- Key CLI subcommands: `init`, `health`, `lint`, `config`, `doctor`, `path`, `lang`, `install`, `fleet context`, `fleet validate`, `graph build`, `archive`, `drift`, `compound`, `tag-sync`, `tag reconcile`, `page publish`, `sync status`, `seed`, `stale`, `observe`, `canvas generate`.
152
+ Key CLI subcommands: `init`, `health`, `lint`, `config`, `doctor`, `path`, `lang`, `install`, `fleet context`, `fleet validate`, `graph build`, `archive`, `remove`, `drift`, `compound`, `tag-sync`, `tag reconcile`, `page publish`, `sync status`, `seed`, `stale`, `observe`, `canvas generate`.
139
153
  Run `skillwiki health <vault> --out /tmp/skillwiki-health.json --no-fail` for a bounded whole-system report that includes doctor, lint, vault-sync, query-readiness, source-freshness, risk flags, and self-check coverage. Run `skillwiki lint <vault> --summary` for lint-only bucket counts with capped examples and details commands. Run `skillwiki doctor` to diagnose setup/runtime issues only. Run `skillwiki config list` to see current configuration.
140
154
 
141
155
  ## Runtime Host Context and Fleet Freshness
@@ -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
- ## Steps
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 and re-add the wikilink entry to `index.md`. 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.
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 directly (archive moves locally; remote stale-path pruning is only allowed through the explicit `skillwiki archive --remote ... --remote-delete --max-remote-deletes 1` path).
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.
@@ -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.