diff --git a/install.sh b/install.sh index 9a3a60c..40c271b 100755 --- a/install.sh +++ b/install.sh @@ -189,12 +189,19 @@ if ! command -v jq >/dev/null 2>&1; then err " apt install jq (Debian/Ubuntu)" exit 1 fi +# Soft-warn on pandoc — the tomd primitive works without it for CSV / code / +# JSON / images, but fails on .docx / .pptx / .html. Opt-in use, so not +# promoted to a hard-fail. +if ! command -v pandoc >/dev/null 2>&1; then + warn "pandoc not found — tomd primitive will fail on .docx/.pptx. Install: brew install pandoc" +fi # --- create target dirs ----------------------------------------------------- say "creating directories" mkdir -p \ "$AGENTS_DIR/_blocks" \ "$AGENTS_DIR/_manifests" \ + "$AGENTS_DIR/_primitives" \ "$AGENTS_DIR/_templates" \ "$AGENTS_DIR/_assembler/src" \ "$AGENTS_DIR/_generated" \ @@ -221,6 +228,15 @@ say "copying shared blocks -> $AGENTS_DIR/_blocks/" backup_dir "$AGENTS_DIR/_blocks" cp -f "$KIT_DIR/_blocks/"*.md "$AGENTS_DIR/_blocks/" +# --- copy primitives (overwrite; primitives are SSoT from kit) ------------- +if [[ -d "$KIT_DIR/_primitives" ]]; then + say "copying primitives -> $AGENTS_DIR/_primitives/" + backup_dir "$AGENTS_DIR/_primitives" + cp -f "$KIT_DIR/_primitives/"*.sh "$AGENTS_DIR/_primitives/" 2>/dev/null || true + cp -f "$KIT_DIR/_primitives/README.md" "$AGENTS_DIR/_primitives/" 2>/dev/null || true + chmod +x "$AGENTS_DIR/_primitives/"*.sh 2>/dev/null || true +fi + # --- copy bridges (overwrite; templates are SSoT from kit) ----------------- if [[ -d "$KIT_DIR/_bridges" ]]; then say "copying bridge templates -> $AGENTS_DIR/_bridges/" @@ -272,7 +288,8 @@ fi # individually rather than the whole directory, so foreign hooks are not # dragged into .bak-TIMESTAMP snapshots on every re-run. say "copying hooks -> $HOOKS_DIR/" -for h in assemble-agents.sh assemble-validate.sh no-hand-edit-agents.sh; do +for h in assemble-agents.sh assemble-validate.sh no-hand-edit-agents.sh tomd-preread.sh; do + [ -f "$KIT_DIR/hooks/$h" ] || continue backup_file "$HOOKS_DIR/$h" cp -f "$KIT_DIR/hooks/$h" "$HOOKS_DIR/$h" chmod +x "$HOOKS_DIR/$h" diff --git a/settings-snippet.json b/settings-snippet.json index 8b88026..84f1317 100644 --- a/settings-snippet.json +++ b/settings-snippet.json @@ -30,6 +30,16 @@ "command": "~/.claude/hooks/no-hand-edit-agents.sh" } ] + }, + { + "matcher": "Read", + "hooks": [ + { + "type": "command", + "command": "~/.claude/hooks/tomd-preread.sh", + "statusMessage": "tomd pre-read auto-convert check..." + } + ] } ] }