Skip to content

Commit 9fefc24

Browse files
committed
add performance-scout
1 parent 5295d2b commit 9fefc24

File tree

12 files changed

+1596
-15
lines changed

12 files changed

+1596
-15
lines changed

apps/frontendsupport/next.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
https://www.chillys.com
2-
31
## contact
42

5-
| Contacted | Site | Perf |
6-
| --------: | ---------------------------------- | ---- |
7-
| [ ] | https://www.victoriabeckham.com | 50 |
8-
| [ ] | https://kyliejennercosmetics.co.uk | 52 |
9-
| [ ] | https://tropicskincare.com | 60 |
10-
| [ ] | https://www.lisaeldridge.com/ | 50 |
11-
| [ ] | https://www.kickgame.com/ | 57 |
12-
| [ ] | https://avon.uk.com/ | 66 |
3+
| Contacted | Site | Desktop Perf | Mobile Perf |
4+
| --------: | ---------------------------------- | ------------ | ----------- |
5+
| [ ] | https://www.lisaeldridge.com/ | 50 | 43 |
6+
| [ ] | https://tropicskincare.com | 61 | 29 |
7+
| [ ] | https://dunelondon.com | 64 | 40 |
8+
| [ ] | https://pelacase.ca/ | 64 | 48 |
9+
| [ ] | https://kyliejennercosmetics.co.uk | 66 | 38 |
1310

1411
## Best shopify sites
1512

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["shopify.co.uk"]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Claude working agreement
2+
3+
## Goal
4+
5+
Build the smallest correct solution that matches the spec.
6+
7+
## Defaults
8+
9+
- No code comments (no `//`, `/* */`, `#`).
10+
- Prefer small functions and descriptive names over comments.
11+
- Don’t change unrelated files.
12+
13+
## Output expectations
14+
15+
- Keep diffs minimal.
16+
- If you change behavior, update any docs/tests that describe it.
17+
18+
## Commands
19+
20+
- Install: `npm install`
21+
- Run: `npm run scan`
22+
- Test: `npm test` (if no tests exist, add a single smoke test and wire this command)
23+
24+
## error handling
25+
26+
- Never swallow errors: don’t use empty catch blocks; if you catch, return a structured error and always log to stderr with enough context (site, step, message) and rethrow
27+
28+
## When unsure
29+
30+
Stop and ask for clarification before coding.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Performance Scout
2+
3+
A TypeScript CLI tool that discovers UK Shopify sites and tests their performance using Lighthouse.
4+
5+
## Features
6+
7+
- Discovers candidate Shopify sites from a local file OR Serper API
8+
- Verifies sites are actually Shopify stores
9+
- Runs Lighthouse performance tests (desktop and mobile)
10+
- Filters sites below a configurable performance threshold
11+
- Outputs results as a markdown table
12+
13+
## Setup
14+
15+
### Prerequisites
16+
17+
- Node.js (v18 or higher recommended)
18+
- npm or yarn
19+
- Chrome/Chromium (required by Lighthouse)
20+
21+
### Installation
22+
23+
1. Install dependencies:
24+
25+
```bash
26+
npm install
27+
```
28+
29+
2. Set your Serper API key (required only if using `--use-serper`):
30+
31+
```bash
32+
export SERPER_API_KEY=your_api_key_here
33+
```
34+
35+
### Configuration
36+
37+
Edit `config.json` to adjust settings:
38+
39+
- `THRESHOLD`: Performance score threshold (0-100). Sites scoring below this on desktop OR mobile are included in results. Default: 50
40+
- `MAX_RESULTS`: Maximum number of results to collect. Default: 10
41+
42+
### Candidates File
43+
44+
Add domains (one per line) to `candidates.txt`:
45+
46+
```
47+
example.co.uk
48+
shop.example.com
49+
another-shop.co.uk
50+
```
51+
52+
## Usage
53+
54+
### Scan using candidates.txt (default)
55+
56+
```bash
57+
npm run scan
58+
```
59+
60+
### Scan using Serper API
61+
62+
```bash
63+
npm run scan:serper
64+
```
65+
66+
Or with the flag directly:
67+
68+
```bash
69+
npm run scan -- --use-serper
70+
```
71+
72+
The tool will:
73+
74+
1. Load candidates from either `candidates.txt` (default) or Serper API (if `--use-serper` flag is used)
75+
2. Verify each candidate is a Shopify site
76+
3. Run Lighthouse tests (desktop and mobile) on verified sites
77+
4. Keep only sites scoring below the threshold
78+
5. Stop after finding `MAX_RESULTS` qualifying sites
79+
6. Output a markdown table to `results.md` and console
80+
81+
## Output
82+
83+
Results are saved to `results.md` in the following format:
84+
85+
| Site | Desktop Perf | Mobile Perf |
86+
| ---------------- | ------------ | ----------- |
87+
| example.co.uk | 45 | 38 |
88+
| shop.example.com | 52 | 41 |
89+
90+
Performance scores range from 0-100, where higher is better.
91+
92+
## Notes
93+
94+
- Built with TypeScript and runs using tsx (no build step required)
95+
- Serper API results are cached in `.serper-cache.json` to avoid repeated API calls
96+
- Lighthouse tests can take 30-60 seconds per site
97+
- Sites that cannot be reached or verified as Shopify stores are skipped
98+
- If fewer than `MAX_RESULTS` qualifying sites are found, the tool outputs what it has

