commitly/skills/commitly.md
2026-01-05 02:23:21 -05:00

69 lines
2.3 KiB
Markdown

# Commitly Skill
Use this skill when you need to commit and/or push changes across multiple git repositories in the monorepo.
## What is Commitly?
Commitly is a Babashka script located at `commitly/commitly` that commits and pushes changes across all modified git subrepositories in the ajet-industries monorepo.
## Usage
```bash
./commitly/commitly [-p] <commit-message>
```
### Options
- `-p` - Push changes after committing. If no commit message is provided with `-p`, it will skip committing and just push all subrepos.
### Examples
**Commit all modified repos with a message:**
```bash
./commitly/commitly "fix: update configuration"
```
**Commit and push all modified repos:**
```bash
./commitly/commitly -p "feat: add new feature"
```
**Just push all repos (no commit):**
```bash
./commitly/commitly -p
```
## How It Works
1. **Discovery**: Scans the current directory for subdirectories containing `.git` folders
2. **Detection**: Checks each repository for uncommitted changes using `git status --porcelain`
3. **Commit**: Runs `git add -A` and `git commit -m "<message>"` for each modified repo
4. **Push**: If `-p` flag is present, runs `git push` for each successfully committed repo (or all repos if no message provided)
## When to Use
Use commitly when you've made changes across multiple services (service-manager, www, gateway, etc.) and want to commit them all with the same message, rather than cd-ing into each directory individually.
## Architecture Context
The monorepo contains multiple independent git repositories:
- `service-manager/` - Orchestration service
- `www/` - Dashboard website
- `gateway/` - Nginx reverse proxy
- `commitly/` - This tool itself
- `just-vibes/` - Other projects
Each has its own `.git` directory and is deployed independently via Gitea Actions when pushed to main.
## Error Handling
- If any repository fails to commit, commitly exits with code 1 and reports which repos failed
- If any repository fails to push (when `-p` is used), commitly exits with code 1 and reports which repos failed
- Repos are processed independently - one failure doesn't stop others from being processed
## Requirements
- Babashka must be installed (`bb` command available)
- The script must be executable: `chmod +x commitly/commitly`
- Each subrepo must have a git remote configured for pushing