Prepare and publish an OpenClaw skill to ClawHub. This skill codifies the audit → generalize → publish workflow.
npx clawhub@latest install)Before creating any copy, audit the source skill for secrets and PII:
CategoryExamplesActionSecretsAPI keys, tokens, passwords, private keysMust removePathsAbsolute paths ( /home/username/..., /Users/...)Replace with env var or ~ relativeDiscord IDsChannel IDs, user IDs, guild IDs, message IDsRemove or replace with env varTimezonesHardcoded IANA timezone stringsReplace with env varPersonal dataReal names, emails, phone numbers, medication namesRemove or generalizeNetwork infoIP addresses, internal URLs, port numbersRemove or replace with placeholdersCustom identifiersUser-specific labels, internal project namesGeneralize
Create a separate directory (never modify the live skill):
text
$CLAWHUB_DEFAULT_DIR/<skill-name>-skill/
Default base: ~/projects/skills (override via CLAWHUB_DEFAULT_DIR env var).
Directory structure:
text
<skill-name>-skill/
├── SKILL.md # Manifest (generalized)
├── README.md # User-facing docs
├── .gitignore # Standard ignores
├── scripts/ # Script files (generalized)
├── references/ # Optional reference docs
└── ... # Any other skill-specific files
For each file in the skill:
SKILL.md frontmatter:
env: block declaring all extracted env vars with descriptions and required/optionaldescriptionScripts (Python, Shell, etc.):
os.environ.get("VAR", fallback) / env var readsnow()/ utc_now() fallbacks that bypass source timestamps — raise errors insteadDocumentation (Markdown):
Shell wrappers:
SCRIPT="$(cd "$(dirname "$0")" && pwd)/tracker.py"Run a final grep across all files:
bash
grep -rn "hardcoded_pattern1\|hardcoded_pattern2\|..." --include="*.py" --include="*.md" --include="*.sh" .
Verify:
bash
git init
git add -A
git commit -m "Initial publishable copy — no PII, no secrets"
Always confirm with the user before publishing.
bash
npx clawhub@latest publish --slug <skill-name> --version <version> --name "<display name>" /absolute/path/to/skill-dir
Gotchas:
. — cwd may not propagate through exec/shell layers--slug is required — without it, the CLI picks up the directory namepublish-skill, skill-publisher, etc.) is likely taken. Pick something unique or namespaced (e.g. myname-publish-helper)Common version bumps:
1.0.01.0.0 → 1.0.1)1.0.0 → 1.1.0)After publishing, report the slug, version, and install command to the user.
Before:
python
TIMEZONE = ZoneInfo("America/Los_Angeles")
WORKSPACE = "/home/user/.openclaw/workspace"
After:
python
TZ_STR = os.environ.get("MEDICATION_TIMEZONE", "UTC")
TIMEZONE = ZoneInfo(TZ_STR)
WORKSPACE = os.environ.get("WORKSPACE", os.path.expanduser("~/.openclaw/workspace"))
Before:
python
MORNING_MEDS = ["RealMedA", "RealMedB"]
KNOWN_MEDS = ["RealMedA", "RealMedB", "RealMedC"]
After:
python
# Edit these lists to match your regimen
MORNING_MEDS: list[str] = [] # e.g. ["MedA", "MedB"]
KNOWN_MEDS: list[str] = [] # e.g. ["MedA", "MedB", "MedC"]
Before:
python
dt_utc = datetime.fromisoformat(ts) if ts else datetime.now(timezone.utc)
After:
python
if not ts:
raise ValueError("timestamp_utc is required — source message timestamp must be provided")
dt_utc = datetime.fromisoformat(ts.replace("Z", "+00:00"))
Add --changelog <text> to the publish command for release notes. Example:
bash
npx clawhub@latest publish --slug my-skill --version 1.1.0 --changelog "Added env var support, fixed timestamp handling" .
CommandPurposenpx clawhub@latest loginAuthenticate (browser callback)npx clawhub@latest whoamiVerify authnpx clawhub@latest publish --slug X --version Y .Publish from current dirnpx clawhub@latest inspect <slug>View published metadatanpx clawhub@latest search <query>Search registry
Publish must run from inside the skill directory (requires SKILL.md in cwd).
SKILL.md — this filereferences/checklist.md — quick audit checklistenv: frontmatter — that's a registry display issue, not a skill issue