Files
charleswiltgen__axiom/scripts/migrate-skill-namespace.sh
T
Charles Wiltgen 7e9facd7dc fix(privacy): remove the personal and production data still shipping
Found by an independent security review of the repo, not by a gate — the
leak-prevention hooks are filename-scoped and cannot see content classes.

- scripts/cursor/fixtures/cursor-3.17.8-hook-payloads.json embedded a real
  session path (which encodes the maintainer's home directory) and a real
  session UUID in seven fields.
- The committed .crash fixture kept the real app's Version and build stamp
  (1.0.0 / 1000000000), the crash's Date/Time and Launch Time with the
  device's UTC offset, and the full binary inventory of a framework whose name
  the anonymizer deliberately hides (wavpack, ogg, FLAC, opus, vorbis, lame,
  mpc, mpg123, sndfile, tta-cpp, Lottie) with their build UUIDs. The
  anonymizer has no rule for any of those keys, which is why they survived;
  editing them does not touch the fixture's fixed-point test because nothing
  rewrites them.
- scripts/migrate-skill-namespace.sh hardcoded /Users/you/Projects/Axiom,
  publishing the layout and making the script unusable anywhere else.
- Four shipped skill files used the maintainer's identity where the corpus
  uses placeholders: /Users/you/... in sandbox-and-file-access.md,
  ~/charles-personal.p12 and "Apple Distribution: Charles Personal (ABC123)"
  in code-signing.md, and an unpatterned device UDID in xctrace-ref.md.
- testflight-triage.md published measured production triage figures and a real
  app-internal symbol (16 of 17 signatures, crashHandlerSymbol); the lesson
  survives without the numbers or the symbol name.
- The three tool Makefiles built without -trimpath, so the maintainer's source
  path was embedded in every shipped binary, and xclog had no Makefile at all —
  its binary was hand-built with the absolute path in its debug info. All four
  tools now build with -trimpath; strings over the four shipped binaries
  reports zero /Users/you occurrences, down from xclog=1 and the three
  others at their previous values.
2026-09-15 14:10:29 -07:00

110 lines
3.9 KiB
Bash
Executable File

#!/bin/bash
# Migrate all skill names to use axiom- prefix
# Usage: ./scripts/migrate-skill-namespace.sh
set -e
cd "$(dirname "$0")/.." # repo root, wherever it lives
SKILLS_DIR=".claude-plugin/plugins/axiom/skills"
AGENTS_DIR=".claude-plugin/plugins/axiom/agents"
COMMANDS_DIR=".claude-plugin/plugins/axiom/commands"
DOCS_DIR="docs"
MANIFEST=".claude-plugin/plugins/axiom/claude-code.json"
echo "=== Axiom Namespace Migration ==="
echo ""
# Step 1: Get list of all current skill directory names
echo "Step 1: Building skill name list..."
SKILL_NAMES=$(ls -d $SKILLS_DIR/*/ 2>/dev/null | xargs -n1 basename | grep -v '^axiom-' | sort)
SKILL_COUNT=$(echo "$SKILL_NAMES" | wc -l | tr -d ' ')
echo "Found $SKILL_COUNT skills to migrate"
# Save skill names to temp file for reference
echo "$SKILL_NAMES" > /tmp/axiom-skill-names.txt
echo ""
# Step 2: Rename directories
echo "Step 2: Renaming skill directories..."
for skill in $SKILL_NAMES; do
if [ -d "$SKILLS_DIR/$skill" ]; then
new_name="axiom-$skill"
if [ ! -d "$SKILLS_DIR/$new_name" ]; then
mv "$SKILLS_DIR/$skill" "$SKILLS_DIR/$new_name"
echo " $skill$new_name"
fi
fi
done
echo ""
# Step 3: Update frontmatter name: fields
echo "Step 3: Updating frontmatter..."
for skill in $SKILL_NAMES; do
# Find files that might have this skill name in frontmatter
find $SKILLS_DIR -name "*.md" -exec grep -l "^name: $skill\$" {} \; 2>/dev/null | while read file; do
sed -i '' "s/^name: $skill\$/name: axiom-$skill/" "$file"
echo " Updated frontmatter: $file"
done
done
echo ""
# Step 4: Update /skill references
echo "Step 4: Updating /skill references..."
for skill in $SKILL_NAMES; do
# Update /skill skillname → /skill axiom-skillname
find $SKILLS_DIR $AGENTS_DIR $COMMANDS_DIR -name "*.md" -exec sed -i '' "s|/skill $skill|/skill axiom-$skill|g" {} \;
done
echo " Updated /skill references in plugin files"
echo ""
# Step 5: Update Related Skills sections and backtick references
echo "Step 5: Updating skill cross-references..."
for skill in $SKILL_NAMES; do
# Update backtick references like `swift-concurrency`
# Be specific: only match exact skill names
find $SKILLS_DIR -name "*.md" -exec sed -i '' "s|\`$skill\`|\`axiom-$skill\`|g" {} \;
# Update Skills: lists (e.g., "Skills: swift-concurrency, memory-debugging")
find $SKILLS_DIR -name "*.md" -exec sed -i '' "s|Skills: $skill|Skills: axiom-$skill|g" {} \;
find $SKILLS_DIR -name "*.md" -exec sed -i '' "s|, $skill|, axiom-$skill|g" {} \;
done
echo " Updated skill cross-references"
echo ""
# Step 6: Update manifest skill names
echo "Step 6: Updating manifest..."
for skill in $SKILL_NAMES; do
sed -i '' "s|\"name\": \"$skill\"|\"name\": \"axiom-$skill\"|g" "$MANIFEST"
done
echo " Updated $MANIFEST"
echo ""
# Step 7: Update documentation
echo "Step 7: Updating documentation..."
for skill in $SKILL_NAMES; do
# Update backtick references in docs
find $DOCS_DIR -name "*.md" -exec sed -i '' "s|\`$skill\`|\`axiom-$skill\`|g" {} \; 2>/dev/null || true
# Update links like [skill-name](/skills/path/skill-name)
find $DOCS_DIR -name "*.md" -exec sed -i '' "s|/$skill)|/axiom-$skill)|g" {} \; 2>/dev/null || true
find $DOCS_DIR -name "*.md" -exec sed -i '' "s|/$skill.md|/axiom-$skill.md|g" {} \; 2>/dev/null || true
done
echo " Updated documentation"
echo ""
# Step 8: Fix any accidental double-prefixes
echo "Step 8: Fixing double-prefixes..."
find $SKILLS_DIR $AGENTS_DIR $COMMANDS_DIR $DOCS_DIR -name "*.md" -exec sed -i '' 's|axiom-axiom-|axiom-|g' {} \; 2>/dev/null || true
sed -i '' 's|axiom-axiom-|axiom-|g' "$MANIFEST"
echo " Fixed double-prefixes"
echo ""
echo "=== Migration Complete ==="
echo ""
echo "Migrated $SKILL_COUNT skills"
echo ""
echo "Next steps:"
echo "1. Review changes: git diff --stat"
echo "2. Spot check: git diff .claude-plugin/plugins/axiom/skills/axiom-concurrency/"
echo "3. Test plugin: claude-code plugin reload axiom"
echo "4. Verify display: Ask Claude to help with iOS concurrency"