agentleFS
maee-comaee-co/cc-autoship/skills/session-retro/SKILL.md

session-retro

Skill0 starsChanged 5 months agoMITView on GitHub

Analyze how the session actually went and propose improvements to skills, hooks, rules, and workflows.

  • Reads credentials

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, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 4

    Distinctive

    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
  1. Distinctive:

    Before ending a session, run these in order:

    line 48
  2. Very specific:

    Check whether --issue is present

    line 61
  3. Distinctive:

    Look back at the conversation during the session and analyse it along the angles below.

    line 97
  4. Distinctive:

    If a proposal overlaps with the existing infrastructure collected in step 2b:

    line 124
  5. Very specific:

    When the --issue flag is given, file only the High-priority proposals as GitHub issues.

    line 163
  6. Distinctive:

    After creating an issue, append its URL to the report

    line 173
  7. Very specific:

    Never put .env contents or token information in the report

    line 189

“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-retro

A skill that looks back at the working patterns of a session and proposes process and infrastructure improvements. It analyses them in five categories: new skills, new hooks, new rules, workflow improvements, and settings tweaks.

How it differs

SkillFocusOutput
An external logging skill (optional)What was done (a record)An external note (not bundled in this kit; only if you added one)
reflexion:memorizeImproving the agent's knowledgeCLAUDE.md
/session-retroProcess and infrastructure improvement proposalsThe terminal + a GitHub issue

Usage

# Basic run
/session-retro

# Specify the number of commits
/session-retro --commits 20

# File the High-priority proposals as GitHub issues
/session-retro --issue

Arguments

ArgumentDescriptionDefault
--commits NThe number of commits to analyse10
--issueFile the High-priority proposals as GitHub issuesfalse

When to run it

Before ending a session, run these in order:

1. External logging (optional)  -> record what you did externally (only if you added a logging skill)
2. /session-retro               -> print the process improvement proposals
3. /reflexion:memorize          -> accumulate learnings in CLAUDE.md (optional)

Procedure

Step 1: Parse the arguments

  1. Read --commits N (default: 10)
  2. Check whether --issue is present

Step 2: Collect the sources

Collect the following in parallel.

2a. Git information

# Recent commit patterns
git log --oneline -N

# Distribution of changed files
git diff --stat HEAD~N..HEAD 2>/dev/null || echo "not enough commits"

# List of changed files
git diff --name-only HEAD~N..HEAD 2>/dev/null

2b. Existing infrastructure

# Skills (extract the name and description)
for f in .claude/skills/*/SKILL.md; do
  name=$(head -5 "$f" | grep "^name:" | sed 's/name: //')
  desc=$(head -5 "$f" | grep "^description:" | sed 's/description: //')
  echo "- $name: $desc"
done

# Hooks
jq '.hooks // {}' .claude/settings.json

# Rules
ls .claude/rules/*.md

Step 3: Analyse the conversation context

Look back at the conversation during the session and analyse it along the angles below. This is the heart of the skill, and it depends on the LLM's ability to analyse itself.

Patterns to detect

  1. Repeated operations: the same kind of command or tool call issued several times
  2. Routine work: a work flow performed with the same steps every time
  3. Manual verification: checks done by hand that could have been automated
  4. Trial and error: an error → fix → retry loop
  5. Implicit rules: conventions or patterns followed but never written down
  6. Unused skills: situations an existing skill could have handled but was not used for
  7. Workflow deviations: work that stepped outside the flow in dev-flow.md

Step 4: Generate proposals in five categories

Cross-reference the collected data with the conversation context and produce proposals in these five categories.

CategoryWhat it detectsCriteria
skill-candidateTurning a repeated operation into a skillRoutine work repeated twice or more
hook-candidateVerification or conversion that should run automaticallyVerification done by hand every time, routine post-processing after a tool run
rule-candidateImplicit rules / patterns of violationConventions followed but never written down
workflow-improvementImproving the development flow or the use of existing skillsFlow deviations, unused skills
settings-tweakImproving settings.jsonToo few or too many permissions, deny rules to add

Duplicate check

  • If a proposal overlaps with the existing infrastructure collected in step 2b:
    • Complete overlap → drop the proposal
    • Partial overlap (an extension of an existing skill) → classify it as workflow-improvement and propose it as "making better use of an existing skill"

Step 5: Print the report

Print to the terminal in the format below.

Output language: write the report body in the language of the session (the same language you are answering the user in). The template below is the English sample and is not a set of strings to copy verbatim. docs/rules/output-language.md is the SSoT for the fixed label translations and the language-invariant tokens. Fixed regardless of language (never translate): the proposal category values skill / hook / rule / workflow / settings (downstream tallying and branching read these values).

## Session Retro report

### Summary
- Session date: {YYYY-MM-DD}
- Analysed: the conversation context + {N} git commits
- Proposals found: {total} (skill: {n}, hook: {n}, rule: {n}, workflow: {n}, settings: {n})

### Proposals

#### 1. [{category}] {proposal title}

**Observed**: {the concrete pattern observed during the session}
**Proposal**: {what the improvement actually is}
**Priority**: High / Medium / Low
**Implementation estimate**: Small / Medium / Large

---
(repeat per proposal)

### Next actions

Proposals recommended for immediate action:
1. {the highest-priority proposal and why}

Step 6: File GitHub issues (only with --issue)

When the --issue flag is given, file only the High-priority proposals as GitHub issues.

gh issue create \
  --title "[infra] session-retro: {proposal title}" \
  --body "{proposal details (observation, proposal, category, implementation estimate)}" \
  --label "enhancement"
  • With several High proposals, file each as its own issue
  • After creating an issue, append its URL to the report

Edge cases

CaseResponse
Zero commits (an investigation session)Skip the git analysis and work from the conversation context alone
Zero proposalsReport that "the current setup is already well optimized"
A proposal that duplicates an existing skillClassify it as workflow-improvement and propose it as "a better way to use it"
A very short sessionReport that there is not enough data to analyse

Safety rules

  • Propose only, never implement (Edit/Write are not in allowed-tools)
  • Creating or changing skills, hooks, and rules is left to the user's judgment
  • Filing an issue with --issue does not need maintainer approval
  • Never put .env contents or token information in the report

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.