wiki-fold
wikiのログ記録をまとめてメタページを作成し、過去のログから要約を抽出し、構造的に冪等なページとして保存、子ページへのリンクを生成することで、ログの整理と検索性を向上させるSkill。
📜 元の英語説明(参考)
Rollup of wiki log entries into meta-pages. Reads the last 2^k entries from wiki/log.md, writes a structurally-idempotent fold page to wiki/folds/ that links back to children. Extractive summarization (no invention). Dry-run by default, stdout-only; commit mode writes and accepts that the PostToolUse hook auto-commits. Triggers on: fold the log, run a fold, run wiki-fold, log rollup, roll up log entries.
🇯🇵 日本人クリエイター向け解説
wikiのログ記録をまとめてメタページを作成し、過去のログから要約を抽出し、構造的に冪等なページとして保存、子ページへのリンクを生成することで、ログの整理と検索性を向上させるSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o wiki-fold.zip https://jpskill.com/download/10556.zip && unzip -o wiki-fold.zip && rm wiki-fold.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10556.zip -OutFile "$d\wiki-fold.zip"; Expand-Archive "$d\wiki-fold.zip" -DestinationPath $d -Force; ri "$d\wiki-fold.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
wiki-fold.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
wiki-foldフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
wiki-fold: 抽出型ログまとめ
[[DragonScale Memory]]のメカニズム1の制限されたサブセットを実装します。これは、生のwiki/log.mdエントリに対するフラットなまとめです。まとめのまとめ(階層的なレベルスタッキング)はこのスキルでは対象外です。以下の「スコープ境界」を参照してください。
まとめは付加的です。子ログエントリとその参照ページは、変更、移動、または削除されることはありません。まとめは抽出型です。出力に含まれるすべての結果とテーマは、特定の子ログエントリに遡ることができる必要があります。捏造された事実や、子エントリがサポートする以上の合成は行いません。
スコープ境界(明示的)
このスキルでは、以下を実装しません:
- まとめのまとめ / 階層的なレベルスタッキング(DragonScaleの仕様では必要ですが、将来のスキルに延期されます)。
- 自動トリガー(まとめは常にフェーズ1で人間が呼び出します)。
- セマンティックタイルによる重複排除(メカニズム3、別のスキル)。
このスキルでは、以下を実装します:
- 選択されたバッチ指数
kでの、生のlog.mdエントリに対するフラットなまとめ。 - 決定論的なまとめIDによる構造的な冪等性。
- カウントチェックによる抽出的な要約。
フロントマターでレベルを参照する場合は、batch_exponent: kを使用してください(level: kではありません)。これは、このスキルが階層的なレベルを生成しないためです。
モード
| モード | 書き込み? | 呼び出し |
|---|---|---|
| dry-run (デフォルト) | Writeツール呼び出しなし。 Bashのcat/heredocを使用してまとめの内容をstdoutに出力するのみ。 |
fold the log, dry-run k=3 |
| commit | Write/Editツールを使用。各Writeは、リポジトリのPostToolUseフックを起動し、wikiの変更を自動コミットします。これを受け入れてください。最初に完全なコンテンツを作成し、次に書き込みをシーケンスします。 | fold the log, commit k=3(クリーンなdry-runの後のみ) |
dry-runでstdoutのみを使用する理由: リポジトリのhooks/hooks.json PostToolUseフックは、Write|Editが発生するたびに起動し、git add wiki/ .raw/を実行します。/tmpに書き込んでも/tmpはステージングされませんが、フックがトリガーされ、汎用的なメッセージで保留中のwikiの変更がコミットされます。Dry-runは残留物を残してはなりません。Bashのstdoutはフックを起動しません。
決定論的なまとめID
すべてのまとめには、その入力から派生したIDがあります。
fold-k{K}-from-{EARLIEST-DATE}-to-{LATEST-DATE}-n{COUNT}
例:fold-k3-from-2026-04-10-to-2026-04-23-n8。
コミットモードでのファイル名はwiki/folds/{FOLD-ID}.mdです。ファイル名に作成日は含めません。タイトルにタイムスタンプは含めません。
重複検出(必須): 出力を生成する前に、wiki/folds/{FOLD-ID}.mdが既に存在するかどうかを確認してください。存在する場合は、「Fold already exists at wiki/folds/{FOLD-ID}.md. Use --force to overwrite, or pick a different range.」と報告して停止します。これがno-opの冪等性保証です。バイト単位で同一のコンテンツは保証されませんが(LLMの文章は異なります)、ファイル名とスコープは保証されます。
パラメータ
k(デフォルト 4): バッチ指数。バッチサイズ =2^k。一般的な値: k=3 (8), k=4 (16), k=5 (32)。range(オプション): 明示的なエントリ範囲entries 1-16。kをオーバーライドします。--force: 同じIDの既存のまとめを上書きします。デフォルトはno。--commit: wiki/に書き込みます。指定しない場合は、dry-runでstdoutのみに出力します。
2^k個未満のログエントリしか存在しない場合は、不足を報告して停止します。部分的なバッチを黙ってまとめないでください。
手順
1. ログエントリの解析
grep -n "^## \[" wiki/log.md | head -{2^k}
各エントリについて、行番号、日付、操作、タイトル、および次の## [またはセクションの終わりまでの箇条書き行を記録します。
2. 子ページ識別子の抽出
各エントリの箇条書きリストから、以下を抽出します。
Location: wiki/path/to/page.md(プライマリページ)[[Wikilinks]]インラインPages created:およびPages updated:リスト
構造化された子リストを作成します。
children:
- date: "2026-04-23"
op: "save"
title: "DragonScale Memory v0.2 — post-adversarial-review"
page: "[[DragonScale Memory]]"
- ...
ログエントリごとに1つのレコード。ページごとに重複排除しないでください。2つのエントリが両方とも[[DragonScale Memory]]を指している場合、両方のレコードが表示され、日付とタイトルで区別できます。
3. 参照ページの読み取り(制限付き)
ログエントリの箇条書きで完全にキャプチャされていないページのみを読み取ります。予算: 0-10ページ読み取り。ハード上限: 15。エントリの参照ページが見つからない場合は、page_missing: trueを記録して続行します。
4. カウントチェックによる抽出的な要約
references/fold-template.mdに従ってまとめの本文を記述します。ルール:
- 抽出型のみ。 すべての結果の箇条書きとテーマの箇条書きは、特定の子エントリ(例:
(from 2026-04-14 session))またはそのエントリからの引用行を引用する必要があります。子エントリに存在しないイベント、カウント、または解釈を導入しないでください。 - ログエントリが主要なソースです。 ログエントリの箇条書きと参照先のメタページが事実(例:カウント)について一致しない場合は、ログエントリの箇条書きを優先し、「source mismatch: log says X, meta says Y.」として不一致をフラグします。
- カウントチェック。 「N concept pages」または「M repos updated」と記述する場合は、ソースエントリからその数をgrepして確認します。数値の不一致はdry-runのブロッカーです。
- エントリを名前を付けずにマージしないでください。 複数のエントリにまたがるテーマは、貢献している各エントリをインラインで名前を付ける必要があります。
- 不確実性は特徴です。 エントリがあいまいな場合は、1つの解釈を選択するのではなく、「ambiguous in source: [[Entry]]」と記述します。
5. 出力前の自己チェック
出力を印刷する前に、以下を確認します。
children:フロントマターのすべての子が、子エントリテーブルに正確に1回表示されます。- テーブル内のすべてのエントリが、
children:フロントマターに表示されます。 - 主要な結果のすべての数値的な主張が、子エントリに対してgrepで検証可能です。
- まとめIDが決定論的であり、ファイルがまだ存在しない(または
--forceが設定されている)。
いずれかのチェックが失敗した場合は、中止して特定のエラーを報告します。
6. 出力
Dry-run: Bashのcat <<'EOF' ... EOFを使用してstdoutに出力します。Writeを使用しないでください。まとめIDと、コミットステップが何をするかの1行の要約を出力します。
Commit (ユーザーが「commit the fold」と言った後のみ):
- まとめページを
wiki/folds/{FOLD-ID}.mdにWriteします。(PostToolUseフックがこれを自動コミットします。) wiki/index.mdをEditして、まとめのリンクを以下に追加します。
(原文はここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
wiki-fold: Extractive Log Rollup
Implements a bounded subset of Mechanism 1 from [[DragonScale Memory]]: flat fold over raw wiki/log.md entries. Fold-of-folds (hierarchical level-stacking) is out of scope for this skill; see "Scope boundary" below.
A fold is additive: child log entries and their referenced pages are never modified, moved, or deleted. A fold is extractive: every outcome and theme in the output must be traceable to a specific child log entry. No invented facts, no synthesis beyond what the child entries support.
Scope boundary (explicit)
This skill does not implement:
- Fold-of-folds / hierarchical level stacking (DragonScale spec calls for it; deferred to a future skill).
- Automatic triggering (folds are always human-invoked in Phase 1).
- Semantic-tiling dedup (Mechanism 3; separate skill).
It does implement:
- Flat fold over raw log.md entries at a chosen batch exponent
k. - Structural idempotency via a deterministic fold ID.
- Extractive summarization with count-checking.
When referring to level in frontmatter, use batch_exponent: k (not level: k), because this skill does not produce hierarchical levels.
Modes
| Mode | Writes? | Invocation |
|---|---|---|
| dry-run (default) | No Write tool calls. Emit fold content via Bash cat/heredoc to stdout only. |
fold the log, dry-run k=3 |
| commit | Uses Write/Edit tools. Each Write fires the repo PostToolUse hook which auto-commits wiki changes. Accept this. Compose full content first, then sequence writes. | fold the log, commit k=3 (only after a clean dry-run) |
Why stdout-only in dry-run: the repo's hooks/hooks.json PostToolUse hook fires on any Write|Edit and runs git add wiki/ .raw/. Writing to /tmp does not stage /tmp, but it still triggers the hook, which will commit any pending wiki changes under a generic message. Dry-run must leave zero residue. Bash stdout does not fire the hook.
Deterministic fold ID
Every fold has an ID derived from its inputs:
fold-k{K}-from-{EARLIEST-DATE}-to-{LATEST-DATE}-n{COUNT}
Example: fold-k3-from-2026-04-10-to-2026-04-23-n8.
The filename in commit mode is wiki/folds/{FOLD-ID}.md. No date-of-creation in the filename. No timestamp in the title.
Duplicate detection (required): before emitting any output, check if wiki/folds/{FOLD-ID}.md already exists. If so, report "Fold already exists at wiki/folds/{FOLD-ID}.md. Use --force to overwrite, or pick a different range." and stop. This is the no-op idempotency guarantee; byte-identical content is NOT guaranteed (LLM prose varies) but the filename and scope are.
Parameters
k(default 4): batch exponent. Batch size =2^k. Typical values: k=3 (8), k=4 (16), k=5 (32).range(optional): explicit entry rangeentries 1-16. Overrides k.--force: overwrite an existing fold with the same ID. Default no.--commit: write to wiki/. Without it, dry-run stdout-only.
If fewer than 2^k log entries exist, report the shortfall and stop. Do not silently fold a partial batch.
Procedure
1. Parse log entries
grep -n "^## \[" wiki/log.md | head -{2^k}
Record for each entry: line number, date, operation, title, and the following bullet lines until the next ## [ or end-of-section.
2. Extract child page identifiers
From each entry's bullet list, extract:
Location: wiki/path/to/page.md(the primary page)[[Wikilinks]]inlinePages created:andPages updated:lists
Build a structured children list:
children:
- date: "2026-04-23"
op: "save"
title: "DragonScale Memory v0.2 — post-adversarial-review"
page: "[[DragonScale Memory]]"
- ...
One record per log entry. Do not dedupe by page: if two entries both point to [[DragonScale Memory]], both records appear, distinguishable by date and title.
3. Read referenced pages (bounded)
Read only the pages that are not already captured fully in the log entry's bullets. Budget: 0-10 page reads. Hard ceiling: 15. If an entry's referenced page is missing, record page_missing: true and proceed.
4. Extractive summarization with count checks
Write the fold body per references/fold-template.md. Rules:
- Extractive only. Every outcome bullet and theme bullet must cite a specific child entry (e.g.,
(from 2026-04-14 session)) or a quoted line from that entry. Do not introduce events, counts, or interpretations not present in a child entry. - Log entry is the primary source. If the log entry's bullets and the referenced meta-page disagree on a fact (e.g., a count), prefer the log-entry bullets and flag the mismatch as "source mismatch: log says X, meta says Y."
- Count checks. If you write "N concept pages" or "M repos updated," grep the source entries for the number and verify. Numeric mismatches are dry-run blockers.
- No merging across entries without naming them. A theme that spans multiple entries must name each contributing entry inline.
- Uncertainty is a feature. If an entry is ambiguous, say "ambiguous in source: [[Entry]]" rather than picking one interpretation.
5. Self-check before emitting
Before printing output, verify:
- Every child in
children:frontmatter appears exactly once in the Child Entries table. - Every entry in the table appears in the
children:frontmatter. - Every numeric claim in Key Outcomes is grep-verifiable against a child entry.
- The fold ID is deterministic and the file does not already exist (or
--forceis set).
If any check fails, abort and report the specific failure.
6. Emit
Dry-run: use Bash cat <<'EOF' ... EOF to stdout. Do not use Write. Print the fold ID and a one-line summary of what the commit step would do.
Commit (only after user says "commit the fold"):
Writethe fold page towiki/folds/{FOLD-ID}.md. (PostToolUse hook will auto-commit this.)Editwiki/index.mdto add the fold link under a## Foldssection (create section if missing). (Hook auto-commits.)Editwiki/log.mdto prepend one entry:## [YYYY-MM-DD] fold | batch-exponent-k{K} rollup of N entries - Location: wiki/folds/{FOLD-ID}.md - Range: {EARLIEST-DATE} to {LATEST-DATE} - Children: N log entries(Hook auto-commits.)
Three auto-commits result. The user sees three separate wiki: auto-commit entries in git log. This is expected; do not attempt to suppress the hook.
Output schema
See references/fold-template.md for the canonical frontmatter and body layout.
Invariants
- Structural idempotency: same range + same k → same fold ID → duplicate detection prevents double-writes. LLM prose may vary across runs; the location and scope are fixed.
- Additive: children are never modified.
- Bounded reads: 0-15 child-page reads per fold.
- Extractive: zero invented facts. Count checks enforced.
- No chaining: wiki-fold does not invoke wiki-lint, wiki-ingest, autoresearch, or save.
What NOT to do
- Do not use Write/Edit during dry-run. Bash stdout only.
- Do not include the current date in the fold filename or title. Use the child entry range.
- Do not silently dedupe children by page title. One record per log entry.
- Do not write "emergent themes" that span entries without naming which entries contribute.
- Do not claim byte-identical idempotency. Structural idempotency is the actual guarantee.
- Do not suppress or bypass the PostToolUse auto-commit hook.
- Do not update
wiki/hot.md. Ownership stays with save/ingest skills.
Reversal
Committed fold reversal (three commits, land in this order):
- Remove the log.md fold entry.
- Remove the index.md entry.
- Delete the fold page file.
Or: git revert the three auto-commits. Child pages are untouched in either path.
Example dry-run sequence
User: "fold the log, dry-run k=3"
- Parse
wiki/log.mdtop 8 entries. - Build structured children list (8 records).
- Read 0-10 referenced pages as needed.
- Produce fold ID:
fold-k3-from-2026-04-10-to-2026-04-23-n8. - Check
wiki/folds/fold-k3-from-2026-04-10-to-2026-04-23-n8.mddoes not exist. - Write fold body following the template.
- Run self-check (frontmatter/table consistency, count verification).
- Emit via
cat <<'EOF' ... EOFto stdout. - Report: "Dry-run complete. Fold ID: {FOLD-ID}. To commit: 'commit the fold'."