🏗️new-app
- プラグイン
- atomic-agents
- ソース
- GitHub で見る ↗
説明
新しい 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 経由を含む)はスキップしてください。
- プロジェクト名 — ディレクトリ名とパッケージ名の両方に使用します。
$ARGUMENTSが指定されている場合はそれをデフォルト値とします。 ディレクトリ名はkebab-case、パッケージ名はsnake_caseに正規化してください。 - LLM プロバイダー — OpenAI / Anthropic / Groq / Ollama / Gemini / OpenRouter / MiniMax から選択。 デフォルト: OpenAI。
- Agent の種別 — 一言程度の概要。
SystemPromptGeneratorの初期コンテンツおよびスキーマペアの初期値に反映されます。 デフォルト: 汎用チャット Agent。 - ツール選択 —
uv(デフォルト。リポジトリが uv を使用しているため)またはpip + venv。
プロジェクトレイアウト・Python バージョン・依存ライブラリの一覧については質問しないでください。こちらで選定します。
フェーズ 2 — 計画の確認
以下の内容を 1 つの短いブロック にまとめて提示し、ユーザーの承諾を待ってください。
- ディレクトリ:
<project-name>/ - パッケージ:
<project_name>/ - Python:
>=3.12(Atomic Agents は PEP 695 ジェネリクスを使用) - 依存ライブラリ:
atomic-agents>=2.7、instructor[<provider-extra>]>=1.14、python-dotenv、rich - 開発用依存ライブラリ:
pytest、pytest-asyncio、ruff - 初期 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 スキルに従い、field の description= を付与したカスタム 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.TOOLS、model_api_parametersにmax_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 — 引き渡し
スキャフォールド完了後、ユーザーに以下を伝えてください:
- キーの設定方法 —
cp .env.example .envを実行してキーを記入する。 - 実行方法 —
uv run python -m <project_name>.main。 - 次のステップ(以下から適切なものを選んで提示):
- 初期スキーマをドメイン固有のものに置き換える →
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を参照。
- 初期スキーマをドメイン固有のものに置き換える →
framework(自動起動)およびreview(コミット前に自動起動)へのリンク。
制約事項
.envはコミットしないこと。コミットするのは.env.exampleのみ。- グローバル環境には何もインストールしないこと。プロジェクトの venv を使用する。
- 古いモデルは選択しないこと。現行世代をデフォルトとする:
OpenAI
gpt-5-mini、Anthropicclaude-haiku-4-5、Groqllama-3.3-70b-versatile、Ollamallama3.1、Geminigemini-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).
- Project name — used as both directory name and package name. Default from
$ARGUMENTSif provided. Normalize tokebab-casefor the directory andsnake_casefor the package. - LLM provider — OpenAI / Anthropic / Groq / Ollama / Gemini / OpenRouter / MiniMax. Default: OpenAI.
- Agent type — a rough one-liner. Shapes the default
SystemPromptGeneratorcontent and the starter schema pair. Defaults to a generic chat agent. - Tooling —
uv(default, because the repo uses uv) orpip + 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>— usesBasicChatInputSchema/BasicChatOutputSchemaunless the agent type calls for custom schemas - Default model for the chosen provider (see
framework/references/providers.md) - Entry point:
main.pywith 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 setMode.TOOLS). - Anthropic:
mode=Mode.TOOLS; includemax_tokensinmodel_api_parameters. - Groq / Ollama / MiniMax:
mode=Mode.JSON(Instructor factory also usesMode.JSON). - Gemini:
assistant_role="model"andmode=Mode.GENAI_TOOLS(Instructor factory usesMode.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:
- How to set their key (
cp .env.example .env). - How to run (
uv run python -m <project_name>.main). - Next steps, picked from:
- Replace the starter schemas with domain-specific ones — use the
atomic-agents:create-atomic-schemaskill. - Add another agent — use the
atomic-agents:create-atomic-agentskill. - Add a tool — use the
atomic-agents:create-atomic-toolskill. - Add a context provider (time, user, RAG, session) — use the
atomic-agents:create-atomic-context-providerskill. - Split into multiple agents — see
framework/references/orchestration.md.
- Replace the starter schemas with domain-specific ones — use the
- A pointer to
framework(auto-triggered) andreview(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, Anthropicclaude-haiku-4-5, Groqllama-3.3-70b-versatile, Ollamallama3.1, Geminigemini-2.5-flash. - Never hand-roll what
framework/references/project-structure.mdalready templates.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。