SpotifyScraper
CLAUDE.md316 starsChanged 6 months agoMITView on GitHub
Guidance for AI coding agents (and humans) working on SpotifyScraper. A Python library that extracts public Spotify data (tracks, albums, artists, playlists, shows, episodes) without the official API. v3 is a clean-room rewrite; the stable v2 line lives on the v2.x branch. This repo is maintained with the help of an automated agent (.github/workflows/claude.yml, triggered by the canary's spotify-breakage issue, currently in observe-only mode). If you are that agent, policy/agent.md is binding — read it first. The load-bearing rules: never…
In this repository5 other files it gives its agents.
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 11
Sans-io core: All Spotify intelligence — URL parsing, token extraction, request building, payload→model parsing — lives in pure, …
- Very specific: line 19
Spec-first: Every non-trivial change goes through OpenSpec: propose (/opsx:propose) → apply (/opsx:apply) → archive (/opsx:archive).
- Very specific: line 47
If you are that agent, policy/agent.md is binding — read it first.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
Guidance for AI coding agents (and humans) working on SpotifyScraper.
What this project is
A Python library that extracts public Spotify data (tracks, albums, artists, playlists, shows, episodes) without the official API. v3 is a clean-room rewrite; the stable v2 line lives on the v2.x branch.
Architecture rules (do not violate)
- Sans-io core. All Spotify intelligence — URL parsing, token extraction, request building, payload→model parsing — lives in pure, sync-agnostic functions. Only the thin client facades in
_sync/and_async/know about I/O. - One runtime dependency. Core depends on
httpxonly. New functionality that needs another package goes behind an optional extra (media,browser) with a lazy import and a helpfulImportError. - Two-tier extraction ladder. Tier 1: anonymous bearer token (bootstrapped from any embed page's
__NEXT_DATA__) → Spotify pathfinder GraphQL. Tier 2 (fallback): parse the entity's own embed page. Tier-1-only model fields are| None. GraphQL persisted-query hashes live ONLY inapi/pathfinder.py. - Typed throughout. Frozen slotted dataclasses for models,
to_dict()JSON-safe;mypy --strictmust pass; exceptions come from theerrors.pyhierarchy — never return error strings or error dicts. - Hermetic tests by default. Network tests are
@pytest.mark.liveand excluded by default. Never commit fixtures containing liveaccessToken,clientId, or cookie values — scrub them (seescripts/capture_fixtures.pyonce it exists).
Workflow
- Spec-first. Every non-trivial change goes through OpenSpec: propose (
/opsx:propose) → apply (/opsx:apply) → archive (/opsx:archive). Specs live inopenspec/. - Conventional commits are enforced by a commit-msg hook (template:
.gitmessage). - One OpenSpec change = one PR into
v3(until v3 merges tomaster).
Commands
| Command | Purpose |
uv sync | Install/refresh the dev environment |
make lint / make format | ruff check / autofix + format |
make type | mypy strict on src/ |
make test | hermetic test suite |
make cov | tests with coverage (85% floor) |
make live | live Spotify smoke tests (network) |
uv build | build wheel + sdist |
Layout
src/spotify_scraper/— the package (src layout,py.typed)tests/unit/,tests/live/,tests/fixtures/— mirrors module treeopenspec/— specs and change proposalsdocs/— MkDocs Material site (ReadTheDocs is canonical hosting)policy/— the Agent Operating Contract for autonomous maintenance
Autonomous maintenance
This repo is maintained with the help of an automated agent (.github/workflows/claude.yml,
triggered by the canary's spotify-breakage issue, currently in observe-only mode).
If you are that agent, policy/agent.md is binding — read it first. The load-bearing
rules: never print/commit/request a secret (you never need SPOTIFY_SP_DC); never edit
or weaken a gate, .github/, release, or security config; make the smallest correct
change; and the evidence standard is the bar for "done" — the specific failing test
is green again, reproducibly, the full suite still passes, and nothing else regressed.
Short of that, comment your findings and stop. See policy/promotion.md for the
autonomy ladder and the AGENT_ENABLED kill switch.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

