agentleFS
JoviDeCroockJoviDeCroock/pracht/skills/upgrade-pracht/SKILL.md

upgrade-pracht

Skill113 starsChanged 7 months agoMITView on GitHub

Upgrade `@pracht/*` packages: inventory versions, read the changelogs, map breaking changes to the app's code, apply, and verify with doctor, typegen, build, and tests. Use for "upgrade pracht", "update @pracht packages", "what changed in the new pracht version", "is this upgrade safe".

  • Installs packages

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    After any upgrade, confirm a single core resolution:

    line 62
  2. Very specific:

    Only @pracht/cli ships CHANGELOG.md in its npm tarball (node_modules/@pracht/cli/CHANGELOG.md).

    line 70
  3. Very specific:

    Use AskUserQuestion before touching anything when breaking migrations are required: confirm the target versions and which migrations to …

    line 119
  4. Distinctive:

    Start from a clean tree so the upgrade can be undone without touching the user's own work:

    line 122
  5. Distinctive:

    If it prints anything, ask the user to commit or git stash push -u their changes first.

    line 129
  6. Very specific:

    Keep the whole upgrade, including fixes made during Step 6, in one dedicated commit when the user agrees to commits.

    line 142
  7. Distinctive:

    Run in order; stop and fix at the first failure:

    line 148
  8. Distinctive:

    If the ladder cannot be made green, roll back rather than shipping a half-upgrade:

    line 169
  9. Very specific:

    Never mix @pracht/* versions from different release waves — upgrade and roll back the family as a unit, and verify with pnpm why …

    line 189
  10. Distinctive:

    Read changelogs before installing, not after something breaks.

    line 191
  11. Very specific:

    Never apply a breaking-change migration without explicit user confirmation via AskUserQuestion.

    line 192
  12. Distinctive:

    Treat 0.x minor bumps as potentially breaking.

    line 194
  13. Distinctive:

    Do not hand-edit lockfiles.

    line 195

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Pracht Upgrade

Upgrade @pracht/* dependencies with the changelog read before the install, not after the build breaks.

Step 1: Inventory

List every installed pracht package and its resolved version:

pnpm list --depth 1 --json | grep -A2 '@pracht/'   # or read package.json + lockfile

The family, in full: @pracht/core, @pracht/cli, @pracht/vite-plugin, @pracht/adapter-node, @pracht/adapter-cloudflare, @pracht/adapter-netlify, @pracht/adapter-vercel, @pracht/adapter-static, @pracht/preact-ssr-precompile, @pracht/capabilities, @pracht/content, @pracht/markdown, @pracht/openapi, @pracht/image, @pracht/i18n, @pracht/session, @pracht/query, @pracht/test, plus the create-pracht scaffolder (which is not a runtime dependency and does not need to move with the rest). Get the latest published versions with npm view <pkg> version.

Step 2: Understand the versioning model

@pracht/core, @pracht/capabilities and @pracht/vite-plugin always release together at one version (a Changesets fixed group): upgrade them to the same version. Every other package is independently versioned — @pracht/cli is on 1.x while core is on 0.x — so there is no "one framework version". Two consequences:

  1. Internal ranges stop at the minor. Published packages depend on their siblings with caret ranges on 0.x (e.g. @pracht/core: ^0.20.0), and a 0.x caret never crosses a minor. @pracht/vite-plugin, the adapters, @pracht/content, @pracht/openapi, @pracht/session, @pracht/i18n, @pracht/query, and @pracht/test take @pracht/core as a peer, so upgrading core past their range fails with ERESOLVE under npm and warns under pnpm; forcing it through (--legacy-peer-deps, --force) can install a second core that splits the runtime. Upgrade the whole family in one move.
  2. Most packages are 0.x, so under semver a minor bump may be breaking — treat ### Minor Changes entries on 0.x packages with the same care as majors.

After any upgrade, confirm a single core resolution:

pnpm why @pracht/core   # exactly one version may appear

Step 3: Read the changelogs between installed and target

Only @pracht/cli ships CHANGELOG.md in its npm tarball (node_modules/@pracht/cli/CHANGELOG.md); the other packages publish dist/ only. Fetch their changelogs from the repo instead:

https://raw.githubusercontent.com/JoviDeCroock/pracht/main/packages/<dir>/CHANGELOG.md
PackageRepo directory
@pracht/corepackages/framework
@pracht/clipackages/cli
@pracht/vite-pluginpackages/vite-plugin
@pracht/adapter-node / -cloudflare / -netlify / -vercel / -staticpackages/adapter-*
@pracht/preact-ssr-precompilepackages/preact-ssr-precompile
@pracht/capabilitiespackages/capabilities
@pracht/contentpackages/content
@pracht/markdownpackages/markdown
@pracht/openapipackages/openapi
@pracht/imagepackages/image
@pracht/i18npackages/i18n
@pracht/sessionpackages/session
@pracht/querypackages/query
@pracht/testpackages/test
create-prachtpackages/start

Changelogs are changesets-generated: ## X.Y.Z sections containing ### Major Changes / ### Minor Changes / ### Patch Changes. Read every section between the installed and target version of every installed package.

Step 4: Map changes onto this app

Classify each entry as breaking / feature / fix. For each breaking (or 0.x minor) entry, grep the app for the APIs, exports, config options, and generated-file shapes it names, and record: affected files, the migration the changelog prescribes, and whether it can be applied mechanically. Also re-check peer ranges after a major target bump — @pracht/vite-plugin requires vite (^8), @pracht/adapter-cloudflare requires vite and wrangler (^4.81), @pracht/core requires preact (^10 or an 11 prerelease) and preact-render-to-string (^6.7), and @pracht/query requires @tanstack/preact-query (^5.91).

Present the plan as a table:

PackageInstalled → TargetBreaking entriesApp impactMigration

Step 5: Confirm, then apply

Use AskUserQuestion before touching anything when breaking migrations are required: confirm the target versions and which migrations to apply.

Start from a clean tree so the upgrade can be undone without touching the user's own work:

git status --porcelain        # must print nothing

If it prints anything, ask the user to commit or git stash push -u their changes first; never upgrade on top of unrelated edits. Then:

pnpm up '@pracht/core@<v>' '@pracht/cli@<v>' '@pracht/vite-plugin@<v>' <adapters...>

Upgrade every installed @pracht/* package in the same command. Apply the agreed code migrations with minimal diffs, one changelog entry at a time. Then read the page behind each changed API with pracht docs <topic>, which serves the docs bundled with the newly installed CLI. A CLI without that command predates it; use https://pracht.resynapse.dev/llms.txt instead.

Keep the whole upgrade, including fixes made during Step 6, in one dedicated commit when the user agrees to commits. Otherwise, once Step 6 passes, record it as a patch: git add -A && git diff --cached --binary > ../pracht-upgrade.patch.

Step 6: Verification ladder

Run in order; stop and fix at the first failure:

pracht doctor --json          # wiring still valid
pracht typegen --check        # generated route types up to date?
pracht typegen                # regenerate if --check failed or routes changed
pracht verify --json          # framework-aware checks
pnpm typecheck                # both tsconfig programs, if the app has the script
pracht build                  # full production build (budgets included)
pnpm test                     # the app's own suite

pracht doctor, verify, and typegen --check exit non-zero on failure, so they gate CI cleanly. Act on doctor warnings too: pnpm up never touches files create-pracht wrote, so a warning is how an older scaffold learns it needs a config change — for example adding "src/**/*.d.ts" to the include of tsconfig.client.json, without which typed route hooks are unknown in client code and <Link route> accepts any string.

Step 7: Rollback note

If the ladder cannot be made green, roll back rather than shipping a half-upgrade:

git revert --no-edit <upgrade-commit>          # committed upgrade
git apply -R --index ../pracht-upgrade.patch   # recorded patch
pnpm install

Both undo only the upgrade's own changes; never git restore or git checkout -- whole files, which also erases the user's edits to them. If the reverse patch does not apply cleanly, stop and ask. Then git stash pop if Step 5 stashed.

Because internal ranges stop at the minor, a partial rollback (one package back, the rest forward) hits the peer conflicts or duplicate core from Step 2 — roll the whole family back together.

Rules

  1. Never mix @pracht/* versions from different release waves — upgrade and roll back the family as a unit, and verify with pnpm why @pracht/core.
  2. Read changelogs before installing, not after something breaks.
  3. Never apply a breaking-change migration without explicit user confirmation via AskUserQuestion.
  4. Treat 0.x minor bumps as potentially breaking.
  5. Do not hand-edit lockfiles; let the package manager resolve.

$ARGUMENTS

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.