Stats
Actions
Tags
From skill-engine
Runs a shell script on session start to initialize the plugin environment. Executes bash commands.
1 event · 1 hook
Where this hook configuration is defined
Defined inline in plugin.json manifest
Event handlers and matchers — expand Raw Configuration for the full JSON
if [ -z "${CLAUDE_PLUGIN_DATA:-}" ]; then
printf '%s\n' 'skill-engine: CLAUDE_PLUGIN_DATA not set; skipping engine state hydration' >&2
exit 0
fi
if ! command -v jq >/dev/null 2>&1; then
printf '%s\n' 'skill-engine: jq not on PATH; install jq via your package manager to enable engine state hydration' >&2
exit 0
fi
state_file="${CLAUDE_PLUGIN_DATA}/state/current.json"
if [ ! -f "$state_file" ]; then
state_dir=$(dirname "$state_file")
if ! mkdir -p "$state_dir" 2>/dev/null; then
printf '%s\n' "skill-engine: cannot create state dir $state_dir; check permissions" >&2
exit 0
fi
tmp_file="${state_file}.tmp.$$"
if printf '%s\n' '{"schema_version": 1, "workflow_set": []}' > "$tmp_file" 2>/dev/null && mv -f "$tmp_file" "$state_file" 2>/dev/null; then
printf '%s\n' 'skill-engine: plugin bootstrapping — first interaction will route to /skill-engine:engine-bootstrap' >&2
else
rm -f "$tmp_file" 2>/dev/null
printf '%s\n' "skill-engine: cannot write state file $state_file; check permissions" >&2
fi
exit 0
fi
if ! jq empty "$state_file" 2>/dev/null; then
printf '%s\n' "skill-engine: state file at $state_file is unparseable JSON; run /skill-engine:engine-bootstrap to re-initialize" >&2
exit 0
fi
schema_version=$(jq -r '.schema_version // empty' "$state_file")
case "$schema_version" in
''|*[!0-9]*) printf '%s\n' "skill-engine: state file missing required field 'schema_version'; run /skill-engine:engine-bootstrap" >&2; exit 0 ;;
esac
exit 0
npx claudepluginhub nick-railsback/skill-engine --plugin skill-engine