Zero-dependency Claude Code plugin using Jungian archetypes as behavioral protocols for multi-agent orchestration. - 7 archetypes (Explorer, Creator, Maker, Guardian, Skeptic, Trickster, Sage) - ArcheHelix: rising PDCA quality spiral with feedback loops - Shadow detection: automatic dysfunction recognition and correction - 3 built-in workflows (fast, standard, thorough) - Autonomous mode: unattended overnight sessions with full visibility - Custom archetypes and workflows via markdown/YAML - SessionStart hook for automatic bootstrap - Examples for feature implementation and security review
30 lines
921 B
Bash
Executable File
30 lines
921 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# SessionStart hook for ArcheFlow plugin.
|
|
# Injects the using-archeflow skill as additional context.
|
|
|
|
set -euo pipefail
|
|
|
|
PLUGIN_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
SKILL_FILE="${PLUGIN_ROOT}/skills/using-archeflow/SKILL.md"
|
|
|
|
if [ ! -f "$SKILL_FILE" ]; then
|
|
echo '{}'
|
|
exit 0
|
|
fi
|
|
|
|
CONTENT=$(awk 'BEGIN{skip=0} /^---$/{skip++; next} skip>=2{print}' "$SKILL_FILE")
|
|
|
|
# Use node if available, fall back to printf-based JSON escaping
|
|
if command -v node &>/dev/null; then
|
|
node -e "
|
|
const content = require('fs').readFileSync('/dev/stdin', 'utf8');
|
|
console.log(JSON.stringify({
|
|
hookSpecificOutput: { additionalContext: content }
|
|
}));
|
|
" <<< "$CONTENT"
|
|
else
|
|
# Portable fallback: escape for JSON using sed
|
|
ESCAPED=$(printf '%s' "$CONTENT" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e ':a;N;$!ba;s/\n/\\n/g')
|
|
printf '{"hookSpecificOutput":{"additionalContext":"%s"}}' "$ESCAPED"
|
|
fi
|