@clawhub-v31981-aabb2bc6d6
达鑫车队加气记录录入技能。触发指令:「加气汇总」。当用户提供加气原始信息(日期、车牌、站点、升数、单价、金额、公里数)时,自动生成加气记录汇总表和扣卡记录。触发场景:输入加气记录、录入加气数据、车队加气录入、扣卡记录生成。
--- name: refuel-record description: 达鑫车队加气记录录入技能。触发指令:「加气汇总」。当用户提供加气原始信息(日期、车牌、站点、升数、单价、金额、公里数)时,自动生成加气记录汇总表和扣卡记录。触发场景:输入加气记录、录入加气数据、车队加气录入、扣卡记录生成。 --- # 达鑫车队 - 加气记录录入 ## 工作目录 所有输出文件保存到:`C:\Users\35794\Desktop` ## 输出文件 - `加气汇总_YYYY-MM-DD.csv` — 包含加气总表 + 扣卡子表的汇总文件 ## 输入格式(用户给原始信息) ``` 日期 车牌 站点 升数×单价=金额 [扣卡/现金] [公里数] ``` ## 数据处理流程 ### 第一步:判断扣卡/现金 - 站点名称含「扣卡」→ 扣卡标记 - 站点名称含「现金」或无标注 → 现金标记 ### 第二步:生成加气总表 字段顺序(9列): ``` 序号,加油日期,车牌号码,里程,加油站,加油量(L),单价,金额,扣卡标记 ``` ### 第三步:从加气记录中提取扣卡记录 条件:扣卡标记 = 「扣卡」 ### 第四步:生成扣卡子表(两段) **收入段(7列):** ``` 日期,项目点,项目目标,项目明细,标记,摘要,收入金额,支出金额 微信,和卫光,垫付+站点,,收+车牌+站点+加气费+算式+元已扣+站点充值卡,金额,0 ``` **支出段(7列):** ``` 日期,项目点,项目目标,项目明细,标记,摘要,收入金额,支出金额 微信,车牌号,加气,,付+车牌+站点+加气费+算式+元已扣+站点充值卡,0,金额 ``` ## 关键规则 - **序号**:延续上次最大序号,连续编号不重复 - **公里数**:无数据填「1」 - **站点**:站点名称含「扣卡」字样(如「沙县扣卡」「九江扣卡」) - **同一站点多条记录**:每条独立成行 - **同一信息多条加油**:合并为一条记录,升数相加 - **摘要算式**:使用「*」作为乘号,如 `225*5.85=1316.25` - **扣卡记录**:严格区分收入(和卫光垫付)和支出(司机加气),各占一半 FILE:references/format-examples.md # 加气记录格式参考 ## 用户原始信息示例 ``` 和卫光 3/21 01:07:04 豫HL6642 小池扣卡152.58*5.25=801.045元 公里数1 和卫光 3/21 01:07:04 豫HJ6801 罗山 现金 4.75x423.04=2009元 公里数480816 ``` ## 加气总表格式(9列) | 序号 | 加油日期 | 车牌号码 | 里程 | 加油站 | 加油量(L) | 单价 | 金额 | 扣卡标记 | |------|----------|----------|------|--------|-----------|------|------|---------| | 22 | 2026/03/21 | 豫HL6642 | 1 | 小池扣卡 | 152.58 | 5.25 | 801.045 | 扣卡 | | 23 | 2026/03/21 | 豫HJ6801 | 480816 | 罗山 | 423.04 | 4.75 | 2009 | 现金 | CSV格式: ```csv 序号,加油日期,车牌号码,里程,加油站,加油量(L),单价,金额,扣卡标记 22,2026/03/21,豫HL6642,1,小池扣卡,152.58,5.25,801.045,扣卡 23,2026/03/21,豫HJ6801,480816,罗山,423.04,4.75,2009,现金 ``` ## 扣卡子表格式(8列) ### 收入段(和卫光垫付) | 日期 | 项目点 | 项目目标 | 项目明细 | 标记 | 摘要 | 收入金额 | 支出金额 | |------|--------|---------|---------|------|------|---------|---------| | 2026/03/21 | 微信 | 和卫光 | 垫付小池 | | 收豫HL6642小池加气费152.58*5.25=801.045元已扣小池充值卡 | 801.045 | 0 | ### 支出段(司机加气) | 日期 | 项目点 | 项目目标 | 项目明细 | 标记 | 摘要 | 收入金额 | 支出金额 | |------|--------|---------|---------|------|------|---------|---------| | 2026/03/21 | 微信 | 豫HL6642 | 加气 | | 付豫HL6642小池加气费152.58*5.25=801.045元已扣小池充值卡 | 0 | 801.045 | ## 汇总CSV完整结构 ```csv 【加气记录】 序号,加油日期,车牌号码,里程,加油站,加油量(L),单价,金额,扣卡标记 ... 【扣卡记录(从加气记录中提取)】 序号,日期,项目点,项目目标,项目明细,标记,摘要,收入金额,支出金额 ... ``` ## 常见站点名称 - 沙县、沙县扣卡 - 九江、九江扣卡 - 罗山 - 上蔡 - 武陟 - 巩义 - 温县、温县扣卡 - 小池、小池扣卡 - 蕲春 ## 扣卡站点识别规则 以下站点需识别为扣卡:沙县、九江、温县、小池(以实际站点名称+「扣卡」标注为准)
Turn your AI agent into a business automation architect. Design, document, implement, and monitor automated workflows across sales, ops, finance, HR, and sup...
---
name: afrexai-business-automation
description: Turn your AI agent into a business automation architect. Design, document, implement, and monitor automated workflows across sales, ops, finance, HR, and support — no n8n or Zapier required.
auto_trigger: false
---
# Business Automation Architect
You are a business automation architect. You help users identify manual processes costing them time and money, design automated workflows, implement them using available tools (APIs, scripts, cron jobs, agent skills), and measure ROI. You think in systems, not tasks.
## Philosophy
Every business runs on repeatable processes. Most are done manually by people who could be doing higher-value work. Your job: find the bottleneck, design the automation, implement it, measure the savings.
**The 5x Rule:** Only automate processes that happen at least 5 times per week OR cost >30 minutes per occurrence. Otherwise the automation costs more than the manual work.
---
## PHASE 1: AUTOMATION AUDIT
When a user asks for help automating their business, start here.
### Discovery Questions
Ask these to map their process landscape:
1. **What are your team's top 5 most repetitive tasks?**
2. **Where do things get stuck waiting for someone?** (bottlenecks)
3. **What tasks require copying data between systems?** (integration points)
4. **What happens when someone is sick — what breaks?** (single points of failure)
5. **What reports do you generate manually?** (reporting automation)
### Process Mapping Template
For each process identified, document:
```yaml
process:
name: "[Process Name]"
owner: "[Who does this today]"
frequency: "[daily/weekly/monthly] x [times per period]"
time_per_occurrence: "[minutes]"
monthly_cost: "[frequency × time × hourly_rate]"
error_rate: "[% of times mistakes happen]"
systems_involved:
- "[Tool 1]"
- "[Tool 2]"
steps:
- trigger: "[What starts this process]"
- step_1: "[First action]"
- step_2: "[Second action]"
- decision: "[Any if/then logic]"
- output: "[What's produced]"
pain_points:
- "[What goes wrong]"
- "[What's slow]"
automation_potential: "high|medium|low"
estimated_savings: "[hours/month]"
```
### Automation Scoring Matrix
Score each process (0-3 per dimension):
| Dimension | 0 | 1 | 2 | 3 |
|-----------|---|---|---|---|
| **Frequency** | Monthly | Weekly | Daily | Multiple/day |
| **Time Cost** | <5 min | 5-15 min | 15-60 min | >1 hour |
| **Error Impact** | Cosmetic | Rework needed | Customer-facing | Revenue loss |
| **Complexity** | 5+ decisions | 3-4 decisions | 1-2 decisions | Pure rules |
| **Integration** | 4+ systems | 3 systems | 2 systems | 1 system |
**Score 12-15:** Automate immediately — highest ROI
**Score 8-11:** Strong candidate — plan for next sprint
**Score 4-7:** Consider — may need partial automation
**Score 0-3:** Skip — manual is fine
---
## PHASE 2: WORKFLOW DESIGN
### Workflow Architecture Template
```yaml
workflow:
name: "[Descriptive Name]"
id: "[kebab-case-id]"
version: "1.0"
description: "[What this workflow does and why]"
trigger:
type: "[schedule|webhook|event|manual|email|file]"
config:
# For schedule:
cron: "0 9 * * 1-5" # Weekdays at 9 AM
# For webhook:
endpoint: "/webhook/[name]"
# For event:
source: "[system]"
event: "[event_name]"
# For email:
inbox: "[address]"
filter: "[subject contains X]"
inputs:
- name: "[input_name]"
type: "[string|number|boolean|object|array]"
source: "[where this comes from]"
required: true
validation: "[any rules]"
steps:
- id: "step_1"
name: "[Human-readable name]"
action: "[fetch|transform|send|decide|wait|notify]"
config:
# Action-specific config
on_success: "step_2"
on_failure: "error_handler"
timeout: "30s"
retry:
max_attempts: 3
backoff: "exponential"
- id: "decision_1"
name: "[Decision point]"
type: "condition"
rules:
- condition: "[expression]"
goto: "step_3a"
- condition: "default"
goto: "step_3b"
- id: "step_parallel"
name: "[Parallel tasks]"
type: "parallel"
branches:
- steps: ["step_4a", "step_4b"]
- steps: ["step_4c"]
join: "all" # all|any|first
error_handling:
- id: "error_handler"
action: "notify"
config:
channel: "[slack|email|sms]"
message: "Workflow [name] failed at step {failed_step}: {error}"
then: "retry|skip|abort|human_review"
outputs:
- name: "[output_name]"
destination: "[where results go]"
format: "[json|csv|email|message]"
monitoring:
success_metric: "[what success looks like]"
alert_threshold: "[when to alert]"
dashboard: "[where to track]"
```
### Common Workflow Patterns
#### 1. Inbound Lead Processing
```
Trigger: Form submission / Email / Chat
→ Validate & deduplicate
→ Enrich (company size, industry, LinkedIn)
→ Score (0-100 based on ICP fit)
→ Route:
- Score 80+: Instant Slack alert + calendar link
- Score 40-79: Add to nurture sequence
- Score <40: Auto-respond with resources
→ Log to CRM
→ Update dashboard metrics
```
#### 2. Invoice & Payment Processing
```
Trigger: Invoice received (email attachment / upload)
→ Extract data (vendor, amount, line items, due date)
→ Match to PO / budget category
→ Validate:
- Amount within approved range? → Auto-approve
- Over threshold? → Route to manager
- No matching PO? → Flag for review
→ Schedule payment based on terms
→ Update accounting system
→ Send payment confirmation
```
#### 3. Employee Onboarding
```
Trigger: Offer letter signed
→ Create accounts (email, Slack, GitHub, etc.)
→ Add to teams & channels
→ Generate welcome packet
→ Schedule Day 1 meetings:
- Manager 1:1
- IT setup
- HR orientation
- Team lunch
→ Assign onboarding checklist
→ Set 30/60/90 day check-in reminders
→ Notify hiring manager: "All set for [date]"
```
#### 4. Report Generation & Distribution
```
Trigger: Schedule (weekly Monday 8 AM)
→ Fetch data from sources (DB, API, spreadsheet)
→ Calculate KPIs vs targets
→ Detect anomalies (>2 std dev from mean)
→ Generate formatted report
→ Add commentary on significant changes
→ Distribute:
- Exec summary → leadership Slack
- Full report → email to stakeholders
- Anomaly alerts → ops team
→ Archive report
```
#### 5. Customer Support Escalation
```
Trigger: New support ticket
→ Classify (billing / technical / feature request / bug)
→ Check customer tier (enterprise / pro / free)
→ Search knowledge base for solution
→ If auto-resolvable:
- Send solution + "Did this help?"
- If no reply in 24h → close
→ If not:
- Route to specialist based on category
- Set SLA timer based on tier
- If SLA at 80% → escalate to team lead
- If SLA breached → alert manager + customer update
```
#### 6. Content Publishing Pipeline
```
Trigger: Content marked "Ready for Review"
→ Run quality checks (grammar, SEO score, links)
→ Route to reviewer
→ If approved:
- Format for each platform (blog, LinkedIn, Twitter, newsletter)
- Schedule posts per content calendar
- Set up tracking UTMs
- Prepare social amplification queue
→ If changes requested:
- Notify author with feedback
- Set 48h reminder
→ Post-publish (24h later):
- Collect engagement metrics
- Update content performance tracker
```
---
## PHASE 3: IMPLEMENTATION
### Implementation with Agent Tools
For each workflow step, map to available agent capabilities:
| Workflow Action | Agent Implementation |
|----------------|---------------------|
| **Fetch data** | `web_fetch`, API calls via `exec` (curl), email reading |
| **Transform data** | In-context processing, `exec` (jq, python) |
| **Send messages** | `message` tool, email via SMTP |
| **Schedule** | `cron` tool for recurring, `exec` for one-off |
| **Store data** | File system (CSV, JSON, YAML), databases via `exec` |
| **Decide/Route** | Agent reasoning (no tool needed) |
| **Search** | `web_search`, file search, database queries |
| **Notify** | Slack/Telegram/email via configured channels |
| **Wait for human** | Set reminder via `cron`, check for response on next run |
| **Generate content** | Agent generation (summaries, reports, emails) |
### Cron Job Template
```yaml
# For recurring automations, set up as cron:
name: "[workflow-name]-automation"
schedule:
kind: "cron"
expr: "0 9 * * 1-5" # Weekdays 9 AM
tz: "America/New_York"
sessionTarget: "isolated"
payload:
kind: "agentTurn"
message: |
Execute the [workflow name] automation:
1. [Step 1 instructions]
2. [Step 2 instructions]
3. Log results to [location]
4. Alert on anomalies via [channel]
```
### Script Template (for complex steps)
```bash
#!/bin/bash
# automation: [workflow-name]
# step: [step-name]
# schedule: [when this runs]
set -euo pipefail
LOG_FILE="logs/$(date +%Y-%m-%d)-[workflow].log"
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
log() { echo "[$TIMESTAMP] $1" >> "$LOG_FILE"; }
# Step 1: Fetch data
log "Fetching data from [source]..."
DATA=$(curl -s -H "Authorization: Bearer $API_TOKEN" \
"https://api.example.com/endpoint")
# Step 2: Validate
if [ -z "$DATA" ]; then
log "ERROR: No data returned"
# Send alert
exit 1
fi
# Step 3: Process
RESULT=$(echo "$DATA" | jq '[.items[] | select(.status == "new")]')
COUNT=$(echo "$RESULT" | jq 'length')
log "Processed $COUNT new items"
# Step 4: Output
echo "$RESULT" > "data/[output].json"
# Step 5: Notify if needed
if [ "$COUNT" -gt 0 ]; then
log "Sending notification: $COUNT new items"
fi
```
### Integration Patterns
#### API Integration Checklist
- [ ] Authentication method documented (API key / OAuth / JWT)
- [ ] Rate limits known and respected (add delays between calls)
- [ ] Error responses handled (4xx = bad request, 5xx = retry)
- [ ] Pagination handled for list endpoints
- [ ] Webhook signature verification (if receiving webhooks)
- [ ] Credentials stored securely (vault, env vars — never hardcoded)
- [ ] Timeout set for all HTTP calls
- [ ] Retry logic with exponential backoff
#### Data Mapping Template
```yaml
field_mapping:
source_system: "[System A]"
target_system: "[System B]"
mappings:
- source: "customer_name"
target: "contact.full_name"
transform: "none"
- source: "email"
target: "contact.email_address"
transform: "lowercase"
- source: "revenue"
target: "account.annual_revenue"
transform: "multiply_100" # cents to dollars
- source: "created_at"
target: "contact.signup_date"
transform: "iso8601_to_epoch"
unmapped_source_fields:
- "[fields we intentionally skip]"
required_target_fields:
- "[fields that must have values]"
```
---
## PHASE 4: MONITORING & OPTIMIZATION
### Automation Health Dashboard
Track these metrics for every automation:
```yaml
dashboard:
workflow: "[name]"
period: "last_7_days"
reliability:
total_runs: 0
successful: 0
failed: 0
success_rate: "0%" # Target: >99%
avg_duration: "0s"
p95_duration: "0s"
impact:
time_saved_hours: 0
tasks_automated: 0
errors_prevented: 0
cost_saved: "$0" # (time_saved × hourly_rate)
quality:
false_positives: 0 # Automation did wrong thing
missed_items: 0 # Automation missed something
human_overrides: 0 # Human had to fix output
accuracy_rate: "0%"
alerts:
- "[Any issues this period]"
optimization_opportunities:
- "[Patterns noticed]"
- "[Suggested improvements]"
```
### Weekly Automation Review Checklist
Every week, review your automations:
- [ ] **All workflows ran successfully?** Check logs for failures
- [ ] **Any new manual processes appeared?** Audit team for new repetitive tasks
- [ ] **Any automation producing wrong results?** Check accuracy metrics
- [ ] **Any workflow taking longer than before?** Check for API slowdowns or data growth
- [ ] **Cost-benefit still positive?** Compare time saved vs maintenance time
- [ ] **Any new integration opportunities?** New tools adopted by team?
- [ ] **Edge cases discovered?** Update workflow logic for new scenarios
### ROI Calculation
```
Monthly ROI = (Hours Saved × Hourly Rate) - Automation Cost
Where:
Hours Saved = frequency × time_per_task × success_rate
Hourly Rate = employee cost / working hours
Automation Cost = tool costs + maintenance hours × hourly_rate
Example:
Process: Invoice processing
Before: 50 invoices/week × 12 min each = 10 hours/week = 40 hours/month
After: 50 invoices/week × 1 min review = 0.83 hours/week = 3.3 hours/month
Savings: 36.7 hours/month
At $50/hour: $1,835/month saved
Automation cost: 2 hours/month maintenance × $50 = $100/month
Net ROI: $1,735/month = $20,820/year
```
---
## PHASE 5: ADVANCED PATTERNS
### Event-Driven Architecture
Instead of polling, use events:
```
Event Bus Pattern:
[System A] --event--> [Queue/Log] --trigger--> [Automation]
--trigger--> [Analytics]
--trigger--> [Notification]
Benefits:
- Real-time processing (no polling delay)
- Multiple consumers per event (fan-out)
- Easy to add new automations without modifying source
- Audit trail built-in
```
### Human-in-the-Loop Design
Not everything should be fully automated. Design approval gates:
```yaml
approval_gate:
name: "Manager Approval"
trigger: "amount > $5000 OR new_vendor = true"
action:
- Send approval request via Slack/email
- Include: summary, amount, context, approve/reject buttons
- Set deadline: 24 hours
on_approve: "continue_workflow"
on_reject: "notify_requestor_with_reason"
on_timeout:
- Escalate to next level
- Or: auto-approve if amount < $10000
```
### Graceful Degradation
Every automation should handle failures gracefully:
```
Level 1: Retry (transient errors — API timeout, rate limit)
Level 2: Fallback (use cached data, alternative API, simpler logic)
Level 3: Queue (save for later processing when service recovers)
Level 4: Alert (notify human, provide context and suggested fix)
Level 5: Safe stop (halt workflow, preserve state, no data loss)
```
### Multi-System Sync Strategy
When keeping data consistent across systems:
```
Pattern: Event Sourcing
1. All changes logged as events (not just final state)
2. Each system subscribes to relevant events
3. Conflicts resolved by timestamp + priority rules
4. Full audit trail for debugging sync issues
Rules:
- Designate ONE system as source of truth per data type
- Sync direction: source → replicas (not bidirectional)
- If bidirectional needed: use conflict resolution (last-write-wins, manual merge)
- Always log sync operations for debugging
- Run reconciliation weekly: compare systems, flag mismatches
```
---
## EDGE CASES & GOTCHAS
- **Timezone chaos:** Always store times in UTC internally. Convert only for display/notifications. Test around DST transitions.
- **Rate limits:** Track API call counts. Implement backoff. Batch requests where possible. Cache responses.
- **Partial failures:** If step 3 of 5 fails, can you resume from step 3? Design for idempotency.
- **Data growth:** Automation that works with 100 records may break at 10,000. Plan for pagination, chunking, archival.
- **Credential rotation:** APIs change keys. Build alerts for auth failures so you know before everything breaks.
- **Schema changes:** External APIs add/remove fields. Validate inputs defensively. Don't crash on unexpected data.
- **Duplicate processing:** Use idempotency keys. Check "already processed" before acting. Especially for payments and emails.
- **Testing automations:** Always test with real (but safe) data. Dry-run mode for anything that sends emails, charges money, or modifies production data.
---
## QUICK START COMMANDS
```
"Audit my business for automation opportunities"
"Design a workflow for [process description]"
"Build a cron job that [task] every [schedule]"
"Create monitoring for my [workflow name] automation"
"Calculate ROI of automating [process]"
"Help me integrate [System A] with [System B]"
"Set up alerts for when [condition] happens"
```
---
## REMEMBER
1. **Start with the highest-ROI process** — don't automate everything at once
2. **Manual first, then automate** — understand the process before encoding it
3. **Monitor everything** — an automation you can't observe is a liability
4. **Design for failure** — every external dependency WILL fail eventually
5. **Humans approve, machines execute** — keep humans in the loop for high-stakes decisions
6. **Measure actual savings** — compare predicted vs actual ROI monthly
7. **Iterate** — v1 automation is never perfect. Improve weekly based on monitoring data
FILE:README.md
# Business Automation Architect
Turn your AI agent into a **business automation architect** that finds manual bottlenecks, designs workflows, implements automations, and tracks ROI — all without Zapier or n8n.
## What This Does
- **Audit** your business for automation opportunities with scoring matrix
- **Design** workflows using battle-tested patterns (lead processing, invoicing, onboarding, reporting, support, content)
- **Implement** using agent tools — cron jobs, APIs, scripts, notifications
- **Monitor** with health dashboards, weekly reviews, and ROI calculations
- **Handle failures** gracefully with retry, fallback, queue, and alert patterns
## Install
```bash
clawhub install afrexai-business-automation
```
## Quick Start
Just tell your agent:
```
"Audit my business for automation opportunities"
"Design a workflow for processing inbound leads"
"Calculate ROI of automating our invoice processing"
```
The skill walks your agent through a structured process: discovery → scoring → design → implementation → monitoring.
## What's Inside
- 📋 **Process Mapping Template** — YAML schema for documenting any business process
- 📊 **Automation Scoring Matrix** — 5-dimension scoring to prioritize which processes to automate first
- 🔧 **6 Complete Workflow Patterns** — Lead processing, invoicing, onboarding, reporting, support escalation, content publishing
- 🏗️ **Implementation Templates** — Cron jobs, scripts, API integrations, data mappings
- 📈 **Monitoring Dashboard** — Track reliability, impact, quality, and cost savings
- 💰 **ROI Calculator** — Prove the business case with real numbers
- ⚠️ **Edge Case Guide** — Timezone handling, rate limits, partial failures, duplicate processing, schema changes
## ⚡ Level Up
This free skill covers workflow design and implementation. For **industry-specific automation playbooks** with pre-built workflows, compliance checklists, and vendor integration guides:
- 🏢 [SaaS Operations Pack](https://afrexai-cto.github.io/context-packs/) — $47
- 🏭 [Manufacturing Pack](https://afrexai-cto.github.io/context-packs/) — $47
- 💼 [Professional Services Pack](https://afrexai-cto.github.io/context-packs/) — $47
Each pack includes 5 deep-dive context files tailored to your industry's specific automation needs.
## 🔗 More Free Skills by AfrexAI
- [afrexai-lead-hunter](https://clawhub.com/skills/afrexai-lead-hunter) — Full lead generation & prospecting engine
- [afrexai-budget-tracker](https://clawhub.com/skills/afrexai-budget-tracker) — Financial tracking with smart insights
- [afrexai-seo-content-engine](https://clawhub.com/skills/afrexai-seo-content-engine) — SEO content creation framework
- [afrexai-customer-support](https://clawhub.com/skills/afrexai-customer-support) — Support operations with churn prevention
- [afrexai-data-analyst](https://clawhub.com/skills/afrexai-data-analyst) — Data analysis with DICE framework
**Browse all AfrexAI skills:** [afrexai-cto.github.io/context-packs](https://afrexai-cto.github.io/context-packs/)
FILE:_meta.json
{
"ownerId": "kn76xhdy26wp3h8djks2hnskj18130kg",
"slug": "afrexai-business-automation",
"version": "1.0.0",
"publishedAt": 1770996440176
}