Command Palette

Search for a command to run...

Назад к скиллам
скилл № 46861

import-scripts

use this only as the source the copy command reads: import-tools.py, the Windows collector, and the Windows ChatGPT pull. Never read it into the conversation

БесплатноБез исполняемых скриптов
brokepот brokep★ 48 звёзд на GitHub

Установить import-scripts в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

import-scripts

Part of the Import Bot agent preset.

Import scripts

The scripts other skills copy out with the command in import-bot-setup ("Copying a script out of a skill"). Copy the one you need by its heading. Never read this skill into the conversation.

import-tools.py

#!/usr/bin/env python3
"""Import Bot's tools on its own computer, in one script.

    python3 import-tools.py parse <archive-or-dir> [out-dir]
    python3 import-tools.py normalize <migration-dir>
    python3 import-tools.py search <migration-dir> "<pattern>" [--from <harness>] [-n 20]
    python3 import-tools.py view <migration-dir> <id-prefix> [--max 80]
    python3 import-tools.py seed <migration-dir> <slug> <id,id,...> [--max-sessions 12] [--max-messages 40]

parse, in order: extract into <out>/raw and drop AppleDouble sidecars, reduce
credential-bearing configs to names and delete them, delete anything on the
never-copy list, split account bundles, redact secret-looking strings value-only,
write <out>/inventory.json and <out>/sources.md, then normalize.

normalize writes one text-only document per session to <out>/pack/sessions/ plus
index.json: {"id","harness","title","timestamp","last_activity","cwd","model","source",
"messages":[{"role","text","timestamp"}],"tools":{name:count},"connectors":[...]}.
Tool calls are counted, never carried.

Sources: Claude Cowork, Claude Code, Codex, OpenClaw, Hermes, and the account pulls
placed under raw/accounts/{chatgpt,claude}/ (official exports and live conversation
JSON). Unknown keys are kept under "raw" so nothing is lost.
"""
import json
import os
import re
import shutil
import sqlite3
import sys
import tarfile
import time
import zipfile
from collections import Counter
from pathlib import Path


# ---------------------------------------------------------------- redaction
SECRET_PATTERNS = [
    r"sk-[A-Za-z0-9_-]{16,}",
    r"xox[abprs]-[A-Za-z0-9-]{10,}",
    r"gh[pousr]_[A-Za-z0-9]{20,}",
    r"AKIA[0-9A-Z]{16}",
    r"AIza[0-9A-Za-z_-]{30,}",
    r"ya29\.[A-Za-z0-9_-]{20,}",
    r"eyJ[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{10,}",
    r"-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----",
]
RX = [re.compile(p) for p in SECRET_PATTERNS]
RX_KV = re.compile(
    r"(?i)((?:api[_-]?key|secret|token|password|passwd|authorization|bearer|cookie|session_key)[\"']?\s*[:=]\s*[\"']?)([^\s'\",;}]{8,})"
)
TEXT_EXT = {".md", ".json", ".jsonl", ".toml", ".yaml", ".yml", ".txt"}

# High-entropy tokens: long, no spaces, mixed letters and digits, not a UUID, path, or URL.
# Catches secrets in formats the pattern list does not know. Shannon entropy over 4.0 bits
# per character on 32+ characters is rare in prose and common in keys.
RX_TOKEN = re.compile(r"(?<![A-Za-z0-9/:._\-])([A-Za-z0-9_\-+/=]{32,})(?![A-Za-z0-9/:._\-])")
RX_UUID = re.compile(r"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}")


def looks_like_secret(tok: str) -> bool:
    if RX_UUID.search(tok) or "/" in tok:
        return False
    if not (any(c.isalpha() for c in tok) and any(c.isdigit() for c in tok)):
        return False
    import math
    counts = {}
    for c in tok:
        counts[c] = counts.get(c, 0) + 1
    ent = -sum(n / len(tok) * math.log2(n / len(tok)) for n in counts.values())
    return ent > 4.0


def redact_text(text: str):
    n = 0
    for r in RX:
        text, k = r.subn("[redacted]", text)
        n += k
    text, k = RX_KV.subn(r"\1[redacted]", text)
    n += k
    def _tok(m):
        nonlocal n
        if looks_like_secret(m.group(1)):
            n += 1
            return "[redacted]"
        return m.group(0)
    text = RX_TOKEN.sub(_tok, text)
    return text, n


NEVER_COPY_DIRS = {"uploads", "outputs", "ccd-session-secrets", "vm_bundles", "claude-code-vm", "skills-plugin", "rpm", "node_modules", ".git", "credentials", "debug", "backups"}
NEVER_COPY_NAMES = {"claude_desktop_config.json", ".claude.json", "config.toml", "settings.json", "openclaw.json", "auth.json", "gateway.json"}
NEVER_COPY_PREFIXES = ("host-creds-",)
NEVER_COPY_SUFFIXES = (".audit-key", ".pem", ".key")
UUIDISH = re.compile(r"^[0-9a-fA-F-]{20,}$")


def extract(src: Path, raw: Path):
    raw.mkdir(parents=True, exist_ok=True)
    if src.is_dir():
        shutil.copytree(src, raw, dirs_exist_ok=True)
    elif zipfile.is_zipfile(src):
        with zipfile.ZipFile(src) as z:
            z.extractall(raw)
    else:
        with tarfile.open(src) as t:
            t.extractall(raw)
    for p in list(raw.rglob("._*")):
        if p.is_file():
            p.unlink()
    for junk in list(raw.rglob(".DS_Store")):
        junk.unlink()


def enforce_allowlist(raw: Path) -> int:
    removed = 0
    for p in list(raw.rglob("*")):
        if not p.exists():
            continue
        parts = set(p.relative_to(raw).parts)
        if p.is_dir() and p.name in NEVER_COPY_DIRS:
            removed += sum(1 for f in p.rglob("*") if f.is_file())
            shutil.rmtree
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл import-scripts?

use this only as the source the copy command reads: import-tools.py, the Windows collector, and the Windows ChatGPT pull. Never read it into the conversation

Как установить скилл import-scripts?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл import-scripts запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить import-scripts с