Ace context evolution

From mouadja02/skills · View interactive version

Ace context evolution is an AI agent skill from the GitHub repository mouadja02/skills. Use when long-lived agents, project memories, system prompts, or playbooks are repeatedly summarized, rewritten, or optimized and risk losing domain detail, provenance, or execution learnings.

How to use this skill

Skill file

ACE Context Evolution

Treat durable context as an evolving playbook, not a shrinking summary. Preserve proven detail, update incrementally, and require execution evidence before promoting lessons.

Use When

Core Workflow

  1. Separate context into stable instructions, reusable strategies, task evidence, rejected ideas, and open questions.
  2. Add new lessons as patches with source evidence instead of rewriting the whole context.
  3. Promote only lessons backed by run logs, tests, user corrections, benchmark deltas, or repeated task outcomes.
  4. Preserve provenance: include where the lesson came from, when it was observed, and when it should be reconsidered.
  5. Prune by invalidating obsolete entries, not deleting them silently, when future agents may need the reason.
  6. Run a collapse check before accepting a rewrite.

Context Patch Contract

Every durable update should include:

| Field | Purpose |

| --- | --- |

| claim | The reusable instruction or lesson |

| evidence | Command, trace, eval, user correction, issue, PR, or paper source |

| scope | Where it applies and where it does not |

| owner | File, skill, team, or subsystem affected |

| expiry | Date or condition for review |

| conflicts | Older rules this supersedes or limits |

See context-evolution-contract.md for templates.

Collapse Guard

Before replacing any long-lived context, compare the old and new versions:

python scripts/context_update_guard.py OLD.md NEW.md

Reject the rewrite if it drops named tools, file paths, commands, metric thresholds, failure modes, citations, or explicit constraints without an invalidation note.

Common Mistakes

| Mistake | Fix |

| --- | --- |

| Rewriting the whole context after each run | Apply small patches grouped by evidence type |

| Treating shorter as better | Preserve operational details that changed behavior |

| Promoting one-off anecdotes | Require repeated evidence or a clear high-impact failure |

| Deleting stale rules | Mark them superseded and keep the reason if future agents may rediscover them |

| Mixing task scratchpads with durable memory | Keep transient reasoning out of permanent context |

References

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.