sl-git-standard

Manages .gitignore isolation of nested cloned repositories and syncs a git.remote manifest with disk clones.

3|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/ZHLX2005/sl --skill sl-git-standard-zhlx2005
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sl-git-standard
Source: https://github.com/ZHLX2005/sl/tree/main/skills/sl-git-standard
Command: npx skills add https://github.com/ZHLX2005/sl --skill sl-git-standard-zhlx2005

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Nested git repositories cloned into .claude/repo/ pollute the host repository's git status and staging area, while the list of reference repositories drifts out of sync with what is actually on disk. This Skill keeps the host repository clean and keeps the git.remote manifest consistent with the clones. ## Core Features & Use Cases - .gitignore Control: Applies a standard declaration block that ignores cloned repos under .claude/repo/* while whitelisting note directories like _read/ and _self/, plus ignoring .claude/www/ and .tool/ artifacts. - Manifest Consistency: A cross-platform Python script provides check (read-only diff preview), extract (append origin URLs to git.remote with dedup), and sync (clone missing repos, fast-forward updates, optional prune) subcommands. - Use Case: After cloning several reference repositories into .claude/repo/, run the check command to preview drift, then run sync so a teammate on another machine can clone the exact same reference set from the shared git.remote manifest. ## Quick Start Ask the AI to clean up git pollution from nested cloned repositories under .claude/repo/ and check consistency between the git.remote manifest and the clones on disk.

Frequently Asked Questions about sl-git-standard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I ignore nested git repositories in .gitignore?

Use the pattern .claude/repo/* (with the asterisk) instead of .claude/repo/ so the parent directory stays visible to git. Then add negation rules like !.claude/repo/_read/ and !.claude/repo/_read/** to whitelist specific subdirectories.

How do I keep a list of cloned git repositories in sync across machines?

Run the get_git_remotes.py script with the extract subcommand to append each clone's origin URL to a git.remote manifest, then use sync on another machine to clone everything listed. The check subcommand previews drift without changing anything.

Why do gitignore negation rules not work for my subdirectory?

Negation rules fail when the parent directory itself is excluded, such as writing .claude/repo/ instead of .claude/repo/*. Git cannot re-include anything under a fully excluded parent, so the parent must use the /* semi-transparent pattern.

Does the sync script work on Windows, Linux, and macOS?

Yes, get_git_remotes.py is a single cross-platform Python file replacing the old ps1 and sh scripts. Invoke it with an explicit interpreter (py on Windows, python3 on Unix) because it intentionally has no shebang to avoid the Windows python3 stub issue.

Will sync --prune delete my local-only cloned repositories?

No. Clones whose origin is a bare local path are treated as machine-local assets: they are never written to the manifest and never compared, updated, or pruned by check or sync. Only clones with shareable URLs (git@, https, http, file://) are managed.

What do the exit codes of the check command mean?

Exit 0 means the manifest and disk clones are consistent, exit 1 means drift was detected (missing, stale, or conflicting repos), and exit 2 means an error occurred. This makes check usable as a CI gate.