マークダウン形式の知識ベース(情報を整理・保存するシステム)を作成・保守できます。AIエージェントはこの知識ベースを読んだり、検索したり、更新したりできます。 次のような場合に使用: - 知識ベースを新たに始めたい - メモや情報を追加・更新したい - ドキュメントやメモをエージェント向けに整理したい - メモのインデックス(目次や検索用リスト)を作成したい - 既存のマークダウン知識ベースのメンテナンスや整理をしたい トリガーキーワード:「knowledge base」「KB」「notes for the agent」「index of notes」「second brain」「docs for AI context」「add a note」「update the KB」
Create and maintain a Markdown knowledge base that any AI agent can read, search, and update. Use when the user wants to start a knowledge base, add or update notes, organize docs/notes for an agent or LLM to consume, build an index of notes, or run a cleanup/maintenance pass on an existing MD knowledge base. Triggers include "knowledge base", "KB", "notes for the agent", "index of notes", "second brain", "docs for AI context", "add a note", "update the KB".
ナレッジベース(KB)はMarkdownファイルのフォルダであり、どのAIエージェントもベクトルデータベースなしで移動できるように設計されています。エージェントは1つのインデックスファイルを読み込み、説明に基づいて関連ノートを選択し、それらのファイルだけを開きます。KB全体を読みやすく保ち、インデックスは最小限に — インデックスがコンテキストに読み込まれるため、高いシグナル価値を持つ必要があります。
新しいKBを作成する場合、ノートを追加・編集する場合、またはメンテナンスを実施する場合は、以下のルールを適用してください。ユーザーのリクエストが曖昧な場合(新規KB vs ノート追加 vs クリーンアップ)は、実行する前にどれかを確認してください。
インデックス優先のナビゲーション。 インデックスはマップであり、コンテナではありません。エージェントは INDEX.md を読み、ワンライン説明でノートを選択してから、それらのファイルだけを開きます。インデックスに登録されていないノートは、KB「内」に存在しません。
アトミック性。 1つのノート = 1つのトピック。タイトルに「と」が必要なら、おそらく2つのノートです。アトミックなノートは検索、リンク、再利用が容易です。
安定したID。 すべてのノートには変更されず、再利用されない永続的なIDがあり、リンクはリネームや移動に耐えられます。
理由付きでリンク。 2つのノートが接続される場合、なぜかを明記してください(前提条件、サポート、対比、参照)。接続はノート自体と同じくらい価値を持ちます。
簡潔な指示。 INDEX.md の指示は短く、高シグナル価値を保ってください — エージェントのコンテキスト予算と競争します。本体はオンデマンドで読み込まれます。
検索構造。 明確なH1タイトルとH2/H3セクションにより、エージェントはノート全体ではなく関連スライスを取得できます。
knowledge-base/
INDEX.md # エントリポイント: 指示 + 完全なノートレジストリ
topics/
<topic>/
_topic.md # トピックマップ: このトピックがカバーする内容 + そのノート
<slug>.md # 1つのアトミックノート
assets/ # ノートで参照される画像・添付ファイル
auth, billing, deploys)です。_topic.md はトピックレベルのコンテンツマップ(MOC)です。短いイントロと、そのトピック内のすべてのノートへのリンクが含まれます。これは便宜的なビューです。INDEX.md が真実の源です。topics/auth/session-tokens.md。id slug部分と一致する必要があります。---
id: 20260618-session-tokens # IDスキーム: YYYYMMDD-slug。安定。再利用または変更不可。
title: Session tokens # 人間向けタイトル、ノートのH1でもあります
tags: [auth, security] # INDEX.mdの管理用タグリストのみ
created: 2026-06-18
updated: 2026-06-18
related: [20260618-auth-flow] # リンクされたノートのID
summary: このノートがカバーする内容を説明する1つのスキャン可能な文。
---
id: YYYYMMDD-slug。ソート可能、読みやすく、安定。同一日で異なるタイトルのノートはslugで区別します。同一の日付と同一のslugで衝突する2つのノートがある場合、-2, -3, … を追加します(割り当てる前に INDEX.md レジストリを確認してください)。一度割り当てられたら、idは永続的です。
summary: この正確な文がインデックスレジストリに掲載されます — エージェントがノートを開くかどうかを判断するのに役立つように書いてください。
updated: 本文が変更されるたびにバンプしてください。
# Session tokens
> Summary: 1文(frontmatter summaryを反映)。
## Context
このノートが存在する理由 / いつ適用されるか。
## Details
実際のコンテンツ、短いH2/H3セクション。
## Related
- [Auth flow](auth-flow.md) — 前提条件: トークンは認証フロー中に発行されます。
- [Rate limiting](../api/rate-limiting.md) — 参照: トークンはレート制限キーを含みます。
related frontmatterにも表示される必要があります。INDEX.md には2つの部分があります。エージェント向けの操作指示とレジストリです。
# ナレッジベース — インデックス
## このKBの使い方(エージェント向け)
1. まずこのインデックスを読んでください。説明でノートを選択してから、それらだけを開いてください。
2. 質問に答えるために、すべてをスキャンするのではなく、1~3個の特定のノートを開くことを優先してください。
3. ノートからの情報を使用するときは、ノート `id` を引用してください。
## このKBを更新する方法(エージェント向け)
- 新しいアイデア → 新しいノートを作成します(アトミック)。同じアイデアが変更された → ノートをその場で編集し、`updated` をバンプします。
- 作成 / リネーム / 削除は、このレジストリとトピックの `_topic.md` を同じ変更で更新する**必須**です。
- 管理用語彙以下のタグのみを使用してください。新しいタグを使用する前にここに追加してください。
## 管理用タグ
`auth`, `security`, `billing`, `api`, `ops` <!-- 意図的に拡張 -->
## レジストリ
### auth
- `20260618-auth-flow` — **認証フロー** — `topics/auth/auth-flow.md` — ユーザーセッションがエンドツーエンドで確立される方法。
- `20260618-session-tokens` — **セッショントークン** — `topics/auth/session-tokens.md` — トークンの形式、ライフタイム、ローテーション。
### billing
- `20260618-invoicing` — **請求書作成** — `topics/billing/invoicing.md` — 請求書がどのように生成・送信されるか。
レジストリ行フォーマット: `id` — **タイトル** — `path` — ワンライン説明。
# Auth
認証、セッション、およびアクセス制御をカバーするノート。
- [認証フロー](auth-flow.md) — セッションがどのように確立されるか。
- [セッショントークン](session-tokens.md) — トークン形式、ライフタイム、ローテーション。
create_directory します。write_file で INDEX.md を、指示ブロック、空の管理用タグリスト、空のレジストリで作成します。_topic.md、その後最初のノート(各々 write_file で)を追加します。INDEX.md に登録し、_topic.md からリンクします — 変更した行だけに触れるよう edit_block を使用してください。list_directory で何があるか確認)。write_file でノート(kebab-case slug)を完全なfrontmatterと本文形式で作成します。related に反映させます。INDEX.md に登録し、_topic.md でリンクします — edit_block で同じ変更内で行います。edit_block でノートをその場で更新し、updated をバンプし、スコープが変わった場合はレジストリ行を edit_block で更新します。write_file で作成します。テキストスキャンに start_search(ripgrep)を、存在確認に get_file_info / list_directory を使用します — これらは大規模で実行可能にします:
孤立ノート(受信リンクがない — 送信は関係ありません): start_search でKBのノート id とファイル名slugを検索し、常に存在する自己マッチ — ノート自体のファイル、INDEX.md、その _topic.md — を割り引いてください。左側に何か残っている場合は本物の受信リファレンスです。何も残らない場合 = 孤立なので、関連ノート/MOCからリンクするか、アーカイブしてください。
リンク切れ / ドリフト: テキストヒットから解決を推論しないでください — 文字列が存在することはファイルが存在することを意味しません。get_file_info(または list_directory per トピック)で各レジストリパスと related: ターゲットが存在することを確認し、ディスク上のすべてのファイルが登録されていることを確認してください。テキスト比較はタイトル/サマリー不同期部分のみに使用してください。
非アトミックノート: 複数のトピックをカバーするように拡張されたノート → 分割します。
重複: ほぼ同一のノート → マージし、1つの id を保持し、リンクをリダイレクトします。
タグの蔓延: INDEX.md から管理用リストを読み込み、その後 start_search でfrontmatter tags: 行を検索し、リスト上にないタグをフラグします → 調整します。
read_multiple_files で候補を一括で取得し、edit_block で修正を適用し、変更内容をレポートしてください。
id は一意で変更されていません。ファイル名slugはid slugと一致します。related に反映されています。INDEX.md レジストリとトピック _topic.md が変更を反映しています。updated は変更されたすべてのノートでバンプされています。A knowledge base (KB) here is a folder of Markdown files designed so any AI agent can navigate it without a vector database: the agent reads one index file, picks the relevant notes by their descriptions, and opens only those. Keep the whole KB readable and the index lean — the index is what gets loaded into context, so it must be high-signal.
Apply the rules below when creating a new KB, adding/editing notes, or doing a maintenance pass. When the user's request is ambiguous (new KB vs. add note vs. cleanup), ask which one before acting.
INDEX.md, selects notes by their one-line descriptions, then opens
only those files. No note is "in" the KB unless it's registered in the index.INDEX.md instructions short and high-signal —
it competes for the agent's context budget. Bodies load on demand.knowledge-base/
INDEX.md # entry point: instructions + full note registry
topics/
<topic>/
_topic.md # topic map: what this topic covers + its notes
<slug>.md # one atomic note
assets/ # images / attachments referenced by notes
auth, billing, deploys)._topic.md is the topic-level map of content (MOC): a short intro plus links
to every note in that topic. It is a convenience view; INDEX.md remains the
source of truth.topics/auth/session-tokens.md.id slug portion.---
id: 20260618-session-tokens # ID scheme: YYYYMMDD-slug. Stable. Never reuse or change.
title: Session tokens # human title, also the note's H1
tags: [auth, security] # only tags from the controlled list in INDEX.md
created: 2026-06-18
updated: 2026-06-18
related: [20260618-auth-flow] # IDs of linked notes
summary: One scannable sentence describing what this note covers.
---
id: YYYYMMDD-slug. Sortable, readable, stable. Different-titled same-day
notes differ by slug; if two same-day notes would collide on the same slug,
append -2, -3, … (check the INDEX.md registry before assigning). Once
assigned, the id is permanent.summary: this exact sentence is what goes in the index registry — write it to
help an agent decide whether to open the note.updated: bump it whenever the body changes.# Session tokens
> Summary: One sentence (mirrors frontmatter summary).
## Context
Why this note exists / when it applies.
## Details
The actual content, in short H2/H3 sections.
## Related
- [Auth flow](auth-flow.md) — prerequisite: tokens are issued during the auth flow.
- [Rate limiting](../api/rate-limiting.md) — see-also: tokens carry the rate-limit key.
related frontmatter.INDEX.md has two parts: operating instructions for agents, and the registry.
# Knowledge Base — Index
## How to use this KB (for agents)
1. Read this index first. Pick notes by their descriptions; open only those.
2. To answer a question, prefer opening 1–3 specific notes over scanning everything.
3. Cite the note `id` when you use information from it.
## How to update this KB (for agents)
- New idea → create a new note (atomic). Same idea changed → edit the note in place and bump `updated`.
- Any create / rename / delete MUST update this registry and the topic's `_topic.md` in the same change.
- Use only tags from the controlled vocabulary below; add a new tag here before using it.
## Controlled tags
`auth`, `security`, `billing`, `api`, `ops` <!-- extend deliberately -->
## Registry
### auth
- `20260618-auth-flow` — **Authentication flow** — `topics/auth/auth-flow.md` — How a user session is established end to end.
- `20260618-session-tokens` — **Session tokens** — `topics/auth/session-tokens.md` — Token format, lifetime, and rotation.
### billing
- `20260618-invoicing` — **Invoicing** — `topics/billing/invoicing.md` — How invoices are generated and sent.
Registry line format: `id` — **Title** — `path` — one-line description.
# Auth
Notes covering authentication, sessions, and access control.
- [Authentication flow](auth-flow.md) — how a session is established.
- [Session tokens](session-tokens.md) — token format, lifetime, rotation.
create_directory for the folder structure above.write_file INDEX.md with the instructions block, an empty controlled-tag
list, and an empty registry._topic.md, then the first note (each via write_file).INDEX.md and link it from _topic.md — edit_block
both so you touch only the changed lines.list_directory to see what's there).write_file the note (kebab-case slug) with full frontmatter and the body shape.related).INDEX.md and link it in _topic.md with edit_block — same change.edit_block the note in place, bump updated, and
edit_block the registry line if the scope changed.write_file a new atomic note instead of expanding this one.Use start_search (ripgrep) for text scans and get_file_info / list_directory
for existence checks — together they make this tractable at scale:
start_search the
KB for the note's id and filename slug, then discount the self-matches that
always exist — the note's own file, INDEX.md, and its _topic.md. Anything
left is a genuine inbound reference; nothing left = orphan, so link it from a
relevant note/MOC or archive it.related:
target exists with get_file_info (or list_directory per topic), and that
every file on disk is registered. Use a text compare only for the
titles/summaries-out-of-sync half.id, redirect links.INDEX.md, then start_search
the frontmatter tags: lines and flag any tag not on the list → reconcile.
Pull candidates in bulk with read_multiple_files, apply fixes with edit_block,
and report what changed.id is unique and unchanged; filename slug matches the id slug.related.INDEX.md registry and the topic _topic.md reflect the change.updated bumped on every changed note.原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。