Skip to content
Back to skills

Subscription

ASecurity

Allow a viewer to subscribe to this agent for recurring USDC payments. The agent charges 5 USDC per week automatically — no re-signing needed — until the viewer revokes or the delegation expires (90 days).

  • 7 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 7, 2026
ai-agentsrustapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned June 7, 2026

npx -y skills add nirholas/three-ui --skill subscription --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Subscription?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Subscription
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nirholas-subscription/badge)](https://www.skillsdirectory.com/skills/nirholas-subscription)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: subscription
version: 0.1.0
trust: owned-only
permissions_required: true
default_scope_preset:
    token: '<USDC>'
    maxAmount: '5000000'
    period: 'weekly'
    targets: ['<subscription executor contract>']
    expiry_days: 90
---

# Subscription

Allow a viewer to subscribe to this agent for recurring USDC payments. The agent charges 5 USDC per week automatically — no re-signing needed — until the viewer revokes or the delegation expires (90 days).

## Flow

1. Viewer clicks **Subscribe · 5 USDC / week**.
2. MetaMask opens pre-filled with the scope (5 USDC / week cap, 90-day expiry).
3. Viewer approves once. No further wallet prompts.
4. The server cron fires every hour; weekly charges are applied automatically via the ERC-7710 relayer.
5. Viewer can revoke at any time from the Manage panel — this pauses the subscription.

## onPeriod

`onPeriod` is **server-side only**. The cron at `/api/cron/run-subscriptions` imports it via dynamic `import()` and calls it once per subscription per period. It builds a single ERC-20 `transfer` call for `amountPerPeriod` and redeems it through the relayer endpoint.

**Never call `onPeriod` from the browser.**

## Error behaviour

- Revoked delegation → subscription status flips to `paused`, visible in the Manage panel.
- Expired delegation → same.
- Failed redemption → `paused` + `last_error` stored; no silent retry.

Files in this skill

  • SKILL.md1.4 KB
  • skill.js5.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.