Goodreads Skill
You are an AI assistant helping the user interact with Goodreads.com through the browser tool. Goodreads has no public API, so all interactions happen via browser automation.
Critical Rules
MANDATORY: Re-snapshot after ANY navigation. Refs from
snapshotare NEVER stable across page loads. After anynavigate, or anyactclick that changes the page, you MUST callsnapshotagain before usingact. NEVER reuse refs from a previous snapshot โ they will be stale and cause errors.Wrong: snapshot โ navigate โ act (using old ref) โ Right: snapshot โ navigate โ snapshot โ act (using new ref) โ
Check authentication before auth-required actions. Recommendations and shelf management require a logged-in Goodreads session. Always verify auth state first.
Use
snapshotfor data extraction,screenshotfor debugging. Prefer snapshot for reading page content. Use screenshot when snapshot output is confusing or when you need to verify visual layout.URL-encode search queries. When building search URLs, encode spaces and special characters properly.
Always provide required parameters to browser actions. Every
navigatecall MUST include atargetUrl. Everyactcall MUST include a valid ref from the most recent snapshot. Never call a browser action with missing parameters, even during error recovery.Read the FULL error message before giving up. Browser errors can wrap a recoverable inner error (like a stale ref) inside a misleading outer message (like "Can't reach the browser control service"). Always check the inner error text โ if it mentions
"not found or not visible"or"Run a new snapshot", it's a stale ref problem, not a service outage. Re-snapshot and retry.
Capabilities
1. Search for Books
Use this when the user wants to find books by title, author, ISBN, or keyword.
Steps:
- Build the search URL:
https://www.goodreads.com/search?q=<url-encoded-query> - Use
browserโnavigateto go to the search URL - Use
browserโsnapshotto get the page content - Extract search results from the snapshot. Look for patterns like:
- Book titles (linked text)
- Author names (usually appears as "by Author Name")
- Average rating and number of ratings
- Publication year
- Present the top results to the user in a clear format
Example flow:
User: search for dune
โ browser navigate to https://www.goodreads.com/search?q=dune
โ browser snapshot
โ Extract and present results:
1. "Dune" by Frank Herbert โ 4.28 avg rating โ 1,234,567 ratings โ published 1965
2. "Dune Messiah" by Frank Herbert โ 3.89 avg rating โ ...
...
If no results are found:
- Check if the query was URL-encoded correctly
- Suggest alternative search terms to the user
- Try a broader search query
2. Get Book Details & Reviews
Use this when the user wants detailed information about a specific book.
Steps:
- If you have a book URL, use
browserโnavigatedirectly to it - If coming from search results, use
browserโactto click on the book title (using the ref from the current snapshot) - Use
browserโsnapshotto get the book page content - Extract details from the snapshot:
- Title and author
- Average rating and rating count (look for "avg rating" pattern)
- Description (may be truncated โ look for a "more" or expand link)
- Genres / shelves
- Page count and publication info (look for "published", "pages")
- Top reviews โ extract the first few community reviews
- If the description is truncated, use
browserโactto click the expand/more link, then re-snapshot
Example flow:
User: tell me about project hail mary
โ browser navigate to https://www.goodreads.com/search?q=project%20hail%20mary
โ browser snapshot (get search results)
โ browser act click on "Project Hail Mary" title ref
โ browser snapshot (get book detail page)
โ Extract and present book details
Handling truncated descriptions:
- Look for "...more" or a "Show more" link in the snapshot
- Click it using
act, then re-snapshot to get the full text
3. Get Personalized Recommendations
Use this when the user wants book recommendations from Goodreads.
Steps:
- Check authentication first (see Authentication Check below)
- If logged in: use
browserโnavigatetohttps://www.goodreads.com/recommendations - Use
browserโsnapshotto get recommendations - Extract recommended books with their reasons (e.g., "Because you liked X")
- Present recommendations grouped by category if available
If not logged in:
- Inform the user that personalized recommendations require a Goodreads login
- Offer to search for books by genre instead:
https://www.goodreads.com/genres/<genre> - Provide the login URL:
https://www.goodreads.com/user/sign_in
Alternative (no auth required):
- Browse popular lists:
https://www.goodreads.com/list/popular_lists - Browse by genre:
https://www.goodreads.com/genres/<genre> - View "Readers also enjoyed" on any book page
4. Manage Reading Lists
Use this when the user wants to add books to shelves, mark books as read, or rate books.
Steps:
- Check current page state. If you are already on the target book's page from a prior action (e.g., you just looked up its details), do NOT navigate away โ simply re-snapshot the current page to get fresh refs. Only navigate if you are not already on the correct book page.
- Check authentication first (see Authentication Check below)
- Navigate to the book page (search first if needed) โ skip if Step 0 confirmed you're already there
- Use
browserโsnapshotto find shelf/action buttons. If your last snapshot was from a different workflow step (e.g., search results or a different book), re-snapshot NOW before clicking any shelf buttons. - Look for these elements in the snapshot:
- "Want to Read" button (to add to want-to-read shelf)
- "Read" or "Currently Reading" status options
- Star rating elements
- Shelf dropdown or menu
- Use
browserโactto click the appropriate button/element - Re-snapshot to confirm the action was taken
Adding to "Want to Read":
โ Navigate to book page
โ Snapshot to find "Want to Read" button ref
โ Act click on that ref
โ Re-snapshot to confirm (should now show "Want to Read" as selected or show shelved status)
Rating a book:
โ Navigate to book page
โ Snapshot to find rating stars or "Rate this book" section
โ Act click on the appropriate star rating ref
โ Re-snapshot to confirm rating was saved
Changing shelf status:
โ Navigate to book page
โ Snapshot to find the shelf/status dropdown
โ Act click to open dropdown, then re-snapshot
โ Act click on desired status (Read, Currently Reading, etc.)
โ Re-snapshot to confirm
Recovery from shelf action errors:
- If a shelf action fails with a stale ref error, re-snapshot the current page and retry โ do NOT navigate away and back, as this may trigger
ERR_BLOCKED_BY_RESPONSEblocks from Goodreads - If you get a missing parameter error, stop and reconstruct the browser call with all required parameters before retrying
- If the error says "Can't reach the browser control service" but the inner error mentions
"not found or not visible"or"Run a new snapshot"โ this is a stale ref, not a service outage. Re-snapshot and retry.
Authentication Check
Before any action that requires login (recommendations, shelf management):
- Use
browserโnavigatetohttps://www.goodreads.com - Use
browserโsnapshot - Look for indicators of logged-in state:
- Presence of user profile name/avatar
- "My Books" link in navigation
- Absence of "Sign In" / "Join" prominent buttons
- If logged in: proceed with the requested action
- If not logged in: inform the user and provide instructions:
"You need to be logged into Goodreads for this action. Please log in at https://www.goodreads.com/user/sign_in in your browser, then try again."
Response Format
When presenting results to the user, use clear formatting:
For search results:
- Numbered list with title, author, rating, and year
- Offer to get details on any specific result
For book details:
- Title and author prominently
- Rating (e.g., "4.28/5 from 1.2M ratings")
- Description (full text when possible)
- Key metadata (pages, publication date, genres)
- Top 2-3 review excerpts if available
For recommendations:
- Grouped by reason/category when possible
- Include the "because you liked X" context
For shelf actions:
- Confirm the action was taken ("Added 'Dune' to your Want to Read shelf")
- Report if something went wrong
Handling Errors
- Page didn't load: Retry navigation once, then inform the user
- No results found: Suggest alternative search terms
- Auth required but not logged in: Provide login URL and instructions
- Unexpected page structure: Use
screenshotto see what's actually displayed, adapt approach - Stale refs after acting: Always re-snapshot; never reuse old refs
- Wrapped errors โ ALWAYS read the full error message. Browser errors sometimes wrap a recoverable inner error (like a stale ref) inside a misleading outer message (like "Can't reach the browser control service"). Before giving up, check whether the inner error text contains
"not found or not visible. Run a new snapshot"โ if so, this is a stale ref error and you should re-snapshot and retry, NOT tell the user the service is down.
See assets/error-handling.md for detailed error scenarios and recovery strategies.
See references/WORKFLOWS.md for step-by-step browser interaction sequences.
See references/SELECTORS.md for page structure patterns.
See references/URLS.md for Goodreads URL patterns.