Logo Delegation

Delegation

Cộng đồng
phuryn
delegation

Before spawning a subagent or dispatching a build, review or research, and before trusting its report: the brief, the delegate, parallel runs, the handoff.

Tổng quan

Nhà phát hànhphuryn
Kho mãproduct-engineering
Tên kỹ năngdelegation
Sao
189
Bản fork
27
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 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ộ.

  • 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 phuryn 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 Delegation 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/phuryn/product-engineering/tree/main/agent-teams/skills/delegation
  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/phuryn/product-engineering.git /tmp/product-engineering
mkdir -p .claude/skills
cp -r /tmp/product-engineering/agent-teams/skills/delegation .claude/skills/delegation
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 Delegation 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 Delegation 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 Delegation 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.

Delegation — a delegate is a partner

A delegate starts with nothing but what you hand it. Give it the why, not just the what: what you are trying to achieve and for whom, the constraints that bind, the traps a smart newcomer would walk into, and how the result will be proved. An instruction-only brief ("change X to Y") gets X changed to Y even when Y is not what you wanted. A brief with the goal in it comes back with judgement: "the force at replay end is redundant, here is why", "a 30px overlay would cover the last line, which is worse than the jump" — each of which changed what shipped (2026-08-21, a remote-control product). That is the return on a brief's length: not compliance, judgement.

Manage a delegate the way a good owner manages you: goal and context, not step-by-step; trust its judgement on the means; push back where you disagree; its view is not binding.

The mechanics of each delegate live in their own skills: codex-agents, grok-agents and claude-agents (each CLI driven headless from another agent as a peer, builder or reviewer), and independent-review (the unsteered review loop, run by default through the Grok CLI or a fresh headless Claude session). This skill is what they share.

What never delegates

  • Deciding what the product should do — thesis, scope, taste, what the owner wants.
  • Accepting or rejecting a review finding. A finding is a claim, its severity included (independent-review § Triage).
  • Anything that touches a real system, development included — a deploy or a promotion, a migration applied to any database (a development project only you use included), a server or worker and its secrets, a live configuration, a drill. The delegate builds each so it is one command and names the commands; you run them. (2026-10-23 and 24, a monitoring product: every stage brief listed these under "What stays with me". Delegated builds made 28 commits the day before the first release and none on the day of five production promotions, which was review fixes and real systems throughout.)
  • Final verification. The tests, the typecheck, the gate, the smoke run on your own eyes. "It says it passes" is a claim to check, never a result.
  • The judgement that a stage is done.

When it is worth handing off: size, not time

If the brief would be nearly as long as the diff, write the diff. Delegation costs a hand-off: the delegate rediscovers the file, the conventions and the surrounding code before it changes anything. (2026-08-21: having already found the exact lines, an agent wrote a 60-line brief and waited twenty minutes for a change it could have made in two.)

SituationWho
You know the file and the line, and the change is mechanicalyou, directly — no brief, no round trip
It needs exploration, or you are unsure of the mechanisma delegate
It needs real test coveragea delegate, or one focused test you write yourself
A naive fix would walk into a trapa delegate, with the trap in the brief — this is where a long brief earns out
  • A build round that has made no writes on a small change is stopped, its leftover process killed, and the change written in-session (2026-09-22, a builder sat twelve minutes on a fifteen-line change with a clean tree). What stays with you is unchanged, and your diff still gets the independent review.
  • Use the parallelism or don't pay for it. The point of a background agent is that you work while it runs. Waiting on it is the latency of delegation without the throughput.
  • Don't delegate when you need the reasoning yourself, or when the synthesis needs everything held in one head.

The brief

