Explanation Docsのロゴ

Explanation Docs

組織
existential-birds
explanation-docs

Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do. Use when writing an explanation doc, conceptual guide, understanding/background doc, design rationale, or architecture explanation, or when asked how/why something works. Builds on the docs-style core writing principles.

概要

公開者existential-birds
リポジトリbeagle
スキル名explanation-docs
スター
82
フォーク
8
同梱ファイル
指示のみ
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    existential-birdsがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルExplanation DocsをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/existential-birds/beagle/tree/main/plugins/beagle-docs/skills/explanation-docs
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/existential-birds/beagle.git /tmp/beagle
mkdir -p .claude/skills
cp -r /tmp/beagle/plugins/beagle-docs/skills/explanation-docs .claude/skills/explanation-docs
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでExplanation Docsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にExplanation Docsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Explanation Docsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Explanation Documentation Skill

This skill provides patterns for writing effective explanation documents. Explanations are understanding-oriented content for readers who want to know why things work the way they do.

Dependency: Use this skill with docs-style for core writing principles. To confirm explanation is the right type — rather than a tutorial, how-to, or reference — see docs-style/references/diataxis-compass.md.

Purpose & Audience

Target readers:

  • Users who want to understand concepts deeply, not just use them
  • Architects and technical leads evaluating design decisions
  • Team members onboarding to a codebase or system
  • Anyone asking "why?" or "how does this work?"

Explanations are for reading away from the keyboard. Unlike tutorials or how-to guides, readers aren't trying to accomplish a task while reading. They're building mental models.

Explanations are NOT:

  • Tutorials (which teach through hands-on doing)
  • How-To guides (which accomplish specific goals)
  • Reference docs (which look up precise details)

Explanation Document Template

Use this structure for all explanation documents:

markdown
---
title: "[Concept/System Name] Explained"
description: "Understand how [concept] works and why it was designed this way"
---

# Understanding [Concept]

Brief intro (2-3 sentences): What this document explains and why it matters. Set expectations for what the reader will understand after reading.

## Overview

High-level summary of the concept. What is it? What problem does it solve? This should be understandable without deep technical knowledge.

## Background and Context

### The Problem

What situation or challenge led to this design? What were users or developers struggling with?

### Historical Context

How did we get here? What came before? This helps readers understand why alternatives were rejected or why certain constraints exist.

## How It Works

### Core Concepts

Explain the fundamental ideas. Use analogies to connect to concepts readers already understand.

<Note>
Use diagrams or visual aids when explaining complex relationships or flows.
</Note>

### The Mechanism

Walk through how the system actually operates. This is conceptual, not procedural - explain the "what happens" rather than "what to do."

### Key Components

Break down the major parts and how they interact. For each component:
- What role does it play?
- How does it relate to other components?

## Design Decisions and Trade-offs

### Why This Approach?

Explain the reasoning behind key design choices. What goals drove these decisions?

### Trade-offs Made

Every design involves trade-offs. Be explicit about:
- What was prioritized
- What was sacrificed
- Under what conditions this design excels or struggles

### Constraints and Assumptions

What constraints shaped the design? What assumptions does it rely on?

## Alternatives Considered

### [Alternative Approach 1]

Brief description of an alternative approach. Why wasn't it chosen? Under what circumstances might it be better?

### [Alternative Approach 2]

Another alternative. Comparing alternatives helps readers understand the design space.

## Implications and Consequences

What does this design mean for:
- Performance?
- Scalability?
- Developer experience?
- Future extensibility?

## Related Concepts

- [Related Concept 1](/concepts/related-1) - How it connects to this topic
- [Related Concept 2](/concepts/related-2) - Another related area
- [Deeper Technical Reference](/reference/detail) - For implementation specifics

Writing Principles

Focus on Understanding, Not Doing

Explanations answer "why?" and "how does it work?" rather than "how do I?"

