| name | swingvy |
| description | Interact with Swingvy HR platform using browser automation. Use when submitting expense claims, checking claim status, approving claims, or managing expense reports on Swingvy. Triggers include "報帳", "請款", "expense claim", "swingvy", "submit expense", "approve claim". |
| allowed-tools | Bash(agent-browser:*), Bash(npx agent-browser:*) |
Swingvy Expense Claims Automation
Automate expense claim submission and approval on Swingvy HR platform.
Quick Start
Always start with the auth flow below. Never skip auth detection.
agent-browser state load swingvy-auth.json
agent-browser open https://secure.swingvy.com/main.html#/home
agent-browser wait --load networkidle
Then immediately verify auth status (see Auth Flow below).
Auth Flow
Every session MUST start with auth detection. Do not assume saved state is valid.
agent-browser state load swingvy-auth.json
agent-browser open https://secure.swingvy.com/main.html#/home
agent-browser wait --load networkidle
agent-browser get url
If auth expired:
agent-browser close
agent-browser --headed open https://secure.swingvy.com
agent-browser wait --load networkidle
agent-browser screenshot /tmp/swingvy-login.png
agent-browser get url
agent-browser state save swingvy-auth.json
If auth valid: proceed directly to task.
URL Routes (SPA Hash Routing)
| Page | URL |
|---|
| Home | #/home |
| My Claims | #/claims/my_claims |
| Approve Claims | #/claims/approve |
Important: Direct hash navigation sometimes doesn't work. Use find text to click sidebar items instead.
Core Workflow
- Load auth state:
state load swingvy-auth.json
- Navigate: Open URL or click sidebar items
- Snapshot:
snapshot -i (note: SPA may return few refs, use find text as fallback)
- Interact: Click, fill, upload
- Screenshot: Capture evidence
Navigation
Swingvy uses a SPA with limited accessibility tree exposure. Prefer these methods:
agent-browser find text "請款" click
agent-browser find text "我的請款" click
agent-browser find text "核准" click
agent-browser open "https://secure.swingvy.com/main.html#/claims/my_claims"
agent-browser wait 2000
Sidebar Structure
人事中心 (top nav - active)
出勤 (Shiftee) (top nav - external link)
Left sidebar:
├── 首頁
├── 公告
├── 請款
│ ├── 我的請款
│ └── 核准
├── 行事曆
├── 績效管理 (expandable)
├── 薪資單
└── 邀請朋友
Common Tasks
View My Claims
agent-browser find text "我的請款" click
agent-browser wait 2000
agent-browser screenshot claims-list.png
Claims list shows: 名稱 (name), 期間 (period), 金額 (amount), 最後更新 (last updated), 狀態 (status).
Status values: 草稿 (draft), 待核准 (pending), 已核准 (approved), 已拒絕 (rejected).
Create New Expense Report
agent-browser find text "我的請款" click
agent-browser wait 2000
agent-browser snapshot -i
agent-browser click @e2
agent-browser wait 2000
agent-browser snapshot -i
agent-browser fill @e2 "202603"
agent-browser click @e5
agent-browser wait 1000
Add Expense Item
Each expense item has these fields:
- 日期 (Date)
- 請款類型 (Claim Type) - e.g., "Office Ops Expense"
- 店家 (Vendor)
- 描述 (Description)
- 金額 (Amount) - in USD
- 附件 (Attachment) - receipt image/PDF
agent-browser snapshot -i
agent-browser screenshot new-item.png
Submit Report
agent-browser snapshot -i
agent-browser click @e_submit
agent-browser wait 2000
agent-browser screenshot submitted.png
Approve Claims (Manager)
agent-browser find text "核准" click
agent-browser wait 2000
agent-browser screenshot pending-approvals.png
View Existing Claim Detail
agent-browser find text "我的請款" click
agent-browser wait 2000
agent-browser find text "202603" click
agent-browser wait 2000
agent-browser screenshot claim-detail.png
Claim Report Structure
Report Header:
├── 報告名稱 (Report Name) - required
├── 狀態 (Status badge): 草稿/待核准/已核准
├── 申請人 (Applicant): P (you)
├── 核准人 (Approvers): B → S (two-level approval chain)
├── 開始日期 (Start Date)
├── 結束日期 (End Date)
└── 總款項 (Total Amount): USD
Expense Items Table:
├── 日期 (Date)
├── 請款類型 (Claim Type)
├── 店家 (Vendor)
├── 描述 (Description)
├── 金額 (Amount)
├── 附件 (Attachment) - image/link count
└── 動作 (Actions) - download, delete
Footer:
├── 總額 (Total): USD
└── 報告紀錄 (Report History)
Approval Chain
Claims go through a two-level approval:
- First approver (B) - direct manager
- Second approver (S) - finance/admin
Tips
- SPA quirks: Swingvy's accessibility tree is sparse. When
snapshot -i returns few elements, use find text "label" to interact with sidebar and buttons.
- Auth state: Save state after login with
state save swingvy-auth.json. Reload before each session.
- Currency: Default is USD. Amount fields accept decimal values.
- Attachments: Receipt images can be uploaded. Look for file upload inputs after expanding an expense item.
- Report naming: Use YYYYMM format (e.g., "202603") for monthly expense reports.
Debugging
agent-browser get url
agent-browser screenshot --full page.png
agent-browser snapshot -i -C
agent-browser eval 'document.querySelector(".swv-nav-sub-menu__title").textContent'