Three things, and the first is the one most often skipped:

  1. What we are trying to achieve, and why — the goal in the owner's terms, and the decision it feeds. A delegate that knows "we are choosing between A and B" can flag a third option or tell you the question is wrong; one told "research A and B" cannot.
  2. The constraints that bind, including the do-nots. The briefs that mattered most carried a warning, not a task: "do not fix this in the argument builder — the same string feeds another spawn path", "replay is off the table, recovery only" (2026-08-21). Each stopped a plausible fix that would have been wrong in the large.
  3. How to prove it — the tests, the gate, what "done" looks like for this hand-off, which is narrower than the stage's own done-when whenever that needs real systems. Say what the delegate's sandbox cannot reach (a database, a browser, Docker, the network) and who runs those checks: "write them; I run them". Its handoff then reports them as written but not run, instead of inventing a count, and says it is a code handoff, not the stage done. Ask it to exercise every existing page and function the stage touches, not only its own (2026-11-01, an evals product: a builder's integration tests found a bug in the session agent's own code, an embed across a relationship that doesn't exist, on a page no earlier test had opened). (2026-10-22 and 23, a monitoring product: briefs that said so got "written, not run" back. The invented counts under § When it comes back are what happens when a brief doesn't.)

Then:

  • Compress the evidence, not the context. Three lines of log beat twenty lines of the reasoning that convinced you. Keep the goal, the binding constraints and the traps at full length; a terse brief produces a locally correct change that is wrong in the large.
  • The brief is the delegate's entire reality. If your conclusion will rest on a specific claim being true ("none of them shipped X"), put the claim in the brief and ask the delegate to confirm or refute it against primary sources. Treat absence claims as extraordinary. Surface data (engagement numbers, link lists, file names) is not product reality. When a fact changes while it builds, append a dated "Added while you build" section to the brief file rather than sending a side message, so the file stays the whole of it (2026-10-23: the owner changed the identity provider's organization settings mid-build).
  • A feature that guesses from real-world input starts from evidence. Run the unchanged code on a real corpus first and cite its numbers for each binding decision. After the build, pin a live golden set that runs on demand, outside the gate. A decision taken from research is a hypothesis the live run may reverse; record the reversal with its measurement. (2026-10-23 and 24, a monitoring product: a brief for suggested health checks was built on a scan of 495 real apps. A live run on 30 sites reversed one binding decision, because a browser-like Accept header turned checks into page loads: one framework's health route answered HTML, and an identity provider's development instance redirected every check to its sign-in. The same run found four more defects.)
  • Don't prescribe the means — paths, filenames, libraries, structure — unless they are hard constraints. "The existing system uses X" is context, not a directive. A choice you wouldn't have made is a disagreement to surface, not a defect.
  • Long briefs go in a file, passed by path or stdin, never as a long inline argument: a long prompt inline trips permission classifiers and shell quoting.
  • Name ranges, not commits, in a brief you will reuse. A second round run from a brief that pins a SHA re-reviews the commit already reviewed and confidently re-reports what was fixed one commit later (2026-08-22, twice in one session). git log --oneline <last-reviewed>..HEAD fails loudly when stale.
  • references/brief-template.md is a starting shape, and also the handoff to ask for back: what was built, the choices where the brief was silent, corrections to the spec, blockers stated as blockers, validation actually run, the commands for you, and what must be redeployed after the push.

Choosing the delegate

DelegateStrong atWatch for
A Claude subagent (the Agent tool)Work that needs this repository's context: it loads the project instructions automaticallyFresh context — none of your conversation or tool results. It loads the project instructions and your settings and inherits your framing, so it is never the reviewer of your work; a review is a session that starts from the repository and the brief alone (independent-review). Often one level deep: a subagent may have no Agent tool of its own (observed 2026-06-10)
The Codex CLI (codex-agents)Building a stage to a brief; arguing a decision through as a peer over several turnsSandbox: a new session is read-only unless told otherwise, and a "build" round that changed nothing reads exactly like one that worked — check the disk
The Grok CLI (grok-agents)A peer, builder or reviewer from a different model family; the independent review's default reviewer (independent-review)A round that could not read exits 0 after a sentence; length is the tell
Headless Claude Code (claude-agents)A session with none of your conversation: a builder or peer for an agent that is not Claude, or a reviewerA plain -p run still loads the project's and the user's instruction files and auto-memory; only a restricted review run starts from the repository alone. A resume keeps the model but drops effort, permission mode and tools unless re-sent (observed 2026-10-24)

The session that wrote the code never clears it. The reviewer is a fresh session, ideally another model family, never the building thread resumed or forked and never a subagent of it. The loop and its stopping rule are independent-review.

