# Wiki Stage Commit

Review staged wiki writes and promote accepted pages to final locations when...

- Repository: https://github.com/Ar9av/obsidian-wiki (3650 stars)
- Category: Git and review
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Ar9av/obsidian-wiki --skill wiki-stage-commit -g -a claude-code -y`
Codex: `npx skills add Ar9av/obsidian-wiki --skill wiki-stage-commit -g -a codex -y`
Cursor: `npx skills add Ar9av/obsidian-wiki --skill wiki-stage-commit -g -a cursor -y`
Gemini CLI: `npx skills add Ar9av/obsidian-wiki --skill wiki-stage-commit -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add Ar9av/obsidian-wiki`

## Description

Review staged wiki writes and promote accepted pages to final locations when WIKI_STAGED_WRITES is enabled. Use for staging approval/commit; rejected pages return to _raw/ for editing.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Wiki Stage Commit, Staged Write Promotion

You are reviewing LLM-written pages that are waiting in `_staging/` for human approval before they land in the live wiki. This skill is only useful when `WIKI_STAGED_WRITES=true` in the vault config.

## Before You Start

1. **Resolve config**, follow the Config Resolution Protocol in `llm-wiki/SKILL.md`. This gives `OBSIDIAN_VAULT_PATH` and `WIKI_STAGED_WRITES`.
2. If `WIKI_STAGED_WRITES` is not set or is `false`, tell the user: "Staged writes mode is not enabled. Set `WIKI_STAGED_WRITES=true` in your `.env` to use this feature." Then stop.
3. Read the `_staging/` directory inventory.

## Invocation Forms

```
/wiki-stage-commit               # interactive review: show each file and ask accept/reject
/wiki-stage-commit --all         # accept all staged files without per-file review
/wiki-stage-commit --reject-all  # reject all staged files (move to _raw/ for manual editing)
/wiki-stage-commit --list        # list staged files with summary, no changes
```

## Step 1: Inventory Staged Files

The CLI owns the inventory, don't glob `_staging/` yourself:

```bash
obsidian-wiki staging list --json
```

Each entry carries:

| Field | Meaning |
|---|---|
| `staged_path` | vault-relative path of the staged file |
| `live_path` | where it will land (a `.patch.md` targets the page it is named after) |
| `kind` | `new`, `update`, or `patch` |
| `staged_revision` | content hash of the staged file, as you are seeing it now |
| `live_revision` | content hash of the live page, or `null` if there is none yet |
| `staged_mtime` | when it was staged |

**Keep `staged_revision` and `live_revision` for every file you show the user.** They are what makes Step 3 refuse to overwrite an agent's concurrent write instead of silently clobbering it.

Report the inventory:

```
Staged files: 4 new pages, 2 updates

The rest: https://github.com/Ar9av/obsidian-wiki/blob/HEAD/.skills/wiki-stage-commit/SKILL.md
