Git Commit Design & Workflow Standards
This skill defines the **Commit Design Taxonomy**, commit classification standards, message conventions, validation requirements, and the strict **Human-In-The-Loop (HITL) Push Boundary** for all AI agents and human contributors in the **GitHub Backup Automation System** repository.
1. High-Priority Rule: Frequent, Atomic & Explanatory Commits
**COMMIT FREQUENTLY AT EACH LOGICAL STEP (More Commits = More Explanatory Work)**: * AI agents and developers MUST prioritize creating granular, atomic Git commits at **each important milestone** or distinct phase of work rather than bundling everything into one monolithic commit at the end. * Each commit MUST encapsulate a **single logical responsibility** (e.g. creating Dockerfiles, adding an API route, optimizing a database index, updating UI styling, documentation updates). * **Never mix unrelated concerns in a single commit** (e.g. do NOT combine a database migration with a frontend UI redesign). * Granular commits make code reviews clear, bisecting simple, rollbacks safe, and capture explanatory architectural progress in the repository history.
2. Commit Design Taxonomy & Classification
All commits in this repository MUST be classified under one of the standard commit categories outlined below. Agents must only construct commits adhering strictly to this taxonomy:
┌─────────────────────────────────────────────────────────────────────────┐
│ COMMIT DESIGN TAXONOMY │
├───────────────┬─────────────────────────────────────────────────────────┤
│ feat │ Feature Addition (new capability, endpoint, service) │
│ perf │ Performance Optimization (caching, query/vector speed) │
│ refactor │ Structural Improvement (cleaner code, zero logic change)│
│ fix │ Bug Fix & Error Resolution (runtime fix, edge cases) │
│ ui / style │ UI & Visual Design (Tailwind, components, theme, layout)│
│ ci / deploy │ CI/CD, Containerization & DevOps (Actions, Docker, YAML)│
│ db │ Database & Migration (idempotent schemas, pgvector) │
│ test │ Testing & Quality Assurance (unit, mock, agent tests) │
│ docs │ Documentation & Specifications (README, SKILL.md, docs) │
│ chore │ Routine Maintenance (dependency updates, tool configs) │
└───────────────┴─────────────────────────────────────────────────────────┘Category 1: Feature Addition (`feat`)
- `feat(observatory): add OpenRouter multi-key automatic failover client`
- `feat(worker): implement SHA-256 archive checksum generation and verification`
- `feat(connectors): add AES-256 encrypted credential vault repository`
- `feat(mcp): implement native GitHub Backup MCP server tool handlers`
Category 2: Improvement & Optimization (`perf`, `refactor`)
- Performance: `perf(<scope>): <short imperative description>`
- Restructuring: `refactor(<scope>): <short imperative description>`
- `perf(db): add GIN index on execution_logs for sub-millisecond FTS queries`
- `perf(observatory): cache OpenRouter model capability registry in-memory`
- `refactor(backend): consolidate WebSocket hub client connection lifecycle`
- `refactor(worker): decouple backup execution loop from direct database calls`
Category 3: Fix & Bug Resolution (`fix`)
- `fix(agent): prevent session crash by rotating OpenRouter key on 429 rate limit`
- `fix(docker): enable --ignore-scripts in Next.js builder for pnpm 10 compatibility`
- `fix(db): ensure migration 000004 applies idempotent alter column statement`
- `fix(ci): resolve go.mod toolchain version mismatch in GitHub Actions runner`
Category 4: UI & Visual Design (`ui`, `style`)
- `ui(dashboard): modernize real-time backup run progress cards and status badges`
- `ui(analytics): add interactive latency distribution charts with recharts`
- `ui(theme): implement high-contrast dark mode color palette for AI chat`
- `ui(components): add confirmation modal for Human-In-The-Loop agent approvals`
Category 5: CI/CD, Containerization & DevOps (`ci`, `deploy`)
- `ci(actions): implement production-grade automated CI/CD pipeline with Docker Hub`
- `feat(deploy): configure Render Blueprint and Vercel project configurations`
- `ci(docker): switch Go builder to golang:alpine for multi-platform compatibility`
- `feat(hooks): configure comprehensive pre-commit and pre-push validation gates`
Category 6: Database & Schema Evolution (`db`)
- `db(migrations): add 000006_create_connectors_table for encrypted credential vault`
- `feat(database): implement Neon multi-environment database branching scripts`
- `db(pgvector): add HNSW vector index generation lifecycle triggers`
Category 7: Testing & Quality Assurance (`test`)
- `test(observatory): add test suite for multi-turn HITL confirmation workflow`
- `test(backend): add unit tests for WebSocket client hub lifecycle and message relay`
- `test(worker): add mock GitHub API server for repository deduplication tests`
Category 8: Documentation & Architectural Blueprints (`docs`)
- `docs(roadmap): specify enterprise SaaS transformation and native MCP ecosystem`
- `docs(skills): document commit design taxonomy and authenticated CLI tooling guide`
- `docs(deployment): document automated CI/CD pipeline and Neon branching runbooks`
3. Mandatory Local Branch First
**ALWAYS CREATE A LOCAL BRANCH FIRST**: Before modifying any files or creating commits, the agent/developer MUST verify they are on a dedicated local feature branch (`<github-username>/<parent-branch>/<feature>`). ```bash git switch -c MishraShardendu22/main/<feature-name> ``` NEVER make changes, staging, or commits directly on `main` or `dev`.
4. The Strict Push Permission Boundary (HITL)
┌─────────────────────────────────────────────────────────┐
│ AGENT DOMAIN │
│ │
│ 1. Modify files for specific logical milestone │
│ 2. Run linters, type checks, and pre-commit gates │
│ 3. Create LOCAL signed Git commit (git commit -s -S) │
│ 4. Repeat steps 1-3 for each milestone │
└────────────────────────────┬────────────────────────────┘
│
[HUMAN REVIEW BOUNDARY]
│
┌────────────────────────────▼────────────────────────────┐
│ HUMAN DOMAIN │
│ │
│ 5. Human inspects git diff and git log │
│ 6. Human decides whether to push or request changes │
│ 7. Human executes git push origin <branch> (or prompts)│
└─────────────────────────────────────────────────────────┘**NO AUTOMATIC REMOTE PUSH**: * Agents are **permitted and encouraged** to create local Git commits (`git commit -s -S`). * Agents must **never** run `git push` or create Pull Requests automatically without explicit user instruction. * Pushing to remote and opening a Pull Request is permitted **ONLY when explicitly requested by the human user** (e.g. *"create a PR to main"*). * All Pull Requests must target **`main`** only.
5. Mandatory Sign-off (`-s`) and Signing (`-S`) Flags
**ALL COMMITS MUST BE SIGNED AND SIGNED-OFF**: Whenever an agent or developer creates a Git commit, it MUST include both `-s` and `-S` flags: * **`-s` (`--signoff`)**: Adds the standard `Signed-off-by: Author <email>` trailer (DCO compliance). * **`-S` (`--gpg-sign`)**: Cryptographically signs the commit with the configured GPG/SSH signing key.
6. Pre-Commit Validation Checklist
Before staging files or creating a local commit, the agent MUST verify that the code passes validation:
# Unified pre-commit validation gate
make pre-commit
# Or individual verifications:
make lint # Checks Biome, Go vet, Pyright
make typecheck # Runs Pyright (Python) and tsc (TypeScript)
make test # Runs Go and Python test suites
make build # Builds Go binaries and Next.js frontend7. Step-by-Step Commit Runbook for AI Agents
Follow this exact sequence whenever recording progress:
```bash
git status
```
```bash
# Stage only files belonging to this logical milestone
git add <path/to/relevant/files>
```
- `feat(...)` for feature additions
- `perf(...)` / `refactor(...)` for improvements & optimizations
- `fix(...)` for bugs & error resolution
- `ui(...)` / `style(...)` for frontend & design
- `ci(...)` / `deploy(...)` for CI/CD, Docker & DevOps
- `db(...)` for database migrations & schemas
- `test(...)` for test suites
- `docs(...)` for documentation & skills
```bash
git commit -s -S -m "<type>(<scope>): <clear descriptive summary>"
```
```bash
git log -n 1 --show-signature --stat
```