self-modifying-code

Guides agents in safely editing an app's own components, routes, styles, and scripts.

Updated May 13, 2026
One-click install
npx skills add https://github.com/fred07diamond/Call-Copilot --skill self-modifying-code-fred07diamond
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: self-modifying-code
Source: https://github.com/fred07diamond/Call-Copilot/tree/main/apps/design/.agents/skills/self-modifying-code
Command: npx skills add https://github.com/fred07diamond/Call-Copilot --skill self-modifying-code-fred07diamond

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Agents editing an application's own source code can break the app, touch secrets, or make unrecoverable changes. This Skill defines a tiered modification policy and verification workflow so agents can safely fix bugs, add features, and adjust styles without compromising the project. ## Core Features & Use Cases - Modification Taxonomy: Classifies edits into four tiers — data files, source code, project config, and off-limits secrets/framework internals — with required actions per tier. - Git Checkpoint Pattern: Enforces commit-or-stash before edits, runs pnpm typecheck && pnpm lint after, and reverts with git checkout -- <file> on failure. - Agent Editability Design: Recommends exposing UI state via data-* attributes and window.__appState, plus configuration-driven rendering through JSON files in data/. - Use Case: An agent asked to restyle a dashboard edits a JSON config in data/ (Tier 1) instead of rewriting component source, avoiding typecheck risk entirely. ## Quick Start Ask the agent to update the app's button styles, and it will checkpoint with git, edit the source, then run typecheck and lint to verify.

Frequently Asked Questions about self-modifying-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I let an AI agent safely edit my app's source code?▼

Classify the edit by tier first: data files need no verification, source code requires running pnpm typecheck and pnpm lint afterward, and config changes need explicit approval. Always create a git checkpoint before editing so failures can be reverted with git checkout.

What files should an AI agent never modify in a project?▼

Agents must never modify .env files or anything containing secrets, and must not touch @agent-native/core framework internals. Files under .agents/skills/ and AGENTS.md should only be changed when explicitly requested.

How do I design a UI that an AI agent can easily modify?▼

Expose UI state through data-* attributes on the document element and richer context via window.__appState so the agent knows what is selected. Extract visual decisions like colors and layouts into JSON config files in data/ so the agent edits config instead of component source.

What should an agent do after editing source code?▼

After any Tier 2 source edit, run pnpm typecheck and pnpm lint to verify the change. If verification fails, revert the file with git checkout -- <file>; if it passes, continue with the task.

When should an agent ask for approval before modifying code?▼

Explicit approval is required before Tier 3 changes to project configuration such as package.json, tsconfig.json, or vite.config files. Routine data edits and verified source edits do not require approval.