agentleFS
gofixpointgofixpoint/amika/.agents/skills/distill-session/SKILL.md

distill-session

Skill301 starsChanged 11 days agoApache-2.0View on GitHub

Review the current chat session and distill new conventions, file layouts, frontmatter fields, or workflow rules into the repo's agent docs. Proposes updates to AGENTS.md/CLAUDE.md, skills, and code comments for site-specific invariants, then simplifies and commits.

2 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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when the user asks you to look over the chat session and update the repo's agent docs (AGENTS.md/CLAUDE.md files or skills) or add code …

    line 8
  2. Distinctive:

    If nothing meets the bar, say so and stop.

    line 22
  3. Distinctive:

    Default to sentences over bullets unless items are genuinely parallel.

    line 43
  4. Distinctive:

    Remove redundant directory structure trees when a folder has one file type.

    line 45
  5. Distinctive:

    After committing, show the user the diffstat.

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “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

Distill session learnings

Use when the user asks you to look over the chat session and update the repo's agent docs (AGENTS.md/CLAUDE.md files or skills) or add code comments for non-obvious invariants.

Usage: /distill-session


Phase 1: Identify what to write down

Re-read the session and list every concrete thing future agents would benefit from knowing. Focus on new file layouts or directories, new or required frontmatter fields, section heading conventions, rules about when not to do something, optional fields in existing schemas, and workflow steps the user corrected or explicitly validated.

Also consider code comments: when a learning is a non-obvious invariant or cross-file contract (e.g. "this statement must stay first", "this value is only trustworthy because X strips it upstream"), add a terse comment at the code site rather than a doc entry. Don't suggest comments for self-describing code.

Skip one-off content (the actual work product written this session), things already documented in the repo's agent docs, and anything derivable from sibling files in the same directory.

If nothing meets the bar, say so and stop.

Phase 2: Present the list and confirm

The targets for distilled learnings are:

  • AGENTS.md / CLAUDE.md files (the instruction file closest to the relevant code).
  • Skills, defined under .agents/skills/ or .claude/skills/.
  • Code comments, for non-obvious invariants or cross-file contracts (see Phase 1).

Show the user the distilled list grouped by destination file, mapping each learning to the most appropriate existing file. Propose a new file only when no existing one fits. For each item, name the destination file and give a one-line summary of the change. Ask the user to confirm or trim before editing.

Phase 3: Make the edits

For each confirmed item, edit or create the target file. Match the conventions of the file you're editing. If the repo links these files via symlinks (e.g. a CLAUDE.md symlinked to AGENTS.md, or .claude/skills/ symlinked to .agents/skills/), edit only one side and preserve the link.

Phase 4: Sub-agent simplification pass

Spawn an Explore (read-only) sub-agent and ask it to review only the files changed in this session for opportunities to simplify. Pass the list of changed file paths. Brief it with the project's documentation style, plus these defaults:

  • Cut trivial bullets.
  • Default to sentences over bullets unless items are genuinely parallel.
  • Lead with the sharpest point.
  • Remove redundant directory structure trees when a folder has one file type.
  • Cut sentences whose removal wouldn't lose information.

For source files that only gained a comment, have it review just the added comments: each should be terse and say something the code doesn't.

Have the sub-agent report a punch list of specific simplifications. Don't have the sub-agent edit files; apply its suggestions in the main agent so the user can see the diff. Skip any that would lose information the user explicitly asked for.

Phase 5: Commit

Stage only the distillation files: the agent-doc files and commented source files edited or created in Phase 3 (the same list passed to the Phase 4 sub-agent). If a source file also holds this session's work product, stage only the comment hunks, not the whole file. Do not use git add -A / git add ., since the worktree may contain unrelated in-progress work or the actual session work product. Then commit with a single message describing the distillation, following the repo's commit conventions.

After committing, show the user the diffstat.

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.