Agent Retrospective
Turn recent repo experience into durable AGENTS.md guidance without polluting the file with one-off history.
Workflow
- Read the repo
AGENTS.md if it exists.
- Find the repo's execution source of truth if one exists, such as
progress.md, architecture notes, release docs, or contribution guides.
- Inspect the most relevant recent evidence:
- current user instructions,
- recent diffs or commits,
- audits and validation results,
- recurring bugs or workflow friction,
- product or architecture decisions that became clearly locked.
- Extract candidate lessons from that evidence.
- Filter each lesson before editing
AGENTS.md.
- Apply only the lessons that pass the filter.
- Validate the touched documentation or metadata with the smallest effective checks.
- Report what changed, what you intentionally did not encode, and any remaining open questions.
Lesson Filter
Keep a lesson only if it is durable and likely to improve future work on this repo.
Prefer lessons that:
- improved correctness,
- reduced repeated workflow friction,
- clarified review expectations,
- locked a stable engineering or product rule,
- prevented a regression more than once,
- improved validation discipline,
- improved documentation hygiene.
Reject lessons that are:
- one-off debugging facts,
- temporary workarounds,
- stale architecture that is no longer active,
- narrow implementation details better kept in code or tests,
- session handoff notes,
- unresolved speculation,
- personal preference with no demonstrated benefit.
Editing Rules
- Edit
AGENTS.md conservatively. Prefer tightening or adding a short rule over rewriting the whole file.
- Keep guidance operational and evergreen. Do not turn
AGENTS.md into a changelog.
- Preserve the file's role separation:
- evergreen engineering standards belong in general sections,
- repo-specific constraints belong in project-specific sections.
- If the repo has a baseline template such as
AGENTS_OG.md, do not modify it unless the user explicitly asks.
- If
AGENTS.md does not exist, create a minimal baseline with only:
- engineering philosophy,
- planning expectations,
- validation discipline,
- review or audit expectations,
- documentation hygiene,
- question or assumption rules.
- Add repo-specific rules to a new file only when they are supported by explicit user guidance or stable evidence from the repo.
Evidence Priority
When sources conflict, prefer:
- direct user instructions in the current session,
- the repo's declared execution source of truth,
- the current implementation and tests,
- recent commits and validation logs,
- older docs.
If an older AGENTS.md rule conflicts with current reality, update the rule instead of preserving stale guidance.
Output
When finishing:
- summarize the durable lessons you encoded,
- call out any notable lessons you rejected and why,
- state what validation you ran,
- note whether
AGENTS.md already existed or had to be created.
1---2name: agent-retrospective3description: Review the current repo state, recent diffs or commits, execution docs, and AGENTS.md to extract durable workflow lessons and update AGENTS.md conservatively. Use when finishing a work session, after a bug-fix or validation pass, during release readiness, or when the user asks to refine repo instructions, coding standards, or lessons learned. If AGENTS.md is missing, create a minimal baseline from explicit user guidance and stable repo evidence.4---56# Agent Retrospective78Turn recent repo experience into durable `AGENTS.md` guidance without polluting the file with one-off history.910## Workflow11121. Read the repo `AGENTS.md` if it exists.132. Find the repo's execution source of truth if one exists, such as `progress.md`, architecture notes, release docs, or contribution guides.143. Inspect the most relevant recent evidence:15 - current user instructions,16 - recent diffs or commits,17 - audits and validation results,18 - recurring bugs or workflow friction,19 - product or architecture decisions that became clearly locked.204. Extract candidate lessons from that evidence.215. Filter each lesson before editing `AGENTS.md`.226. Apply only the lessons that pass the filter.237. Validate the touched documentation or metadata with the smallest effective checks.248. Report what changed, what you intentionally did not encode, and any remaining open questions.2526## Lesson Filter2728Keep a lesson only if it is durable and likely to improve future work on this repo.2930Prefer lessons that:31- improved correctness,32- reduced repeated workflow friction,33- clarified review expectations,34- locked a stable engineering or product rule,35- prevented a regression more than once,36- improved validation discipline,37- improved documentation hygiene.3839Reject lessons that are:40- one-off debugging facts,41- temporary workarounds,42- stale architecture that is no longer active,43- narrow implementation details better kept in code or tests,44- session handoff notes,45- unresolved speculation,46- personal preference with no demonstrated benefit.4748## Editing Rules4950- Edit `AGENTS.md` conservatively. Prefer tightening or adding a short rule over rewriting the whole file.51- Keep guidance operational and evergreen. Do not turn `AGENTS.md` into a changelog.52- Preserve the file's role separation:53 - evergreen engineering standards belong in general sections,54 - repo-specific constraints belong in project-specific sections.55- If the repo has a baseline template such as `AGENTS_OG.md`, do not modify it unless the user explicitly asks.56- If `AGENTS.md` does not exist, create a minimal baseline with only:57 - engineering philosophy,58 - planning expectations,59 - validation discipline,60 - review or audit expectations,61 - documentation hygiene,62 - question or assumption rules.63- Add repo-specific rules to a new file only when they are supported by explicit user guidance or stable evidence from the repo.6465## Evidence Priority6667When sources conflict, prefer:681. direct user instructions in the current session,692. the repo's declared execution source of truth,703. the current implementation and tests,714. recent commits and validation logs,725. older docs.7374If an older `AGENTS.md` rule conflicts with current reality, update the rule instead of preserving stale guidance.7576## Output7778When finishing:79- summarize the durable lessons you encoded,80- call out any notable lessons you rejected and why,81- state what validation you ran,82- note whether `AGENTS.md` already existed or had to be created.