From harness-claude
Dispatches 3+ independent tasks to concurrent agents after verifying no file/dependency conflicts, integrates results. For parallelizable tasks in separate codebase subsystems.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Dispatch independent tasks to concurrent agents, integrate results, and verify no conflicts. Only for truly independent problems.
Dispatches parallel subagents for 2+ independent tasks without file or state conflicts or dependencies. Triggers on 'run these in parallel', plans with separate domains, includes prompt templates and verification.
Dispatches concurrent agents for independent problems like multiple test failures in different subsystems or bulk operations on unrelated files. Use when tasks have no shared state to cut resolution time.
Provides patterns for subagent delegation and parallel execution using fan-out/fan-in, map-reduce, and isolation techniques. Use for independent subtasks, multi-area research, coordinated specialist work, or avoiding sequential delays.
Share bugs, ideas, or general feedback.
Dispatch independent tasks to concurrent agents, integrate results, and verify no conflicts. Only for truly independent problems.
Before dispatching anything in parallel, predict conflicts using predict_conflicts (preferred) or check_task_independence (fallback):
List the candidate tasks. Pull from the plan, or identify from the current work. For each task, identify the files it will read and write.
Call check_task_independence. Pass the tasks with their file lists:
{
"path": "<project-root>",
"tasks": [
{ "id": "task-a", "files": ["src/module-a/index.ts", "src/module-a/index.test.ts"] },
{ "id": "task-b", "files": ["src/module-b/index.ts", "src/module-b/index.test.ts"] }
],
"depth": 1
}
The tool checks direct file overlap AND transitive dependency overlap (via the knowledge graph when available). It returns:
pairs: Pairwise independence results with overlap detailsgroups: Safe parallel dispatch groups (connected components of the conflict graph)verdict: Human-readable summary (e.g., "3 of 4 tasks can run in parallel in 2 groups")analysisLevel: "graph-expanded" (full analysis) or "file-only" (graph unavailable)Preferred: Use predict_conflicts for severity-aware analysis with automatic regrouping:
{
"path": "<project-root>",
"tasks": [
{ "id": "task-a", "files": ["src/module-a/index.ts", "src/module-a/index.test.ts"] },
{ "id": "task-b", "files": ["src/module-b/index.ts", "src/module-b/index.test.ts"] }
],
"depth": 1
}
The predict_conflicts tool extends independence checking with:
conflicts: Severity-classified conflict details with human-readable reasoninggroups: Revised parallel dispatch groups (high-severity conflicts force serialization)summary: Conflict counts by severity and whether regrouping occurredverdict: Human-readable summary including severity breakdownIf predict_conflicts is unavailable, fall back to check_task_independence.
Act on the result. Use the returned groups for dispatch. Flag any medium-severity conflicts to the coordinator. If high-severity conflicts forced regrouping (summary.regrouped === true), log which tasks were serialized and why. If all tasks are in one group, dispatch them all in parallel. If tasks are split across groups, dispatch each group as a separate parallel wave.
When in doubt, run serially. The cost of a false parallel dispatch (merge conflicts, subtle bugs, wasted work) far exceeds the cost of running serially.
If check_task_independence is not available, verify independence manually:
Check file overlap. For each pair of tasks, compare the files they will read and write. Any overlap in WRITE targets means they are NOT independent. Overlap in READ targets is acceptable only if neither task writes to those files.
Check state overlap. Do any tasks share database tables, configuration files, environment variables, or in-memory state? If yes, they are NOT independent.
Check import graph overlap. If Task A modifies module X and Task B imports module X, they are NOT independent — Task B's tests may be affected by Task A's changes.
When in doubt, run serially. Same principle as above.
When a knowledge graph exists at .harness/graph/, check_task_independence automatically uses it for transitive dependency analysis (this is the "graph-expanded" analysis level). No manual graph queries are needed for independence checking.
For custom queries beyond independence checking, these tools remain available:
query_graph — get the dependency subgraph for a specific module or fileget_impact — assess the impact radius of changes to a specific moduleWhen no graph is available, check_task_independence falls back to file-only overlap detection and flags analysisLevel: "file-only" so you know transitive dependencies were not checked.
For each independent task, write a focused agent brief:
Scope. Exactly what files and directories this agent may touch. Be explicit about boundaries — the agent should not explore outside its scope.
Goal. One sentence: what is the observable outcome when this agent is done?
Constraints. What the agent must NOT do:
harness validate before your final commitExpected output. What the agent should produce:
Context. Give each agent the minimum context it needs. Include relevant file paths, type definitions it will use, and API contracts it must respect. Do not dump the entire codebase context — focused agents work better with focused context.
Launch agents in parallel. Use subagent dispatch (TaskCreate or platform-specific parallel execution).
Do not intervene while agents are running unless one reports a blocker. Let them complete independently.
Collect results. Wait for all agents to finish. Gather their outputs: commits, test results, and summaries.
Check for conflicts. Even with verified independence, unexpected conflicts can occur:
If conflicts exist, resolve them manually. Do not ask an agent to fix conflicts it does not have full context for. You have the full picture; the agents did not.
Run the FULL test suite. Not just each agent's tests — the complete project test suite. Parallel changes can cause integration failures that individual test runs miss.
Run harness validate. Verify project-wide health after integration.
If integration fails, identify which agent's changes caused the failure. Revert that agent's commits, fix the issue serially, and re-integrate.
Verify all observable truths from the plan are satisfied after integration.
If all tests pass and harness validates, the parallel execution is complete.
Write a summary of what was parallelized, what each agent produced, and any integration issues that were resolved.
harness validate — Each agent runs this before its final commit. Run again after integration.harness check-deps — Run after integration to verify no cross-boundary violations were introduced by the combined changes.check_task_independence (or manual fallback if tool unavailable)harness validate passes after integration| Rationalization | Why It Is Wrong |
|---|---|
| "These two tasks touch different functions in the same file, so they are independent enough" | If both tasks write to the same file, they are NOT independent. Even different functions in the same file creates merge conflicts. |
| "I verified independence manually -- no need to run check_task_independence" | Manual verification misses transitive dependency overlap. check_task_independence with graph-expanded analysis catches transitive conflicts. |
| "There are only 2 independent tasks, but parallelism would save time" | NOT when there are fewer than 3 independent tasks. Coordination overhead outweighs parallelism benefit for 2 tasks. |
| "Each agent's tests pass, so integration is fine" | Step 4 requires running the FULL test suite after integration. Parallel changes can cause integration failures that individual test runs miss. |
Context: Plan has Tasks 4, 5, and 6 which implement UserService, ProductService, and NotificationService. Each service is in its own directory, has its own types, and has no cross-service dependencies.
Step 1: Verify independence
Call check_task_independence:
{
"path": ".",
"tasks": [
{
"id": "task-4-user",
"files": [
"src/services/user/service.ts",
"src/services/user/service.test.ts",
"src/types/user.ts"
]
},
{
"id": "task-5-product",
"files": [
"src/services/product/service.ts",
"src/services/product/service.test.ts",
"src/types/product.ts"
]
},
{
"id": "task-6-notification",
"files": [
"src/services/notification/service.ts",
"src/services/notification/service.test.ts",
"src/types/notification.ts"
]
}
]
}
Result:
{
"analysisLevel": "graph-expanded",
"groups": [["task-4-user", "task-5-product", "task-6-notification"]],
"verdict": "3 of 3 tasks can run in parallel in 1 group"
}
All tasks are independent — safe to parallelize.
Step 2: Create agent briefs
Agent A — UserService:
Scope: src/services/user/, src/services/user.test.ts
Goal: UserService with CRUD operations, all tests passing
Constraints: Do not modify files outside src/services/user/. Run harness validate.
Context: User type definition in src/types/user.ts, DB helper in src/utils/db.ts
Agent B — ProductService:
Scope: src/services/product/, src/services/product.test.ts
Goal: ProductService with CRUD operations, all tests passing
Constraints: Do not modify files outside src/services/product/. Run harness validate.
Context: Product type definition in src/types/product.ts, DB helper in src/utils/db.ts
Agent C — NotificationService:
Scope: src/services/notification/, src/services/notification.test.ts
Goal: NotificationService with create and list, all tests passing
Constraints: Do not modify files outside src/services/notification/. Run harness validate.
Context: Notification type in src/types/notification.ts, email utility in src/utils/email.ts
Step 3-4: Dispatch, integrate
All 3 agents complete. No merge conflicts.
Run full test suite: 34 tests, all pass.
Run harness validate: passes.
Situation: Tasks 7 and 8 both modify src/api/routes/index.ts to add new route handlers.
Task 7: writes src/api/routes/users.ts, MODIFIES src/api/routes/index.ts
Task 8: writes src/api/routes/products.ts, MODIFIES src/api/routes/index.ts
File overlap: BOTH WRITE to src/api/routes/index.ts
Verdict: NOT INDEPENDENT — run serially