Skip to main content
skill CX Codex

parallel-agent-contracts — Claude Code skill: setup and features

parallel-agent-contracts enforces type ownership rules across parallel agents in TypeScript projects, requiring grep checks and tsc verification before any subtask completes.

MIT ★ 3,951 updated 2026-01-26

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add parcadei/Continuous-Claude-v3 --skill parallel-agent-contracts -a claude-code
Open on GitHub

What parallel-agent-contracts does

When multiple agents write code in parallel, they frequently redefine identical interfaces in different files. This skill embeds strict type contracts directly into subagent prompt templates to prevent collisions in TypeScript repositories.

Every spawned subagent receives three constraints. First, it must execute grep -r across src/ to find existing types before declaring new ones. Second, it consults a canonical type map that assigns ownership for core types like Message, ToolCall, or TokenUsage to dedicated files in src/sdk/. Third, the agent runs npx tsc --noEmit 2>&1 | head -20 and must resolve every error before reporting completion.

The skill has user-invocable: false in its frontmatter. It operates in the background as an orchestration rule rather than an interactive slash command. Verification fails immediately if the target project lacks a working TypeScript setup.

What it helps with

  • Prevent duplicate interface definitions during parallel agent execution
  • Force subagents to verify code with npx tsc before finishing a task
  • Establish explicit file ownership for core SDK types

Example prompts for the agent

  • Launch parallel agents to implement new providers using parallel-agent-contracts rules
  • Generate a subagent prompt enforcing the canonical type map and tsc verification

How to install parallel-agent-contracts

1Skills CLI (Vercel)

npx skills add parcadei/Continuous-Claude-v3 --skill parallel-agent-contracts -a claude-code

2Manually: put the files in place

~/.claude/skills/parallel-agent-contracts/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/parallel-agent-contracts/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about parallel-agent-contracts

How to install parallel-agent-contracts in Claude Code?

Run npx skills add parcadei/Continuous-Claude-v3 --skill parallel-agent-contracts -a claude-code. Alternatively, copy the file to ~/.claude/skills/parallel-agent-contracts/SKILL.md.

What does parallel-agent-contracts do?

It injects type ownership rules, grep checks, and a mandatory npx tsc --noEmit verification step into prompts used when launching parallel coding agents.

Can this skill be triggered directly by the user?

No, the skill sets user-invocable: false, which means it functions as an internal prompt template during task delegation rather than a direct slash command.

Source text

SKILL.md · MIT
---
name: parallel-agent-contracts
description: Parallel Agent Type Contracts
user-invocable: false
---

# 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 Complete
Run verification:
\`\`\`bash
npx tsc --noEmit 2>&1 | head -20
\`\`\`
If ANY type errors exist, fix them before completing.
```

### 2. Grep-Before-Create
```markdown
## 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:

| Type | Owner File | Import From |
|------|-----------|-------------|
| `NormalizedTool` | `src/sdk/agent.ts` | `'./agent'` |
| `ToolCall` | `src/sdk/agent.ts` | `'./agent'` |
| `ToolResult` | `src/sdk/agent.ts` | `'./agent'` |
| `ToolDefinition` | `src/sdk/agent.ts` | `'./agent'` |
| `Message` | `src/sdk/types.ts` | `'./types'` |
| `ContentBlock` | `src/sdk/types.ts` | `'./types'` |
| `TokenUsage` | `src/sdk/types.ts` | `'./types'` |
| `ProviderAdapter` | `src/sdk/providers/index.ts` | `'./providers'` |
| `RiggClient` | `src/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 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

© parcadei · MIT · parcadei/Continuous-Claude-v3

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set161

The whole set →
research-codebase research-codebase — a subagent that automatically documents your codebase. It spawns specialized agents in parallel to locate files, analyze code logic, find usage patterns, and synthesize findings into a single technical report. CX Codex ★ 3,951repo stars search-tools search-tools is a Claude Code skill that routes code searches to LEANN, AST-grep, Morph, or Grep based on the task. CX Codex +1 ★ 3,951repo stars modular-arithmetic Handles modular arithmetic problems in graph number theory. Activates when you need the extended Euclidean algorithm, the Chinese remainder theorem, Euler's theorem, quadratic residues, or order of elements. CX Codex +1 ★ 3,951repo stars agentica-spawn agentica-spawn — a skill that spawns multi-agent patterns via Agentica: swarms for parallel research, hierarchies for role-based tasks, generator-critic loops for iterative refinement, and juries for consensus. CX Codex +1 ★ 3,951repo stars spark spark is a Claude Code subagent for small, focused code changes. It handles quick fixes and tweaks, then writes a summary to a project file. CX Codex ★ 3,951repo stars entropy A skill for Shannon entropy, conditional and differential entropy, KL divergence, and maximum entropy principle problems. CX Codex +1 ★ 3,951repo stars proactive-delegation The proactive-delegation rule directs Claude Code to proactively hand off tasks to specialized subagents. It preserves the main context by detecting research, bug fixes, and parallel work automatically. CX Codex +1 ★ 3,951repo stars search-hierarchy The search-hierarchy skill picks a search tool based on whether a question concerns code structure, meaning, or an exact identifier. It helps locate a relevant file before reading it. CX Codex +1 ★ 3,951repo stars

Project sponsors

Companies that keep this analytics open