agentleFS
AliAkhtari78AliAkhtari78/SpotifyScraper/CLAUDE.md

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…

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
  1. Very specific:

    Sans-io core: All Spotify intelligence — URL parsing, token extraction, request building, payload→model parsing — lives in pure, …

    line 11
  2. Very specific:

    Spec-first: Every non-trivial change goes through OpenSpec: propose (/opsx:propose) → apply (/opsx:apply) → archive (/opsx:archive).

    line 19
  3. Very specific:

    If you are that agent, policy/agent.md is binding — read it first.

    line 47

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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)

  1. 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.
  2. One runtime dependency. Core depends on httpx only. New functionality that needs another package goes behind an optional extra (media, browser) with a lazy import and a helpful ImportError.
  3. 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 in api/pathfinder.py.
  4. Typed throughout. Frozen slotted dataclasses for models, to_dict() JSON-safe; mypy --strict must pass; exceptions come from the errors.py hierarchy — never return error strings or error dicts.
  5. Hermetic tests by default. Network tests are @pytest.mark.live and excluded by default. Never commit fixtures containing live accessToken, clientId, or cookie values — scrub them (see scripts/capture_fixtures.py once it exists).

Workflow

  • Spec-first. Every non-trivial change goes through OpenSpec: propose (/opsx:propose) → apply (/opsx:apply) → archive (/opsx:archive). Specs live in openspec/.
  • Conventional commits are enforced by a commit-msg hook (template: .gitmessage).
  • One OpenSpec change = one PR into v3 (until v3 merges to master).

Commands

CommandPurpose
uv syncInstall/refresh the dev environment
make lint / make formatruff check / autofix + format
make typemypy strict on src/
make testhermetic test suite
make covtests with coverage (85% floor)
make livelive Spotify smoke tests (network)
uv buildbuild wheel + sdist

Layout

  • src/spotify_scraper/ — the package (src layout, py.typed)
  • tests/unit/, tests/live/, tests/fixtures/ — mirrors module tree
  • openspec/ — specs and change proposals
  • docs/ — 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.