원클릭으로
check-docs-drift
Detect upstream changes to polkadot-docs tutorials, classify drifts, and sync dependency versions from upstream variables.yml.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Detect upstream changes to polkadot-docs tutorials, classify drifts, and sync dependency versions from upstream variables.yml.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Regenerate all brand assets under .github/media/ from .github/brand/tokens.yml. Run after editing tokens, templates, or bumping the workspace version.
Cut a new versioned release. Analyzes changes since last tag, determines semver bump, generates release notes and manifest, updates Cargo.toml and CHANGELOG.md, and opens a draft PR that triggers publish-release.yml on merge. Supports `--dry-run` to preview all artifacts in a scratch dir without any git or GitHub mutations.
Automated pipeline to create a polkadot-docs test harness from a tutorial URL. Analyzes the guide, generates all files, runs tests, debugs failures, and creates PRs.
Verify that internal documentation (READMEs, docs/ site, badges) stays consistent with the codebase. Catches version mismatches, broken links, and stale references.
Create a new recipe test harness that verifies an external recipe repository. Use when adding a new recipe to the cookbook.
| name | check-docs-drift |
| description | Detect upstream changes to polkadot-docs tutorials, classify drifts, and sync dependency versions from upstream variables.yml. |
Scan all polkadot-docs/ test harnesses, compare their pinned docs_commit against the latest upstream commit, classify any drifts, and sync dependency versions from the upstream variables.yml.
Throughout the entire run, maintain running counters to produce a Run Report at the end:
date +%s at the start and end of each phase to measure duration.gh api calls made, files read/modified, npm install runs, versions bumped.Track these as you go — do not retroactively estimate. Report them in Phase 8.
Find all polkadot-docs/**/README.md files. Exclude node_modules, .test-workspace, and the top-level polkadot-docs/README.md.
For each README, parse the YAML frontmatter and extract:
source_github or source_repo (both field names are used — check both)docs_committitleCategorize each README:
source_github or source_repo) AND docs_commitdocs_commitFor each trackable README, extract the file path from the GitHub URL (strip everything up to and including /blob/master/) and fetch the latest commit SHA:
gh api "repos/polkadot-developers/polkadot-docs/commits?path={FILE_PATH}&per_page=1&sha=master" --jq '.[0].sha'
Compare the fetched SHA against docs_commit. Build a list of drifted entries (old SHA, new SHA, file path, title, README path).
Optimization: Before spawning subagents, group drifted files by their (old_sha, new_sha) pair. Files sharing the same commit range can be analyzed in a single subagent with one API call, avoiding redundant fetches. This is common when upstream makes a bulk change (e.g., badge updates) that touches many files at once.
For each drift (or group of drifts sharing a commit range), spawn a parallel subagent (via the Agent tool) that:
Fetches the patch:
gh api "repos/polkadot-developers/polkadot-docs/compare/{old_sha}...{new_sha}" --jq '.files[] | select(.filename == "{FILE_PATH}") | .patch'
If the patch is empty or truncated, fetch the raw file at both SHAs and diff locally.
Classifies the diff as COSMETIC or SUBSTANTIVE:
COSMETIC (safe to auto-bump docs_commit):
SUBSTANTIVE (requires test harness review):
Returns: verdict (cosmetic/substantive), one-line summary, list of key changes.
Display a summary table grouped into sections:
| Guide | Drift | Summary |
|---|---|---|
| {title} | view diff | {one-line summary} |
| Guide | Drift | Summary |
|---|---|---|
| {title} | view diff | {one-line summary} |
List titles of guides where docs_commit matches the latest SHA.
docs_commitList guides that have a source URL but no docs_commit field — suggest adding it.
Act autonomously — do not prompt the user for confirmation:
docs_commit in each affected README to the latest SHA, commit, and push.docs_commit: Report them in the results. Do not add the field automatically — this is an informational note for the user.After presenting results and performing any user-approved actions, create a GitHub issue summarizing the findings so a developer can resolve the substantive drifts later.
[Docs Drift] {N} tutorial(s) updated upstreamdocs-driftdocs-drift label first. If one exists, comment on it instead of creating a new one.# Check for existing issue
gh issue list --state open --label "docs-drift" --json number --jq '.[0].number // empty'
# Create or comment
gh issue create --title "{title}" --body "{body}" --label "docs-drift"
# OR
gh issue comment {number} --body "{body}"
Compare our versions.yml against the upstream polkadot-docs variables.yml.
Fetch the upstream file:
gh api repos/polkadot-developers/polkadot-docs/contents/variables.yml --jq '.content' | base64 -d
For each entry in our versions.yml, find the matching entry in upstream variables.yml and compare versions. The structures differ — map between them:
polkadot_sdk.release_tag ↔ dependencies.repositories.polkadot_sdk.versionparachain_template.crates.* ↔ dependencies.repositories.polkadot_sdk_parachain_template.subdependencies.* and dependencies.crates.*zombienet.version ↔ dependencies.repositories.zombienet.versioncrates.* ↔ dependencies.crates.*javascript_packages.* ↔ dependencies.javascript_packages.*Build a list of version mismatches (our version vs upstream version).
For each outdated entry:
versions.ymlpackage.json files (in polkadot-docs/, recipes/, migration/, and dot/sdk/templates/) that reference the same package at the old version and update themnpm install --package-lock-only in each modified harness directory to regenerate lockfilesIf any entries exist in upstream but not in our versions.yml, check whether that package is used in any harness package.json. If so, add it to versions.yml and report it.
Present a summary table of version changes made, and any new entries added.
After completing the pipeline, reflect on what happened during this run:
If you identified concrete improvements, create a draft PR on a separate branch (chore/improve-check-docs-drift-skill) with changes to this skill file.
When writing improvements, follow the Claude Code skills documentation and these best practices:
SKILL.md directive, not prescriptive — say "study this reference file and adapt" instead of embedding full code templates.gh pr create --draft) — never create ready-to-merge PRs from skill runs.Include in the PR description:
Display a final metrics summary so the user can see where time and tokens were spent:
## Run Report
| Phase | Duration | Key stats |
|-------|----------|-----------|
| 1. Scan & Detect | 12s | 15 READMEs scanned, 4 drifted |
| 2. Analyze Drifts | 38s | 3 subagents, 2 batches, 847 diff lines |
| 3. Present Results | 2s | — |
| 4. Auto-Bump | 5s | 2 cosmetic bumps committed |
| 5. GitHub Issue | 3s | Created #248 |
| 6. Version Sync | 22s | 4 bumped, 10 package.json, 8 lockfiles |
| 7. Self-Improvement | 8s | No improvements identified |
| **Total** | **90s** | **3 subagents, 847 diff lines, 15 API calls** |
### Bottleneck notes
- Phase 2 consumed most time due to 1 large diff (623 lines)
Guidelines:
— to confirm it was reached.