Skip to content

docs: Add local PR preview workflow#74

Open
andmatei wants to merge 8 commits into
mainfrom
andmatei/local-pr-preview
Open

docs: Add local PR preview workflow#74
andmatei wants to merge 8 commits into
mainfrom
andmatei/local-pr-preview

Conversation

@andmatei

@andmatei andmatei commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a local workflow for previewing how a PR renders the IPA docs before merging — no hosted infrastructure.

  • scripts/preview-pr.sh — checks out a PR and starts the Docusaurus dev server (supports --port, --no-open, --install).
  • /preview-pr <n> slash command + a preview-ipa Claude Code skill that wrap the script.
  • CONTRIBUTING.md — a short "Reviewing a pull request locally" section.

andmatei added 8 commits June 17, 2026 11:23
Add scripts/preview-pr.sh, which checks out a PR (via the GitHub CLI) and
starts the Docusaurus dev server, document the reviewer flow in
CONTRIBUTING.md, and add a preview-ipa Claude Code skill that wraps it.

Reviewers can see how guideline enrichments render before approving without
hosted preview infrastructure; this complements the existing CI build, which
already fails on broken links (onBrokenLinks: throw).
Add a thin .claude/commands/preview-pr.md that delegates to the preview-ipa
skill (the workspace command->skill->script pattern), and add an
argument-hint to the skill to match the staging-preview convention.
Add a --port/-p option (and --port=N) to scripts/preview-pr.sh so reviewers can
avoid a clash on port 3000 (e.g. comparing two PRs) and so a backgrounded run
doesn't stall on Docusaurus's interactive 'port in use' prompt. Document it in
CONTRIBUTING.md and the preview-ipa skill.
- skill: stop the dev server by killing the process tree (a lone kill orphans
  the node server and leaves the port bound)
- script + skill: add --no-open and use it on the backgrounded run so it
  doesn't pop a browser tab
- script: --port= (empty value) now errors like the bare --port form
- skill + command: report the actual port instead of hardcoding 3000
The site's baseUrl is /ipa/, so a guideline renders at
http://localhost:<port>/ipa/<id> (id = the IPA number from frontmatter, e.g.
ipa/general/0101.mdx -> /ipa/101), not /<id>. Verified against the production
build output. Fixes the URL mapping in the skill, command, and CONTRIBUTING.
Lead the description with 'Use when' triggers only (drop the what-it-does
summary), dedupe the port guidance (was in both step 2 and Notes), push flag
details to --help, and tighten prose. No change to the documented workflow.
…aware

- Don't restate the Node/npm version in the skill or script header; .tool-versions
  is the source of truth and a hardcoded copy would drift on a version bump.
- Trim the CONTRIBUTING 'Reviewing a PR locally' section.
- Report URLs as http://localhost:<port>/ipa/... instead of hardcoding 3000,
  since --port can change it.
The helper script is the documented path and Development Setup already covers
npm ci + docusaurus:start, so the by-hand line was redundant.
@andmatei andmatei changed the title docs: add local PR preview workflow for reviewers docs: Add local PR preview workflow Jun 17, 2026
@andmatei andmatei marked this pull request as ready for review June 17, 2026 16:35
@andmatei andmatei requested a review from a team as a code owner June 17, 2026 16:35

@yelizhenden-mdb yelizhenden-mdb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Such a helpful skill! Thanks!

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