worker-delegate
Skill2 starsChanged 6 days agoMITView on GitHub
Use when delegating high-volume file exploration, log triage, or disjoint domain reviews to isolated sub-agents or background workers.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Echo-Scion/portable-brainvibingword for word, first seen Oct 15, 2026
Other versions1 project uses a version of this.
Word for word · 1
- Echo-Scion/portable-brainvibing★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-engineerSkill
- api-contractSkill
- app-lifecycleSkill
- brain-graphSkill
- code-reviewSkill
- cost-optimizerSkill
- data-logicSkill
- feature-discoverySkill
- frontend-experienceSkill
- integrity-sentinelSkill
- meta-agent-adminSkill
- paletteSkill
- project-architectSkill
- project-operatorSkill
- saas-strategistSkill
- self-evolveSkill
- session-offloadSkill
- strict-tddSkill
- systematic-debuggingSkill
- ui-finishSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Before spawning a subagent, the Agent MUST evaluate the task against this deterministic routing matrix:
- Very specific: line 37
Exit Code 1 (
MERGE_TO_SINGLE_AGENT): If $J(T_1, T_2) > 0.20$ ($20\%$), the Agent MUST abort delegation and merge all tasks into a single … - Very specific: line 38
Exit Code 0 (
ALLOW_DELEGATION/ALLOW_PARALLEL_DISJOINT): If $J(T_1, T_2) \le 0.20$, the Agent MAY proceed with subagent delegation. - Distinctive: line 47
When dispatching 2–3 subagents concurrently, the Agent MUST structure subagent prompts using an Immutable Prefix + Variable Suffix layout:
- Very specific: line 58
When delegating tasks using isolated branch or worktree workspaces (Workspace: 'branch' or Workspace: 'share'), the new workspace starts …
- Very specific: line 106
When using native fallback, pass Model: 'flash' (BUDGET [High Effort]) down-tiered from PREMIUM, capped at $\le 2$ concurrent subagents.
- Very specific: line 142
Every result file MUST include a fenced ``
jsonl ``` Context Delta block:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Worker Delegation Protocol (Context-Isolating Scout)
Core Law: The Main Agent owns all architectural state and file mutations (Single-Writer Principle). Subagents operate strictly as Read-Only Scouts, Patch-Spec Drafters, or Partitioned Auditors to prevent context pollution and split-brain code modifications.
1. The 4-Way Execution Routing Gate (Choose Before Delegating)
Before spawning a subagent, the Agent MUST evaluate the task against this deterministic routing matrix:
| Task Characteristic | Context Overlap | Target Mechanism | Operational Rationale |
| Multi-file feature coding / refactoring | $\ge 20%$ | Main Thread (/plan $\to$ implementation_plan.md) | Prevents split-brain state drift, interface drift, and redundant context prefill. |
| End-to-end autonomous module / greenfield app | High (Swarm) | /teamwork (invoke_subagent) | Uses platform-native multi-agent shared blackboard & internal review loop. |
| Heavy CLI build / pack / test / AST scan | $0%$ (OS Process) | Native Async (run_command background) | Zero LLM token burn during execution; reactive wakeup on completion. |
| Searching 20+ files, log triage, or disjoint read-only audit | $< 20%$ | /worker-delegate (invoke_subagent) | Condenses 50,000+ raw tokens into a 20-line surgical brief for the main thread. |
2. Pre-Delegation Mechanical Gates
The Agent MUST enforce three deterministic gates prior to dispatching any subagent:
Gate 1: Deterministic Dependency Overlap Gate (orion.py delegate-check)
The Agent MUST NOT guess context overlap. Before splitting tasks across subagents, the Agent MUST run:
python .agents/scripts/orion.py delegate-check <task1_files> <task2_files> [--threshold 0.20]The CLI resolves 1-hop local imports and calculates pairwise Jaccard Dependency Overlap: $$J(T_1, T_2) = \frac{|D(T_1) \cap D(T_2)|}{|D(T_1) \cup D(T_2)|}$$
- Exit Code 1 (
MERGE_TO_SINGLE_AGENT): If $J(T_1, T_2) > 0.20$ ($20%$), the Agent MUST abort delegation and merge all tasks into a single sequential plan (implementation_plan.md) on the main thread. - Exit Code 0 (
ALLOW_DELEGATION/ALLOW_PARALLEL_DISJOINT): If $J(T_1, T_2) \le 0.20$, the Agent MAY proceed with subagent delegation.
Gate 2: Tier-0 Mechanical Scout First (Zero-Token Pre-Filter)
The Agent MUST NOT dispatch an LLM subagent to read unindexed files sequentially.
- The Agent MUST run
python .agents/scripts/orion.py scan map <target_dir>orrtk grepto extract exact AST symbol spans[Lstart-Lend]. - The Agent MUST pass the generated AST skeleton map into the subagent's task specification.
- The Agent MUST instruct the subagent to inspect only the targeted
[Lstart-Lend]spans usingread_filerather than reading entire source files.
Gate 3: Prefix-Cache Aligned Sub-Agent Prompting (Cloud LLM Parallelism)
When dispatching 2–3 subagents concurrently, the Agent MUST structure subagent prompts using an Immutable Prefix + Variable Suffix layout:
- Immutable Prefix (100% Identical Order Across Subagents):
- Root rules (
AGENTS.md) - Repository Map & PageRank symbol topology
- Global symbol definitions
- Root rules (
- Variable Suffix (Partition-Specific):
- Specific task contract
- Isolated partition file list This structure maximizes Cloud LLM prefix-cache hits across concurrent subagent executions.
Gate 4: Sub-Agent Workspace Warm-Up (orion.py worktree seed)
When delegating tasks using isolated branch or worktree workspaces (Workspace: 'branch' or Workspace: 'share'), the new workspace starts cold (lacking gitignored .env, .orion/working/context.json, and tool configs).
- The Agent MUST execute worktree seeding before dispatching:
python .agents/scripts/orion.py worktree seed <target_workspace_path> - The seeder ports all declared
.worktreeincludeenvironment files instantly via reflink / hardlink, ensuring subagents never suffer from missing.envor missing context crashes.
3. Read-Only Subagent Archetypes (Single-Writer Principle)
The Subagent MUST NOT write or edit files in the workspace. All file mutations belong exclusively to the Main Agent.
Archetype 1: investigator (Code Locating & Log Triage)
- Role: Discovers candidate symbol definitions, references, or error patterns across large file trees.
- Output Contract:
<Header>: - path:line — `symbol` — short note totals: <counts>.
Archetype 2: patch-drafter (Surgical Patch Specification Synthesizer)
- Role: Performs read-only inspection of candidate sites and drafts drop-in replacement specifications without touching files.
- Output Contract:
Verification: <expected assertion / exit code>path:Lstart-Lend — `symbol_signature` Root Cause: <1-sentence analysis> Replacement Code: ```language <exact replacement block> - Execution: The Main Agent reviews the patch specification and applies edits using native file-editing tools.
Archetype 3: reviewer (Isolated Reviewer & 5-Lens Goldfish Swarm)
- Role: Stateless, read-only auditor evaluating diffs, technical blueprints (
context/00_Strategy/BLUEPRINT.md), or architectural proposals (implementation_plan.md) across 5 focused lenses:simplicity-reuse: High-altitude simplicity, YAGNI, anti-weeds, and codebase reuse.comprehension: Synthesizes what this proposes and how the existing system works; failure to synthesize = Blocker.system-risks: Probes scaling bottlenecks, unbacked assertions, and failure modes across the Triad.implementation-readiness: Enforces the Stage 5 Zero-Decision Check (zero design decisions left to implementers).layer-boundaries: Audits 5-tier layer boundaries and unidirectional dependency direction.
- Second-Worker-First Delegation Law (0% Primary IDE Quota):
- Dispatched via
python .agents/scripts/orion.py worker review --spec <path>(aliased asorion.py delegate). - Routes execution through the Dual-Engine Second Worker (OpenCode Go API in parallel
max_workers=3or Local Ollama sequentiallymax_workers=1), consuming 0% of the user's primary IDE cloud quota.
- Dispatched via
- Native Subagent Bounded Fallback:
- Permitted ONLY if both API Worker and Local Ollama are offline AND host platform supports native subagents.
- When using native fallback, pass
Model: 'flash'(BUDGET [High Effort]) down-tiered fromPREMIUM, capped at $\le 2$ concurrent subagents.
- Output Contract:
path:line: <emoji> <severity>: <problem>. <fix>. totals: N🔴 N🟡 N🔵 N❓ Scout Status: completed | not_run
4. Structured Task Specification Schema
The Agent MUST write delegation task specifications to .agents/working/delegations/task-{task_id}.md:
# File: .agents/working/delegations/task-{task_id}.md
## Task Contract
- task_id: "TASK-001"
- archetype: "investigator" | "patch-drafter" | "reviewer"
- intent: "[Single-sentence measurable objective]"
- target_partition:
- "path/to/read_only_dir_or_file1"
- "path/to/read_only_dir_or_file2"
- forbidden_files:
- ".agents/rules/*"
- ".orion/*"
- ast_skeleton_input: "Path to compiled AST skeleton map"
- output_artifact: ".agents/working/delegations/result-TASK-001.md"5. Result Collection & Session Context Cache Ingestion
The Subagent MUST write its final output to .agents/working/delegations/result-{task_id}.md.
Every result file MUST include a fenced ```jsonl Context Delta block:
# Result: {task_id}
## Status: SUCCESS | PARTIAL | FAILED
## Summary
[1-3 sentence lessword summary]
## Context Delta
```jsonl
{"target_file": "path/to/file.py", "ast_span": "[L120-L165]", "symbol_signature": "def process_data()", "action_recipe": "Add bounds check before indexing list"}Detailed Findings
[Structured tables, patch specifications, or audit notes]
### Automatic Session Context Cache Ingestion
The `pre-agent-wake.py` hook automatically scans `.agents/working/delegations/result-*.md` and extracts all Context Delta records into `context_payload["delegation_deltas"]` inside `.orion/working/context.json`. The Main Agent consumes these surgical recipes with $<5\%$ context footprint without re-reading raw files.
---
## 6. Anti-Patterns & Operational Invariants
- ❌ The Agent MUST NOT delegate tasks when $J(T_1, T_2) > 0.20$ via `delegate-check`.
- ❌ In **Mode A (Main-Worktree Scout / Reviewer / Patch-Drafter)**, the Subagent MUST NOT modify source files (`write_file`, `edit_file`) or mutate git worktrees; only `.agents/working/delegations/result-{task_id}.md` may be written.
- ❌ In **Mode B (`/teamwork` Isolated Branch Worktree)**, file mutations are permitted ONLY inside the seeded worktree (`orion.py worktree seed <path>`) when $J(T_1, T_2) \le 0.20$ and write-sets are strictly disjoint.
- ❌ The Agent MUST NOT read worker output from raw stdout streams; the Agent MUST read `.agents/working/delegations/result-{task_id}.md`.
- ❌ The Agent MUST NOT spawn more than 3 subagents concurrently. Always dispatch swarms in sequential batches of $\le 3$.
- ❌ The Agent MUST NOT count a failed, timed-out, or unresponsive subagent reviewer as having "zero findings". If retry fails, its status MUST be recorded as `not run`.
- ❌ The Agent MUST NOT invoke Isolated Reviewers on `PREMIUM` models; pass `Model: 'flash'` for all read-only review delegations to preserve cloud quota.
---
## 7. Operational References
- Continuous execution rulings: `references/continuous_execution.md`Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

