agentleFS
EndogenAIEndogenAI/dogma/.github/skills/session-retrospective/SKILL.md

session-retrospective

Skill2 starsChanged 8 months agoApache-2.0View on GitHub

Formalises the post-phase insight harvest and substrate encoding loop: articulate lessons learned, gap-analyse which are already encoded, route encoding gaps to the correct fleet agents, and commit the result. USE FOR: closing a phase with ≥2 novel patterns observed; ending a session where new techniques outperformed prior expectations; when a specialist agent produces unexpectedly clean output worth encoding; back-propagating new knowledge into AGENTS.md, guides, skills, and agent files. DO NOT USE FOR: mid-phase check-ins (wait until the phase produces a stable output); sessions under context-window pressure (schedule for next session); tasks that produced no new patterns or lessons.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read docs/guides/session-management.md and docs/guides/workflows.md before deviating from any step below.

    line 12
  2. Distinctive:

    Do NOT run: if:

    line 55
  3. Distinctive:

    After all routing delegations complete, invoke the Review agent with:

    line 142
  4. Distinctive:

    If Review approves all changes, Orchestrator commits via git operations following Conventional Commits:

    line 148
  5. Distinctive:

    If Review flags any change, fix before committing — do not bypass the Review gate.

    line 154
  6. Very specific:

    Do not run under context-window pressure: If the context window is above 75%, write a ## Pre-Compact Checkpoint note (see …

    line 173
  7. Distinctive:

    Scope to genuine lessons: Do not encode obvious, already-documented behaviour.

    line 174

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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

Session Retrospective — Insight Discovery and Substrate Encoding

This skill enacts the Endogenous-First axiom from MANIFESTO.md: new knowledge discovered during a session must flow back into the substrate, not remain as ephemeral chat context. It is governed by AGENTS.md § Per-Phase Execution Checklists and § Session-End Closing Steps. This skill is the session-level enactment of Issue #82 (Dogma Neuroplasticity — back-propagation protocol).

Read docs/guides/session-management.md and docs/guides/workflows.md before deviating from any step below.


Beliefs & Context

This skill implements the back-propagation protocol: new patterns discovered interactively must be encoded durably before they can influence future sessions.

Implements: Issue #82 — Dogma Neuroplasticity — back-propagation protocol

Governed by:

  • AGENTS.md § Per-Phase Execution Checklists — retrospective runs as the close step after the final phase
  • MANIFESTO.md Endogenous-First axiom — endogenous knowledge compounds; chat-only knowledge evaporates

Used by:

  • Executive Orchestrator (runs retrospective at session close)
  • Executive Fleet (receives agent/skill encoding gaps)
  • Executive Docs (receives AGENTS.md / guide encoding gaps)
  • Orchestrator (commits via terminal after Review approval)
  • Review agent (validates additions before commit)

Companion skill: session-management — retrospective runs during Session Close phase (Step 5 of that skill)

Encoding circuit — the complete back-propagation loop this skill enacts:

Sprint observation → Retrospective harvest → Gap-analysis → Routing plan → Issue seed → Workplan → Phase delegation → Commit

Steps 2–4 map to this skill's Harvest, Gap-Analyse, and Route steps; steps 5–8 execute in subsequent sessions from the routing plan. The circuit closes only when a commit lands — scratchpad notes alone do not close it. The highest-leverage point is step 3: a routing entry missing the Section field causes re-scoping at step 6 or 7, costing tokens that a complete entry at step 3 would have eliminated.


When to Run

Trigger this skill when any of the following conditions hold after a phase or session:

TriggerExample
≥2 novel patterns observed this phaseNew delegation pattern worked; new anti-pattern avoided
New technique outperformed prior expectationSkill invocation faster than direct agent call
Specialist agent produced unexpectedly clean outputReviewer catches something the pattern didn't anticipate
Session produced a pattern not yet in any SKILL.md or AGENTS.mdA new compression trick, routing shortcut, or gap-fill strategy
A lesson was learned the hard way (anti-pattern hit)Heredoc silently corrupted content; retry loop wasted tokens

Do NOT run if:

  • The context window is under pressure — write a ## Pre-Compact Checkpoint note and schedule the retrospective for the next session instead.
  • The phase produced no new patterns (routine execution of a well-encoded procedure).
  • You are mid-phase and the output is not yet stable.

Workflow

Step 1 — Harvest

Articulate what was learned this phase or session. Write a ## Retrospective — <YYYY-MM-DD> section in the active scratchpad (.tmp/<branch-slug>/<today>.md) with:

## Retrospective — YYYY-MM-DD

### Lessons Learned
1. <Lesson: one sentence — what happened and why it matters>
2. ...

### Anti-patterns Avoided
1. <What was tempting but skipped — and why it would have failed>

### Efficiency Observations
1. <What took longer than expected / shorter than expected — why>

Token target: ≤400 tokens for the Harvest section. Compress observations; do not include raw session history.

Inputs: scratchpad, workplan phase status, your own session memory. Output: a numbered lessons list with ≤10 items, written to the scratchpad.


