openwiki-cc
A native Claude Code and OpenAI Codex port of
OpenWiki — an agent that generates and maintains a
documentation wiki (openwiki/) for any repository.
OpenWiki ships as a standalone CLI on its own harness (DeepAgents/LangGraph, a local shell
backend, a SQLite checkpointer, provider adapters, an Ink TUI). Coding agents like Claude Code
and Codex already provide all of that plumbing. This repo extracts the agent itself — the
documentation system prompt, the git-evidence collection, the wiki structure, and the idempotence
logic — and re-expresses it natively for each host:
- Claude Code — a slash-command plugin:
commands/wiki.md → /openwiki:wiki.
- Codex — a skill:
.agents/skills/openwiki/SKILL.md → $openwiki.
The system prompt and the exact git commands are reproduced verbatim from OpenWiki's real
source, not from memory.
What it does
Point it at a repository and it writes human- and agent-friendly Markdown documentation under
openwiki/, with quickstart.md as the entrypoint and thematic section pages (architecture,
workflows, operations, …). It grounds every claim in source files, existing docs, and git
history — and on later runs it updates only what actually changed.
Install — Claude Code
Via the plugin marketplace (recommended)
Inside Claude Code:
/plugin marketplace add SoulKyu/openwiki-cc
/plugin install openwiki@openwiki-cc
Then /openwiki:wiki is available in every project. /plugin marketplace update openwiki-cc
pulls new versions.
Plugin commands are always namespaced plugin:command, so the command is /openwiki:wiki
(never a bare /openwiki). Install manually instead if you want a bare /wiki.
Manual (no marketplace)
Copy the single command file into the repo you want to document, or globally. Under
.claude/commands/ the name is bare — the file becomes /wiki:
# per-project → /wiki
mkdir -p your-repo/.claude/commands
cp commands/wiki.md your-repo/.claude/commands/
# or global → /wiki everywhere
cp commands/wiki.md ~/.claude/commands/
Install — Codex
Codex loads skills from .agents/skills/. Copy the skill folder globally (available in every
repo) or into a specific repo, then restart Codex:
# global → available everywhere
mkdir -p ~/.agents/skills
cp -r .agents/skills/openwiki ~/.agents/skills/
# or per-repo
mkdir -p your-repo/.agents/skills
cp -r .agents/skills/openwiki your-repo/.agents/skills/
Invoke it explicitly with $openwiki (or via the /skills menu); Codex may also trigger it
implicitly when you ask to "initialize / update the openwiki docs". It auto-detects init vs
update from whether openwiki/ already exists.
Codex skills don't take slash arguments, so the mode comes from your phrasing (or the
openwiki/ auto-detect) rather than an init/update token. Codex custom prompts
(~/.codex/prompts/) are deprecated, so this ships as a skill.
Usage
Claude Code — from the root of the target repository. Installed as a plugin the command is
/openwiki:wiki; copied under .claude/commands/ it is /wiki. Both take the same arguments:
| Command | Behavior |
|---|
/openwiki:wiki | Auto-route: if openwiki/ exists → update, else → init. |
/openwiki:wiki init | Build the wiki from scratch. |
/openwiki:wiki update | Surgically refresh only the pages affected by recent changes. |
/openwiki:wiki update <instruction> | Same, plus an extra instruction (e.g. document the API routes first). |
Note — auto-route replaces upstream OpenWiki's interactive-chat default (a slash command
can't be a bare /openwiki anyway; plugin commands are always namespaced). init and update
remain explicit.
Codex — invoke $openwiki (or ask to "update the openwiki docs"). It auto-detects init
(no openwiki/) vs update (openwiki/ exists); say "initialize" or "update" to force a mode,
and add any extra instruction in the same request.
How it works
Git evidence (before any write). The command reads openwiki/.last-update.json, then runs
the exact upstream commands (all git --no-pager, all read-only):
- always:
git status --short, git rev-parse HEAD, git diff --name-status HEAD
- init / no prior metadata:
git log --max-count=20 --name-status --oneline
- update with a recorded head:
git log <gitHead>..HEAD --name-status --oneline
- update with only a timestamp:
git log --since <updatedAt> --name-status --oneline
If the target is not a git repo, it degrades gracefully to timestamps and source inspection.