jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ Stitch Loop

stitch-loop

Stitchというツールを使い、AIがウェブ

⏱ 障害ポストモーテム 1日 → 1時間

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Teaches agents to iteratively build websites using Stitch with an autonomous baton-passing loop pattern

🇯🇵 日本人クリエイター向け解説

一言でいうと

Stitchというツールを使い、AIがウェブ

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o stitch-loop.zip https://jpskill.com/download/3546.zip && unzip -o stitch-loop.zip && rm stitch-loop.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/3546.zip -OutFile "$d\stitch-loop.zip"; Expand-Archive "$d\stitch-loop.zip" -DestinationPath $d -Force; ri "$d\stitch-loop.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して stitch-loop.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → stitch-loop フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Stitch Loop を使って、最小構成のサンプルコードを示して
  • Stitch Loop の主な使い方と注意点を教えて
  • Stitch Loop を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] stitch-loop

Stitch ビルドループ

あなたは、反復的なサイト構築ループに参加する自律的なフロントエンドビルダーです。あなたの目標は、Stitch を使用してページを生成し、それをサイトに統合し、次のイテレーションのための指示を準備することです。

使用する状況

  • あなたは、実行またはエージェント間でバトンベースのループを使用して、Stitch でウェブサイトを反復的に構築しています。
  • 各パスは、次のプロンプトを読み取り、ページを生成または統合し、次のタスクを引き渡す必要があります。
  • 複数ステップのフロントエンドサイト構築のために、規律ある自律的なループが必要です。

概要

ビルドループパターンは、「バトン」システムを通じて、継続的で自律的なウェブサイト開発を可能にします。各イテレーションでは、以下のことを行います。

  1. バトンファイル(.stitch/next-prompt.md)から現在のタスクを読み取ります。
  2. Stitch MCP ツールを使用してページを生成します。
  3. ページをサイト構造に統合します。
  4. 次のイテレーションのために、バトンファイルに次のタスクを書き込みます。

前提条件

必須:

  • Stitch MCP Server へのアクセス
  • Stitch プロジェクト(既存または新規作成)
  • .stitch/DESIGN.md ファイル(必要に応じて design-md スキルを使用して生成)
  • サイトのビジョンとロードマップを文書化した .stitch/SITE.md ファイル

オプション:

  • Chrome DevTools MCP Server — 生成されたページの視覚的な検証を可能にします。

バトンシステム

.stitch/next-prompt.md ファイルは、イテレーション間のリレーバトンとして機能します。

---
page: about
---
A page describing how jules.top tracking works.

**DESIGN SYSTEM (REQUIRED):**
[Copy from .stitch/DESIGN.md Section 6]

**Page Structure:**
1. Header with navigation
2. Explanation of tracking methodology
3. Footer with links

重要なルール:

  • YAML フロントマターの page フィールドが出力ファイル名を決定します。
  • プロンプトの内容には、.stitch/DESIGN.md からのデザインシステムブロックを含める必要があります。
  • ループを継続するために、作業を完了する前にこのファイルを更新する必要があります

実行プロトコル

ステップ 1: バトンを読み取る

.stitch/next-prompt.md を解析して、以下を抽出します。

  • page フロントマターフィールドからのページ名
  • Markdown ボディからのプロンプトコンテンツ

ステップ 2: コンテキストファイルを参照する

生成する前に、これらのファイルを読み取ります。

ファイル 目的
.stitch/SITE.md サイトのビジョン、Stitch プロジェクト ID、既存のページ(サイトマップ)、ロードマップ
.stitch/DESIGN.md Stitch プロンプトに必要なビジュアルスタイル

重要な確認事項:

  • セクション 4(サイトマップ)— 既に存在するページを再作成しないでください。
  • セクション 5(ロードマップ)— バックログがある場合は、ここからタスクを選択してください。
  • セクション 6(クリエイティブな自由)— ロードマップが空の場合の新しいページのアイデア。

ステップ 3: Stitch で生成する

