agentleFS
manastalukdarmanastalukdar/ai-devstudio/skills/context-save/SKILL.md

context-save

Skill1 starsChanged 7 months agoMITView on GitHub

Save current work-in-progress context as a git WIP commit — captures all staged and unstaged changes with a timestamped stash message so you can switch contexts safely and restore later. Inspired by gstack's context-save skill.

23 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ios-clean, ios-fix and 6 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.
  • Saqlain-811Skill

    ios-clean

    Remove the DebugBridge SPM package and all #if DEBUG wiring from an iOS app. (gstack)

    Also in 5 projects that use this

  • Saqlain-811Skill

    ios-fix

    Autonomous iOS bug fixer. (gstack)

    Also in 5 projects that use this

  • timurgaleevSkill

    document-generate

    Generate missing docs for a feature, module or project as tutorials, how-tos, reference and explanation.

    Also in 7 projects that use this

  • bastosSkill

    ios-design-review

    Review iOS app UI/UX design quality using Apple's design principles and the Liquid Glass-era design language from WWDC25/26. Use when asked for a design review, UX critique, visual design assessment, or evaluation of an app's interface quality, design intent, alignment with the new Apple design system, or usability. Triggers: "design review", "UX review", "visual design critique", "review the UI", "does this design work", "evaluate this interface", "design feedback", "Liquid Glass review".

    Also in 5 projects that use this

  • johnlindquistSkill

    diagram

    Maintain and synchronize Unified Impact Diagrams following Diagram Driven Development (DDD) methodology. Create, update, and manage diagrams that connect user value to technical implementation.

    Also in 4 projects that use this

  • SentrySkill

    spec

    Produce a verified spec — problem, desired outcome, and acceptance criteria — before building. Use when given a GitHub/Linear issue link, when starting from a fuzzy in-conversation idea, or asked to "figure out what to do" / "scope this" / "what should I build" — whenever the *what* isn't yet pinned down. Grills the ambiguities, checks the premise against the code, and produces acceptance criteria you sign off on — then hands to design-first.

    Also in 8 projects that use this

  • +2 more from Saqlain-811

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Early exit: If the working tree is already clean, report it and stop.

    line 17
  2. Very specific:

    If a .claude/sessions/ directory exists, append a note to the active session:

    line 78
  3. Distinctive:

    Merge conflict state: do not save during active merge.

    line 91
  4. Very specific:

    Use /context-restore to undo the WIP commit and restore all changes to the working tree.

    line 97

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

Context Save

I'll snapshot your current work-in-progress into a named git WIP commit so you can switch tasks safely and pick up exactly where you left off. Inspired by gstack's context-save skill.

Token Optimization

Expected range: 100–250 tokens

Patterns used: Bash git commands, early exit (clean working tree)

Early exit: If the working tree is already clean, report it and stop.

Usage

/context-save                        # auto-name from branch and timestamp
/context-save "halfway through auth"  # descriptive label

Step 1 — Check Working Tree

# Verify there is something to save
if git diff --quiet && git diff --cached --quiet; then
    echo "✓ Working tree is clean — nothing to save"
    exit 0
fi

# Show what will be saved
echo "Changes to save:"
git status --short
git stash list | head -3

Step 2 — Stage Everything

# Stage all changes (tracked and untracked) for the WIP commit
git add -A

# Verify staging
git diff --cached --stat

Step 3 — Create WIP Commit

BRANCH=$(git rev-parse --abbrev-ref HEAD)
TIMESTAMP=$(date '+%Y-%m-%d %H:%M')
LABEL="${1:-WIP}"

git commit -m "wip: ${LABEL} [${BRANCH}] ${TIMESTAMP}"

The commit message format: wip: <label> [<branch>] <timestamp>

Example: wip: halfway through auth [feature/oauth] 2026-04-27 14:32

Step 4 — Confirm Save

Context saved — wip: halfway through auth [feature/oauth] 2026-04-27 14:32

  3 files staged, 127 additions, 34 deletions

To restore: /context-restore
To see all WIP saves: git log --oneline | grep "^wip:"

Step 5 — Record in Session State (Optional)

If a .claude/sessions/ directory exists, append a note to the active session:

if ls .claude/sessions/*.json 2>/dev/null | head -1 | grep -q json; then
    ACTIVE=$(ls -t .claude/sessions/*.json | head -1)
    # Append WIP save event to session
fi

Edge Cases

  • Untracked binary files: git add -A includes them; note large files in the confirmation
  • Already on a WIP commit: warn "The current HEAD is already a WIP commit — save anyway? [y/N]"
  • Merge conflict state: do not save during active merge; tell user to resolve conflicts first
  • Detached HEAD: warn that the WIP commit will be orphaned; suggest creating a branch first
  • Submodules: git add -A does not recurse into submodules; note if any are dirty

Restore

Use /context-restore to undo the WIP commit and restore all changes to the working tree.

Safety

This skill creates a git commit — it does not modify history. The WIP commit can always be undone with git reset HEAD~1 --mixed (restores files to working tree) or git reset HEAD~1 --hard (discards changes — use carefully).

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.