Skip to content
c3-migrate logo

C3 Migration Skill

c3-migrate

Use when upgrading .c3/ documentation to current skill version - reads VERSION, applies transforms from migrations/ directory in batches

SKILL.md

Full skill instructions

C3 Migration Skill

Overview

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."

Quick Reference

PhaseKey ActivitiesOutput
1. DetectRead version, compare to currentVersion gap identified
2. PlanList migrations/, scan filesMigration plan
3. ConfirmPresent changes to userUser approval
4. ExecuteApply transforms in batchesUpdated files
5. FinalizeUpdate version, suggest TOC rebuildMigration complete

Phase 1: Detect Version

Read Project Version

# 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:

FormatLocation
v1/​v2.c3/​VERSION file
v3c3-version: 3 in .c3/​README.md frontmatter
v4+ (date-based)c3-version: YYYYMMDD-slug in .c3/​README.md frontmatter

Compare Versions

ConditionAction
PROJECT == SKILL"Already current, no migration needed." Stop.
PROJECT > SKILL"Project newer than skill." Stop.
PROJECT < SKILLContinue to Phase 2

Version ordering:

  • Numeric versions (1, 2, 3) sort before date-based versions
  • Date-based versions sort lexicographically: 20251124-foo < 20251125-bar
  • Example: 1 < 2 < 3 < 20251124-adr-date-naming < 20251125-next-change

Phase 2: Build Migration Plan

  1. List files in migrations/ directory from plugin directory
  2. Sort lexicographically (numeric versions first, then YYYYMMDD-slug)
  3. For each migration newer than PROJECT:
    • Extract transforms section
    • Parse patterns and file globs
  4. Scan .c3/ for affected files
  5. Build plan summary

Plan Format

## 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

Phase 3: Confirm with User

"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.


Phase 4: Execute Migration

Batch Processing

Process 3-5 files per batch for trackability.

For each batch:

  1. Apply transforms to files
  2. Report progress: Batch 1/​3 complete: 3 files updated

Error Handling

ErrorAction
Pattern doesn't matchLog warning, continue
File read errorStop batch, report

Phase 5: Finalize

Update Version

# 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

Suggest TOC Rebuild

"Migration complete: v{FROM} → v{TO}

Rebuild the TOC using the plugin's build-toc.sh script to refresh the table of contents."

ADR Status Check (Post-Migration)

After migration, verify ADR status field consistency:

# Check all ADRs have status field
for f in .c3/​adr/​adr-*.md; do
  grep -q '^status:' "$f" || echo "Missing status: $f"
done

# List ADRs by status
grep -l '^status: proposed' .c3/​adr/​*.md 2>/​dev/​null
grep -l '^status: accepted' .c3/​adr/​*.md 2>/​dev/​null
grep -l '^status: implemented' .c3/​adr/​*.md 2>/​dev/​null

Reminder: Only status: implemented ADRs should appear in TOC. After migration, rebuild TOC to ensure filtering is correct.


V1 → V2 Migration

Transforms

  1. Flatten components: Move from components/​{container}/ to components/
  2. Rename context: CTX-system-overview.md → README.md
  3. Update links: Remove container subfolder from paths

Verification

# 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

V2 → V3 Migration

Transforms

  1. Convert containers to folders: containers/​C3-1-*.md → c3-1-*/​README.md
  2. Move components into containers: components/​C3-101-*.md → c3-1-*/​c3-101-*.md
  3. Update context: id: context → id: c3-0, add c3-version: 3
  4. Lowercase ADRs: ADR-001-*.md → adr-001-*.md

Verification

# 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 .

20251125-layer-settings Migration

Changes

  • Layer sections support structured configuration with useDefaults, include, exclude, litmus, diagrams
  • Existing prose-only format still works (backward compatible)
  • Skills read defaults from defaults.md files

Transforms

No automatic transforms required.

This migration is backward compatible:

  • Existing context: | prose format continues to work
  • Skills fall back to defaults.md when settings not customized

Optional Upgrade

Users who want layer customization can manually convert:

From:

context: |
  prose guidance here

To:

context:
  useDefaults: true
  guidance: |
    prose guidance here
  include: |
    custom items

Verification

# 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

Red Flags

RationalizationCounter
"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

Related

More Other skills

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

179.7K 76.1K
View

Fundamental design principles for writing maintainable, testable Python code.

40.2K 21.9K
View

Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.

40.2K 20K
View

Generate Playwright tests from scenarios using interactive browser exploration and validation.

39.7K 18.2K
View

Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.

40.2K 14.7K
View

GDPR-compliant data handling with consent management, data subject rights, and privacy controls.

40.2K 14.3K
View

Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.

40.2K 13.5K
View

Detailed multi-file refactor planning with safety checks and rollback guidance.

39.7K 13K
View