Logo di Breakup Pr

Breakup Pr

OrganizzazionePopolare
lightdash
breakup-pr

Suddividi una PR di grandi dimensioni in componenti verticali di funzionalità, da rilasciare gradualmente tramite PR sovrapposte di Graphite. Tutti i componenti verticali condividono un'unica feature flag, così l'intera funzionalità viene rilasciata in modo atomico. Usala per suddividere una PR grande o una diff, creare componenti verticali, distribuire in modo incrementale o graduale oppure quando una PR è troppo grande da revisionare.

Add to TypingMind

Panoramica

Pubblicato dalightdash
Repositorylightdash
Nome della skillbreakup-pr
Stelle
6.2K
Fork
790
File inclusi
Solo istruzioni
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da lightdash su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Breakup Pr in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/lightdash/lightdash/tree/main/.claude/skills/breakup-pr
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lightdash/lightdash.git /tmp/lightdash
mkdir -p .claude/skills
cp -r /tmp/lightdash/.claude/skills/breakup-pr .claude/skills/breakup-pr
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Breakup Pr in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Breakup Pr non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Breakup Pr non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Break Up PR into Vertical Feature Slices

You are splitting a large PR into vertical feature slices — each slice is an independently mergeable, CI-green stacked PR delivered via Graphite (see the graphite skill for gt commands).

All slices are gated behind a single shared feature flag so the feature ships atomically when the flag is enabled.

Why Vertical Slices?

Large PRs are hard to review, hard to reason about, and risky to merge. Vertical slicing solves this by breaking work into small, focused changes that are easier to understand and safer to ship.

Easier code review:

  • Reviewers can focus on one concern at a time (e.g., "just the migration" or "just the API")
  • Each PR tells a clear story — what changed and why is obvious from the diff
  • Smaller diffs mean faster reviews and higher-quality feedback
  • Comments and discussions stay focused instead of sprawling across unrelated changes

Iterative improvement:

  • Each slice can be reviewed, refined, and merged independently
  • Feedback on early slices (e.g., schema design) can inform later slices before they're written
  • If a later slice needs rework, earlier slices are already safely merged
  • The stack shows a natural progression — reviewers understand the "journey" of the feature

Safer delivery:

  • Smaller changes = smaller blast radius if something goes wrong
  • Issues are easier to bisect — you know exactly which slice introduced a problem
  • Rollback is surgical: revert one slice, not the whole feature
  • CI catches issues earlier in the stack, before dependent code is written

Better collaboration:

  • Multiple people can review different slices in parallel
  • Stack structure makes dependencies explicit — no guessing what to review first
  • Merge conflicts are localized to individual slices
  • Progress is visible: "3 of 5 PRs merged" is clearer than "PR still in review"

The feature flag unifies it all: Even though slices merge incrementally, the feature flag keeps everything hidden until you're ready to ship. Merge with confidence, ship when ready.

Process

Step 1: Analyze the PR

If given a PR URL, fetch and analyze the diff:

bash
gh pr diff <PR_NUMBER>

If on a branch, analyze the diff against main:

bash
git diff main...HEAD

Understand:

  • What files are changed and why
  • The dependency graph between changes (schema → backend → frontend)
  • What constitutes a "vertical" — an independently testable slice of functionality

Step 2: Identify the Feature Flag

Determine the feature flag name for this feature:

  • Check if the PR already uses a feature flag — if so, reuse it
  • If not, create one following the naming convention: kebab-case (e.g., my-new-feature)

The feature flag goes in packages/common/src/types/featureFlags.ts:

typescript
export enum FeatureFlags {
    // ... existing flags
    MyNewFeature = 'my-new-feature',
}

CRITICAL: The same feature flag is used for ALL vertical slices. This ensures the entire feature is gated atomically.

Step 3: Plan the Vertical Slices

Break the PR into vertical slices ordered by dependency (bottom of stack = first to merge):

What is a vertical slice? A vertical slice is a thin, end-to-end piece of user-facing functionality that cuts through all architectural layers (migration + types + backend + API + frontend). Each slice delivers something a user could test or demo, even if it's narrow.

How to identify slices: Think about the feature from the user's perspective. Ask: "What are the distinct things a user can do with this feature?" Each answer is a candidate slice.

For example, a "content verification" feature might slice as:

  1. Admin can verify/unverify a chart (migration + model + service + API + UI — but only for charts)
  2. Admin can verify/unverify a dashboard (extend to dashboards)
  3. Verified badge appears in search and content browser
  4. Editing content auto-removes verification
  5. Admin settings panel to view all verified content

Each slice touches every layer it needs — that's what makes it vertical.

Anti-pattern: horizontal/layer slicing Do NOT slice by architectural layer (e.g., "PR 1: migration", "PR 2: backend types", "PR 3: API", "PR 4: frontend"). This produces PRs that aren't independently testable and forces reviewers to hold the whole feature in their head across multiple PRs.

Slicing guidelines:

  • Start with the narrowest end-to-end path — the simplest user action that exercises the full stack
  • Subsequent slices widen the feature: new entity types, new surfaces, new behaviors, edge cases
  • Infrastructure-only slices (e.g., a migration with no consumers) are acceptable ONLY when the migration is complex enough to warrant isolated review — and even then, prefer bundling it with the first slice that uses it
  • Each slice should tell a coherent story: a reviewer should understand what user-facing change this enables

