agentleFS
hevangelhevangel/media-agent-skills/skills/audiobookshelf/SKILL.md

audiobookshelf

Skill4 starsChanged 21 days agoMITView on GitHub

Interact with the Audiobookshelf API to manage audiobook libraries, update metadata, scan directories, and manage authors. Use when working with Audiobookshelf server instances.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 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.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All settings are loaded from the .env file in the workspace root.

    line 12
  2. Very specific:

    Use api_client.py as starting point for new API scripts

    line 75
  3. Very specific:

    Use update_audio_metadata.py patterns for local file metadata updates

    line 76
  4. Very specific:

    Put generated scripts under $WORKSPACE_PATH/temp/

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill 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
SKILL.md

Audiobookshelf API

Configuration

All settings are loaded from the .env file in the workspace root.

AUDIOBOOKSHELF_HOST=http://localhost/audiobookshelf
AUDIOBOOKSHELF_USERNAME=your_username
AUDIOBOOKSHELF_PASSWORD=your_password

Reference

Python API Packages

Available Scripts

ScriptPurpose
api_client.pyCommon client setup patterns (async and sync)
list_libraries.pyList all libraries from the server
get_library_items.pyGet books with filtering by author/series
dump_library_to_json.pyExport all books from a library to JSON
search_authors.pySearch and manage authors
update_book_metadata.pyUpdate book metadata via PATCH API
update_audio_metadata.pyUpdate local audio file metadata using mutagen
scan_libraries.pyTrigger library rescans
scan_audiobook_directory.pyScan local directories for audiobook info

Key Patterns

Async API with aioaudiobookshelf

from aioaudiobookshelf import SessionConfiguration, get_admin_client_by_token

async with aiohttp.ClientSession() as session:
    session_config = SessionConfiguration(session=session, url=SERVER_URL, token=API_KEY)
    abs_client = await get_admin_client_by_token(session_config=session_config)
    libraries = await abs_client.get_all_libraries()

Sync API with requests

headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
response = requests.patch(url, headers=headers, json=payload, timeout=10)

Local Audio Metadata with mutagen

from mutagen.mp4 import MP4
audio = MP4(file_path)
audio.tags['\xa9ART'] = [author]
audio.save()

Instructions

  • Review code snippets in scripts/ for reusable patterns before creating new scripts
  • Use api_client.py as starting point for new API scripts
  • Use update_audio_metadata.py patterns for local file metadata updates
  • Put generated scripts under $WORKSPACE_PATH/temp/

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.