本文へ移動
cccskills
無料GitHub で公開日本語紹介

self-modifying-code

エージェントがアプリ自身のコードを変更するとき、変更対象ごとの注意度や確認手順、編集禁止領域を判断するためのルールを示します。

原文原文の説明を見る

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.

BuilderIO/agent-nativeスター 7,522(GitHub 7,522 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 変更対象の安全性を判断したいとき
  • エージェントが編集しやすいUIを設計するとき
  • ソース変更前後の手順を確認したいとき
  • 設定や秘密情報の編集可否を判断したいとき

日本語での紹介

できること

エージェントがアプリ自身を変更する際の対象を、データ、アプリのソース、設定、編集禁止領域に分け、必要な手順を示します。ソース変更では事前にGitのコミットまたはstashで戻せる地点を作り、変更後に型チェックとlintを実行する流れを定めています。設定ファイルは明示的な承認を先に得る対象で、.envや@agent-native/*の内部実装、関連する上書き設定は変更禁止です。さらに、UI状態をdata-*属性やwindow.__appStateで見えるようにする方法、見た目の設定をデータファイルに分ける考え方も説明します。

こんなときに便利

エージェントがアプリのコードを編集する機能を設計するときや、依頼された変更が安全な範囲か判断したいときに役立ちます。通常のソース編集ではなく、変更ルールや編集可能性を検討する場面を対象とします。

使い方の例

  • 「このファイルはエージェントが変更してよい範囲か確認して」
  • 「アプリのUIをエージェントが把握しやすくする方法を提案して」
  • 「設定ファイルを変更する前に必要な手順を確認して」

注意点

ソース変更にはGitのチェックポイント作成と、pnpm typecheck && pnpm lintによる確認が定められています。設定変更には明示的な承認が必要です。秘密情報やフレームワーク内部は編集禁止です。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md5.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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:

TierWhatExamplesAfter modifying
1: DataFiles in data/JSON state, generated content, markdownNothing — these are routine
2: SourceApp codeComponents, routes, styles, scriptsRun pnpm typecheck && pnpm lint
3: ConfigProject configpackage.json, tsconfig.json, vite.config.*Ask for explicit approval first
4: Off limitsSecrets and framework.env, @agent-native/* packages & overridesNever 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 dispatch/core behavior overrides when upgrade fails — run npx @agent-native/core@latest upgrade, then fix app-level errors only
  • Don't modify .agents/skills/ or AGENTS.md unless explicitly requested
  • Don't skip the typecheck/lint step after editing source code
  • Don't make source changes without a git checkpoint to roll back to

Related Skills

  • upgrade-agent-native — supported path to bring an older app/workspace current
  • customizing-agent-native — configure, compose, or eject installed features safely
  • storing-data — Tier 1 modifications (data files) are the safest and most common
  • actions — The agent can create or modify actions to add new capabilities
  • delegate-to-agent — Self-modification requests come through the agent chat
  • real-time-sync — Database writes trigger change events to update the UI
  • internationalization — UI copy, language catalogs, locale switching, and RTL-safe edits

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

a2a-assets

無料概要あり

複数のアプリやMCPホストからブランド画像・動画を生成、調整、書き出し、挿入する作業を支援します。ライブラリ選択や修正依頼も扱います。

  • スライド用のブランド画像を作りたいとき
  • 既存素材をフィードバックに合わせて直したいとき
  • 動画素材を生成して書き出したいとき
BuilderIO/agent-native7,5222026年10月26日 更新

account-health

無料概要あり

特定の顧客企業について、契約と製品利用の数値を照らし合わせ、根拠や不足情報を明記した健全性レポートをまとめます。

  • 顧客の健全性を確認したいとき
  • 契約席数と実利用を比べたいとき
  • 更新前に利用状況を整理したいとき
BuilderIO/agent-native7,5222026年10月26日 更新

actions

無料概要あり

アプリの操作をエージェントと画面の両方から呼び出せるアクションとして実装し、API連携や画面のデータ取得を一貫した形で追加するスキルです。

  • 新しいアプリ操作を追加したいとき
  • 外部APIと連携したいとき
  • 画面からデータを取得したいとき
BuilderIO/agent-native7,5222026年10月26日 更新

adding-a-feature

無料概要あり

新機能をUI・エージェント用アクション・説明資料・画面状態の4領域でそろえ、利用者とエージェントのどちらからも一貫して使えるようにするチェックリストです。

  • 新機能追加の作業範囲を整理したいとき
  • UIとエージェント操作をそろえたいとき
  • 画面状態の同期漏れを防ぎたいとき
BuilderIO/agent-native7,5222026年10月26日 更新

adhoc-analysis

無料概要あり

複数のデータソースを照合して、傾向や指標、根拠をまとめた分析結果を作成します。必要に応じて、再実行できるダッシュボードとして保存できます。

  • 商談と通話記録を照合したいとき
  • 顧客の利用状況を横断して調べたいとき
  • 繰り返し更新できる分析を保存したいとき
BuilderIO/agent-native7,5222026年10月26日 更新

admin-surfaces

無料概要あり

Analyticsの管理画面で、機能フラグの状態確認と切り替え、ダッシュボード利用状況の調査、接続先アプリのデータベース管理を行います。

  • アプリごとの機能フラグを確認・変更したいとき
  • ダッシュボードの所有者や利用状況を調べたいとき
  • 接続済みアプリのテーブルを管理したいとき
BuilderIO/agent-native7,5222026年10月26日 更新

BuilderIO のスキルをすべて見る

このスキルの問題を報告する