Stitch MCP ツールを使用してページを生成します。

  1. 名前空間の発見: list_tools を実行して Stitch MCP プレフィックスを見つけます。
  2. プロジェクトの取得または作成:
    • .stitch/metadata.json が存在する場合は、そこから projectId を使用します。
    • それ以外の場合は、[prefix]:create_project を呼び出し、次に [prefix]:get_project を呼び出して完全なプロジェクト詳細を取得し、.stitch/metadata.json に保存します(以下のスキーマを参照)。
    • 各画面を生成した後、再度 [prefix]:get_project を呼び出し、各画面の完全なメタデータ(id、sourceScreen、dimensions、canvas position)で .stitch/metadata.jsonscreens マップを更新します。
  3. 画面の生成: [prefix]:generate_screen_from_text を呼び出します。
    • projectId: プロジェクト ID
    • prompt: バトンからの完全なプロンプト(デザインシステムブロックを含む)
    • deviceType: DESKTOP(または指定されたもの)
  4. アセットの取得: ダウンロードする前に、.stitch/designs/{page}.html.stitch/designs/{page}.png が既に存在するかどうかを確認します。
    • ファイルが存在する場合: ユーザーに、Stitch プロジェクトからデザインを更新するか、既存のローカルファイルを再利用するかを尋ねます。ユーザーが確認した場合のみ再ダウンロードします。
    • ファイルが存在しない場合: ダウンロードに進みます。
      • htmlCode.downloadUrl — ダウンロードして .stitch/designs/{page}.html として保存します。
      • screenshot.downloadUrl — ダウンロードする前に URL に =w{width} を追加します。ここで {width} は画面メタデータからの width 値です(Google CDN はデフォルトで低解像度のサムネイルを提供します)。.stitch/designs/{page}.png として保存します。

ステップ 4: サイトに統合する

  1. 生成された HTML を .stitch/designs/{page}.html から site/public/{page}.html に移動します。
  2. アセットパスをパブリックフォルダからの相対パスに修正します。
  3. ナビゲーションを更新します。
    • 既存のプレースホルダーリンク(例: href="#")を見つけて、新しいページに接続します。
    • 必要に応じて、新しいページをグローバルナビゲーションに追加します。
  4. すべてのページで一貫したヘッダー/フッターを確保します。

ステップ 4.5: 視覚的な検証(オプション)

Chrome DevTools MCP Server が利用可能な場合は、生成されたページを検証します。

  1. 利用可能性の確認: list_tools を実行して chrome* ツールが存在するかどうかを確認します。
  2. 開発サーバーの起動: Bash を使用してローカルサーバーを起動します(例: npx serve site/public)。
  3. ページへの移動: [chrome_prefix]:navigate を呼び出して http://localhost:3000/{page}.html を開きます。
  4. スクリーンショットのキャプチャ: [chrome_prefix]:screenshot を呼び出してレンダリングされたページをキャプチャします。
  5. 視覚的な比較: Stitch のスクリーンショット(.stitch/designs/{page}.png)と比較して忠実度を確認します。
  6. サーバーの停止: 開発サーバープロセスを終了します。

注: このステップはオプションです。Chrome DevTools MCP がインストールされていない場合は、ステップ 5 に進みます。

ステップ 5: サイトドキュメントを更新する

.stitch/SITE.md を変更します。

  • セクション 4(サイトマップ)に新しいページを [x] とともに追加します。
  • セクション 6(クリエイティブな自由)から使用したアイデアを削除します。
  • バックログ項目を完了した場合は、セクション 5(ロードマップ)を更新します。

ステップ 6: 次のバトンを準備する(重要)

完了する前に .stitch/next-prompt.md を更新する必要があります。これにより、ループが継続されます。

  1. 次のページを決定する:
    • .stitch/SITE.md のセクション 5(ロードマップ)で保留中の項目を確認します。
    • 空の場合は、セクション 6(クリエイティブな自由)から選択します。
    • または、サイトのビジョンに合う新しいものを考案します。
  2. 適切な YAML フロントマターでバトンを記述する:
---
page: achievements
---
A competitive achievements page showing developer badges and milestones.

**DESIG
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Stitch Build Loop

You are an autonomous frontend builder participating in an iterative site-building loop. Your goal is to generate a page using Stitch, integrate it into the site, and prepare instructions for the next iteration.

When to Use

  • You are iteratively building a website with Stitch using a baton-based loop across runs or agents.
  • Each pass should read the next prompt, generate or integrate a page, and hand off the next task.
  • You need a disciplined autonomous loop for multi-step frontend site construction.

Overview

The Build Loop pattern enables continuous, autonomous website development through a "baton" system. Each iteration:

  1. Reads the current task from a baton file (.stitch/next-prompt.md)
  2. Generates a page using Stitch MCP tools
  3. Integrates the page into the site structure
  4. Writes the next task to the baton file for the next iteration

Prerequisites

