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.md exists 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
- 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:
- Check if
CLAUDE.md exists in the current directory
- If it doesn't exist, create it with just
@AGENTS.md followed by a newline
- If it exists but doesn't already have
@AGENTS.md at the top, prepend @AGENTS.md followed by a newline to the existing content
- 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:
- Generate an appropriate
.gitignore based 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
.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
1---2name: here-be-git3description: 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.4---5
6# Here Be Git
7
8Initialise a git repository with optional configuration for agent workflows.
9
10## Workflow
11
12### Step 1: Initialise Git Repository
13
14Run `git init` in the current working directory. Confirm to the user that the repository has been initialised.
15
16### Step 2: Agent Commit Instructions
17
18Ask the user:
19
20> Would you like me to add instructions for the agent to always commit when it's done with a task?
21
22If the user confirms:
23
241. Check if `AGENTS.md` exists in the current directory
252. If it exists, append the commit instructions to it
263. If it doesn't exist, create it with the commit instructions
27
28The commit instructions to add:
29
30```markdown
31## Git Workflow
32
33- Always commit your changes when you have completed a task or reached a logical stopping point
34- Use clear, descriptive commit messages that explain what was done and why
35- Ensure the working directory is clean (all changes committed) before ending your session
36```
37
38After creating or updating `AGENTS.md`:
39
401. Check if `CLAUDE.md` exists in the current directory
412. If it doesn't exist, create it with just `@AGENTS.md` followed by a newline
423. If it exists but doesn't already have `@AGENTS.md` at the top, prepend `@AGENTS.md` followed by a newline to the existing content
434. Commit both files together with an appropriate message
44
45### Step 3: Gitignore Configuration
46
47Ask the user:
48
49> 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)
50
51If the user provides a flavour or patterns:
52
531. Generate an appropriate `.gitignore` based on their input
542. For common flavours, include standard patterns:
55 - **Node.js**: `node_modules/`, `dist/`, `.env`, `*.log`, etc.
56 - **Python**: `__pycache__/`, `*.pyc`, `.venv/`, `venv/`, `.env`, `*.egg-info/`, etc.
57 - **macOS**: `.DS_Store`, `.AppleDouble`, `.LSOverride`, `._*`
58 - **IDE files**: `.idea/`, `.vscode/`, `*.swp`, `*.swo`, `*.sublime-*`
593. Include any specific files or patterns the user mentions
604. Commit the `.gitignore` with an appropriate message
61
62If the user declines, skip this step.
63
64## Notes
65
66- If git is already initialised in the directory, inform the user and skip to Step 2
67- Use the AskUserQuestion tool for the confirmation prompts
68- Keep commits atomic and well-described