agentleFS
algopianalgopian/chromeclaw-skills/skills/git/SKILL.md

Git

Skill4 starsChanged 8 months agoMITView on GitHub

Browser-based git operations via isomorphic-git — init, clone, commit, push, pull, branch, merge, diff, and file management, all running in a browser sandbox with IndexedDB persistence.

37 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use sql, api 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.
  • thechandanbhagatSkill

    sql

    Write SQL queries, optimize database performance, design schemas, and debug SQL issues. Use for database operations, query optimization, and schema design.

    Also in 3 projects that use this

  • xiaobei930Skill

    api

    RESTful API design patterns and best practices. Use when creating endpoints, designing APIs, or implementing routes.

    Also in 3 projects that use this

  • MicrosoftSkill

    scaffold

    Also in 4 projects that use this

  • MicrosoftSkill

    perf

    Speed and memory performance rules for Rust crates, the Node addon, webui-framework, and webui-router.

    Also in 3 projects that use this

  • mrgoonieSkill

    devops

    Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.

    Also in 3 projects that use this

  • AnthropicSkill

    debug

    Structured debugging session — reproduce, isolate, diagnose, and fix. Trigger with an error message or stack trace, "this works in staging but not prod", "something broke after the deploy", or when behavior diverges from expected and the cause isn't obvious.

    Also in 7 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 29 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    All modules run in the sandbox (no tabId needed).

    line 21

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

Git Skill

Pure JavaScript git client running entirely in the browser via isomorphic-git + LightningFS (IndexedDB-backed filesystem). No server, no CLI, no native git required. Repos persist across sessions.

How It Works

execute_javascript({
  action: "execute",
  path: "skills/git/code/<module>.js",
  args: { action: "<action>", ... }
})

All modules run in the sandbox (no tabId needed). Git operations use IndexedDB for storage — repos survive page reloads and browser restarts.

Prerequisites

Two-step initialization (once per session):

# Step 1: Load bundled vendor libraries (sets window.LightningFS, window.git, window.GitHttp)
execute_javascript({
  action: "bundle",
  files: [
    "skills/git/code/vendor/lightning-fs.min.js",
    "skills/git/code/vendor/isomorphic-git.umd.min.js",
    "skills/git/code/vendor/git-http-web.umd.js"
  ]
})

# Step 2: Initialize globals
execute_javascript({
  action: "execute",
  path: "skills/git/code/setup.js",
  args: { action: "init" }
})

Libraries are bundled locally in vendor/ — no CDN or network required for initialization.

Common Workflows

Initialize + Write + Commit

# 1. Load vendor libs + init (once per session — see Prerequisites above)
# 2. Init repo
git.js { action: "init", dir: "myproject" }

# 2. Create files
git.js { action: "writeFile", dir: "myproject", filepath: "README.md", content: "# My Project" }
git.js { action: "writeFile", dir: "myproject", filepath: "src/index.js", content: "console.log('hello')" }

# 3. Stage + commit
git.js { action: "add", dir: "myproject", filepath: "README.md" }
git.js { action: "add", dir: "myproject", filepath: "src/index.js" }
git.js { action: "commit", dir: "myproject", message: "Initial commit", author: { name: "User", email: "user@example.com" } }

Clone + Read + Modify

# 1. Clone a public repo (shallow)
git.js { action: "clone", dir: "lightning-fs", url: "https://github.com/nicolo-ribaudo/lightning-fs", depth: 1 }

# 2. List and read files
git.js { action: "listFiles", dir: "lightning-fs" }
git.js { action: "readFile", dir: "lightning-fs", filepath: "README.md" }

# 3. Check status
git.js { action: "statusMatrix", dir: "lightning-fs", filter: "changed" }

Branch + Merge

# 1. Create and switch branch
git.js { action: "branch", dir: "myproject", name: "feature-x", checkout: true }

# 2. Make changes + commit
git.js { action: "writeFile", dir: "myproject", filepath: "feature.js", content: "// new feature" }
git.js { action: "add", dir: "myproject", filepath: "feature.js" }
git.js { action: "commit", dir: "myproject", message: "Add feature X" }

# 3. Switch back and merge
git.js { action: "checkout", dir: "myproject", ref: "main" }
git.js { action: "merge", dir: "myproject", theirs: "feature-x" }

Push to Remote

# Requires auth token (e.g. GitHub PAT)
git.js { action: "addRemote", dir: "myproject", remote: "origin", url: "https://github.com/user/repo" }
git.js { action: "push", dir: "myproject", auth: { username: "oauth2", token: "ghp_xxxx" } }

Diff Changes

# Working tree vs HEAD
git.js { action: "diff", dir: "myproject", filepath: "README.md" }

# Between two refs
git.js { action: "diff", dir: "myproject", filepath: "README.md", ref1: "main", ref2: "feature-x" }

# Summary of all changed files
git.js { action: "diffSummary", dir: "myproject" }

Workspace Management

workspace.js { action: "list" }          # List all repos in IndexedDB
workspace.js { action: "info", dir: "myproject" }   # Repo details
workspace.js { action: "du" }            # Storage usage
workspace.js { action: "delete", dir: "old-repo" }  # Delete repo

