Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
builderio avatar

Self Modifying Code

  • 5 installs
  • 4.4k repo stars
  • Updated August 2, 2026
  • builderio/agent-native

self-modifying-code is an agent-native framework skill describing how an agent can safely edit the app's own source code across a tiered modification taxonomy.

About

A skill for the agent-native framework covering how an agent can safely modify the app's own source code. A developer follows it when the agent needs to edit components, routes, styles, or scripts, or when designing an app to be agent-editable. It sets a tiered taxonomy of what to modify and a git-checkpoint plus typecheck/lint safety pattern.

  • Defines a 4-tier modification taxonomy from data files to off-limits secrets/framework
  • Prescribes a git checkpoint pattern with pnpm typecheck && pnpm lint before source edits
  • Recommends exposing UI state via data-* attributes and window.__appState for editability

Self Modifying Code by the numbers

  • 5 all-time installs (skills.sh)
  • Ranked #13,035 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 3, 2026 (Skillselion catalog sync)
At a glance

self-modifying-code capabilities & compatibility

Capabilities
refactoring · code review
Use cases
refactoring
From the docs

What self-modifying-code says it does

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.
SKILL.md
Before modifying source code (Tier 2+), create a rollback point:
SKILL.md
Don't modify `.env` files or files containing secrets
SKILL.md
npx skills add https://github.com/builderio/agent-native --skill self-modifying-code

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs5
repo stars4.4k
Last updatedAugust 2, 2026
Repositorybuilderio/agent-native

What it does

Guide the agent to safely edit an app's own components, routes, styles, or scripts with rollback checkpoints.

Who is it for?

Designing an app the agent can change and defining what edits are safe versus off-limits.

Skip if: Editing .env files, secrets, or @agent-native/core package internals.

When should I use this skill?

The agent needs to edit components, routes, styles, or scripts, or when designing UI for agent editability.

What you get

Agent source edits are tiered, checkpointed, and verified with typecheck and lint before landing.

By the numbers

  • Defines a 4-tier modification taxonomy
  • Lists a 5-step git checkpoint pattern

Files

SKILL.mdMarkdownGitHub ↗

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/core internalsNever modify these

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).

Don't

  • Don't modify .env files or files containing secrets
  • Don't modify @agent-native/core package internals
  • 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

  • files-as-database — Tier 1 modifications (data files) are the safest and most common
  • scripts — The agent can create or modify scripts to add new capabilities
  • delegate-to-agent — Self-modification requests come through the agent chat
  • sse-file-watcher — Source and data file edits trigger SSE events to update the UI

Related skills

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.