@trawlme/skills 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trawl-scrap-banner
|
|
3
|
+
description: Generate + upload a brand-aware banner (1200x630 PNG) for a Trawl scrap. Fetches the official brand logo from Wikimedia Commons, composes against a gradient or flat brand-color background, renders via Chrome headless, uploads via `trawl scraps banner`. Triggers on "make banner for my scrap", "generate scrap banner", "upload banner for {site}". Does NOT cover scrap script generation (see trawl-scrap-design) or CLI account management (see trawl-cli).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Trawl Scrap Banner
|
|
7
|
+
|
|
8
|
+
Generate + upload a brand-aware 1200x630 banner for a Trawl scrap. Prototype validated 2026-05-10 on eBay.
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
After a scrap ships to prod (post-cron-activation, pre-Done). Default step in the seed roadmap workflow — banners are part of "Done" by convention.
|
|
13
|
+
|
|
14
|
+
Skip for internal/non-discoverable scraps (no UI surface).
|
|
15
|
+
|
|
16
|
+
## Inputs
|
|
17
|
+
|
|
18
|
+
- `scrapId` — Trawl scrap ID (24-hex), required
|
|
19
|
+
- `siteName` — brand name in URL form (`ebay`, `yahoo-finance`, `github`…), required
|
|
20
|
+
- `tagline` — short text under the logo, e.g. `"Comp pricing · Item watchlist"`, optional
|
|
21
|
+
|
|
22
|
+
## Pipeline
|
|
23
|
+
|
|
24
|
+
### 1. Fetch logo
|
|
25
|
+
|
|
26
|
+
Search Wikimedia Commons for the official brand SVG. Sanitize `siteName` first — no `/` or special chars (alphanumeric + hyphens only).
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Canonical Commons API (not Wikipedia) — broadest logo coverage
|
|
30
|
+
SITE_TITLE="${siteName^}_logo.svg" # capitalize first letter: ebay → Ebay_logo.svg
|
|
31
|
+
curl -s "https://commons.wikimedia.org/w/api.php?action=query&titles=File:${SITE_TITLE}&prop=imageinfo&iiprop=url&format=json" \
|
|
32
|
+
-H "User-Agent: Mozilla/5.0" | jq -r '.query.pages | to_entries[0].value.imageinfo[0].url // empty' \
|
|
33
|
+
> /tmp/${siteName}-logo-url.txt
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If the URL is empty, try common naming variants manually:
|
|
37
|
+
- `EBay_logo.svg` (original casing), `Google_G_logo.svg`, `Reddit_logo.svg`
|
|
38
|
+
- PNG fallback via thumb endpoint: `https://upload.wikimedia.org/wikipedia/commons/thumb/.../1200px-....png`
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Download
|
|
42
|
+
curl -sL -H "User-Agent: Mozilla/5.0" "$(cat /tmp/${siteName}-logo-url.txt)" -o /tmp/${siteName}-logo.svg
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Always use `User-Agent: Mozilla/5.0`** — Wikimedia rejects empty UAs.
|
|
46
|
+
|
|
47
|
+
### 2. Pick background gradient
|
|
48
|
+
|
|
49
|
+
| Logo colors | Background |
|
|
50
|
+
|---|---|
|
|
51
|
+
| 3+ brand colors (eBay, Google) | `linear-gradient(135deg, pastel-c1, pastel-c2, …)` |
|
|
52
|
+
| 1–2 brand colors (Reddit, GitHub) | flat pastel or 2-stop gradient |
|
|
53
|
+
|
|
54
|
+
Pastel = target brand color at 10–15% saturation. Example: eBay red `#e53238` → pastel `#ffeaec`.
|
|
55
|
+
|
|
56
|
+
### 3. Compose HTML
|
|
57
|
+
|
|
58
|
+
Copy `references/banner-template.html` to `/tmp/${siteName}-banner.html`. Make three substitutions (all at once — no nested placeholders remain after this step):
|
|
59
|
+
- `{{LOGO_PATH}}` → `file:///tmp/${siteName}-logo.svg`
|
|
60
|
+
- `{{BG_GRADIENT}}` → the gradient string from step 2 (e.g. `linear-gradient(135deg, #ffeaec 0%, #e0efff 100%)`)
|
|
61
|
+
- `{{TAGLINE_BLOCK}}` → `<div class="tagline">Comp pricing · Item watchlist</div>` — substitute the literal tagline text directly, or use an empty string if no tagline
|
|
62
|
+
|
|
63
|
+
### 4. Render via Chrome headless
|
|
64
|
+
|
|
65
|
+
macOS:
|
|
66
|
+
```bash
|
|
67
|
+
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
|
|
68
|
+
--headless=new --disable-gpu --hide-scrollbars \
|
|
69
|
+
--window-size=1200,630 \
|
|
70
|
+
--screenshot=/tmp/${siteName}-banner.png \
|
|
71
|
+
file:///tmp/${siteName}-banner.html
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Linux / CI: replace with `google-chrome` or `chromium-browser` (same flags). On K8s workers, `chromium --headless=new ...` works if `chromium` is in PATH.
|
|
75
|
+
|
|
76
|
+
### 5. Upload
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
trawl scraps banner ${scrapId} -f /tmp/${siteName}-banner.png
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
CLI confirms upload. Banner is immediately visible on trawl.me.
|
|
83
|
+
|
|
84
|
+
## Conventions
|
|
85
|
+
|
|
86
|
+
- Logo width **360px** on 1200x630 canvas (~30%). Larger overwhelms; smaller loses recognition.
|
|
87
|
+
- **Fetch the real SVG** — never recreate the wordmark in HTML/CSS. Brand fonts aren't reliably reproducible.
|
|
88
|
+
- Tagline: uppercase, `letter-spacing: 2.4px`, `color: #5a5a5a`, 22px, one line, `·` separator.
|
|
89
|
+
- Saturated gradients (not pastel) only for monochrome logos (LinkedIn blue, GitHub black).
|
|
90
|
+
|
|
91
|
+
## Examples
|
|
92
|
+
|
|
93
|
+
| Site | Gradient | Tagline |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| eBay | `135deg, #ffeaec, #fff7e0, #e0efff, #e8f5d9` | `Comp pricing · Item watchlist` |
|
|
96
|
+
| Reddit | `135deg, #fff1ec, #fff8f5` | `Subreddit pulse · Post discussions` |
|
|
97
|
+
| GitHub | `135deg, #f5f5f5, #e8e8e8` | `Repo stats · Trending discovery` |
|
|
98
|
+
|
|
99
|
+
## What this skill does NOT cover
|
|
100
|
+
|
|
101
|
+
- Scrap script → `trawl-scrap-design`
|
|
102
|
+
- CLI account management → `trawl-cli`
|