open-swe
LangChainのOpen SWEフレームワークを活用し、計画、コーディング、テスト、改善を繰り返す非同期型のソフトウェア開発エージェントを構築し、コーディングボットや課題解決の自動化、リポジトリで非同期に作業するSWEエージェントを作成するSkill。
📜 元の英語説明(参考)
Build asynchronous coding agents using LangChain's Open SWE framework — agents that plan, code, test, and iterate on software engineering tasks. Use when: building coding bots, automating issue resolution, creating SWE agents that work on repos asynchronously.
🇯🇵 日本人クリエイター向け解説
LangChainのOpen SWEフレームワークを活用し、計画、コーディング、テスト、改善を繰り返す非同期型のソフトウェア開発エージェントを構築し、コーディングボットや課題解決の自動化、リポジトリで非同期に作業するSWEエージェントを作成するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o open-swe.zip https://jpskill.com/download/15199.zip && unzip -o open-swe.zip && rm open-swe.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15199.zip -OutFile "$d\open-swe.zip"; Expand-Archive "$d\open-swe.zip" -DestinationPath $d -Force; ri "$d\open-swe.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
open-swe.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
open-sweフォルダができる - 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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Open SWE
概要
Open SWE (LangChain 製) は、自律的に計画、コーディング、テスト、プルリクエストの送信を行える非同期ソフトウェアエンジニアリングエージェントを構築するためのオープンソースフレームワークです。同期型のコーディングアシスタントとは異なり、Open SWE エージェントはバックグラウンドで動作します。GitHub の issue を取得し、数分から数時間かけて作業し、レビュー可能な PR を提供します。
GitHub Issue (ラベル "ai-fix")
↓ webhook
Open SWE Agent
├── Planner: issue の分析、コードベースの調査、計画の作成
├── Coder: 計画に従って変更を実装
├── Tester: テストの実行、失敗の修正
└── Reviewer: PR 前の自己レビュー
↓
説明とテスト結果を含むプルリクエスト
手順
ユーザーが非同期コーディングエージェントの構築、issue 解決の自動化、または SWE ボットの作成を依頼した場合:
- Open SWE をインストール —
pip install open-swe langgraph langchain-anthropic - エージェントを構成 — LLM、リポジトリパス、およびツールを使用して
SWEAgentをインスタンス化 - GitHub に接続 —
GitHubIntegrationを使用して、ラベル付きの issue をリッスン - 複雑なタスクを分解 — 複数ステップの issue には
TaskPlannerを使用 - テストループを有効化 — エージェントがテストに合格するまで反復するように
run_tests=Trueを設定
基本的なエージェントのセットアップ
from open_swe import SWEAgent
from langchain_anthropic import ChatAnthropic
llm = ChatAnthropic(model="claude-sonnet-4-20250514")
agent = SWEAgent(llm=llm, repo_path="/path/to/repo", tools=["bash", "file_editor", "search"])
result = await agent.solve(
issue="Fix the login timeout bug - sessions expire after 5 minutes instead of 30",
)
print(result.patch) # unified diff
print(result.explanation) # 変更内容とその理由
GitHub 連携
from open_swe.integrations import GitHubIntegration
github = GitHubIntegration(token=os.environ["GITHUB_TOKEN"], repo="owner/repo")
@github.on_issue(labels=["ai-fix"])
async def handle_issue(issue):
agent = SWEAgent(llm=llm, repo_path=github.clone())
result = await agent.solve(issue=issue.body)
if result.success:
pr = await github.create_pr(
title=f"Fix: {issue.title}",
body=f"Resolves #{issue.number}\n\n{result.explanation}",
branch=f"ai-fix/{issue.number}",
patch=result.patch,
)
await issue.comment(f"PR created: {pr.url}")
else:
await issue.comment(f"Could not resolve automatically:\n{result.error}")
例
例 1:複雑な機能をサブタスクに分解する
from open_swe.planner import TaskPlanner
planner = TaskPlanner(llm=llm)
tasks = await planner.decompose(
issue="Add user avatar upload with S3 storage and image resizing",
codebase_context=agent.explore_codebase(),
)
# Returns: [
# "Add S3 upload utility in lib/storage.ts",
# "Create avatar resize middleware using sharp",
# "Add PUT /api/users/:id/avatar endpoint",
# "Write tests for upload and resize",
# "Update user profile component to show avatar",
# ]
for task in tasks:
result = await agent.solve(issue=task)
agent.apply_patch(result.patch)
例 2:テストループを使用して複数の issue を並行して処理する
import asyncio
from open_swe import SWEAgent
async def process_issues(issues: list[str]):
tasks = []
for issue in issues:
agent = SWEAgent(llm=llm, repo_path=clone_repo())
tasks.append(agent.solve(issue=issue, max_iterations=5, run_tests=True, test_command="pytest"))
return await asyncio.gather(*tasks)
results = asyncio.run(process_issues([
"Fix SQL injection in search endpoint",
"Add rate limiting to API",
"Update deprecated dependencies",
"Add input validation to signup form",
"Fix timezone bug in event scheduler",
]))
for r in results:
for i, attempt in enumerate(r.iterations):
print(f"Attempt {i+1}: {'PASS' if attempt.tests_passed else 'FAIL'}")
ガイドライン
- 最初に調査 — エージェントはコーディング前に、関連するファイルを読み込む必要があります。
- コーディング前に計画 — 実装計画を作成し、大規模な変更については承認を得ます。
- 変更後にテスト — 回帰を早期に検出するために、変更を加えるたびにテストを実行します。
- 自己レビュー — PR を送信する前に、自分のコードに問題がないか確認します。
- 段階的 — ファイルごとに変更を適用し、各ステップ間でテストを行います。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Open SWE
Overview
Open SWE (by LangChain) is an open-source framework for building asynchronous software engineering agents that can autonomously plan, code, test, and submit pull requests. Unlike synchronous coding assistants, Open SWE agents work in the background — pick up a GitHub issue, work on it for minutes to hours, and deliver a ready-to-review PR.
GitHub Issue (labeled "ai-fix")
↓ webhook
Open SWE Agent
├── Planner: analyze issue, explore codebase, create plan
├── Coder: implement changes following plan
├── Tester: run tests, fix failures
└── Reviewer: self-review before PR
↓
Pull Request with description + test results
Instructions
When a user asks to build an async coding agent, automate issue resolution, or create SWE bots:
- Install Open SWE —
pip install open-swe langgraph langchain-anthropic - Configure the agent — Instantiate
SWEAgentwith an LLM, repo path, and tools - Connect to GitHub — Use
GitHubIntegrationto listen for labeled issues - Decompose complex tasks — Use
TaskPlannerfor multi-step issues - Enable test loops — Set
run_tests=Trueso the agent iterates until tests pass
Basic Agent Setup
from open_swe import SWEAgent
from langchain_anthropic import ChatAnthropic
llm = ChatAnthropic(model="claude-sonnet-4-20250514")
agent = SWEAgent(llm=llm, repo_path="/path/to/repo", tools=["bash", "file_editor", "search"])
result = await agent.solve(
issue="Fix the login timeout bug - sessions expire after 5 minutes instead of 30",
)
print(result.patch) # unified diff
print(result.explanation) # what was changed and why
GitHub Integration
from open_swe.integrations import GitHubIntegration
github = GitHubIntegration(token=os.environ["GITHUB_TOKEN"], repo="owner/repo")
@github.on_issue(labels=["ai-fix"])
async def handle_issue(issue):
agent = SWEAgent(llm=llm, repo_path=github.clone())
result = await agent.solve(issue=issue.body)
if result.success:
pr = await github.create_pr(
title=f"Fix: {issue.title}",
body=f"Resolves #{issue.number}\n\n{result.explanation}",
branch=f"ai-fix/{issue.number}",
patch=result.patch,
)
await issue.comment(f"PR created: {pr.url}")
else:
await issue.comment(f"Could not resolve automatically:\n{result.error}")
Examples
Example 1: Decompose a Complex Feature into Subtasks
from open_swe.planner import TaskPlanner
planner = TaskPlanner(llm=llm)
tasks = await planner.decompose(
issue="Add user avatar upload with S3 storage and image resizing",
codebase_context=agent.explore_codebase(),
)
# Returns: [
# "Add S3 upload utility in lib/storage.ts",
# "Create avatar resize middleware using sharp",
# "Add PUT /api/users/:id/avatar endpoint",
# "Write tests for upload and resize",
# "Update user profile component to show avatar",
# ]
for task in tasks:
result = await agent.solve(issue=task)
agent.apply_patch(result.patch)
Example 2: Process Multiple Issues in Parallel with Test Loops
import asyncio
from open_swe import SWEAgent
async def process_issues(issues: list[str]):
tasks = []
for issue in issues:
agent = SWEAgent(llm=llm, repo_path=clone_repo())
tasks.append(agent.solve(issue=issue, max_iterations=5, run_tests=True, test_command="pytest"))
return await asyncio.gather(*tasks)
results = asyncio.run(process_issues([
"Fix SQL injection in search endpoint",
"Add rate limiting to API",
"Update deprecated dependencies",
"Add input validation to signup form",
"Fix timezone bug in event scheduler",
]))
for r in results:
for i, attempt in enumerate(r.iterations):
print(f"Attempt {i+1}: {'PASS' if attempt.tests_passed else 'FAIL'}")
Guidelines
- Explore first — The agent should read relevant files before coding
- Plan before code — Create an implementation plan, get approval for large changes
- Test after change — Run tests after every modification to catch regressions early
- Self-review — Check own code for issues before submitting a PR
- Incremental — Apply changes file by file, testing between each step