<!-- Generated from ja/how-to-create/index.html. The canonical document is the HTML page. -->

- [ ホーム ](/ja/) 
/
- 作成方法            
# `llms.txt` ファイルの作成方法

3つのテンプレート、チェックリスト、および一般的なスタックごとにコピー＆ペーストで実行できる導入手順。

最終更新: 2026年8月12日

このページの内容

- [ 1. 含める内容を計画する ](#plan)
- [ 2. 最小限のテンプレート ](#minimal)
- [ 3. 推奨テンプレート ](#recommended)
- [ 4. 高度なテンプレート ](#advanced)
- [ 5. 検証 ](#validate)
- [ 6. 使用環境にデプロイする ](#deploy)
- [ 7. ビルド時に自動生成する ](#auto)
- [ チェックリスト ](#checklist)            
## 1. 含める内容を計画する

何かを書く前に、 **5～20ページ** をサイト上から選びます。LLMがプロジェクトについての質問に答えるために必要となるページです。サイトマップではなく、厳選された推薦ページ一覧と考えてください。

最初に使いやすい分類:

- **製品**、概要、ユースケース、料金。 
- **ドキュメント**、入門、APIリファレンス、主要ガイド。 
- **統合**、パートナー、SDKをそれぞれ1行ずつ掲載します。 
- **リファレンス**、変更履歴、ステータスページ、セキュリティポリシー。 
- **任意**、ブランドアセット、プレス、アーカイブ。   
ページがLLMによる実際のユーザー質問への回答に役立たないなら、含めないでください。最大の
間違いはすべてを含めることで、シグナルが薄まります。

## 2. 最小限のテンプレート

H1見出しのみが必須要素です。以下のテンプレートでは、要約とリンクを追加することで、
ファイルの有用性を高めています。
llms.txt, minimal    コピー     

```
# {Site name}

> {One-sentence description of what your site is about.}

## Pages

- [{Page title}]({absolute URL}): {short note}

```

## 3. 推奨テンプレート

ほとんどのサイトにおいて、このテンプレートが適切な出発点となります：blockquoteによる要約、
背景説明の段落、そして3～4つのセクションです。
llms.txt, recommended    コピー     

```
# {Site name}

> {One- or two-sentence overview. Factual, no marketing claims.}

{Optional 1–3 sentences of context: what this site covers, who it's for, and how the file below is curated.}

## Product

- [Product overview]({URL}): high-level capabilities.
- [Pricing]({URL}): plans and limits.

## Documentation

- [Getting started]({URL}): install, first call, hello world.
- [API reference]({URL}): full endpoint catalog.
- [Guides]({URL}): tutorials and how-tos.

## Optional

- [Changelog]({URL}): version history.
- [Brand assets]({URL}): logos and color palette.

```

## 4. 高度なテンプレート

大規模なSaaSまたは開発者プラットフォームでは通常、専用の `Optional` セクション。これを出発点として使い、大胆に絞り込んでください。
llms.txt, advanced    コピー     

```
# Acme

> Acme is a hosted analytics platform for product teams. The pages below cover product, pricing, the API, and integration guides.

The map here is curated for assistants, it is not exhaustive. Use it to answer questions about product capabilities, pricing tiers, integrations, SDKs, and migration from other tools. For the full corpus, see /llms-full.txt.

## Product

- [Product overview](https://acme.example/product): high-level capabilities.
- [Use cases](https://acme.example/use-cases): scenarios for product, marketing, and support teams.
- [Changelog](https://acme.example/changelog): monthly product updates.

## Pricing

- [Pricing tiers](https://acme.example/pricing): plans, limits, overage rules.
- [Billing FAQ](https://acme.example/billing-faq): invoices, taxes, refunds.

## Developers

- [REST API reference](https://docs.acme.example/api): full endpoint catalog.
- [Webhooks](https://docs.acme.example/webhooks): events, signatures, retries.
- [SDK, JavaScript](https://docs.acme.example/sdk/js): install, init, track events.
- [SDK, Python](https://docs.acme.example/sdk/python): install, init, track events.

## Integrations

- [Segment](https://docs.acme.example/integrations/segment): two-way sync.
- [Snowflake](https://docs.acme.example/integrations/snowflake): nightly export.
- [HubSpot](https://docs.acme.example/integrations/hubspot): contacts and events.

## Optional

- [Brand assets](https://acme.example/brand): logos, color palette.
- [Press releases](https://acme.example/press): historical announcements.
- [Status page](https://status.acme.example): real-time service health.

```

例

Generator を使用する

テンプレートを使わずに始めたい場合は、
ジェネレーター :
フォームに入力して、クリーンなファイルをダウンロードしてください。

## 5. 検証

ファイルを貼り付ける先は [バリデーター](/ja/validator/) 仕様と一致していることを確認するため。これによって検出される一般的な
問題：H1タグの欠落、リンク構文の不正（`- [name](url)`）、相対
URL、セクション外のコンテンツ、誤って 2 つ目の H1 を置くこと、大きすぎるファイル。

## 6. 使用環境にデプロイする

### Cloudflare Pages
Cloudflare Pages    コピー     

```
# Cloudflare Pages
# Place llms.txt in the public/ root of your project. It will be served at /llms.txt.

# Verify after deploy:
curl -I https://your-domain.com/llms.txt

```

→ [Cloudflare Pages完全ガイド](/ja/llms-txt-cloudflare/)

### Vercel

`llms.txt` をプロジェクトの `public/` ディレクトリに置くと、Vercel は そのまま次の場所で提供します：
`/llms.txt`.

→ [Vercel 完全ガイド](/ja/llms-txt-vercel/)

### Netlify

同じ方法です。静的ディレクトリ（`public/`
Next.js または Astro については、 `static/` 、SvelteKitとHugoではstatic/）に配置します。Netlifyはそれを
`/llms.txt`.

→ [Netlify完全ガイド](/ja/llms-txt-netlify/)

### Next.js
Next.js    コピー     

```
// Next.js (App Router), public/llms.txt is served as-is.
// 1. Place the file at: public/llms.txt
// 2. No code change needed, it's served at https://yoursite.com/llms.txt

// If you prefer to generate it dynamically:
// app/llms.txt/route.ts
import { NextResponse } from 'next/server';

export async function GET() {
const body = `# Acme

> One-line summary.

## Docs

- [Getting started](https://acme.example/docs/getting-started)
`;

return new NextResponse(body, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' },
});
}

```

→ [Next.js 完全ガイド](/ja/llms-txt-nextjs/)

### Astro
Astro    コピー     

```
// Astro, public/llms.txt is served as-is.
// Drop the file at: public/llms.txt
// Astro will copy it to dist/llms.txt during `astro build`.

// To generate it from your content collections, create:
// src/pages/llms.txt.ts
import type { APIRoute } from 'astro';
import { getCollection } from 'astro:content';

export const GET: APIRoute = async () => {
const docs = await getCollection('docs');
const body = [
'# Acme',
'',
'> Hosted analytics for product teams.',
'',
'## Documentation',
'',
...docs.map((d) => `- [${d.data.title}](https://acme.example/${d.slug}/): ${d.data.summary}`),
].join('\\n');

return new Response(body, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } });
};

```

→ [完全な Astro ガイド](/ja/llms-txt-astro/)

### SvelteKit
SvelteKit    コピー     

```
// SvelteKit, static/llms.txt is served as-is.
// Drop the file at: static/llms.txt
// SvelteKit copies it to build/llms.txt during build.

// To generate it dynamically, create:
// src/routes/llms.txt/+server.ts
import type { RequestHandler } from './$types';

export const GET: RequestHandler = () => {
const body = `# Acme

> One-line summary.

## Docs

- [Getting started](https://acme.example/docs/getting-started)
`;

return new Response(body, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' },
});
};

```

→ [SvelteKit完全ガイド](/ja/llms-txt-sveltekit/)

### Hugo
Hugo    コピー     

```
# Hugo, place llms.txt in the static/ folder.
# It will be copied to public/llms.txt during hugo build.

# To generate it from content, create a custom output format.
# config.toml:
[outputs]
home = ["HTML", "RSS", "LLMSTXT"]

[outputFormats.LLMSTXT]
name = "LLMSTXT"
mediaType = "text/plain"
baseName = "llms"
isPlainText = true
notAlternative = true

# layouts/index.llmstxt:
# {{ "# " }}{{ .Site.Title }}
#
# > {{ .Site.Params.description }}
#
# ## Pages
#
# {{ range .Site.RegularPages }}- [{{ .Title }}]({{ .Permalink }}): {{ .Params.summary }}
# {{ end }}

```

→ [Hugo完全ガイド](/ja/llms-txt-hugo/)

### WordPress
WordPress    コピー     

```
# WordPress, three options
#
# 1. Easiest: upload llms.txt to your hosting (FTP/SFTP) at the web root.
#    Verify: https://yoursite.com/llms.txt
#
# 2. Plugin: any "static file uploader" plugin works. Place file at root.
#
# 3. Programmatic: add a small handler to your theme's functions.php
#    that intercepts the request and returns the file contents.
add_action('init', function () {
if (\$_SERVER['REQUEST_URI'] === '/llms.txt') {
header('Content-Type: text/plain; charset=utf-8');
echo file_get_contents(get_template_directory() . '/llms.txt');
exit;
}
});

```

→ [完全な WordPress ガイド](/ja/llms-txt-wordpress/)

### Express
Express    コピー     

```
// Express, serve llms.txt as a static file or dynamic route.

// Option 1: static file in public/
app.use(express.static('public')); // serves public/llms.txt at /llms.txt

// Option 2: dynamic route
app.get('/llms.txt', (req, res) => {
res.type('text/plain');
res.send(`# Acme

> One-line summary.

## Docs

- [Getting started](https://acme.example/docs/getting-started)
`);
});

```

→ [Express 完全ガイド](/ja/llms-txt-express/)

### Laravel
Laravel    コピー     

```
One-line summary.

## Docs

- [Getting started](https://acme.example/docs/getting-started)
EOT;

return response($content, 200)
->header('Content-Type', 'text/plain; charset=utf-8');
});

// Or use a controller:
// php artisan make:controller LlmsTxtController
// Then: Route::get('/llms.txt', [LlmsTxtController::class, 'show']);

```

→ [Laravel完全ガイド](/ja/llms-txt-laravel/)

### CMS（Contentful、Sanity、Strapi、Prismic）
CMS build script    コピー     

```
# CMS-driven llms.txt (Contentful, Sanity, Strapi, Prismic…)
#
# Pattern: fetch curated entries at build time, write llms.txt.
#
# Node.js example (runs in CI or as a build script):

import { createClient } from 'contentful';
import fs from 'fs/promises';

const client = createClient({
space: process.env.CONTENTFUL_SPACE_ID,
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
});

const entries = await client.getEntries({ content_type: 'doc', 'fields.featured': true });

const lines = [
'# Acme',
'',
'> Hosted analytics for product teams.',
'',
'## Documentation',
'',
...entries.items.map(
(e) => `- [${e.fields.title}](https://acme.example/${e.fields.slug}/): ${e.fields.summary}`
),
];

await fs.writeFile('public/llms.txt', lines.join('\n'));
console.log(`Wrote ${entries.items.length} entries to llms.txt`);

```

→ [完全版CMSガイド](/ja/llms-txt-cms/)

### その他のプラットフォームガイド

その他の一般的なスタックやビルダー向けのステップ別ガイド：

- [Angular](/ja/llms-txt-angular/), [Vue (Vite)](/ja/llms-txt-vue/), [Nuxt](/ja/llms-txt-nuxt/), [Remix](/ja/llms-txt-remix/), [Gatsby](/ja/llms-txt-gatsby/) 
- [Docusaurus](/ja/llms-txt-docusaurus/), [MkDocs](/ja/llms-txt-mkdocs/), [Jekyll](/ja/llms-txt-jekyll/), [Eleventy](/ja/llms-txt-eleventy/), [GitHub Pages](/ja/llms-txt-github-pages/) 
- [Ruby on Rails](/ja/llms-txt-rails/), [Django](/ja/llms-txt-django/), [Laravel](/ja/llms-txt-laravel/), [Express](/ja/llms-txt-express/) 
- ノーコード: [Framer](/ja/llms-txt-framer/), [Webflow](/ja/llms-txt-webflow/), [Wix](/ja/llms-txt-wix/), [Squarespace](/ja/llms-txt-squarespace/), [Ghost](/ja/llms-txt-ghost/), [Shopify](/ja/llms-txt-shopify/)   
### その他のスタック

静的な `nginx`、ファイルをウェブルートへコピーします。ルールは共通です。次の正規パスでファイルを配信します： `/llms.txt`
を付けて `Content-Type: text/plain; charset=utf-8`.

## 7. ビルド時に自動生成する

小規模サイトなら手動での保守でも問題ありませんが、すぐに限界が生じます。一般的なパターンは2つあります。

- **ビルドスクリプト**では、コンテンツコレクション（Markdown、MDX、CMS）を反復処理して `llms.txt` に `dist/`。上記のアストロおよびCMSの例。 
- **サーバールート**では、データベースまたはCMSからオンデマンドでファイルをレンダリングします。Next.js、
SvelteKit、Express、Laravelの例は上記のとおりです。   
どちらを選んでも、CIで [バリデーター](/ja/validator/) CI で実行します。これにより、コンテンツ移行後に空のセクションが残るなど、気付かれにくい壊れたファイルを検出できます。

## 公開前のチェックリスト

- ファイルの配信先： `/llms.txt` で `200 OK`. 
- `Content-Type: text/plain; charset=utf-8`. 
- H1が正確に1つ。 
- プレーンな言葉による引用要約で、マーケティングの美辞麗句は使わない. 
- すべての URL は **絶対URL** (`https://...`). 
- 各セクションに少なくとも1項目あること。 
- 非公開または認証が必要なURLは記載されていない。 
- バリデーターがエラーを返さないこと。 
- 公開するコーパスがある場合は、併せて公開してください [`/llms-full.txt`](/ja/llms-full-txt/). 
- `robots.txt` がファイルのクロールを引き続き許可していること（ `Disallow: /llms.txt`).   
## 次へ

- [ベストプラクティス](/ja/best-practices/)、続けるべきこと、避けるべきこと。 
- [llms.txt と SEO](/ja/llms-txt-seo/)、AIによる引用、GEOシグナル、順位。 
- [llms-full.txt](/ja/llms-full-txt/)、コンテンツコーパス全体を公開します。 
- [実際の例](/ja/examples/)、うまくいく方法を取り入れます。 
- [バリデータ](/ja/validator/) · [ジェネレーター](/ja/generator/).        
## ソース

- [ llmstxt.org、コミュニティによる提案 ](https://llmstxt.org/)
- [ Mintlify：llms.txtでドキュメントを簡素化 ](https://www.mintlify.com/blog/simplifying-docs-with-llms-txt)