Explanation (good)How-To (wrong context)
"The cache uses LRU eviction because memory is limited and recent items are more likely to be accessed again.""To configure the cache, set the maxSize parameter."
"Authentication tokens expire to limit the damage if they're compromised.""Refresh your token by calling the /refresh endpoint."

Use Analogies and Mental Models

Connect unfamiliar concepts to things readers already know.

markdown
<!-- Good: Relatable analogy -->
Think of the message queue like a post office. Messages (letters) are dropped off
by senders and held until recipients pick them up. The post office doesn't care
about the content - it just ensures reliable delivery.

<!-- Avoid: Jumping straight to technical details -->
The message queue implements a FIFO buffer with configurable persistence
and at-least-once delivery semantics.

Explain the "Why" Behind Design Decisions

Don't just describe what exists - explain why it exists that way.

markdown
<!-- Good: Explains rationale -->
We chose eventual consistency over strong consistency because our read-heavy
workload (100:1 read-to-write ratio) benefits more from low latency than from
immediate consistency. Most users never notice the brief delay.

<!-- Avoid: Just states facts -->
The system uses eventual consistency with a 500ms propagation window.

Discuss Trade-offs Honestly

Every design choice has costs. Acknowledging them builds trust and helps readers make informed decisions.

markdown
## Trade-offs

This architecture optimizes for **write throughput** at the cost of:

- **Read latency**: Queries may need to hit multiple partitions
- **Complexity**: Developers must understand partition keys
- **Cost**: More storage due to denormalization

This trade-off makes sense for our use case (high-volume event ingestion)
but may not suit read-heavy analytics workloads.

Structure for Reflection, Not Action

Explanations are read linearly, away from the keyboard. Structure them like essays, not manuals.

  • Use flowing prose more than bullet points
  • Build concepts progressively - each section prepares for the next
  • Allow for depth - it's okay if sections are longer than in how-to guides
  • Include context that would be distracting in task-focused docs

Keep Explanation Bounded

Diátaxis warns that explanation is "the most easily neglected and most easily mistaken" type — it tends to absorb material that belongs elsewhere. A paragraph of setup steps creeps in, or a parameter table, and the document quietly stops being an explanation.

Guard the boundary: if you find yourself writing instructions the reader should follow, that belongs in a How-To; if you're listing exact signatures or options to consult, that belongs in Reference. Link to those docs instead of inlining them. The discipline of staying within "why" and "how it works" is what makes an explanation worth reading away from the keyboard.

A useful tell that you're on track: explanation reads naturally with discursive openings like "The reason for X is that historically…", "X is better than Y because…", or "Some teams prefer Z, which works well when… but…". If a section can't be phrased that way, it may not be explanation.

Admit Opinion and Judgement

Diataxis is explicit that explanation is the one type where opinion belongs: "all human activity and knowledge is invested with values, judgements, opinion — even, dare we say it, ideology." Reference and how-to must stay neutral, but an explanation that refuses to take a position fails to help the reader form their own. State recommendations and say why ("We prefer X over Y in most cases because…"), name the conditions under which the judgement flips, and attribute contested claims honestly. The goal is informed understanding, not false neutrality.

Connect to the Bigger Picture

Show how this concept relates to other parts of the system or to broader industry patterns. Explanation is bounded by its topic, not by the machinery, so it is free to make connections outward — to adjacent systems, to history, even to ideas beyond the immediate codebase — where they deepen understanding.

markdown
## Related Concepts

Our event sourcing approach is part of our broader CQRS (Command Query
Responsibility Segregation) architecture. Understanding event sourcing
helps explain:

- Why our read models are eventually consistent
- How we achieve audit logging "for free"
- Why replaying events is central to our testing strategy

For more on CQRS, see [Understanding Our Architecture](/concepts/cqrs-architecture).

Components for Explanations

Diagrams and Visuals

Explanations benefit heavily from visual aids:

markdown
## System Architecture

The following diagram shows how requests flow through the system:

