here-be-git 精选
个人 agent skills 合集,涵盖多种日常与工程场景。原文:Initialise a git repository with optional agent commit instructions and .gitignore. Use when users say "here be git", "init git", "initialise git", or otherwise indicate they want to set up version control in the current directory.
仓库级简介:该 skill 尚无单独撰写的中文摘要安装方式
cp -r skills/here-be-git ~/.claude/skills/here-be-git把该 skill 目录放进客户端 skills 目录。不同客户端的目录可能不同,Claude Code 默认是 ~/.claude/skills/
/plugin marketplace add intellectronica/agent-skills⚠️ 该命令形态随客户端版本变化,仅在检测到 .claude-plugin/marketplace.json 时展示;不可用时请用「目录复制」。
https://raw.githubusercontent.com/intellectronica/agent-skills/9b0e00ad1b941165e2506545bbfddafa34cf2cb8/skills/here-be-git/SKILL.md下载后另存为 ~/.claude/skills/here-be-git/SKILL.md。链接锁定采集时的 commit,内容与本站展示一致。
整仓一次性获取:git clone --depth 1 https://github.com/intellectronica/agent-skills.git
依赖与权限
- 无需 API Key
- 无需联网
- 依赖外部命令:
gitnodepythonmake - 以上为按正文与 frontmatter 自动推断的信号,仅供参考;安装前建议先阅读原文。
SKILL.md 正文
Here Be Git
Initialise a git repository with optional configuration for agent workflows.
Workflow
Step 1: Initialise Git Repository
Run git init in the current working directory. Confirm to the user that the repository has been initialised.
Step 2: Agent Commit Instructions
Ask the user:
Would you like me to add instructions for the agent to always commit when it's done with a task?
If the user confirms:
- Check if
AGENTS.mdexists in the current directory - If it exists, append the commit instructions to it
- If it doesn't exist, create it with the commit instructions
The commit instructions to add:
## Git Workflow — CRITICAL, MANDATORY, NO EXCEPTIONS
> **THIS IS NOT OPTIONAL.** Every agent operating in this repository MUST follow this workflow after every change, no matter how small. There are ZERO exceptions to this rule. Skipping a commit is never acceptable. If you have made any change to any file, you MUST commit before moving on.
### Rules
1. **ALWAYS commit your changes immediately after completing a task or reaching any logical stopping point.** Do not defer. Do not batch. Do not skip.
2. **ALWAYS commit before ending your session.** The working directory MUST be clean (all changes committed) when you finish. Leaving uncommitted changes is a failure state.
3. **Use clear, descriptive commit messages** that explain what was done and why.
4. **If in doubt, commit.** It is always better to have one commit too many than one too few.
### To be absolutely clear
- "I'll commit later" — **No. Commit now.**
- "It's just a small change" — **Commit it.**
- "I'm about to make another change" — **Commit the current one first.**
- "The user didn't ask me to commit" — **Irrelevant. Commit anyway.**
After creating or updating AGENTS.md, commit it with an appropriate message.
Step 3: Gitignore Configuration
Ask the user:
Would you like me to create a .gitignore? If so, what flavour or patterns should I include? (e.g., Node.js, Python, macOS, IDE files, or specific files/patterns)
If the user provides a flavour or patterns:
- Generate an appropriate
.gitignorebased on their input - For common flavours, include standard patterns:
- Node.js:
node_modules/,dist/,.env,*.log, etc. - Python:
__pycache__/,.pyc,.venv/,venv/,.env,.egg-info/, etc. - macOS:
.DS_Store,.AppleDouble,.LSOverride,._* - IDE files:
.idea/,.vscode/,.swp,.swo,.sublime-
- Include any specific files or patterns the user mentions
- Commit the
.gitignorewith an appropriate message
If the user declines, skip this step.
Notes
- If git is already initialised in the directory, inform the user and skip to Step 2
- Use the AskUserQuestion tool for the confirmation prompts
- Keep commits atomic and well-described
质量与来源
- 所属仓库
- intellectronica/agent-skills
- 仓库星标
- 295
- 最近更新
- 6 个月前
- 采集时间
- 今天
- commit
- 9b0e00ad1b94
- 内容指纹
- sha256:447862aefc644be
- 文件路径
- skills/here-be-git/SKILL.md