agentleFS
denysmdenysm/wiki-kit/skills/wrap/SKILL.md

wrap

Skill1 starsChanged 5 days agoMITView on GitHub

Close the session in one word: writes the lessons note in the /wiki:ll format and files it with one script call (notes index, log, the project's state note, commit), pushes where the project's rules say, rebuilds the search index only after a large import, then gives a pasteable prompt for the next chat and the budget report. Use when the user ends the work, in any wording (en): wrap up, wrap, that's it, we're done, end of session, close the session, digest this chat, finish. (ru): итог, финиш, подведи итог, конец, закрываем, сворачиваемся, закругляемся, ну всё, на сегодня всё, переварить чат, переварить в вики. (uk): підсумок, кінець, закриваємо, згортаємось, на сьогодні все. Not for ending a single step inside ongoing work.

  • Commits and pushes

46 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use start, update and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AnthropicSkill

    start

    Set up your bio-research environment and explore available tools. Use when first getting oriented with the plugin, checking which literature, drug-discovery, or visualization MCP servers are connected, or surveying available analysis skills before starting a new project.

    Also in 5 projects that use this

  • AnthropicSkill

    update

    Sync tasks and refresh memory from your current activity. Use when pulling new assignments from your project tracker into TASKS.md, triaging stale or overdue tasks, filling memory gaps for unknown people or projects, or running a comprehensive scan to catch todos buried in chat and email.

    Also in 3 projects that use this

  • LangChainSkill

    remember

    Review the current conversation and capture valuable knowledge — best practices, coding conventions, architecture decisions, workflows, and user feedback — into persistent memory (AGENTS.md) or reusable skills. Use when the user says: (1) remember this, (2) save what we learned, (3) update memory, (4) capture learnings.

    Also in 3 projects that use this

  • termdockSkill

    recall

    Retrieves cross-session memories about past decisions, lessons, and patterns. Use when user asks about prior work, past decisions, or mentions a feature. Triggers include check memory, what did we decide, how did we solve.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    build

    Build the TypeSpec Rust emitter from source. Run this after cloning the repo, after pulling changes, or when TypeScript source files have been modified.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 7 projects that use this

  • +1 more from anthropics

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 40 edited versions we read keep these.

  • 1

    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. Very specific:

    Do not look for the wiki, read _index.md, log.md or the state note, or read a file to edit it: the script does that.

    line 19
  2. Distinctive:

    If the session produced nothing worth keeping (a lookup, a short answer), say so in one line and only run the budget report (step 2, last …

    line 31
  3. Very specific:

    Write <wiki root>/raw/notes/YYYY-MM-DD-ll-<slug>.md with one Write.

    line 36
  4. Very specific:

    Only what a later session would otherwise rediscover: a trick that worked, a trap with its fix, a measured number.

    line 43

“Common” is measured: kept by at least 6 in 10 of the 40 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

Wrap (close the session)

One word from the user replaces the end-of-session checklist. Only reading this conversation needs the model; the rest is one script call. A closing costs the number of model turns times the context size (at 250k tokens every turn re-reads the whole session), so the target is three turns:

  1. one Write: the lessons note (and a memory file in the same turn, if any);
  2. one Bash: file, commit, push, index and budget, chained;
  3. the report.

Do not look for the wiki, read _index.md, log.md or the state note, or read a file to edit it: the script does that. Read something only when a step fails.

0. Is it really the end?

The trigger words are common ("ну всё", "конец", "that's it"). Treat the message as a wrap only when it closes the work, not when it closes one step, voices frustration, or is part of a sentence about something else. If in doubt, ask one short question in the user's language ("Закрываем сессию: уроки в вики, коммит, промпт на следующий чат?") and wait. A bare trigger after finished work needs no question.

If the session produced nothing worth keeping (a lookup, a short answer), say so in one line and only run the budget report (step 2, last command), then step 3.

1. Turn 1: the lessons note

Write <wiki root>/raw/notes/YYYY-MM-DD-ll-<slug>.md with one Write. The wiki root and its rules (language, .local.md, confidentiality) come from the project's CLAUDE.md, which is already in context. This replaces /wiki:ll: the same note format, without its search and filing turns.

  • Topic: where the session's work belongs. Work across topics: one note per topic, all in this turn. No topic fits: ask.
  • Only what a later session would otherwise rediscover: a trick that worked, a trap with its fix, a measured number. Not a retelling of the chat. Usually 2–7 lessons; none is a valid result (then no note, go to step 2 without ll_file.py).
  • A lesson never carries secrets; the audit hook refuses the Write if it does.
  • The whole transcript is saved only on request (/wiki:session promote).
---
title: "Lessons Learned: <session theme> (session <id>)"
type: notes
source: session
ingested: YYYY-MM-DD
authors: [<user>, Claude Code]
source_date: YYYY-MM-DD
tags: [lessons-learned, <topic tags>]
lesson_kind: lessons-learned
lesson_count: N
category: notes
confidence: high
summary: "<N lessons, one clause each>"
---

# Lessons Learned: <session theme>

> Extracted from session <id> on YYYY-MM-DD. <One sentence of scope.>

## Lesson 1: <title>

**Category**: gotcha | pattern | rule | discovery | correction
**Context**: <what was being done>
**Symptom**: <the error or failure, exact message>
**Root cause**: <why>
**Fix**: <what was done>
**Rule**: <one sentence that holds beyond this case>

Quote every free-text frontmatter value. lesson_count equals the number of ## Lesson N headings. <id> is the first 8 characters of the session id (the budget report prints it); drop (session <id>) when unknown.

Durable facts about the user or how they want to work go to memory, as the memory rules say, not into the wiki: write the memory file in this same turn; its index line is appended in step 2.

A lesson that makes a wiki article wrong is fixed in the article only when the claim is wrong now (extra turns), and counted with --articles M; anything else waits for the next compile.

2. Turn 2: one Bash call

<kit> is the kit path the project's CLAUDE.md names, else $(cd -P <this skill's folder>/../.. && pwd). Chain with ; so the budget report prints even when a step fails:

K=<kit>/scripts
python3 -I $K/ll_file.py <note> --apply --commit --co-author "<the session's Co-Authored-By value>" \
  --state "<done, with commit ids>" --state "<verified, how>" --state "<open>" \
  [--state-section "<heading>"] [--articles M] [--push];
[printf '%s\n' '- [Title](file.md) — hook' >> <memory dir>/MEMORY.md;]
[git -C <repo> add <own paths> && git -C <repo> commit -m "<op>: …" [&& git -C <repo> push];]
[nohup python3 -I $K/search.py index <hub> > ~/.cache/wiki-kit/index.log 2>&1 &]
<the project's usage report, else: python3 -I $K/claude_usage.py --session last brief>
  • ll_file.py adds the note's row to raw/notes/_index.md and its line to the wiki's log.md, appends each --state bullet to the last ## section of the hub README.md (--state-section names or creates a section, --readme another file), checks the note and the bullets with the raw_check.py rules (exit 2, nothing written), and commits only these files as ll: <topic> — N lessons: <theme>. What is already there is not added again. Without --apply it prints the plan.
  • State bullets: what was done (with commit ids), what was verified and how, what is still open. Close an item only with its evidence. No --state when the session did not change the state.
  • Other repositories the session wrote to and left uncommitted: commit them in the same call, by explicit paths of this session's files (another session may have drafts there), following the project's git rules and attribution lines.
  • --push and git push only where the project or memory says to push (for example the kit itself). A pre-push or leak check that refuses: fix or ask, never --no-verify.
  • The search index only when the session added more than a few dozen files to a wiki; search.py query refreshes changed files by itself.

3. Turn 3: the report

Short, in the user's language: lessons filed (topic, file, count), state updated, commits per repository (pushed or local), index (skipped or started), then:

  • Next-chat prompt: a fenced block the user can paste into a new chat as is: goal, state with commit ids and paths, the first concrete step, what not to redo. No placeholders. If nothing is pending, say so instead.
  • Budget: the usage report's output from step 2 (if it failed, say so). Its last answer ≈ $… is the cost of this closing.
  • One line: the session can be cleared (/clear) or a new chat started.

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.