templates/videos/.agents/skills/self-modifying-code/SKILL.md
How the agent can modify the app's own source code. Use when the agent needs to edit components, routes, styles, or scripts, when designing UI for agent editability, or when deciding what the agent should and shouldn't modify.
npx skillsauth add BuilderIO/agent-native self-modifying-codeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
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.
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/core internals | Never modify these |
Before modifying source code (Tier 2+), create a rollback point:
pnpm typecheck && pnpm lintgit checkout -- <file>This ensures the agent can experiment without breaking the app.
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).
.env files or files containing secrets@agent-native/core package internals.agents/skills/ or AGENTS.md unless explicitly requestedtools
Public booking flow — the state machine, animations, and URL/app-state sync.
tools
Trigger-based automations — reminders, follow-ups, webhooks — across the booking lifecycle.
tools
Team event types, round-robin assignment, collective bookings, host weights, and no-show calibration.
development
The pure `computeAvailableSlots` function — inputs, outputs, invariants, and debugging guide.