From 5187ed759790b62320192c9ed5439c3f3b1fc6b5 Mon Sep 17 00:00:00 2001 From: Haider Date: Sat, 13 Jun 2026 03:54:05 +0530 Subject: [PATCH] feat(altimate-code): SessionStart hook injecting skill-consultation directive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a SessionStart hook to the altimate-code plugin. On session boot, the handler outputs a hookSpecificOutput JSON with additionalContext text that directs the agent to consult Skills before reading files on data-engineering tasks, with explicit mention of altimate-code for warehouse / lineage / cross-DB work. Files added: skills/altimate-code/hooks/hooks.json — hook declaration skills/altimate-code/hooks-handlers/session-start.sh — handler shell script Validated locally: - hooks.json parses as valid JSON - handler executes cleanly and outputs 952 chars of valid JSON - claude --print --include-hook-events smoke produces 4 hook events, SessionStart fires correctly, additionalContext flows into session. --- .../altimate-code/hooks-handlers/session-start.sh | 13 +++++++++++++ skills/altimate-code/hooks/hooks.json | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 skills/altimate-code/hooks-handlers/session-start.sh create mode 100644 skills/altimate-code/hooks/hooks.json diff --git a/skills/altimate-code/hooks-handlers/session-start.sh b/skills/altimate-code/hooks-handlers/session-start.sh new file mode 100755 index 0000000..83e9a46 --- /dev/null +++ b/skills/altimate-code/hooks-handlers/session-start.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# SessionStart hook for the altimate-code skill. Injects a one-shot directive +# into the session's system prompt telling the agent to consult Skills before +# reading files when the task is data-engineering shaped. +cat <<'EOF' +{ + "hookSpecificOutput": { + "hookEventName": "SessionStart", + "additionalContext": "You have access to data-engineering skills via plugins: dbt-skills (refactoring, creating, testing, debugging, documenting, migrating dbt models, incremental models), snowflake-skills (finding expensive queries, optimizing query by id, optimizing query text), and altimate-code (warehouse access, column-level lineage, dbt builds against real warehouses, cross-database operations, multi-warehouse data parity). When the user's task involves dbt models, SQL refactoring, data warehouse work, query optimization, or cross-database operations, INVOKE THE Skill TOOL FIRST — before reading files, writing code, or starting work directly. Prefer altimate-code:altimate-code when the task needs live warehouse access, column-level lineage, dbt builds against a real warehouse, profiling, cost attribution, or cross-database migration. Use Skill consultation as your first action on every data-engineering task; the skill's body will tell you how to proceed." + } +} +EOF +exit 0 diff --git a/skills/altimate-code/hooks/hooks.json b/skills/altimate-code/hooks/hooks.json new file mode 100644 index 0000000..c1df509 --- /dev/null +++ b/skills/altimate-code/hooks/hooks.json @@ -0,0 +1,15 @@ +{ + "description": "Nudges the agent to consult Skills before reading files on data-engineering tasks, with explicit mention of altimate-code for warehouse/lineage/cross-DB work.", + "hooks": { + "SessionStart": [ + { + "hooks": [ + { + "type": "command", + "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh\"" + } + ] + } + ] + } +}