360 Secure SkillHub
360 安全技能中心

Repo Publisher

核心功能:将私有仓库同步为安全的公开版本,自动剥离密钥、私有IP、API密钥等敏感信息,支持自定义文件排除和内容替换规则,同步后还会扫描残留敏感信息。典型场景:需公开分享代码但要保护隐私数据时。通过运行bash脚本使用,输入私有仓库路径、公开仓库地址,可先执行dry-run预览清理结果,最终输出无敏感信息的公开仓库版本。

h-mascot
h-mascot
热度 24.29
最近更新 2026-06-04 00:17:48
分类:开发依赖:代码执行 / 读写文件 / 第三方 API应用场景:自动化脚本 / DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add ec-repo-publisher
Metadata
name
repo-publisher
version
1.0.0
description
Sync private repos to clean public versions. Strips secrets, private IPs, API keys, and custom patterns before publishing.

Repo Publisher

Publish cleaned versions of private repos for public sharing.

How It Works

  1. Private repo (henrino3/project) - your full backup with secrets, configs, everything
  2. Public repo (henrino3/project-public) - cleaned version safe to share
  3. publish.sh copies private → strips secrets → pushes to public

Usage

# Dry run first (shows what would be removed/replaced)
~/clawd/skills/repo-publisher/scripts/publish.sh \
  ~/Code/crewlink \
  git@github.com:henrino3/crewlink.git \
  --dry-run

# Actually publish
~/clawd/skills/repo-publisher/scripts/publish.sh \
  ~/Code/crewlink \
  git@github.com:henrino3/crewlink.git

Configuration Files

.publishignore

Place in your repo root. Lists files/dirs to exclude from public version (like .gitignore).

# Private configs
secrets/
private/
.env.local
my-private-notes.md
internal-docs/

# Agent-specific data
crewlink-api-keys.json
agent-tokens/

.publishreplace

Place in your repo root. Lists find|replace pairs for scrubbing private values.

# Format: FIND_STRING|REPLACE_STRING
henry@curacel.ai|you@example.com
Enterprise Crew|Your Crew Name
ada-gateway|your-server
henrymascot|your-username

What Gets Stripped Automatically

Even without config files, the script always strips:

  • secrets/ directories
  • *.key, *.pem, *.p12 files
  • .env and *.env files
  • *.log files
  • node_modules/
  • Tailscale IPs (100.x.x.x → YOUR_SERVER_IP)
  • Local IPs (192.168.x.x → YOUR_LOCAL_IP)
  • Common API key patterns (sk-, gho_, crewlink_, moltbook_)
  • Bearer tokens

Workflow for Ada

When Henry says "publish X" or "share X publicly":

  1. Check if public repo exists: gh repo view henrino3/X-public
  2. If not, create it: gh repo create henrino3/X-public --public
  3. Run dry-run first to review
  4. Run publish
  5. Share the public URL with Henry

Example: Publishing CrewLink

# Make crewlink repo private first
gh repo edit henrino3/crewlink --visibility private

# Create public version
gh repo create henrino3/crewlink-public --public --description "Agent social network for your AI crew"

# Publish clean version
~/clawd/skills/repo-publisher/scripts/publish.sh \
  ~/Code/crewlink \
  git@github.com:henrino3/crewlink-public.git

Secret Scanning

After stripping, the script scans for leaked secrets and warns if any are found. Always run --dry-run first on a new repo to review what gets cleaned.