# Precommit Workflow Management

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-mishrashardendu22-agent-skills-precommit-workflow-management`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [MishraShardendu22](https://agentstack.voostack.com/s/mishrashardendu22)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [MishraShardendu22](https://github.com/MishraShardendu22)
- **Source:** https://github.com/MishraShardendu22/agent-skills/tree/main/.agents/skills/precommit-workflow-management
- **Website:** https://github.mishrashardendu22.is-a.dev

## Install

```sh
agentstack add skill-mishrashardendu22-agent-skills-precommit-workflow-management
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Pre-Commit Workflow Management Skill

This skill explains how to maintain, configure, and execute the intelligent pre-commit hook workflow in the **GitHub Backup Automation System** monorepo.

## 1. Branch-First Development

> [!IMPORTANT]
> **CREATE A LOCAL BRANCH FIRST**: Always start by creating a local branch from `main`:
> ```bash
> git switch -c MishraShardendu22/main/
> ```
> Never make changes directly on `main`.

---

## 2. Pre-Commit Architecture

The pre-commit workflow lives in `.githooks/pre-commit` and is tracked directly in version control.

```text
Staged Changes Detected (git diff --cached)
  │
  ├── Only Go files changed ───────► Run Go formatting, vet, tests, build (~1-2s)
  ├── Only Python files changed ───► Run Pyright typecheck, agent test suite (~3-4s)
  ├── Only Frontend files changed ─► Run Biome lint, Next.js build (~10-12s)
  ├── Only Documentation changed ──► Fast-path bypass (<0.2s)
  └── Global / Config / Manual ────► Full monorepo validation gate (~20s)
```

---

## 2. Key Features

1. **Selective Staged-File Execution**: Avoids unnecessary work by only running checks relevant to the files staged for the commit.
2. **Fast-Path for Documentation**: Commits containing only markdown (`*.md`), text (`*.txt`), or asset files skip expensive build and test pipelines.
3. **Subshell Directory Isolation**: Every check runs in a subshell `(cd "${REPO_ROOT}" && ...)` to prevent current working directory drift.
4. **Fail-Fast with Remediation**: Aborts immediately on failure and outputs exact commands needed to fix the problem.
5. **Zero External Runtime Dependencies**: Implemented in portable POSIX bash, requiring no npm wrapper packages (like Husky) at the repository root.

---

## 3. Operations & Maintenance Runbook

### Activating the Hook Locally
```bash
make hooks-install
# Or: ./scripts/install-hooks.sh
```

### Manually Running Pre-Commit Gate
```bash
make pre-commit
```

### Bypass Flags (Emergency Only)
```bash
# Skip tests for quick drafts
SKIP_TESTS=1 git commit -s -S -m "chore: draft"

# Skip builds for lightweight edits
SKIP_BUILDS=1 git commit -s -S -m "fix: comment"

# Force full validation across all subsystems
PRECOMMIT_ALL=1 git commit -s -S -m "feat: core change"
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [MishraShardendu22](https://github.com/MishraShardendu22)
- **Source:** [MishraShardendu22/agent-skills](https://github.com/MishraShardendu22/agent-skills)
- **License:** MIT
- **Homepage:** https://github.mishrashardendu22.is-a.dev

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-mishrashardendu22-agent-skills-precommit-workflow-management
- Seller: https://agentstack.voostack.com/s/mishrashardendu22
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