```mermaid
graph LR
    A[Client] --> B[Load Balancer]
    B --> C[API Gateway]
    C --> D[Service A]
    C --> E[Service B]
    D --> F[(Database)]
    E --> F

The load balancer distributes traffic across API gateway instances...


### Comparison Tables

Tables work well for comparing approaches:

```markdown
## Comparing Approaches

| Aspect | Monolith | Microservices |
|--------|----------|---------------|
| Deployment | Single unit, simpler | Independent, more complex |
| Scaling | Vertical | Horizontal per service |
| Team autonomy | Lower | Higher |
| Operational overhead | Lower | Higher |

We chose microservices because team autonomy was critical for our
100+ engineer organization...

Callouts for Key Insights

markdown
<Note>
This is a common source of confusion: the "eventual" in eventual consistency
doesn't mean "maybe" - it means "not immediately, but guaranteed eventually."
</Note>

<Warning>
This design assumes network partitions are rare. In environments with
unreliable networks, consider stronger consistency guarantees.
</Warning>

Expandable Sections for Depth

Use expandables for tangential but valuable details:

markdown
<Expandable title="Historical note: Why we migrated from Redis">
Our original implementation used Redis for caching. In 2023, we migrated
to a custom solution because...

This context explains why some older code references Redis patterns
even though we no longer use it directly.
</Expandable>

Example Explanation Document

markdown
---
title: "Understanding Our Authentication System"
description: "Learn how authentication works in our platform and why we designed it this way"
---

# Understanding Our Authentication System

This document explains how our authentication system works and the reasoning
behind its design. After reading, you'll understand the flow from login to
API access and why we made the architectural choices we did.

## Overview

Our authentication system uses short-lived access tokens with long-lived refresh
tokens. This pattern, sometimes called "token rotation," balances security with
user experience by limiting exposure while avoiding frequent re-authentication.

## Background and Context

### The Problem

Modern web applications face competing demands: security teams want frequent
credential rotation, while users expect seamless experiences without constant
logins. Traditional session-based authentication requires server-side state,
complicating horizontal scaling.

### Historical Context

We originally used server-side sessions stored in Redis. As we scaled to
multiple regions, session synchronization became a bottleneck. JWT tokens
emerged as an industry standard for stateless authentication, and we adopted
them in 2022.

## How It Works

### Core Concepts

**Access tokens** are like day passes at a conference. They grant entry for a
limited time and are checked at each door (API endpoint). If someone steals
your day pass, they can only use it until it expires.

**Refresh tokens** are like the registration confirmation you used to get your
day pass. You don't carry it around, but you can use it to get a new day pass
when yours expires.

### The Authentication Flow

When a user logs in:

1. They provide credentials to the authentication service
2. If valid, they receive both an access token (15-minute expiry) and
   a refresh token (7-day expiry)
3. The access token is used for API requests
4. When the access token expires, the refresh token obtains a new one
5. The old refresh token is invalidated, and a new one is issued

This rotation means that even if a refresh token is compromised, it can only
be used once before the legitimate user's next refresh invalidates it.

### Key Components

**Authentication Service**: Issues and validates tokens. Stateless for access
tokens, maintains a denylist for revoked refresh tokens.

**API Gateway**: Validates access tokens on every request. Rejects expired or
malformed tokens before requests reach backend services.

**Token Store**: Maintains refresh token metadata for revocation. Uses Redis
with regional replication.

## Design Decisions and Trade-offs

### Why Short-Lived Access Tokens?

We chose 15-minute expiry based on our threat model. Shorter expiry limits the
window for stolen token abuse, but more frequent refreshes increase latency
and auth service load. Our analysis showed 15 minutes balances these concerns
for our traffic patterns.

### Trade-offs Made

**Prioritized**: Horizontal scalability, security through token rotation
**Sacrificed**: Immediate revocation of access tokens, simplicity

Access tokens remain valid until expiry even after logout. For most use cases,
15 minutes of continued access is acceptable. For high-security operations
(password changes, large transfers), we require re-authentication.

### Constraints and Assumptions

- Clients can securely store refresh tokens (HttpOnly cookies for web)
- Clock skew between servers is under 30 seconds
- Redis is available for refresh token validation

