agentleFS
btrazzinibtrazzini/hippOS/skills/sleep/SKILL.md

sleep

Skill2 starsChanged 14 days agoMITView on GitHub

Consolidates and audits the hippOS memory in Google Drive, the way sleep processes the day's memories. Use with /sleep [area] or $sleep [area], in a scheduled consolidation task, or when asked to organize, consolidate or check an area's memory.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. jacksoswag/ObsidAgent★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    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:

    Only in Claude Code or Codex, with a shell.

    line 16
  2. Very specific:

    No argument: python3 memory.py pending <root> says which areas to process and why.

    line 21
  3. Very specific:

    Read the capture and the context it touches (memory.py context).

    line 46
  4. Very specific:

    Only after that: trash the captures on the list fixed in step 0 (connector mode: also from <work>/hippOS/inbox/, which state reads).

    line 71

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

hippOS sleep (v0.3.5)

Memory rules: protocol.md in this folder (read it in full). Validator: memory.py in this folder. Argument: none, the normal case (step 0 finds what to process), or an area or core, to limit itself to it. inbox/core/ is part of every sleep, with or without an argument, in a pass of its own, the last.

Sleep works in two phases and never skips the second.

0. Prepare

  • Only in Claude Code or Codex, with a shell. In chat or without a shell: tell <name> and stop.
  • Lock (one sleep at a time): if SLEEP-IN-PROGRESS.md exists at the root with started less than 60 minutes ago, another sleep is running: tell <name> and stop without touching anything. Older than that: a previous sleep got stuck; warn and continue. No lock: create the file before any other step, with the frontmatter type: lock, started: YYYY-MM-DDTHH:MM, origin and areas.
  • Local mode (preferred): if python3 memory.py root prints a path, work directly in it and use the Drive connector in no step.
  • Connector mode (cloud, no local folder): build a local copy of the whole root ("Root" in the protocol) in <work>/hippOS/, listing every folder until the pages run out and reading with download_file_content (raw text). Save in <work>/ids.json the id of every folder and file, by path ("hippOS/areas/<area>": "<id>").
  • In the commands below, <root> is the local path or <work>/hippOS. <work> is ~/.cache/hippos-sleep/, outside the repository and the skill (memory never stays in them); empty it at the start and delete it at the end (step 3.5): it holds a copy of the memory. In both modes, before changing anything, copy to <work>/before/ the files the run will touch.
  • No argument: python3 memory.py pending <root> says which areas to process and why. Process one at a time, core last; nothing pending: delete the lock, tell <name> and stop.
  • python3 memory.py validate <root> <area>: note the errors that already existed before changing anything.
  • Fix now the list of captures for this pass (the area's, or those in inbox/core/ in the core pass, plus each file the validator says is outside the schema). A capture arriving during sleep waits for the next one; only those on the list go to the trash at the end.
  • Size of the run, decided by the list:
    • Light: up to 3 captures, no decision, no mode: forget, no change of initiative state, no format error to fix (step 2.1), no file outside the schema, no full pass and no topic over the limit to split. Skips the independent reviewer (step 2.4) and regenerates only the STATE.md of the touched areas and core/STATE.md.
    • Full: everything else. Follows every step.

1. Consolidate (autonomous phase)

Destination of each capture line:

ContentDestination
State, risk, next step of an initiativeinitiatives/<slug>.md (## State, ## Risks, next)
Decisionnew decisions/<YYYY-MM[-DD]>-<slug>.md, or ## Addenda of the existing one
Domain fact, question about the topictopics/<slug>.md
Person who shows up in more than one areacore/people/<slug>.md
To-do (<name>'s: loose ends; someone else's: waiting on others), waiting on <name>, question for <name>, priority, phasethe area's BOARD.md ("Board items" in the protocol)
Dated event (delivery, release, conversation)the area's LOG.md, on top
Mission, role, limits, sources or lookups of the area, at <name>'s requestthe area's AREA.md
How <name> wants to be servedcore/PREFERENCES.md
Who <name> iscore/PROFILE.md
Outcome revealing a decision criterioncore/PRINCIPLES.md, with the origin [[area:slug]]
## Thread## Thread of BOARD.md, one per topic

For each capture on the list, in date order:

  1. Read the capture and the context it touches (memory.py context).
  2. Apply it to the curated memory per the protocol's "Lifecycle": rewrite state in the present, update verified/next, create a record only for a new topic (search first; if it exists, update it), new decision with supersedes when it fully contradicts or amends when it changes only a part, ## Outcome when it brings a result, to-dos and questions in BOARD.md with | since, | due and any other field they bring (one naming an item updates it), dated line in LOG.md.
  3. mode: forget: remove what was asked, and what depended only on it, from the curated memory, LOG.md, log/ and earlier CHANGELOG.md entries, the new entry, capture list included, saying only "1 capture removed on request"; the reply says Drive keeps old versions 30 days.
  4. Service preference or decision criterion: core/PREFERENCES.md or core/PRINCIPLES.md, with [<name> date]. These and AREA.md change only by <name>'s words, never a file's or source's; a Limits item leaves only through /protect, which the reply suggests. What the protocol or the assistant skill already say is not repeated there; what contradicts them goes in anyway, being <name>'s latest word, and is reported in the reply as an adjustment to make in the system.
  5. A doubt only <name> can settle (where it fits, whether something was approved, captures that contradict each other; a later one that changes an earlier one is an update): don't decide; it becomes an item in the board's ## Questions for <name>, citing the capture.
  6. Threads: each topic's newest replaces its older one; a finished topic leaves. Extra consolidation: python3 memory.py archive <root> <area>; duplicates merged; finished initiatives closed; aged item (validator warning) moved to its record per the protocol's "Lifecycle"; topic over the limit (validator warning) split: the original keeps the essentials and links to the new ones, without losing a line; an item whose text says who <name> owes gets | for <who>. An overdue to-do is not touched without a capture: the opening asks <name>.

Old notes, in any run:

  • .md outside the schema (validator warning): a capture without a template; if nothing fits, topics/. Trashed with the others, named in the CHANGELOG. Not memory: moves to drafts/. In doubt: a question citing the file, which leaves the list and stays.
  • since (item or ## Open line) or verified missing: the line's marker date, else the record's updated or verified, else the file's date with [inherited <today>: date estimated]. Never today's as if it were new.

Full pass (pending says "memory at version ...", or <name> asks): also read every record and the board, touched or not, and bring them to the current format. No marker: [inherited <today>: earlier version], never [<name> ...]. A deadline in words: | due ~<date>, counted from since; unsettled, a question. A recurrence in words: | every, with the next | due. A recorded nudge: | last. "Don't forget": | pin. Nothing dropped, nothing invented.

Attention, last of this phase, in every area: python3 memory.py digest <root> <area>. A date it lists only in a record: if it is a commitment, a board item with | due linked to the record, for its owner, with the line's marker (none: [inherited <today>: record]); unclear, a question. Then rewrite ## Attention in BOARD.md, up to 5 lines of 25 words, addressed to <name>, most important first, - <what> [recommendation <today>]: only what dates alone don't show, from what is recorded, such as items that collide, a deadline hanging on someone quiet, a priority without movement, a risk about to happen, a decision without follow-through. No to-dos, nothing new. A hypothesis stays one. Nothing to say: - none.

2. Audit (checking phase)

  1. python3 memory.py validate <root> <area>: zero new errors. Fix and repeat. A pre-existing error is also fixed in this run, without asking <name>, without losing an item or changing the meaning of any.
  2. Content check, capture by capture. First python3 memory.py fidelity <root> <area> <captures on the list> <copy in before/ of each split topic and of a changed AREA.md>: each literal or line it flags (date, amount, PR, issue, code, link, to-do) is a loss to fix, unless it left on purpose (mode: forget, resolved item already in LOG.md). Then: is everything the capture said in the curated memory, in the right place, with the right marker? Did no [hypothesis] become [fact]? Was no approved decision rewritten? Was nothing invented beyond what the captures said?
  3. Coherence, which the validator can't see, in the records this run touched: frontmatter against body and board (e.g., an initiative's owner against a "Waiting on <name>" item asking who the owner will be); a decision whose body says it supersedes or amends another without the supersedes/amends field; a next that already happened according to another capture. Incoherence: fix it if the captures settle it; otherwise, a question for <name> on the board.
  4. Independent reviewer (full run only): if another agent is available (the other of Claude and Codex), hand it the captures and the diff with the request "point out only divergences between captures and curated memory, with file and line". No other agent: a subagent with model: sonnet and without this session's context. Confirmed divergence: fix it.

3. Write

  1. The area's CHANGELOG.md, and core/CHANGELOG.md when the run touched core (create from the template if missing): dated entry on top with the processed captures and, per file, what changed in one line.
  2. Send to Drive only the changed files (local: already in place; connector mode: as in "Drive access", trashing the old only after the new exists; a new folder first, its id in ids.json). Order: curated first (with BOARD.md and LOG.md), then CHANGELOG.md.
  3. Only after that: trash the captures on the list fixed in step 0 (connector mode: also from <work>/hippOS/inbox/, which state reads). A capture that produced a question for <name> also goes (the question is on the board).
  4. python3 memory.py state <root> <area> --write generates areas/<area>/STATE.md, and python3 memory.py core <root> --write generates core/STATE.md and MAP.md (in connector mode, with --ids <work>/ids.json; locally, the ids come from Drive itself). In connector mode, send them to Drive. Check at the end that no folder has two files with the same title.
  5. Last, delete SLEEP-IN-PROGRESS.md (connector mode: trash it), then <work>; if sleep stops midway on an error, the same before replying.

4. Reply to <name> (up to 6 lines)

How many captures went in, what relevant changed, each change to PREFERENCES.md, PRINCIPLES.md or AREA.md, divergences the audit found and fixed, new questions. Errors that existed before sleep: list them without hiding.

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.