
rea-marketing
"Use when the user wants to reverse engineer a brand's holiday marketing (Black Friday, Christmas, Singles' Day…): what ran on each channel, when, at what estimated budget, and whether it worked in sales."
- GitHub stars
- 8.7K
Add marketplace
/plugin marketplace add superdesigndev/tregRun it inside Claude Code once, then install the plugin below.
Install
/plugin install rea-marketing@tregRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceREA marketing
Brand(s) + a holiday in; a two-part teardown out.
- Part 1 · What the marketing team did. Per channel: what ran, in which week, at what estimated budget; what the content says and how the viral posts were made; every other strategy and move.
- Part 2 · Did it work. Real sales numbers plus estimated sales by channel, set against the spend, ending in one verdict: worked, mixed, didn't work, or too early to call.
The report closes with a few plays to copy. Runs on treg: use the treg tools if connected (mcp__treg__call, catalog_get, catalog_search); otherwise read https://treg.to/llms.txt, install, sign in, and come back.
Four principles
- Counts are pulled in full; only money is estimated. Ads, posts and moves are counted as found: page until the source is empty, never scale or extrapolate a count. If a source stops early, show "pulled N of M". Dollars (spend, sales) are never public, so they are estimates at market rates, each with a low / mid / high range and the rate shown.
- SEEN or INFERRED. SEEN = a call result or image shows it (link it). INFERRED = reasoned from what was seen (say from what). Nothing seen → "not seen", never guessed. That a move caused a result is always INFERRED.
- HOLIDAY and BRAND(S) come from the user. Nothing here assumes a holiday or a brand.
- Public evidence only. No accounts, forms, sign-ups, purchases or contacting anyone.
Working rules
- Before an endpoint's first call:
catalog_getit, quote the price, check the cap (default $3 per brand). DataForSEO endpoints take a JSON array body: [{…}]. - Free first:
treg.web.searchandtreg.web.extract(headerX-Treg-Route-Prefer: tinyfish). - A call fails or returns nothing →
catalog_searchthe same job, try one alternative → else "unavailable". An empty answer is a finding only if a second provider agrees. - Big responses: let them save to a file (or trim with the endpoint's
jq/fields), parse withpython3 -I. Never page raw JSON through the chat. - Python does all math; every number on the page comes from code output and a CSV. Date every count.
- Social media collab = any post by someone other than the brand that the brand is behind or profits from: paid partnership, gifted/PR, affiliate or TikTok Shop, code or storefront link, ambassador, creator post run as an ad. Use this name everywhere in the report.
0 · Setup: interview first
No data call runs until the user has answered (AskUserQuestion when available):
- Which holiday or season, and which country (US → location_code 2840, language_code en).
- Which brand or brands. One or several; the user names them. Never pick for the user. Only if asked for ideas, search "best campaigns " and let them choose.
- Optional: their own company and stage (for the plays); anything to focus on or leave out.
If the first message already names holiday and brands, restate them in one line and go.
Then set, in Python, from today's date (never hard-code a year):
- Day 0 and the windows, for this year and last year: baseline = days -70 to -42, ramp = -28 to -1, peak = day 0 to its end, after = +1 to +14. Chart window = weeks -12 to +2. Say "D-n" for today against day 0.
| holiday | day 0 | peak ends |
|---|---|---|
| Black Friday | day after the 4th Thursday of Nov | Cyber Monday |
| Christmas | Dec 1 | Dec 24 |
| Singles' Day | Nov 11 | Nov 11 (presales from ~Oct 20) |
| Valentine's | Feb 1 | Feb 14 |
| Mother's Day (US) | 2nd Sunday of May, -14 | that Sunday |
| Halloween | Oct 1 | Oct 31 |
| anything else | search its dates, propose day 0 and peak end, confirm with the user |
- HOLIDAY_TERMS: the 3-5 words people search for it ("black friday", "cyber monday", "bfcm"). Every search and filter uses these.
- Mode: live (holiday ahead or running: last year's season + this year so far) or retro (holiday over: that season + the one before). Season labels are "Last year (YYYY)" and "This year so far (YYYY)".
- One brand = the brand against itself (this year vs last year at the same D-day); no cross-brand lines, no earnings tab if private. Several = same steps per brand, then side by side. If a brand is added or dropped later, rebuild every section, not only the tables.
◆ After each step below: a 3-line finding, what the next step checks, cost so far.
Part 1 data · what ran, when
Every step saves dated rows (date, brand, channel, what, link, views) so steps 9-12 can count them.
1 · Brand map — ~$0.01
treg.web.extracton home, where-to-buy, rewards, holiday/gift page, FAQ (look for HOLIDAY_TERMS, "sale", "early access", "price match").- Official handles linked from the site. Retail map: own site, Amazon (official store or resellers), TikTok Shop, Walmart, key retailers.
- Product line-up: model names from the nav and best-sellers. Shopify store →
crawl4ai.shopify.store.products{"store","limit":250}; count tags that name a promo or an exclusion (sale, bfcm, early-access, exclude, gwp, bundle).
2 · Paid ads — ~$0.15
- Meta, every ad, both seasons. pageId from
scrapecreators.x.v1-facebook-adlibrary-search-companies{"query":BRAND}. Then pageanyapi.facebook.company_ads{pageId, country, status ALL, startDate, endDate, sortBy recent} with ajqquery that returns only id, start day and end day per ad plus nextCursor, until nextCursor is empty. Check the row count against the library total. Take ad copy and format from one fuller first page. Cursors expire between sessions: restart from page one. No ads for the country → try companyName, then say "none found in the library". - Google.
spyfu.google.domain.overview{"domain","pastNMonths":14} → monthly budget (estimate);spyfu.google.domain.ad_history{"domain","keywordFilter":HOLIDAY_TERMS} → holiday copy and keywords bought, including rivals' names;adyntel.google.ads.transparencyfor now. - TikTok.
adyntel.tiktok-ads.library.search.company{"company_domain","influencer_ads":true}. - Keep per ad: start, end, network, format, offer in the copy, landing page, and whether it runs from a creator's page (a partnership ad, also a collab).
3 · Social media collabs — ~$0.15
- Search wide.
scrapecreators.tiktok.search.videos, date_posted last-3-months, no trim (so results save to files), for: BRAND + each HOLIDAY_TERM, "tiktok shop", "deal", "code", "gifted", "partner", "haul", and one search per product name. 10+ searches a brand, page 2 (cursor 30) on the main ones. Alsotikhub.x.instagram-v2-fetch-user-tagged-posts,scrapecreators.x.v1-instagram-search-hashtag,treg.youtube.search.videos. - Clean. Keep the report's country (
region), drop the brand's own accounts, dedupe by video id, keep posts inside the window. - Label each post from the raw item: paid (
is_paid_partnership,branded_content_accounts, #ad, #partner) | gifted/PR | TikTok Shop affiliate (a shop anchor, or "Creator earns commission") | link/code | run as an ad. Tier by followers: under 10k, 10-100k, 100-500k, 500k-1M, 1M+. - Flag dupes: the cart product doesn't carry the brand or model name, or the caption says dupe / "$X vs $Y". Count them apart from real collabs.
- No platform lists every collab: the method note says how many searches ran and which platforms.
4 · Owned social — ~$0.05
- Pull each handle back to the start of the window, both seasons where dates allow (X:
anyapi.x.search.postswith from:HANDLE since: until:; IG and TikTok: page back by cursor). - Tag every post: holiday | offer (%, sale, code, gift) | launch | none. Record which product each post shows. Owned posts are read for the offer calendar and products, not ranked.
5 · Site, offers and email — ~$0.05
- What the home, holiday and sale pages say now: offer, popups, early access, rewards.
- Email/SMS/loyalty/affiliate tools:
predictleads.companies.technology_detections(score ≥ 0.9). Launches and news dated in the window:predictleads.companies.news_events.
6 · Retail and prices — ~$0.05 + $0.03 per snapshot
- Per retailer and marketplace: official store or resellers, the retailer's own event and the brand's discount in it, who discounts first.
- 5-10 hero products: own-site price vs list,
serper.google.serp.shopping{"q":PRODUCT} for every merchant (China:justoneapi.x.taobao-get-item-detail-v5,justoneapi.x.jd-get-item-price-v1). Discount depth = 1 - price / list. Note products never discounted. Past prices can't be rebuilt: in retro mode use dated ads and posts that quote prices, and say so.
7 · Search, AI answers and word of mouth — ~$0.17
- Demand line.
dataforseo.x.keywords-data-dataforseo-trends-explore-live[{"keywords":[…], "location_code","date_from":day -70,"date_to":day +14 or today}], one call per season, all brands in one call (max 5; more → extra calls sharing one anchor term). Pick a term that means the brand ("rhode skin", not "rhode"). Express each week as a multiple of the baseline (1× = normal). Seasons are on separate scales: compare shape and timing, not height. A spike no move explains is "unexplained, check", not credited. - 3-5 holiday buyer questions →
cloro.ai-search.chatgpt.shopping: is the brand named. - What buyers say: comments and searches like "is BRAND having a sale"; after the peak,
reviews about shipping and stock-outs (
crawl4ai.trustpilot.business.reviews).
Part 2 data · what it got
8 · Sales — ~$0.06 per brand
Real numbers (label each with its date and what it is):
- Amazon:
justoneapi.x.amazon-search-products-v1{"keyword","country"} → "bought in past month" (a floor per listing), price, review count, stock hints. - TikTok Shop:
anyapi.tiktok_shop.search{"query","country"} →soldCount(lifetime) by shop: official, authorised resellers, dupes. - eBay resale:
serpapi.x.ebay-search→quantity_sold. - Public parent: holiday-quarter sales ÷ full year (25% = an average quarter). Private: "not disclosed".
- Store traffic where there are stores:
litescrape.google.maps.popular_times.
Periods need two snapshots. Lifetime and rolling counts become "sold during the holiday" only as the difference between two dated pulls. In live mode, schedule daily snapshots (sold counts, reviews, stock, prices) from today to day 0 + 14 and tell the user.
Compute — no calls
9 · Volume per week
One unit = one ad live that week (counted in every week between its start and end), one collab
post, one owned holiday/offer/launch post, one site, retail or PR move. Save volume_weekly.csv
(brand, season, week, channel, units, views). Per brand: prep start (first unit, weeks before
day 0, which channel), peak week and the top channel's share.
10 · Estimated spend (always labelled "estimate", with its range)
| Spend | Mid (low - high) |
|---|---|
| Google search ads | SpyFu monthly budget, spread by day |
| Meta / TikTok ads | $150 per live ad per day ($50 - 400) |
| Paid collab post, by followers | <10k $150 (50-300) · 10-100k $750 (250-1,500) · 100-500k $3,000 (1,500-5,000) · 500k-1M $8,000 (5,000-12,000) · 1M+ $20,000 (10,000-50,000) |
| Gifted post | one product at retail |
| Affiliate / TikTok Shop post | views × 0.2% bought (0.06-0.36%) × price × 12% commission (5-20%) + one sample; capped at real sold units × price × commission where sold counts exist |
| Making an owned post | $1,000 ($150 - 3,000) |
| PR event or brand collab | $100,000 ($30,000 - 200,000) |
| Not estimated (say so) | retailer co-op fees, email/SMS sends, staff time |
Refresh the rates with WebSearch (current CPM, creator rate card, commission) and cite them. Output: spend per week by type, channels ranked by spend, the peak spend week.
11 · Estimated sales by channel (low / mid / high, period, trust)
| Channel | How | Trust |
|---|---|---|
| Amazon | units from "bought in past month" × price, per product line; a floor | medium |
| TikTok Shop, real listings | sold counts × price | high |
| TikTok Shop, dupes | units only, own row: "not the brand's revenue" | high |
| Own site | visits (organic clicks + Google budget ÷ category CPC) × category conversion rate × order value | low |
| Social media collabs | views × share who buy × price; a ceiling, checked against real sold units | low |
| Other retail | review growth between snapshots ÷ 1-2% review rate, or "not estimated" | low |
Find the category's conversion rate and CPC with WebSearch and cite them. Totals are for comparing channels with each other, not the truth; a public brand's total is checked against reported sales.
12 · Did it work: six tests, one verdict
| Test | Number | Compared with |
|---|---|---|
| Demand rose | peak-week search ÷ baseline | last year's multiple at the same D-day |
| Reach was cheap | views per estimated dollar, per channel | the brand's other channels |
| Sales rose | units or sales in the holiday window | a normal window (snapshot difference), or holiday-quarter share vs 25% |
| Spend paid back | estimated sales in window ÷ estimated spend in window, as a range (low sales ÷ high spend to high ÷ low) | 1× |
| Price held | discount depth on hero products; new models at full price | list price, last year |
| Demand was kept | real units ÷ (real + dupe units) | — |
Grade each pass / mixed / fail / can't tell yet, with its trust. Verdict:
- Worked: sales rose and at least three other tests pass.
- Didn't work: sales flat or down, or spend clearly not paid back.
- Mixed: anything between; say which tests split.
- Too early to call: before day 0 + 14, or no second snapshot. Give the reading "so far" from the tests that can already be read and the date the verdict will be final.
Never call success from marketing volume alone: a verdict needs a result number. Then two short lists, each item tied to a test: what worked, what didn't.
Also from the dated moves (timeline.csv): search in the 7 days before a move vs the 8 days from
it; moves under 3 days apart share one lift. Last year vs this year: the same move at the same
D-day, side by side.
The report: report.html, published as an artifact
Plain, casual US English whatever the chat language. About the brands, not the tooling: no data- platform names, no coverage table, no bill on the page (those go in the chat reply). Every title says what its section contains ("How early DJI started, where it pushed, and what it got"); no slogans or abstract phrasing.
Hero. " marketing teardown: <brand(s)>", D-n badge, per brand one sentence on what it did and a verdict pill, 4 KPI tiles.
Part 1 · What did
- Timeline: which channel ran when, and what it cost. One card, one brand at a time, season toggle. Four readouts: prep started · biggest push (volume) · biggest estimated spend · result. One chart on weeks -12 to +2: top, estimated spend per week stacked by type; bottom, one small square per live unit stacked by channel, with the search line (1× = normal) and the views line (dashed). Spend colours follow their channel's colour family; legend in two labelled rows (Squares, Spend bars). Ramp shaded, day 0 marked, future weeks hatched. Every axis is labelled: spend panel titled "Estimated spend per week (US$, bars)" with $0 / half / max ticks and the week's total above each bar; squares panel titled "Campaign units live per week (count, squares · left axis)" with count ticks on the left, gridlines and the week's total above each column; the search line names its right axis ("Search vs normal", 1× marked). Hover shows a tooltip only: no fading, highlighting, zooming or other animation. The tooltip appears at once and leads with a colour swatch and the channel or spend type in bold, then the week, the count or amount with its range and share of that week, then the single ad or post. Hovering a search point shows "N× normal" and what 1× means. Under it: "Where the money most likely went, in order", named moves as channel lanes on the same weeks (chips stay inside their lane), then a note listing every rate and anything not pulled.
- Each channel, week by week (keep section titles this short). Tabs: Paid ads | Social media collabs |
Owned social | Site & offers | Retail & prices | Search & PR. Every tab reads top to bottom
in the same order:
- Summary block, three boxes: Estimated budget (one big number, its range, how it was worked out; "Not estimated" with the reason where it can't be) · What did (2-3 counted bullets) · When (first seen, peak week, still running or not). The boxes are tinted in the channel's colour (paid orange, collabs purple, owned teal, others grey).
- Week by week chart: bars = this channel's units live per week (count on each bar, left axis), the estimated spend under each week in the channel's colour, and the search line (1× = usual) on the same weeks. Charts first, text short.
- Show, don't describe: Paid ads → 1-2 real ad examples (image from the ad library, page name, "Sponsored", first line of copy, dates live, platforms, link to the ad); Social media collabs → the top 8 posts as cards (cover, views, kind pill, the creator's profile photo as a small circle, handle, followers, date, link); Owned social → the top 4 posts with covers. Download images at pull time and embed them (CDN links expire within hours).
- The week-by-week table folded under "Show the week-by-week table": one row per week with what ran, the top post, est. spend and range, search, views. A number that isn't public says "not public"; a week not pulled says "not pulled" and is never shown as zero; a week whose data isn't out says "not out yet". Search is brand-wide, not caused by one channel.
- Then the dated moves. No stat tiles or cards that repeat or contradict the summary.
- Content strategy and how the viral posts were made. Tabs: What the content says (each model name counted in ads, collab posts, owned posts and the holiday page: products pushed on social vs sold at the holiday; hooks; whether the offer is in the copy; formats) | Viral teardown (top 5 real collab posts and top 2 dupes by views, covers opened and read: hook, format, length, call to action, views ÷ followers; the shared formula as counted points; which kind of collab makes the hits; dupes outlined in red).
- Other strategies and every move. Show, don't list: every point is a picture, a chart or
a marked-up example with a link, never a numbered paragraph.
- Offer and pricing: offer cards from the brand's own store, one per discounted product plus
the hero product: a real screenshot of the product page (Playwright, popups closed, cropped
to image + price), price now, struck-through list price, a "-N% · save $X" pill (or "list
price, no discount yet") and a link. Prices from the store's own data (Shopify:
/products/<handle>.jsgivespriceandcompare_at_priceper variant); say "N of M variants discounted". Then a price-by-seller bar chart for the hero product (own store, big retailers, marketplace sellers, refurbished; coloured, linked) and tiles for where the offer shows up (yes / partly / no per channel). - Patterns: one card per pattern, each with its own visual. Always include how the top collab clips are built: the 5 most-viewed real posts, each with cover, hook text, a bar as long as the clip split into hook → body → call to action, length, views, followers, kind, link. Others as fits: one real ad's copy marked up by part, with a link; posts-per-week mini bars; views by collab kind; real vs other-brand units. Never fill a bar with a guessed value.
- All moves: the full dated table with lift, kept plain and scannable.
- Offer and pricing: offer cards from the brand's own store, one per discounted product plus
the hero product: a real screenshot of the product page (Playwright, popups closed, cropped
to image + price), price now, struck-through list price, a "-N% · save $X" pill (or "list
price, no discount yet") and a link. Prices from the store's own data (Shopify:
Part 2 · Did it work
5. Sales: real numbers and estimates. Charts over text. Tabs: Real numbers first (a bar
per Amazon listing with thumbnail, price, list price and link; TikTok Shop units by product
for the brand; a share bar and top listings for the hero product's searches, coloured own
shop / retailer / pre-owned / other brands) | Estimated sales by channel (a range chart:
band low to high, mark at mid, coloured by trust; the table under it) | Indirect signals |
Earnings (public brands only). No text cards that repeat the charts.
TikTok Shop search returns a different set of listings on each call: run 4-5 searches (brand,
hero product full name, short name, the category phrase), include each listing's id in the
jq, combine and dedupe by id, save the rows, and say it is a combined sample, not a census.
Call real rival brands "other brands", not dupes. If a new pull contradicts an earlier
figure, replace it everywhere and tell the user what changed and why.
6. Verdict: did 's strategy work. The verdict in one line, the six-test
table (number, compared with, grade, trust), estimated spend next to estimated sales, then
"What worked" and "What didn't". In live mode: "so far", plus the date it becomes final.
Close. "N plays to copy" (3-6 cards drawn from what passed the tests, each with evidence, when to start, effort and the number to watch). A play gets a folded, copy-ready prompt only when its first step is pulling data with treg; that prompt starts "Using treg, …". Plays that are pure writing or planning get no prompt. "N things to skip" (from what failed), a short method note (SEEN vs INFERRED, sources, snapshot dates).
Look. Read the artifact design guide first. Model: https://treg.to/rea-growth. Inter Tight 600 headings, Inter text, JetBrains Mono labels; max width 1120px; light and dark via CSS variables; warm-grey cards (#F4F2EE), hairlines, one green accent (#1F7A4D), one colour per brand. Tabs are a centred segmented control with a one-line caption. SEEN = solid pill, INFERRED = dashed. Tables stack and the nav scrolls on mobile.
Checks before publishing. Render headless in light and dark at 1280px and at 390px; look at
the hero, the timeline per brand and every tab. Squares add up to volume_weekly.csv; counts
match the pulled rows (nothing scaled); every number traces to a CSV; every estimate shows its
range; no chip outside its lane, no broken image, no sideways scroll; one brand → no other
brand named. Fix, then publish. End the chat reply with the verdict and the bill.
From the superdesigndev/treg README
Treg (OpenRouter for Tools)
treg — the tool catalog for your agent
OpenRouter, but for agent tools instead of models. Point an agent at one base URL with one token and it can do the job: a curated catalog of thousands of endpoints across many providers — SEO and backlinks, social and trends, people and company enrichment, ads, scraping, image and video generation — priced per call, from a cent, with no provider signup. Plus your own team's keys, skills and CLIs, callable by every teammate's agent without the credential ever leaving the server.
Ask for the task, not the tool. You do not need to know which vendor sells backlink data, or to hold an account with them. Search for what you want to do, read the price, call it.
Built for the Superdesign team, live at treg.to — anyone can self-host.
Why it exists
The tools an agent needs for real work sit behind subscriptions nobody buys for a single run — Semrush $139/mo, Moz $99/mo, Crunchbase $99/mo, Apollo $59/seat — behind signup walls, or behind no public API at all (invite-only, partner-only, app-review-only). treg carries those accounts and bills fractions of a cent per call.
Two kinds of tool, one token
- The catalog — external endpoints treg can serve with its own key or through a verified public route that needs no provider key. Own-key calls use the team's prepaid balance; anonymous calls are free. No account with the provider is needed. New verified accounts receive $1.00 free once, when they create an eligible team.
- Your own tools — anything a teammate registered: a paid API account, an OAuth connection, a
vendor CLI, a
SKILL.md. Your own key always wins over treg's, and those calls are never metered.
The vocabulary for the second half:
- tool = something the registry calls for you with the org's credential. Two kinds:
- endpoint — an upstream
base_url+ credential bindings (each binding injects one secret into the request; a request can carry several, e.g. an OAuth bearer and adeveloper-tokenheader). - CLI — a vendor binary (
stripe,gh,vercel, ...) run with the credential injected.
- endpoint — an upstream
- skill / bundle = a recipe (
SKILL.md) + its secrets + its tool(s), registered together.
The one rule: the proxy relays, never models the upstream, and injects auth server-side — so it survives upstream API changes and callers never hold keys.
Part 1 · Using the registry
Visit treg.to (hosted on Render) — the dashboard, sign-in, and every URL below live there.
Quickstart
Same flow as the dashboard's Getting started guide:
# 1. install the CLI — also points it at the registry
curl -fsSL https://treg.to/install.sh | sh
# 2. sign in (GitHub default · --email for a one-time code · --token for agents/CI)
treg login
# 3. do something useful immediately — no key, nothing registered
treg catalog search "backlinks for a domain" # find a tool by what it DOES
treg call tikhub.tiktok.user.profile --query uniqueId=tiktok
treg balance # exactly what that cost
# (or `treg onboard` for the guided walkthrough)
Fish Audio provides S2.1 Pro speech, public-voice discovery, and private voice cloning.
Speech is binary stdout, so redirect it to a file. A discovered voice's _id or a team voice id is
the TTS reference_id; voices created on treg's Fish account are durable team resources:
treg call fishaudio.tts.s2-1-pro --method POST --header model=s2.1-pro \
--data '{"text":"Hello from treg","format":"mp3"}' > speech.mp3
treg call fishaudio.voices.discover --query self=false --query licensed=false --query language=en
treg resources list --provider fishaudio --kind voice
With your own Fish key, requests are an unmetered upstream relay and Fish owns the account boundary.
A client written for a provider's own API can switch by its base URL alone: https://treg.to/call/<provider> in place of the provider's base URL (https://api.dataforseo.com/v3 → https://treg.to/call/dataforseo) runs the catalog tool on that method and path exactly as /call/<id> would; a path the catalog does not list is a 404, never relayed.
Catalog tool inputs are described by treg catalog get <id>. Tools marked strict_query reject undeclared or repeated query parameters, unsupported values and request bodies. Send each declared parameter within its declared type, allowed values and range, each single-valued one once, and a row count such as limit as a whole number within its stated maximum: a tool that enforces this answers a 400 catalog_parameter_invalid naming the parameter, and nothing is charged. Undeclared fields are forwarded as sent.
Your token identifies you on every call (X-Treg-Token header) and is the same for all tools.
Discover what your team has shared: treg tool ls · check credential health: treg health.
Or install it as a Claude Code plugin
/plugin marketplace add superdesigndev/treg
/plugin install treg@treg
Installs the treg skill and treg's tools with no token and no configuration. Run /mcp, pick
treg and sign in; the tools appear after it. Other agents: npx skills add superdesigndev/treg -s treg
(or see Workflow skills for the rest).
See docs/CLAUDE-PLUGIN.md. MiniMax Code / MiniMax Agent users: the same
skill ships via the MiniMax Plugin Marketplace (docs/MINIMAX-PLUGIN.md).
Workflow skills
Ready-made recipes your agent runs end to end, every call through treg:
| Skill | What your agent can do |
|---|---|
treg | Find and call any tool in the catalog, plus your own tools |
web-access | When your agent's own web tools fall short, read the live web without local scrapers: free search and page reads first, then the right platform job for social, stores, reviews, maps and papers, with treg falling back to the next vendor when one fails |
lead-signals | Find in-market buyers from public signals (complaints, job changes, hiring, funding, tool adoption) and monitor a topic, competitor or account list for them (treg.to/leads-signals) |
recruit | Turn a LinkedIn job post into a ranked shortlist: criteria from the post, people search, filters with reasons, one line on why each fits, cited evidence (posts, GitHub, talks, tenure, job change) under a per-candidate spend cap, then a checked personal email and phone, with a run file of counts, evidence and the vendor trail per candidate |
doomscroll | Catch up on any topic over the last hours: the best posts, clips and reactions from X, TikTok, YouTube, Reddit, Hacker News and Product Hunt, grouped into stories with links, only what is new since the last scroll |
make-ugc | Make AI UGC videos: trending hooks, a presenter, talking-head clips, captions (treg.to/ugc) |
jev-memory | Give Claude Code a memory: a Claude Code mod where Jev judges each prompt after the turn and keeps your lasting preferences, installed ready-made or built from one prompt (the mod) |
install.sh installs only treg and names the others in one line; your agent offers them after
sign-in and the first call. Name the ones you want with
sh -s -- --skills lead-signals,recruit (or --skills all; the opt-in jev-memory and rea-growth are never in that set). In Claude Code each one is
also its own plugin in treg's marketplace: /plugin install recruit@treg, or pick them from /plugin. To add
them to an existing agent instead (skills.sh CLI):
npx skills add superdesigndev/treg # every public skill
npx skills add superdesigndev/treg --skill lead-signals # just one
treg skill bootstrap --skills all # the installer's set, with the treg CLI you already have
The workflow skills run on treg, so set it up first (the Quickstart above, or point your agent at treg.to/llms.txt).
Claude.ai connector
The Claude Connectors Directory surface is https://treg.to/mcp/v2/. It exposes only curated
catalog endpoints, without image, video or audio generation, and separates read calls from write
calls so Claude receives accurate safety signals. The existing /mcp/ surface remains available for catalog endpoints, team-owned tools,
and imported skills. See the MCP and OAuth architecture
for the boundary and implementation, and the
submission runbook for release gates.
Call a tool you don't have a key for
The catalog is grouped by what endpoints do: keyword and rank tracking, backlinks and authority, AI visibility, trending and discovery, publishing to socials, people and company enrichment, ads management and creative, measurement.
treg catalog # every platform, busiest first
treg catalog search "find a work email" # by the job, not the vendor
treg catalog search --new # tools added in the last 30 days, newest first
treg catalog get hunter.people.email.find # params, PRICE, example response
treg call hunter.people.email.find --query domain=reddit.com --query full_name="Alexis Ohanian"
How a catalogued call is served — the credential ladder, in order:
- your team registered its own tool for that provider → that tool, that key;
- your team stored a secret for the provider → injected through a virtual tool (never for a keyless public API, which has nothing to connect);
- neither, and the endpoint has a verified public route → no provider key, free;
- otherwise → treg's own key, billed to the team's prepaid balance.
The anonymous price assumes the caller does not send a provider credential header. The faithful
relay preserves caller headers, so a caller-supplied provider key can use that key's credits.
Your own credential always beats treg's, so connecting a key you already pay for makes those calls
free of the balance rather than duplicating them. An endpoint treg has no published price for is
refused, not served free — you are told to connect your own key instead. Where several providers
serve one capability, treg catalog search shows them side by side with prices; choosing is
yours — treg does not silently pick or fail over between providers for you. (When treg's own
account for a provider is out it may serve the same endpoint through a treg-owned relay account,
disclosed on the response; a team can opt out.) The exception you opt into: treg.<capability> routed endpoints, where treg picks the provider for you and names it. For common jobs (scraping a page, web search, Google results, finding an email) start with the routed endpoint, such as treg.web.extract or treg.web.search, rather than a provider you remember by name. On treg.people.email.find and treg.people.phone.find, X-Treg-Route-Verify: true also checks the found address or number in the same call, as its own charge, and says what the check found.
treg balance # credit left, calls in flight, recent spend
treg topup # add funds, or set up automatic top-ups
Out of balance is an HTTP 402 error: insufficient_balance carrying balance_micro, estimated_cost_micro and a topup_url,
so an agent can act on it without reading prose.
No account at all? When the operator switches agent payments on, an agent with a stablecoin
wallet can pay for catalog calls one at a time over HTTP, with MPP (Tempo) or x402 (Base): a
/call/<id> without a treg token answers 402 with the payment challenge, and a client such as pympp
or the mppx library pays it and sends the call again. What the call does not use stays as that
wallet's credit for its next calls; it is never paid back as money. The agent-facing rules are in
the skill's "Pay with a wallet" section, the design in
agent payments.
Enrich Arena lives at /enrich-arena, outside the dashboard. Compare enrichment answers with each vendor’s cost and speed,
vote for the best answer in one click, or watch a sequential waterfall. Capability-compatible
async providers participate too; Arena handles submit and polling internally. Browsing is
public; submitting requires login, and billable attempts use your team's credits. See the
Arena guide.
Web Arena compares Web Search, Web Fetch, and Sitemap providers at /web-arena.
Battle calls selected providers for the same input; Waterfall tries them in order. The
live leaderboard combines direct provider-call hit rates and response times with checked
Web Arena quality results over a rolling 30-day window. The pages open when the feature
is enabled. See the
Web Arena guide.
Share & use your own tools
The zero-thought path — point treg at a project and it figures out what's shareable:
treg scan # read-only preview: the keys, skills & CLIs upload would register
treg upload # register them (encrypted server-side); idempotent, --replace to update
treg upload scans the .env (matching keys against ~80 known providers), every skill
subdirectory, and installed catalog CLIs. Three kinds of things go into the registry — here's how
to share and use each:
1. Endpoints (HTTP APIs)
Share — one upstream URL callable with a stored key, or bulk from a .env:
treg secret add STRIPE_KEY --value sk_live_123
treg add stripe --base-url https://api.stripe.com --secret STRIPE_KEY
treg upload env --select openai,stripe,resend # or straight from the .env
Use — the agent-native way: build the real upstream request and prefix it with the proxy.
treg resolves the tool by host, injects the credential, and relays everything else faithfully
(your X-Treg-Token is stripped before the upstream sees it):
Real request: GET https://api.intercom.io/conversations?per_page=5
Through treg: GET https://treg.to/call/https://api.intercom.io/conversations?per_page=5
header: X-Treg-Token: <your token>
Or the CLI shorthand — and treg calls for the audit log:
treg call intercom conversations --query per_page=5
treg call stripe v1/balance
2. CLIs
Share — automatic: treg upload detects installed catalog CLIs (stripe, gh, vercel, …)
and registers them; a recipe-only catalog CLI skill (e.g. stripe-cli) auto-becomes runnable too.
Use — treg run executes the vendor CLI with the org's credential injected, so you never
hold the key or log in:
treg run stripe -- get /v1/balance
treg run gh -- pr list
--local (default) runs on your machine. Server-side CLI execution (--server) is disabled globally.
treg runs is the audit log.
3. Skills
Share — a skill is a whole capability (SKILL.md recipe + its secrets + its tool(s)),
registered together so the whole team runs the same skill, maintained in one place:
treg upload skills --dir ~/.claude/skills --all # register a folder of skills in one pass
Use — pull any shared skill into your agent; its API calls go through treg with your token, so the key stays on the server, never in the skill:
treg skill install seo-blog-writer # writes into ./.claude/skills/ (--all for the library)
Manual registration — when the heuristics can't figure a tool out
# multi-credential tool (e.g. google-ads: OAuth bearer + a developer-token header)
treg tool add google-ads --base-url https://googleads.googleapis.com \
--bind "secret=<oauth-id>,injector=oauth" \
--bind "secret=<dev-id>,name=developer-token,format={secret}"
# one skill, step by step
treg skill init --dir ./my-skill # drafts treg.json (guesses base_url, finds secrets)
treg skill add --dir ./my-skill # registers recipe + secrets + tool, atomically
# OAuth via the browser (mints the first token, treg holds it and auto-refreshes)
treg oauth connect gsc --client-secret client_secret.json \
--scopes https://www.googleapis.com/auth/webmasters.readonly
Full options for every command: USAGE.md.
The CLI and its installer send anonymous usage to PostHog when using treg.to (which command ran and
how it ended, never request content or credentials).
Disable with TREG_TELEMETRY=0 or DO_NOT_TRACK=1.
See analytics details.
Teams
An account can own up to 10 teams. Joining other teams as a member does not count toward this limit.
Everything is scoped to an org: a token = a (user, org) membership, and every secret, tool,
and skill belongs to the active org. Roles: owner / admin / member / viewer.
treg org create "Acme" # make a team, become owner
treg org invite teammate@acme.com # invite by email (pick role + tool access)
treg org join <code> # accept an invite (sign in as the invited email first)
treg org ls | use <slug> | members # switch orgs, see the roster
treg org access <member> --tools a,b # per-member tool access (admin+)
Team owners can enable enterprise SSO from the dashboard's Team → SSO tab. WorkOS connects the company's identity provider; owners can invite their IT admin to finish setup. Employees can enter their work email in any sign-in dialog or use the team's direct sign-in link. treg keeps its team roles and API keys. The Directory Sync plan removes a deactivated employee's team access. See enterprise SSO setup.
Going deeper
-
Feedback:
treg feedback submit friction "The pagination example is unclear."Share problems or suggestions without private information. See feedback instructions. -
Review:
treg review CALL_ID usefulRate an invited catalog call after using its result;not_sureis fine. Omit private data and continue the task. -
USAGE.md— the fulltregCLI reference. -
/llms.txt: the agent entry point, in the llms.txt format: what treg is, setup for each kind of agent, the search-read-call loop and the rules, with links to/skill.md, the operating guide, for everything else. -
The dashboard at treg.to — full CRUD, a guided tutorial (Help → Tutorial), and copyable setup instructions for your agents.
-
The API — everything the CLI does is plain HTTP; interactive OpenAPI docs live at
/docs. The proxy endpoint is/call/{...}; all endpoints take theX-Treg-Tokenheader.
Part 2 · Self-hosting & development
Run it locally
One command (needs tmux + uv; it syncs the venv itself):
scripts/dev-local.sh up # server on http://localhost:18790, dev-safe settings
That runs the server in tmux with hot-reload, its own sqlite DB (treg-dev.db), and email OTP dev
mode (sign-in codes shown on the page — no mail sender needed). Day-to-day:
scripts/dev-local.sh cli login # sandboxed CLI: never touches your real ~/.treg/config.json
scripts/dev-local.sh logs # server output · status / restart / down
scripts/dev-local.sh reset # wipe the dev DB + CLI sandbox for a fresh start
Or run the server directly, without tmux:
bash scripts/build-dashboard.sh # Node 22.12+ and npm; build the Dashboard
uv sync # create the venv from uv.lock (pulls the server deps for dev)
uv run python -m treg upgrade # prepare schema + run idempotent release tasks without serving
uv run python -m treg # serve on 0.0.0.0:18790 (add --reload for dev)
uv run python -m treg keygen # print a fresh Fernet key for TREG_SECRET_KEY
Installing to run a server (not from source): the base package is the CLI only. To run a registry, install the server extra —
pip install "tools-registry[server]"— which adds FastAPI, the database drivers, and encryption.pip install tools-registryalone gives just thetregcommand for talking to an existing registry.
The official hosted service is available at treg.to. Its production topology and live settings are
maintained in the private operator runbook.
Configuration
Environment variables (prefix TREG_, read from .env):
| Var | Default | Purpose |
|---|---|---|
TREG_DATABASE_URL | sqlite+aiosqlite:///./treg.db | DB URL (SQLite for dev, Postgres in prod) |
TREG_READ_DATABASE_URL | (empty) | Optional SQLite / PostgreSQL read datasource; empty reuses the primary. Requires callers to opt in; existing queries are unchanged. See read datasource setup. |
TREG_SECRET_KEY | (empty) | Fernet key for secrets-at-rest; empty → an ephemeral key is minted (secrets won't survive a restart). During a rotation, a comma-separated list: the first key encrypts, every key decrypts |
TREG_AWS_SECRET_ID | (empty) | ARN of an AWS Secrets Manager secret holding a JSON object of TREG_* settings, read once at startup and winning over the environment; AWS credentials come from the standard AWS_* variables |
TREG_KMS_KEY_ID | (empty) | KMS key or alias ARN for stored credentials: this process can open KMS-sealed values (AWS credentials from the standard AWS_* variables) |
TREG_KMS_ENCRYPT_NEW | false | also seal new credential writes with that key; set only once every process that reads credentials has TREG_KMS_KEY_ID |
TREG_PUBLIC_URL | https://treg.to | treg's public base, used to build the OAuth callback URI |
TREG_SESSION_SECRET | (empty) | signs the dashboard session cookie; falls back to TREG_SECRET_KEY. Set a real value in prod |
TREG_GITHUB_CLIENT_ID / _SECRET | (empty) | GitHub OAuth sign-in (callback <public_url>/auth/github/callback); empty hides the button |
TREG_GOOGLE_CLIENT_ID / _SECRET | (empty) | Google OAuth sign-in (redirect <public_url>/auth/google/callback); empty hides the button |
TREG_WORKOS_API_KEY / _CLIENT_ID / _WEBHOOK_SECRET | (empty) | WorkOS enterprise SSO; configure callback and signed directory webhook as described in enterprise SSO setup |
TREG_ENTERPRISE_SSO_BUNDLE_ONLY | true | Show only the SSO + Directory Sync plan by default; set to false to offer both monthly plans. |
TREG_ENTERPRISE_SSO_BUNDLE_PRICE_ID / TREG_ENTERPRISE_SSO_ONLY_PRICE_ID | (empty) | Reusable monthly Stripe Price IDs in the same account as TREG_STRIPE_SECRET_KEY; an unset or unusable Price hides its plan. Stripe's Price supplies the displayed amount and Checkout charge. |
TREG_ENTERPRISE_SSO_BUNDLE_MIN_PRICE_USD / TREG_ENTERPRISE_SSO_ONLY_MIN_PRICE_USD | 0 | Optional whole-dollar minimum for each monthly Stripe Price; lower prices are hidden and rejected at Checkout. |
TREG_AGENT_PAYMENTS_ENABLED | false | Keyless callers pay per catalog call with MPP or x402. Startup checks the rest of the TREG_AGENT_PAYMENTS_* set (secret, rails, recipients, settlement) and names every problem; see agent payments. |
TREG_INSTAGRAM_CLIENT_ID / _SECRET | (empty) | Instagram App ID and secret for direct Instagram Login (redirect <public_url>/oauth/callback) |
TREG_META_CLIENT_ID / _SECRET | (empty) | Meta app credentials for Facebook Pages, Meta Ads, and optional Instagram page-tools |
TREG_OAUTH_REVIEW_PENDING | instagram-login,page-messages | Comma-separated registry review keys whose capabilities must remain gated; hosted review state is maintained privately. |
TREG_RESEND_API_KEY / TREG_EMAIL_FROM | (empty) | transactional email via Resend (OTP codes + invites); From must be a Resend-verified sender |
TREG_BLOCKED_EMAIL_DOMAINS | (empty) | comma-separated email domains refused at every sign-up/sign-in door and at team creation (subdomains included, case-insensitive). Empty blocks nothing — no list ships in the code |
TREG_CLIENT_IP_HEADER | (empty) | a header only your edge can set, used as the client address for every per-IP limit (cf-connecting-ip behind Cloudflare) |
TREG_TRUSTED_PROXY_HOPS | 1 | without that header: the X-Forwarded-For entry this many hops from the RIGHT (the one your nearest proxy appended); 0 when clients connect directly. The first entry is client-written and never trusted |
TREG_RATE_LIMIT_EXEMPT_IPS | (empty) | comma-separated addresses or CIDR blocks exempt from every per-IP limit (an authorized security test, a monitoring probe); per-email, per-user and deployment-wide limits still apply. A malformed entry refuses to start |
TREG_REQUIRED_EXTENSIONS | (empty) | comma-separated policy extensions (treg.extensions entry points) that must be installed, else startup fails. treg.to runs a private abuse-policy extension this way; it can only restrict (policy extensions) |
TREG_TURNSTILE_SITE_KEY / _SECRET | (empty) | Cloudflare Turnstile on every email sign-in form and on a new address's first GitHub/Google sign-in; either empty = off. The site key is served in /captcha.js, the secret only reaches siteverify |
TREG_TURNSTILE_MODE | observe | observe logs each outcome and changes nothing; enforce refuses a code to a missing or invalid token, gives no signup credit when Cloudflare cannot answer, and gives a new GitHub/Google user signup credit only on a passed check |
TREG_TURNSTILE_SOCIAL | true | false skips the check on a new address's first GitHub/Google sign-in, which then gets signup credit as with no widget; the email door is unchanged |
TREG_TURNSTILE_HOSTNAMES | (empty) | comma-separated hosts a token must be solved on; empty = the TREG_PUBLIC_URL host (and its known aliases) |
TREG_ADMIN_TOKEN | (empty) | cross-tenant super-admin bearer; authorizes every /admin/* endpoint. Empty disables the env path (only is_superadmin users reach /admin). Keep it long + secret. |
TREG_EMAIL_DEV_MODE | false | when true, /auth/email/start returns the OTP in its response (no mail sender needed) — dev/local only, never in prod. |
TREG_KV_URL | (empty) | shared key-value store (Redis protocol) for counters every worker must agree on, today the per-team review-invitation budget. Empty = an in-process fallback, fine for one worker |
No .env is needed for local dev — every setting has a working default (ephemeral key, sqlite).
⚠️ Back these up before moving or redeploying: the Fernet key (
TREG_SECRET_KEY) and the database (Postgres in prod;treg.dbfor a local sqlite run). Lose the Fernet key and every stored secret it sealed becomes unrecoverable; the same holds for a KMS key that is deleted.
Architecture
Request flow for /call: resolve tool (by URL host + longest base_url prefix, or by name) →
decrypt its secret(s) → apply each binding's injector → stream to the upstream → fire-and-forget
audit record. The infra relay streams bytes without business logic. The call application buffers
responses needing settlement or ownership evidence up to 8 MiB; larger responses return a 502
without charging instead of a truncated success. Endpoints that inline media (Gemini images)
declare spooled_response: their metered answer is read to a temp file instead, settled from its
reported usage, and relayed whole. Authorized free final downloads needing no body
evidence stream in full, as do own-key and own-tool responses.
Module map (src/treg/):
| Module | Role |
|---|---|
proxy.py | relay() — the whole product in one function: a faithful streaming proxy |
injectors.py | the auth-shape seam: env, cli_auth, secret_file, oauth place a secret into a header/query |
oauth.py | token freshness (single-flight refresh) + the connect flow (consent URL, code exchange) |
health.py | credential health: refresh oauth, probe tools, webhook the owner of anything broken |
convert.py | scaffold a skill directory into a registerable bundle manifest |
api.py | the API — the only brain; CLI + skill are thin clients over it |
cli.py | the treg CLI |
models.py | SQLModel tables: Org, User, Membership, Invite, Secret, Tool, Bundle, PendingOAuth, CallRecord |
crypto.py config.py db.py audit.py | Fernet encryption + tokens · settings · async DB · deferred audit writer |
The 4 auth shapes (per binding injector): env (plain string / API key) · secret_file (a
JSON token file, pull a field) · oauth (a JSON OAuth token, auto-refreshed if refreshable) ·
cli_auth (material lifted from a CLI's keychain).
Faithful-relay contract: the proxy alters only three things, everything else is verbatim:
- hop-by-hop transport headers (re-derived per hop),
- treg's own control + edge-forwarding headers (
x-treg-token,x-treg-org,ngrok-skip-browser-warning,x-forwarded-*,via, …) and treg's session cookie — all stripped, never leak upstream, - the injected credential(s).
OAuth, three ways to get the first token: manual upload (drop in a token.json) ·
auto-refresh (if the token carries refresh_token + client creds, treg keeps it fresh, you never
re-upload) · hosted connect flow (treg oauth connect → browser consent → treg captures the
token itself).
Health checks: give a tool an optional probe ({method, path, expect_status}); a periodic run
(on demand or via cron) validates every credential, refreshes OAuth, and webhooks the owner of any
that break.
Deep design lives in docs/context/ (per-subsystem fragments).
Tests
uv run --with pytest-xdist pytest -n auto -q # daily local default (same shape as CI)
uv run --frozen python -m pytest -q # serial: debugging one test, or order
Coverage: proxy walking-skeleton, all injector shapes, per-user auth + CRUD + audit, skill composer,
URL-passthrough + faithful relay, OAuth refresh + connect flow, health checks, treg run/shell,
upload/scan, orgs + invites, the dashboard API, CLI.
Contributing & docs
treg/
├── src/treg/ # the package (api, cli, proxy, injectors, oauth, health, convert, models, …)
│ └── web/ # dashboard, landing, tutorial, llms.txt, skill.md, install.sh
├── tests/ # pytest suite (CI + local default: pytest-xdist -n auto)
├── docs/
│ └── context/ # design fragments (codemap system) + generated index
├── USAGE.md # full treg CLI reference
└── pyproject.toml
Per-subsystem design docs are fragments in docs/context/, each citing its src/treg/*
sources. Working in this repo with an AI agent? The /tools-registry-context skill loads the
right fragment for what you're touching and keeps the docs in sync — run
/tools-registry-context sync before pushing.
Roadmap: MCP support · finer permission tiers · at-rest key-management hardening · possible Loopni merge.
License
Apache 2.0 with additional terms (LICENSE): use it freely — including commercially,
inside your own organization (self-hosting your own registry is encouraged). The restriction: don't
redistribute the code to third parties as a competing hosted/managed registry service without written
permission (jason@superdesign.dev). Using the hosted treg.to API inside your own product —
with pass-through billing via X-Treg-Meta and usage/by-tag — is allowed without permission;
that's calling our API, not redistributing our software.
Pinned customer read scopes
For a restricted customer agent, treg org agent-new bot --pin customer=cust_A enforces attribution
and scopes call/run history, archived results and shared-provider async ownership to that pin.
Foreign or unattributed ids return 404; an unpinned operator keeps the org-wide view and shared
balance. BYOK account access and public media URLs retain their existing permissions. See the
multi-tenancy contract
for multiple pins, migration and replay behavior.
Details
- Marketplace
- superdesigndev/treg
- Source
- plugins/workflows/rea-marketing
- Category
- Productivity
More from superdesigndev/treg
All 10Similar to rea-marketing
More Productivity & Planning
code-reviewanthropics/claude-code156.1K starsAutomated code review for pull requests using multiple specialized agents with confidence-based scoring to filter false positives
cavemanJuliusBrussee/caveman121.1K starsTalk like caveman. Cut filler. Keep technical details explicit.
career-opscareer-ops-hq/career-ops83.4K starsOpen-source AI job search that runs locally in your AI coding CLI: scan job portals, evaluate listings into a structured A-H report with a 1-5 score, tailor you
ruflo-autopilotruvnet/ruflo82.2K starsAutonomous /loop-driven task completion with learning, prediction, and progress tracking
ppt-masterhugohe3/ppt-master78K starsGenerate natively editable PPTX from PDF / DOCX / URL / Markdown — real DrawingML shapes, text boxes, charts, and animations. Note: run `pip install -r requirem
moletw93/Mole75.4K starsDrive the Mole CLI (mo) safely: find what uses disk space, preview cleanup with --dry-run, uninstall apps, and read system health and cleanup history.