self-modifying-code
하는 일
이 스킬은 에이전트가 앱 자체의 컴포넌트와 스타일을 어떻게 바꿀 수 있는지, 그리고 어떤 설정 파일과 프레임워크 파일이 금지되는지 설명합니다. 에이전트가 직접 편집하도록 설계된 앱을 만드는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓에이전트가 직접 바꾸도록 기대되는 앱을 설계할 때.
- ✓파일이 에이전트가 편집하기에 안전한지 결정할 때.
- ✓에이전트가 설정, 환경 파일 또는 프레임워크 패키지를 편집하고 싶을 때.
스킬 링크
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/self-modifying-code/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 페이지의 레이아웃은 에이전트가 바꿀 수 있게 하되, 제 설정 파일과 환경 파일은 건드리지 않게 해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
변경은 계층으로 나뉩니다. 데이터와 소스 파일은 검사를 거쳐 허용되고, 설정은 승인이 필요하며, 비밀 값과 프레임워크 패키지는 절대 수정되지 않습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
에이전트가 .env 파일을 편집할 수 있나요?
아니요. 환경 파일은 건드릴 수 없는 계층에 있습니다.
소스 코드를 바꾼 뒤 어떤 검사가 실행되나요?
소스 편집 후 타입 검사와 린트를 실행하라고 이 스킬은 말합니다.
설정 변경은 누가 승인하나요?
패키지나 빌드 설정 파일을 바꾸기 전에 사용자가 명시적으로 승인해야 합니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 7.6k
- 순위
- #13181
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
design-exploration
7.6k에이전트가 여러 UI 디자인 방향을 나란히 보여 주고, 사용자가 하나를 고르면 그 디자인을 다듬도록 돕습니다.
visual-edit
7.6k에이전트가 실행 중인 로컬 앱을 시각 편집기에 열어, 실제 화면을 함께 검토하고 편집하도록 돕습니다.
turn-into-app
7.6k워크플로, 스프레드시트 또는 프로젝트를 데이터가 채워진 세련된 시각 앱으로 바꾸고, 컨트롤 뒤에서 에이전트가 작업하도록 합니다.
visual-plan
7.6k일반 텍스트 계획을 다이어그램, 파일 맵, 코드 조각, 열린 질문이 담긴 대화형 시각 계획으로 바꿔 줍니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.