migrate-internal-package
Migrate an internal package into Ghost
Move a package from another TryGhost repository into Ghost without losing its
history or creating a period where neither repository owns it. Keep migration
mechanics separate from Ghost's lifetime package standards.
Any contributor can run this skill. Do not require repository administration
permission for the audit, import, PR preparation, CI, read-only preflight,
post-merge verification or follow-up work. Administration is required only at
the exceptional merge checkpoint, which is handed to one of the small set of
Ghost repository administrators.
The contributor workflow is documented in
docs/contributing/internal-package-migrations.md.
Keep that guide aligned when this skill changes its outputs or human
checkpoints.
Authority boundaries
Explain every cross-repository or administrative action before it happens.
- A request for instructions is not permission to perform the action.
- If the user says "tell me how, I do it", provide the command and wait.
- Require explicit authorization before changing repository settings, merging a
PR, deprecating npm versions, or force-pushing.
- Never run the history import's
--confirmoperation. That command is the
deliberate human administrator checkpoint because it temporarily changes a
Ghost repository setting and merges the exceptional PR.
- Never ask for, display, or store credentials or OTPs.
Work in isolated checkouts
Never manipulate history in a checkout containing unrelated work. Fetch both
repositories, confirm the source checkout is clean, and create a dedicated
Ghost worktree from the freshly fetched origin/main.
Run history-changing commands individually or in a fail-fast shell. A failed
git worktree add must not be followed by git subtree add in whichever
checkout happens to be current. Before choosing a branch or path, list existing
worktrees and matching local and remote branches. Use a migration-specific slug,
for example codex/import-<package>-from-<source>, rather than a generic name.
If the destination branch or path already exists, stop and inspect its
cleanliness, base, divergence, source split and attached worktree. Do not mutate,
delete or silently reuse it. Present the evidence and ask the user whether to
resume, preserve and supersede, or remove it when more than one choice is
reasonable. A previous attempt can contain valid unmerged history even when its
remote branch is gone.
Before importing, record and compare the destination HEAD and origin/main;
they must match. Recheck the first parent immediately after the subtree commit.
Initialize a fresh Ghost worktree with pnpm bootstrap, not pnpm setup.
pnpm setup is a pnpm CLI command that configures pnpm's global home and may
edit shell startup files; it does not invoke Ghost's repository bootstrap.
Before continuing, confirm the command installed the workspace, initialized the
submodules and configured the repository-local blame ignore file as described
by Ghost's root bootstrap script.
Confirm this workflow applies
Before changing either repository, record the source repository, its default
branch, the package path within it, the destination path in Ghost, and whether
the package has been published to npm. Then:
All packages moved by this workflow belong in Ghost's root packages/
workspace. Derive the destination as packages/<package-directory> from the
source package directory and report that exact path to the user before creating
the subtree. Never place an imported package under ghost/, even when Ghost
Core is its only consumer. If the derived path conflicts with an existing path
or the request appears to require another workspace, stop and resolve the
destination explicitly before manipulating history.
- Find every Ghost and source-repository reference to the package name and
directory.
- Inspect its npm metadata, README, documentation, release configuration and
known public consumers.
- Confirm Ghost is the real owner and can consume it via
workspace:*. - Identify any need for independent releases or supported external use.
Publication or download counts alone do not prove that a package must remain a
supported public API. If supported external consumers still need new releases,
stop: this internal-only workflow is the wrong publishing model.
For the public-consumer audit, check npm metadata, first-party repositories and
documentation, plus GitHub code search for package dependencies and runtime
imports. Classify results as first-party consumers, independent integrations,
Ghost forks, or deployed Ghost installation snapshots. Forks and installation
snapshots show historical presence only. Require a recent update, current
deployment, active dependency or another freshness signal before treating them
as evidence of continued installation needs; even then, they do not establish
an independently supported API. Record the evidence and confidence behind the
ownership decision; stop and ask if current support expectations remain
unclear.
Run registry-only npm view commands from a neutral temporary directory. A
repository's devEngines policy can reject the host Node version before npm
contacts the registry, which is unrelated to the package metadata audit. Record
that failure separately if using a neutral directory does not resolve it.
Produce these work products in order
- A green Ghost import PR with reachable source history.
- After it merges, a green sou
