agentleFS
nitekeepernitekeeper/atelier/skills/save/SKILL.md

save

Skill0 starsChanged 5 months agoMITView on GitHub

Use when ending a session or at a meaningful checkpoint — captures session state for the next resume.

36 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use query, idea and 7 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.
  • ArtemXTechSkill

    query

    Query data from this vault. USE WHEN user asks about projects, clients, tasks, daily notes. Use grep to extract frontmatter - do NOT read full files.

    Also in 4 projects that use this

  • szweibelSkill

    idea

    Generate a wide field of options when the user is brainstorming, exploring, expanding, or pressure-testing — not recommending or implementing

    Also in 3 projects that use this

  • GoogleSkill

    dashboard

    Configures and launches the GKE Capacity & Triage Dashboard scoped to a GCP project ID, GKE cluster name, or target ML workload ID. Uses the configure-and-launch-dashboard action and launch-workload-dashboard workflow to verify local dashboard health, discover cluster capacity, trigger live scans, and generate deep-linked URLs. Use when the user types "/dashboard", says "launch dashboard", "open dashboard", "show capacity", or "view triage dashboard" with a project, cluster, or workload. Don't use for general workload log querying or automated failure attribution (use the troubleshoot skill).

    Also in 4 projects that use this

  • Microsoft AzureSkill

    lint

    Run all linting and spell checking for TypeScript and Rust code. Run this before committing to catch style issues, clippy warnings, and misspellings.

    Also in 5 projects that use this

  • HK-hubSkill

    defuddle

    Extract clean markdown content from web pages using Defuddle CLI, removing clutter and navigation to save tokens. Use instead of WebFetch when the user provides a URL to read or analyze, for online documentation, articles, blog posts, or any standard web page.

    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 4 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. 0 are common, 11 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 31 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

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

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

    Call save when closing a session or at a meaningful checkpoint.

    line 11
  2. Very specific:

    Settings recommendation (after pre-flight): if startup_check() returned a settings_rec_offer with eligible=True and non-empty changes, read …

    line 29
  3. Distinctive:

    BEFORE proceeding to the rest of this skill.

    line 32
  4. Distinctive:

    Run (from the target project root):

    line 40
  5. Distinctive:

    If clean (no output): skip to step 2.

    line 44
  6. Distinctive:

    If dirty: ask the user for a brief commit message, then:

    line 45
  7. Distinctive:

    If git commit fails, surface the error and do not proceed until the working tree is clean.

    line 50
  8. Very specific:

    If the output is literally .git: not a worktree.

    line 57
  9. Very specific:

    If the output path contains worktrees/ (or worktrees\ on Windows): you are in a linked worktree.

    line 58
  10. Distinctive:

    If the script exits non-zero (conflict, dirty main, detached HEAD): follow its printed recovery instructions.

    line 73
  11. Very specific:

    If the output is empty ([] or no rows): stop. Tell the user: "No projects found in .ai/memex.db.

    line 80
  12. Distinctive:

    Ask: "Does this capture the session correctly?

    line 96
  13. Distinctive:

    If the command exits non-zero or returns an error: abort.

    line 109
  14. Distinctive:

    Ask: "Anything to capture to the knowledge base?

    line 116
  15. Very specific:

    If yes: invoke ingest.

    line 117
  16. Distinctive:

    Never skip Phase A — git state must be clean before writing a session row.

    line 122
  17. Distinctive:

    Always check for worktree (step 2) — leaked worktrees accumulate silently.

    line 123
  18. Very specific:

    Never proceed past a failed session.py write — if the DB write fails, do not confirm success.

    line 124
  19. Very specific:

    Never reference .ai/work.md — that file no longer exists in this architecture.

    line 127

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

save

Session-close command. Commits git state, writes a session row to the DB, and optionally captures session knowledge to Memex. In a git worktree, also merges back to the base branch and cleans up the worktree.

When to use

Call save when closing a session or at a meaningful checkpoint. This is the last thing you do before ending work.

Pre-flight (always first)

Run from scripts.atelier_entrypoint import startup_check; startup_check().

