@domandigital/craft 0.7.0 → 0.8.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/CHANGELOG.md +17 -0
- package/CHARACTER.md +26 -9
- package/COPY.md +280 -0
- package/README.md +12 -0
- package/dist/{audit-YNODYB3U.js → audit-C62GULQR.js} +3 -3
- package/dist/audit.cjs +859 -86
- package/dist/audit.d.cts +2 -0
- package/dist/audit.d.ts +2 -0
- package/dist/audit.js +859 -86
- package/dist/{chunk-CU5TZHOV.js → chunk-2VLN6JLN.js} +5 -5
- package/dist/{chunk-IQTZWNEK.js → chunk-6LPMM752.js} +5 -5
- package/dist/{chunk-Q54JSNC5.js → chunk-DWZY5MWD.js} +1 -1
- package/dist/{chunk-J2BOAIHJ.js → chunk-JNFHQGKR.js} +1 -1
- package/dist/{chunk-3AP4PJMX.js → chunk-OBVWDPQQ.js} +857 -77
- package/dist/{chunk-OA7SGPN4.js → chunk-UVBVYM5D.js} +2 -2
- package/dist/{chunk-YYC4EGER.js → chunk-X6PHP22P.js} +126 -11
- package/dist/{chunk-GV3QOTQU.js → chunk-XEH4GK5K.js} +4 -4
- package/dist/{cli-6Y5E32FS.js → cli-BWERSVPW.js} +4 -4
- package/dist/{cli-MW3JAGX3.js → cli-C5RLL7AW.js} +4 -4
- package/dist/cli-D6VYGCOE.js +16 -0
- package/dist/cli-I4TQMCUP.js +15 -0
- package/dist/{cli-TM2HWYN7.js → cli-UMQNCHAQ.js} +9 -9
- package/dist/cli.js +2 -2
- package/dist/index.cjs +977 -105
- package/dist/index.d.cts +80 -4
- package/dist/index.d.ts +80 -4
- package/dist/index.js +970 -105
- package/package.json +2 -1
- package/word-lists.json +12 -3
- package/dist/cli-IQT6QZ6U.js +0 -16
- package/dist/cli-PD43TWX7.js +0 -15
package/dist/audit.js
CHANGED
|
@@ -4,15 +4,22 @@ var isProsePath = (path) => /\.(md|markdown|mdx|txt)$/i.test(path);
|
|
|
4
4
|
function allText(ctx) {
|
|
5
5
|
return [...ctx.blocks.filter((b) => isProsePath(b.path)), ...ctx.strings.filter((b) => !isProsePath(b.path))];
|
|
6
6
|
}
|
|
7
|
+
var LINK = /\b(?:https?:\/\/|www\.)[^\s<>"'`)\]]+|\]\([^)\s]+\)/gi;
|
|
8
|
+
function linkSpans(text) {
|
|
9
|
+
return [...text.matchAll(LINK)].map((m) => [m.index ?? 0, (m.index ?? 0) + m[0].length]);
|
|
10
|
+
}
|
|
11
|
+
var insideLink = (spans, at) => spans.some(([a, b]) => at >= a && at < b);
|
|
7
12
|
function phrases(patterns, label, source = (ctx) => ctx.blocks, skip = () => false) {
|
|
8
13
|
return (ctx) => {
|
|
9
14
|
const hits = [];
|
|
10
15
|
for (const block of source(ctx)) {
|
|
11
16
|
const spans = [];
|
|
17
|
+
const links = linkSpans(block.text);
|
|
12
18
|
for (const pattern of patterns) {
|
|
13
19
|
const global = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : `${pattern.flags}g`);
|
|
14
20
|
for (const m of block.text.matchAll(global)) {
|
|
15
21
|
if (skip(block, m[0], m.index ?? 0)) continue;
|
|
22
|
+
if (insideLink(links, m.index ?? 0)) continue;
|
|
16
23
|
spans.push([m.index ?? 0, (m.index ?? 0) + m[0].length, m[0]]);
|
|
17
24
|
}
|
|
18
25
|
}
|
|
@@ -53,7 +60,14 @@ var AI_WORDS = [
|
|
|
53
60
|
"moreover",
|
|
54
61
|
"navigating",
|
|
55
62
|
"ever-evolving",
|
|
56
|
-
"unparalleled"
|
|
63
|
+
"unparalleled",
|
|
64
|
+
// Measured: Kobak et al. 2024 (arXiv 2406.07016) found these 10 to 14 times
|
|
65
|
+
// above their expected rate in post-ChatGPT abstracts. Academic, so warn only.
|
|
66
|
+
"underscore",
|
|
67
|
+
"underscores",
|
|
68
|
+
"underscoring",
|
|
69
|
+
"showcasing",
|
|
70
|
+
"pivotal"
|
|
57
71
|
];
|
|
58
72
|
var STOCK_PHRASES = [
|
|
59
73
|
"in today's digital age",
|
|
@@ -67,7 +81,11 @@ var STOCK_PHRASES = [
|
|
|
67
81
|
"curated",
|
|
68
82
|
"crafted with care",
|
|
69
83
|
"tailored to your",
|
|
70
|
-
"peace of mind"
|
|
84
|
+
"peace of mind",
|
|
85
|
+
"so here's",
|
|
86
|
+
"in an era where",
|
|
87
|
+
"the future looks bright",
|
|
88
|
+
"only time will tell"
|
|
71
89
|
];
|
|
72
90
|
var AI_PHRASES = [
|
|
73
91
|
"let's dive in",
|
|
@@ -200,7 +218,7 @@ function lineAround(text, index) {
|
|
|
200
218
|
var emptyState = (block, match, index = 0) => SIGNED_IN.test(block.path) || DATA_ABSENCE.test(isProsePath(block.path) ? lineAround(block.text, index) : block.text) || DATA_ABSENCE.test(match);
|
|
201
219
|
var NO_X_NO_Y = /\bno\s+[\w'’ ]{2,30},\s*no\s+\w/i;
|
|
202
220
|
var NO_X_BADGE = /^no\s+[\w'’\- ]{2,28}[.!]?$/i;
|
|
203
|
-
var EMOJI = /[\u{1F300}-\u{1FAFF}\u{1F1E6}-\u{1F1FF}]+/u;
|
|
221
|
+
var EMOJI = /(?:[\u{1F300}-\u{1FAFF}\u{1F1E6}-\u{1F1FF}\u2728\u2705\u274C\u274E\u2757\u2753\u26A1\u2B50\u2764]|[\u2600-\u27BF]\uFE0F)+/u;
|
|
204
222
|
var placeholderDash = (block) => block.literal === true && /^[\s—]*$/.test(block.text);
|
|
205
223
|
function badgeHits(ctx) {
|
|
206
224
|
const hits = [];
|
|
@@ -243,10 +261,16 @@ var COPY_TELLS = [
|
|
|
243
261
|
surface: "copy",
|
|
244
262
|
why: "Phrases every generated services page uses. They fill space where a fact should be.",
|
|
245
263
|
fix: "Replace the phrase with the fact behind it: a number, a name, a place, a time.",
|
|
246
|
-
detect: phrases([wordList(STOCK_PHRASES)], quoted),
|
|
264
|
+
detect: phrases([wordList(STOCK_PHRASES), /\b(?:in|on|along)\s+(?:its|their|his|her)\s+journey\b/i], quoted),
|
|
247
265
|
fixtures: {
|
|
248
|
-
flag: [
|
|
249
|
-
|
|
266
|
+
flag: [
|
|
267
|
+
f("content/home.md", "Take your plumbing to the next level with peace of mind."),
|
|
268
|
+
f("content/home.md", "We meet each practice where it is in its journey.")
|
|
269
|
+
],
|
|
270
|
+
pass: [
|
|
271
|
+
f("content/home.md", "Gas Safe registered since 2009. Same-day callouts in Brackley."),
|
|
272
|
+
f("content/home.md", "We mapped the patient journey from booking to aftercare.")
|
|
273
|
+
]
|
|
250
274
|
}
|
|
251
275
|
},
|
|
252
276
|
{
|
|
@@ -271,7 +295,11 @@ var COPY_TELLS = [
|
|
|
271
295
|
f("content/home.md", "In today's rapidly evolving market, we help."),
|
|
272
296
|
f("content/home.md", "Whether you're a landlord or a tenant, call us.")
|
|
273
297
|
],
|
|
274
|
-
pass: [
|
|
298
|
+
pass: [
|
|
299
|
+
f("content/home.md", "Book in three taps. We confirm by text within the hour."),
|
|
300
|
+
f("content/home.md", "Book at https://example.com/seamless-booking today."),
|
|
301
|
+
f("content/home.md", "[Book a slot](/seamless-booking) today.")
|
|
302
|
+
]
|
|
275
303
|
}
|
|
276
304
|
},
|
|
277
305
|
{
|
|
@@ -420,8 +448,14 @@ var COPY_TELLS = [
|
|
|
420
448
|
fix: "Remove it. Typographic marks are fine: a star for a rating, a middot as a separator, an arrow in a link.",
|
|
421
449
|
detect: phrases([new RegExp(EMOJI.source, "u")], (m) => `emoji ${m}`, (ctx) => ctx.strings),
|
|
422
450
|
fixtures: {
|
|
423
|
-
flag: [
|
|
424
|
-
|
|
451
|
+
flag: [
|
|
452
|
+
f("content/home.md", "New treatments this month \u2728\u{1F680}"),
|
|
453
|
+
f("app/cta.tsx", `export const label = "Book \u{1F680}";`),
|
|
454
|
+
f("content/home.md", "New treatments this month \u2728"),
|
|
455
|
+
f("content/home.md", "Same-day callouts \u2705"),
|
|
456
|
+
f("content/home.md", "Open Sundays \u2600\uFE0F")
|
|
457
|
+
],
|
|
458
|
+
pass: [f("content/home.md", "Rated \u2605\u2605\u2605\u2605\u2605 \xB7 Book now \u2192"), f("content/home.md", "\u2713 Gas Safe registered")]
|
|
425
459
|
}
|
|
426
460
|
},
|
|
427
461
|
{
|
|
@@ -519,6 +553,698 @@ var COPY_TELLS = [
|
|
|
519
553
|
}
|
|
520
554
|
}
|
|
521
555
|
];
|
|
556
|
+
var ING_TAIL = /,\s+(?:ensuring|highlighting|underscoring|showcasing|reflecting|demonstrating|emphasi[sz]ing|fostering|cementing|solidifying|reinforcing|symboli[sz]ing|signalling|signaling)\b[^.!?\n]{0,80}/i;
|
|
557
|
+
var VAGUE_ATTRIBUTION = [
|
|
558
|
+
/\b(?:studies|research|experts|scientists|surveys|statistics|the data)\s+(?:show|shows|suggest|suggests|agree|say|says|confirm|confirms|prove|proves|indicate|indicates)\b/i,
|
|
559
|
+
/\b(?:many|most)\s+(?:experts|people|customers|professionals|homeowners)\s+(?:agree|say|believe)\b/i,
|
|
560
|
+
/\bit\s+is\s+(?:widely|generally|commonly)\s+(?:known|accepted|believed|agreed)\b/i
|
|
561
|
+
];
|
|
562
|
+
function sourced(block, _match, index) {
|
|
563
|
+
const before = block.text.slice(Math.max(0, index - 40), index);
|
|
564
|
+
if (/(?:\b[A-Z][\w&]*[’']s|\b[A-Z]{2,}[a-z]*)\s+$/.test(before)) return true;
|
|
565
|
+
const rest = block.text.slice(index, index + 400);
|
|
566
|
+
const end = rest.search(/[.!?](?:\s|$)/);
|
|
567
|
+
const sentence = rest.slice(0, end === -1 ? rest.length : end + 16);
|
|
568
|
+
return /\[\^\w+\]|\]\(https?:|\(source|according to [A-Z]|\bper [A-Z]/.test(sentence);
|
|
569
|
+
}
|
|
570
|
+
var CLOSING_SUMMARY = /(?:^|[.!?]\s+|\n\s*|>\s*)(?:Overall|In conclusion|In summary|To sum up|All in all|In short|To summari[sz]e),/;
|
|
571
|
+
var FALSE_RANGE = [
|
|
572
|
+
/\bfrom\s+(?:[\w'’-]+\s+){0,3}[\w'’-]+\s+to\s+(?:[\w'’-]+\s+){0,3}[\w'’-]+\s+alike\b/i,
|
|
573
|
+
/\b(?:everyone|anyone)\s+from\s+(?:[\w'’-]+\s+){0,3}[\w'’-]+\s+to\s+(?:[\w'’-]+\s*){1,4}/i
|
|
574
|
+
];
|
|
575
|
+
var RESIDUE = [
|
|
576
|
+
/\bas an AI(?:\s+language)?\s+(?:model|assistant)\b/i,
|
|
577
|
+
/(?:^|\n|>)\s*(?:Certainly|Sure|Absolutely|Of course|Great question)[!,.]\s+(?:Here(?:['’]s| is| are)|Below)\b/i,
|
|
578
|
+
/\bhere(?:['’]s| is)\s+(?:a|an|the|your)\s+(?:revised|rewritten|updated|polished|refined|improved|draft|more concise)\s+(?:version|draft|copy)\b/i,
|
|
579
|
+
/\blet me know if you(?:['’]d| would) like me to\b/i,
|
|
580
|
+
/\b(?:my|the) (?:knowledge|training) cut-?off\b|\bas of my last (?:update|training)\b/i,
|
|
581
|
+
/\bI hope this helps\b/i,
|
|
582
|
+
// Citation tokens a chat tool leaves in copied text.
|
|
583
|
+
// A run of them is one paste: "citeturn11search1turn10view0" is one finding.
|
|
584
|
+
// ChatGPT wraps them in invisible private-use characters (U+E200 to U+E202),
|
|
585
|
+
// which survive a copy and paste into a CMS: found live, 2026-09-23.
|
|
586
|
+
/[\uE200-\uE2FF]*(?:cite)?[\uE200-\uE2FF]*(?:turn\d+(?:search|news|view|fetch|file|image)\d+[\uE200-\uE2FF]*)+/,
|
|
587
|
+
/:?contentReference\[oaicite:\d+\](?:\{index=\d+\})?/,
|
|
588
|
+
// Entity markers from the same paste: entity["company","Bark","services
|
|
589
|
+
// marketplace"] shows on the page where the plain name "Bark" belongs.
|
|
590
|
+
/[\uE200-\uE2FF]*entity[\uE200-\uE2FF]*\["[a-z_]+"\s*,\s*"[^"\n]{1,80}"(?:\s*,\s*"[^"\n]{0,160}")*\][\uE200-\uE2FF]*/,
|
|
591
|
+
/【\d+(?:[:†][^】]{0,40})?】/
|
|
592
|
+
];
|
|
593
|
+
var AI_UTM = /utm_source=(?:chatgpt\.com|chat\.openai\.com|openai|perplexity(?:\.ai)?|claude\.ai|copilot(?:\.microsoft\.com)?|gemini(?:\.google\.com)?)\b/gi;
|
|
594
|
+
function residueHits(ctx) {
|
|
595
|
+
const hits = phrases(RESIDUE, quoted, allText)(ctx);
|
|
596
|
+
for (const file of ctx.files) {
|
|
597
|
+
for (const m of file.text.matchAll(AI_UTM)) hits.push({ path: file.path, offset: m.index ?? 0, message: `link tracked as copied from a chat assistant: "${m[0]}"` });
|
|
598
|
+
}
|
|
599
|
+
return hits;
|
|
600
|
+
}
|
|
601
|
+
var PLACEHOLDER = [
|
|
602
|
+
/\[(?:insert|your|add|company|client|business|customer|name of|placeholder)\b[^\]\n]{0,40}\](?!\()/i,
|
|
603
|
+
/\blorem ipsum\b/i,
|
|
604
|
+
/\bTODO_PLACEHOLDER\b/
|
|
605
|
+
];
|
|
606
|
+
var PLACEHOLDER_ELEMENT = />\s*(\[(?:insert|your|add|company|client|business|customer|name of|placeholder)\b[^\]\n<]{0,40}\])\s*</gi;
|
|
607
|
+
function insideQuotes(block, _match, index) {
|
|
608
|
+
const lineStart = block.text.lastIndexOf("\n", index - 1) + 1;
|
|
609
|
+
const before = block.text.slice(lineStart, index);
|
|
610
|
+
const straight = (before.match(/"/g) ?? []).length;
|
|
611
|
+
const curly = (before.match(/“/g) ?? []).length - (before.match(/”/g) ?? []).length;
|
|
612
|
+
return straight % 2 === 1 || curly > 0;
|
|
613
|
+
}
|
|
614
|
+
function placeholderHits(ctx) {
|
|
615
|
+
const hits = phrases(PLACEHOLDER, quoted, allText, insideQuotes)(ctx);
|
|
616
|
+
const seen = new Set(hits.map((h) => `${h.path}:${h.offset}`));
|
|
617
|
+
for (const file of ctx.files) {
|
|
618
|
+
if (isProsePath(file.path)) continue;
|
|
619
|
+
for (const m of file.text.matchAll(PLACEHOLDER_ELEMENT)) {
|
|
620
|
+
const offset = (m.index ?? 0) + m[0].indexOf(m[1]);
|
|
621
|
+
if (!seen.has(`${file.path}:${offset}`)) hits.push({ path: file.path, offset, message: quoted(m[1]) });
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
return hits;
|
|
625
|
+
}
|
|
626
|
+
var QUESTION_REVEAL = [
|
|
627
|
+
/\b(?:The|Our|What['’]s the|Here['’]s the)\s+(?:result|catch|secret|answer|difference|best part|twist|kicker|bottom line|upshot)\?\s+[A-Z0-9]/,
|
|
628
|
+
/\?\s+It means\b/
|
|
629
|
+
];
|
|
630
|
+
function inlineLabelHits(ctx) {
|
|
631
|
+
const hits = [];
|
|
632
|
+
for (const file of ctx.files) {
|
|
633
|
+
if (!isProsePath(file.path)) continue;
|
|
634
|
+
const lines = file.text.split("\n");
|
|
635
|
+
let run = [];
|
|
636
|
+
let offset = 0;
|
|
637
|
+
const flush = () => {
|
|
638
|
+
if (run.length >= 3) hits.push({ path: file.path, offset: run[0], message: `${run.length} bullets in a row open with a bold label and a colon` });
|
|
639
|
+
run = [];
|
|
640
|
+
};
|
|
641
|
+
for (const line of lines) {
|
|
642
|
+
const m = /^\s*(?:[-*+]|\d+\.)\s+\*\*[^*]{1,40}:?\*\*:?\s+(\S.*)$/.exec(line);
|
|
643
|
+
if (m && m[1].trim().split(/\s+/).length <= 6) run.push(offset);
|
|
644
|
+
else flush();
|
|
645
|
+
offset += line.length + 1;
|
|
646
|
+
}
|
|
647
|
+
flush();
|
|
648
|
+
}
|
|
649
|
+
return hits;
|
|
650
|
+
}
|
|
651
|
+
var RESEARCH_TELLS = [
|
|
652
|
+
{
|
|
653
|
+
id: "chatbot-residue",
|
|
654
|
+
name: "Chatbot residue",
|
|
655
|
+
generation: 1,
|
|
656
|
+
severity: "warn",
|
|
657
|
+
surface: "copy",
|
|
658
|
+
why: "'Certainly! Here's a revised version', 'as an AI language model', a citeturn0search0 token, a link tracked utm_source=chatgpt.com: text that exists only because a chat reply was pasted whole. This is evidence, not style.",
|
|
659
|
+
fix: "Delete the residue. Then read the whole passage again, because the rest of it came from the same paste.",
|
|
660
|
+
detect: residueHits,
|
|
661
|
+
fixtures: {
|
|
662
|
+
flag: [
|
|
663
|
+
f("content/home.md", "Certainly! Here's a revised version of your home page."),
|
|
664
|
+
f("content/home.md", "As an AI language model, I cannot visit your salon."),
|
|
665
|
+
f("content/home.md", "Let me know if you'd like me to shorten it."),
|
|
666
|
+
f("content/home.md", "Prices start at \xA340 citeturn0search3 for a full set."),
|
|
667
|
+
f("content/home.md", "Prices start at \xA340. citeturn11search1turn10view0turn2view3"),
|
|
668
|
+
f("content/home.md", "Prices start at \xA340. \uE200cite\uE202turn11search1\uE202turn10view0\uE201"),
|
|
669
|
+
f("content/home.md", "Prices start at \xA340 :contentReference[oaicite:2]{index=2} for a full set."),
|
|
670
|
+
f("content/home.md", "Prices start at \xA340\u30104\u2020source\u3011 for a full set."),
|
|
671
|
+
f("app/guide.tsx", `export const Guide = () => <a href="https://example.com/guide?utm_source=chatgpt.com">Read the guide</a>;`),
|
|
672
|
+
f("content/home.md", "Here's a more concise version for the hero.")
|
|
673
|
+
],
|
|
674
|
+
pass: [
|
|
675
|
+
f("content/home.md", "Certainly the busiest week of the year: book early."),
|
|
676
|
+
f("content/home.md", "Here's the price list for 2026."),
|
|
677
|
+
f("app/guide.tsx", `export const Guide = () => <a href="https://example.com/guide?utm_source=newsletter">Read the guide</a>;`)
|
|
678
|
+
]
|
|
679
|
+
}
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
id: "placeholder",
|
|
683
|
+
name: "Unfilled placeholder",
|
|
684
|
+
generation: 1,
|
|
685
|
+
severity: "warn",
|
|
686
|
+
surface: "copy",
|
|
687
|
+
why: "'[Insert testimonial]', '[Your Name]', lorem ipsum, TODO_PLACEHOLDER: scaffolding a reader must never see, and the clearest sign a page shipped before anyone read it.",
|
|
688
|
+
fix: "Fill it from the client or the proof source, or remove the element. Never invent the missing fact to close it.",
|
|
689
|
+
detect: placeholderHits,
|
|
690
|
+
fixtures: {
|
|
691
|
+
flag: [
|
|
692
|
+
f("content/home.md", "Rated 5 stars by [Insert client name] and others."),
|
|
693
|
+
f("content/home.md", "Lorem ipsum dolor sit amet."),
|
|
694
|
+
f("content/home.md", "Rated TODO_PLACEHOLDER: google_rating from our reviews."),
|
|
695
|
+
f("app/card.tsx", `export const Quote = () => <blockquote>[Insert testimonial here]</blockquote>;`)
|
|
696
|
+
],
|
|
697
|
+
pass: [
|
|
698
|
+
f("content/home.md", "Manage bookings in [your account](/account)."),
|
|
699
|
+
f("content/guide.md", 'After 90 days, check your ranking for "[your trade] [your town]" on Google.'),
|
|
700
|
+
f("content/guide.md", "Send a short message: \u201CThanks for choosing [Business Name]! Leave us a review.\u201D"),
|
|
701
|
+
f("content/home.md", "Rated 4.9 from 212 Google reviews.")
|
|
702
|
+
]
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
id: "question-reveal",
|
|
707
|
+
name: "Staged reveal",
|
|
708
|
+
generation: 2,
|
|
709
|
+
severity: "warn",
|
|
710
|
+
surface: "copy",
|
|
711
|
+
why: "'The result? Faster growth.', 'What does this mean for you? It means...': the writer asks the reader's question for them and answers it. An infomercial hook, and a favourite of generated copy.",
|
|
712
|
+
fix: "State the answer: 'Most customers book again within six weeks.'",
|
|
713
|
+
detect: phrases(QUESTION_REVEAL, quoted),
|
|
714
|
+
fixtures: {
|
|
715
|
+
flag: [f("content/home.md", "We rebuilt the booking flow. The result? Twice the bookings."), f("content/home.md", "What does this mean for you? It means fewer missed calls.")],
|
|
716
|
+
pass: [f("content/faq.md", "How long does a set last? About three weeks with gel."), f("content/home.md", "We rebuilt the booking flow, and bookings doubled in a month.")]
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
id: "inline-label-list",
|
|
721
|
+
name: "Bold-label bullets",
|
|
722
|
+
generation: 2,
|
|
723
|
+
severity: "warn",
|
|
724
|
+
surface: "copy",
|
|
725
|
+
why: "'**Speed:** Faster pages' three times in a row: a short label restated in a few words, the list shape generated copy defaults to. A definition list, with a real explanation after each label, is not this.",
|
|
726
|
+
fix: "Drop the labels and write each bullet as the fact: 'Pages load in under a second'. Keep labels only where they help a reader navigate, as in a specification.",
|
|
727
|
+
detect: inlineLabelHits,
|
|
728
|
+
fixtures: {
|
|
729
|
+
flag: [f("content/home.md", "- **Speed:** Faster pages\n- **Security:** Safer data\n- **Support:** Help when you need it\n")],
|
|
730
|
+
pass: [
|
|
731
|
+
f("content/home.md", "- Pages load in under a second\n- Card details never touch our server\n- Support by phone until 8pm\n"),
|
|
732
|
+
f("content/home.md", "- **Speed:** Faster pages\n- **Security:** Safer data\n"),
|
|
733
|
+
f("content/guide.md", "- **GDC**: The statutory regulator for all dental professionals.\n- **GCC**: The statutory regulator for chiropractors in the UK.\n- **CQC**: The independent regulator of health and social care in England.\n")
|
|
734
|
+
]
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
id: "ing-tail",
|
|
739
|
+
name: "Empty -ing tail",
|
|
740
|
+
generation: 2,
|
|
741
|
+
severity: "warn",
|
|
742
|
+
surface: "copy",
|
|
743
|
+
why: "'..., ensuring peace of mind', '..., highlighting our commitment': a participle tacked on the end that claims significance and names no mechanism. One of the most common shapes in the Wikipedia guide to AI writing.",
|
|
744
|
+
fix: "Cut the tail, or replace it with the mechanism: 'so you can drop the car off before work'.",
|
|
745
|
+
detect: phrases([ING_TAIL], (m) => quoted(m.replace(/^,\s*/, ""))),
|
|
746
|
+
fixtures: {
|
|
747
|
+
flag: [
|
|
748
|
+
f("content/home.md", "Every engineer is Gas Safe registered, ensuring complete peace of mind."),
|
|
749
|
+
f("app/about.tsx", `export const About = () => <p>We have served Brackley since 2009, highlighting our commitment to the town.</p>;`)
|
|
750
|
+
],
|
|
751
|
+
pass: [
|
|
752
|
+
f("content/home.md", "We open at 7am, so you can drop the car off before work."),
|
|
753
|
+
f("content/home.md", "Engineers arrive by 9, carrying the parts for most boilers.")
|
|
754
|
+
]
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
id: "vague-attribution",
|
|
759
|
+
name: "Unnamed source",
|
|
760
|
+
generation: 1,
|
|
761
|
+
severity: "warn",
|
|
762
|
+
surface: "copy",
|
|
763
|
+
why: "'Studies show', 'experts agree', 'it is widely known': a claim credited to nobody. A reader cannot check it, and the house proof rule forbids a claim nobody can check.",
|
|
764
|
+
fix: "Name the source and the number ('A 2023 Which? survey of 2,000 drivers found...') or cut the claim.",
|
|
765
|
+
detect: phrases(VAGUE_ATTRIBUTION, quoted, (ctx) => ctx.blocks, sourced),
|
|
766
|
+
fixtures: {
|
|
767
|
+
flag: [
|
|
768
|
+
f("content/home.md", "Studies show that regular servicing saves money."),
|
|
769
|
+
f("content/home.md", "Most experts agree a boiler lasts fifteen years."),
|
|
770
|
+
f("content/home.md", "It is widely known that gel damages nails.")
|
|
771
|
+
],
|
|
772
|
+
pass: [
|
|
773
|
+
f("content/home.md", "A 2023 Which? survey of 2,000 owners found serviced boilers failed half as often."),
|
|
774
|
+
f("content/home.md", "BrightLocal's research shows that reviews drive 20% of local ranking."),
|
|
775
|
+
f("content/home.md", "Research shows 62% of consumers avoid a business with wrong hours.[^7]"),
|
|
776
|
+
f("content/home.md", "Our customers rate us 4.9 from 212 Google reviews.")
|
|
777
|
+
]
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
id: "closing-summary",
|
|
782
|
+
name: "Closing summary",
|
|
783
|
+
generation: 1,
|
|
784
|
+
severity: "warn",
|
|
785
|
+
surface: "copy",
|
|
786
|
+
why: "'Overall,', 'In conclusion,', 'In short,': a paragraph that announces it is summing up, then restates what the reader has just read.",
|
|
787
|
+
fix: "Cut the summary. End on the last new fact, or on the next step: 'Book a survey and we'll quote within two days'.",
|
|
788
|
+
detect: phrases([CLOSING_SUMMARY], (m) => quoted(m.replace(/^[.!?>\s]+/, ""))),
|
|
789
|
+
fixtures: {
|
|
790
|
+
flag: [
|
|
791
|
+
f("content/home.md", "We rewire, test and certify.\n\nOverall, we are the right choice for your home."),
|
|
792
|
+
f("content/home.md", "Prices start at \xA340. In conclusion, we offer great value.")
|
|
793
|
+
],
|
|
794
|
+
pass: [f("content/home.md", "We rewire, test and certify.\n\nBook a survey and we'll quote within two days.")]
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
id: "false-range",
|
|
799
|
+
name: "False range",
|
|
800
|
+
generation: 1,
|
|
801
|
+
severity: "warn",
|
|
802
|
+
surface: "copy",
|
|
803
|
+
why: "'From first-time buyers to seasoned investors alike' names two ends of no real scale, to sound as if it covers everyone. It describes nobody.",
|
|
804
|
+
fix: "Say who you actually serve, or cut it. A real range is fine: 'from 9am to 5pm', 'from small repairs to full rewires'.",
|
|
805
|
+
detect: phrases(FALSE_RANGE, quoted),
|
|
806
|
+
fixtures: {
|
|
807
|
+
flag: [
|
|
808
|
+
f("content/home.md", "We help clients from first-time buyers to seasoned investors alike."),
|
|
809
|
+
f("content/home.md", "Everyone from students to retirees loves our cakes.")
|
|
810
|
+
],
|
|
811
|
+
pass: [
|
|
812
|
+
f("content/home.md", "Open from 9am to 5pm, Monday to Saturday."),
|
|
813
|
+
f("content/home.md", "We take on everything from small repairs to full rewires.")
|
|
814
|
+
]
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
];
|
|
818
|
+
|
|
819
|
+
// src/character/tells/density.ts
|
|
820
|
+
var DOCUMENT = /\.(md|markdown|mdx|txt|html?)$/i;
|
|
821
|
+
var MIN_WORDS = 400;
|
|
822
|
+
var WORD = /[A-Za-z0-9£$€][\w'’£$€%.,-]*/g;
|
|
823
|
+
var countWords = (text) => (text.match(WORD) ?? []).length;
|
|
824
|
+
function documents(ctx) {
|
|
825
|
+
const byPath = /* @__PURE__ */ new Map();
|
|
826
|
+
for (const block of ctx.blocks) {
|
|
827
|
+
if (!DOCUMENT.test(block.path) || block.literal) continue;
|
|
828
|
+
const list = byPath.get(block.path) ?? [];
|
|
829
|
+
list.push(block);
|
|
830
|
+
byPath.set(block.path, list);
|
|
831
|
+
}
|
|
832
|
+
const docs = [];
|
|
833
|
+
for (const [path, blocks] of byPath) {
|
|
834
|
+
const text = blocks.map((b) => withoutHeadings(b.text)).join("\n");
|
|
835
|
+
const words = countWords(text);
|
|
836
|
+
if (words >= MIN_WORDS) docs.push({ path, blocks, words });
|
|
837
|
+
}
|
|
838
|
+
return docs;
|
|
839
|
+
}
|
|
840
|
+
var withoutHeadings = (text) => text.replace(/^\s{0,3}#{1,6}\s.*$/gm, "");
|
|
841
|
+
var allowed = (doc2, floor, per1000) => Math.max(floor, Math.floor(doc2.words * per1000 / 1e3));
|
|
842
|
+
var thousands = (n) => n.toLocaleString("en-GB");
|
|
843
|
+
function sentences(doc2) {
|
|
844
|
+
const out = [];
|
|
845
|
+
for (const block of doc2.blocks) {
|
|
846
|
+
const text = withoutHeadings(block.text);
|
|
847
|
+
for (const para of text.matchAll(/[^\n]+(?:\n(?!\s*\n)[^\n]+)*/g)) {
|
|
848
|
+
const body = para[0];
|
|
849
|
+
const start = para.index ?? 0;
|
|
850
|
+
for (const m of body.matchAll(/[^.!?]+[.!?]+["'’”)]*|[^.!?]+$/g)) {
|
|
851
|
+
const raw = m[0];
|
|
852
|
+
const trimmed = raw.trim();
|
|
853
|
+
if (countWords(trimmed) === 0) continue;
|
|
854
|
+
const lead = raw.length - raw.trimStart().length;
|
|
855
|
+
out.push({ text: trimmed.replace(/\s+/g, " "), offset: block.offset + start + (m.index ?? 0) + lead });
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
return out;
|
|
860
|
+
}
|
|
861
|
+
var RATES = [
|
|
862
|
+
{ label: "rather than", pattern: /\brather\s+than\b/i, floor: 4, per1000: 0.9, why: "the document's one move" },
|
|
863
|
+
{ label: "instead of", pattern: /\binstead\s+of\b/i, floor: 4, per1000: 0.7, why: "the reflex swap once 'rather than' is edited out" },
|
|
864
|
+
{ label: "actually", pattern: /\bactually\b/i, floor: 2, per1000: 0.35, why: "filler, the sentence means the same without it" },
|
|
865
|
+
{ label: "properly", pattern: /\bproperly\b/i, floor: 3, per1000: 0.4, why: "filler, the sentence means the same without it" },
|
|
866
|
+
{ label: "genuinely", pattern: /\bgenuinely\b/i, floor: 1, per1000: 0.2, why: "reaching for sincerity: one is emphasis, two is a tic" },
|
|
867
|
+
{
|
|
868
|
+
label: "the single ...est",
|
|
869
|
+
pattern: /\bthe\s+single\s+(?:\w+est|most|\w+\s+most)\b/i,
|
|
870
|
+
floor: 1,
|
|
871
|
+
per1000: 0.15,
|
|
872
|
+
why: "if three things are the single most important, none is"
|
|
873
|
+
},
|
|
874
|
+
{ label: "That is / This is opener", pattern: /^(?:That\s+is|That['’]s|This\s+is)\b/, opener: true, floor: 4, per1000: 0.7, why: "pointing back instead of moving on" },
|
|
875
|
+
{ label: "Every opener", pattern: /^Every\b/, opener: true, floor: 4, per1000: 0.6, why: "the same sweeping opener, again" },
|
|
876
|
+
{
|
|
877
|
+
label: "Worth noting opener",
|
|
878
|
+
pattern: /^(?:Worth\s+(?:knowing|noting|saying|mentioning|remembering)|It(?:['’]s|\s+is)\s+worth\s+(?:knowing|noting|saying|mentioning|remembering))\b/,
|
|
879
|
+
opener: true,
|
|
880
|
+
floor: 3,
|
|
881
|
+
per1000: 0.5,
|
|
882
|
+
why: "a hedge that lets a sentence start without committing"
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
label: "negation-led opener",
|
|
886
|
+
pattern: /^(?:None\s+of|Not\s+one|Not\s+a\s+single|Nothing|No\s+one|Nobody|Never)\b/,
|
|
887
|
+
opener: true,
|
|
888
|
+
floor: 5,
|
|
889
|
+
per1000: 1,
|
|
890
|
+
why: "each earns its place once or twice; at twenty the document has one move"
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
label: "participle triad",
|
|
894
|
+
pattern: /\b[a-z]{3,}ed,\s+[a-z]{3,}ed,?\s+and\s+[a-z]{3,}ed\b/i,
|
|
895
|
+
floor: 3,
|
|
896
|
+
per1000: 0.6,
|
|
897
|
+
why: "'researched, written and referenced' is fine once and a cadence in bulk"
|
|
898
|
+
}
|
|
899
|
+
];
|
|
900
|
+
function rateHits(ctx) {
|
|
901
|
+
const hits = [];
|
|
902
|
+
for (const doc2 of documents(ctx)) {
|
|
903
|
+
const list = sentences(doc2);
|
|
904
|
+
for (const rate of RATES) {
|
|
905
|
+
const found = [];
|
|
906
|
+
const global = new RegExp(rate.pattern.source, rate.pattern.flags.replace("g", "") + "g");
|
|
907
|
+
for (const s of list) {
|
|
908
|
+
if (rate.opener) {
|
|
909
|
+
if (rate.pattern.test(s.text)) found.push(s);
|
|
910
|
+
} else {
|
|
911
|
+
const n = (s.text.match(global) ?? []).length;
|
|
912
|
+
for (let k = 0; k < n; k += 1) found.push(s);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
const limit = allowed(doc2, rate.floor, rate.per1000);
|
|
916
|
+
if (found.length > limit) {
|
|
917
|
+
hits.push({
|
|
918
|
+
path: doc2.path,
|
|
919
|
+
offset: found[limit].offset,
|
|
920
|
+
message: `"${rate.label}" ${found.length} times in ${thousands(doc2.words)} words (allows ${limit}): ${rate.why}`,
|
|
921
|
+
excerpt: found[limit].text.slice(0, 120)
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
return hits;
|
|
927
|
+
}
|
|
928
|
+
function aphorismHits(ctx) {
|
|
929
|
+
const hits = [];
|
|
930
|
+
for (const doc2 of documents(ctx)) {
|
|
931
|
+
const found = [];
|
|
932
|
+
for (const block of doc2.blocks) {
|
|
933
|
+
let at = 0;
|
|
934
|
+
for (const line of withoutHeadings(block.text).split("\n")) {
|
|
935
|
+
const text = line.trim().replace(/^[-*>]\s+/, "");
|
|
936
|
+
const parts2 = text.match(/[^.!?]+[.!?]+/g) ?? [];
|
|
937
|
+
if (parts2.length === 2 && parts2.join("").length >= text.length - 1 && parts2.every((p) => countWords(p) >= 2 && countWords(p) <= 7)) {
|
|
938
|
+
found.push({ text, offset: block.offset + at + line.indexOf(text.charAt(0)) });
|
|
939
|
+
}
|
|
940
|
+
at += line.length + 1;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
const limit = allowed(doc2, 5, 1.2);
|
|
944
|
+
if (found.length > limit) {
|
|
945
|
+
hits.push({
|
|
946
|
+
path: doc2.path,
|
|
947
|
+
offset: found[limit].offset,
|
|
948
|
+
message: `${found.length} two-line aphorisms in ${thousands(doc2.words)} words (allows ${limit}). Keep the one that lands hardest`,
|
|
949
|
+
excerpt: found[limit].text
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
return hits;
|
|
954
|
+
}
|
|
955
|
+
var CONTRACTION = /\b(?:\w+n['’]t|\w+['’](?:re|ve|ll|m|d)|(?:it|that|there|here|what|who|he|she|let|where)['’]s)\b/gi;
|
|
956
|
+
function contractionHits(ctx) {
|
|
957
|
+
const hits = [];
|
|
958
|
+
for (const doc2 of documents(ctx)) {
|
|
959
|
+
if (doc2.words < 800) continue;
|
|
960
|
+
const text = doc2.blocks.map((b) => withoutHeadings(b.text)).join("\n");
|
|
961
|
+
const count2 = (text.match(CONTRACTION) ?? []).length;
|
|
962
|
+
const rate = count2 * 1e3 / doc2.words;
|
|
963
|
+
if (rate < 1) {
|
|
964
|
+
const first = sentences(doc2)[0];
|
|
965
|
+
hits.push({
|
|
966
|
+
path: doc2.path,
|
|
967
|
+
offset: first?.offset ?? 0,
|
|
968
|
+
message: `${count2} contraction${count2 === 1 ? "" : "s"} in ${thousands(doc2.words)} words. Prose with none reads stiff; formal legal pages are the exception`
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
return hits;
|
|
973
|
+
}
|
|
974
|
+
function rhythmHits(ctx) {
|
|
975
|
+
const hits = [];
|
|
976
|
+
for (const doc2 of documents(ctx)) {
|
|
977
|
+
const list = sentences(doc2);
|
|
978
|
+
if (list.length < 40) continue;
|
|
979
|
+
const lengths = list.map((s) => countWords(s.text));
|
|
980
|
+
const mean = lengths.reduce((a, b) => a + b, 0) / lengths.length;
|
|
981
|
+
const sd = Math.sqrt(lengths.reduce((a, b) => a + (b - mean) ** 2, 0) / lengths.length);
|
|
982
|
+
const cv = sd / mean;
|
|
983
|
+
if (cv < 0.42) {
|
|
984
|
+
hits.push({
|
|
985
|
+
path: doc2.path,
|
|
986
|
+
offset: list[0].offset,
|
|
987
|
+
message: `${list.length} sentences averaging ${mean.toFixed(1)} words with little variation (spread ${cv.toFixed(2)}, reads metronomic below 0.42)`
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
return hits;
|
|
992
|
+
}
|
|
993
|
+
var normal = (s) => s.toLowerCase().replace(/[’]/g, "'").match(/[a-z0-9£$€'%]+/g) ?? [];
|
|
994
|
+
function repeatHits(ctx) {
|
|
995
|
+
const hits = [];
|
|
996
|
+
const RUN = 9;
|
|
997
|
+
for (const doc2 of documents(ctx)) {
|
|
998
|
+
const whole = /* @__PURE__ */ new Map();
|
|
999
|
+
const runs = /* @__PURE__ */ new Map();
|
|
1000
|
+
for (const s of sentences(doc2)) {
|
|
1001
|
+
const words = normal(s.text);
|
|
1002
|
+
if (words.length < RUN || !/[.!?]["'’”)]*$/.test(s.text)) continue;
|
|
1003
|
+
const key = words.join(" ");
|
|
1004
|
+
const earlier = whole.get(key);
|
|
1005
|
+
if (earlier) {
|
|
1006
|
+
hits.push({ path: doc2.path, offset: s.offset, message: `the same sentence appears twice (${words.length} words)`, excerpt: s.text.slice(0, 120) });
|
|
1007
|
+
continue;
|
|
1008
|
+
}
|
|
1009
|
+
whole.set(key, s);
|
|
1010
|
+
let reported = false;
|
|
1011
|
+
for (let i = 0; i + RUN <= words.length && !reported; i += 1) {
|
|
1012
|
+
const run = words.slice(i, i + RUN).join(" ");
|
|
1013
|
+
const seen = runs.get(run);
|
|
1014
|
+
if (seen && seen.key !== key) {
|
|
1015
|
+
hits.push({ path: doc2.path, offset: s.offset, message: `shares a ${RUN}-word run with an earlier sentence: "${run}"`, excerpt: s.text.slice(0, 120) });
|
|
1016
|
+
reported = true;
|
|
1017
|
+
} else if (!seen) {
|
|
1018
|
+
runs.set(run, { sentence: s, key });
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
return hits;
|
|
1024
|
+
}
|
|
1025
|
+
function headings(file) {
|
|
1026
|
+
const out = [];
|
|
1027
|
+
for (const m of file.text.matchAll(/^\s{0,3}#{1,6}\s+(.+?)\s*#*\s*$/gm)) {
|
|
1028
|
+
out.push({ text: m[1], offset: (m.index ?? 0) + m[0].indexOf(m[1]), end: (m.index ?? 0) + m[0].length });
|
|
1029
|
+
}
|
|
1030
|
+
for (const m of file.text.matchAll(/<h[1-6]\b[^>]*>([\s\S]*?)<\/h[1-6]>/gi)) {
|
|
1031
|
+
const text = m[1].replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim();
|
|
1032
|
+
if (text) out.push({ text, offset: (m.index ?? 0) + m[0].indexOf(m[1]), end: (m.index ?? 0) + m[0].length });
|
|
1033
|
+
}
|
|
1034
|
+
return out.sort((a, b) => a.offset - b.offset);
|
|
1035
|
+
}
|
|
1036
|
+
function longFiles(ctx) {
|
|
1037
|
+
const docs = new Map(documents(ctx).map((d) => [d.path, d]));
|
|
1038
|
+
return ctx.files.filter((f4) => docs.has(f4.path)).map((file) => ({ file, doc: docs.get(file.path) }));
|
|
1039
|
+
}
|
|
1040
|
+
var HEADING_SHAPES = [
|
|
1041
|
+
["X, and Y", /^[^,]{2,}, and [^,]{2,}$/i],
|
|
1042
|
+
["X, because Y", /^[^,]{2,}, because [^,]{2,}$/i],
|
|
1043
|
+
["comma list", /^[A-Z][\w'’-]*(?:, [\w'’-]+){2,}(?:,? (?:and|or) [\w'’-]+)?\.?$/]
|
|
1044
|
+
];
|
|
1045
|
+
function headingShapeHits(ctx) {
|
|
1046
|
+
const hits = [];
|
|
1047
|
+
for (const { file, doc: doc2 } of longFiles(ctx)) {
|
|
1048
|
+
const found = [];
|
|
1049
|
+
for (const heading of headings(file)) {
|
|
1050
|
+
const shape = HEADING_SHAPES.find(([, re]) => re.test(heading.text));
|
|
1051
|
+
if (shape) found.push({ heading, shape: shape[0] });
|
|
1052
|
+
}
|
|
1053
|
+
const limit = allowed(doc2, 3, 0.5);
|
|
1054
|
+
if (found.length > limit) {
|
|
1055
|
+
hits.push({
|
|
1056
|
+
path: file.path,
|
|
1057
|
+
offset: found[limit].heading.offset,
|
|
1058
|
+
message: `${found.length} headings share one shape (${[...new Set(found.map((f4) => f4.shape))].join(", ")}), allows ${limit}`,
|
|
1059
|
+
excerpt: found[limit].heading.text
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
return hits;
|
|
1064
|
+
}
|
|
1065
|
+
function headingEchoHits(ctx) {
|
|
1066
|
+
const hits = [];
|
|
1067
|
+
for (const { file } of longFiles(ctx)) {
|
|
1068
|
+
for (const heading of headings(file)) {
|
|
1069
|
+
const words = normal(heading.text);
|
|
1070
|
+
if (words.length < 4) continue;
|
|
1071
|
+
const after = file.text.slice(heading.end, heading.end + 600).trimStart().replace(/^\s*(?:<\/?(?:p|div|section)\b[^>]*>\s*)*/i, "");
|
|
1072
|
+
const opening = normal(after.split(/\n\s*\n/)[0] ?? "").slice(0, words.length);
|
|
1073
|
+
if (opening.join(" ") === words.join(" ")) {
|
|
1074
|
+
hits.push({ path: file.path, offset: heading.offset, message: `the heading "${heading.text}" is repeated as the first words under it` });
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
return hits;
|
|
1079
|
+
}
|
|
1080
|
+
var FILLER_WORDS = "boiler van kitchen garden studio market street window roof tile paint brush ladder hedge lawn fence gate shop counter oven bread flour kettle chair table shelf lamp cable socket switch meter valve pipe tap sink drain gutter brick mortar timber plank screw bolt hinge lock key door frame glass mirror towel basin morning evening winter summer spring autumn monday tuesday friday weekend hour minute week month year fitted checked cleaned painted mended booked quoted delivered collected measured sanded sealed wired local quiet small large early late busy bright warm dry".split(" ");
|
|
1081
|
+
function filler(words, seed = 1, options = {}) {
|
|
1082
|
+
const { contractions = true, uniform } = options;
|
|
1083
|
+
const shape = [5, 17, 9, 24, 6, 13, 31, 8, 11, 4, 20, 15];
|
|
1084
|
+
let state = seed;
|
|
1085
|
+
const next = (n) => {
|
|
1086
|
+
state = (state * 1103515245 + 12345) % 2147483648;
|
|
1087
|
+
return state % n;
|
|
1088
|
+
};
|
|
1089
|
+
const out = [];
|
|
1090
|
+
let count2 = 0;
|
|
1091
|
+
let i = 0;
|
|
1092
|
+
while (count2 < words) {
|
|
1093
|
+
const length = uniform ?? shape[i % shape.length];
|
|
1094
|
+
const s = [];
|
|
1095
|
+
for (let w = 0; w < length; w += 1) s.push(FILLER_WORDS[next(FILLER_WORDS.length)]);
|
|
1096
|
+
if (contractions && i % 6 === 2) s.splice(1, 0, "we're");
|
|
1097
|
+
s[0] = s[0].charAt(0).toUpperCase() + s[0].slice(1);
|
|
1098
|
+
out.push(`${s.join(" ")}.`);
|
|
1099
|
+
count2 += s.length;
|
|
1100
|
+
i += 1;
|
|
1101
|
+
}
|
|
1102
|
+
const paragraphs = [];
|
|
1103
|
+
for (let p = 0; p < out.length; p += 4) paragraphs.push(out.slice(p, p + 4).join(" "));
|
|
1104
|
+
return paragraphs.join("\n\n");
|
|
1105
|
+
}
|
|
1106
|
+
var f2 = (path, text) => ({ path, text });
|
|
1107
|
+
var doc = (extra, seed = 1) => `${filler(520, seed)}
|
|
1108
|
+
|
|
1109
|
+
${extra}
|
|
1110
|
+
`;
|
|
1111
|
+
var times = (n, sentence) => Array.from({ length: n }, (_, i) => sentence(i)).join(" ");
|
|
1112
|
+
var DENSITY_TELLS = [
|
|
1113
|
+
{
|
|
1114
|
+
id: "phrase-density",
|
|
1115
|
+
name: "Leaned-on phrase",
|
|
1116
|
+
generation: 2,
|
|
1117
|
+
severity: "warn",
|
|
1118
|
+
surface: "copy",
|
|
1119
|
+
why: "'Rather than', 'actually', 'That is...' openers, participle triads: each is ordinary English once, and a document that uses one far above its rate has one move and repeats it.",
|
|
1120
|
+
fix: "Keep the instances that land hardest and vary or cut the rest. Never delete every one: the count is the problem, not the phrase.",
|
|
1121
|
+
detect: rateHits,
|
|
1122
|
+
fixtures: {
|
|
1123
|
+
flag: [
|
|
1124
|
+
f2("content/proposal.md", doc(times(6, (i) => `We fitted boiler ${i} rather than patching it.`))),
|
|
1125
|
+
f2("content/proposal.md", doc(times(6, (i) => `We sealed roof ${i} instead of patching it.`))),
|
|
1126
|
+
f2("content/proposal.md", doc(times(4, (i) => `Room ${i} actually needed a new valve.`))),
|
|
1127
|
+
f2("content/proposal.md", doc(times(5, (i) => `Gate ${i} was properly hung.`))),
|
|
1128
|
+
f2("content/proposal.md", doc(times(3, (i) => `Kitchen ${i} was genuinely tidy.`))),
|
|
1129
|
+
f2("content/proposal.md", doc(times(3, (i) => `Pipe ${i} is the single biggest risk.`))),
|
|
1130
|
+
f2("content/proposal.md", doc(times(6, (i) => `That is why tap ${i} leaks.`))),
|
|
1131
|
+
f2("content/proposal.md", doc(times(6, (i) => `Every tap ${i} gets checked.`))),
|
|
1132
|
+
f2("content/proposal.md", doc(times(5, (i) => `Worth noting: valve ${i} sticks.`))),
|
|
1133
|
+
f2("content/proposal.md", doc(times(7, (i) => `None of room ${i} needed paint.`))),
|
|
1134
|
+
f2("content/proposal.md", doc(times(5, (i) => `Wall ${i} was measured, sanded and sealed.`))),
|
|
1135
|
+
f2("site/index.html", `<html><body><p>${filler(520, 3)}</p><p>${times(6, (i) => `We fitted boiler ${i} rather than patching it.`)}</p></body></html>`)
|
|
1136
|
+
],
|
|
1137
|
+
pass: [
|
|
1138
|
+
f2("content/proposal.md", doc(times(3, (i) => `We fitted boiler ${i} rather than patching it.`))),
|
|
1139
|
+
f2("content/short.md", times(6, (i) => `We fitted boiler ${i} rather than patching it.`)),
|
|
1140
|
+
f2("app/page.tsx", `export const copy = [${Array.from({ length: 40 }, (_, i) => `"We fitted boiler ${i} rather than patching it."`).join(", ")}];`)
|
|
1141
|
+
]
|
|
1142
|
+
}
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
id: "aphorism-density",
|
|
1146
|
+
name: "Aphorism cadence",
|
|
1147
|
+
generation: 2,
|
|
1148
|
+
severity: "warn",
|
|
1149
|
+
surface: "copy",
|
|
1150
|
+
why: "Two clipped sentences alone on a line ('All of this already exists. The job is making it findable.') land once. Closing every section, they are a cadence a reader learns to hear.",
|
|
1151
|
+
fix: "Keep the strongest one. Fold the rest into the paragraph above as plain statements.",
|
|
1152
|
+
detect: aphorismHits,
|
|
1153
|
+
fixtures: {
|
|
1154
|
+
flag: [f2("content/proposal.md", doc(Array.from({ length: 7 }, (_, i) => `The site exists. Job ${i} makes it findable.`).join("\n\n")))],
|
|
1155
|
+
pass: [f2("content/proposal.md", doc(Array.from({ length: 3 }, (_, i) => `The site exists. Job ${i} makes it findable.`).join("\n\n")))]
|
|
1156
|
+
}
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
id: "contraction-scarcity",
|
|
1160
|
+
name: "No contractions",
|
|
1161
|
+
generation: 1,
|
|
1162
|
+
severity: "warn",
|
|
1163
|
+
surface: "copy",
|
|
1164
|
+
why: "A long document with almost no contractions reads stiff and machine-made. People write 'we're' and 'don't'.",
|
|
1165
|
+
fix: "Contract where you would in speech: 'we are' to 'we're', 'do not' to 'don't'. Formal legal pages are the deliberate exception.",
|
|
1166
|
+
detect: contractionHits,
|
|
1167
|
+
fixtures: {
|
|
1168
|
+
flag: [f2("content/proposal.md", filler(900, 5, { contractions: false }))],
|
|
1169
|
+
pass: [f2("content/proposal.md", filler(900, 5)), f2("content/short.md", filler(500, 5, { contractions: false }))]
|
|
1170
|
+
}
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
id: "sentence-rhythm",
|
|
1174
|
+
name: "Metronomic rhythm",
|
|
1175
|
+
generation: 2,
|
|
1176
|
+
severity: "warn",
|
|
1177
|
+
surface: "copy",
|
|
1178
|
+
why: "Sentence after sentence of the same length reads generated. A person's sentences run long, then short, then long again.",
|
|
1179
|
+
fix: "Break one long sentence in two, join two short ones, and let some sentences be flat and plain.",
|
|
1180
|
+
detect: rhythmHits,
|
|
1181
|
+
fixtures: {
|
|
1182
|
+
flag: [f2("content/proposal.md", filler(600, 7, { uniform: 12 }))],
|
|
1183
|
+
pass: [f2("content/proposal.md", filler(600, 7))]
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
id: "repeated-sentence",
|
|
1188
|
+
name: "Repeated sentence",
|
|
1189
|
+
generation: 1,
|
|
1190
|
+
severity: "warn",
|
|
1191
|
+
surface: "copy",
|
|
1192
|
+
why: "The same sentence on two pages, or the same nine words lightly edited, is one of the strongest signs a document was assembled rather than written.",
|
|
1193
|
+
fix: "Say it once, where it matters most, and write the second place fresh.",
|
|
1194
|
+
detect: repeatHits,
|
|
1195
|
+
fixtures: {
|
|
1196
|
+
flag: [
|
|
1197
|
+
f2("content/proposal.md", doc("We check every valve before the engineer leaves the house.\n\nMore here.\n\nWe check every valve before the engineer leaves the house.")),
|
|
1198
|
+
f2("content/proposal.md", doc("We check every valve before the engineer leaves the house.\n\nBy then we check every valve before the engineer leaves the site."))
|
|
1199
|
+
],
|
|
1200
|
+
pass: [f2("content/proposal.md", doc("We check every valve before the engineer leaves the house.\n\nThe engineer leaves once the customer has signed the sheet."))]
|
|
1201
|
+
}
|
|
1202
|
+
},
|
|
1203
|
+
{
|
|
1204
|
+
id: "heading-shape",
|
|
1205
|
+
name: "One heading shape",
|
|
1206
|
+
generation: 2,
|
|
1207
|
+
severity: "warn",
|
|
1208
|
+
surface: "copy",
|
|
1209
|
+
why: "Headings that all share one shape ('X, and Y', 'X, because Y', 'Keep, rewrite, consolidate, retire') read as a template filled in section by section.",
|
|
1210
|
+
fix: "Write each heading for its section. Most should be a plain noun phrase.",
|
|
1211
|
+
detect: headingShapeHits,
|
|
1212
|
+
fixtures: {
|
|
1213
|
+
flag: [
|
|
1214
|
+
f2("content/proposal.md", ["## Fast, and fairly priced", "## Local, and insured", "## Tidy, and quiet", "## Early, and on time", "", filler(520, 9)].join("\n\n")),
|
|
1215
|
+
f2("site/index.html", `<h2>Fast, because we care</h2><h2>Tidy, because it matters</h2><h2>Early, because you asked</h2><h2>Quiet, because neighbours</h2><p>${filler(520, 9)}</p>`),
|
|
1216
|
+
f2("content/proposal.md", ["## Keep, rewrite, retire", "## Fix, paint, seal", "## Book, quote, fit", "## Plan, build, check", "", filler(520, 9)].join("\n\n"))
|
|
1217
|
+
],
|
|
1218
|
+
pass: [f2("content/proposal.md", ["## Pricing", "## Fast, and fairly priced", "## Who we are", "## Areas we cover", "", filler(520, 9)].join("\n\n"))]
|
|
1219
|
+
}
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
id: "heading-echo",
|
|
1223
|
+
name: "Heading echoed",
|
|
1224
|
+
generation: 2,
|
|
1225
|
+
severity: "warn",
|
|
1226
|
+
surface: "copy",
|
|
1227
|
+
why: "A heading repeated word for word as the first line under it spends the reader's attention twice on the same words.",
|
|
1228
|
+
fix: "Let the first sentence say something the heading did not.",
|
|
1229
|
+
detect: headingEchoHits,
|
|
1230
|
+
fixtures: {
|
|
1231
|
+
flag: [
|
|
1232
|
+
f2("content/proposal.md", `## We fix boilers the same day
|
|
1233
|
+
|
|
1234
|
+
We fix boilers the same day across Brackley.
|
|
1235
|
+
|
|
1236
|
+
${filler(520, 11)}`),
|
|
1237
|
+
f2("site/index.html", `<h2>We fix boilers the same day</h2>
|
|
1238
|
+
<p>We fix boilers the same day across Brackley.</p><p>${filler(520, 11)}</p>`)
|
|
1239
|
+
],
|
|
1240
|
+
pass: [f2("content/proposal.md", `## We fix boilers the same day
|
|
1241
|
+
|
|
1242
|
+
Call before noon and an engineer is with you by six.
|
|
1243
|
+
|
|
1244
|
+
${filler(520, 11)}`)]
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
];
|
|
522
1248
|
|
|
523
1249
|
// src/color/oklch.ts
|
|
524
1250
|
var clamp01 = (n) => n < 0 ? 0 : n > 1 ? 1 : n;
|
|
@@ -582,8 +1308,8 @@ function parts(fn) {
|
|
|
582
1308
|
function hslToRgb(h, s, l) {
|
|
583
1309
|
const k = (n) => (n + h / 30) % 12;
|
|
584
1310
|
const a = s * Math.min(l, 1 - l);
|
|
585
|
-
const
|
|
586
|
-
return { r:
|
|
1311
|
+
const f4 = (n) => l - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
|
|
1312
|
+
return { r: f4(0), g: f4(8), b: f4(4) };
|
|
587
1313
|
}
|
|
588
1314
|
var clamp012 = (n) => Math.min(1, Math.max(0, n));
|
|
589
1315
|
function parseColour(raw) {
|
|
@@ -695,7 +1421,7 @@ function firstMatch(text, pattern) {
|
|
|
695
1421
|
return m ? m.index : -1;
|
|
696
1422
|
}
|
|
697
1423
|
var FRAMEWORK_PALETTE = /^--(?:color-)?(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-\d+$|^--tw-/;
|
|
698
|
-
var
|
|
1424
|
+
var f3 = (path, text) => ({ path, text });
|
|
699
1425
|
function familyNames(value) {
|
|
700
1426
|
return value.split(",").map((v) => v.trim().replace(/^["']|["']$/g, "").trim()).filter(Boolean);
|
|
701
1427
|
}
|
|
@@ -1160,14 +1886,14 @@ var SOURCE_TELLS = [
|
|
|
1160
1886
|
detect: fontTell(REFLEX_FONTS_1),
|
|
1161
1887
|
fixtures: {
|
|
1162
1888
|
flag: [
|
|
1163
|
-
|
|
1889
|
+
f3("app/layout.tsx", `import { Inter } from "next/font/google";
|
|
1164
1890
|
const inter = Inter({ subsets: ["latin"] });`),
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1891
|
+
f3("index.html", `<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600" rel="stylesheet">`),
|
|
1892
|
+
f3("tailwind.config.js", `fontFamily: { sans: ["Roboto", "sans-serif"] }`),
|
|
1893
|
+
f3("main.ts", `import "@fontsource/montserrat";`),
|
|
1894
|
+
f3("components/A.tsx", `<p className="font-['Open_Sans']">x</p>`)
|
|
1169
1895
|
],
|
|
1170
|
-
pass: [
|
|
1896
|
+
pass: [f3("app/layout.tsx", `import { Bricolage_Grotesque } from "next/font/google";`)]
|
|
1171
1897
|
}
|
|
1172
1898
|
},
|
|
1173
1899
|
{
|
|
@@ -1180,10 +1906,10 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1180
1906
|
fix: "Pick the display face from the client's world (signage, packaging, the trade's lettering) and record why in art-direction.json. If this face really is the right one, declare an exception with the reason and the evidence.",
|
|
1181
1907
|
detect: fontTell(REFLEX_FONTS_2),
|
|
1182
1908
|
fixtures: {
|
|
1183
|
-
flag: [
|
|
1909
|
+
flag: [f3("src/styles.css", `@theme {
|
|
1184
1910
|
--font-sans: "DM Sans", system-ui, sans-serif;
|
|
1185
1911
|
}`)],
|
|
1186
|
-
pass: [
|
|
1912
|
+
pass: [f3("src/styles.css", `@theme {
|
|
1187
1913
|
--font-sans: "Hanken Grotesk", system-ui, sans-serif;
|
|
1188
1914
|
}`)]
|
|
1189
1915
|
}
|
|
@@ -1199,10 +1925,10 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1199
1925
|
detect: violetHits,
|
|
1200
1926
|
fixtures: {
|
|
1201
1927
|
flag: [
|
|
1202
|
-
|
|
1203
|
-
|
|
1928
|
+
f3("components/Hero.tsx", `<a className="rounded-md bg-indigo-600 px-4 py-2 text-white">Book</a>`),
|
|
1929
|
+
f3("app/globals.css", `:root { --accent: #5a35d1; }`)
|
|
1204
1930
|
],
|
|
1205
|
-
pass: [
|
|
1931
|
+
pass: [f3("components/Hero.tsx", `<a className="rounded-md bg-emerald-700 px-4 py-2 text-white">Book</a>`)]
|
|
1206
1932
|
}
|
|
1207
1933
|
},
|
|
1208
1934
|
{
|
|
@@ -1216,10 +1942,10 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1216
1942
|
detect: gradientHits,
|
|
1217
1943
|
fixtures: {
|
|
1218
1944
|
flag: [
|
|
1219
|
-
|
|
1220
|
-
|
|
1945
|
+
f3("components/Hero.tsx", `<section className="bg-gradient-to-r from-blue-600 to-purple-600">`),
|
|
1946
|
+
f3("app/globals.css", `.hero { background: linear-gradient(135deg, #2563eb, #9333ea); }`)
|
|
1221
1947
|
],
|
|
1222
|
-
pass: [
|
|
1948
|
+
pass: [f3("components/Hero.tsx", `<section className="bg-gradient-to-b from-stone-100 to-stone-200">`)]
|
|
1223
1949
|
}
|
|
1224
1950
|
},
|
|
1225
1951
|
{
|
|
@@ -1233,10 +1959,10 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1233
1959
|
detect: gradientTextHits,
|
|
1234
1960
|
fixtures: {
|
|
1235
1961
|
flag: [
|
|
1236
|
-
|
|
1237
|
-
|
|
1962
|
+
f3("components/Hero.tsx", `<h1 className="bg-gradient-to-r from-rose-500 to-amber-500 bg-clip-text text-transparent">`),
|
|
1963
|
+
f3("app/globals.css", `.headline { -webkit-background-clip: text; color: transparent; }`)
|
|
1238
1964
|
],
|
|
1239
|
-
pass: [
|
|
1965
|
+
pass: [f3("components/Hero.tsx", `<h1 className="font-display text-5xl text-ink">`)]
|
|
1240
1966
|
}
|
|
1241
1967
|
},
|
|
1242
1968
|
{
|
|
@@ -1250,10 +1976,10 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1250
1976
|
detect: glassHits,
|
|
1251
1977
|
fixtures: {
|
|
1252
1978
|
flag: [
|
|
1253
|
-
|
|
1254
|
-
|
|
1979
|
+
f3("components/Hero.tsx", `<div className="rounded-2xl bg-white/10 p-8 backdrop-blur-md">`),
|
|
1980
|
+
f3("app/globals.css", `.card { background: rgb(255 255 255 / .1); backdrop-filter: blur(12px); }`)
|
|
1255
1981
|
],
|
|
1256
|
-
pass: [
|
|
1982
|
+
pass: [f3("components/Hero.tsx", `<div className="rounded-sm bg-paper p-8">`)]
|
|
1257
1983
|
}
|
|
1258
1984
|
},
|
|
1259
1985
|
{
|
|
@@ -1266,10 +1992,10 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1266
1992
|
fix: "Follow the hero with the thing only this business has: the work, the place, the person. Put proof where a doubt arises.",
|
|
1267
1993
|
detect: heroThenProofHits,
|
|
1268
1994
|
fixtures: {
|
|
1269
|
-
flag: [
|
|
1995
|
+
flag: [f3("app/page.tsx", `export default function Page() {
|
|
1270
1996
|
return (<main><Hero /><TrustStrip /><Services /></main>);
|
|
1271
1997
|
}`)],
|
|
1272
|
-
pass: [
|
|
1998
|
+
pass: [f3("app/page.tsx", `export default function Page() {
|
|
1273
1999
|
return (<main><Hero /><Workshop /><TrustStrip /></main>);
|
|
1274
2000
|
}`)]
|
|
1275
2001
|
}
|
|
@@ -1285,7 +2011,7 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1285
2011
|
detect: iconGridHits,
|
|
1286
2012
|
fixtures: {
|
|
1287
2013
|
flag: [
|
|
1288
|
-
|
|
2014
|
+
f3(
|
|
1289
2015
|
"components/Features.tsx",
|
|
1290
2016
|
`import { Heart } from "lucide-react";
|
|
1291
2017
|
<div className="grid grid-cols-1 gap-6 md:grid-cols-3">
|
|
@@ -1293,7 +2019,7 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1293
2019
|
</div>`
|
|
1294
2020
|
)
|
|
1295
2021
|
],
|
|
1296
|
-
pass: [
|
|
2022
|
+
pass: [f3("components/Features.tsx", `<ul className="divide-y">
|
|
1297
2023
|
<li className="flex justify-between py-3">Gel manicure <span>\xA332</span></li>
|
|
1298
2024
|
</ul>`)]
|
|
1299
2025
|
}
|
|
@@ -1308,8 +2034,8 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1308
2034
|
fix: `Keep one gated signature moment per page (STANDARD section 7) and let the rest arrive still. The limit here is ${REVEAL_LIMIT} per scan.`,
|
|
1309
2035
|
detect: revealHits,
|
|
1310
2036
|
fixtures: {
|
|
1311
|
-
flag: [
|
|
1312
|
-
pass: [
|
|
2037
|
+
flag: [f3("app/page.tsx", Array.from({ length: REVEAL_LIMIT + 1 }, (_, i) => `<Reveal><Block n={${i}} /></Reveal>`).join("\n"))],
|
|
2038
|
+
pass: [f3("app/page.tsx", `<Reveal><Signature /></Reveal>
|
|
1313
2039
|
<Block />
|
|
1314
2040
|
<Block />`)]
|
|
1315
2041
|
}
|
|
@@ -1324,8 +2050,8 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1324
2050
|
fix: `Choose the shape language on purpose (and record it), then use the pill only where it means something. The limit here is ${PILL_LIMIT} per scan.`,
|
|
1325
2051
|
detect: pillHits,
|
|
1326
2052
|
fixtures: {
|
|
1327
|
-
flag: [
|
|
1328
|
-
pass: [
|
|
2053
|
+
flag: [f3("components/Tags.tsx", Array.from({ length: PILL_LIMIT + 1 }, () => `<span className="rounded-full px-3">tag</span>`).join("\n"))],
|
|
2054
|
+
pass: [f3("components/Tags.tsx", `<span className="rounded-full px-3">tag</span>
|
|
1329
2055
|
<a className="rounded-sm px-4">Book</a>`)]
|
|
1330
2056
|
}
|
|
1331
2057
|
},
|
|
@@ -1339,8 +2065,8 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1339
2065
|
fix: "Delete the primitives nothing imports. Restyle the ones that stay so they belong to this site.",
|
|
1340
2066
|
detect: shadcnHits,
|
|
1341
2067
|
fixtures: {
|
|
1342
|
-
flag: [SHADCN_PRIMITIVES.slice(0, SHADCN_LIMIT).map((name) =>
|
|
1343
|
-
pass: [
|
|
2068
|
+
flag: [SHADCN_PRIMITIVES.slice(0, SHADCN_LIMIT).map((name) => f3(`src/components/ui/${name}.tsx`, `export function X() { return null; }`))],
|
|
2069
|
+
pass: [f3("src/components/ui/button.tsx", `export function Button() { return null; }`)]
|
|
1344
2070
|
}
|
|
1345
2071
|
},
|
|
1346
2072
|
{
|
|
@@ -1354,11 +2080,11 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1354
2080
|
detect: creamHits,
|
|
1355
2081
|
fixtures: {
|
|
1356
2082
|
flag: [
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
2083
|
+
f3("app/globals.css", `body { background-color: #f5efe6; }`),
|
|
2084
|
+
f3("app/page.tsx", `<main className="bg-cream text-ink">`),
|
|
2085
|
+
f3("app/page.tsx", `<main className="bg-[#f7f1e8]">`)
|
|
1360
2086
|
],
|
|
1361
|
-
pass: [
|
|
2087
|
+
pass: [f3("app/globals.css", `body { background-color: #ffffff; }`)]
|
|
1362
2088
|
}
|
|
1363
2089
|
},
|
|
1364
2090
|
{
|
|
@@ -1372,11 +2098,11 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1372
2098
|
detect: italicSerifHits,
|
|
1373
2099
|
fixtures: {
|
|
1374
2100
|
flag: [
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
2101
|
+
f3("components/Hero.tsx", `<h1 className="font-display text-6xl">Nails, <em>reimagined</em></h1>`),
|
|
2102
|
+
f3("components/Hero.tsx", `<span className="font-serif italic">reimagined</span>`),
|
|
2103
|
+
f3("app/globals.css", `.hero h1 { font-style: italic; }`)
|
|
1378
2104
|
],
|
|
1379
|
-
pass: [
|
|
2105
|
+
pass: [f3("components/Hero.tsx", `<h1 className="font-display text-6xl">Nails in Brackley</h1>
|
|
1380
2106
|
<p><em>Walk-ins</em> welcome.</p>`)]
|
|
1381
2107
|
}
|
|
1382
2108
|
},
|
|
@@ -1391,12 +2117,12 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1391
2117
|
detect: eyebrowChipHits,
|
|
1392
2118
|
fixtures: {
|
|
1393
2119
|
flag: [
|
|
1394
|
-
|
|
2120
|
+
f3("components/Hero.tsx", `<span className="inline-flex rounded-full border px-3 py-1 text-xs">Now booking</span>
|
|
1395
2121
|
<h1>Nails in Brackley</h1>`),
|
|
1396
|
-
|
|
2122
|
+
f3("components/Hero.tsx", `<span className={cn("rounded-full px-3 text-xs", "bg-rose-500/10")}>New</span>
|
|
1397
2123
|
<h1>Nails</h1>`)
|
|
1398
2124
|
],
|
|
1399
|
-
pass: [
|
|
2125
|
+
pass: [f3("components/Hero.tsx", `<h1>Nails in Brackley</h1>
|
|
1400
2126
|
<span className="inline-flex rounded-full border px-3 py-1 text-xs">Tag</span>`)]
|
|
1401
2127
|
}
|
|
1402
2128
|
},
|
|
@@ -1410,9 +2136,9 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1410
2136
|
fix: "Use the client's own marks, photography or numerals. If an icon earns its place, set it inline with the text.",
|
|
1411
2137
|
detect: iconTileStackHits,
|
|
1412
2138
|
fixtures: {
|
|
1413
|
-
flag: [
|
|
2139
|
+
flag: [f3("components/Card.tsx", `import { Sparkles } from "lucide-react";
|
|
1414
2140
|
<div className="flex size-10 items-center justify-center rounded-lg bg-violet-100"><Sparkles /></div>`)],
|
|
1415
|
-
pass: [
|
|
2141
|
+
pass: [f3("components/Card.tsx", `import { Sparkles } from "lucide-react";
|
|
1416
2142
|
<p className="flex items-center gap-2"><Sparkles className="size-4" />Aftercare</p>`)]
|
|
1417
2143
|
}
|
|
1418
2144
|
},
|
|
@@ -1426,8 +2152,8 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1426
2152
|
fix: "Lay content out by what it is. If one item matters most, give it the page, not a double-width tile.",
|
|
1427
2153
|
detect: bentoHits,
|
|
1428
2154
|
fixtures: {
|
|
1429
|
-
flag: [
|
|
1430
|
-
pass: [
|
|
2155
|
+
flag: [f3("components/Features.tsx", `<div className="grid grid-cols-3"><div className="md:col-span-2 md:row-span-2" /><div /></div>`)],
|
|
2156
|
+
pass: [f3("components/Features.tsx", `<div className="grid grid-cols-3"><div className="col-span-2" /><div /></div>`)]
|
|
1431
2157
|
}
|
|
1432
2158
|
},
|
|
1433
2159
|
{
|
|
@@ -1441,10 +2167,10 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1441
2167
|
detect: glowHits,
|
|
1442
2168
|
fixtures: {
|
|
1443
2169
|
flag: [
|
|
1444
|
-
|
|
1445
|
-
|
|
2170
|
+
f3("components/Hero.tsx", `<div className="absolute -top-20 left-1/2 h-96 w-96 rounded-full bg-rose-400/30 blur-3xl" />`),
|
|
2171
|
+
f3("app/globals.css", `.hero { background: radial-gradient(circle at top, rgb(244 63 94 / .25), transparent 60%); }`)
|
|
1446
2172
|
],
|
|
1447
|
-
pass: [
|
|
2173
|
+
pass: [f3("components/Hero.tsx", `<div className="absolute inset-0 bg-black/40" />`)]
|
|
1448
2174
|
}
|
|
1449
2175
|
},
|
|
1450
2176
|
{
|
|
@@ -1458,13 +2184,13 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1458
2184
|
detect: gridBackgroundHits,
|
|
1459
2185
|
fixtures: {
|
|
1460
2186
|
flag: [
|
|
1461
|
-
|
|
2187
|
+
f3(
|
|
1462
2188
|
"app/globals.css",
|
|
1463
2189
|
`.hero { background-image: linear-gradient(to right, #e5e5e5 1px, transparent 1px), linear-gradient(to bottom, #e5e5e5 1px, transparent 1px); background-size: 24px 24px; }`
|
|
1464
2190
|
),
|
|
1465
|
-
|
|
2191
|
+
f3("components/Hero.tsx", `<div className="absolute inset-0 bg-[linear-gradient(to_right,#8882_1px,transparent_1px)] bg-[size:24px_24px]" />`)
|
|
1466
2192
|
],
|
|
1467
|
-
pass: [
|
|
2193
|
+
pass: [f3("app/globals.css", `.hero { background-image: url(/shopfront.avif); }`)]
|
|
1468
2194
|
}
|
|
1469
2195
|
},
|
|
1470
2196
|
{
|
|
@@ -1478,10 +2204,10 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1478
2204
|
detect: marqueeHits,
|
|
1479
2205
|
fixtures: {
|
|
1480
2206
|
flag: [
|
|
1481
|
-
|
|
1482
|
-
|
|
2207
|
+
f3("app/globals.css", `@keyframes marquee { from { transform: translateX(0) } to { transform: translateX(-50%) } }`),
|
|
2208
|
+
f3("components/Logos.tsx", `import Marquee from "react-fast-marquee";`)
|
|
1483
2209
|
],
|
|
1484
|
-
pass: [
|
|
2210
|
+
pass: [f3("app/globals.css", `@keyframes fade { from { opacity: 0 } to { opacity: 1 } }`)]
|
|
1485
2211
|
}
|
|
1486
2212
|
},
|
|
1487
2213
|
{
|
|
@@ -1495,10 +2221,10 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1495
2221
|
detect: thinBorderWideShadowHits,
|
|
1496
2222
|
fixtures: {
|
|
1497
2223
|
flag: [
|
|
1498
|
-
|
|
1499
|
-
|
|
2224
|
+
f3("components/Card.tsx", `<div className="rounded-2xl border border-black/5 bg-white shadow-2xl">`),
|
|
2225
|
+
f3("app/globals.css", `.card { border: 1px solid rgb(0 0 0 / .06); box-shadow: 0 20px 48px rgb(0 0 0 / .08); }`)
|
|
1500
2226
|
],
|
|
1501
|
-
pass: [
|
|
2227
|
+
pass: [f3("components/Card.tsx", `<div className="rounded-sm border border-ink bg-white">`)]
|
|
1502
2228
|
}
|
|
1503
2229
|
},
|
|
1504
2230
|
{
|
|
@@ -1512,15 +2238,61 @@ const inter = Inter({ subsets: ["latin"] });`),
|
|
|
1512
2238
|
detect: introHits,
|
|
1513
2239
|
fixtures: {
|
|
1514
2240
|
flag: [
|
|
1515
|
-
|
|
2241
|
+
f3("components/IntroCinematic.tsx", `const seen = sessionStorage.getItem("intro");
|
|
1516
2242
|
export function IntroCinematic() { return <AnimatePresence /> }`),
|
|
1517
|
-
|
|
2243
|
+
f3("app/page.tsx", `<><Preloader /><Hero /></>`)
|
|
1518
2244
|
],
|
|
1519
|
-
pass: [
|
|
2245
|
+
pass: [f3("components/Introduction.md", `An introduction to the studio.`)]
|
|
1520
2246
|
}
|
|
1521
2247
|
}
|
|
1522
2248
|
];
|
|
1523
2249
|
|
|
2250
|
+
// src/character/house.ts
|
|
2251
|
+
var HOUSE = {
|
|
2252
|
+
"em-dash": { tier: "block", label: "em dash, use a full stop or a comma" },
|
|
2253
|
+
emoji: { tier: "block", label: "emoji" },
|
|
2254
|
+
"not-just-but": { tier: "block", label: "contrastive negation. The template is the tell, not the sentiment. Say the positive claim" },
|
|
2255
|
+
"no-x-no-y": {
|
|
2256
|
+
tier: "block",
|
|
2257
|
+
label: '"No X, no Y" list. Defining the brand by what it is not, itemised, is the same template as contrastive negation'
|
|
2258
|
+
},
|
|
2259
|
+
"no-x-badge": { tier: "block", label: 'standalone "No X" badge. Reads as a slapped-on kicker, and worse when reused across pieces' },
|
|
2260
|
+
"ai-phrase": { tier: "block", label: "AI tell" },
|
|
2261
|
+
"plainer-word": { tier: "block", label: "a plainer word exists. Name the mechanism instead" },
|
|
2262
|
+
"plain-english": { tier: "block", label: 'use "properly explained"' },
|
|
2263
|
+
buzzword: { tier: "block", label: "forbidden phrase" },
|
|
2264
|
+
"negative-reassurance": { tier: "block", label: "negative reassurance, say what they get" },
|
|
2265
|
+
"review-phrase": { tier: "review", label: "review tier" },
|
|
2266
|
+
"ai-vocabulary": { tier: "review", label: "AI vocabulary" },
|
|
2267
|
+
"stock-phrase": { tier: "review", label: "stock phrase" },
|
|
2268
|
+
"hollow-imperative": { tier: "review", label: "hollow imperative" },
|
|
2269
|
+
"rhetorical-opener": { tier: "review", label: "rhetorical question opener" },
|
|
2270
|
+
"staccato-triplet": { tier: "review", label: "staccato triplet" },
|
|
2271
|
+
"where-x-meets-y": { tier: "review", label: "'where X meets Y'" },
|
|
2272
|
+
"ing-tail": { tier: "review", label: "empty -ing tail" },
|
|
2273
|
+
"vague-attribution": { tier: "review", label: "unnamed source" },
|
|
2274
|
+
"closing-summary": { tier: "review", label: "closing summary" },
|
|
2275
|
+
"false-range": { tier: "review", label: "false range" },
|
|
2276
|
+
// The first candidate for block: evidence of a pasted chat reply, not a
|
|
2277
|
+
// matter of style. Blocks once its estate hits have been read (ROADMAP.md).
|
|
2278
|
+
"chatbot-residue": { tier: "review", label: "chatbot residue" },
|
|
2279
|
+
"placeholder": { tier: "review", label: "unfilled placeholder" },
|
|
2280
|
+
"question-reveal": { tier: "review", label: "staged reveal" },
|
|
2281
|
+
"inline-label-list": { tier: "review", label: "bold-label bullets" },
|
|
2282
|
+
"phrase-density": { tier: "review", label: "density" },
|
|
2283
|
+
"aphorism-density": { tier: "review", label: "density" },
|
|
2284
|
+
"contraction-scarcity": { tier: "review", label: "density" },
|
|
2285
|
+
"sentence-rhythm": { tier: "review", label: "density" },
|
|
2286
|
+
"repeated-sentence": { tier: "review", label: "repetition" },
|
|
2287
|
+
"heading-shape": { tier: "review", label: "headings" },
|
|
2288
|
+
"heading-echo": { tier: "review", label: "headings" },
|
|
2289
|
+
// Banned only "when vague", per the rules. Too noisy for a sweep.
|
|
2290
|
+
"vague-word": { tier: "explicit", label: "vague" }
|
|
2291
|
+
};
|
|
2292
|
+
function houseRule(id, name = id) {
|
|
2293
|
+
return HOUSE[id] ?? { tier: "review", label: name };
|
|
2294
|
+
}
|
|
2295
|
+
|
|
1524
2296
|
// src/character/parse.ts
|
|
1525
2297
|
function lineAt(text, offset) {
|
|
1526
2298
|
let line = 1;
|
|
@@ -1669,8 +2441,8 @@ var oklchOf = (value) => parseColour(value)?.oklch ?? null;
|
|
|
1669
2441
|
function reflexFonts(list) {
|
|
1670
2442
|
const wanted = new Map(list.map((n) => [n.toLowerCase(), n]));
|
|
1671
2443
|
return (s) => {
|
|
1672
|
-
const total = s.fonts.reduce((n,
|
|
1673
|
-
const display = s.fonts.reduce((n,
|
|
2444
|
+
const total = s.fonts.reduce((n, f4) => n + f4.chars, 0) || 1;
|
|
2445
|
+
const display = s.fonts.reduce((n, f4) => n + f4.displayChars, 0) || 1;
|
|
1674
2446
|
const hits = [];
|
|
1675
2447
|
const seen = /* @__PURE__ */ new Set();
|
|
1676
2448
|
const h1 = s.headings.find((h) => h.level === 1);
|
|
@@ -1871,8 +2643,8 @@ var RENDERED_PATHS = {
|
|
|
1871
2643
|
};
|
|
1872
2644
|
|
|
1873
2645
|
// src/character/check.ts
|
|
1874
|
-
var CATALOGUE_VERSION = "2026.09.
|
|
1875
|
-
var CATALOGUE = [...SOURCE_TELLS, ...COPY_TELLS].map(
|
|
2646
|
+
var CATALOGUE_VERSION = "2026.09.7";
|
|
2647
|
+
var CATALOGUE = [...SOURCE_TELLS, ...COPY_TELLS, ...RESEARCH_TELLS, ...DENSITY_TELLS].map(
|
|
1876
2648
|
(t) => RENDERED_PATHS[t.id] ? { ...t, rendered: RENDERED_PATHS[t.id] } : t
|
|
1877
2649
|
);
|
|
1878
2650
|
function tellById(id) {
|
|
@@ -1907,7 +2679,8 @@ function toFinding(tell, hit2, texts) {
|
|
|
1907
2679
|
line: texts.has(hit2.path) ? lineAt(text, hit2.offset) : 0,
|
|
1908
2680
|
excerpt: hit2.excerpt ?? excerptAt(text, hit2.offset),
|
|
1909
2681
|
message: hit2.message,
|
|
1910
|
-
fix: tell.fix
|
|
2682
|
+
fix: tell.fix,
|
|
2683
|
+
...tell.surface === "copy" ? { house: houseRule(tell.id, tell.name).tier } : {}
|
|
1911
2684
|
};
|
|
1912
2685
|
}
|
|
1913
2686
|
function report(tells, files, run, options) {
|
|
@@ -2086,14 +2859,14 @@ function collectInPage() {
|
|
|
2086
2859
|
t.chars += chars;
|
|
2087
2860
|
text.set(cs.color, t);
|
|
2088
2861
|
const family = firstFamily(cs.fontFamily);
|
|
2089
|
-
const
|
|
2862
|
+
const f4 = fonts.get(family) ?? { chars: 0, displayChars: 0, italicChars: 0, weights: /* @__PURE__ */ new Set() };
|
|
2090
2863
|
const size = px(cs.fontSize);
|
|
2091
2864
|
const weight = parseInt(cs.fontWeight, 10) || 400;
|
|
2092
|
-
|
|
2093
|
-
if (/^H[1-3]$/.test(el.tagName) || size >= 28)
|
|
2094
|
-
if (cs.fontStyle === "italic" || cs.fontStyle.startsWith("oblique"))
|
|
2095
|
-
|
|
2096
|
-
fonts.set(family,
|
|
2865
|
+
f4.chars += chars;
|
|
2866
|
+
if (/^H[1-3]$/.test(el.tagName) || size >= 28) f4.displayChars += chars;
|
|
2867
|
+
if (cs.fontStyle === "italic" || cs.fontStyle.startsWith("oblique")) f4.italicChars += chars;
|
|
2868
|
+
f4.weights.add(weight);
|
|
2869
|
+
fonts.set(family, f4);
|
|
2097
2870
|
sizes.add(Math.round(size));
|
|
2098
2871
|
weights.add(weight);
|
|
2099
2872
|
}
|
|
@@ -2109,7 +2882,7 @@ function collectInPage() {
|
|
|
2109
2882
|
const htmlBg = getComputedStyle(document.documentElement).backgroundColor;
|
|
2110
2883
|
const bodyBg = getComputedStyle(document.body).backgroundColor;
|
|
2111
2884
|
const ground = painted(bodyBg) ? bodyBg : painted(htmlBg) ? htmlBg : "rgb(255, 255, 255)";
|
|
2112
|
-
const
|
|
2885
|
+
const headings2 = Array.from(document.querySelectorAll("h1, h2, h3")).filter(shown).slice(0, 60).map((h) => {
|
|
2113
2886
|
const cs = style(h);
|
|
2114
2887
|
const italic = cs.fontStyle !== "normal";
|
|
2115
2888
|
const italicPart = !italic && Array.from(h.querySelectorAll("*")).some((c) => style(c).fontStyle !== "normal" && (c.textContent ?? "").trim().length > 0);
|
|
@@ -2325,8 +3098,8 @@ function collectInPage() {
|
|
|
2325
3098
|
pageHeight: document.documentElement.scrollHeight,
|
|
2326
3099
|
ground,
|
|
2327
3100
|
colours: { backgrounds: toList(bg).slice(0, 60), text: toList(text).sort((a, b) => b.chars - a.chars).slice(0, 40) },
|
|
2328
|
-
fonts: Array.from(fonts, ([family,
|
|
2329
|
-
headings,
|
|
3101
|
+
fonts: Array.from(fonts, ([family, f4]) => ({ family, chars: f4.chars, displayChars: f4.displayChars, italicChars: f4.italicChars, weights: nums(f4.weights) })).sort((a, b) => b.chars - a.chars),
|
|
3102
|
+
headings: headings2,
|
|
2330
3103
|
controls,
|
|
2331
3104
|
sections,
|
|
2332
3105
|
effects,
|