Skip to content
cccskills
FreePublished on GitHub

self-modifying-code

Guide agents that edit an app's own code by classifying changes by risk, requiring checkpoints and verification for source edits, and marking secrets and framework internals as off limits. It also explains how to expose app state so agents can understand the UI.

OriginalShow the original description

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-native7,524 stars(GitHub 7,524 + cccskills 0)

Run score Not tested

See how to install

Good for

  • Decide whether an app file is safe to edit
  • Plan UI that agents can inspect and modify
  • Check the steps required before source changes
  • Avoid changing secrets or framework internals

Files included (1)

  • SKILL.md5.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

a2a-assets

FreeSummary

Generate, refine, export, and place brand images or videos from an Assets library into another app. The skill covers choosing a library, handling image batches and video runs, and updating selected assets after feedback.

  • Generate brand images for slides or another app
  • Refine an existing asset after feedback
  • Create and export a video asset
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

account-health

FreeSummary

Prepare a customer account health, renewal, or contract usage readout. Verify the account identity, use approved metric definitions, compare contracted capacity with actual usage, and trace findings to sources, time windows, and known gaps.

  • Preparing a named customer's account health review
  • Comparing contracted seats or capacity with usage
  • Gathering adoption signals before a renewal or QBR
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

actions

FreeSummary

Create focused app actions that agents can call as tools and frontend code can use through client hooks. Use them to add provider integrations or fetch UI data, with validated inputs and structured results.

  • Adding a new app operation
  • Connecting an external provider API
  • Fetching data for a frontend view
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

adding-a-feature

FreeSummary

Use this checklist when adding a feature or integration to an agent-native app. It covers the user interface, agent-callable actions, instructions, and app-state sync so both the user and agent can work with the capability consistently.

  • Planning a new feature across UI and agent actions
  • Checking that agent changes appear in the UI
  • Documenting actions and feature state for the agent
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

adhoc-analysis

FreeSummary

Investigate complex questions by combining data from multiple sources, then summarize patterns, metrics, and evidence in a clear report. Save requested analyses as dashboards with instructions for future refreshes.

  • Comparing CRM deals with call records
  • Investigating customer health across systems
  • Saving a repeatable performance analysis
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

admin-surfaces

FreeSummary

Use the Analytics admin surfaces to inspect and change workspace feature flags, review dashboard ownership and usage activity, or browse and edit databases connected from other agent-native apps. The skill guides administrators to the relevant view and actions.

  • Review dashboard owners, views, and edits
  • Change a workspace feature flag for an app
  • Browse or edit a connected app database
BuilderIO/agent-native7.5KUpdated Oct 26, 2026

See all skills by BuilderIO

Report a problem with this skill