Files
sms-activation-providers/SKILL.md
T

90 lines
3.8 KiB
Markdown

---
name: "sms-activation-providers"
description: "Use for sms-verification-number, 5SIM, and GrizzlySMS activation APIs: balance lookup, country/service discovery, number purchase, SMS polling, status transitions, and completion."
---
# SMS Activation Providers
Use this skill when the task is about temporary phone numbers and SMS verification through one of these providers:
- sms-verification-number
- 5SIM
- GrizzlySMS
## What this skill does
- Keeps the provider boundary explicit instead of pretending all APIs are the same.
- Normalizes the activation lifecycle: inspect balance, discover countries/services, buy a number, poll for SMS, finish or cancel.
- Keeps auth and wire format provider-specific.
## Scope
- In scope: activation APIs for buying numbers, checking status, reading SMS, finishing, canceling, banning, and checking balance.
- In scope: price and availability discovery when the provider exposes it.
- Out of scope by default: GrizzlySMS partner/server-to-server supply protocol, custom callback servers, or any workflow that turns the provider into a number source for Grizzly itself.
- Out of scope: inventing service codes, country codes, or operator codes. Resolve those from the provider tables or discovery endpoints first.
## Provider selection
If the user names a provider, use that provider directly.
If the user does not name a provider:
- Prefer the provider whose auth/config is already available.
- Use the provider-specific discovery endpoint to check balance, available services, and price before ordering.
- Do not mix request styles across providers.
## Common workflow
1. Read the provider auth from the configured source.
2. Check balance or profile first.
3. Discover country, operator, and service availability.
4. Order the number with an optional max-price guard when the API supports it.
5. Poll the order until SMS arrives or the order times out.
6. Extract the code from the returned SMS payload or status string.
7. Finish, cancel, or ban the order according to the provider's state model.
## Normalized status model
Map provider-specific states to these internal buckets:
- `waiting`: order created, waiting for SMS
- `code_received`: code available
- `completed`: activation finished
- `canceled`: order canceled
- `timeout`: order expired or timed out
- `banned`: order banned or invalidated
- `error`: bad key, rate limit, no balance, no numbers, invalid parameters, or transport failure
## Error handling
- Treat `BAD_KEY`, `BAD_ACTION`, `BAD_LANG`, `NO_ACTIVATION`, `REQUEST_LIMIT`, `NO_BALANCE`, `NO_NUMBERS`, and 5SIM authorization or request failures as hard signal, not silent success.
- If the provider supports a max price, use it to avoid surprise price spikes.
- On no numbers, change one dimension at a time: country, operator, or service.
- On wait-state polling, use a short bounded loop with backoff rather than a tight retry storm.
## References
Read the provider reference that matches the requested service before answering or drafting code:
- [Common workflow](references/common.md)
- [sms-verification-number](references/sms-verification-number.md)
- [5SIM](references/5sim.md)
- [GrizzlySMS](references/grizzlysms.md)
- [Local auth example](references/auth.example.md)
## Recommend (price-first shortlist)
The unified CLI now supports a `recommend` command for price-driven shortlist generation:
- For `smsvn`: uses `getServicesAndCostWithStatistics` for a specific `--country`.
- For `5sim`: uses `guest_products/{country}/{operator}`.
- Supports filters: `--service`, `--max-price`, `--min-qty`, `--top-n`.
Examples:
```bash
python3 scripts/sms_activation.py --provider smsvn recommend --country 12 --max-price 0.2 --top-n 10
python3 scripts/sms_activation.py --provider 5sim recommend --country usa --operator any --service amazon --top-n 5
```