Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Lonsdale201/wp-agent-skills --skill wc-coupon-dynamicgit clone --depth 1 https://github.com/Lonsdale201/wp-agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/lonsdale201/wp-agent-skills/wc-coupon-dynamic)<a href="https://agentmods.dev/skills/lonsdale201/wp-agent-skills/wc-coupon-dynamic"><img src="https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/wc-coupon-dynamic/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/lonsdale201/wp-agent-skills/wc-coupon-dynamic"><img src="https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/wc-coupon-dynamic.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00135 | $0.02694 |
| Opus 5 | $0.00068 | $0.01347 |
| Sonnet 5 | $0.00027 | $0.00539 |
| Haiku 4.5 | $0.00014 | $0.00269 |
Grade A, and why
wc-coupon-dynamic scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.
WooCommerce virtual coupons
WooCommerce calls these virtual coupons. “Pseudo coupon” is an informal description, not the core term. Use one when a code is generated or resolved from another authoritative store and creating a shop_coupon post per code would cause unnecessary synchronization.
Choose the right model
| Need | Model |
|---|---|
| Merchant edits the code; core reporting, holds, and usage limits should work | Persisted WC_Coupon; use wc-coupon-types-rules |
| A namespaced code maps to an external entitlement | Virtual coupon from this skill |
| A new discount formula appears in the coupon type selector | Register a complete custom type with wc-coupon-types-rules; it may also be used by a virtual coupon |
| A surcharge or positive adjustment | WooCommerce fee API, not a negative coupon |
A virtual coupon is not automatically safer or faster. Its resolver and usage ledger replace storage and concurrency behavior that core normally supplies.
Understand the resolution contract
WC_Coupon::__construct() filters the unresolved value before database lookup:
$coupon = apply_filters( 'woocommerce_get_shop_coupon_data', false, $data, $this );
A truthy result is passed to read_manual_coupon(), which sets ID 0, marks the object virtual, and skips persisted lookup. Returning false means “not resolved by this filter” and lets later filters or the database handle the input.
The input may be an integer ID or a string code. Do not type it as string. The filter can run on frontend, Store API, REST-adjacent order operations, admin, CLI, cron, and repeated calculation paths.
Use an owned namespace and one request snapshot
final class MyPlugin_Virtual_Coupons {
private const PREFIX = 'loyalty-';
/** @var array<string,object|null> */
private static $entitlements = array();
public static function normalize( $input ): ?string {
if ( ! is_string( $input ) ) {
return null;
}
$code = wc_strtolower( wc_format_coupon_code( $input ) );
return 0 === strpos( $code, self::PREFIX ) ? $code : null;
}
public static function entitlement( string $code ) {
if ( ! array_key_exists( $code, self::$entitlements ) ) {
self::$entitlements[ $code ] = myplugin_find_entitlement( $code );
}
return self::$entitlements[ $code ];
}
public static function resolve( $resolved, $input ) {
if ( false !== $resolved ) {
return $resolved; // Preserve a resolver that ran earlier.
}
$code = self::normalize( $input );
if ( null === $code ) {
return false;
}
$entitlement = self::entitlement( $code );
// Keep every owned-prefix code virtual, including denied/unknown ones.
// Validation below rejects this inert marker without database fallback.
if ( ! $entitlement ) {
return array(
'discount_type' => 'fixed_cart',
'amount' => '0',
'description' => __( 'Unavailable virtual coupon', 'myplugin' ),
);
}
return array(
'discount_type' => 'percent',
'amount' => '10',
'individual_use' => true,
'usage_limit' => 1,
'usage_count' => (int) $entitlement->usage_count,
'date_expires' => $entitlement->expires_at,
'exclude_sale_items' => true,
'description' => __( 'Loyalty discount', 'myplugin' ),
);
}
}
add_filter(
'woocommerce_get_shop_coupon_data',
array( MyPlugin_Virtual_Coupons::class, 'resolve' ),
10,
2
);
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today Changed · -1 lines 2bf2f58c674e
- 8d ago First seen · 241 lines · 135 tokens per session scan A c0728b3a6b78
wc-coupon-dynamic is a skill published in the GitHub repository Lonsdale201/wp-agent-skills (22 stars, last pushed yesterday), licensed MIT. It adds 135 tokens to every session and 2,694 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
commerce-app-business-config
Manage custom business configuration in an Adobe Commerce app. Use when the user wants to add, modify, or remove merchant-configurable settings (config fields, admin config, store configuration) exposed through Commerce Admin. Creates typed config fields (text, password, email, url, tel, boolean, list) in…
doku-payment-gateway
Expert guide for integrating DOKU Payment Gateway (Jokul API v2). Covers HMAC-SHA256 header signature calculation, Checkout & Direct APIs (VA, QRIS, E-Wallet, Credit Card), webhook notification verification, and sandbox/production setup / Panduan ahli integrasi DOKU Payment Gateway.
webhook-integration
Complete guide for setting up and handling Dodo Payments webhooks for real-time payment event notifications.
better-auth-integration
Guide only for applications using @dodopayments/better-auth, covering authenticated customer sync, checkout, portal access, usage ingestion, and verified webhook callbacks.
newebpay-checkout
A checkout integration for NewebPay’s MPG payment service, which provides an online payment page. It includes encrypted payment data, an HTML form submission, and callback endpoints for payment results.
kryptogo-pay-webhook
A callback endpoint for KryptoGO Payment, which sends your application updates about a payment. It handles pending, successful, expired, insufficient, and refunded outcomes.