Community寫作與編輯github.com

Jamie-BitFlight/parallel-work

用於同時執行多個子代理的工作模式,包括扇出與屏障、製作者/檢查者、生成與過濾、排名錦標賽、根本原因假設扇出,以及條件停止循環。

parallel-work 是什麼?

此技能定義了一系列並行執行的工作模式 (Shapes),旨在幫助 AI 代理高效處理可分解的獨立任務單元。其核心價值在於透過同時啟動多個代理來提升速度,同時明確管理協調成本。技能支援廣泛的並行場景,例如對大量檔案進行相同編輯 (機械式扇出)、分離生成與評審職責 (製作者/檢查者)、從多個來源生成並篩選候選方案、透過配對比較進行排名、針對根本原因分析提出多個假設,以及重複執行直到滿足特定條件 (條件停止循環)。該技能還包含了檢查清單扇出模式,能將 `- [ ]` 列表中的未完成項目自動轉換為可並行處理的單元。技能強調在啟動循環或合併結果前必須設定上限 (Cap),以避免無限執行。這些模式主要設計為與 `delegate` 技能搭配使用,以實現跨平台 (如 Claude Code) 的並行代理調度。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Jamie-BitFlight/claude_skills/tree/main/plugins/agent-orchestration/skills/parallel-work

Installed? Explore more 寫作與編輯 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

並行工作 (Parallel work)

並行化為每個工作單元提供全新的上下文,並加快執行速度。其代價是協調成本:必須等待的匯入點 (fan-in)、不得衝突的合併操作、以及不能由製作者兼任的評判者。僅在單元真正獨立時使用,並明確支付協調成本。

前置條件

  • 工作單元之間相互獨立:沒有任何單元需要依賴另一個單元的結果才能開始。
  • 你已清楚知道有哪些工作單元。原因不明 → 先發送一次調查任務。
  • 寫入操作是隔離的:每個單元寫入不同檔案,或者每個單元在自己的隔離工作樹 (worktree) 中運行,並僅提交該單元觸及的檔案(技術細節請參考:delegate/references/harness-notes/claude-code.md 的「隔離」章節)。

缺少任一條 → 序列化處理,或先進行調查。

工作模式 (Shapes)

扇出與匯入 (Fan-out, Fan-in)。 對同一個階段的 N 個分派,每個作用於一個單元,同時發送。一個單獨的合併分派等待所有分派完成 — 這個等待就是屏障 (barrier) — 然後將它們的交付檔案合併為一個。將每個單元的輸出保留在各自的檔案中;合併器讀取的是檔案路徑,而不是你的上下文。

機械式扇出 (Mechanical fan-out)。 一個 process 分派僅決定一次確切的變更內容。N 個通用的分派原樣應用此變更,每個作用於各自的目標。一個 review 分派檢查整個結果集。協調器本身絕不應用此編輯,無論目標集合多小。

製作者/檢查者 (Maker/checker)。 產生結果的人絕不評判它。將 review 分派導向另一個代理 — 如果該領域存在 reviewer 類型的代理則使用它,否則使用不同角色的專家代理 — 並提供成功標準和工件路徑,且不透露製作者的任何推理過程。

生成與過濾 (Generate and filter)。 扇出以產生候選方案;一個分派根據書面評分標準進行去重和評分;只有存活下來的候選方案繼續。在生成之前寫好評分標準。

錦標賽 (Tournament)。 用於對一個過大而無法在單一視窗中評判的集合進行排名:進行兩兩比較的分派,每個分派持有兩個項目,並在一個檔案中維護一個錦標賽對陣表。比較式的判斷比絕對分數更可靠。

假設扇出 (Hypothesis fan-out)。 用於根本原因分析:針對每個不相關的證據來源(日誌、程式碼、資料)發送一個分派,每個分派僅從其自己的來源形成一個假設。然後針對每個假設發送一個分派,試圖反駁它。經得起反駁的假設就是最終發現。

條件停止循環 (Loop until stop)。 用於大小未知的工作:重複一個分派,直到一個可觀察的條件成立 — 沒有新的發現、閘門輸出中零錯誤、檢查清單檔案沒有未勾選的項目。在第一次迭代之前設定上限(預設為 5)。達到上限時,回報 PARTIAL 以及剩餘內容。

檢查清單扇出 (Checklist fan-out)

一個包含 - [ ] 項目的 Markdown 檔案就是一個現成的工作單元列表:為每個未勾選的項目發送一個分派,每個分派被告知在完成 (DONE) 時勾選自己的那一行,然後循環直到「沒有未勾選的項目剩餘」。對操作同一檔案的多個項目進行序列化處理。

上限與停止條件

每個循環和每個匯入點在開始之前都必須設定一個數字:迭代次數、重新分派次數、或工作單元數量。達到上限時,向用戶回報 PARTIAL 或 BLOCKED,絕不能默默地重試。

持久化團隊 (Persistent teams)

某些執行平台提供長期存在的代理團隊,並附帶共享任務列表和訊息功能。它們增加了代理們不一致遵循的指令和通訊開銷,並且在不同平台之間不可移植。上述的各種工作模式完全不需要這些功能。僅當代理必須在任務中間交換訊息時才考慮使用團隊功能,並且此時應查閱執行平台的使用說明。

參考指標

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Jamie-BitFlight/agentskill-kaizen-meta-docs

