claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialdevelopment

🏗️new-app

プラグイン
atomic-agents

説明

新しい Atomic Agents プロジェクトをゼロから構築します —— ディレクトリ、`pyproject.toml`、env ファイル、最初の agent、および実行可能なエントリーポイントを作成します。 次のような場合に使用: ユーザーが新しい atomic-agents プロジェクトをゼロから始めたいと依頼したとき、「scaffold」「new project」「start from zero」といった表現を使ったとき、または `/atomic-agents:new-app` を実行したとき。

原文を表示

Scaffold a new Atomic Agents project from scratch — create the directory, `pyproject.toml`, env file, first agent, and a runnable entry point. Use when the user asks to start a new atomic-agents project from scratch, says "scaffold" / "new project" / "start from zero", or runs `/atomic-agents:new-app`.

ユースケース

  • 新しいAtomic Agentsプロジェクトをゼロから始めるとき
  • プロジェクトのスカフォルディングが必要なとき
  • 初期ディレクトリ構造を作成するとき

本文(日本語訳)

新規 Atomic Agents プロジェクト

Atomic Agents の新規プロジェクトを雛形から生成します。 成果物は、単一パッケージ構成の Python プロジェクトで、動作する Agent・スキーマペア・プロバイダーラップ済みクライアント・実行可能な main.py が含まれます。

このスキルは方針が明確に定められています。ユーザーがすぐに実行できる、完全にテスト済みのスケルトンを生成してください。


フェーズ 1 — 情報収集

以下の質問を 1 回のメッセージでまとめて 送信してください。1 問ずつ送ってはいけません。 ユーザーがすでに回答済みの項目($ARGUMENTS 経由を含む)はスキップしてください。

  1. プロジェクト名 — ディレクトリ名とパッケージ名の両方に使用します。 $ARGUMENTS が指定されている場合はそれをデフォルト値とします。 ディレクトリ名は kebab-case、パッケージ名は snake_case に正規化してください。
  2. LLM プロバイダー — OpenAI / Anthropic / Groq / Ollama / Gemini / OpenRouter / MiniMax から選択。 デフォルト: OpenAI。
  3. Agent の種別 — 一言程度の概要。SystemPromptGenerator の初期コンテンツおよびスキーマペアの初期値に反映されます。 デフォルト: 汎用チャット Agent。
  4. ツール選択uv(デフォルト。リポジトリが uv を使用しているため)または pip + venv

プロジェクトレイアウト・Python バージョン・依存ライブラリの一覧については質問しないでください。こちらで選定します。


フェーズ 2 — 計画の確認

以下の内容を 1 つの短いブロック にまとめて提示し、ユーザーの承諾を待ってください。

  • ディレクトリ: <project-name>/
  • パッケージ: <project_name>/
  • Python: >=3.12(Atomic Agents は PEP 695 ジェネリクスを使用)
  • 依存ライブラリ: atomic-agents>=2.7instructor[<provider-extra>]>=1.14python-dotenvrich
  • 開発用依存ライブラリ: pytestpytest-asyncioruff
  • 初期 Agent: <agent-type> — Agent の種別に応じたカスタムスキーマが不要な場合は BasicChatInputSchema / BasicChatOutputSchema を使用
  • 選択したプロバイダーのデフォルトモデル(framework/references/providers.md を参照)
  • エントリポイント: REPL を備えた main.py

フェーズ 3 — スキャフォールド生成

以下の順序でファイルを作成してください。各ステップを確認してから次へ進んでください。

ディレクトリ構成とパッケージ

<project-name>/
├── pyproject.toml
├── .env.example
├── .gitignore
├── README.md
└── <project_name>/
    ├── __init__.py
    └── main.py

pyproject.toml

framework/references/project-structure.md のテンプレートを使用し、選択したプロバイダーの extra およびプロジェクト名を代入してください。

.env.example

プロバイダーの API キー変数をプレースホルダー付きで記載してください。実際のキーは絶対に含めないこと。

.gitignore

framework/references/project-structure.md のテンプレートを使用してください。

<project_name>/main.py

実行可能な REPL を生成してください。 .env をロードし、framework/references/providers.md に従ってプロバイダークライアントをインスタンス化し、Agent を構築し、シードとなるアシスタントメッセージを持つ ChatHistory を接続して、console.input(...) のループを実装してください。