Model and effort (Claude subagents)

  • Set the model explicitly on every spawn. Omitting it inherits the parent's model; "inherit" is never a routing decision, it is the absence of one. (2026-07-03: a full day of mining agents, evidence filers and a benchmark babysitter ran silently at top-tier rates; the babysitter alone was about twenty rounds of purely mechanical work a mid-tier model does identically.)
  • Route by the job, not by how important it feels. The smallest tier for bulk mechanics with no judgement (renames, CSV parsing, log scans); the mid tier for scoped research, code exploration and building to a written spec; the top tiers for multi-step reasoning and for judgement bottlenecks — architecture, adversarial review, taste. Model names change every few months; the shape doesn't.
  • Use the top tier adversarially. The highest-value top-tier call of one day was "refute this audit", which overturned the parent's framing and trimmed two over-read magnitudes (2026-07-24).
  • Consult up. A cheaper parent running a plan spawns ONE top-tier child for the single judgement-heavy step — packed with the full context, the why and the specific decision — and treats its answer as the ruling on that step.
  • Pull down, decide up. For data work, the child pulls and reduces to a table; the parent decides what the table means. (2026-08-12: a whole search-data scan ran in a top-tier parent — paginating an API, reducing 39K rows — when the only step that needed it was deciding that one 219K-impression row was worth zero.)
  • Effort. Check what a spawn actually ran at rather than assuming: each subagent transcript records it (grep -o '"effort":"[a-z]*"' <transcript> | sort | uniq -c). Measured 2026-08-22: Agent-tool spawns inherited the parent session's effort, whatever tier they ran on. Claude Code 2.1.310 (read 2026-10-24) gives the Agent tool its own effort field; a workflow's agent options or an agent definition's frontmatter set it too.
  • A child that finds the task needs more reasoning than its tier gives returns to the parent rather than burning tokens; the parent re-runs that step a tier up.

Several agents at once

  • Parallelise on evidence, not impatience. Measure the file overlap before deciding: git show --stat --name-only --format= <ref> per planned change. (2026-08-20: of eight commits, six touched one protocol file and five one host file, so almost nothing in the batch was parallel-safe; the two that touched neither were exactly the two that should have run alongside.)
  • Never two writers in one tree. A fix written while a delegate built in the same checkout vanished silently when the delegate wrote its files back; git status showed the file identical to HEAD (2026-08-19). Parallel means separate worktrees or nothing.
  • Worktrees carry their own dependencies. Never remove a worktree whose node_modules is a link to another checkout: removal deletes through the link (independent-review has the recipe).
  • Parallel stages merge through an integration branch. Each stage builds on its own branch in its own worktree and gets a clean review round before it merges; the merge names that round, and the gate runs again after every merge, because two branches that pass alone can fail together (a test fixture from one predated a field the other made required). Shared ledgers are where merges conflict — the backlog, the decision log, the test doc, the architecture doc, the plan — and the resolution keeps both sides' entries. Briefs for concurrent stages reserve the shared sequence numbers: which migration number and timestamp floor each stage takes, and which migrations are applied rather than only written. Every merge checks the new migrations' timestamps against the ledger (migration list on the database they will be applied to), because a reserved floor does not stop a collision with one applied meanwhile (2026-11-01, an evals product: a builder's timestamp matched, to the second, one applied on the main branch while it built). (2026-10-22 and 23, a monitoring product: 39 merges into the integration branch, 16 with conflicts; 25 of the 37 conflicted files were shared docs. Two branches' migrations collided once, and the unapplied one was renumbered after the other, already applied with a later timestamp.)
  • Parallel sessions share more than a tree: test accounts, the development database, and any worker running against it. Give each concurrent session its own accounts or run them one at a time, and scope background workers to named accounts. (2026-10-22, a monitoring product: a design-review session created records in the gate's test account mid-run and turned the gate red, and development's workers picked up the suites' test records, about 90 checks a gate run racing their assertions; 2026-10-24, a signed-in browser step failed two runs of three under a parallel review's load.)
  • The binding constraint is usually review, not build. Findings do not exist until a round runs, and fix commits are where the worst defects come from, so parallel building cannot compress that chain. Within one branch, review stays sequential: each round needs a stable "what changed since the last round".

