npx claudepluginhub nickalus12/loom --plugin loomThis skill uses the workspace's default tool permissions.
---
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Activate this skill during Phase 3 (Execution) of Loom orchestration. This skill defines how Loom executes implementation phases through native subagent delegation.
If workflow_mode is express in the current session, STOP HERE. Do not proceed
to the execution mode gate. Do not prompt the user. Do not resolve execution mode.
Express always dispatches sequentially. Return to the Express Workflow and continue
from the delegation step.
Read LOOM_EXECUTION_MODE (default: ask).
parallel: call update_session with { execution_mode: 'parallel', execution_backend: 'native' } to record in session state. Skip to delegation.sequential: call update_session with { execution_mode: 'sequential', execution_backend: 'native' } to record in session state. Skip to delegation.ask: proceed to Step 2.Before prompting the user, analyze the approved plan to generate a recommendation:
Count total phases in the plan
Count phases marked parallel: true (parallelizable phases)
Count distinct parallel batches (groups of parallelizable phases at the same dependency depth)
Count sequential-only phases (phases with blocked_by dependencies that prevent parallelization)
Cross-check file ownership across all phases. If any two phases share a file in their files arrays, those phases CANNOT be parallel-eligible — subtract them from the parallelizable count. Report each overlap as an Overlapping-file Warning in the prompt.
If validate_plan was called during planning and returned a parallelization_profile, use its parallel_eligible and effective_batches counts as the authoritative source for items 1-5 above. These are computed from actual dependency depths and override any manual flag-based counts. If parallelization_profile is not available, use the counts from items 1-5 as-is.
Record these counts — they feed into the prompt.
update_session with { execution_mode: 'sequential', execution_backend: 'native' }. Inform the user: "All phases are sequential — no parallel batches available." Skip to delegation. Do NOT prompt with a choice. Do NOT call AskUserQuestion. Do NOT present options. (Parallelism requires at least 2 phases at the same dependency depth; a single parallel-eligible phase has nothing to batch with.)When parallelizable phases ≤ 1, there is NO choice to make. Auto-select sequential and skip directly to delegation. Do not show a picker.
AskUserQuestion options list with "(Recommended)" appended to its label. The non-recommended option MUST NOT include "(Recommended)" in its label.Call AskUserQuestion with type: 'choice' using exactly one of these option sets:
When recommending parallel: options: - label: "Parallel (Recommended)" description: "Spawn child agents for each ready batch where file ownership does not overlap." - label: "Sequential (High Precision)" description: "Spawn one child agent at a time in dependency order."
When recommending sequential: options: - label: "Sequential (Recommended)" description: "Spawn one child agent at a time in dependency order." - label: "Parallel" description: "Spawn child agents for each ready batch where file ownership does not overlap."
WRONG — Both options labeled "(Recommended)": options: - label: "Parallel (Recommended)" - label: "Sequential (High Precision) (Recommended)"Only ONE option receives the "(Recommended)" suffix. Never both.
update_session with the selected execution_mode and execution_backend: nativeparallel is selected and a ready batch has only one phase, execute it sequentiallysequential is selected, preserve plan order even when phases are parallel-safeIf execution_mode is not present in session state at the point where delegation is about to begin, STOP. Do not default to sequential. Return to this gate and resolve it. This catches any edge case where the gate was skipped.
When MCP state tools (get_session_status, update_session, transition_phase) are available, prefer them for state operations. They provide structured I/O and atomic transitions.
When MCP tools are not available, state lives inside <LOOM_STATE_DIR> and is accessible through Read and Write.
Helper scripts remain available for shell-injected command prompts:
node ${CLAUDE_PLUGIN_ROOT}/scripts/read-state.js <relative-path>
node ${CLAUDE_PLUGIN_ROOT}/scripts/read-active-session.js
Hooks fire automatically at agent boundaries. The orchestrator does not invoke them directly.
hooks system (PreToolUse): resolves active agent identity from the required Agent: header first, then falls back to legacy env/regex detection, and injects compact session contextorchestrator inline validation (no hook — see SKIP_EVENTS_CLAUDE): validates that the response contains both Task Report and Downstream Context; requests one retry on the first malformed responseThe hook state directory under /tmp/loom-hooks/<session-id>/ is transient and separate from orchestration state.
For a sequential phase:
blocked_by dependencies are completedin_progresscurrent_phasecurrent_batch: nullTodoWrite / TaskCreate before delegationcompleted or failedTodoWrite / TaskCreate after the state updateUse native parallel execution only for sibling phases at the same dependency depth with non-overlapping file ownership.
LOOM_MAX_CONCURRENTin_progresscurrent_batch in session state for that chunkLOOM_MAX_CONCURRENT=0 means emit the entire ready batch in one turnAskUserQuestion remains available; a batch may pause while waiting for user inputin_progress phases on resume instead of attempting to restore in-flight subagent interactionsInclude the following in every delegation query body:
Progress: Phase [N] of [M]: [Phase Name]
Session: [session_id]
For native parallel batches, also include the batch identifier in the required header:
Agent: <agent_name>
Phase: <id>/<total>
Batch: <batch_id>
Session: <session_id>
Record all errors in session state with:
agenttimestamptypemessageresolutionLOOM_MAX_RETRIES (default 2)failed and escalate to the userIncrement retry_count on each retry.
When a native subagent terminates early or exceeds its configured timeout:
When a subagent reports a file conflict:
Native subagent results are wrapped. Do not assume the handoff begins at byte 0.
## Task Report (or # Task Report) inside the returned text## Downstream Context (or # Downstream Context) inside the returned textAfter processing each handoff:
downstream_contextcompletedupdatedcurrent_batch as each chunk finishesWhen all phases are completed:
failed or pending phasessession-management