hydrogen
hydrogen copied to clipboard
Add Claude command for updating reference dev docs `/update-dev-docs`
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
- Checkout this branch
- Make a minor change to trigger doc regeneration
- Run
/update-dev-docsin Claude Code - 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)