Branch on the returned action:

  • proceed-local — Memex is not installed. Continue with the rest of this skill's recipe; all writes go to the project-local .ai/atelier.db.
  • proceed-memex — Memex is installed and bootstrapped. Continue; all writes go through Memex.
  • prompt-migration — Memex is installed but this project still has a local DB. Read internal/migrate-local-to-memex/SKILL.md and follow its prompt protocol. After the user answers, restart the pre-flight (startup_check() will now return proceed-memex or proceed-local depending on the user's choice).

Settings recommendation (after pre-flight): if startup_check() returned a settings_rec_offer with eligible=True and non-empty changes, read internal/settings-recommendation/SKILL.md and follow its prompt protocol BEFORE proceeding to the rest of this skill. After the user's choice, continue the original command.

Procedure

Phase A — Git state

  1. Check for uncommitted changes. Run (from the target project root):
    git status --short
    • If clean (no output): skip to step 2.
    • If dirty: ask the user for a brief commit message, then:
      git add -A
      git commit -m "<message>"
      If git commit fails, surface the error and do not proceed until the working tree is clean.
  2. Detect worktree. Run:
    git rev-parse --git-dir
    • If the output is literally .git: not a worktree. Skip to Phase B.
    • If the output path contains worktrees/ (or worktrees\ on Windows): you are in a linked worktree. Continue to Phase A-WT.

Phase A-WT (linked worktree only)

  1. Merge back, remove worktree, delete branch. Run:

    python3 atelier/scripts/worktree.py merge-back

    This script:

    • Verifies the main workspace is on the expected base branch and clean.
    • Merges the worktree branch into the base branch with --no-ff.
    • Removes the worktree directory.
    • Deletes the worktree branch.

    If the script exits non-zero (conflict, dirty main, detached HEAD): follow its printed recovery instructions. Do not proceed to Phase B until cleanup is complete or the user explicitly decides to skip cleanup.

Phase B — Write session

  1. Determine context. You need four values before calling session.py write. If you ran load this session they are in working memory. If not:
    • project_id: run python3 atelier/scripts/projects.py list and select the active project. If the output is empty ([] or no rows): stop. Tell the user: "No projects found in .ai/memex.db. Create a project first with projects.py create or confirm you are in the correct target directory." Do not proceed to step 5.
    • agent_id: run python3 atelier/scripts/agents.py list and identify your own agent record by name. Ask the user if your record is ambiguous or missing.
    • phase: read from the project record returned by projects.py list (phase column).
    • status: determine from session state — in-progress, blocked, or complete.
  2. Gather session fields. Draft the following from your working memory of this session, then present as a block for user confirmation:

    current_tasks  : <one sentence — what is in progress right now>
    accomplished   : <what was completed or meaningfully advanced this session>
    next_action    : <first imperative action for the next session>
    status         : in-progress | blocked | complete
    blocking_reason: <required only if status is "blocked">

    Ask: "Does this capture the session correctly? (edit or confirm)" Wait for confirmation before writing.

  3. Write the session. Run:

    python3 atelier/scripts/session.py write <project_id> <agent_id> <phase> <status> \
      --current-tasks "<current_tasks>" \
      --accomplished "<accomplished>" \
      --next-action "<next_action>" \
      [--blocking-reason "<blocking_reason>"]

    (DB: .ai/memex.db)

    If the command exits non-zero or returns an error: abort. Do not confirm success. Surface the error to the user.

    On success, confirm: "Session saved (project [project_id], session [id from output])."

Phase C — Knowledge capture

  1. Offer Memex ingest. Ask: "Anything to capture to the knowledge base? (y/n)"
    • If yes: invoke ingest.
    • If no: done.

Hard rules

  • Never skip Phase A — git state must be clean before writing a session row.
  • Always check for worktree (step 2) — leaked worktrees accumulate silently.
  • Never proceed past a failed session.py write — if the DB write fails, do not confirm success.
  • next_action must be an imperative sentence (e.g., "Run the migration tests"). Reject vague values like "continue" or "TBD".
  • Both projects.py and session.py use .ai/memex.db. Pass no db path; the default is correct.
  • Never reference .ai/work.md — that file no longer exists in this architecture.

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.