Agentskill kaizen plugin documentation index. Load when needing to read about cross-platform notes, improvement plans, or DuckDB integration.

Jamie-BitFlight/bash-51-features

Bash 5.1 release features and improvements with practical examples. Use when working with Bash 5.1 features, epoch time variables, redirection enhancements, or when user asks about Bash 5.1 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-52-features

Bash 5.2 release features and improvements with practical examples. Use when working with Bash 5.2 features, variable handling enhancements, readline improvements, or when user asks about Bash 5.2 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-53-features

Bash 5.3 release features and improvements with practical examples. Use when working with Bash 5.3 features, new command substitution, GLOBSORT, loadable builtins, or when user asks about Bash 5.3 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-development

This skill should be used when the user asks to "write a bash script", "create a shell script", "implement bash function", "parse arguments in bash", "handle errors in bash", or mentions bash development, shell scripting, script templates, or modern bash patterns.

Jamie-BitFlight/bash-lint

This skill should be used when the user asks to "lint bash script", "run shellcheck", "format shell script", "use shfmt", "fix shellcheck errors", or mentions shell script linting, formatting, code quality, or pre-commit hooks for bash.

Jamie-BitFlight/bash-logging

This skill should be used when the user asks to "add logging to bash script", "colorize output", "implement log levels", "CI/CD sections", "terminal colors in bash", or mentions logging functions, emoji output, collapsible CI sections, or shlocksmith.

Jamie-BitFlight/bash-portability

This skill should be used when the user asks about "POSIX compatibility", "portable shell scripts", "cross-shell compatibility", "bashisms", "shebang selection", or mentions writing scripts that work on different shells (bash, sh, dash, zsh) or different systems.

Jamie-BitFlight/bash-testing

This skill should be used when the user asks to "test bash script", "write shell tests", "use shunit2", "use shellspec", "create test suite for bash", or mentions unit testing, test frameworks, mocking, or test-driven development for shell scripts.

Jamie-BitFlight/brainstorming-skill

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or when users request help with ideation, marketing, and strategic planning. Explores user intent, requirements, and design before implementation using research-validated prompt patterns.

Jamie-BitFlight/clang-format

Configure clang-format code formatting. Use when: user mentions clang-format or .clang-format, analyzing code style/patterns, creating/modifying formatting config, troubleshooting formatting, brace styles/indentation/spacing/alignment/pointer alignment, or codifying conventions.

Jamie-BitFlight/commitlint

When setting up commit message validation for a project. When project has commitlint.config.js or .commitlintrc files. When configuring CI/CD to enforce commit format. When extracting commit rules for LLM prompt generation. When debugging commit message rejection errors.

Jamie-BitFlight/conventional-commits

When writing a git commit message. When task completes and changes need committing. When project uses semantic-release, commitizen, git-cliff. When choosing between feat/fix/chore/docs types. When indicating breaking changes. When generating changelogs from commit history.

Jamie-BitFlight/dasel-reference

Use when querying, modifying, or converting JSON, YAML, TOML, XML, CSV, HCL, or INI with dasel v3. Complete reference for selectors, functions, conditionals, variables, spread operator, type casting, and format-specific patterns.

Jamie-BitFlight/data-exploration

Use when exploring unknown structured data files with dasel v3 — discover schema, list keys, find nested values, sample arrays, identify data types across JSON, YAML, TOML, XML, CSV, HCL, INI formats

Jamie-BitFlight/data-transformation

Use when modifying, converting, or transforming structured data with dasel v3 — in-place mutations, format conversion, batch operations, array manipulation, object construction, and merge patterns across JSON, YAML, TOML, XML, CSV, HCL, INI

Jamie-BitFlight/delegate

Decompose substantive work into phases, dispatch each phase to a sub-agent, and adjudicate what comes back. Use whenever a request asks for implementation, investigation, a fix, a review, or any change to files — including small ones — and whenever you are about to read source or run a diagnostic yourself instead of handing it off. Also use when a report from a sub-agent needs judging, when a phase needs re-dispatching, or when a user names one instance of a pattern. Does not apply when your own prompt begins "Your ROLE_TYPE is sub-agent." — then follow references/sub-agent-contract.md instead.

Jamie-BitFlight/enterprise-hibernate-hbm

Dasel v3 query patterns for Hibernate .hbm.xml mapping files — entity-table binding, Java property-to-column extraction, one-to-many set/list/bag relationship tracing, many-to-one foreign key discovery, batch scanning across 60+ HBM files. Use when querying Hibernate ORM class mappings, extracting schema metadata from Java persistence layer, or auditing entity-column relationships in enterprise legacy codebases.

Jamie-BitFlight/enterprise-installanywhere

Dasel v3 query patterns for InstallAnywhere .iap_xml installer definitions — use when querying action sequences, discovering variables, resolving platform conditions, navigating panels, or comparing installer variants. Files are 2.5+ MB, 65,000+ lines — too large for context reads, requires structural dasel queries.

Jamie-BitFlight/enterprise-maven-pom

Dasel v3 selector patterns for Maven POM XML files — use when querying dependency versions, filtering by groupId or scope, extracting module hierarchy from parent POMs, or detecting version conflicts across enterprise multi-module Java projects. Load this skill when working with pom.xml files using dasel.

相關技能