agentleFS
hoatv2211hoatv2211/GameStudio-CodexKIT/skills/safe-project-mutation/SKILL.md

safe-project-mutation

Skill3 starsChanged 3 months agoMITView on GitHub

Use when changing project files or generated state requires a report-only dry run, exact scope, backup manifest, apply verification, and a tested restore path.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Use for scripted edits, bulk normalization, generated files, project scaffolding, config rewrites, asset metadata operations, or any …

    line 39
  2. Very specific:

    Do not use this skill as the primary owner for a scaffold or per-project adapter.

    line 42
  3. Very specific:

    Default to report-only. Reject path traversal, source deletion, out-of-scope writes, unknown generated ownership, active …

    line 48
  4. Distinctive:

    Run report-only mode and calculate proposed changes without writing files.

    line 55
  5. Distinctive:

    Create backups for existing targets and a manifest for creates, updates, and restore actions.

    line 57
  6. Distinctive:

    Run the declared verification command and capture exit code and artifacts.

    line 61
  7. Distinctive:

    Never skip report-only because an operation is “just formatting.”

    line 73
  8. Distinctive:

    Never back up after mutation.

    line 74
  9. Distinctive:

    Never delete source assets.

    line 75
  10. Distinctive:

    Never hand-edit generated outputs without changing their source.

    line 76
  11. Very specific:

    Use the bundled scripts/safe_mutation.py for deterministic file operations and the active project's AGENTS.md for repository-wide mutation …

    line 88

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Safe Project Mutation

Overview

Separate inspection from mutation. Every applied file change must be scoped, reviewable, restorable, and verified.

When to use

Use for scripted edits, bulk normalization, generated files, project scaffolding, config rewrites, asset metadata operations, or any medium-risk file mutation.

When NOT to use

Do not use this skill as the primary owner for a scaffold or per-project adapter; use studio-project-scaffold and keep mutation safety as its dependency. Do not use it to authorize database writes, service control, publishing, credential changes, destructive cleanup, or edits outside the user-approved repository.

Required inputs and context discovery

Require repository root, exact operations, owned paths, excluded paths, expected before/after state, process/editor locks, reviewer, verification command, backup location, and restore objective.

Safety and risk level

Default to report-only. Reject path traversal, source deletion, out-of-scope writes, unknown generated ownership, active editor/build/server conflicts, missing reviewer, or missing restore information.

Workflow

  1. Normalize every target path and prove it remains inside the approved root. Require a pre-change impact query under code-intelligence-contract before non-trivial code edits; do not expand write scope automatically. Completion criterion: affected paths, source owners, generated authorities, and approved write scope are explicit, or the graph lane is BLOCKED.
  2. If the graph lane is BLOCKED, mutation may proceed only with Decision: REVIEWER_ACKNOWLEDGED_FALLBACK. Record explicit missing graph coverage/blocker, authoritative source owners, known callers/consumers, generated authorities or exact NOT_APPLICABLE, focused test commands, named reviewer, and residual risk. Preserve existing risk, approval, backup, and restore gates; any unresolved generated, cross-repository, or dynamic boundary remains BLOCKED, and graph verdict stays BLOCKED. Completion criterion: fallback fields are complete and approved write scope remains unchanged.
  3. Run report-only mode and calculate proposed changes without writing files. Completion criterion: hashes and diff intent exist while source state is unchanged.
  4. Create backups for existing targets and a manifest for creates, updates, and restore actions. Completion criterion: each operation has a backup or an explicit “created file; remove on restore” action.
  5. Apply only the reviewed manifest. Completion criterion: actual hashes match the manifest’s expected outputs.
  6. Run the declared verification command and capture exit code and artifacts. Completion criterion: success is supported by fresh output or labeled BLOCKED.
  7. Exercise restore in a fixture or provide a verified restore command for the real scope. Completion criterion: the original hashes can be reproduced.

Evidence and output contract

Produce a report-only plan, mutation-manifest.json, backup paths, before/after hashes, verification output, reviewer, and restore instructions.

Handoff contract

Record pending versus applied operations, manifest path, backup root, verification state, restore command, and any process locks that must remain closed.

Pitfalls and anti-rationalization

  • Never skip report-only because an operation is “just formatting.”
  • Never back up after mutation.
  • Never delete source assets; archive or leave BLOCKED.
  • Never hand-edit generated outputs without changing their source.
  • Stale, broken, partial, unavailable, disabled, or unsupported graph state is BLOCKED graph evidence, not permission to assume a small blast radius.
  • A reviewer fallback never converts graph BLOCKED into PASS or widens file ownership.

Verification checklist

  • Report-only mode did not mutate the fixture.
  • Every path is inside approved scope.
  • Backup and manifest predate apply.
  • Verification output is fresh.
  • Restore reproduces original state.

References and scripts

Use the bundled scripts/safe_mutation.py for deterministic file operations and the active project's AGENTS.md for repository-wide mutation rules when present.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.