Skip to content

Resync Research and Learning pack sources into ~/.pai/skills/ runtime #145

@virtualian

Description

@virtualian

Context

During the 2026-04-20 skill-migration run (#110 artefact, engine/skill-migration.ts) on the maintainer's local laptop, drift backups on Research and Learning surfaced a three-stale-copies situation:

Copy Path convention Voice pattern
Canonical winner (~/.claude/skills/<Pack>, mtime 19-24 Mar) ~/.claude/MEMORY/... literals "Workflow Announcement" (text-only)
Displaced backup (~/.pai/skills/<Pack>, mtime 7-15 Apr) ${PAI_DIR}/MEMORY/... tokens (post-#114) bun ~/.claude/PAI/Tools/Notify.ts ... invocations
Repo source (Packs/<Pack>/src/, authoritative) ${PAI_DIR}/MEMORY/... tokens bun ~/.pai/PAI/Tools/Notify.ts ... invocations (two-root-aware)

Skill-migration's "CC side wins on drift" rule chose the most stale of the three — an under-specified input to the rule, not a bug in the rule itself.

Problem

There is no authoritative sync path from Packs/<Pack>/src/ into ~/.pai/skills/<Pack>/ for upgraders. Pack sources evolve in the repo (#114 path sweep, post-#112 voice-path updates, ongoing content edits), but the runtime ~/.pai/skills/ tree only receives updates when some ad-hoc process happens to run.

Symptoms on this laptop:

  • Research: SKILL.md + three workflow files lag repo source by ≥5 weeks.
  • Learning: SKILL.md + three workflow files + one tool file lag repo source. Notify.ts invocation paths point at ~/.claude/PAI/Tools/ instead of ~/.pai/PAI/Tools/.
  • Every other pack that showed drift in the migration is likely similar, but Research and Learning are the confirmed cases.

Drift backups containing the less-stale intermediate copy have been discarded; canonical is now ~/.pai/skills/<Pack> but still lags repo source.

Scope

Mechanism to bring ~/.pai/skills/<Pack> into alignment with Packs/<Pack>/src/ for PAI-owned packs, on upgrade runs. Candidate approaches (investigation, non-exhaustive):

  1. Per-pack install/upgrade wizard that copies Packs/<Pack>/src/~/.pai/skills/<Pack>/, with conflict detection against runtime-local edits.
  2. Peer of engine/skill-migration.ts that treats Packs/<Pack>/src/ as the authority when both runtime copies are older than source.
  3. Sync tool that operates outside the installer, invoked explicitly on demand.
  4. Something else the investigation surfaces.

Acceptance

Related

Out of scope

  • Implementation. Investigation and design recommendation.
  • Third-party pack sync (out of scope for PAI install infrastructure).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions