agentleFS
kienbui1995kienbui1995/magic-powers/skills/amplitude/diff-intake/SKILL.md

diff-intake

Skill0 starsChanged 8 months agoMITView on GitHub

Transform code diffs (PRs, branches, files) into structured YAML briefs for analytics instrumentation planning. Minimal MCP usage — primarily code analysis.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the input is a GitHub PR URL, use web fetch or GitHub CLI to retrieve the diff

    line 94
  2. Very specific:

    After producing the YAML, state: "Brief ready.

    line 119

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Diff Intake

When to Use

  • Starting an instrumentation workflow from a pull request URL or branch name
  • Auditing what analytics-relevant changes exist in a feature branch before it ships
  • Converting a vague feature description into a concrete list of trackable interactions
  • Feeding downstream skills (discover-event-surfaces, instrument-events) with structured input
  • Reviewing merged PRs retroactively to find missed instrumentation

Core Jobs

1. Classify Input Type

Determine what the user has provided and select the right ingestion path:

  • PR URL (github.com/.../pull/123) → fetch the diff via GitHub API or gh pr diff
  • Branch name (feat/checkout-v2) → run git diff main...feat/checkout-v2 to get full changeset
  • File or directory path → read the files directly and look for new/changed code
  • Feature description (free text) → search the codebase for relevant files using keywords

Output of classification: input_type + source_reference + list of files changed.

2. Parse Changes

For each changed file, extract:

  • What was added (new functions, components, API routes, state variables)
  • What was removed (deleted screens, deprecated flows, removed UI elements)
  • What was modified (changed behavior in existing flows — renamed fields, reordered steps)
  • New UI surfaces: screens, modals, drawers, tooltips, banners
  • User interactions: buttons, forms, links, gestures, keyboard shortcuts
  • Data flows: new API calls, changed request/response shapes, new data dependencies

Focus on user-facing changes only. Skip internal refactors with no UX impact.

3. Extract Analytics-Relevant Changes

Filter parsed changes down to what matters for analytics:

  • New screens → candidate page_viewed events
  • New buttons/CTAs → candidate button_clicked or action-specific events
  • New forms → candidate form_started, form_submitted, form_abandoned events
  • New API endpoints exposed to users → candidate conversion or action events
  • State changes with business significance → candidate status-change events
  • Removed features → events that may need deprecation
  • Changed flows → events that may need property updates

4. Produce Structured YAML Brief

Output a YAML document consumed by discover-event-surfaces:

brief:
  summary: "One sentence describing the feature change"
  pr_reference: "<URL or branch>"
  files_changed: 12
  new_surfaces:
    - type: screen
      name: "Checkout Confirmation Page"
      file: "src/pages/checkout/confirmation.tsx"
      interactions:
        - "Continue Shopping button"
        - "View Order Details link"
    - type: form
      name: "Shipping Address Form"
      file: "src/components/ShippingForm.tsx"
      fields: ["street", "city", "zip", "country"]
  removed_surfaces:
    - type: screen
      name: "Legacy Cart Page"
      note: "Replaced by new unified checkout"
  changed_behaviors:
    - description: "Payment step now skipped for free orders"
      files: ["src/flows/checkout.ts"]
      impact: "high — affects conversion funnel"
  technical_context:
    stack: "React + TypeScript"
    analytics_sdk: "Amplitude Browser SDK v2"
    existing_tracking_file: "src/analytics/events.ts"

MCP Tools

This skill uses minimal MCP — primarily local code analysis tools:

  • No mcp__Amplitude__* tools required at this stage
  • The output YAML is the input to discover-event-surfaces which uses Amplitude tools
  • If the input is a GitHub PR URL, use web fetch or GitHub CLI to retrieve the diff

Key Concepts

  • Analytics brief: The YAML document produced by this skill — the contract between diff analysis and event discovery
  • New surface: Any new user-facing UI element that a user can interact with or see
  • Changed behavior: An existing flow that works differently — may require property updates on existing events
  • Technical context: Stack, SDK, and conventions that downstream skills need to write correct tracking code
  • Funnel-critical change: A change that adds or removes a step in acquisition, activation, or conversion — highest priority for tracking

Output Format

A structured YAML brief with these top-level sections:

brief:
  summary: <string>
  pr_reference: <URL or branch name>
  files_changed: <count>
  new_surfaces: <list of {type, name, file, interactions}>
  removed_surfaces: <list of {type, name, note}>
  changed_behaviors: <list of {description, files, impact}>
  technical_context: {stack, analytics_sdk, existing_tracking_file}

After producing the YAML, state: "Brief ready. Proceed to discover-event-surfaces to map these surfaces to candidate analytics events."

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.