prove
Per-surface verification loops for wenlan — daemon, cli, mcp, plugin, suite strength (mutation), behavior trace, weekly sweep. Routes to scripts; every check…
Frictionless Wenlan setup for Codex. Detects a missing local runtime, installs or repairs it, and verifies the plugin to MCP to local runtime round-trip. Run when the user says "set up wenlan", "is wenlan working", or "fix wenlan".
$ npx -y skills add 7xuanlu/wenlan --skill setup --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/setupContext preview
The summary Claude sees to decide when to auto-load this skill.
Frictionless Wenlan setup for Codex. Detects a missing local runtime, installs or repairs it, and verifies the plugin to MCP to local runtime round-trip. Run when the user says "set up wenlan", "is wenlan working", or "fix wenlan".
name: setup description: > Frictionless Wenlan setup for Codex. Detects a missing local runtime, installs or repairs it, and verifies the plugin to MCP to local runtime round-trip. Run when the user says "set up wenlan", "is wenlan working", or "fix wenlan". allowed-tools: ["Bash", "mcp__wenlan__brief"] user-invocable: true
Self-healing setup for Codex. Default backend is local memory: no local model, no API key, no prompt ceremony. Local model and Anthropic key are optional upgrades after the basic path works.
Run in order. Stop and report at the first failure that needs human attention. Otherwise, push through automatically.
for i in 1 2 3; do curl -fsS -m 3 http://127.0.0.1:7878/api/health && break sleep 1 done
Compare daemon version vs plugin manifest version:
PLUGIN_JSON="${CODEX_PLUGIN_ROOT:-plugin-codex}/.codex-plugin/plugin.json"
[ -r "$PLUGIN_JSON" ] || PLUGIN_JSON=".codex-plugin/plugin.json"
if command -v python3 >/dev/null 2>&1 && [ -r "$PLUGIN_JSON" ]; then
RESP="$(curl -fsS -m 3 http://127.0.0.1:7878/api/health)"
DAEMON_VER="$(printf '%s' "$RESP" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("version",""))')"
EXPECTED_VER="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1])).get("version",""))' "$PLUGIN_JSON")"
RELEASE_VER="${EXPECTED_VER%%+*}"
printf 'daemon=%s expected=%s release=%s\n' "$DAEMON_VER" "$EXPECTED_VER" "$RELEASE_VER"
else
echo "version_check=skipped"
fiCodex will keep using this slice until the plugin cache is updated.
of `daemon=` (strip the `+g<sha>` suffix) against `release=`, numeric per component, not lexicographic. Daemon release equal or newer → the plugin cache is stale, not the runtime: skip the repair below (it would only reinstall the same-or-latest runtime and restart a healthy daemon) and go straight to the stop message in step 4 — update the plugin, restart, rerun.
runtime:
PLUGIN_JSON="${CODEX_PLUGIN_ROOT:-plugin-codex}/.codex-plugin/plugin.json"
[ -r "$PLUGIN_JSON" ] || PLUGIN_JSON=".codex-plugin/plugin.json"
EXPECTED_VER="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1])).get("version",""))' "$PLUGIN_JSON")"
RELEASE_VER="${EXPECTED_VER%%+*}"
curl -fsSL https://raw.githubusercontent.com/7xuanlu/wenlan/v${RELEASE_VER}/install.sh | bash
export PATH="$HOME/.wenlan/bin:$PATH"
wenlan setup --basic
wenlan background onThen continue to the health and version re-probe below. The installer deliberately targets the latest stable runtime. Do not downgrade a newer runtime to match a stale plugin cache.
Detect whether the `wenlan` CLI is on PATH:
command -v wenlan >/dev/null 2>&1 && echo present || echo absent
If absent, install and configure local memory:
curl -fsSL https://raw.githubusercontent.com/7xuanlu/wenlan/v0.18.8/install.sh | bash export PATH="$HOME/.wenlan/bin:$PATH" wenlan setup --basic wenlan background on
If present but the local runtime is down:
wenlan setup --basic 2>/dev/null || true wenlan background on
`wenlan setup --basic` is idempotent. `wenlan background on` starts the managed background process.
If `wenlan background on` exited non-zero, print its output and stop: it already waited for the daemon and named what went wrong. Otherwise poll for up to 240 seconds, the budget the first-run checks use, because a first boot downloads the embedding model (about 210 MB) before it answers:
healthy=
deadline=$((SECONDS + 240))
while [ "$SECONDS" -lt "$deadline" ]; do
if curl -fsS -m 3 http://127.0.0.1:7878/api/health >/dev/null 2>&1; then
healthy=1
break
fi
sleep 1
done
if [ -z "$healthy" ]; then
W="$(command -v wenlan || echo "$HOME/.wenlan/bin/wenlan")"
"$W" doctor
exit 1
fiWhen the loop ends without a healthy answer, the doctor output names the daemon state and where its logs are (a file path on macOS, `journalctl` on Linux); stop there. Likely causes: the model download is still running or failed, launchd load failure, port 7878 already in use, or a local runtime crash.
Once healthy, repeat the version comparison from step 2. If the versions still differ, stop instead of claiming setup succeeded:
Runtime and plugin versions still differ after repair; update the Wenlan plugin, restart Codex, then run /wenlan:setup again.
This usually means the runtime is newer than the plugin cached by the current Codex process. Updating the plugin is safer than silently downgrading the runtime, and the restart is required before this session can load new plugin code.
Run the Wenlan CLI doctor through the resolved binary path:
W="$(command -v wenlan || echo "$HOME/.wenlan/bin/wenlan")" "$W" doctor
Expected: local memory configured. Capture the mode string for the final report.
Call the Wenlan MCP `brief` tool as a read-only round-trip.
brief()
If it fails, report: "wenlan-mcp did not respond through Codex. Start a new Codex thread after reinstalling the plugin so Codex respawns the MCP server."
Print:
Wenlan ready. Runtime: up on 127.0.0.1:7878 Mode: <mode from CLI doctor> MCP: connected Data: ~/.wenlan/ Try: /brief, /capture <thing>
Mention these only if the user asks for richer synthesis:
Wenlan is a knowledge base for the AI-native age. Your AI agents capture what they learn, Wenlan keeps it current and distills it into source-cited wiki pages you can trust
Per-surface verification loops for wenlan — daemon, cli, mcp, plugin, suite strength (mutation), behavior trace, weekly sweep. Routes to scripts; every check…
Build, launch, screenshot, and drive the wenlan-app Tauri desktop app in dev mode on macOS (WKWebView) or Windows (WebView2). Use when asked to run or start…
Build, launch, and stop the wenlan daemon (wenlan-server) for local dev and verification. Use when asked to run or restart the daemon, or before driving any…
Drive/evidence recipe for verifying wenlan changes at their real surfaces (daemon HTTP, CLI, MCP stdio). The handle file the built-in verify protocol expects;…
Read the current Space-owned project Brief from Wenlan for Codex. With an optional topic, appends separately labeled related context from the same Space.…