Agent 本体については、atomic-agents:create-atomic-agent スキルのワークフローに従ってください。 同一の正規 import・プロバイダーごとの mode マトリクス・SystemPromptGenerator の形式を使用してください。

カスタム Agent 種別が指定された場合は、atomic-agents:create-atomic-schema スキルに従い、fielddescription= を付与したカスタム InputSchema / OutputSchema サブクラスを作成してください。 それ以外の場合は BasicChatInputSchema / BasicChatOutputSchema を使用してください。

正規 import は必ず以下を使用すること:

from atomic_agents import (
    AtomicAgent, AgentConfig,
    BasicChatInputSchema, BasicChatOutputSchema,
)
from atomic_agents.context import ChatHistory, SystemPromptGenerator
from instructor import Mode

プロバイダーごとの AgentConfig 設定 — Instructor ファクトリーの mode と AgentConfig.mode を一致させること:

  • OpenAI: デフォルト設定で動作します。mode は省略(または Mode.TOOLS を設定)。
  • Anthropic: mode=Mode.TOOLSmodel_api_parametersmax_tokens を含めること。
  • Groq / Ollama / MiniMax: mode=Mode.JSON(Instructor ファクトリーも Mode.JSON を使用)。
  • Gemini: assistant_role="model" および mode=Mode.GENAI_TOOLS(Instructor ファクトリーは Mode.GENAI_TOOLS を使用)。
  • OpenRouter: mode=Mode.TOOLS

README.md

簡潔に記載してください。以下の内容を含めること: プロジェクトの概要・インストール方法(uv sync または pip install -e .[dev])・API キーの設定方法(cp .env.example .env して編集)・実行方法(uv run python -m <project_name>.main 等)。


フェーズ 4 — インストールと動作確認

