Migrate .c3/ documentation to current skill version - reads VERSION, compares against migrations/ directory, executes transforms in batches
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Migrate project .c3/ documentation from older versions to current skill version.
Core principle: Explicit migration triggered by user. Show plan, get confirmation, execute in batches.
Announce at start: "I'm using the c3-migrate skill to upgrade your C3 documentation."
| Phase | Key Activities | Output |
|---|---|---|
| 1. Detect | Read version, compare to current | Version gap identified |
| 2. Plan | List migrations/, scan files | Migration plan |
| 3. Confirm | Present changes to user | User approval |
| 4. Execute | Apply transforms in batches | Updated files |
| 5. Finalize | Update version, suggest TOC rebuild | Migration complete |
# Check frontmatter first (v3), then VERSION file (v1/v2)
if grep -q '^c3-version:' .c3/README.md 2>/dev/null; then
PROJECT_VERSION=$(grep '^c3-version:' .c3/README.md | sed 's/c3-version: *//')
elif [ -f ".c3/VERSION" ]; then
PROJECT_VERSION=$(cat .c3/VERSION)
else
PROJECT_VERSION=0
fi
Version storage:
| Format | Location |
|---|---|
| v1/v2 | .c3/VERSION file |
| v3 | c3-version: 3 in .c3/README.md frontmatter |
| v4+ (date-based) | c3-version: YYYYMMDD-slug in .c3/README.md frontmatter |
| Condition | Action |
|---|---|
| PROJECT == SKILL | "Already current, no migration needed." Stop. |
| PROJECT > SKILL | "Project newer than skill." Stop. |
| PROJECT < SKILL | Continue to Phase 2 |
Version ordering:
20251124-foo < 20251125-bar1 < 2 < 3 < 20251124-adr-date-naming < 20251125-next-changemigrations/ directory from plugin directoryPROJECT:
.c3/ for affected files## Migration Plan: v{FROM} → v{TO}
### Version {N} transforms:
- {PATTERN_DESC}: {FILE_COUNT} files
### Batches:
- Batch 1: file1.md, file2.md
- Batch 2: file3.md, file4.md
"I'll migrate your
.c3/documentation from v{FROM} to v{TO}.Changes:
- {CHANGE_1}
- {CHANGE_2}
Files affected: {N}
Proceed? [y/n]"
If declined, stop.
Process 3-5 files per batch for trackability.
For each batch:
Batch 1/3 complete: 3 files updated| Error | Action |
|---|---|
| Pattern doesn't match | Log warning, continue |
| File read error | Stop batch, report |
# For numeric versions (1, 2, 3)
if [[ "$TARGET_VERSION" =~ ^[0-9]+$ ]]; then
if [ "$TARGET_VERSION" -ge 3 ]; then
sed -i "s/^c3-version: .*/c3-version: $TARGET_VERSION/" .c3/README.md
rm -f .c3/VERSION
else
echo "$TARGET_VERSION" > .c3/VERSION
fi
else
# For date-based versions (YYYYMMDD-slug)
sed -i "s/^c3-version: .*/c3-version: $TARGET_VERSION/" .c3/README.md
rm -f .c3/VERSION
fi
"Migration complete: v{FROM} → v{TO}
Rebuild the TOC using the plugin's
build-toc.shscript to refresh the table of contents."
components/{container}/ to components/CTX-system-overview.md → README.md# No nested component directories
[ $(find .c3/components -mindepth 1 -type d | wc -l) -eq 0 ]
# README.md has correct id
grep -q '^id: context$' .c3/README.md
containers/C3-1-*.md → c3-1-*/README.mdcomponents/C3-101-*.md → c3-1-*/c3-101-*.mdid: context → id: c3-0, add c3-version: 3ADR-001-*.md → adr-001-*.md# No containers/ or components/ directories
[ ! -d ".c3/containers" ] && [ ! -d ".c3/components" ]
# Context has c3-0 and c3-version
grep -q '^id: c3-0$' .c3/README.md
grep -q '^c3-version: 3$' .c3/README.md
# All lowercase
! find .c3 -name "C3-*" -o -name "ADR-*" | grep -q .
useDefaults, include, exclude, litmus, diagramsdefaults.md filesNo automatic transforms required.
This migration is backward compatible:
context: | prose format continues to workUsers who want layer customization can manually convert:
From:
context: |
prose guidance here
To:
context:
useDefaults: true
guidance: |
prose guidance here
include: |
custom items
# VERSION shows 20251125-layer-settings or later
grep 'c3-version:' .c3/README.md
# settings.yaml still valid (basic check)
if [ -f ".c3/settings.yaml" ]; then
grep -q '^context:' .c3/settings.yaml || grep -q '^context$' .c3/settings.yaml
fi
| Rationalization | Counter |
|---|---|
| "I'll migrate without asking" | Always confirm with user first |
| "I'll do all files at once" | Batch for trackability |
| "Pattern didn't match, skip silently" | Log warnings |
| "Version update not critical" | Always update on success |