mcpField
H
here-be-git

here-be-git

github.com/intellectronica开发298528 次安装27 周前更新
代码仓库

关于 here-be-git

here-be-git 是用于初始化 Git 仓库的技能,也可按需添加 Agent 提交说明和 .gitignore。它会引导用户完成仓库设置,并提交生成的配置文件。

主要功能

  1. 01初始化 Git 仓库
  2. 02向 AGENTS.md 添加提交说明
  3. 03按指定模式创建 .gitignore
  4. 04提交生成的配置文件

适用场景

  1. 01在目录中启用 Git 跟踪
  2. 02为 Agent 设置仓库提交规则
  3. 03添加语言或 IDE 忽略模式

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/intellectronica/agent-skills --skill here-be-git

安装后在 Claude Code 中输入/here-be-git确认已加载。

详细介绍

这里有 Git

初始化 Git 仓库,并可选地配置 Agent 工作流。

工作流

步骤 1:初始化 Git 仓库

在当前工作目录中运行 git init。确认仓库已初始化,并告知用户。

步骤 2:Agent 提交说明

询问用户:

您希望我添加说明,要求 Agent 在完成任务后始终进行提交吗?

如果用户确认:

  1. 检查当前目录中是否存在 AGENTS.md
  2. 如果存在,将提交说明追加到其中
  3. 如果不存在,创建文件并写入提交说明

要添加的提交说明:

## 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.**

创建或更新 AGENTS.md 后,使用恰当的提交说明进行提交。

步骤 3:Gitignore 配置

询问用户:

您希望我创建 .gitignore 吗?如果希望,请问要包含哪些风格或模式?(例如,Node.js、Python、macOS、IDE 文件,或特定文件/模式)

如果用户提供了风格或模式:

  1. 根据用户的输入生成合适的 .gitignore
  2. 对于常见风格,包含标准模式:
    • Node.js:node_modules/、dist/、.env、*.log 等
    • Python:__pycache__/、*.pyc、.venv/、venv/、.env、*.egg-info/ 等
    • macOS:.DS_Store、.AppleDouble、.LSOverride、._*
    • IDE 文件:.idea/、.vscode/、*.swp、*.swo、*.sublime-*
  3. 包含用户提及的任何特定文件或模式
  4. 使用恰当的提交说明提交 .gitignore

如果用户拒绝,则跳过此步骤。

注意事项

  • 如果目录中已经初始化了 git,告知用户并跳至步骤 2
  • 使用 AskUserQuestion 工具进行确认
  • 保持提交原子化,并使用清晰的说明

评论

支持 Markdown