Step 2 — Gap-Analyse

Delegate to an Explore subagent with a narrow, scoped prompt:

"For each lesson below, search AGENTS.md, docs/guides/, .github/agents/*.agent.md, and .github/skills/*/SKILL.md to identify whether it is already encoded. Return a table: Lesson | Already Encoded In | Gap (Yes/No). Return ≤800 tokens."

Pass the numbered lessons list as input. Do not pass the full scratchpad — Focus-on-Descent applies: narrow context in, compressed result out.

Expected output (from the Explore subagent):

#LessonAlready Encoded InGap?
1...AGENTS.md § FooNo
2...—Yes

The subagent appends its output under ## Gap-Analysis Output in the scratchpad.

Compression target: ≤800 tokens returned.


Step 3 — Route

For each lesson with Gap = Yes, route to the correct fleet agent using the Routing Table below. Write a ## Routing Plan section in the scratchpad listing each gap, its target agent, and the specific file(s) to update.

Routing Table

Lesson domainTarget agentFiles to update
Session lifecycle procedureExecutive Fleet (this agent).github/skills/session-management/SKILL.md
Agent posture or guardrailExecutive Fleet.github/agents/<slug>.agent.md
New reusable workflow skillExecutive Fleet.github/skills/<new-slug>/SKILL.md
AGENTS.md convention (fleet-wide)Executive DocsAGENTS.md (root)
Guide update (workflow, testing, github)Executive Docsdocs/guides/<guide>.md
Subdirectory AGENTS.mdExecutive Docsdocs/AGENTS.md, .github/agents/AGENTS.md
Research synthesis gapExecutive Researcherdocs/research/<topic>.md
Script or automation gapExecutive Scripterscripts/<script>.py

Constraint: route one gap per delegation. Do not batch all gaps into a single agent invocation — batching reduces accountability and makes Review harder. Each delegation gets a focused scope.

Routing entry format (for execution handoff across sessions): each row in the ## Routing Plan section should contain six fields:

| Gap# | Lesson (one sentence) | Target Agent | Target File | Section | Change (one sentence) |

A routing plan entry with these six fields is sufficient context to reconstruct a full delegation brief in a later session without re-reading session history. The Section field is the highest-value addition: without it, the receiving agent re-derives the insertion point at delegation cost. Grounded in 2026-03-13 corpus sprint: the 6-row routing plan from 2026-03-12 reconstructed all 6 Phase 4 delegations without re-derivation.

Inputs to each downstream agent: the specific lesson text + the target file(s) + the reasoning for the gap. Expected outputs: a file edit (new section, new bullet, or new file) ready for Review.


Step 4 — Verify

After all routing delegations complete, invoke the Review agent with:

"Review the following additions for consistency with existing substrate. Confirm each addition: (1) does not duplicate existing content, (2) follows the formatting conventions of its host file, (3) maintains cross-reference density (links back to MANIFESTO.md or AGENTS.md where applicable), (4) introduces no TODO placeholders."

Pass the list of changed files. The Review agent returns a per-file verdict.

If Review approves all changes, Orchestrator commits via git operations following Conventional Commits:

docs(session): encode <topic> lessons from <date> retrospective

If Review flags any change, fix before committing — do not bypass the Review gate.


Example Invocation Prompt

The canonical invocation for this skill is:

"What lessons have we learned? Delegate querying which ones are encoded and which aren't, routing to the fleet to update the executive orchestrator and appropriate workflows."

This phrase is the trigger. When an orchestrator uses this phrasing (or a close variant), apply this skill's four-step procedure in sequence.


Constraints

  • Never encode lessons as chat-only notes. A lesson that exists only in conversation history will not survive compaction. Write it to the scratchpad first, then to the substrate.
  • Never batch all lessons into one delegation. One gap → one delegation → one focused change → one Review checkpoint.
  • Always run the Review gate before committing. Retrospective-sourced changes must be validated for consistency — they arrive from informal observation, not from a formal spec.
  • Do not run under context-window pressure. If the context window is above 75%, write a ## Pre-Compact Checkpoint note (see session-management § Compaction Guard) and defer the retrospective to the next session open.
  • Scope to genuine lessons. Do not encode obvious, already-documented behaviour. The bar is: "a future agent would behave differently if this were encoded."
  • Do not modify MANIFESTO.md during a retrospective. That document encodes foundational axioms. Retrospectives update operational substrate (AGENTS.md, guides, skills, agent files) — not axioms.

Completion Criteria

The retrospective is complete when:

  • ## Retrospective — <date> section written to active scratchpad
  • Gap-analysis table produced (Explore subagent output in scratchpad under ## Gap-Analysis Output)
  • All Yes-gap lessons routed to correct fleet agents, one per delegation
  • Each delegated agent has produced a file edit
  • Review agent has returned Approved verdict for all changed files
  • Orchestrator has committed with a Conventional Commit message referencing the retrospective date
  • Session summary notes that retrospective was run and which gaps were filled

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.