Logo To Stack

To Stack

Cộng đồng
helderberto
to-stack

Split a large branch or PR into a stack of small PRs, verified layer by layer, and open them as linked drafts.

Tổng quan

Nhà phát hànhhelderberto
Kho mãagent-skills
Tên kỹ năngto-stack
Sao
20
Bản fork
2
Tệp đi kèm
1
Giấy phépMIT
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 là Markdown thuần túy, không phải 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ộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được helderberto công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI To Stack 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 thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/helderberto/agent-skills/tree/main/skills/to-stack
  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/helderberto/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/to-stack .claude/skills/to-stack
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 To Stack 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ự tải To Stack 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 To Stack không bị giới hạn ở mô hình mà kỹ năng này được viết cho. 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 kỹ năng chưa dùng không tốn chi phí.

  • Đổ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.

To Stack

Turn one large change into a stack: PR 1 on the base branch, each later PR on the one below it. Reviewers read one concern at a time, and the top of the stack is byte-for-byte the tree you already tested.

Arguments: $ARGUMENTS

  • A PR number or URL, or a branch. None → the current branch and its PR.
  • --each — land each PR on the base in order, each with its own version bump and CHANGELOG section. Default: merge from the top down into PR 1, which lands as one squash and one release.

Workflow

  1. Resolve.

    • Dirty tree → stop and ask to commit or stash.
    • A PR → gh pr view <PR> --json headRefName,baseRefName, then gh pr checkout <PR>. A branch → check it out. Its head is <tip>; its base is the PR's baseRefName, else the default branch.
    • git fetch origin <base>, then diff against the remote base, since a stale local base inflates the diff: git diff --stat origin/<base>...<tip> and git log --oneline origin/<base>..<tip>.
    • Tip conflicts with the base, or the base already released the planned version → merge the base in and bump first. A collision belongs to the whole change, not to one layer.
    • Under ~600 changed lines without lockfiles → say a split isn't worth it, and stop unless the user insists.

    Done when the scope is stated: "Splitting feat/x (#42) vs main: 49 files, +3432".

  2. Map. Record what every changed file needs: its imports, and for each test case the mocks, globals, helpers and options it touches. Group the changes into concerns. For shared files (manifest, entry barrel, types index, core module, README, CHANGELOG), assign each changed line to a concern. Done when every changed line has an owner. Ownership rules: references/layering.md.

  3. Plan. Order the concerns so each layer depends only on layers below it: manifest and config first, then the core, then features, then deprecated or compatibility code, so a future major deletes one layer. Each layer is tight:

    • one concern, under ~600 changed lines without lockfiles
    • green on its own
    • nothing in it waits on a later layer to be used: move a reader with its writer

    Present a table of layer, branch, contents, approximate lines and base, plus the merge strategy. An existing PR becomes PR 1, and its branch gets rewritten. Wait for an unambiguous yes. It covers building, pushing (--force-with-lease for the rewritten branch) and opening the PRs.

  4. Back up. Run git branch <branch>-full <tip>. Every later check compares against it. Done when the backup points at the tip.

  5. Build bottom-up. For each layer, on a new branch from the one below:

    • Files that land whole: git restore --source=<backup> --staged --worktree -- <paths>, listing both sides of a rename. Unlike git checkout, it also applies deletions.
    • Shared files: write only this layer's slice. In tests, keep the final cases this layer can run. If a core behavior would go untested, write the smallest stand-in case; a later layer restores the final version.
    • Manifest: only this layer's fields, then regenerate the lockfile (npm install --package-lock-only --ignore-scripts, or the repo's equivalent). The version bump goes in layer 1. With --each, each layer bumps from the one below by its own change type, so the top's version can be above the backup's.
    • Docs: only this layer's README and CHANGELOG lines, under the one version heading, or the layer's own heading with --each.
    • Stage explicit paths. Delete any generated output the base doesn't ignore yet, such as build shims, before the checks.
    • Call the Skill tool with check. Commit only if it's green: chain with &&. One conventional commit per layer.

    Done when every layer has its commit and check passed on that exact tree.

  6. Verify the stack. git diff --quiet <backup> <top> must pass, because the top layer is the original tree. With --each, run it with -- . ':!<manifest>' ':!<lockfile>' ':!CHANGELOG.md', then check that git diff <backup> <top> -- <manifest> <lockfile> CHANGELOG.md shows only version lines and version headings. If it fails, find the layer that lost or gained lines, fix it there, and restack as in step 7. Done when the diff is empty.

  7. Fold in fixes, only when the user asked for changes along with the split.

    • Commit each fix on the layer that owns the code.
    • Restack everything above it: git rebase --update-refs --onto <layer> <layer>@{1} <top>.
    • When adjacent edits conflict, keep both sides' intent.
    • Then check that each layer's files outside the fix still match the tree that passed check: git diff <green-sha> <layer> -- . ':!<fix paths>'.

    Done when the top differs from the backup by exactly the fixes.

  8. Open the drafts.

    • Push each layer branch with -u, and the rewritten PR 1 branch with --force-with-lease.
    • Bottom-up, skip a layer that already has a PR: gh pr list --head <branch> --state open.
    • Otherwise run gh pr create --draft --base <layer below> --head <branch> --title <title> --body "Part N of M". PR 1's base is the base branch.
    • Record each PR number from the printed URL.

    Done when every layer has a PR whose base is the layer below.

  9. Write the bodies. One per layer, on the repo's PR template (.github/pull_request_template.md or its variants). Each body holds:

    • Part N of M and a one-sentence summary

    • the stack as a numbered list of the PR numbers, with ← this PR

    • what the layer adds

    • review notes on anything that arrives in a later layer

    • the evidence from step 5

    • Default: PR 1 keeps the whole-change description, because its squash is what lands, with the stack and "this PR's own diff" on top. Retitle it to the whole change with --title.

    • --each: PR 1 lands alone, so its body and title cover its own layer, like the others.

    Apply each body with gh pr edit <n> --body-file <file>.

    Done when every PR body links the whole stack.

Report

A table of # | PR | Branch | Lines | Tests, then how to land it:

  • Review from PR 1 up.
  • Default: merge from the top down, squashing each PR into the one below. PR 1 merges to the base last, so no layer needs a rebase.
  • --each: merge PR 1 into the base, then rebase PR 2 onto the squashed commit (git fetch origin <base>, then git rebase --onto origin/<base> <old PR 1 tip> <PR 2>) and retarget it, and so on up the stack.
  • A fix on a lower layer: commit it there, restack with --update-refs, and push the layers above with --force-with-lease.
  • Keep the backup branch until PR 1 merges.

Next: /hb:feedback <PR 1> once reviews arrive.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

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

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

Split a large branch or PR into a stack of small PRs, verified layer by layer, and open them as linked drafts.

Vì sao nên dùng To Stack 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. To Stack 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 To Stack trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/helderberto/agent-skills/tree/main/skills/to-stack. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà 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 To Stack?

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.

Bạn có thể dùng To Stack 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 To Stack 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 To Stack có miễn phí không?

Có. Kỹ năng này được helderberto phát hành trên GitHub theo giấy phép MIT. 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 cho mô hình các công cụ mới để gọi — mã đượ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à tiêu chí của đầu ra tốt. 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 👇