feat: migrate CLI + ai-context-migrate skill (1.1.0)#4
Merged
Conversation
ApprovabilityVerdict: Needs human review Unable to check for correctness in e2a0126. Diff is too large for automated approval analysis. A human reviewer should evaluate this PR. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Pull request overview
Adds the 1.1 migration workflow on top of the skills system: a new ai-context migrate CLI, bundled migration curation skill, gauntlet/self-test assets, and expanded docs/templates for cross-CLI skills.
Changes:
- Adds skills discovery/mirroring APIs, migration planning/apply APIs, and CLI commands for
skillsandmigrate. - Bundles
ai-context-kitandai-context-migrateskills into templates and gauntlet fixtures. - Adds docs, tests, changesets, and validation scripts/results for skills and migration flows.
Reviewed changes
Copilot reviewed 167 out of 171 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
packages/core/src/migrate.ts |
Implements migration plan generation and apply execution. |
packages/core/src/skills.ts |
Adds skill parsing, discovery, mirror planning, symlink/copy creation. |
packages/core/src/engine.ts |
Integrates skills into build/verify/diff/doctor/init. |
packages/core/src/config.ts |
Adds manifest skills block loading. |
packages/core/src/render.ts |
Adds kit-awareness stanza to generated root files. |
packages/core/src/types.ts |
Adds skill and migration type definitions. |
packages/core/src/io.ts |
Adds symlink/copy filesystem helpers. |
packages/core/src/errors.ts |
Adds skill and migration error codes. |
packages/core/src/index.ts |
Exports new skills and migrate APIs. |
packages/cli/src/index.ts |
Registers new CLI subsystems and init flags. |
packages/cli/src/commands/skills/* |
Adds skills list and skills create. |
packages/cli/src/commands/migrate/* |
Adds migrate plan/status/apply/clean. |
packages/templates/src/* |
Adds skills config and bundled skill assets to templates. |
packages/templates/src/skills/** |
Adds bundled ai-context-kit and ai-context-migrate skills and references. |
packages/*/test/**/*.ts |
Adds coverage for skills, migration, CLI, init upgrade, and rendering behavior. |
docs/*.md |
Documents skills, migration, CLI contract, config, errors, and support policy. |
scripts/test-migrate-on-gauntlet.sh |
Adds end-to-end migration self-test. |
scripts/gauntlet/README.md |
Documents gauntlet runner stages. |
scripts/epmx-gauntlet/* |
Adds EPMX-specific migration validation runner and docs. |
examples/gauntlet/** |
Adds full skills gauntlet fixture, generated outputs, and validation transcripts. |
.changeset/*.md |
Adds release notes for skills and migration changes. |
README.md |
Adds top-level skills and migration sections. |
package.json |
Adds pnpm gauntlet script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+400
to
+408
| entry.applied_at = new Date().toISOString(); | ||
| report.applied.push({ name: entry.name, action: entry.action }); | ||
| } catch (error) { | ||
| const reason = error instanceof ContextError ? `[${error.code}] ${error.message}` : String(error); | ||
| report.failed.push({ name: entry.name, reason }); | ||
| throw new ContextError( | ||
| "AICTX_MIGRATE_ENTRY_FAILED", | ||
| `Failed to apply entry '${entry.name}': ${reason}. Migration halted. Fix and re-run.` | ||
| ); |
Comment on lines
+33
to
+38
| log_stage() { | ||
| local stage="$1" outcome="$2" detail="${3:-}" | ||
| echo "- **$stage**: $outcome" >> "$REPORT" | ||
| [ -n "$detail" ] && echo " - $detail" >> "$REPORT" | ||
| echo "[epmx-gauntlet] $stage: $outcome${detail:+ — $detail}" | ||
| } |
Comment on lines
+427
to
+434
| if (fileExists && !options.force) { | ||
| if (options.upgrade) { | ||
| if (isMetaSkillFile && options.refreshMetaSkill) { | ||
| writeUtf8(abs, file.content.endsWith("\n") ? file.content : `${file.content}\n`); | ||
| written.push(file.path); | ||
| } | ||
| continue; // skip existing files in upgrade mode | ||
| } |
Spec for the kit's migration capability — `ai-context migrate` CLI (safe + deterministic) plus a bundled `ai-context-migrate` skill that drives the agent's curation phase. EPMX Monorepo is the validating consumer (40 entries → 39 .ai/skills/ subdirs). Builds on v1.0.0 (PR #3). Sequencing: ship v1.0.0 → build/iterate this on EPMX → ship 1.1.0 → land EPMX migration as separate PR. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
30 tasks across 10 phases. Phase A-G build the kit feature (TDD, ~commit-per-task). Phase H self-tests against the gauntlet fixture. Phase I applies the migration to EPMX-Monorepo on a feature branch at the EPMX repo root (not via worktree, per user preference). Phase J ships kit 1.1.0. Maps every spec section to at least one task. Includes the EPMX gauntlet runner, the self-test harness, both PRs (kit + EPMX), and the rollback path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
f19e133 to
e2a0126
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ai-context migrateCLI subsystem (plan/status/apply/clean)ai-context-migratebundled skill for agent-driven curationscripts/test-migrate-on-gauntlet.sh)Depends on
#3 (1.0.0 release) merging first. This branch is currently based on the 1.0.0 work; once #3 merges, this PR will rebase onto main.
Spec + plan
Validation
Empirically validated against EPMX Monorepo (EPMX PR #511):
Plus the kit's internal validation:
scripts/test-migrate-on-gauntlet.sh) PASSES on synthetic legacy fixtureThe 4-phase model
ai-context migrate plan.ai/migration-plan.jsonai-context-migrateskill (agent)ai-context migrate applyai-context build/verify/doctor+ gauntletTest plan
pnpm -r test)pnpm -r typecheck)pnpm -r build)scripts/test-migrate-on-gauntlet.sh)🤖 Generated with Claude Code
Note
Add
ai-context migrateCLI andai-context-migrateskill for migrating legacy skill layoutsmigrate plan,migrate status,migrate apply [--dry-run], andmigrate cleansubcommands to the CLI, each with console reporting and structured exit codes.move_dir,promote_bare_md,consolidate_symlink,keep_existing) in migrate.ts that reorganize legacy.claude/skills/layouts into.ai/skills/<name>/SKILL.mdwith mirror symlinks under.agents/skills/and.claude/skills/.applyPlanenforces a clean working tree, git repo presence, and a valid manifest skills block before executing.ai-context-migrateskill (with reference docs) into the templates package via a refactored skills-bundler.ts that now discovers all skills underpackages/templates/src/skills/*.AICTX_MIGRATE_*error codes and full Vitest coverage across classify, plan, apply, serialize, and precondition modules.Macroscope summarized e2a0126.