Module Reference

setup.js — Library Initialization

ActionArgsReturns
init (default)corsProxy?Init filesystem from loaded vendor globals. No-op if already ready.
status—Report whether libraries are loaded
reset—Tear down globals, force re-initialization

Requires: Vendor files loaded first via bundle action (see Prerequisites). Bundled libraries: @isomorphic-git/lightning-fs@4.6.2, isomorphic-git@1.27.1. Globals set: window.__gitFs, window.__git, window.__gitHttp, window.__gitCorsProxy, window.__gitReady.

git.js — Git Operations

Repository Operations

ActionRequired ArgsOptional ArgsDescription
initdirdefaultBranchInitialize empty git repo
clonedir, urlauth, depth, singleBranch, ref, corsProxy, noCheckoutClone remote repo (default: shallow, single branch)
listFilesdirrefList tracked files

Staging & Status

ActionRequired ArgsOptional ArgsDescription
statusMatrixdirfilter, patternStatus of all files (human-readable). filter: "changed"|"staged"|"unstaged"
statusdir, filepath—Status of single file
adddir, filepath—Stage file(s). filepath can be string or array.
removedir, filepath—Remove/unstage file

Status codes: unmodified, new,untracked, added,staged, modified,unstaged, modified,staged, modified,partially-staged, deleted,unstaged, deleted,staged, absent.

Commits & History

ActionRequired ArgsOptional ArgsDescription
commitdir, messageauthorCreate commit. Default author: ChromeClaw.
logdirdepth, ref, filepathView commit history (default depth: 10)
resolveRefdir, ref—Resolve ref to SHA

Author format: { name: "Name", email: "email@example.com" }

Branching

ActionRequired ArgsOptional ArgsDescription
branchdir, namecheckoutCreate branch (optionally checkout)
deleteBranchdir, name—Delete branch
listBranchesdirremoteList branches
currentBranchdir—Get current branch name
checkoutdir, refforceSwitch branch/ref
mergedir, theirsauthorMerge branch into current

Remote Operations

ActionRequired ArgsOptional ArgsDescription
addRemotedir, urlremoteAdd remote (default: "origin")
deleteRemotedir, remote—Remove remote
listRemotesdir—List remotes
fetchdirremote, ref, auth, depth, corsProxyFetch from remote
pulldirremote, ref, auth, author, corsProxyPull (fetch+merge)
pushdirremote, ref, auth, force, corsProxyPush to remote

Auth format: { username: "oauth2", token: "ghp_xxxx" } — passed per-call, never stored.

File Operations (Working Tree)

ActionRequired ArgsOptional ArgsDescription
readFiledir, filepathencodingRead file content (default: utf8)
writeFiledir, filepath, contentencodingWrite file (auto-creates parent dirs)
deleteFiledir, filepath—Delete file
mkdirdir, filepath—Create directory
readBlobdiroid, filepath, refRead from git object store

Diff

ActionRequired ArgsOptional ArgsDescription
diffdir, filepathref1, ref2Compare file between refs/working tree. Returns both contents.
diffSummarydirref1, ref2List all changed files between two refs or working tree

Config & Tags

ActionRequired ArgsOptional ArgsDescription
getConfigdir, path—Get git config value (e.g. "user.name")
setConfigdir, path, value—Set git config value
tagdir, valueref, forceCreate tag
listTagsdir—List tags

workspace.js — Repo Management

ActionRequired ArgsOptional ArgsDescription
list (default)——List all top-level dirs, mark git repos
infodir—Repo details: branch, branches, remotes, last commit, tags
deletedir—Recursively delete a repo
existsdir—Check if repo/dir exists
du—dirEstimate storage (file count + size)

Authentication

Auth is per-call — never stored in globals:

{ "auth": { "username": "oauth2", "token": "ghp_xxxx" } }

Supports:

  • GitHub PATs: { username: "oauth2", token: "ghp_..." }
  • GitLab tokens: { username: "oauth2", token: "glpat-..." }
  • Username/password: { username: "user", password: "pass" }

Known Limitations

  • CORS proxy required for remote ops — default proxy (cors.isomorphic-git.org) is public/shared
  • No merge conflict resolution — conflicting merges will fail
  • Large repos limited by IndexedDB (~50MB-2GB depending on browser); always use shallow clone
  • No submodules — not supported by isomorphic-git
  • Binary files — readFile defaults to utf8; use encoding: null for binary
  • No SSH — HTTPS only (browser limitation)

Testing

// Unit tests (sandbox, no setup needed)
execute_javascript({ action: "execute", path: "skills/git/code/tests/test-unit.js" })

// E2E tests (requires vendor bundle + setup.js init first)
execute_javascript({ action: "bundle", files: [
  "skills/git/code/vendor/lightning-fs.min.js",
  "skills/git/code/vendor/isomorphic-git.umd.min.js",
  "skills/git/code/vendor/git-http-web.umd.js"
] })
execute_javascript({ action: "execute", path: "skills/git/code/setup.js", args: { action: "init" } })
execute_javascript({ action: "execute", path: "skills/git/code/tests/test-e2e.js" })

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.