writing-agent-instructions
Fungsinya
Panduan ini menjelaskan cara menulis instruksi yang membentuk perilaku agent AI di aplikasi, termasuk peta utama, skill terperinci, dan deskripsi alat. Panduan ini untuk orang yang membangun aplikasi atau templat untuk agent AI.
Kapan dipakai
- βSaat Anda menulis atau meninjau berkas AGENTS.md untuk aplikasi.
- βKetika Anda menulis skill baru atau mendeskripsikan aksi yang bisa dipakai agent.
- βSaat Anda perlu memutuskan apakah sesuatu termasuk instruksi, skill, atau memori.
Link skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/writing-agent-instructions/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBantu saya menulis ulang instruksi untuk aplikasi saya supaya AI tahu kapan harus memakai setiap alat.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Panduan ini menyatakan untuk menjaga berkas instruksi utama tetap pendek dan mudah dipindai, memindahkan detail mendalam ke skill, dan menulis deskripsi alat agar agent bisa cepat memilih yang tepat.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Seberapa panjang seharusnya berkas instruksi utama?
Panduan ini menyatakan untuk menjaganya tetap kecil dan mencatat batas karakter pada berkas tersebut.
Di mana detail cara yang panjang sebaiknya diletakkan?
Di dalam skill, sehingga berkas utama hanya menjelaskan apa itu aplikasi dan apa yang bisa dilakukannya.
Apa yang harus difokuskan deskripsi aksi?
Membantu agent memilih alat yang tepat dengan cepat, jadi ditulis untuk pencarian cepat, bukan prosa.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 7.6k
- Peringkat
- #13192
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
design-exploration
7.6kMembantu agent Anda mengeksplorasi beberapa arah desain UI secara berdampingan, membiarkan Anda memilih satu, lalu menyempurnakan desain yang dipilih.
visual-edit
7.6kMembantu agent Anda membuka aplikasi lokal yang sedang berjalan di editor visual agar Anda dapat meninjau dan mengedit layar aslinya bersama-sama.
turn-into-app
7.6kMengubah alur kerja, spreadsheet, atau proyek menjadi aplikasi visual yang rapi, dengan layar yang terisi dan agent yang bekerja di balik kontrol.
visual-plan
7.6kMengubah rencana teks biasa menjadi rencana visual interaktif dengan diagram, peta file, cuplikan kode, dan pertanyaan terbuka.
Skill serupa
writing-skills
311kMengajari agent Anda menulis skill baru dan menguji setiap skill lebih dulu, memastikan skill itu benar-benar mengubah perilaku agent.
writing-for-agents
310kMenjelaskan cara menulis instruksi yang jelas untuk agent AI, termasuk file skill, AGENTS.md, dan CLAUDE.md, agar perilaku agent dapat diprediksi.
bengali-nlp
280kMembuat agent Anda memproses teks Bahasa Bengali. Membantu memahami dan mengolah bahasa tersebut, termasuk normalisasi teks dan karakteristik uniknya.