Token导航 LogoToken导航TokenDH.com
AI 工具只读github未标认证来源可访问clear审计异常

config-restore配置恢复

Agent Skill

config-restore 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

336

周安装

14

GitHub Stars

公开资料未说明

下载量

112
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:config-restore(配置恢复)
来源仓库:https://github.com/ppx123-web/claude-config
仓库路径:skills/config-restore
安装命令:
npx skills add https://github.com/ppx123-web/claude-config --skill config-restore
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/ppx123-web/claude-config --skill config-restore

简介

config-restore 从备份目录恢复 Claude Code 的配置文件到 ~/.claude/。

  • 适用于配置损坏或误删后的快速还原。
  • 支持用户确认后再覆盖现有文件,保障数据安全。
  • 安装前请确认权限范围、维护状态及是否会覆盖重要配置。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Config Restore Skill

Restores Claude Code configuration files from a backup directory back to ~/.claude/. Restores the commands/, skills/, and agents/ directories with user confirmation before overwriting existing files.

What Gets Restored

By default, this skill restores three directories to ~/.claude/:

  • commands/ - All slash command definitions
  • skills/ - All agent skills and their resources
  • agents/ - All subagent definitions

These are the user-created configurations that define custom Claude Code behavior.

When to Use This Skill

Use this skill to:

  • Restore configurations from a previous backup
  • Reload configurations after making changes
  • Copy configurations from another machine or project
  • Recover from accidental deletions or modifications
  • Import configurations shared by others

Restore Workflow

Follow this workflow when performing a restore:

1. Confirm Source Directory

Always confirm the source directory, even though the default is the current working directory. Ask this:

"Source directory: [current-working-directory]
Is this correct, or would you like to specify a different location?"

Wait for user confirmation before proceeding.

2. Select Directories to Restore

Ask the user which directories to restore. Present this interactive prompt:

"Which directories would you like to restore?
- commands/
- skills/
- agents/

Restore all three, or specify which ones?"

If the user doesn't specify, restore all three. If they specify a subset, only restore those.

3. Check for Conflicts

Critical: Before copying, check if target directories already exist in ~/.claude/. If they do, ask for confirmation:

"⚠️ Target directory commands/ already exists with X files
❓ Overwrite commands/ in ~/.claude/?"

Wait for user response (yes/no) before proceeding. If user declines, skip that directory.

4. Execute the Restore Script

Use the restore script located at scripts/restore.sh within this skill directory. Execute it with appropriate parameters:

~/.claude/skills/config-restore/scripts/restore.sh [source-dir] [directories...]

Parameters:

  • source-dir: Source directory containing backup (default: current directory if not specified)
  • directories...: Space-separated list of directories to restore (commands, skills, agents)

The script will:

  • Check that source directory exists
  • Check that ~/.claude/ exists (error if not)
  • Ask for confirmation before overwriting existing directories
  • Use rsync if available (efficient copying), otherwise fallback to cp -r
  • Preserve directory structure
  • Skip directories if user declines confirmation

5. Report Results

After the restore completes, show the user a detailed list of what was restored:

✅ Restore complete!

Restored directories:
- commands/ (15 files)
- skills/ (8 directories, 42 files)
- agents/ (23 files)

Total: 80 files in 31 directories
Target: /Users/username/.claude

If any directories were skipped (either missing from source or declined by user), report them clearly.

Error Handling

The restore script handles these scenarios:

Source Directory Doesn't Exist

Exits with error message:

❌ Error: Source directory /path/to/source not found

Target Directory Missing

If ~/.claude/ doesn't exist, the script exits with error:

❌ Error: Target directory ~/.claude not found. Claude Code may not be installed.

This prevents accidentally creating ~/.claude/ in unexpected situations.

User Declines Overwrite

If user says "no" to overwrite confirmation, the directory is skipped:

❓ Overwrite commands/ in ~/.claude/? no
Skipping commands/

Directory Not in Source

If a requested directory doesn't exist in the source backup:

⚠️ Skipping agents/ (not found in source)

rsync Not Available

Automatically falls back to cp -r command. User sees:

⚠️ rsync not available, using cp instead

Examples

Common restore patterns:

  • "restore my claude config" - Restore all directories from current location
  • "just restore commands and skills" - Selective restore of specific directories
  • "restore from ~/backups/claude-config" - Custom source directory
  • "I accidentally deleted my commands" - Recovery from accidental deletion

See examples/restore-workflows.md for detailed walkthroughs with complete dialogue.

Best Practices

  • Always confirm source directory before restoring
  • Check for conflicts and ask before overwriting existing files
  • Show clear feedback about what was restored so user knows operation succeeded
  • Handle errors gracefully with helpful error messages
  • Never auto-overwrite - always ask user for confirmation when conflicts exist
  • Use rsync when available for efficient copying
  • Fail fast if ~/.claude/ doesn't exist rather than creating it

Technical Details

Script Location

The restore script is at: ~/.claude/skills/config-restore/scripts/restore.sh

Copy Method

  • Prefers rsync -av for efficient copying
  • Falls back to cp -rf if rsync unavailable
  • Always preserves permissions and timestamps
  • Creates target directories as needed with mkdir -p

Conflict Detection

  • Checks if target directory exists before copying
  • Counts files in target to show user what will be overwritten
  • Prompts user for each directory with conflicts
  • Respects user's choice to skip or overwrite

Directory Structure

The restore preserves this structure:

source-dir/
├── commands/
│   ├── command1.md
│   └── command2.md
├── skills/
│   ├── skill1/
│   └── skill2/
└── agents/
    ├── agent1.md
    └── agent2.md

All files are copied to ~/.claude/ maintaining the same structure.

See Also

  • Troubleshooting common issues: references/troubleshooting.md
  • Detailed restore workflow examples: examples/restore-workflows.md
  • The restore script implementation: scripts/restore.sh
  • Claude Code skill documentation for skill structure
  • Related: config-backup skill for creating backups

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.57%
按下载量换算32

Antigravity

23.95%
按下载量换算27

Gemini CLI

16.66%
按下载量换算19

windsurf

14%
按下载量换算16

trae

9.17%
按下载量换算10

OpenCode

3.26%
按下载量换算4

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills