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

diff-intake — скилл для Claude Code: разбор диффа перед аналитикой

Читает дифф PR или ветки и собирает YAML-бриф об изменениях. Первый шаг в цепочке скиллов для аналитики и инструментирования событий.

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

Что делает diff-intake

Скилл принимает ссылку на PR, сравнение веток или сырой дифф и разбирает его по шагам. Сначала тянет список изменённых файлов через gh pr view или git log и git diff --stat, потом раскладывает их по категориям: Core Logic, Generated, Testing, Config, Documentation, Noise. Для каждого файла отмечает путь, категорию, тип изменения и вероятность аналитики по шкале от 1 до 5.

Дальше читаются только файлы Core Logic. По ним строится карта: краткое описание правок в две строки и слой — frontend, backend или shared. Отдельно выводятся пользовательские изменения и затронутые поверхности: компоненты, маршруты, страницы, обработчики. Если правка чисто бэкендовая и интерактивной поверхности нет, поле surfaces.components просто не заполняется.

На выходе — YAML-блок без текста вокруг. В нём классификация изменения (feat, fix, refactor, perf, revert и прочие), оценка analytics_scope от none до high и карта файлов. Бриф рассчитан на то, что его дальше прочитают скиллы discover-event-surfaces и instrument-events — сам он события не расставляет. Для работы нужен gh с авторизацией: если auth падает, скилл не станет угадывать форму запроса.

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

  • понять, что реально изменилось в PR, не читая весь дифф
  • отделить пользовательские правки от внутренних рефакторингов
  • найти места в коде, которые стоит покрыть событиями
  • оценить, нужен ли вообще разбор аналитики для этого изменения
  • передать следующим скиллам машинночитаемый бриф вместо пересказа

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

  • разбери этот PR и скажи, что поменялось
  • что изменилось в ветке feature/checkout по сравнению с main
  • помоги инструментировать этот дифф — начни с брифа

Как установить diff-intake

1Через Skills CLI (Vercel)

npx skills add amplitude/mcp-marketplace --skill diff-intake -a claude-code

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

~/.claude/skills/diff-intake/SKILL.md

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

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

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

discover-event-surfaces Скилл анализирует YAML-отчёт diff-intake после правок кода и формирует список событий аналитики перед ревью с продакт-менеджером. CX Codex +1 42 800установок discover-analytics-patterns Скилл находит реальные шаблоны аналитики в кодовой базе: вызовы SDK, обёртки, импорты и правила имён. Нужен перед добавлением новых событий. CX Codex +1 42 800установок add-analytics-instrumentation Скилл запускает сквозной процесс разметки аналитики в коде: находит целевые события и строит готовый план трекинга для PR, ветки или фичи. CX Codex +1 42 900установок taxonomy Скилл для работы с таксономией событий в Amplitude: проверяет имена событий и свойств, ищет дубли и устаревшие события, готовит план трекинга. CX Codex +1 42 700установок instrument-events Превращает YAML с кандидатами в события в план инструментирования: где именно в коде поставить вызовы трекинга и какие свойства передавать. CX Codex +1 42 800установок

Похожие

understand-diff Egonex-AI Скилл сопоставляет изменения в Git с графом знаний проекта, чтобы оценить затронутые компоненты и радиус поломки. Пригодится перед ревью пуллреквестов. CX Codex +1 3 600установок diff-analyze ruvnet Анализирует git-дифф перед PR: оценивает риск, классифицирует изменения и предлагает роли ревьюеров. Нужен перед слиянием крупных правок. CX Codex +1 751установок summarize_git_diff danielmiessler Промпт читает git diff и выдаёт короткое сообщение коммита в стиле conventional commits плюс список изменений по пунктам. ★ 44 429звёзд репо security-diff-scan официальный OpenAI Проверяет пулреквесты, коммиты и диффы рабочей копии на уязвимости. Помогает найти проблемы безопасности в изменённом коде до слияния веток. CX Codex GP ChatGPT 30установок Developer Work Analysis from Git Diff and Commit Message [email protected] Промпт разбирает git diff и сообщение коммита: оценивает масштаб изменений, отмечает проблемы и формулирует рекомендации. GP ChatGPT ★ 174 597звёзд репо matter-intake официальный anthropics Проводит новое юридическое дело через одинаковый опрос и раскладывает его по файлам: карточка, история, строка в журнале. CX Codex +1 629установок

Рядом в теме «Настройка агента: память, контекст, субагенты»

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →

Вопросы о diff-intake

Как установить diff-intake в Claude?

Одной командой: npx skills add amplitude/mcp-marketplace --skill diff-intake -a claude-code. Файл скилла окажется в ~/.claude/skills/diff-intake/SKILL.md.

Что делает diff-intake?

Читает дифф PR или ветки, категоризирует файлы и выдаёт YAML-бриф с классификацией изменения, пользовательскими правками и картой файлов. Это первый шаг в цепочке аналитики.

Нужен ли доступ к GitHub для работы скилла?

Да, для PR используется gh pr view, поэтому нужна авторизация в GitHub CLI. Если авторизация не проходит, скилл не станет угадывать форму запроса.

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

SKILL.md · MIT
---
name: diff-intake
description: >
  Reads a PR or branch diff and produces a structured YAML change brief for
  downstream analytics instrumentation skills. Use this as the first step
  whenever a user shares a PR link, branch comparison, or raw diff and wants
  to understand what changed, what needs tracking, or how to instrument a
  feature. Trigger on phrases like "review this PR", "what changed in this
  branch", "help me instrument this diff", "check analytics coverage for this
  change", or any request to start the analytics review workflow.
---

# diff-intake

Follow this skill step by step.
You are step 1 of the analytics instrumentation workflow. Produce a compact
YAML change brief that downstream skills (discover-event-surfaces,
instrument-events) will consume. Keep the output machine-readable and
precise — no prose around the YAML block.

## Step 1: Gather changed files and categorize

Fetch the list of changed files from the source, then categorize each one.

### Fetching changes
- **PR URL**
`gh pr view <number-or-url>`
`gh pr view <pr-number> --json files --jq '.files[] | "\(.path)\t+\(.additions) -\(.deletions)\t"'`
- **Branch comparison**
`git log <main|master>..<branch>`
`git diff --stat <main|master>..<branch>`
- **Ambiguous mention** (PR number, branch name): infer the right form and fetch without asking unless auth fails.

### Categorize files
Assign each file to a category based on its path:
- **Core Logic**: application source (e.g. src/auth/login.py, database/models.ts)
- **Generated**: anything with `generated` in its path
- **Testing**: test files
- **Config / Dependencies**: package.json, docker-compose.yml, etc.
- **Documentation**: READMEs, docs/
- **Noise**: lock-files, .svg, auto-generated migrations

For each file, record: path, category, change type (Added / Modified / Deleted), and analytics likelihood (1–5).

## Step 2: Build the file summary map
Read every single **Core Logic** file and create the file summary map.
Only process and include **Core Logic** files.

### Fetching detailed diffs
- **PR**
`gh pr view <number-or-url> --json baseRefOid,headRefOid`
Using the response, get a detailed diff
`git diff <baseRefOid>...<headRefOid> -- <file1> <file2> <file_n>`
- **Branch comparison**
`git diff main..feature/foo  -- <file1> <file2> <file_n>`

### For each file, record
- `summary` — 2-line summary of what changed
- `stack` — frontend, backend, or shared

### Also derive user-facing changes and touched surfaces

While reading the diff and the changed files, also produce the higher-level
signals that downstream event discovery needs:

- `user_facing_changes` — a flat list of concrete behavior changes that matter
  to a user, PM, or analyst. Each item should describe what a user can now do,
  see, or experience differently. Omit purely internal refactors.
- `surfaces.components` — the UI components, routes, pages, handlers, or other
  interaction surfaces directly involved in those user-facing changes. Prefer
  likely instrumentation points over low-level helpers.

For each surface, record:
- `name` — component, route, page, hook, or surface name
- `file` — repo-relative path
- `change` — `added`, `modified`, or `deleted`

If the change is backend-only or has no clear interactive surface, omit
`surfaces.components` rather than inventing one.

## Step 3: Classify the overall change

Infer the change type and analytics scope:

| Type                                     | Analytics implication                             |
| ---------------------------------------- | ------------------------------------------------- |
| feat                                     | High — new surfaces likely need tracking          |
| fix                                      | Low–Medium — may affect existing event conditions |
| refactor                                 | Low — tracking paths may move, regression risk    |
| perf                                     | Low — usually no tracking impact                  |
| revert                                   | Medium — need to check what tracking was lost     |
| style / docs / test / build / ci / chore | None — skip analytics analysis                    |

`analytics_scope` = highest implication present:
- `none` — only no-impact types
- `low` — only perf/refactor
- `medium` — fix
- `high` — any feature or capability addition

If `analytics_scope` is `none`, emit the brief and note that downstream skills are not needed.

## Step 4: Emit the YAML brief
Output only the YAML block — no prose before or after. Follow the format exactly.
List each file individually in file_summary_map (no globs).

```yaml
change_brief:
  classification:
    primary: feat           # dominant conventional commit type
    types: [feat, fix]      # all types detected
    analytics_scope: high   # none | low | medium | high
    stack: frontend         # frontend | backend | fullstack
  summary: "One sentence describing the overall change"
  user_facing_changes:
    - "Users can now upload an avatar with drag-and-drop and preview it before saving."
  surfaces:
    components:
      - name: "AvatarUpload"
        file: "src/components/AvatarUpload.tsx"
        change: modified
  file_summary_map:         # each entry includes a layer field
    - file: "src/components/AvatarUpload.tsx"
      summary: "New component for avatar upload with drag-and-drop and preview"
      layer: frontend       # frontend | backend | shared
    - file: "src/api/upload.ts"
      summary: "Upload endpoint handler, validates file type and persists to S3"
      layer: backend
```

© amplitude · MIT · amplitude/mcp-marketplace

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

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

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