Files
proffesor-for-testing__agen…/scripts/prepare-assets.sh
Profa b6fe4abec8 fix: resolve MCP path, stale v3/ refs, CRLF line endings, and rewrite README
- Fix MCP entry path resolution in mcp.ts (1 level up, not 2)
- Remove stale v3/ directory references in 10-workers.ts
- Fix CRLF line endings in 170+ skill files breaking frontmatter parsing
- Add CRLF→LF safety net in prepare-assets.sh
- Rewrite README.md for clarity (1097→280 lines, outcome-focused)
- Sync assets from .claude/skills via prepare-assets.sh

Fixes issues reported in v3.7.9 upgrade (skill-lint failures, MCP errors)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 15:46:53 +00:00

93 lines
4.6 KiB
Bash
Executable File

#!/bin/bash
# Prepare assets for npm publish
# Copies skills and agents from the repo to the package assets directory
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
echo "📦 Preparing assets for npm publish..."
# Create asset directories
mkdir -p "$REPO_ROOT/assets/skills"
mkdir -p "$REPO_ROOT/assets/agents/v3"
# Copy skills (QE-related skills: v2 methodology and v3 domain skills)
echo "📋 Copying skills..."
if [ -d "$REPO_ROOT/.claude/skills" ]; then
# V2 QE skills (testing-related with generic names)
V2_QE_SKILLS="accessibility-testing api-testing-patterns bug-reporting-excellence chaos-engineering-resilience code-review-quality compatibility-testing compliance-testing consultancy-practices context-driven-testing contract-testing database-testing exploratory-testing-advanced holistic-testing-pact localization-testing mobile-testing mutation-testing pair-programming performance-testing quality-metrics refactoring-patterns regression-testing risk-based-testing security-testing shift-left-testing shift-right-testing six-thinking-hats tdd-london-chicago technical-writing test-automation-strategy test-data-management test-design-techniques test-environment-management test-reporting-analytics verification-quality visual-testing-advanced xp-practices"
# Additional QE skills not matching qe-* prefix or V2 list
EXTRA_QE_SKILLS="a11y-ally brutal-honesty-review cicd-pipeline-qe-orchestrator debug-loop enterprise-integration-testing middleware-testing-patterns observability-testing-patterns pentest-validation pr-review security-visual-testing sfdipot-product-factors sherlock-review testability-scoring test-idea-rewriting wms-testing-patterns"
for skill_dir in "$REPO_ROOT/.claude/skills"/*; do
if [ -d "$skill_dir" ]; then
skill_name=$(basename "$skill_dir")
# Include: qe-* skills, qcsd-* swarms, n8n-* testing, core skills, and QE methodology skills
if [[ "$skill_name" =~ ^qe- ]] || \
[[ "$skill_name" =~ ^qcsd- ]] || \
[[ "$skill_name" =~ ^n8n- ]] || \
[[ "$skill_name" == "agentic-quality-engineering" ]] || \
[[ "$skill_name" == "aqe-v2-v3-migration" ]] || \
[[ " $V2_QE_SKILLS " =~ " $skill_name " ]] || \
[[ " $EXTRA_QE_SKILLS " =~ " $skill_name " ]]; then
cp -r "$skill_dir" "$REPO_ROOT/assets/skills/"
fi
fi
done
echo " ✅ Copied $(ls -1 "$REPO_ROOT/assets/skills" | wc -l | tr -d ' ') skills"
else
echo " ⚠️ Skills directory not found at $REPO_ROOT/.claude/skills"
fi
# Copy agents (qe-* agents - ADR-045 version-agnostic naming)
echo "🤖 Copying agents..."
if [ -d "$REPO_ROOT/.claude/agents/v3" ]; then
# Copy qe-* agents (version-agnostic naming per ADR-045)
for agent_file in "$REPO_ROOT/.claude/agents/v3"/qe-*.md; do
if [ -f "$agent_file" ]; then
cp "$agent_file" "$REPO_ROOT/assets/agents/v3/"
fi
done
# Copy subagents directory if it exists
if [ -d "$REPO_ROOT/.claude/agents/v3/subagents" ]; then
mkdir -p "$REPO_ROOT/assets/agents/v3/subagents"
for agent_file in "$REPO_ROOT/.claude/agents/v3/subagents"/qe-*.md; do
if [ -f "$agent_file" ]; then
cp "$agent_file" "$REPO_ROOT/assets/agents/v3/subagents/"
fi
done
fi
agent_count=$(find "$REPO_ROOT/assets/agents/v3" -name "*.md" | wc -l | tr -d ' ')
echo " ✅ Copied $agent_count agents"
else
echo " ⚠️ Agents directory not found at $REPO_ROOT/.claude/agents/v3"
fi
# Copy validation infrastructure (ADR-056)
echo "🔍 Copying validation infrastructure..."
if [ -d "$REPO_ROOT/.claude/skills/.validation" ]; then
mkdir -p "$REPO_ROOT/assets/skills/.validation"
cp -r "$REPO_ROOT/.claude/skills/.validation/"* "$REPO_ROOT/assets/skills/.validation/"
echo " ✅ Copied validation infrastructure"
echo " - schemas: $(ls -1 "$REPO_ROOT/assets/skills/.validation/schemas" 2>/dev/null | wc -l | tr -d ' ') files"
echo " - templates: $(ls -1 "$REPO_ROOT/assets/skills/.validation/templates" 2>/dev/null | wc -l | tr -d ' ') files"
echo " - examples: $(ls -1 "$REPO_ROOT/assets/skills/.validation/examples" 2>/dev/null | wc -l | tr -d ' ') files"
else
echo " ⚠️ Validation directory not found at $REPO_ROOT/.claude/skills/.validation"
fi
# Strip CRLF line endings from all text files (safety net)
echo "🔧 Normalizing line endings..."
find "$REPO_ROOT/assets" -type f \( -name "*.md" -o -name "*.json" -o -name "*.yaml" -o -name "*.yml" -o -name "*.js" \) -exec sed -i 's/\r$//' {} +
echo " ✅ All text files normalized to LF"
# Remove .DS_Store files
find "$REPO_ROOT/assets" -name ".DS_Store" -delete
echo "✨ Asset preparation complete!"