S self evolution

From xg-gh-25/SwarmAI · View interactive version

S self evolution is an AI agent skill from the GitHub repository xg-gh-25/SwarmAI. Manage governance (SOUL principles, AGENT/STEERING rules, gates): classify, capture, promote, refine, retire, compress. TRIGGER: \"add rule\", \"promote this correction\", \"steeringify\", \"加条规则\". NOT FOR: one-off file edits.

How to use this skill

Skill file

Self-Evolution — Governance Lifecycle Manager

Manages the Three-Layer Governance OS: Principles → Rules → Gates.

Read INSTRUCTIONS.md for the full protocol.

Six Operations

| Operation | Trigger | What It Does |

|-----------|---------|-------------|

| CLASSIFY | Any governance change proposed | Classify layer, parent principle, check overlap and size delta |

| CAPTURE | User correction detected | Write C-entry with bias tag (A/B/C/D) |

| PROMOTE | Pattern seen 3x OR user approves | Elevate from EVOLUTION → AGENT/STEERING (absorbs steeringify) |

| REFINE | Principle not precise enough | Sharpen existing principle/rule wording |

| RETIRE | Rule covered by gate, or 30d idle | Remove from active rules, record in EVOLUTION |

| COMPRESS | 3+ rules share same root | Merge into single rule with broader coverage |

Trigger Detection (unchanged from v1)

🔴 Reactive — Capability gap

🟡 Proactive — Better way exists (deferred)

🟢 Correction Capture — User pushback → C-entry with bias tag

🔵 Stuck — Going in circles

Priority: Stuck > Reactive > Correction > Proactive

Limits: Max 3 triggers/session. 60s cooldown.

Bias Classification (on every correction)

| Bias | Pattern | Indicator |

|------|---------|-----------|

| A | Premature completion | "Good enough", skip review, defer known issue |

| B | Inference over evidence | Assert without reading, stale memory |

| C | Productivity over quality | Rush output, shallow analysis |

| D | Surrender on obstacle | Give up, ask user to compensate |

Admission, not a count budget (enforced on PROMOTE/REFINE)

There is no count cap (AGENT.md § Intake Gate): the real risk is attention dilution, which no

count measures. Every new rule passes three questions — a NO blocks it: (1) a genuinely new

axis? overlap → fold into the existing rule; (2) load-bearing — can I name the failure it

prevents? (3) belongs here — principle → SOUL, one-off → EVOLUTION, better as a mechanism →

SOUL P7. Before drafting, ask whether a clearer skill, a better tool result, a mechanism or an

edit to an existing rule fixes it: a new sentence in the prompt is the last resort. An addition

that would dilute the set must REPLACE an existing rule or not land.

Intake Classification (on every governance change)

Before writing to SOUL/AGENT/STEERING:

  1. Layer: principle / rule / gate / knowledge?
  2. Parent: which SOUL principle?
  3. Overlap: "$SWARM_BACKEND_BIN" cognition find --in context,evolution --query "<proposed text>" (SOUL / AGENT /

STEERING / SELF are context files), entry by entry; list the top matches and say fold-into or new-axis.

  1. Delta: what the change removes, and the file's size before → after.
  2. Source: user / correction / pipeline / self-detect

Output brief → the user approves. Governance is never auto-written; 3× evidence only makes a

proposal eligible.

Config

| Key | Default | Effect |

|-----|---------|--------|

| enabled | true | Kill switch |

| max_triggers_per_session | 3 | Per-session cap |

| promotion_threshold | 3 | Same-class corrections needed before a proposal is surfaced |

| deprecation_days | 30 | Days idle before retirement candidate |

Writing to EVOLUTION.md

Never edit EVOLUTION.md: Cognitive Distillation Flow's writer is its only writer.

(promoted / retired), is submitted as one complete unit bound to that user message:

`"$SWARM_BACKEND_BIN" ingest submit --source S1 --evidence last-user

--payload-json - with "kind":"cognition", "scope":"agent" and "type":"correction"`

(bias tag in the title). A status change is a new unit that names the entry it updates;

CDF links it with supersedes, the old text stays.

extracts them from the session after it ends.

STEERING.md is a user file: change it only through the workspace editor API with the

expected_revision of its latest GET, after the user approves the text.

Verification

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.