К основному содержанию
скилл CX Codex

pre-merge — скилл для Claude Code: проверки перед мержем

Скилл-чеклист, который прогоняет типы, линтер и тесты до коммита, до PR и до мержа в main. Пригодится, когда не хочется ловить поломки уже в ревью.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add bobmatnyc/claude-mpm-skills --skill pre-merge -a claude-code
Открыть на GitHub

Что делает pre-merge

Скилл разбивает подготовку к мержу на три этапа. Перед коммитом — проверка типов, линтер, локальные тесты, отсутствие console.log и закомментированных блоков. Перед PR — описание изменений, ссылки на тикеты, скриншоты для UI, новые тесты, обновлённая документация. Перед мержем в main — зелёный CI, одобрение ревьюера, отсутствие конфликтов, успешные миграции и план отката.

Для каждого языка в скилле лежат готовые команды: для TypeScript и JavaScript это npx tsc --noEmit, npm run lint, npm test, для Python — mypy src/, pylint src/, pytest, для Go — gofmt -l ., golangci-lint run, go test ./.... Отдельные блоки посвящены безопасности API (аутентификация, валидация входа через Zod или Pydantic, защита от SQL-инъекций и XSS) и миграциям базы: файл миграции, прогон на локальной и staging-базе, обратная миграция.

Есть шаблон описания PR с разделами про тесты, скриншоты, ломающие изменения, влияние на производительность и план отката. В конце — пример скрипта pre-commit.sh и настройка хуков через Husky или pre-commit. Скилл помечен как user-invocable: false и disable-model-invocation: true: сам он не вызывается ни вами, ни моделью, это справочник, который читают по ходу работы. Если в проекте нет линтера или тестов, часть чеклиста просто не к чему применить — это повод сначала завести хотя бы npm test или pytest.

Какие задачи решает

  • прогнать типы, линтер и тесты перед коммитом
  • собрать описание PR со скриншотами и ссылками на тикеты
  • проверить миграции базы до мержа в main
  • пройти чеклист безопасности для изменений в API
  • настроить pre-commit хук через Husky или pre-commit

Примеры запросов агенту

  • Пройди по чеклисту pre-merge перед тем, как я открою PR
  • Проверь мои изменения по pre-merge: типы, линтер, тесты
  • Собери описание PR по шаблону из pre-merge

Как установить pre-merge

1Через Skills CLI (Vercel)

npx skills add bobmatnyc/claude-mpm-skills --skill pre-merge -a claude-code

2Вручную: положить файлы

~/.claude/skills/pre-merge/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/pre-merge/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора65

phoenix-api-channels Скилл для Claude, который ведёт агента по Phoenix: JSON-контроллеры, контексты Ecto, Channels и Presence на BEAM. CX Codex +1 339установок ecto-patterns Скилл подсказывает агенту, как писать схемы, changesets, миграции и транзакции в Ecto для Phoenix-приложений на Elixir. CX Codex +1 336установок media-transcoding Скилл для пакетной перекодировки видео по готовым пресетам FFmpeg: веб, мобильные, архив. Пригодится, когда надо привести библиотеку роликов к одному формату. CX Codex +1 335установок phoenix-ops Скилл для подготовки Phoenix-приложения к продакшену: релизы, runtime-конфиг, кластеризация, телеметрия и защита эндпоинтов. CX Codex +1 331установок vb6-legacy Скилл для работы с классическим VB6: подсказывает, как переносить код в VB.NET и вызывать COM-объекты без утечек памяти. CX Codex +1 329установок vercel-overview Скилл-справочник по Vercel: проекты, CLI, переменные окружения, Git-интеграция, REST API и вебхуки. Пригодится, когда агент планирует деплой или разбирается в настройках проекта. CX Codex +1 328установок vercel-security-access Скилл-справочник по безопасности Vercel: роли, SSO, защита деплоев, файрвол, BotID и журналы. Пригодится, когда настраиваешь доступ к проектам и превью. CX Codex +1 328установок digitalocean-teams Скилл описывает, как устроены Teams и Organizations в DigitalOcean: роли, доступы, участники и общий счёт. Пригодится, когда настраиваете команду или разбираетесь с правами. CX Codex +1 318установок

Похожие

om-approve-merge-pr open-mercato Скилл принимает номер пул-реквеста, ставит апрувящий ревью и делает squash-merge. Отказывается, если мешает QA-гейт или блокирующий лейбл. CX Codex +1 3 500установок om-merge-buddy open-mercato Скилл проверяет открытые пуллреквесты, оценивает CI, ревью и QA-статусы, после чего формирует отчёт о готовности к слиянию. Работает только в режиме чтения. CX Codex +1 2 800установок fix-merge-conflicts cursor Разрешает конфликты слияния в ветке, проверяет сборку и тесты перед завершением работы. Нужен, когда конфликтов несколько и их надо разобрать без рефакторинга. CX Codex +1 2 700установок no-mistakes kunchenguid Проверяет изменения через цепочку ревью, тестов, линтинга, документации и CI перед отправкой в настроенную ветку. Подходит для валидации задачи после её выполнения. CX Codex +1 5 600установок re0-merge LilMGenius Помогает принять или отклонить внешний pull request с сохранением авторства, отдельными коммитами мейнтейнера и объяснением решения. CX Codex +1 1 200установок pre-publish-review code-yeongyu Запускает многоагентную проверку кодовой базы перед публикацией пакета в npm. Помогает найти скрытые регрессии, поломки API и риски в релизе. CX Codex +1 753установок

Рядом в теме «Git и GitHub»

Все скиллы по теме «Git и GitHub» →

Вопросы о pre-merge

Как установить pre-merge в Claude?

Выполните npx skills add bobmatnyc/claude-mpm-skills --skill pre-merge -a claude-code. Скилл окажется в ~/.claude/skills/pre-merge/SKILL.md.

Что делает pre-merge?

Это чеклист проверок перед коммитом, перед созданием PR и перед мержем в main: типы, линтер, тесты, миграции, безопасность API, план отката. Плюс шаблон описания PR и пример скрипта pre-commit.sh.

Почему скилл нельзя вызвать вручную?

В нём стоит user-invocable: false и disable-model-invocation: true. Он работает как справочник: вы или агент открываете его и идёте по пунктам, а не запускаете как команду.

Исходный текст

SKILL.md · MIT
---
name: pre-merge
description: "Comprehensive verification workflow before merging changes to production."
user-invocable: false
disable-model-invocation: true
version: 1.0.0
tags: []
progressive_disclosure:
  entry_point:
    summary: "Comprehensive verification workflow before merging changes to production."
    when_to_use: "When working with version control, branches, or pull requests."
    quick_start: "1. Review the core concepts below. 2. Apply patterns to your use case. 3. Follow best practices for implementation."
---
# Pre-Merge Verification

Comprehensive verification workflow before merging changes to production.

## When to Use This Skill

Use this skill when:
- Creating a pull request for review
- About to merge code to main/production branch
- Need systematic verification checklist
- Want to catch issues before code review

## Pre-Commit Verification

Before committing code, verify:
- [ ] Type checking passes (language-appropriate: `tsc --noEmit`, `mypy`, etc.)
- [ ] Linting passes with no errors (ESLint, Pylint, etc.)
- [ ] All existing tests pass locally
- [ ] No console.log/debug statements left in code
- [ ] Code follows project style guide
- [ ] No commented-out code blocks

### Commands by Language

**TypeScript/JavaScript**:
```bash
# Type check
npx tsc --noEmit

# Lint
npm run lint
# or: pnpm lint
# or: npx eslint .

# Tests
npm test
# or: pnpm test
```

**Python**:
```bash
# Type check
mypy src/

# Lint
pylint src/
# or: flake8 src/
# or: ruff check src/

# Tests
pytest
# or: python -m pytest
```

**Go**:
```bash
# Format check
gofmt -l .

# Lint
golangci-lint run

# Tests
go test ./...
```

## Pre-PR Verification

Before creating a pull request, ensure:

### Required Information
- [ ] Changeset added for user-facing changes (if using changesets)
- [ ] PR description is complete with:
  - [ ] Summary of changes
  - [ ] Related ticket references (ENG-XXX, HEL-XXX, JIRA-XXX, etc.)
  - [ ] Screenshots for UI changes (desktop, tablet, mobile)
  - [ ] Breaking changes documented
  - [ ] Migration guide (if breaking changes)
- [ ] New tests added for new functionality
- [ ] Documentation updated if needed (README, API docs, etc.)

### Security Checklist (if API changes)
- [ ] Authentication required on protected routes
- [ ] Authorization checks implemented
- [ ] Input validation with schema (Zod, Pydantic, etc.)
- [ ] No sensitive data in logs
- [ ] No SQL injection vulnerabilities
- [ ] No XSS vulnerabilities
- [ ] Rate limiting considered

### Database Changes (if schema changes)
- [ ] Migration file created
- [ ] Migration tested on local database
- [ ] Migration tested on staging database
- [ ] Down migration available (rollback plan)
- [ ] No breaking changes without migration guide
- [ ] Schema changes documented

### UI Changes (if applicable)
- [ ] Screenshots included:
  - [ ] Desktop view (1920x1080)
  - [ ] Tablet view (768x1024)
  - [ ] Mobile view (375x667)
- [ ] Responsive behavior verified
- [ ] Accessibility checked (keyboard navigation, screen readers)
- [ ] Loading states implemented
- [ ] Error states implemented

## Pre-Merge Verification

Before merging to main branch, confirm:

