self-modifying-code
Fungsinya
Skill ini menjelaskan bagaimana agent boleh mengubah komponen dan gaya aplikasi, serta berkas konfigurasi dan framework mana yang terlarang. Skill ini untuk pengembang yang merancang aplikasi yang diharapkan diedit oleh agent.
Kapan dipakai
- βSaat Anda merancang aplikasi yang diharapkan diubah sendiri oleh agent.
- βKetika Anda memutuskan apakah sebuah berkas aman untuk diedit agent.
- βSaat agent tergoda untuk mengedit konfigurasi, berkas lingkungan, atau paket framework.
Link skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/self-modifying-code/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
βBiarkan agent mengubah tata letak halaman ini, tetapi pastikan ia tidak menyentuh pengaturan atau berkas lingkungan saya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Perubahan dikelompokkan menjadi tingkatan. Data dan berkas sumber diizinkan dengan pemeriksaan, konfigurasi membutuhkan persetujuan, dan rahasia serta paket framework tidak pernah diubah.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Self-Modifying Code
Rule
The agent can edit the app's own source code β components, routes, styles, scripts. This is a feature, not a bug. Design your app expecting this.
Why
An agent-native app isn't just an app the agent can use β it's an app the agent can change. The agent can fix bugs, add features, adjust styles, and restructure code. This makes the agent a true collaborator, not just an operator.
Modification Taxonomy
Not all modifications are equal. Use this to decide what level of care is needed:
| Tier | What | Examples | After modifying |
|---|---|---|---|
| 1: Data | Files in data/ |
JSON state, generated content, markdown | Nothing β these are routine |
| 2: Source | App code | Components, routes, styles, scripts | Run pnpm typecheck && pnpm lint |
| 3: Config | Project config | package.json, tsconfig.json, vite.config.* |
Ask for explicit approval first |
| 4: Off limits | Secrets and framework | .env, @agent-native/* packages & overrides |
Never modify these |
Tier 4 includes all of the following β not only editing package source:
- Files under
node_modules/@agent-native/*(core, dispatch, scheduling, β¦) pnpm.overrides,overrides,resolutions, orpatchedDependenciesthat target any@agent-native/*packagepnpm patch,pnpm patch-commit, or local package patch artifacts for any dependency- Invented "dispatch/core behavior" shims meant to paper over a version skew or failed upgrade
This does not prohibit intentional app-owned UI customization. When public
props and composition are insufficient, the customizing-agent-native skill
uses agent-native eject to transfer the smallest supported unit from the
installed package into the app. The ejected unit must keep public runtime
contracts and must not replace Core auth, DB, actions, agent execution, or
transport behavior. Manual copying is only the fallback described by an unknown
third-party package's add-style blueprint.
When an older branch needs current packages, use agent-native upgrade
(see the upgrade-agent-native skill). If upgrade or typecheck fails, fix
app code or stop and ask β do not patch the framework.
Git Checkpoint Pattern
Before modifying source code (Tier 2+), create a rollback point:
- Commit or stash current state
- Make the edit
- Run
pnpm typecheck && pnpm lint - If verification fails β revert with
git checkout -- <file> - If verification passes β continue
This ensures the agent can experiment without breaking the app.
Designing for Agent Editability
Make your app easy for the agent to understand and modify:
Expose UI state via data-* attributes so the agent knows what's selected:
const el = document.documentElement;
el.dataset.currentView = view;
el.dataset.selectedId = selectedItem?.id || "";
Expose richer context via window.__appState for complex state:
(window as any).__appState = {
selectedId: id,
currentLayout: layout,
itemCount: items.length,
};
Use configuration-driven rendering β Extract visual decisions (colors, layouts, sizes) into JSON config files in data/. The agent can modify the config (Tier 1) instead of the component source (Tier 2).
Keep localized copy in catalogs β When editing visible UI copy, labels,
toasts, empty states, prompts, or formatting, update the English source catalog.
Read the optional internationalization skill and update additional catalogs
only when translations.locales in agent-native.config.ts includes them.
Don't
- Don't modify
.envfiles or files containing secrets - Don't modify
@agent-native/core,@agent-native/dispatch, or other@agent-native/*package internals (including undernode_modules) - Don't confuse readable package source with app-owned code: use
customizing-agent-nativeandagent-native ejectfor supported ownership transfer - Don't use
pnpm patch/pnpm patch-commit, commitpatches/artifacts, or addpnpm.patchedDependenciesto "make the app run" after a version bump - Don't add
pnpm.overrides/patchedDependencies/resolutionsfor@agent-native/*to paper over a broken upgrade - Don't invent local
Pertanyaan umum
Bolehkah agent mengedit berkas .env?
Tidak. Berkas lingkungan berada di tingkatan yang terlarang.
Pemeriksaan apa yang dijalankan setelah perubahan kode sumber?
Skill ini menyatakan untuk menjalankan typecheck dan lint setelah mengedit sumber.
Siapa yang menyetujui perubahan konfigurasi?
Pengguna harus memberikan persetujuan eksplisit sebelum berkas paket atau konfigurasi build diubah.
Detail
Deskripsi asli dari pembuat
Tiers, checkpoints, and off-limits paths for an agent editing the app's own source. Use when designing UI for agent editability, deciding whether a file is safe for the agent to change, or when tempted to patch config, `.env`, or an `@agent-native/*` package. Do not load it for ordinary source edits.
repo: BuilderIO/agent-native
Popularitas
- Bintang GitHub
- 7.6k
- Peringkat
- #13181
- 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
add-model-provider
394kMemungkinkan agent Anda menghubungkan penyedia model AI baru ke OpenClaw dengan perintah pengaturan yang aman, menjaga kunci API tetap di luar teks biasa, dan menjalankan uji langsung.
acp-router
394kMembantu agent Anda mengirim tugas ke asisten pemrograman seperti Claude Code atau Cursor lewat OpenClaw, sehingga pekerjaan dijalankan di alat tersebut.
browser-automation
394kMengajari agent Anda mengendalikan halaman web langkah demi langkah, termasuk login, tab, dan pemulihan saat halaman berhenti merespons.