Skip to content

feat(registry): move Skills when GitHub moves their Repository - #499

Merged
harlan-zw merged 9 commits into
mainfrom
feat/registry-moved-repos
Oct 7, 2026
Merged

harlan-zw merged 9 commits into
mainfrom
feat/registry-moved-repos

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Related to #488

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

229 Skills in 13 Repositories still carry a name that GitHub has moved. facebook/react is now react/react, for example. ADR-0002 froze the registry name at admission, so these pages, sitemaps and run commands name a Repository GitHub no longer serves. Two moves also left a duplicate Repository in the registry: hyf0/vue-skills beside vuejs-ai/skills, and shadcn/ui beside shadcn-ui/ui.

ADR-0013 replaces ADR-0002: the registry follows GitHub.

  • Sync moves the rows. The GraphQL summary read now returns the Repository ID. When GitHub answers with another name, repositoryMoveStatements moves the Repository's rows to that name in one D1 batch, and sync carries on under the new name. The hourly prefetch leaves a moved Repository in the queue, so its sync job makes the move. A move into a name the registry already holds merges, and a clash keeps the row under the new name. If that row is stored for a different Repository ID, sync and the backfill refuse the move. A root Skill takes the new Repository name. Every moved Skill is queued for a trust and indexability recompute.
  • The old name becomes an alias. repo_aliases keeps each old name with its Repository ID. A new middleware answers /gh/<old-owner>/<old-repo> and every path under it with one 301 to the same path under the new name. A later move points older aliases at the newest name.
  • Runs keep the old name. run-identity and page-url fall back to the alias, so npx skilld run facebook/react/fix resolves the Skill the page shows now, and delivery reports the new page URL. Delivery follows GitHub's 301 since fix(artifact-delivery): read moved and oversized Repositories #488.
  • Indexing. Sitemaps read the moved rows, so they list only new URLs, and the move deletes the old routes from the agent sitemap. No indexable page is added; a merge removes a duplicate. The embedding marker stays under the old name, so the nightly prune deletes the old vector.
  • Static lists. official-repos.ts lists the 8 official Repositories under both names, so they stay official before and after the backfill. Track pins in clusters.ts name the new Repositories.

Architecture after this change: sync and the backfill move rows through one batch into the registry tables and repo_aliases; the old URL redirect, run lookups and delivery read the alias

On 2026-10-07 production held 503 Repositories under a moved name. 69 of them hold 560 Skill rows. The backfill moves the 13 the run sweep found. Sync moves each of the others the next time it reads it.

📝 Migration

The deploy applies 0145_repository_moves.sql. After it, from the repository root:

  1. Run pnpm exec tsx scripts/move-repositories.ts. It reads production and GitHub only, prints the rows each move touches, and writes one SQL file per move to a temporary folder.
  2. Run pnpm exec tsx scripts/move-repositories.ts --apply. It repeats the checks, then runs each file with wrangler d1 execute --remote --file. Each file runs in one transaction, and a second run changes nothing.

Old URLs answer 301 once the alias cache expires, within 15 minutes. When no row carries an old name, delete that name from official-repos.ts.

--reverse moves each Repository back to its old name. Sync moves it forward again unless this deploy is rolled back. A merge does not split back into two Repositories.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

ADR-0002 kept a moved Repository under its old name, so pages, sitemaps
and run commands named Repositories GitHub no longer serves, and two
renames left duplicate Repositories in the registry. Sync now follows
GitHub: it stores the Repository ID, moves every row to the new name in
one batch, and keeps the old name as an alias that answers 301.

ADR-0013 replaces ADR-0002.
Sync moves a Repository the next time it reads it. The script runs the
same statements now for the 13 moves the 2026-10-07 run sweep found, with
a read-only dry run as the default.
@harlan-zw harlan-zw added the harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. label Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. labels Oct 6, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-07 01:09 UTC.

GitHub merged this pull request.

  • Logged (30/100): The production backfill can race an in-flight sync job and resurrect the old name. View code
    • Ask an agent to verify and fix this finding
  • Logged (35/100): A move can merge into a name held by an unverified row because NULL repository_id is treated as unproven rather than checked against the stored source identity. View code
    • Ask an agent to verify and fix this finding
  • Logged (22/100): Each continuation of a moved repository re-queues all of its Skills for recompute. View code
    • Ask an agent to verify and fix this finding
  • Logged (20/100): The old repo-hub .md route is not deleted from the agent sitemap table. View code
    • Ask an agent to verify and fix this finding
  • Logged (18/100): A move back produces a transient 301 loop for up to 15 minutes from the cached alias set. View code
    • Ask an agent to verify and fix this finding
  • Logged (15/100): The PR's architecture diagram evidence is inaccessible (HTTP 400 per controller retrieval). View code
    • Ask an agent to verify and fix this finding

6f436aa6-678d-4bc1-a9bc-c22080fe16e7

Selected findings run after merge and open separate pull requests.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 6, 2026
Main gained its own 0144 migration, and two migrations may not share a
number. The batched summary read narrowed the Repository ID with a check
TypeScript could not carry into the parser, so the parser now owns it.
The hourly prefetch records an unchanged Repository in place without a
sync job. A moved Repository with an unchanged tree never reached
syncRepo, so its rows would never move.
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-running An Agent holds a Task on this issue or pull request right now. label Oct 6, 2026
@harlan-zw harlan-zw added the harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. label Oct 6, 2026
@harlan-zw

Copy link
Copy Markdown
Collaborator Author

Agent check outside CI, by Harlan Agent Kit, on dbbb56aa:

  • Dry run of scripts/move-repositories.ts against production, read only. GitHub confirmed all 13 new names by Repository ID. The old names hold 264 Skill rows. vuejs-ai/skills and shadcn-ui/ui already exist, so those two moves merge.
  • Applied the backfill to a local D1 copy and served the built Worker. /gh/facebook/react, /gh/facebook/react/fix, both .md copies, /gh/hyf0/vue-skills/vue-best-practices and /gh/shadcn/ui/shadcn each answered one 301 to the new path, with the query string kept. /gh/facebook/hermes stayed 200.
  • /gh/react/react/verify rendered 200 with canonical https://skilld.dev/gh/react/react/verify and no facebook in the HTML.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-blocked The automated Review found a material defect in this head commit. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-blocked The automated Review found a material defect in this head commit. labels Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Oct 6, 2026
The backfill now runs the held-row check sync runs, so it never merges
into a row stored for a different Repository ID. It also stops with a
clear message when the D1 lacks the moves migration.
@harlan-zw harlan-zw added the harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. label Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 6, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: READY.

Read the Review results

#510 adds migration 0145 and ADR-0013, and #512 adds ADR-0014. This
branch moves to 0146 and ADR-0015 so all three merge without a clash.
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-blocked The automated Review found a material defect in this head commit. and removed harlan-agent-ready The automated Review passed every gate on this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Oct 6, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: BLOCKED.

Read the Review results

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-blocked The automated Review found a material defect in this head commit. labels Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Oct 6, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: READY.

Read the Review results

@harlan-zw
harlan-zw merged commit 2b17cc4 into main Oct 7, 2026
7 checks passed
@harlan-zw
harlan-zw deleted the feat/registry-moved-repos branch October 7, 2026 01:01
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-ready The automated Review passed every gate on this head commit. label Oct 7, 2026
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.

1 participant