Skip to content

Update commerce-api skill to utilize godaddy cli#1341

Merged
wcole1-godaddy merged 2 commits intomainfrom
update-ai-skill-for-cli
Apr 4, 2026
Merged

Update commerce-api skill to utilize godaddy cli#1341
wcole1-godaddy merged 2 commits intomainfrom
update-ai-skill-for-cli

Conversation

@pbennett1-godaddy
Copy link
Copy Markdown
Collaborator

Summary

Summary

Refactors the commerce-api TanStack Intent skill to focus on OAuth authentication and delegates API discovery/testing to @godaddy/cli. Previously the skill documented every subgraph endpoint, hardcoded
query/mutation counts, and included per-API GraphQL examples. This was brittle and duplicated what the CLI already provides.

What changed

Before (467 lines): Auth flow + hardcoded endpoint tables + introspection patterns + query examples for all 5 APIs (Checkout, Orders, Catalog, Taxes, Price Adjustments) + 6 common mistakes

After (299 lines): Auth flow + CLI discovery patterns + Checkout session example + 5 common mistakes

Kept

  • OAuth2 client credentials grant (/v2/oauth2/token) with full code example
  • Environments table (ote, prod)
  • Required headers (Authorization, Content-Type, x-store-id, user-agent)
  • OAuth scopes table (commerce.product:read, commerce.product:write, commerce.order:read)
  • Checkout API createCheckoutSession / updateCheckoutSession pattern
  • Token caching pattern

Replaced

  • Hardcoded subgraph endpoint tables, introspection code, query/mutation counts, per-API GraphQL examples → @godaddy/cli discovery section:
    • godaddy api list — discover domains
    • godaddy api list --domain — list endpoints with scopes
    • godaddy api describe — full schema, parameters, GraphQL operations
    • godaddy api search — keyword search
    • godaddy api call — authenticated test calls

Added

  • New common mistake: Checkout API uses a different host (checkout.commerce.api.{host}) than subgraph APIs

Removed

  • Per-API query examples (Orders, Catalog, Taxes, Price Adjustments)
  • Hardcoded query/mutation counts (11q/17m, 29q/110m, etc.)
  • GraphQL introspection code pattern
  • Subgraph URL missing storeId mistake (now handled by CLI describe output)
  • Draft order status mistake (unverified at subgraph level)

Why

The CLI's API catalog (godaddy api describe) returns full schemas, endpoint URLs, required scopes, and GraphQL operations — everything an agent needs to implement calls. Hardcoding that in the skill
meant maintaining two sources of truth that drift independently. Now the skill teaches auth (which the CLI doesn't cover — it uses interactive OAuth PKCE), and the CLI handles discovery.

Validation

  $ npx @tanstack/intent@latest validate                                                                                                                                                                  
  ✅ Validated 1 skill files — all passed                                                                                                                                                                 

All skill claims verified against live APIs:

Claim Result
Token endpoint with form params ✅ 200
Wrong token URL → error ✅ 405
Missing Bearer prefix → 401 (subgraph APIs) ✅ Confirmed
Invalid scope → invalid_scope ✅ 400
Checkout on checkout.commerce.api.{host} ✅ 200
Checkout on wrong host → fails ✅ 404
godaddy api list returns domains + endpoints ✅ Confirmed
godaddy api describe returns schemas + scopes ✅ Confirmed

Changeset

  • Changeset added (docs)

Test Plan

@pbennett1-godaddy pbennett1-godaddy self-assigned this Apr 3, 2026
@pbennett1-godaddy pbennett1-godaddy requested a review from a team as a code owner April 3, 2026 19:29
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 3, 2026

🦋 Changeset detected

Latest commit: 7dbbbb7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@godaddy/react Patch
nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wcole1-godaddy wcole1-godaddy merged commit 8d3f2c2 into main Apr 4, 2026
3 checks passed
@wcole1-godaddy wcole1-godaddy deleted the update-ai-skill-for-cli branch April 4, 2026 00:49
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.

2 participants