Skip to content

Add Cursor agent skills for SoundCloud API integration#541

Open
dpreussler wants to merge 1 commit into
masterfrom
add-cursor-agent-skills
Open

Add Cursor agent skills for SoundCloud API integration#541
dpreussler wants to merge 1 commit into
masterfrom
add-cursor-agent-skills

Conversation

@dpreussler
Copy link
Copy Markdown
Contributor

Publish focused skills for auth, discovery, and core integration rules alongside Agents.md, aligned with developer portal AI documentation.

Publish focused skills for auth, discovery, and core integration rules
alongside Agents.md, aligned with developer portal AI documentation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces structured 'Cursor Agent Skills' to facilitate AI-driven integration with the SoundCloud API, covering authentication (OAuth 2.1 with PKCE), discovery endpoints, and core integration rules like the use of URNs and cursor-based pagination. Feedback focuses on improving documentation consistency by recommending Basic Auth for token refresh flows and reinforcing the preference for cursor-based pagination over manual offsets. Additionally, it was suggested to explicitly mention the 'collection' key in response schemas to ensure agents correctly parse paginated results.

Comment on lines +38 to +43
curl -X POST "https://secure.soundcloud.com/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=refresh_token" \
--data-urlencode "refresh_token=REFRESH_TOKEN" \
--data-urlencode "client_id=CLIENT_ID" \
--data-urlencode "client_secret=CLIENT_SECRET"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the Client Credentials example and the core rules in soundcloud-api-integration/SKILL.md, consider using the Authorization: Basic header for the refresh token flow instead of passing the client secret in the request body. This follows standard OAuth 2.1 practices for confidential clients.

Suggested change
curl -X POST "https://secure.soundcloud.com/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=refresh_token" \
--data-urlencode "refresh_token=REFRESH_TOKEN" \
--data-urlencode "client_id=CLIENT_ID" \
--data-urlencode "client_secret=CLIENT_SECRET"
curl -X POST "https://secure.soundcloud.com/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Basic BASE64_CLIENT_ID_SECRET" \
--data-urlencode "grant_type=refresh_token" \
--data-urlencode "refresh_token=REFRESH_TOKEN"

Comment thread Agents.md
### Cursor-Based Paging (Preferred)
**AI Agents should prioritize cursor-based pagination over static page numbers.** * **Why:** Cursors are more resilient to real-time data changes and offer better performance for deep-scrolling large datasets.
* **Implementation:** Look for the `next_href` or `cursor` field in the API response. Use this entire URL or token for the subsequent request rather than manually incrementing an `offset
* **Implementation:** Look for the `next_href` field in the API response. Use that URL for the next request, or pass `linked_partitioning=true` with `limit` / `offset` as documented per endpoint.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The addition of "or pass linked_partitioning=true with limit / offset" is slightly confusing because the section's primary recommendation is to avoid manual offsets in favor of cursor-based paging. It is clearer to instruct the agent to use linked_partitioning=true on the initial request to obtain the next_href, and then exclusively follow that link for subsequent pages.


- `user_urn`: full URN, e.g. `soundcloud:users:948745750`
- Response: user collection; paginate via `next_href`
- Same pagination model as related tracks (`limit`, `offset`, `linked_partitioning`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To reinforce the preference for cursor-based paging, consider removing the reference to offset here. The agent should be encouraged to use linked_partitioning=true and follow the next_href provided in the response.

Suggested change
- Same pagination model as related tracks (`limit`, `offset`, `linked_partitioning`)
- Same pagination model as related tracks (limit, linked_partitioning)


1. Accept `access_token` and resource URN as parameters
2. Use `httpx` or `requests`
3. Return `(items, next_href)` tuple
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When linked_partitioning=true is active, the API returns results within a collection key in the response object. Specifying this in the function requirements will help the agent generate code that correctly extracts the results.

Suggested change
3. Return `(items, next_href)` tuple
3. Return (collection, next_href) tuple

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant