acc-explain-business-process
1
总安装量
1
周安装量
#45210
全站排名
安装命令
npx skills add https://github.com/dykyi-roman/awesome-claude-code --skill acc-explain-business-process
Agent 安装分布
opencode
1
claude-code
1
Skill 文档
Business Process Explainer
Overview
Identifies and documents business processes implemented in code. Translates technical method chains, event flows, and service orchestrations into natural language descriptions with actors, steps, preconditions, and outcomes.
Process Detection
Use Case / Command Handler Analysis
# Find use cases and command handlers (primary business operations)
Grep: "class.*UseCase|class.*Handler" --glob "**/Application/**/*.php"
Grep: "function (execute|handle|__invoke)" --glob "**/Application/**/*.php"
# Read the handler to trace the full process
# Each handler method = one business process
Service Orchestration
# Application services that orchestrate domain operations
Grep: "class.*Service" --glob "**/Application/**/*.php"
Grep: "function (create|update|delete|process|execute|handle)" --glob "**/Application/**/*.php"
# Domain services with business logic
Grep: "class.*Service" --glob "**/Domain/**/*.php"
Event-Driven Processes
# Events that trigger subsequent processes
Grep: "class.*Event" --glob "**/Domain/**/*.php"
Grep: "dispatch|publish|raise|record" --glob "**/*.php"
# Event handlers (reaction to events)
Grep: "#\\[AsMessageHandler\\]|implements.*Handler" --glob "**/*.php"
Grep: "function.*handle.*Event" --glob "**/*.php"
Analysis Process
Step 1: Identify the Process
For each Use Case / Command Handler:
- Read the handler â understand the sequence of operations
- Identify the actor â who initiates this process (User, Admin, System, Scheduler)
- Identify preconditions â what must be true before the process starts
- Trace the steps â follow method calls through the layers
- Identify outcomes â what changes after the process completes
- Find side effects â events dispatched, notifications sent, logs written
Step 2: Trace Method Chains
Handler::handle(Command)
â Repository::find(id) // Load data
â Entity::performAction(args) // Domain logic
â Repository::save(entity) // Persist changes
â EventBus::dispatch(event) // Side effects
Translate to:
“When [actor] performs [action], the system [step 1], then [step 2], and finally [step 3].”
Step 3: Map to Business Language
| Technical Term | Business Term |
|---|---|
CreateOrderHandler |
“Place an order” |
Repository::find() |
“Look up the [entity]” |
Entity::validate() |
“Verify that [conditions]” |
Repository::save() |
“Record the [entity]” |
EventBus::dispatch() |
“Notify relevant parties” |
throw InvalidArgumentException |
“Reject if [condition]” |
Transaction::begin/commit |
“Ensure all-or-nothing” |
Process Documentation Template
For each identified process:
### Process: [Business Name]
**Trigger:** [What starts this process]
**Actor:** [Who initiates â Customer, Admin, System, Scheduler]
**Preconditions:**
- [What must be true before starting]
- [Required state/permissions]
**Steps:**
1. **[Actor]** [initiates action] (e.g., "submits order form")
2. **System** [validates/checks] (e.g., "validates order data")
3. **System** [performs domain logic] (e.g., "calculates total with discounts")
4. **System** [persists changes] (e.g., "saves the new order")
5. **System** [triggers side effects] (e.g., "sends confirmation email")
**Outcomes:**
- **Success:** [What happens on success]
- **Failure:** [What happens on failure â specific error scenarios]
**Side Effects:**
- [Events dispatched]
- [Notifications sent]
- [External systems called]
**Business Rules Applied:**
- [Rule references from acc-extract-business-rules]
Output Format
## Business Processes
### Overview
| # | Process | Actor | Trigger | Domain |
|---|---------|-------|---------|--------|
| 1 | Place Order | Customer | Submit order form | Order |
| 2 | Process Payment | System | Order confirmed | Payment |
| 3 | Ship Order | Warehouse | Payment received | Shipping |
| 4 | Cancel Order | Customer/Admin | User request | Order |
### Process 1: Place Order
**Trigger:** Customer submits order through API or web form
**Actor:** Customer (authenticated)
**Preconditions:**
- Customer is authenticated
- Shopping cart is not empty
- All items are in stock
**Steps:**
1. **Customer** submits order with items and delivery address
2. **System** validates order data (items exist, quantities available)
3. **System** checks customer's eligibility (account active, no blocks)
4. **System** calculates total price including taxes and shipping
5. **System** applies available discounts (loyalty, promotional)
6. **System** reserves inventory for ordered items
7. **System** creates the order record with "pending" status
8. **System** initiates payment process
**Outcomes:**
- **Success:** Order created with status "pending", confirmation sent
- **Failure (validation):** Error returned with specific field errors
- **Failure (stock):** "Items out of stock" with affected items listed
- **Failure (payment):** Order created but marked "payment_failed"
**Side Effects:**
- OrderCreated event â triggers confirmation email
- OrderCreated event â triggers inventory reservation
- OrderCreated event â triggers analytics tracking
**Business Rules:**
- INV-1: Order amount must be positive
- INV-2: Order must have at least one item
- POL-1: Free shipping for orders over $100
### Process Interaction Map
[Place Order] ââtriggersâââ [Process Payment] â success âââââââ failure â â v v [Ship Order] [Cancel Order] â v [Deliver Order]
Process Complexity Indicators
| Indicator | Simple | Medium | Complex |
|---|---|---|---|
| Steps | 1-3 | 4-7 | 8+ |
| Actors | 1 | 2 | 3+ |
| Branches | 0-1 | 2-3 | 4+ |
| Side effects | 0-1 | 2-3 | 4+ |
| Domain events | 0 | 1-2 | 3+ |
Integration
This skill is used by:
acc-business-logic-analystâ documents all business processesacc-extract-business-rulesâ references rules in processesacc-trace-request-lifecycleâ technical trace for each process