@trawlme/skills 1.1.1 → 1.2.1
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trawlme/skills",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Claude Code skills for the Trawl CLI — teaches Claude how to manage scraps via @trawlme/cli",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"skills/**/*.md",
|
|
11
|
+
"skills/**/references/**",
|
|
11
12
|
"skills/**/run-local.mjs",
|
|
12
13
|
"bin/install.js",
|
|
13
14
|
"README.md",
|
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
The `${siteName^}_logo.svg` heuristic (capitalize first letter) fails for compound brands. Use the table below first:
|
|
37
|
+
|
|
38
|
+
| siteName | Wikimedia file |
|
|
39
|
+
|---|---|
|
|
40
|
+
| ebay | `EBay_logo.svg` |
|
|
41
|
+
| github | `GitHub_logo_2013.svg` (icon-only: `GitHub_Invertocat_Logo.svg`) |
|
|
42
|
+
| reddit | `Reddit_logo_new.svg` |
|
|
43
|
+
| youtube | `YouTube_Logo_2017.svg` |
|
|
44
|
+
| linkedin | `LinkedIn_logo_initials.png` (PNG — save as `-logo.png`, adjust `{{LOGO_PATH}}` in template) |
|
|
45
|
+
| twitter | `Logo_of_Twitter.svg` (X rebrand: `X_logo_2023.svg`) |
|
|
46
|
+
| yahoo-finance | `Yahoo!_Finance_logo_2021.svg` |
|
|
47
|
+
| amazon | `Amazon_logo.svg` |
|
|
48
|
+
| tripadvisor | `Tripadvisor_logoCMYK.svg` |
|
|
49
|
+
| google | `Google_2015_logo.svg` |
|
|
50
|
+
| tiktok | `TikTok_logo.svg` |
|
|
51
|
+
| booking | `Booking.com_logo.svg` |
|
|
52
|
+
|
|
53
|
+
If the brand is not in the table, try the `${siteName^}_logo.svg` heuristic, then PNG fallback via thumb endpoint: `https://upload.wikimedia.org/wikipedia/commons/thumb/.../1200px-....png`
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Download
|
|
57
|
+
curl -sL -H "User-Agent: Mozilla/5.0" "$(cat /tmp/${siteName}-logo-url.txt)" -o /tmp/${siteName}-logo.svg
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Always use `User-Agent: Mozilla/5.0`** — Wikimedia rejects empty UAs.
|
|
61
|
+
|
|
62
|
+
#### Fallback sources when Wikimedia misses
|
|
63
|
+
|
|
64
|
+
1. **simpleicons.org CDN** — `https://cdn.simpleicons.org/{slug}` — mono-color SVG with brand color baked in. Works for LinkedIn, GitHub, Twitter. Unsuitable for multi-color logos (eBay, Google).
|
|
65
|
+
2. **Brand press kit** — last resort: search `{brand}.com/press` or `{brand}.com/about/brand` for official SVG/PNG downloads.
|
|
66
|
+
|
|
67
|
+
### 2. Pick background gradient
|
|
68
|
+
|
|
69
|
+
| Logo colors | Background |
|
|
70
|
+
|---|---|
|
|
71
|
+
| 3+ brand colors (eBay, Google) | `linear-gradient(135deg, pastel-c1, pastel-c2, …)` |
|
|
72
|
+
| 1–2 brand colors (Reddit, GitHub) | flat pastel or 2-stop gradient |
|
|
73
|
+
|
|
74
|
+
Pastel = target brand color at 10–15% saturation. Example: eBay red `#e53238` → pastel `#ffeaec`.
|
|
75
|
+
|
|
76
|
+
### 3. Compose HTML
|
|
77
|
+
|
|
78
|
+
Copy `references/banner-template.html` to `/tmp/${siteName}-banner.html`. Make three substitutions (all at once — no nested placeholders remain after this step):
|
|
79
|
+
- `{{LOGO_PATH}}` → `file:///tmp/${siteName}-logo.svg`
|
|
80
|
+
- `{{BG_GRADIENT}}` → the gradient string from step 2 (e.g. `linear-gradient(135deg, #ffeaec 0%, #e0efff 100%)`)
|
|
81
|
+
- `{{TAGLINE_BLOCK}}` → `<div class="tagline">Comp pricing · Item watchlist</div>` — substitute the literal tagline text directly. When no tagline: replace with `""` (empty string — leave the placeholder line blank, the surrounding HTML renders cleanly)
|
|
82
|
+
|
|
83
|
+
### 4. Render via Chrome headless
|
|
84
|
+
|
|
85
|
+
macOS:
|
|
86
|
+
```bash
|
|
87
|
+
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
|
|
88
|
+
--headless=new --disable-gpu --hide-scrollbars \
|
|
89
|
+
--window-size=1200,630 \
|
|
90
|
+
--screenshot=/tmp/${siteName}-banner.png \
|
|
91
|
+
file:///tmp/${siteName}-banner.html
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Linux / CI: replace with `google-chrome` or `chromium-browser` (same flags). On K8s workers, `chromium --headless=new ...` works if `chromium` is in PATH.
|
|
95
|
+
|
|
96
|
+
### 5. Upload
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
trawl scraps banner ${scrapId} -f /tmp/${siteName}-banner.png
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
CLI confirms upload. Banner is immediately visible on trawl.me.
|
|
103
|
+
|
|
104
|
+
## Conventions
|
|
105
|
+
|
|
106
|
+
- Logo width **360px** on 1200x630 canvas (~30%). Larger overwhelms; smaller loses recognition.
|
|
107
|
+
- **Fetch the real SVG** — never recreate the wordmark in HTML/CSS. Brand fonts aren't reliably reproducible.
|
|
108
|
+
- Tagline: uppercase, `letter-spacing: 2.4px`, `color: #5a5a5a`, 22px, one line, `·` separator.
|
|
109
|
+
- Saturated gradients (not pastel) only for monochrome logos (LinkedIn blue, GitHub black).
|
|
110
|
+
|
|
111
|
+
## Examples
|
|
112
|
+
|
|
113
|
+
| Site | Gradient | Tagline |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| eBay | `135deg, #ffeaec, #fff7e0, #e0efff, #e8f5d9` | `Comp pricing · Item watchlist` |
|
|
116
|
+
| Reddit | `135deg, #fff1ec, #fff8f5` | `Subreddit pulse · Post discussions` |
|
|
117
|
+
| GitHub | `135deg, #f5f5f5, #e8e8e8` | `Repo stats · Trending discovery` |
|
|
118
|
+
|
|
119
|
+
## What this skill does NOT cover
|
|
120
|
+
|
|
121
|
+
- Scrap script → `trawl-scrap-design`
|
|
122
|
+
- CLI account management → `trawl-cli`
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<style>
|
|
6
|
+
html, body { margin: 0; padding: 0; }
|
|
7
|
+
body {
|
|
8
|
+
width: 1200px; height: 630px;
|
|
9
|
+
display: flex; flex-direction: column;
|
|
10
|
+
align-items: center; justify-content: center;
|
|
11
|
+
background: {{BG_GRADIENT}};
|
|
12
|
+
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
13
|
+
}
|
|
14
|
+
.logo {
|
|
15
|
+
width: 360px;
|
|
16
|
+
height: auto;
|
|
17
|
+
filter: drop-shadow(0 6px 18px rgba(0,0,0,0.10));
|
|
18
|
+
}
|
|
19
|
+
.tagline {
|
|
20
|
+
margin-top: 36px;
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
font-size: 22px;
|
|
23
|
+
color: #5a5a5a;
|
|
24
|
+
letter-spacing: 2.4px;
|
|
25
|
+
text-transform: uppercase;
|
|
26
|
+
}
|
|
27
|
+
</style>
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<img class="logo" src="{{LOGO_PATH}}" alt="">
|
|
31
|
+
{{TAGLINE_BLOCK}}
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|