packages/performance-scout/SPEC.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Create a Node.js (ESM) CLI tool that:
2+
3+
- Discovers candidate UK Shopify sites:
4+
- Primary: read candidate domains from candidates.txt (one per line, domains only)
5+
- Optional: if SERPER_API_KEY exists, fetch more candidates via Serper “search” API for query: '"cdn.shopify.com" site:.uk' and add unique domains.
6+
- For each candidate, verify Shopify by fetching https://<domain>/ and checking for common Shopify signals (cdn.shopify.com, myshopify.com, /cdn/shop, “Powered by Shopify”).
7+
- Run Lighthouse CLI twice per accepted site:
8+
- Desktop: lighthouse https://<domain> --preset=desktop --only-categories=performance --output json --quiet --chrome-flags="--headless"
9+
- Mobile: lighthouse https://<domain> --only-categories=performance --output json --quiet --chrome-flags="--headless"
10+
- Parse the JSON from stdout, extract categories.performance.score, convert to 0–100.
11+
- Keep only sites where (desktop < THRESHOLD) OR (mobile < THRESHOLD), where THRESHOLD comes from config.json (default 50).
12+
- Stop once you have 10 rows (configurable MAX_RESULTS in config.json).
13+
- Output a markdown table:
14+
| Site | Desktop Perf | Mobile Perf |
15+
- Add package.json scripts: "scan": "node ./scan.mjs"
16+
- Include README with setup + how to run.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lisaeldridge.com
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
shopify.co.uk
2+
dakine.co.uk
3+
irockersup.co.uk
4+
cocoandblu.co.uk
5+
llcompany.co.uk
6+
mitchum.co.uk
7+
sweetify.uk
8+
vicegolf.co.uk
9+
toast.co.uk
10+
urbancan.co.uk
11+
shop.hants.gov.uk
12+
pinterest.co.uk
13+
lashify.uk
14+
besidemealways.co.uk
15+
abbotshill.herts.sch.uk
16+
coolframes.co.uk
17+
styleaddict.uk
18+
sugarrushsweeties.co.uk
19+
childsplayclothing.co.uk
20+
nicholataylorson.co.uk
21+
lisaeldridge.com
22+
tropicskincare.com
23+
dunelondon.com
24+
pelacase.ca
25+
kyliejennercosmetics.co.uk
26+
limely.co.uk
27+
izie.co.uk
28+
davinci-gourmet.co.uk
29+
thejammyvegan.co.uk
30+
leathermissalcovers.co.uk
31+
wwf.org.uk
32+
getcrooked.co.uk
33+
diabetes.org.uk
34+
committees.parliament.uk
35+
muckandmelt.co.uk
36+
sweetsforall.co.uk
37+
paperlanterncompany.co.uk
38+
play.diabetes.org.uk
39+
munchkin.co.uk
40+
foiltickets.co.uk
41+
eatsleeplive.co.uk
42+
firsttactical.co.uk
43+
foxproject.org.uk
44+
seamlesspos.co.uk
45+
stcatherineschool.co.uk
46+
shop.the-connaught.co.uk
47+
emmabridgewater.co.uk
48+
kraken-signs.co.uk
49+
craftcellar.co.uk
50+
exhibitioncourthotel4.co.uk
51+
vouchergate.co.uk
52+
strategycore.co.uk
53+
aya.co.uk
54+
richardtaunton.ac.uk
55+
cotswoldlavender.co.uk
56+
cumulus.hosiene.co.uk
57+
gitlab.cim.rhul.ac.uk
58+
bartshealth.nhs.uk
59+
hub.qmplus.qmul.ac.uk
60+
yumove.co.uk
61+
basschat.co.uk
62+
speakerpoint.co.uk
63+
tornadomotorsport.co.uk
64+
threadtype.co.uk
65+
ohgm.co.uk
66+
s1000xr.uk
67+
niococktails.co.uk
68+
lisou.co.uk
69+
support.cleancanvas.co.uk
70+
freelancer.co.uk
71+
rmweb.co.uk
72+
insigneart.co.uk
73+
theoodie.co.uk
74+
napapijri.co.uk
75+
herbalplan.co.uk
76+
exampaperspractice.co.uk
77+
packagingwise.co.uk
78+
stevemadden.co.uk
79+
brycelandsco.co.uk
80+
cremeofnature.co.uk
81+
g-heat.co.uk
82+
digraphics.co.uk
83+
walkersworkwear.co.uk
84+
malayacosmetics.co.uk
85+
shepherdandwoodward.co.uk
86+
smdesigns.co.uk
87+
source-vintage.co.uk
88+
igmaynard.co.uk
89+
daydress.co.uk
90+
super73.co.uk
91+
diabetes.co.uk
92+
hanro.co.uk
93+
saltbeerfactory.co.uk
94+
sodastream.co.uk
95+
dermalogica.co.uk
96+
suffolklatchcompany.co.uk
97+
rwa.org.uk
98+
hambledonvineyard.co.uk
99+
gray-nicolls.co.uk
100+
1881distillery.co.uk
101+
ecoscent.co.uk
102+
brotherscider.co.uk
103+
watchesofwales.co.uk
104+
welovecornhole.co.uk
105+
plouise.co.uk
106+
kingkraft.co.uk
107+
crumbsanddoilies.co.uk
108+
pretavoir.co.uk
109+
thecandlebrand.co.uk
110+
k18hair.co.uk
111+
eshvi.co.uk
112+
butlerscheeses.co.uk
113+
michaelspiers.co.uk
114+
pubstuff.co.uk
115+
lowa.co.uk
116+
womag.co.uk
117+
free-stuff.co.uk
118+
morrison-sporrans.co.uk
119+
blumkit.co.uk
120+
direct-drainage.co.uk
121+
mancoco.co.uk
122+
hyper-creative.co.uk
123+
omnitub.co.uk
124+
hardtimesclothing.co.uk
125+
bluettipower.co.uk
126+
italianostucco.co.uk
127+
firepit.co.uk
128+
chubbsafesonline.co.uk
129+
impulsefragrances.co.uk
130+
tomscakes.co.uk
131+
jacksgolf.co.uk
132+
truggery.co.uk
133+
skyflite.co.uk
134+
crusadergifts.co.uk
135+
persephonebooks.co.uk
136+
ginamarie.co.uk
137+
lilydogtreats.co.uk
138+
bradleysmoker.co.uk
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"DESKTOP_THRESHOLD": 40,
3+
"MOBILE_THRESHOLD": 30,
4+
"MAX_RESULTS": 100
5+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "performance-scout",
3+
"version": "1.0.0",
4+
"type": "module",
5+
"description": "CLI tool to discover and test UK Shopify sites for performance",
6+
"scripts": {
7+
"scan": "tsx ./scan.ts",
8+
"scan:serper": "tsx ./scan.ts --use-serper"
9+
},
10+
"keywords": [
11+
"shopify",
12+
"lighthouse",
13+
"performance",
14+
"cli"
15+
],
16+
"author": "",
17+
"license": "MIT",
18+
"dependencies": {
19+
"lighthouse": "^13.0.1",
20+
"serpapi": "^2.2.1"
21+
},
22+
"devDependencies": {
23+
"tsx": "^4.21.0"
24+
},
25+
"volta": {
26+
"extends": "../../package.json"
27+
}
28+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
| Site | Desktop Perf | Mobile Perf |
2+
| -------------------------- | ------------ | ----------- |
3+
| lisaeldridge.com | 42 | 20 |
4+
| tropicskincare.com | 55 | 30 |
5+
| pelacase.ca | 61 | 33 |
6+
| kyliejennercosmetics.co.uk | 43 | 33 |
7+
| pretavoir.co.uk | 48 | 9 |
8+
| bradleysmoker.co.uk | 77 | 17 |

0 commit comments

Comments
 (0)