Metadata-Version: 2.4
Name: sameness
Version: 0.1.0
Summary: Do the pages of one site look like one template? Compare content skeletons, shells, fonts, palettes and copy across pages. No dependencies.
Author: Tsuruta Lab
License: MIT
Project-URL: Homepage, https://github.com/tsurutanmen/sameness
Project-URL: Issues, https://github.com/tsurutanmen/sameness/issues
Keywords: design,ai slop,template,website audit,html,consistency
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Dynamic: license-file

# sameness

Do the pages of one site look like one template?

Detectors for the AI look score one page at a time: the purple gradient, Inter, three feature cards.
But when people are asked what gives a machine-made site away, the two answers at the top are not
features. In a Reddit corpus of 3,033 on-topic comments, "screams AI" (6.4%) and "they all look the
same" (6.1%) each beat every specific feature; purple, gradients, animations and glass together add
up to about 7%. Sameness is a property of a *set* of pages. `sameness` compares the pages of one
site with each other.

```
pip install git+https://github.com/tsurutanmen/sameness
```

No dependencies. Python 3.9 or later.

## Thirty seconds

```
$ sameness tests/fixtures/clone_*.html

4 pages

sameness    1.00   mean similarity of the content skeleton across page pairs (1 = one template)
shells      1      distinct header/nav/footer structures (1 = one site)
palette     1.00   mean overlap of hex colours between pages (1 = one palette)

near-clones (content skeleton >= 90% similar):
  clone_0.html  ~  clone_1.html  ~  clone_2.html  ~  clone_3.html

same meta description on several pages:
    4 page(s)  "One platform to elevate your workflow."

headings that appear on several pages (outside header/nav/footer):
    4x  Ready?

page           words emoji grad   sym  repeated blocks
clone_0.html      36     0    0   3x3  cardx3
...
note: pages share one content skeleton; a reader will see one template with the words swapped
note: 4 pages reuse a meta description; search results will show the same sentence for each
```

Or crawl a live site, same host only, linked stylesheets included:

```
sameness --site https://example.com --max 20
```

## What it measures

| line | meaning |
|---|---|
| `sameness` | Mean similarity of the *content* skeleton (the tag sequence of the page with header, nav and footer removed) over all page pairs. 1.00 means every page is the same template. |
| `near-clones` | Groups of pages whose content skeletons are at least 90% similar. Pages of one kind (articles, product pages) are expected to share a skeleton; the question is whether pages of different kinds do too. |
| `shells` | Number of distinct header/nav/footer structures. A site has one. When it has four, the pages do not read as one place, which is the opposite failure and just as visible. |
| `font sets`, `palette` | Fonts declared and hex colours used, per page and their overlap across pages. |
| `same meta description`, `same <title>` | Copy reused across pages, usually a default that was never replaced. |
| `sym` | Perfectly symmetric blocks on a page: `3x3` means three lists of exactly three items. |
| `--pairs` | The full pairwise table: skeleton similarity, shared headings, shared repeated block classes. |

Everything comes from the markup and the stylesheet text. Nothing is rendered, so layout that only
exists after JavaScript runs is not seen.

## Two real sites

A 15-page site of ours that had been built in four sittings. No page-level detector complained; the
Tell Score was A or B on every page. `sameness` reported:

```
sameness    0.26
shells      8      distinct header/nav/footer structures (1 = one site)
palette     0.26
font sets:  5
note: 8 different shells on one site: the pages do not read as one place
```

That was the finding a reader had already made ("it looks like four different sites"), now as a
number. The other direction, a small research site with one shell:

```
sameness    0.51
shells      1
palette     1.00
near-clones: the six research notes share one article skeleton
same meta description on several pages:  2 page(s)  "aaaaaaaaaaaaaa"
```

The near-clones are articles and are supposed to look alike. The placeholder description was real
and had been missed.

## Python

```python
import sameness

pages = [sameness.extract(html, name=url) for url, html in docs]
rep = sameness.compare(pages)
print(rep)
rep.to_dict()                      # everything, JSON-serialisable

for p in rep.pairs:                # pairwise numbers
    print(p.a, p.b, p.skeleton, p.headings, p.classes)

for url, html, css in sameness.crawl("https://example.com", max_pages=20):
    ...
```

## Claude Code skill

`skill/sameness/SKILL.md` tells Claude Code to run this after building or editing more than one page
of a site, and how to read the result. Install by copying the folder:

```
cp -r skill/sameness ~/.claude/skills/sameness
```

## Related tools

Per-page detectors, which this complements rather than replaces:
[ai-design-tells](https://github.com/hankimis/ai-design-tells) (Tell Score, 27 tells),
[avoid-ai-design](https://github.com/funboy322/avoid-ai-design) (a rewrite skill),
[vibecoded-audit](https://github.com/KreshBack/vibecoded-audit) (49 tells, crawls but scores per page).
The Reddit corpus is from
[vibecoded-design-tells](https://github.com/JCarterJohnson/vibecoded-design-tells).

## License

MIT.
