hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

Add Claude command for updating reference dev docs `/update-dev-docs`

Open juanpprieto opened this issue 3 months ago • 1 comments

WHY are these changes introduced?

Reduce manual work when updating Hydrogen API reference documentation on shopify.dev after new releases.

WHAT is this pull request doing?

Adds a Claude Code slash command /update-dev-docs that automates the documentation update process.

The command handles:

  • Version detection from packages/hydrogen/src/version.ts
  • Doc generation via npm run docs:build
  • Copying JSON files to shopify-dev repo
  • Branch creation and validation
  • PR creation with proper formatting
Process Flow
1. Detect version (e.g., 2025.7.0 → 2025-07)
2. Generate docs in hydrogen repo
3. Navigate to shopify-dev repo
4. Create version directories if needed
5. Copy generated JSON files
6. Run lint:mdx validation
7. Commit and push changes
8. Create PR with template

Example PR

https://github.com/Shopify/shopify-dev/pull/63408

HOW to test your changes?

Testing the Command

  1. Checkout this branch
  2. Make a minor change to trigger doc regeneration
  3. Run /update-dev-docs in Claude Code
  4. Verify the command:
    • Detects the correct version
    • Generates documentation
    • Creates proper branch structure
    • Runs validation
    • Creates a well-formed PR

Post-merge steps

None required.

Checklist

  • [x] I've read the Contributing Guidelines
  • [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • [x] I've added a changeset if this PR contains user-facing or noteworthy changes (N/A - tooling only)
  • [x] I've added tests to cover my changes (N/A - automation script)
  • [x] I've added or updated the documentation (command is self-documenting)

juanpprieto avatar Oct 02 '25 02:10 juanpprieto