Co-Pilot / 辅助式
更新于 a month ago

here-be-git

Iintellectronica
0.1k
intellectronica/agent-skills/skills/here-be-git
76
Agent 评分

💡 摘要

此技能初始化 Git 仓库并配置代理提交说明和 .gitignore 文件。

🎯 适合人群

软件开发人员项目经理DevOps 工程师技术写作人员

🤖 AI 吐槽:看起来很能打,但别让配置把人劝退。

安全分析低风险

风险:Low。建议检查:文件读写范围与路径穿越风险。以最小权限运行,并在生产环境启用前审计代码与依赖。


name: here-be-git description: 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.

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:

  1. Check if AGENTS.md exists in the current directory
  2. If it exists, append the commit instructions to it
  3. If it doesn't exist, create it with the commit instructions

The commit instructions to add:

## Git Workflow - Always commit your changes when you have completed a task or reached a logical stopping point - Use clear, descriptive commit messages that explain what was done and why - Ensure the working directory is clean (all changes committed) before ending your session

After creating or updating AGENTS.md:

  1. Check if CLAUDE.md exists in the current directory
  2. If it doesn't exist, create it with just @AGENTS.md followed by a newline
  3. If it exists but doesn't already have @AGENTS.md at the top, prepend @AGENTS.md followed by a newline to the existing content
  4. Commit both files together 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:

  1. Generate an appropriate .gitignore based on their input
  2. 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-*
  3. Include any specific files or patterns the user mentions
  4. Commit the .gitignore with 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
五维分析
清晰度8/10
创新性6/10
实用性9/10
完整性8/10
可维护性7/10
优缺点分析

优点

  • 自动化 Git 初始化和配置。
  • 鼓励最佳提交信息实践。
  • 可定制的 .gitignore 生成。

缺点

  • 需要用户输入以配置 .gitignore。
  • 可能无法涵盖工作流程中的所有边缘情况。
  • 假设用户已安装 Git。

相关技能

ccmp

A
toolCo-Pilot / 辅助式
86/ 100

“看起来很能打,但别让配置把人劝退。”

claude-mods

A
toolCo-Pilot / 辅助式
86/ 100

“看起来很能打,但别让配置把人劝退。”

agentic-qe

A
toolCo-Pilot / 辅助式
86/ 100

“看起来很能打,但别让配置把人劝退。”

免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。

版权归原作者所有 intellectronica.