Each slice MUST:

  • Be independently mergeable and CI-green
  • Gate new behavior behind the shared feature flag
  • Not break existing functionality when the flag is OFF
  • Be reviewable in isolation (aim for <600 lines per PR)
  • Be describable as a user-facing capability (not an architectural layer)

Present the plan to the user before coding:

Feature flag: FeatureFlags.MyNewFeature ('my-new-feature')

Stack plan (bottom → top):
  1. PR: Admin can verify a chart (migration + types + model + service + API + UI)
  2. PR: Extend verification to dashboards
  3. PR: Show verified badge in search and content browser
  4. PR: Auto-remove verification on content edit
  5. PR: Admin settings panel to manage verified content

Wait for user confirmation before proceeding.

Step 4: Implement Each Slice

For each slice, follow this pattern:

  1. Checkout the right position in the stack:

    • First slice: gt co main then start
    • Subsequent slices: stay on previous branch (gt will stack automatically)
  2. Make the changes for this slice only

  3. Gate new behavior behind the feature flag:

    Backend pattern:

    typescript
    import { FeatureFlags } from '@lightdash/common';
    
    // In a service method:
    const featureFlag = await this.featureFlagModel.get({
        user,
        featureFlagId: FeatureFlags.MyNewFeature,
    });
    if (!featureFlag.enabled) {
        throw new ForbiddenError('Feature not enabled');
    }

    Frontend pattern:

    typescript
    import { FeatureFlags } from '@lightdash/common';
    import { useServerFeatureFlag } from '../hooks/useServerOrClientFeatureFlag';
    
    const { data: featureFlag } = useServerFeatureFlag(FeatureFlags.MyNewFeature);
    
    // Conditionally render:
    if (!featureFlag?.enabled) return null;
    // or
    {featureFlag?.enabled && <NewComponent />}
  4. Run checks:

    bash
    pnpm -F <package> lint
    pnpm -F <package> typecheck
    pnpm -F <package> test  # or test:dev:nowatch for backend
  5. Create the branch and submit:

    bash
    git add <specific-files>
    gt c --no-interactive -m 'feat: <description>'
    gt s --no-interactive

Step 5: Submit the Stack

After all slices are implemented:

bash
gt s --stack --no-interactive

Verify the stack looks correct:

bash
gt log

Feature Flag Placement Guide

LayerWhere to gatePattern
Database migrationUsually NOT gated — migrations run regardless. Design schema to be backwards-compatible.
Backend modelUsually NOT gated — models can exist without being called.
Backend serviceGate at the service method entry pointfeatureFlagModel.get(...) check
Backend controller/routeGate in the controller if the entire endpoint is newfeatureFlagModel.get(...) check
Frontend route/pageGate at the route or page leveluseServerFeatureFlag(...)
Frontend componentGate at the component renderConditional render with flag check
Frontend nav/menu itemGate the menu entryConditional render with flag check

Key Files Reference

PurposeFile
Feature flag enumpackages/common/src/types/featureFlags.ts
Commercial flagspackages/common/src/ee/commercialFeatureFlags.ts
Backend flag modelpackages/backend/src/models/FeatureFlagModel/FeatureFlagModel.ts
Backend flag servicepackages/backend/src/services/FeatureFlag/FeatureFlagService.ts
Frontend flag hookspackages/frontend/src/hooks/useServerOrClientFeatureFlag.ts
PostHog integrationpackages/backend/src/postHog.ts

Anti-patterns to Avoid

  • Horizontal/layer slicing — DO NOT create PRs like "migration PR", "backend types PR", "API PR", "frontend PR". Each PR should be a vertical slice through all necessary layers
  • Different feature flags per slice — use ONE flag for the whole feature
  • Mixing unrelated changes — each PR is one logical vertical
  • Breaking existing behavior when flag is OFF — feature-flagged code must be invisible when disabled
  • Giant slices — if a slice is >600 lines, break it down further
  • Skipping typecheck/lint — every slice must be CI-green independently
  • Infrastructure-only PRs with no user-facing change — prefer bundling infrastructure with the first slice that uses it

Completion Criteria

  • All slices are submitted as a Graphite stack
  • Each PR passes lint, typecheck, and tests independently
  • All new behavior is gated behind the single shared feature flag
  • Working tree is clean
  • Stack is visible via gt log

Domande frequenti

Cosa fa la skill IA Breakup Pr?

Suddividi una PR di grandi dimensioni in componenti verticali di funzionalità, da rilasciare gradualmente tramite PR sovrapposte di Graphite. Tutti i componenti verticali condividono un'unica feature flag, così l'intera funzionalità viene rilasciata in modo atomico. Usala per suddividere una PR grande o una diff, creare componenti verticali, distribuire in modo incrementale o graduale oppure quando una PR è troppo grande da revisionare.

Perché usare Breakup Pr su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Breakup Pr è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Breakup Pr in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/lightdash/lightdash/tree/main/.claude/skills/breakup-pr. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Breakup Pr?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Breakup Pr?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Breakup Pr: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Breakup Pr è gratuita?

È pubblicata su GitHub da lightdash. Consulta il repository per i termini di licenza. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