relay-diagnostic
Operator relay diagnostics and sponsor nonce recovery. Use canonical payment-status polling for caller-facing payment state; use this for relay health and sponsor recovery.
What this skill does
# Relay Diagnostic Skill
Diagnoses and recovers stuck sponsored transactions by inspecting the sponsor relay's nonce state and optionally triggering automated recovery.
Use this for operator diagnostics only. Caller-facing x402 payment state should come from canonical payment-status polling by `paymentId`, not from relay health heuristics.
- **check-health** — Read-only, no wallet required. Returns relay version, sponsor nonce status, detected gaps, and stuck transactions.
- **recover** — Requires an unlocked wallet (to source the sponsor API key). Attempts RBF, gap-fill, or both.
## Usage
```
bun run relay-diagnostic/relay-diagnostic.ts <subcommand> [options]
```
## Subcommands
### check-health
Check the sponsor relay availability and nonce status. No wallet needed.
```
bun run relay-diagnostic/relay-diagnostic.ts check-health
```
Output:
```json
{
"healthy": true,
"network": "mainnet",
"version": "1.2.0",
"sponsorAddress": "SP1PMPPVCMVW96FSWFV30KJQ4MNBMZ8MRWR3JWQ7",
"nonceStatus": {
"lastExecuted": 4210,
"lastMempool": 4215,
"possibleNext": 4216,
"missingNonces": [],
"mempoolNonces": [4211, 4212, 4213, 4214, 4215],
"hasGaps": false,
"gapCount": 0,
"mempoolDesync": false,
"desyncGap": 5
},
"stuckTransactions": [],
"issues": [],
"formatted": "Relay Health Check (mainnet)\nStatus: HEALTHY\n..."
}
```
### recover
Attempt automated recovery of stuck transactions. Requires an unlocked wallet.
```
bun run relay-diagnostic/relay-diagnostic.ts recover [options]
```
Options:
- `--action <rbf|fill-gaps|both>` — Recovery mode (default: `both`)
- `--txids <txid,...>` — Comma-separated list of specific stuck txids for RBF (omit to bump all)
- `--nonces <n,...>` — Comma-separated list of specific missing nonces for gap-fill (omit to fill all)
Output:
```json
{
"action": "both",
"rbf": {
"supported": true,
"result": { "bumped": 2 }
},
"fillGaps": {
"supported": true,
"result": { "filled": 0 }
},
"summary": "Recovery request sent to relay. Run check-health to verify nonce state improved."
}
```
## Notes
- Always run `check-health` before `recover` — recovery without a prior health check may bump transactions unnecessarily.
- If the relay returns 404 or 501 for recovery endpoints, the tool reports `supported: false` with instructions to contact the AIBTC team.
- The sponsor address for mainnet is `SP1PMPPVCMVW96FSWFV30KJQ4MNBMZ8MRWR3JWQ7`.
- Wallet operations require an unlocked wallet (use `bun run wallet/wallet.ts unlock` first).
Related in Sales & CRM
process-mapper
IncludedUse when a BizOps lead, COO, or process-improvement owner needs to document an end-to-end business process (procurement, employee onboarding, incident handoff, customer-onboarding, claims adjudication) in BPMN-style notation, measure cycle times by stage, surface where work spends most of its time waiting vs. being worked, and quantify the gap between processing time and total elapsed time. Pairs Lean / Six Sigma / Theory-of-Constraints canon with deterministic stdlib-only Python tools to produce a process map, a ranked bottleneck list (with severity + root-cause hypothesis), and a cycle-time analysis (P50, P90, value-add ratio, Little's-Law throughput). Distinct from sales-pipeline, system-reliability (SLO), and strategic-OKR work — this is tactical process documentation for internal operations.
payment-integration
IncludedIntegrate payments with SePay (VietQR), Polar, Stripe, Paddle (MoR subscriptions), Creem.io (licensing). Checkout, webhooks, subscriptions, QR codes, multi-provider orders.
customer-success-manager
IncludedMonitors customer health, predicts churn risk, and identifies expansion opportunities using weighted scoring models for SaaS customer success
sales-engineer
IncludedAnalyzes RFP/RFI responses for coverage gaps, builds competitive feature comparison matrices, and plans proof-of-concept (POC) engagements for pre-sales engineering. Use when responding to RFPs, bids, or proposal requests; comparing product features against competitors; planning or scoring a customer POC or sales demo; preparing a technical proposal; or performing win/loss competitor analysis. Handles tasks described as 'RFP response', 'bid response', 'proposal response', 'competitor comparison', 'feature matrix', 'POC planning', 'sales demo prep', or 'pre-sales engineering'.
customer-success-manager
IncludedMonitors customer health, predicts churn risk, and identifies expansion opportunities using weighted scoring models for SaaS customer success
sales-engineer
IncludedAnalyzes RFP/RFI responses for coverage gaps, builds competitive feature comparison matrices, and plans proof-of-concept (POC) engagements for pre-sales engineering. Use when responding to RFPs, bids, or proposal requests; comparing product features against competitors; planning or scoring a customer POC or sales demo; preparing a technical proposal; or performing win/loss competitor analysis. Handles tasks described as 'RFP response', 'bid response', 'proposal response', 'competitor comparison', 'feature matrix', 'POC planning', 'sales demo prep', or 'pre-sales engineering'.