agentleFS
grasscaograssgrasscaograss/AwesomeWeldoneSkills/parallel-feature/SKILL.md

parallel-feature

Skill2 starsChanged 5 months agoApache-2.0View on GitHub

并行 Agent 开发工作流:先生成接口契约,再按文件归属并行实现,最后集成验收。触发场景:(1) 用户要求开发跨多层的功能(领域+应用+前端+测试);(2) 用户说"并行开发""parallel feature""多 agent 同时做";(3) 新功能涉及 3 个以上文件切面时主动建议使用。

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

并行 Feature 开发

三阶段工作流:契约 → 并行施工 → 集成验收。

阶段 1:生成接口契约

收到用户功能描述后,先读取相关现有代码,生成接口契约文档,等用户确认后再进入阶段 2。

契约必须包含以下内容:

## Feature: <功能名称>

### 共享契约

#### 新增类型/接口
- 列出所有新增的 DTO、接口、枚举,包含完整字段签名

#### 已有类型(只读引用,禁止修改)
- 列出将被引用但不应改动的现有类型

#### 调用链
- 用箭头表达完整调用链路:UI → AppService → Domain → Storage

### 文件归属

| Agent | 职责 | 可编辑文件 | 禁止触碰 |
|-------|------|-----------|---------|
| A 领域层 | 实体/DTO/接口定义 | `src/...Domain/.../*.cs`, `src/...Contracts/.../*.cs` | 应用层、前端 |
| B 应用层 | AppService 实现 | `src/...Application/.../*.cs` | 领域层定义、前端 |
| C 前端 | Blazor 组件 | `src/...Blazor/**/*.razor`, `*.razor.cs` | 后端全部 |
| D 测试 | 单元测试 | `test/**/*Test*.cs` | 源码文件 |

### 验收标准
- `dotnet build` 0 error
- 指定的测试全部通过
- 明确的功能验收条件

文件归属自动推断规则

路径模式归属 Agent
src/**/Domain/**/*.csA 领域层
src/**/Contracts/**/*.csA 领域层
src/**/Application/**/*.csB 应用层
src/**/Blazor/**/*.razor*C 前端
src/**/HttpApi/**/*.csB 应用层
test/**/*Test*.csD 测试

如果功能较简单(只涉及 2 个切面),合并为 2 个 agent 即可,不必强行凑 4 个。

阶段 2:并行施工

用户确认契约后,为每个 Agent 生成独立 prompt,在同一条消息中用多个 Agent tool 调用并行启动。

每个 Agent prompt 必须包含:

  1. 完整的共享契约(类型签名、调用链)
  2. 该 Agent 的文件归属范围
  3. 明确的禁止触碰文件列表
  4. 具体的实现要求

Agent prompt 模板:

你是 <角色> Agent。功能:<功能描述>

## 共享契约
<完整契约内容>

## 你的职责
- 可编辑:<文件列表>
- 禁止触碰:<文件列表>

## 实现要求
<该切面的具体实现指引>

## 约束
- 不得修改共享契约中定义为"只读引用"的类型
- 不得编辑归属范围外的文件
- 方法签名必须严格匹配契约定义
- 完成后列出所有新增/修改的文件

阶段 3:集成验收

所有 Agent 返回后,执行:

  1. 冲突检查:读取每个 Agent 修改的文件,检查是否有交叉修改
  2. 签名一致性:验证接口方法签名在各层之间一致
  3. 构建验证:运行 dotnet build --no-restore
  4. 结果报告:汇总每个 Agent 的变更,报告构建结果

如果构建失败:

  • 分析错误,定位到具体 Agent 的输出
  • 启动修复 Agent 修复冲突/签名不一致问题
  • 最多重试 2 次,仍失败则报告给用户

阶段 4(可选):补测试

如果契约中有测试 Agent(D),它会并行运行。如果没有,集成验收通过后询问用户是否需要补写测试。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.