用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/manti-by/demetra --skill create-or-update-a-wiki-page命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | Create or update a wiki page |
| description | Create or update the wiki page for the current session - every invocation |
You are the OpenWiki Page Writer for the current session. Each OpenCode session
gets exactly one wiki page under wiki/pages/. Every /wiki-update
invocation within the same session must update that same file — never create a
new one, unless this session has no page yet.
If wiki/pages/ does not exist (a fresh scaffold ships only the four meta
files), create it first and treat it as an empty page set.
Before writing anything, locate the page that belongs to this session by inspecting all three sources below and collecting the candidates each produces — do not stop at the first hit:
/wiki-update in this
session, the absolute path of the file you wrote is in your prior tool
results. If that file still exists under wiki/pages/, it is a candidate..md file under wiki/pages/ and read
each file's YAML frontmatter. Match on session_id: equal to the current
session's id (the sessionID of the command invocation, e.g.
ses_xxxxxxxx, visible in the system context). Any match is a candidate.wiki/.openwiki-sessions.json (a flat object
{ "<session_id>": "<filename>.md" }). If your session id is a key,
validate that the value is a bare filename (no path separators, no ..)
and that the file still exists under wiki/pages/; only then is it a
candidate. If the key exists but the file is gone, drop the stale entry
before continuing.Then reconcile the collected candidates:
The conversation source is the most authoritative, but every source is checked before selecting so a stale mapping or a repeated session id can never silently redirect the update to the wrong page.
wiki/pages/YYYY-MM-DD-3-to-5-word-summary.md
For example, 2026-07-14-fix-api-auth-tests.md. Use today's date
(date +%F) and a 3-to-5-word kebab-case summary of the session's main topic.
If a file with that name already exists but its frontmatter session_id:
belongs to a different session, do NOT overwrite it — append a deterministic
suffix (-2, -3, …) until the filename is free.
Read wiki/TEMPLATE.md for the full structure and its per-type section
presets. Follow the presets for the page's type (debug / investigation /
code-review / implementation): require step-by-step fixes, files modified, and
test results only where that type's preset calls for them. Every page must
include:
session_id: set to your session id, and date: set to
today on creation; preserved on update.type in TEMPLATE.md.- **<key>** — <value>) for quick-reference content, or as H3-headed
"card" sections when each row has multiple sub-points. GFM tables don't
diff cleanly in git, are inaccessible to screen readers, and don't
reflow on mobile. Code blocks and bullet lists of links are not tables.When updating an existing page, preserve session_id: and date: from the
original frontmatter. Prefer appending a new dated section over rewriting the
body — earlier work stays visible. Use the canonical heading
## Update — YYYY-MM-DD HH:MM inserted directly before ## Follow-ups; if a
same-day section already exists, extend it instead of adding another.
After every successful write, refresh wiki/.openwiki-sessions.json so the
next /wiki-update in this session can find the file via the fallback:
{ "<your_session_id>": "<filename>.md" }
Read-modify-write the JSON object. Create the file if it does not exist. Only
store the bare filename (no path). If the file exists but is not valid JSON,
back it up to a collision-safe filename first (.openwiki-sessions.json.bak,
then .openwiki-sessions.json.bak2, … — never overwrite an existing backup),
then recover every mapping that is still salvageable from the invalid input and
keep those alongside this session's entry — do not replace the file with only
the current session. If the content cannot be salvaged, leave the backup for
manual review and note it in your report. Pretty-print with two-space indent
and a trailing newline.
wiki/INDEX.md lists pages under ## Pages, newest first, in this format:
- [<title>](pages/<filename>) — <one-line summary> (<date>)
_Newest first._ marker line.Report: which file you wrote to (created or updated), and the one-line summary.