## Alternatives Considered

### Server-Side Sessions

Traditional sessions would allow immediate revocation but require sticky
sessions or distributed session storage. We rejected this due to scaling
complexity and regional latency concerns.

### Longer Access Token Expiry

Longer-lived tokens reduce auth service load but increase risk from token
theft. Given our security requirements, we prioritized shorter windows.

## Implications and Consequences

**Performance**: Auth service handles ~10K refresh requests per minute. Token
validation is CPU-bound (signature verification), so we scale horizontally.

**Developer Experience**: Services never need database access for auth - they
just validate JWT signatures. This simplifies service development.

**User Experience**: Most users never notice token refresh. Mobile apps
refresh proactively to avoid mid-action expiry.

## Related Concepts

- [API Gateway Architecture](/concepts/api-gateway) - How the gateway validates tokens
- [Token Security Best Practices](/concepts/token-security) - Secure storage guidance
- [Authentication API Reference](/reference/auth-api) - Endpoint documentation

Checklist for Explanations

Before publishing, verify:

  • Title indicates this explains a concept (not a how-to)
  • Introduction sets expectations for what reader will understand
  • Background section provides context and history
  • Core concepts explained with analogies or mental models
  • Design decisions include rationale, not just facts
  • Trade-offs discussed honestly
  • Alternatives mentioned and compared
  • Implications for different concerns addressed
  • Related concepts linked
  • Written for reading away from keyboard (no tasks to follow)
  • Progressive structure builds understanding step by step

Gates before "done" (sequenced)

Run in order. Do not skip ahead; each step has an objective pass condition.

  1. Classify — Decide whether this document is an explanation (vs tutorial, how-to, or reference) using When to Use Explanation vs Other Doc Types. Pass if the dominant reader question matches an Explanation row in that table and the introduction states what understanding the reader will gain (one short sentence is enough).
  2. Skeleton — Align the draft with Explanation Document Template. Pass if the draft includes substantive content (not placeholders) for Overview, How It Works, and at least one of Design Decisions and Trade-offs or Alternatives Considered.
  3. Rationale — Pass if every major design or architecture claim includes either why it was chosen or what trade-off it accepts (not only what exists).
  4. Checklist — Complete Checklist for Explanations. Pass if every item is satisfied or explicitly waived in prose (with reason).

When to Use Explanation vs Other Doc Types

Reader's QuestionDoc TypeFocus
"How do I do X?"How-To GuideSteps to accomplish a goal
"Teach me about X"TutorialLearning through guided doing
"What is the API for X?"ReferencePrecise technical details
"Why does X work this way?"ExplanationUnderstanding and context
"What are the trade-offs of X?"ExplanationDesign rationale
"How does X relate to Y?"ExplanationConceptual connections

For the full compass procedure and the other type distinctions, see docs-style/references/diataxis-compass.md.

Explanation Signals

Write an explanation when users:

  • Ask "why" questions
  • Need to make architectural decisions
  • Are evaluating whether something fits their use case
  • Want to understand design philosophy
  • Need context before diving into implementation

Not an Explanation

If users need to accomplish something while reading, it's not an explanation:

  • "How to configure caching" - How-To Guide
  • "Cache API reference" - Reference Doc
  • "Build a caching layer tutorial" - Tutorial
  • "How caching works and why we use LRU" - Explanation

Related Skills

よくある質問

AIスキル「Explanation Docs」では何ができますか?

Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do. Use when writing an explanation doc, conceptual guide, understanding/background doc, design rationale, or architecture explanation, or when asked how/why something works. Builds on the docs-style core writing principles.

TypingMindでExplanation Docsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Explanation Docsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにExplanation Docsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/existential-birds/beagle/tree/main/plugins/beagle-docs/skills/explanation-docsを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Explanation Docsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Explanation Docsは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもExplanation Docsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Explanation Docs」は無料ですか?

はい。existential-birdsがGitHubでApache-2.0ライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