Skill站外收录 @skilllib/skill-2117939930272416433
bpmn-workflow
将业务需求自动转化为标准化的 BPMN 2.0 流程图,并与 Gherkin 行为描述建立双向追溯关系,同时聚合生成系统级端到端工作流视图,支撑需求分析、跨角色协同与流程合规验证。
商业与营销 AI 技能
Skills.MD
# BPMN Workflow Skill
Generate BPMN 2.0 process diagrams from feature specifications, link them to Gherkin scenarios, and compose a system-wide workflow diagram.
## When to Use
- After completing Ask mode (feature exploration) to visualize the flow
- When documenting system processes for stakeholders
- Before Plan mode to ensure all scenarios are captured
- When updating existing features with new scenarios
## Prerequisites
- Feature has been explored in Ask mode with wireframes
- User flows have been identified
- API endpoints (if any) have been specified
## Instructions
### Phase 1: Gather Feature Context
**Step 1.1: Check for existing .feature files**
```
Glob docs/bpmn/features/**/*.feature
```
If found, parse existing scenarios:
```
CallMcpTool:
server: "bpmn-mcp"
toolName: "read-feature"
arguments: { "featurePath": "docs/bpmn/features/{feature-id}/{feature-id}.feature" }
```
**Step 1.2: If no .feature file exists, generate scenarios from:**
- Ask mode wireframes (each screen = potential scenario)
- User flow descriptions
- API endpoints defined (CRUD operations = scenarios)
- Edge cases identified (error states, empty states)
### Phase 2: Generate Gherkin (if needed)
If generating new scenarios, structure them as:
```gherkin
Feature: [Feature Name]
As a [user type]
I want to [action]
So that [benefit]
Scenario: [Happy path name]
Given [precondition]
When [action]
Then [expected result]
Scenario: [Error case name]
Given [precondition]
When [invalid action]
Then [error handling]
```
**Scenario naming conventions:**
- Happy path: `Successful [action]`, `[Action] completes`
- Validation: `[Action] with invalid [field]`
- Error: `[Action] when [error condition]`
- Edge: `[Action] with [edge case]`
### Phase 3: Generate BPMN
Call the generate-bpmn MCP tool:
```
CallMcpTool:
server: "bpmn-mcp"
toolName: "generate-bpmn"
arguments: {
"featureId": "{feature-id}",
"featureName": "{Feature Name}",
"scenarios": [
{
"id": "{scenario-id}",
"name": "{Scenario Name}",
"steps": [
{ "keyword": "Given", "text": "{step text}" },
{ "keyword": "When", "text": "{step text}" },
{ "keyword": "Then", "text": "{step text}" }
]
}
],
"outputPath": "docs/bpmn/features/{feature-id}/{feature-id}.bpmn"
}
```
### Phase 4: Create Manifest Link
Link BPMN elements to Gherkin scenarios:
```
CallMcpTool:
server: "bpmn-mcp"
toolName: "link-gherkin"
arguments: {
"featureId": "{feature-id}",
"featureName": "{Feature Name}",
"bpmnFile": "docs/bpmn/features/{feature-id}/{feature-id}.bpmn",
"featureFile": "docs/bpmn/features/{feature-id}/{feature-id}.feature"
}
```
This creates `docs/bpmn/features/{feature-id}/manifest.json` with traceability links.
### Phase 5: Compose System Diagram
Update the master system diagram:
```
CallMcpTool:
server: "bpmn-mcp"
toolName: "compose-system"
arguments: {
"systemName": "Well Platform",
"featuresDir": "docs/bpmn/features",
"outputPath": "docs/bpmn/system.bpmn"
}
```
## Output Format
After completing all phases, present:
```markdown
## BPMN Workflow Generated
### Files Created/Updated
| File | Status | Description |
|------|--------|-------------|
| `docs/bpmn/features/{id}/{id}.feature` | Created/Updated | [N] scenarios |
| `docs/bpmn/features/{id}/{id}.bpmn` | Created | Process diagram |
| `docs/bpmn/features/{id}/manifest.json` | Created | [N] links |
| `docs/bpmn/system.bpmn` | Updated | Added {Feature Name} pool |
### Scenarios Mapped
| Scenario | BPMN Element | Steps |
|----------|--------------|-------|
| [Name] | Task_{id} | [N] |
### System Diagram
[ASCII representation of system pools]
┌─────────────────┐ ┌─────────────────┐
│ Auth │────▶│ Workspaces │
│ • Login │ │ • Create │
│ • Register │ │ • Switch │
└─────────────────┘ └─────────────────┘
```
## BPMN Element Mapping
| Gherkin Concept | BPMN Element |
|-----------------|--------------|
| Scenario | UserTask |
| Given steps | Documentation (preconditions) |
| When steps | Documentation (action) |
| Then steps | Documentation (expected) |
| Feature | Process |
| Background | Subprocess (shared) |
## Storage Structure
```
docs/bpmn/
├── README.md # Documentation
├── system.bpmn # Master system diagram
└── features/
└── {feature-id}/
├── {feature-id}.bpmn # Feature process diagram
├── {feature-id}.feature # Gherkin scenarios
└── manifest.json # BPMN ↔ Gherkin links
```
## Related Skills
- **problem-framing** - Defines the problem before BPMN generation
- **competitor-scan** - Research how competitors document workflows
- **design-context** - Ensures BPMN aligns with existing patterns
## Troubleshooting
**No MCP server available:**
- Ensure bpmn-mcp is configured in `.cursor/mcp.json`
- Check that `@wellapp/bpmn` package is built
**Invalid BPMN generated:**
- Validate with `validate-bpmn` tool
- Check scenario IDs are unique
- Ensure step keywords are valid (Given/When/Then/And/But)
**Manifest links broken:**
- Re-run `link-gherkin` after updating scenarios
- Ensure scenario IDs match between .feature and manifest
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「bpmn-workflow」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次