Logo Breakup Pr

Breakup Pr

Tổ chứcPhổ biến
lightdash
breakup-pr

Chia một PR lớn thành các lát cắt tính năng theo chiều dọc và phát hành dần qua các PR xếp chồng của Graphite. Tất cả các phần đều dùng chung một feature flag để toàn bộ tính năng được phát hành đồng thời. Dùng khi: chia nhỏ PR lớn, tách diff, chia theo lát cắt dọc, phát hành từng phần, triển khai theo giai đoạn hoặc khi PR quá lớn để đánh giá.

Add to TypingMind

Tổng quan

Nhà phát hànhlightdash
Kho mãlightdash
Tên kỹ năngbreakup-pr
Sao
6.2K
Bản fork
790
Tệp đi kèm
Chỉ có hướng dẫn
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được lightdash công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Breakup Pr trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/lightdash/lightdash/tree/main/.claude/skills/breakup-pr
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Breakup Pr trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Breakup Pr ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Breakup Pr với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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

Câu hỏi thường gặp

Kỹ năng AI Breakup Pr làm được gì?

Chia một PR lớn thành các lát cắt tính năng theo chiều dọc và phát hành dần qua các PR xếp chồng của Graphite. Tất cả các phần đều dùng chung một feature flag để toàn bộ tính năng được phát hành đồng thời. Dùng khi: chia nhỏ PR lớn, tách diff, chia theo lát cắt dọc, phát hành từng phần, triển khai theo giai đoạn hoặc khi PR quá lớn để đánh giá.

Vì sao nên dùng Breakup Pr trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Breakup Pr là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Breakup Pr trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/lightdash/lightdash/tree/main/.claude/skills/breakup-pr. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Breakup Pr?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Breakup Pr với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Breakup Pr với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Breakup Pr có miễn phí không?

Kỹ năng này được lightdash phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