mcpField
P
parallel-agent-contracts

parallel-agent-contracts

github.com/parcadeiAgent workflows3.9k480 installsUpdated 39w ago
Repository

About parallel-agent-contracts

A skill for prompting parallel code-implementation agents to reuse canonical types and verify TypeScript before completion. It is intended for teams coordinating agents in a TypeScript codebase.

Key features

  1. 01TypeScript verification requirement
  2. 02Search before defining types
  3. 03Canonical type ownership map
  4. 04Reusable agent prompt template

Use cases

  1. 01Preventing duplicate types across parallel tasks
  2. 02Checking TypeScript before an agent reports completion

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/parcadei/continuous-claude-v3 --skill parallel-agent-contracts

After installing, type/parallel-agent-contractsin Claude Code to confirm it loaded.

Details

From the project README

Parallel Agent Type Contracts

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

Required in Every Agent Prompt

1. Verification Command (MANDATORY)
## Before Marking Complete
Run verification:
\`\`\`bash
npx tsc --noEmit 2>&1 | head -20
\`\`\`
If ANY type errors exist, fix them before completing.
2. Grep-Before-Create
## Before Creating Any Type/Interface
First check if it exists:
\`\`\`bash
grep -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:

# Task: [Description]

## Type Ownership (DO NOT recreate)
- [List relevant types from canonical map]

## Before Creating New Types
Run: `grep -r "interface TypeName" src/` - if exists, import it.

## Before Marking Complete
Run: `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

Comments

Markdown supported