Required:

  • Access to the Stitch MCP Server
  • A Stitch project (existing or will be created)
  • A .stitch/DESIGN.md file (generate one using the design-md skill if needed)
  • A .stitch/SITE.md file documenting the site vision and roadmap

Optional:

  • Chrome DevTools MCP Server — enables visual verification of generated pages

The Baton System

The .stitch/next-prompt.md file acts as a relay baton between iterations:

---
page: about
---
A page describing how jules.top tracking works.

**DESIGN SYSTEM (REQUIRED):**
[Copy from .stitch/DESIGN.md Section 6]

**Page Structure:**
1. Header with navigation
2. Explanation of tracking methodology
3. Footer with links

Critical rules:

  • The page field in YAML frontmatter determines the output filename
  • The prompt content must include the design system block from .stitch/DESIGN.md
  • You MUST update this file before completing your work to continue the loop

Execution Protocol

Step 1: Read the Baton

Parse .stitch/next-prompt.md to extract:

  • Page name from the page frontmatter field
  • Prompt content from the markdown body

Step 2: Consult Context Files

Before generating, read these files:

File Purpose
.stitch/SITE.md Site vision, Stitch Project ID, existing pages (sitemap), roadmap
.stitch/DESIGN.md Required visual style for Stitch prompts

Important checks:

  • Section 4 (Sitemap) — Do NOT recreate pages that already exist
  • Section 5 (Roadmap) — Pick tasks from here if backlog exists
  • Section 6 (Creative Freedom) — Ideas for new pages if roadmap is empty

Step 3: Generate with Stitch

Use the Stitch MCP tools to generate the page:

  1. Discover namespace: Run list_tools to find the Stitch MCP prefix
  2. Get or create project:
    • If .stitch/metadata.json exists, use the projectId from it
    • Otherwise, call [prefix]:create_project, then call [prefix]:get_project to retrieve full project details, and save them to .stitch/metadata.json (see schema below)
    • After generating each screen, call [prefix]:get_project again and update the screens map in .stitch/metadata.json with each screen's full metadata (id, sourceScreen, dimensions, canvas position)
  3. Generate screen: Call [prefix]:generate_screen_from_text with:
    • projectId: The project ID
    • prompt: The full prompt from the baton (including design system block)
    • deviceType: DESKTOP (or as specified)
  4. Retrieve assets: Before downloading, check if .stitch/designs/{page}.html and .stitch/designs/{page}.png already exist:
    • If files exist: Ask the user whether to refresh the designs from the Stitch project or reuse the existing local files. Only re-download if the user confirms.
    • If files do not exist: Proceed with download:
      • htmlCode.downloadUrl — Download and save as .stitch/designs/{page}.html
      • screenshot.downloadUrl — Append =w{width} to the URL before downloading, where {width} is the width value from the screen metadata (Google CDN serves low-res thumbnails by default). Save as .stitch/designs/{page}.png

Step 4: Integrate into Site

  1. Move generated HTML from .stitch/designs/{page}.html to site/public/{page}.html
  2. Fix any asset paths to be relative to the public folder
  3. Update navigation:
    • Find existing placeholder links (e.g., href="#") and wire them to the new page
    • Add the new page to the global navigation if appropriate
  4. Ensure consistent headers/footers across all pages

Step 4.5: Visual Verification (Optional)

If the Chrome DevTools MCP Server is available, verify the generated page:

  1. Check availability: Run list_tools to see if chrome* tools are present
  2. Start dev server: Use Bash to start a local server (e.g., npx serve site/public)
  3. Navigate to page: Call [chrome_prefix]:navigate to open http://localhost:3000/{page}.html
  4. Capture screenshot: Call [chrome_prefix]:screenshot to capture the rendered page
  5. Visual comparison: Compare against the Stitch screenshot (.stitch/designs/{page}.png) for fidelity
  6. Stop server: Terminate the dev server process

Note: This step is optional. If Chrome DevTools MCP is not installed, skip to Step 5.

Step 5: Update Site Documentation

Modify .stitch/SITE.md:

  • Add the new page to Section 4 (Sitemap) with [x]
  • Remove any idea you consumed from Section 6 (Creative Freedom)
  • Update Section 5 (Roadmap) if you completed a backlog item

Step 6: Prepare the Next Baton (Critical)

You MUST update .stitch/next-prompt.md before completing. This keeps the loop alive.

  1. Decide the next page:
    • Check .stitch/SITE.md Section 5 (Roadmap) for pending items
    • If empty, pick from Section 6 (Creative Freedom)
    • Or invent something new that fits the site vision
  2. Write the baton with proper YAML frontmatter:
---
page: achievements
---
A competitive achievements page showing developer badges and milestones.

**DESIGN SYSTEM (REQUIRED):**
[Copy the entire design system block from .stitch/DESIGN.md]

**Page Structure:**
1. Header with title and navigation
2. Badge grid showing unlocked/locked states
3. Progress bars for milestone tracking

File Structure Reference

project/
├── .stitch/
│   ├── metadata.json   # Stitch project & screen IDs (persist this!)
│   ├── DESIGN.md       # Visual design system (from design-md skill)
│   ├── SITE.md         # Site vision, sitemap, roadmap
│   ├── next-prompt.md  # The baton — current task
│   └── designs/        # Staging area for Stitch output
│       ├── {page}.html
│       └── {page}.png
└── site/public/        # Production pages
    ├── index.html
    └── {page}.html

.stitch/metadata.json Schema

This file persists all Stitch identifiers so future iterations can reference them for edits or variants. Populate it by calling [prefix]:get_project after creating a project or generating screens.

{
  "name": "projects/6139132077804554844",
  "projectId": "6139132077804554844",
  "title": "My App",
  "visibility": "PRIVATE",
  "createTime": "2026-03-04T23:11:25.514932Z",
  "updateTime": "2026-03-04T23:34:40.400007Z",
  "projectType": "PROJECT_DESIGN",
  "origin": "STITCH",
  "deviceType": "MOBILE",
  "designTheme": {
    "colorMode": "DARK",
    "font": "INTER",
    "roundness": "ROUND_EIGHT",
    "customColor": "#40baf7",
    "saturation": 3
  },
  "screens": {
    "index": {
      "id": "d7237c7d78f44befa4f60afb17c818c1",
      "sourceScreen": "projects/6139132077804554844/screens/d7237c7d78f44befa4f60afb17c818c1",
      "x": 0,
      "y": 0,
      "width": 390,
      "height": 1249
    },
    "about": {
      "id": "bf6a3fe5c75348e58cf21fc7a9ddeafb",
      "sourceScreen": "projects/6139132077804554844/screens/bf6a3fe5c75348e58cf21fc7a9ddeafb",
      "x": 549,
      "y": 0,
      "width": 390,
      "height": 1159
    }
  },
  "metadata": {
    "userRole": "OWNER"
  }
}
Field Description
name Full resource name (projects/{id})
projectId Stitch project ID (from create_project or get_project)
title Human-readable project title
designTheme Design system tokens: color mode, font, roundness, custom color, saturation
deviceType Target device: MOBILE, DESKTOP, TABLET
screens Map of page name → screen object. Each screen includes id, sourceScreen (resource path for MCP calls), canvas position (x, y), and dimensions (width, height)
metadata.userRole User's role on the project (OWNER, EDITOR, VIEWER)

Orchestration Options

The loop can be driven by different orchestration layers:

Method How it works
CI/CD GitHub Actions triggers on .stitch/next-prompt.md changes
Human-in-loop Developer reviews each iteration before continuing
Agent chains One agent dispatches to another (e.g., Jules API)
Manual Developer runs the agent repeatedly with the same repo

The skill is orchestration-agnostic — focus on the pattern, not the trigger mechanism.

Design System Integration

This skill works best with the design-md skill:

  1. First time setup: Generate .stitch/DESIGN.md using the design-md skill from an existing Stitch screen
  2. Every iteration: Copy Section 6 ("Design System Notes for Stitch Generation") into your baton prompt
  3. Consistency: All generated pages will share the same visual language

Common Pitfalls

  • ❌ Forgetting to update .stitch/next-prompt.md (breaks the loop)
  • ❌ Recreating a page that already exists in the sitemap
  • ❌ Not including the design system block from .stitch/DESIGN.md in the prompt
  • ❌ Leaving placeholder links (href="#") instead of wiring real navigation
  • ❌ Forgetting to persist .stitch/metadata.json after creating a new project

Troubleshooting

Issue Solution
Stitch generation fails Check that the prompt includes the design system block
Inconsistent styles Ensure .stitch/DESIGN.md is up-to-date and copied correctly
Loop stalls Verify .stitch/next-prompt.md was updated with valid frontmatter
Navigation broken Check all internal links use correct relative paths

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.