skills/ppt-station-skill/tests/test_parse_rebuild.sh
wangyitong a65adcc2e5 Initial commit: merged, deduplicated, and vetted skill collection
Sources: extracted from two upstream archives (skill-repo, skills-main),
merged with the following policy:

- 15 broken symlinks (pointing to /Users/jameslee/.cc-switch/skills or
  ../../.agents/skills on a foreign machine) discarded
- 3 real name collisions with identical content (ai-pair, ifind-http-api,
  zhipu-websearch) kept as one copy
- Functional overlaps deduped keeping the strongest variant:
  - docx family: kept docx (official, full toolchain) + docx-cn
    (GB/T 9704 Chinese official-document constants),
    dropped docx_writer (no scripts, name collided with docx)
  - humanizer family: kept humanizer-zh (6 zh reference docs),
    dropped humanizer (en, redundant for CN workflow)
- Skills that only ran in a foreign environment removed:
  ablemind-ops, app-publish, hlb-design-system, openclaw-adj-skill,
  claude-driver
- alphapai excluded from this public repo because its SKILL.md hard-coded
  live credentials

Result: 25 skills, 572 files, ~7.5 MB.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 14:47:12 +08:00

52 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# 测试 parse_ppt.py + rebuild_ppt.py - 解析重建流程
set -e
PYTHON=$(which python3 || which python)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJ_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
PARSE_SCRIPT="$SCRIPT_DIR/../scripts/parse_ppt.py"
REBUILD_SCRIPT="$SCRIPT_DIR/../scripts/rebuild_ppt.py"
TMPDIR=$(mktemp -d)
trap "rm -rf $TMPDIR" EXIT
echo "=== 测试 parse_ppt.py + rebuild_ppt.py ==="
echo "输入: $PROJ_DIR/aim/aim01.pptx"
# Step 1: 解析
echo "Step 1: 解析 PPT → JSON"
$PYTHON "$PARSE_SCRIPT" "$PROJ_DIR/aim/aim01.pptx" "$TMPDIR/parsed.json" 2>/dev/null
if [ ! -f "$TMPDIR/parsed.json" ]; then
echo "FAIL: parsed.json 未生成"
exit 1
fi
SIZE=$(wc -c < "$TMPDIR/parsed.json")
echo " parsed.json 大小: ${SIZE} bytes"
if [ "$SIZE" -lt 100 ]; then
echo "FAIL: parsed.json 太小"
exit 1
fi
# Step 2: 重建
echo "Step 2: 重建 JSON → PPT"
$PYTHON "$REBUILD_SCRIPT" "$TMPDIR/parsed.json" "$TMPDIR/rebuilt.pptx" 2>/dev/null
if [ ! -f "$TMPDIR/rebuilt.pptx" ]; then
echo "FAIL: rebuilt.pptx 未生成"
exit 1
fi
SIZE=$(wc -c < "$TMPDIR/rebuilt.pptx")
echo " rebuilt.pptx 大小: ${SIZE} bytes"
if [ "$SIZE" -lt 1000 ]; then
echo "FAIL: rebuilt.pptx 太小"
exit 1
fi
echo "PASS: parse + rebuild 流程正常"