Parallel Agent Contracts

by parcadeid07ff4b06b62No license3.9K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 8 months ago

Parallel Agent Type Contracts

AI-generated overview

Provides prompt templates and a canonical type map so parallel coding agents avoid duplicating TypeScript types.

What it does
This skill supplies guidance for writing prompts when several agents implement code in parallel. It defines required prompt sections: a verification command using the TypeScript compiler, a grep-before-create check for existing types, and a canonical type map listing which file owns each shared type and how to import it. It also includes a reusable prompt template and a short explanation of why the approach works.
When to use it
Use it when coordinating multiple agents on the same TypeScript codebase and wanting to prevent conflicting or duplicated type definitions. It fits prompt authoring for parallel implementation work rather than a single-agent coding task.
Requirements
No scripts are shipped; it is instructions only. The described workflow assumes a TypeScript project, the npx tsc command, and grep available in the environment.

Parallel Agent Type Contracts

When launching parallel agents for code implementation, prevent type duplication.

Required in Every Agent Prompt

1. Verification Command (MANDATORY)

markdown
## Before Marking CompleteRun verification:\`\`\`bashnpx tsc --noEmit 2>&1 | head -20\`\`\`If ANY type errors exist, fix them before completing.

2. Grep-Before-Create

markdown
## Before Creating Any Type/InterfaceFirst check if it exists:\`\`\`bashgrep -r "interface YourTypeName\|type YourTypeName" src/\`\`\`If found, import it. NEVER duplicate existing types.

3. Canonical Type Map

Include relevant entries from this map in agent prompts:

TypeOwner FileImport From
NormalizedToolsrc/sdk/agent.ts'./agent'
ToolCallsrc/sdk/agent.ts'./agent'
ToolResultsrc/sdk/agent.ts'./agent'
ToolDefinitionsrc/sdk/agent.ts'./agent'
Messagesrc/sdk/types.ts'./types'
ContentBlocksrc/sdk/types.ts'./types'
TokenUsagesrc/sdk/types.ts'./types'
ProviderAdaptersrc/sdk/providers/index.ts'./providers'
RiggClientsrc/sdk/client.ts'./client'

Prompt Template

When spawning implementation agents:

markdown
# Task: [Description]
## Type Ownership (DO NOT recreate)- [List relevant types from canonical map]
## Before Creating New TypesRun: `grep -r "interface TypeName" src/` - if exists, import it.
## Before Marking CompleteRun: `npx tsc --noEmit 2>&1 | head -20`Fix all type errors before completing.
## Your Implementation[Actual task description]

Why This Works

  1. Type checker is the contract - tsc catches conflicts automatically
  2. Grep is fast - 1 second to check if type exists
  3. Explicit ownership - No ambiguity about where types live
  4. Fail fast - Agent can't claim "done" with broken types

Source and attribution

Source:parcadei/continuous-claude-v3in.claude/skills/parallel-agent-contractsat commitd07ff4b

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal