Parallel Agent Contracts

parcadei/continuous-claude-v3/.claude/skills/parallel-agent-contracts

作者 parcadeid07ff4b06b62无许可证3.9K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库8个月前更新

Parallel Agent Type Contracts

AI 生成的概览

提供提示词模板与规范类型表,让并行编码代理避免重复定义 TypeScript 类型。

功能
该技能为多个代理并行实现代码时的提示词编写提供指导。它规定提示词必须包含的部分:使用 TypeScript 编译器的验证命令、创建前用 grep 检查类型是否已存在,以及一份规范类型表,说明每个共享类型由哪个文件负责以及如何导入。它还给出可复用的提示词模板,并简要说明这种做法为何有效。
适用场景
当需要在同一个 TypeScript 代码库上协调多个代理、避免类型定义冲突或重复时使用。它适用于并行实现工作的提示词编写,而非单代理编码任务。
运行要求
不附带脚本,仅为说明性内容。所述流程假定存在 TypeScript 项目,并可在环境中使用 npx tsc 命令与 grep。

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

来源与署名

来源:parcadei/continuous-claude-v3位于.claude/skills/parallel-agent-contracts提交d07ff4b

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架