AgentSkillsCN

claude-code-archiver

下载、格式化并归档 @anthropic-ai/claude-code npm 包。当用户提出“归档 Claude Code”“下载 Claude Code”“获取最新版 Claude Code”“npm 打包 Claude Code”或需要在 ~/swe/archive 中搭建全新版本的 Claude Code,并附带格式化的 cli.js 以及完整的 Git 历史记录时,可使用此技能。

SKILL.md
--- frontmatter
name: claude-code-archiver
description: Download, prettify, and archive @anthropic-ai/claude-code npm packages. Use when user asks to "archive claude code", "download claude code", "get latest claude code", "npm pack claude code", or needs to set up a new Claude Code version in ~/swe/archive with prettified cli.js and git history.

Claude Code Archiver

Archive Claude Code npm packages with prettified source and git tracking.

Quick Reference

Archive locations:

  • Archive: ~/swe/archive/claude-code-{version}/
  • Production: ~/swe/claude-code-{version}/
  • Tarballs kept: ~/swe/archive/anthropic-ai-claude-code-{version}.tgz

First commit message: Sotola: Pristine from Anthropic

Workflow

1. Download and Archive

bash
cd ~/swe/archive
npm pack @anthropic-ai/claude-code
# Note the version from output (e.g., 2.1.7)

tar -xzf anthropic-ai-claude-code-X.Y.Z.tgz
mv package claude-code-X.Y.Z
cd claude-code-X.Y.Z

# Prettify bundled cli.js (adds newlines/indentation)
npx prettier --write --tab-width 2 --use-tabs false --print-width 80 cli.js

# Initialize git
git init && git add -A
git commit -m "Sotola: Pristine from Anthropic"

2. Clone to Production

bash
git clone ~/swe/archive/claude-code-X.Y.Z ~/swe/claude-code-X.Y.Z

Scripts

Two helper scripts in scripts/:

  • archive-claude-code.sh - Downloads latest, extracts, prettifies, commits
  • clone-to-production.sh VERSION - Clones archived version to ~/swe/

Notes

  • Prettification expands cli.js from ~11MB to ~16MB (formatting adds whitespace)
  • Keep .tgz files in archive for reference
  • Production clones track the archive as origin remote