インストール手順を実行してください:

  • uv: uv sync
  • pip: python -m venv .venv && .venv/bin/pip install -e ".[dev]" (Windows の場合: .venv\Scripts\pip

有効な API キーなしで import を検証してください:

uv run python -c "from <project_name>.main import agent; print('ok')"

これが成功すれば、スキャフォールドは正常です。 ユーザーに .env へキーを記入して REPL を実行するよう案内してください。


フェーズ 5 — 引き渡し

スキャフォールド完了後、ユーザーに以下を伝えてください:

  1. キーの設定方法cp .env.example .env を実行してキーを記入する。
  2. 実行方法uv run python -m <project_name>.main
  3. 次のステップ(以下から適切なものを選んで提示):
    • 初期スキーマをドメイン固有のものに置き換える → atomic-agents:create-atomic-schema スキルを使用。
    • Agent を追加する → atomic-agents:create-atomic-agent スキルを使用。
    • ツールを追加する → atomic-agents:create-atomic-tool スキルを使用。
    • コンテキストプロバイダー(時刻・ユーザー・RAG・セッション)を追加する → atomic-agents:create-atomic-context-provider スキルを使用。
    • 複数の Agent に分割する → framework/references/orchestration.md を参照。
  4. framework(自動起動)および review(コミット前に自動起動)へのリンク。

制約事項

  • .env はコミットしないこと。コミットするのは .env.example のみ。
  • グローバル環境には何もインストールしないこと。プロジェクトの venv を使用する。
  • 古いモデルは選択しないこと。現行世代をデフォルトとする: OpenAI gpt-5-mini、Anthropic claude-haiku-4-5、Groq llama-3.3-70b-versatile、Ollama llama3.1、Gemini gemini-2.5-flash
  • framework/references/project-structure.md にテンプレートが存在するものを手動で実装しないこと。
原文(English)を表示

New Atomic Agents Project

Scaffold a fresh Atomic Agents project. The result is a single-package Python project with one working agent, one schema pair, a provider-wrapped client, and a runnable main.py.

This skill is opinionated. Produce a complete, tested skeleton the user can run immediately.

Phase 1 — Interrogate

Ask these questions in one message, not one-at-a-time. Skip any the user already answered (including via $ARGUMENTS).

  1. Project name — used as both directory name and package name. Default from $ARGUMENTS if provided. Normalize to kebab-case for the directory and snake_case for the package.
  2. LLM provider — OpenAI / Anthropic / Groq / Ollama / Gemini / OpenRouter / MiniMax. Default: OpenAI.
  3. Agent type — a rough one-liner. Shapes the default SystemPromptGenerator content and the starter schema pair. Defaults to a generic chat agent.
  4. Toolinguv (default, because the repo uses uv) or pip + venv.

Do not ask about project layout, Python version, or dependency list. Pick them.

Phase 2 — Confirm the plan

State the plan in one short block and wait for a yes. Include:

  • Directory: <project-name>/
  • Package: <project_name>/
  • Python: >=3.12 (Atomic Agents uses PEP 695 generics)
  • Dependencies: atomic-agents>=2.7, instructor[<provider-extra>]>=1.14, python-dotenv, rich
  • Dev dependencies: pytest, pytest-asyncio, ruff
  • First agent: <agent-type> — uses BasicChatInputSchema/BasicChatOutputSchema unless the agent type calls for custom schemas
  • Default model for the chosen provider (see framework/references/providers.md)
  • Entry point: main.py with a REPL

Phase 3 — Scaffold

Create files in this order. Verify each step before proceeding.

Directory and package

<project-name>/
├── pyproject.toml
├── .env.example
├── .gitignore
├── README.md
└── <project_name>/
    ├── __init__.py
    └── main.py

pyproject.toml

Use the template from framework/references/project-structure.md, substituting the chosen provider extra and project name.

.env.example

Include the provider's API-key variable with a placeholder. Never the real key.

.gitignore

Use the template from framework/references/project-structure.md.

<project_name>/main.py

Produce a runnable REPL. Load .env, instantiate the provider client per framework/references/providers.md, build an agent, wire a ChatHistory with a seed assistant message, loop on console.input(...).

For the agent itself, follow the workflow from the atomic-agents:create-atomic-agent skill — same canonical imports, same per-provider mode matrix, same SystemPromptGenerator shape.

When a custom agent type was requested, build custom InputSchema / OutputSchema subclasses with field description= populated, following the atomic-agents:create-atomic-schema skill. Otherwise use BasicChatInputSchema / BasicChatOutputSchema.

Always use the canonical imports:

from atomic_agents import (
    AtomicAgent, AgentConfig,
    BasicChatInputSchema, BasicChatOutputSchema,
)
from atomic_agents.context import ChatHistory, SystemPromptGenerator
from instructor import Mode

Per-provider AgentConfig knobs — match the Instructor factory mode on AgentConfig.mode:

  • OpenAI: defaults work. Omit mode (or set Mode.TOOLS).
  • Anthropic: mode=Mode.TOOLS; include max_tokens in model_api_parameters.
  • Groq / Ollama / MiniMax: mode=Mode.JSON (Instructor factory also uses Mode.JSON).
  • Gemini: assistant_role="model" and mode=Mode.GENAI_TOOLS (Instructor factory uses Mode.GENAI_TOOLS).
  • OpenRouter: mode=Mode.TOOLS.

README.md

Short. Include: what the project is, how to install (uv sync or pip install -e .[dev]), how to set the API key (cp .env.example .env and edit), how to run (uv run python -m <project_name>.main or equivalent).

Phase 4 — Install and smoke-test

Execute the install step:

  • uv: uv sync
  • pip: python -m venv .venv && .venv/bin/pip install -e ".[dev]" (Windows: .venv\Scripts\pip)

Verify imports without a live API key:

uv run python -c "from <project_name>.main import agent; print('ok')"

If that works, the scaffold is sound. Tell the user to drop their key into .env and run the REPL.

Phase 5 — Hand off

After scaffolding, tell the user:

  1. How to set their key (cp .env.example .env).
  2. How to run (uv run python -m <project_name>.main).
  3. Next steps, picked from:
    • Replace the starter schemas with domain-specific ones — use the atomic-agents:create-atomic-schema skill.
    • Add another agent — use the atomic-agents:create-atomic-agent skill.
    • Add a tool — use the atomic-agents:create-atomic-tool skill.
    • Add a context provider (time, user, RAG, session) — use the atomic-agents:create-atomic-context-provider skill.
    • Split into multiple agents — see framework/references/orchestration.md.
  4. A pointer to framework (auto-triggered) and review (auto-triggered before commit).

Constraints

  • Never commit .env. Only .env.example.
  • Never install anything globally. Use the project venv.
  • Never pick an old model. Default to current generation: OpenAI gpt-5-mini, Anthropic claude-haiku-4-5, Groq llama-3.3-70b-versatile, Ollama llama3.1, Gemini gemini-2.5-flash.
  • Never hand-roll what framework/references/project-structure.md already templates.

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。