wiki-remove
When This Skill Activates
- User wants to permanently remove a maintained vault path (not archive-for-reference).
- User explicitly requests permanent disposal of one exact raw object.
- Cleanup of stale pages that should not return via snapshot resurrection.
- User says hard delete, remove for real, stop resurrecting.
Output language
If skillwiki is available: run skillwiki lang at the start. Otherwise default to English log prose.
Pre-orientation
Read SCHEMA/index only as needed. Confirm the full vault-relative path. First classify the target as maintained content or raw/** evidence.
Probe (required)
command -v skillwiki && skillwiki remove --help
git -C <vault> rev-parse --is-inside-work-tree and git remote get-url origin (expect private karlorz/wiki / fleet vault_remote)
- Auth:
gh auth status or git ls-remote origin HEAD
| Result |
Mode |
| skillwiki OK |
PRIMARY |
| skillwiki fail, git/gh + private repo OK |
FAILSAFE-GIT |
| neither |
FAIL CLOSED — stop; never bare rm for fleet effect |
Do not auto npm install -g skillwiki in headless/goal/satellite sessions.
PRIMARY — maintained pages
- Resolve vault:
skillwiki path.
- Confirm path with user.
- On a vault-sync leaf when S3 prune is intentional:
skillwiki remove <page> [vault] --remote seaweed-wiki:cloud/wiki --remote-delete --max-remote-deletes 1 --reason "<text>"
Otherwise: skillwiki remove <page> [vault] --reason "<text>"
- Read JSON: expect
tombstone_path under meta/delete-intents/, removed set.
- Commit + push via normal wiki-sync / git (tombstone + deletion must reach private
main for durability).
- Report MODE=primary, paths, and whether remote-delete ran.
skillwiki remove must refuse every raw/** target. Do not bypass that refusal.
PRIMARY — exact raw disposal
Permanent raw disposal is exceptional and never inferred from cleanup, dedup, stale, archive, or reingest intent.
- Require an explicit user request naming one exact raw file and a reason. Refuse basenames, globs, directories, symlinks, batches, and inferred targets.
- Run
skillwiki sources dispose <exact-raw-path> [vault] --reason "<text>".
- Present the preview: complete-file SHA-256, byte size, typed/other/asset inbound references, delete-intent path, recoverability statement, operation ID, and approval token.
- Only in the same attended session, after the user approves that exact preview, run the identical command with
--write --approve <token>.
- The command revalidates bytes and inbound references under the managed lock, writes append-only approval/completion events plus durable delete intent, then removes the exact object.
- Scheduled/headless disposal is always refused. A stale token never authorizes changed state.
FAILSAFE-GIT steps (no skillwiki CLI)
Agent must have git (and preferably gh) access to private vault remote. This fallback is for maintained pages only. If the target is under raw/, fail closed until skillwiki sources dispose is available; never reproduce raw disposal by hand.
- Confirm path with user. Set
PATH_REL (vault-relative, no ..).
- Write tombstone
meta/delete-intents/<slug>.json where slug is path with / → __, e.g. summaries/foo.md → summaries__foo.md.json:
{
"schema": "vault-delete-intent/v1",
"path": "PATH_REL",
"action": "remove",
"created": "ISO-8601-UTC",
"host": "SKILLWIKI_HOST_ID-or-unknown",
"actor": "agent-failsafe-git",
"reason": "user requested remove; skillwiki CLI unavailable",
"source": "failsafe-git",
"expires": null
}
- Delete local file at
PATH_REL (and index line for [[slug]] if typed page).
git add tombstone + path change; commit with trailers:
Delete-Intent: PATH_REL
Delete-Source: failsafe-git
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.
- Optional: if
rclone and WIKI_REMOTE exist: rclone deletefile "$WIKI_REMOTE/PATH_REL" (single path only).
- Report
MODE=failsafe-git, commit SHA, S3_PRUNE=done|deferred.
Stop conditions
- User declines.
- FAIL CLOSED (no CLI and no private git access).
- Push to private wiki fails.
- Path invalid or under
_archive/ without explicit restore/remove policy.
- Raw target cannot be processed by the attended exact-target CLI flow.
Forbidden
- Bare
rm / bare git rm without tombstone.
- Force-push.
- Unbounded
rclone sync / mass remote delete.
- Claiming fleet delete complete without tombstone on
origin/main (and push success).
- Passing raw paths to ordinary
skillwiki remove, or using FAILSAFE-GIT/bare filesystem deletion for raw evidence.
- Scheduled, headless, batch, glob, directory, basename-inferred, or stale-token raw disposal.
Reversibility
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.
1---2name: wiki-remove3description: Remove maintained vault paths with durable delete intent; raw evidence requires the separate attended exact-target sources dispose workflow.4---56# wiki-remove78## When This Skill Activates910- User wants to permanently remove a maintained vault path (not archive-for-reference).11- User explicitly requests permanent disposal of one exact raw object.12- Cleanup of stale pages that should not return via snapshot resurrection.13- User says hard delete, remove for real, stop resurrecting.1415## Output language1617If `skillwiki` is available: run `skillwiki lang` at the start. Otherwise default to English log prose.1819## Pre-orientation2021Read SCHEMA/index only as needed. Confirm the full vault-relative path. First classify the target as maintained content or `raw/**` evidence.2223## Probe (required)24251. `command -v skillwiki && skillwiki remove --help`262. `git -C <vault> rev-parse --is-inside-work-tree` and `git remote get-url origin` (expect private `karlorz/wiki` / fleet `vault_remote`)273. Auth: `gh auth status` **or** `git ls-remote origin HEAD`2829| Result | Mode |30|--------|------|31| skillwiki OK | **PRIMARY** |32| skillwiki fail, git/gh + private repo OK | **FAILSAFE-GIT** |33| neither | **FAIL CLOSED** — stop; never bare `rm` for fleet effect |3435Do not auto `npm install -g skillwiki` in headless/goal/satellite sessions.3637## PRIMARY — maintained pages38391. Resolve vault: `skillwiki path`.402. Confirm path with user.413. On a vault-sync leaf when S3 prune is intentional:42 `skillwiki remove <page> [vault] --remote seaweed-wiki:cloud/wiki --remote-delete --max-remote-deletes 1 --reason "<text>"`43 Otherwise: `skillwiki remove <page> [vault] --reason "<text>"`444. Read JSON: expect `tombstone_path` under `meta/delete-intents/`, `removed` set.455. Commit + push via normal wiki-sync / git (tombstone + deletion must reach private `main` for durability).466. Report MODE=primary, paths, and whether remote-delete ran.4748`skillwiki remove` must refuse every `raw/**` target. Do not bypass that refusal.4950## PRIMARY — exact raw disposal5152Permanent raw disposal is exceptional and never inferred from cleanup, dedup, stale, archive, or reingest intent.53541. Require an explicit user request naming one exact raw file and a reason. Refuse basenames, globs, directories, symlinks, batches, and inferred targets.552. Run `skillwiki sources dispose <exact-raw-path> [vault] --reason "<text>"`.563. Present the preview: complete-file SHA-256, byte size, typed/other/asset inbound references, delete-intent path, recoverability statement, operation ID, and approval token.574. Only in the same attended session, after the user approves that exact preview, run the identical command with `--write --approve <token>`.585. The command revalidates bytes and inbound references under the managed lock, writes append-only approval/completion events plus durable delete intent, then removes the exact object.596. Scheduled/headless disposal is always refused. A stale token never authorizes changed state.6061## FAILSAFE-GIT steps (no skillwiki CLI)6263Agent **must** have git (and preferably gh) access to private vault remote. This fallback is for maintained pages only. If the target is under `raw/`, fail closed until `skillwiki sources dispose` is available; never reproduce raw disposal by hand.64651. Confirm path with user. Set `PATH_REL` (vault-relative, no `..`).662. Write tombstone `meta/delete-intents/<slug>.json` where slug is path with `/` → `__`, e.g. `summaries/foo.md` → `summaries__foo.md.json`:6768```json69{70 "schema": "vault-delete-intent/v1",71 "path": "PATH_REL",72 "action": "remove",73 "created": "ISO-8601-UTC",74 "host": "SKILLWIKI_HOST_ID-or-unknown",75 "actor": "agent-failsafe-git",76 "reason": "user requested remove; skillwiki CLI unavailable",77 "source": "failsafe-git",78 "expires": null79}80```81823. Delete local file at `PATH_REL` (and index line for `[[slug]]` if typed page).834. `git add` tombstone + path change; commit with trailers:8485```text86Delete-Intent: PATH_REL87Delete-Source: failsafe-git88```89905. `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.916. Optional: if `rclone` and `WIKI_REMOTE` exist: `rclone deletefile "$WIKI_REMOTE/PATH_REL"` (single path only).927. Report `MODE=failsafe-git`, commit SHA, `S3_PRUNE=done|deferred`.9394## Stop conditions9596- User declines.97- FAIL CLOSED (no CLI and no private git access).98- Push to private wiki fails.99- Path invalid or under `_archive/` without explicit restore/remove policy.100- Raw target cannot be processed by the attended exact-target CLI flow.101102## Forbidden103104- Bare `rm` / bare `git rm` without tombstone.105- Force-push.106- Unbounded `rclone sync` / mass remote delete.107- Claiming fleet delete complete without tombstone on `origin/main` (and push success).108- Passing raw paths to ordinary `skillwiki remove`, or using FAILSAFE-GIT/bare filesystem deletion for raw evidence.109- Scheduled, headless, batch, glob, directory, basename-inferred, or stale-token raw disposal.110111## Reversibility112113Hard remove is not locally reversible from `_archive`. Restore requires re-authoring content and deleting the tombstone file under `meta/delete-intents/`, then normal push.