agentleFS
AhmiDarrowAhmiDarrow/RemedyAI/skills/self-inject/SKILL.md

self-inject

Skill5 starsChanged 23 days agoApache-2.0View on GitHub

Run one test-gated self-improvement round on the Remedy codebase: draft a change, snapshot the diff, gate it with tests only, apply (restart sidecar / rebuild SPA) on green or roll back on red, record in the ledger, and continue. Use when self-improve, hot-inject, self-dev, fix our own code, "improve yourself", or run the auto-improvement loop.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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. Very specific:

    Do a change-safety blast-radius pass before drafting.

    line 41
  2. Very specific:

    Use normal file_edit / file_write tools.

    line 45
  3. Distinctive:

    Do not touch generated/lock files unless the change requires it.

    line 46
  4. Distinctive:

    Run the verification for the changed tree(s):

    line 54
  5. Very specific:

    Use the self_inject.gate() helper (driven by project_fingerprint.suggest_verify) where available instead of typing commands by hand.

    line 61
  6. Distinctive:

    Do not retry-loop or silently keep a failing diff.

    line 71
  7. Distinctive:

    If the user asked for the loop, draft the next improvement and repeat.

    line 80

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Self-inject (Remedy improves Remedy)

Goal

Close the loop on Remedy improving this repo. One round = draft a change, audit it with tests only, apply it to the running product on green or roll it back on red, record the result, and keep going. Never commit red; never leave the tree or the running product broken.

When to use

  • User says self-improve, hot-inject, improve the codebase, fix our own code, self-dev.
  • Triggered on command, or automatically by the sidecar scheduler (starts at boot when enabled). Organism learning ticks every ~60s with no user prompt; ruff self-heal waits for ~5 minutes of user-turn idle on a clean tree.

Round steps (in order)

1. Orient + blast radius

git status -sb
git log -5 --oneline
  • Name which tree(s) the change touches: Python sidecar (src/remedy/) and/or desktop SPA (desktop/src/).
  • Do a change-safety blast-radius pass before drafting. Bound the diff.

2. Draft

  • Use normal file_edit / file_write tools. Keep the change minimal and focused.
  • Do not touch generated/lock files unless the change requires it.

3. Snapshot (rollback point)

  • Capture git diff before gating so a red round can be reverted exactly.

4. Gate — tests only

Run the verification for the changed tree(s):

TreeGate
Pythonuv run pytest -q (ruff/mypy as warnings, not hard fails)
Desktopcd desktop && npm test

Use the self_inject.gate() helper (driven by project_fingerprint.suggest_verify) where available instead of typing commands by hand.

5. Apply or roll back

  • GREEN → apply:
    • Python change → restart the sidecar so live source takes effect.
    • Desktop change → rebuild the SPA (cd desktop && npm run build) + re-resolve WebUI dir + hard-refresh, if the change must reach the WebUI.
  • RED → roll back (git checkout -- <paths>), record the failure, stop the round. Do not retry-loop or silently keep a failing diff.

6. Record

  • Append the outcome to the ledger: ~/.remedy/self_inject_ledger.jsonl (diff-id / gate commands + exit codes / outcome / commit or revert ref).

7. Continue

  • If the user asked for the loop, draft the next improvement and repeat.
  • Otherwise return to idle (next round waits for the idle trigger or another command).

Safety

DoDon't
Test-gate every roundCommit a red diff
Snapshot before editingLeave a broken working tree
Respect instance_lock / single serveRestart mid-messenger-poll
Stop on first redSilent retry loops / thrash

Related skills

  • self-dev-loop — full orchestration (inject → gauntlet → soak → stress → ship)
  • change-safety — blast radius before multi-file work
  • project-etiquette — ship gates
  • gauntlet-security · soak-product · stress-suite

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.