While it runs

  • Don't edit a tree a delegate is building in. Wait, or work in another worktree.
  • Never git checkout -- <file> (or git restore) on a tree carrying uncommitted work to undo a probe edit: it destroys everything uncommitted in the file, a delegate's whole build included. (2026-08-15, twice in one day; one implementation was recovered only from a source map that still embedded the original TypeScript.) Undo a probe by re-editing the exact change back, or git stash push -- <file> around it. Commit a build before breaking it on purpose to verify a test.
  • Long runs go detached, with a completion marker you watch for, because a shell tool kills its process tree at its timeout. Keep their state in files that survive your context window (flight-deck).

When it comes back

  • A delegated diff is unreviewed code. Read it before believing it, and it still gets the independent review.
  • Check the disk before believing a round happened: git status, file times. A round that ran without write access returns a reasoned report that changed nothing and reads exactly like one that worked (2026-09-16).
  • Re-run the gate yourself, and rewrite any evidence it wrote from your own run. A delegated builder whose sandbox could not reach the database or a browser had no passing gate to report; twice its runs were written up with invented counts (2026-09-16, 2026-09-17). Read every line a delegate adds to a coverage map or a status file.
  • Before passing a delegate's "commands for the owner" up, do every one you can — through an API, a CLI, a key you hold — and re-read the result. Escalate only what truly needs a person: a dashboard-only click, money, taste. (2026-10-23, a monitoring product: a handoff listed the identity provider's OAuth settings as owner settings; they were applied through its backend API with the instance's secret key and re-read, and the migrations and edge rollout in two other handoffs' owner commands were run by the coordinator.)
  • A builder's objection that is a product decision goes to the owner, from its own section of the handoff, never folded in with the corrections you can accept yourself. (2026-11-01, an evals product: a builder found that the brief's sample above a spending cap contradicted the brief's own overshoot bound; it was right, and which to keep was the owner's call.)
  • When you take a handoff over, put a dated status line at its top (merged, reviewed in which rounds, deployed where, what still waits) and your own changes in a section of their own, leaving the delegate's text as written. Check what it claims was deployed against your environment's log. (2026-10-24: a handoff still opened "incomplete" and "uncommitted" after the coordinator had committed, reviewed and pushed it, and it claimed a deploy the environment log never recorded; review rounds found both.)
  • Audits record HEAD and git status --short at the start and again before delivering, and re-verify any finding about a deleted, moved or renamed file against current HEAD. Put that instruction in the audit's brief. (An audit once reported a file "in limbo" whose deletion had been committed earlier the same session.)
  • Repeated correct fixes that don't work mean the model of the problem is wrong, not the implementation. Stop fixing and get one observation that discriminates between two mechanisms — a screenshot, one question the owner can answer in a minute. Ask it the second time a fix does not land, not the fifth (2026-08-21: four rounds, each correct and green, none fixing the symptom). Green tests that exercise a sequence the user never receives convert "I don't understand this" into "this is fixed".
  • Converge before surfacing. The owner arbitrates intent and taste, not trade-offs two agents could argue through; bring them one result, or a disagreement stated cleanly.
  • "Ready to test" means testable with nothing to do first — built, installed or deployed on the surface the owner will use, with what needs a reload said. A handoff that names its edges is fine; one that stops midway and calls itself done is not (2026-08-19: the owner tested a fix twice against last night's build).

How you can tell it worked

The delegate's report could be checked against the disk without asking it anything, and whatever it claimed to have run, you ran again yourself.

Files

FileHoldsRead when
references/brief-template.mda brief's skeleton, with what each part is for, and the handoff the delegate writes backwriting any brief longer than a paragraph; reading a handoff

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

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

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

Before spawning a subagent or dispatching a build, review or research, and before trusting its report: the brief, the delegate, parallel runs, the handoff.

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

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/phuryn/product-engineering/tree/main/agent-teams/skills/delegation. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng 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 Delegation?

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 Delegation 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 Delegation 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 Delegation có miễn phí không?

Có. Kỹ năng này được phuryn 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 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 👇