### CI/CD Checks
- [ ] All CI checks pass (lint, type-check, tests, build)
- [ ] Code review approved by at least one reviewer
- [ ] No TypeScript errors in changed files
- [ ] No merge conflicts with target branch
- [ ] Build succeeds without warnings

### Functional Verification
- [ ] Database migrations run successfully (if applicable)
- [ ] No regression in existing functionality
- [ ] Performance benchmarks within acceptable range
- [ ] Manual testing completed for critical paths

### Documentation
- [ ] CHANGELOG.md updated (if using)
- [ ] API documentation updated (if API changes)
- [ ] README updated (if setup/usage changes)
- [ ] Migration guide provided (if breaking changes)

## PR Description Template

Use this template for comprehensive PR descriptions:

```markdown
## Summary
[Brief description of what this PR does]

## Related Tickets
- Fixes #123
- Closes ENG-456
- Related to HEL-789

## Changes
- [ ] Feature: [Description]
- [ ] Bug Fix: [Description]
- [ ] Refactor: [Description]
- [ ] Documentation: [Description]

## Testing
### Unit Tests
- Added tests for [feature/function]
- Coverage: X%

### Manual Testing
- [ ] Tested on desktop (Chrome, Firefox, Safari)
- [ ] Tested on mobile (iOS Safari, Android Chrome)
- [ ] Tested edge cases: [list specific cases]

## Screenshots
### Desktop
![Desktop view](screenshot-url)

### Tablet
![Tablet view](screenshot-url)

### Mobile
![Mobile view](screenshot-url)

## Breaking Changes
[List any breaking changes or write "None"]

### Migration Guide
[If breaking changes, provide migration steps]

## Performance Impact
[Describe any performance implications or write "No impact"]

## Security Considerations
[Describe security implications or write "No security impact"]

## Rollback Plan
[Describe how to rollback if issues occur]

## Deployment Notes
[Any special deployment considerations or write "Standard deployment"]
```

## Common Pitfalls to Avoid

### Pre-Commit
- ❌ Committing code with failing tests
- ❌ Leaving console.log/debug statements
- ❌ Committing without running type checker
- ❌ Committing large blocks of commented code

### Pre-PR
- ❌ Creating PR without description
- ❌ Missing screenshots for UI changes
- ❌ Not linking to related tickets
- ❌ Not documenting breaking changes
- ❌ Missing test coverage for new code

### Pre-Merge
- ❌ Merging with failing CI checks
- ❌ Merging without code review approval
- ❌ Merging with merge conflicts
- ❌ Merging without testing migrations
- ❌ Merging without considering rollback plan

## Quick Verification Script

Create a pre-commit verification script:

**JavaScript/TypeScript (pre-commit.sh)**:
```bash
#!/bin/bash
set -e

echo "Running type check..."
npx tsc --noEmit

echo "Running linter..."
npm run lint

echo "Running tests..."
npm test -- --run

echo "✅ All checks passed!"
```

**Python (pre-commit.sh)**:
```bash
#!/bin/bash
set -e

echo "Running type check..."
mypy src/

echo "Running linter..."
pylint src/

echo "Running tests..."
pytest

echo "✅ All checks passed!"
```

Make executable:
```bash
chmod +x pre-commit.sh
```

## Automation with Git Hooks

Set up automatic pre-commit checks:

### Using Husky (JavaScript/TypeScript)
```bash
npm install --save-dev husky
npx husky install
npx husky add .husky/pre-commit "npm run lint && npm test"
```

### Using pre-commit (Python)
Create `.pre-commit-config.yaml`:
```yaml
repos:
  - repo: local
    hooks:
      - id: type-check
        name: Type Check
        entry: mypy src/
        language: system
        pass_filenames: false
      - id: lint
        name: Lint
        entry: pylint src/
        language: system
        pass_filenames: false
      - id: test
        name: Test
        entry: pytest
        language: system
        pass_filenames: false
```

Install hooks:
```bash
pre-commit install
```

## Success Criteria

### Pre-Commit Success
- ✅ All local checks pass
- ✅ Code is formatted correctly
- ✅ No debug statements remain
- ✅ Tests pass locally

### Pre-PR Success
- ✅ PR description is comprehensive
- ✅ All required information included
- ✅ Screenshots attached (if UI changes)
- ✅ Breaking changes documented

### Pre-Merge Success
- ✅ CI pipeline is green
- ✅ Code review approved
- ✅ No conflicts with target branch
- ✅ Manual testing completed

## Related Skills

- `universal-verification-screenshot` - Screenshot verification for UI changes
- `universal-verification-bug-fix` - Bug fix verification workflow
- `toolchains-universal-security-api-review` - API security testing
- `universal-collaboration-git-workflow` - Git workflow best practices

© bobmatnyc · MIT · bobmatnyc/claude-mpm-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой