본문으로 건너뛰기
Skillpedia
에이전트7.6k · #13181

self-modifying-code

하는 일

이 스킬은 에이전트가 앱 자체의 컴포넌트와 스타일을 어떻게 바꿀 수 있는지, 그리고 어떤 설정 파일과 프레임워크 파일이 금지되는지 설명합니다. 에이전트가 직접 편집하도록 설계된 앱을 만드는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓에이전트가 직접 바꾸도록 기대되는 앱을 설계할 때.
  • ✓파일이 에이전트가 편집하기에 안전한지 결정할 때.
  • ✓에이전트가 설정, 환경 파일 또는 프레임워크 패키지를 편집하고 싶을 때.

스킬 링크

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/self-modifying-code/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/self-modifying-code/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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, or patchedDependencies that target any @agent-native/* package
  • pnpm 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:

  1. Commit or stash current state
  2. Make the edit
  3. Run pnpm typecheck && pnpm lint
  4. If verification fails → revert with git checkout -- <file>
  5. 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 .env files or files containing secrets
  • Don't modify @agent-native/core, @agent-native/dispatch, or other @agent-native/* package internals (including under node_modules)
  • Don't confuse readable package source with app-owned code: use customizing-agent-native and agent-native eject for supported ownership transfer
  • Don't use pnpm patch / pnpm patch-commit, commit patches/ artifacts, or add pnpm.patchedDependencies to "make the app run" after a version bump
  • Don't add pnpm.overrides / patchedDependencies / resolutions for @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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