writing-agent-instructions
できること
このガイドは、アプリ内でAIエージェントの振る舞いを決める指示の書き方を説明します。主要な案内役、詳細なスキル、ツールの説明が対象です。AIエージェント向けのアプリやテンプレートを作る人向けです。
使う場面
- ✓アプリのAGENTS.mdファイルを書いたり確認したりするとき。
- ✓新しいスキルファイルを書いたり、エージェントが使えるアクションを説明したりするとき。
- ✓内容を指示、スキル、メモリのどこに入れるべきか判断する必要があるとき。
スキルのリンク
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/writing-agent-instructions/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“アプリの指示を書き直して、AIが各ツールをいつ使うべきかわかるようにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
ガイドは、主要な指示ファイルを短く見やすく保ち、詳しい説明はスキルに移すよう勧めます。また、エージェントがすばやく適切なツールを選べるように、ツールの説明を書くことを求めます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Writing Agent Instructions & Skills
This is a creator-facing guide. When you build an agent-native app or template,
the agent's behavior is only as good as the instructions you give it. Three
surfaces carry that guidance: AGENTS.md (the map), skills (the deep dives),
and action/tool descriptions (how the agent picks the right tool). Write each
one for fast retrieval, not for prose.
Keep AGENTS.md small and skimmable
AGENTS.md is loaded as orientation. It should be the smallest thing that lets
the agent act correctly, with everything deep pushed into skills. Aim for these
sections and little else:
- Purpose line — one sentence on what the app is and the primary workflow.
- Core rules — the handful of invariants that must always hold (data in SQL, operations go through actions, AI goes through the agent chat, schema changes are additive). Short, imperative bullets.
- Application-state keys — the
navigation/selection/focus keys the agent reads to know what the user is looking at, with their shape. - Action table — a compact table of action name -> purpose (see below).
- Skills index — a list of the skills that exist and when to read each one.
If a section is growing past a screen, it belongs in a skill. AGENTS.md
answers "what is this app and what can I do," not "how exactly do I do the hard
thing."
The 6,000-character cap is real and silent
A template AGENTS.md is injected into the runtime agent's system prompt and
hard-sliced at COMPACT_PROMPT_RESOURCE_MAX_CHARS (6,000). Past that, the agent
sees a truncation marker instead of your text, so the tail stops being
always-on guidance and becomes something it has to go fetch. pnpm guard:agent-chat-context — the repository's own check — fails the build when a
first-party file overflows; generated apps do not ship that repository-only
guard. Keep files under ~5,500 so ordinary edits don't tip them over.
Two consequences worth designing around:
- Put the skills list second, right after the purpose line. It is the pointer to every deferred skill. If it lands in the truncated tail, the agent cannot discover any of the depth you carefully moved out.
- Markdown tables cost more than they look. Prettier pads table cells to
align columns, and that invisible whitespace counts against the cap — enough
padding in a wide action table to push a file back over it on its own. Both
**/AGENTS.mdand**/SKILL.mdare in.prettierignorefor this reason; keep them there and write table rows unpadded.
# Projects App
One workspace for projects, tasks, and notes. Agent and UI share the same SQL
data and the same actions.
## Core Rules
- Data lives in SQL via Drizzle. Use actions for all writes.
- All AI work goes through the agent chat; never call an LLM inline.
- Schema changes are additive only.
## Application State
- `navigation.view`: `home` | `project`
- `navigation.projectId`: selected project on a project page
## Actions
| Action | Purpose |
| --- | --- |
| `list-projects` | List accessible projects |
| `create-project` | Create a project |
| `update-project` | Rename or archive a project |
## Skills
- `project-imports` — read before importing legacy CSV exports.
- `sharing` — read before exposing a project to other users.
Single-source AGENTS.md (CLAUDE.md is a symlink)
Keep one canonical instructions file: AGENTS.md. If a client expects
CLAUDE.md, make it a symlink to AGENTS.md rather than a second copy. Two
hand-maintained files drift, and the agent ends up with contradictory rules.
One source of truth, linked where needed.
Keep generated guidance in sync
Framework guidance is authored once in this repo and copied outward. Treat
.agents/skills/ as the canonical source for shared skills. Generated
workspace skills in packages/core/src/templates/workspace-core/.agents/skills/
and first-party template copies of shared skills must stay byte-for-byte in
sync; run pnpm sync:workspace-skills after editing a shared skill, and
pnpm guard:workspace-skills before calling the guidance done.
Generated app and workspace instructions must teach the same action-first data contract:
- Normal app data goes through
defineActionfiles inactions/. - React calls actions with
useActionQuery,useActionMutation, orcallAction; route paths are a transport detail hidden behind helpers. - Custom
/api/*routes are only for route-shaped protocols such as uploads, str
よくある質問
主要な指示ファイルはどのくらいの長さにすべきですか?
小さく保つべきだとされており、そのファイルには文字数の上限があることにも触れています。
長い手順の詳細はどこに書くべきですか?
スキルに書きます。主要ファイルには、アプリが何であり何ができるかだけを書きます。
アクションの説明では何に重点を置くべきですか?
エージェントが適切なツールをすばやく選ぶことです。そのため、文章ではなく素早く参照できる形で書きます。
詳細
作者による元の説明
How to write great agent instructions for an agent-native app or template: AGENTS.md, skills, and tool/action descriptions. Use when authoring or reviewing AGENTS.md, writing a SKILL.md, wording action descriptions, or deciding what belongs in instructions vs skills vs memory.
repo: BuilderIO/agent-native
人気
- GitHubのスター
- 7.6k
- ランキング
- #13192
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
design-exploration
7.6kUIの複数のデザインの方向性を並べて検討し、1つを選んでもらい、選んだデザインを磨き上げるようエージェントを支援します。
visual-edit
7.6k実行中のローカルのアプリをビジュアルエディターで開き、本物の画面をまとめて確認し編集できるようエージェントを支援します。
turn-into-app
7.6kワークフロー、スプレッドシート、プロジェクトを、画面にデータが入り、操作の裏でエージェントが働く、洗練されたビジュアルアプリに変えます。
visual-plan
7.6kプレーンテキストの計画を、図、ファイルのマップ、コードの断片、未解決の質問を含む、対話できるビジュアルな計画に変えます。
似ているスキル
writing-skills
311k新しいスキルを書き、それぞれをまず試すようエージェントに教えます。そのスキルが実際にエージェントの動作を変えることを確認します。
writing-for-agents
310kスキル、AGENTS.md、CLAUDE.mdを含め、AIエージェントのための明確な指示の書き方を説明し、エージェントが予測可能に動くようにします。
bengali-nlp
280kエージェントがベンガル語のテキストを処理できるようにします。テキストの正規化など、ベンガル語特有の性質に対応しながら、言語を理解して扱えるようにします。