git-workflow-enforcer
БесплатноБез исполняемых скриптовНе проверенEnforce git commits after every phase and task to enable rollback and prevent lost work. Auto-trigger when completing phases, tasks, or when detecting…
от marcusgoll★ 97 звёзд на GitHubОб этом скилле
- Detect uncommitted changes: Run
git status --porcelain - Classify change type: Phase completion, task completion, or file modification
- Generate commit message: Use Conventional Commits format based on context
- Validate safety: Check branch, merge conflicts, commit message format
- Execute commit: Stage files and commit with generated message
- Provide feedback: Show commit hash and rollback command
Example:
Context: Task T001 completed
❌ UNCOMMITTED CHANGES DETECTED
Modified: api/models/message.py
Created: api/tests/test_message.py
✅ AUTO-COMMITTING with generated message:
feat(green): T001 implement Message model to pass test
Implementation: SQLAlchemy model with validation
Tests: 26/26 passing
Coverage: 93% (+1%)
✅ COMMITTED: abc123f
Rollback: git revert abc123f
Phase completion markers:
- "Phase N complete"
- "/specify complete", "/plan complete", "/tasks complete"
- "analysis complete", "optimization complete"
- Phase command finishing
Task completion markers:
- "T### complete", "task ### done"
- "task-tracker mark-done" command
- "mark task complete"
Change detection:
git status --porcelainreturns non-empty- Files created/modified/deleted
- Working tree dirty before phase transition
[optional body]
[optional footer]
**Auto-detection logic:**
| Context | Type | Scope | Subject Template |
|---------|------|-------|------------------|
| Phase 0 | docs | spec | create specification for {feature} |
| Phase 0.5 | docs | clarify | resolve {n} clarifications for {feature} |
| Phase 1 | docs | plan | create implementation plan for {feature} |
| Phase 2 | docs | tasks | create task breakdown for {feature} ({n} tasks) |
| Phase 3 | docs | analyze | create cross-artifact analysis for {feature} |
| Phase 4 (RED) | test | red | {taskId} write failing test for {description} |
| Phase 4 (GREEN) | feat | green | {taskId} implement {description} to pass test |
| Phase 4 (REFACTOR) | refactor | - | {taskId} improve {description} |
| Phase 5 | docs | optimize | complete optimization review for {feature} |
| Phase 6 | docs | preview | create release notes for {feature} v{version} |
**Body generation:**
- Phase commits: Include metrics (task count, criteria count, etc.)
- Task commits: Include evidence (tests, coverage, commit hash)
- Fix commits: Include root cause and solution
See [references/commit-templates.md](references/commit-templates.md) for complete templates.
</commit_message_generation>
</quick_start>
<workflow>
<detection_phase>
**1. Monitor for Commit Triggers**
Check for uncommitted changes when:
- Phase command completes
- task-tracker mark-done-with-notes called
- User mentions "commit", "save progress", etc.
```bash
# Check for uncommitted changes
git status --porcelain
# If non-empty output → uncommitted changes exist
Phase completion:
- Extract phase name from workflow state or command
- Extract feature slug from current directory
- Get artifact file paths (spec.md, plan.md, etc.)
Task completion:
- Extract TaskId from task-tracker parameters or conversation
- Extract task description from tasks.md
- Get phase marker ([RED], [GREEN], [REFACTOR])
- Extract evidence (tests, coverage) from completion context
File modification:
- Analyze changed files to infer purpose
- Check git log for recent commit patterns
- Default to "chore" type if unclear
Check 1: Branch safety
CURRENT_BRANCH=$(git branch --show-current)
if "$CURRENT_BRANCH" =~ ^(main|master)$; then
❌ BLOCKED: Direct commits to main/master not allowed
Recommendation: git checkout -b feat/{feature-slug}
Exit code: 1
fi
if ! "$CURRENT_BRANCH" =~ ^(feat|feature|bugfix|fix|hotfix|chore)/; then
⚠️ WARNING: Branch name doesn't follow convention
Expected: feat/*, bugfix/*, hotfix/*, chore/*
Current: $CURRENT_BRANCH
Proceed? (auto-yes in non-interactive mode)
fi
Check 2: Merge conflicts
# Check for conflict markers
if grep -r "<<<<<<<" . --exclude-dir=.git; then
❌ BLOCKED: Unresolved merge conflicts detected
Resolve conflicts before committing
Exit code: 1
fi
# Check git status for conflicts
if git status | grep -q "both modified"; then
❌ BLOCKED: Merge conflicts in git status
Run: git s
Установить git-workflow-enforcer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл git-workflow-enforcer?
Enforce git commits after every phase and task to enable rollback and prevent lost work. Auto-trigger when completing phases, tasks, or when detecting uncommitted changes. Auto-commit with Conventional Commits format. Verify branch safety, check for merge conflicts, enforce clean working tree. Block completion if changes not committed.
Как установить скилл git-workflow-enforcer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл git-workflow-enforcer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic