web-test-wallet-sign
Skill1 starsChanged 10 months agoMITView on GitHub
Handle MetaMask signature and transaction popups during Web3 DApp testing - approve signatures, send transactions, call contracts. Detects popup type and handles gas errors.
In this repository7 other files it gives its agents.
- web-test-case-genSkill
- web-test-cleanupSkill
- web-test-reportSkill
- web-test-researchSkill
- web-testSkill
- web-test-wallet-connectSkill
- web-test-wallet-setupSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
During web-test execution: when MetaMask popup appears
- Distinctive: line 51
Action: Check gas, then approve/reject
- Distinctive: line 130
When a transaction or contract call fails due to insufficient gas:
- Very specific: line 165
If success: true → continue test
- Very specific: line 166
If success: false with error: insufficient_gas → FAIL test
- Very specific: line 167
If success: false with other errors → retry or fail based on test config
- Distinctive: line 171
web-test-wallet-setup: - Must complete first
- Distinctive: line 172
web-test-wallet-connect: - Must connect before signing
- Distinctive: line 188
If gas error detected, popup is rejected and test is marked as failed
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Wallet Sign
Handle MetaMask signature requests and transaction popups during Web3 DApp testing.
When to Use This Skill
- During web-test execution when MetaMask popup appears
- When DApp requests signature (personal_sign, signTypedData)
- When DApp sends transaction (eth_sendTransaction)
- When DApp calls contract (write operations)
Prerequisites
- web-test-wallet-setup completed
- web-test-wallet-connect completed (wallet connected to DApp)
- Browser session active with wallet
Quick Start
SKILL_DIR="<path-to-this-skill>"
# Handle any MetaMask popup (auto-detects type)
node $SKILL_DIR/scripts/wallet-sign-helper.js wallet-sign --wallet --headed --keep-openPopup Types
1. Sign Message (personal_sign)
- Action: Auto-approve
- Risk: Low (read-only, no gas)
- Result: Always succeeds
2. Sign Typed Data (signTypedData_v4)
- Action: Auto-approve
- Risk: Low (read-only, no gas)
- Result: Always succeeds
3. Send Transaction (eth_sendTransaction)
- Action: Check gas, then approve/reject
- Risk: Medium (costs gas, transfers value)
- Result: Fails if insufficient gas
4. Contract Call (write operations)
- Action: Check gas, then approve/reject
- Risk: Medium (costs gas)
- Result: Fails if insufficient gas
Instructions
Detect and Handle Popup
SKILL_DIR="<path-to-this-skill>"
# Auto-detect popup type and handle appropriately
node $SKILL_DIR/scripts/wallet-sign-helper.js wallet-sign --wallet --headed --keep-openOutput for Signature:
{
"success": true,
"type": "signature",
"subtype": "personal_sign",
"action": "approved",
"message": "Signature request approved"
}Output for Transaction (success):
{
"success": true,
"type": "transaction",
"action": "approved",
"txHash": "0x...",
"message": "Transaction sent successfully"
}Output for Transaction (gas error):
{
"success": false,
"type": "transaction",
"action": "failed",
"error": "insufficient_gas",
"message": "Transaction failed: insufficient funds for gas"
}Force Reject
# Reject any popup (for testing negative flows)
node $SKILL_DIR/scripts/wallet-sign-helper.js wallet-reject --wallet --headed --keep-openCheck Popup Status
# Check if there's a pending popup without acting
node $SKILL_DIR/scripts/wallet-sign-helper.js wallet-check --wallet --headed --keep-openCommand Reference
| Command | Description |
wallet-sign | Auto-detect and handle popup (approve signatures, check gas for tx) |
wallet-reject | Reject any pending popup |
wallet-check | Check popup status without acting |
Error Handling
Gas Errors (Test Failure)
When a transaction or contract call fails due to insufficient gas:
{
"success": false,
"type": "transaction",
"error": "insufficient_gas",
"details": {
"required": "0.01 ETH",
"available": "0.001 ETH"
},
"action": "test_failed",
"message": "Insufficient funds for gas - test marked as FAILED"
}Important: Gas errors should fail the current test case in web-test.
Network Errors
{
"success": false,
"error": "network_error",
"message": "Failed to broadcast transaction"
}Integration with web-test
During test execution, when a MetaMask popup is detected:
- Pause test execution
- Call wallet-sign
- Check result:
- If
success: true→ continue test - If
success: falsewitherror: insufficient_gas→ FAIL test - If
success: falsewith other errors → retry or fail based on test config
- If
Related Skills
- web-test-wallet-setup - Must complete first
- web-test-wallet-connect - Must connect before signing
- web-test - Main test runner that uses this skill
- web-test-cleanup - Clean up after testing
MetaMask UI Detection
The skill detects popup type by analyzing the MetaMask notification page:
- Signature Request: Contains "Sign" button, "Message" text, no gas info
- Transaction: Contains "Confirm" button, gas fee display, value transfer
- Contract Call: Contains "Confirm" button, gas fee, function call data
Notes
- Signatures (personal_sign, signTypedData) never fail - always approve
- Transactions and contract calls check for gas errors before approval
- If gas error detected, popup is rejected and test is marked as failed
- Screenshots are taken at each step for debugging
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
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.

