From 93c137a953e7a5fe69d781ebdb49fcc85ae67b0c Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 20 Apr 2026 08:56:59 -0500 Subject: aix: update to .ai/ layout; filter candidates to template projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two changes: - AI_INSTRUCTIONS now points at .ai/protocols.org (was docs/) — aligns with the template docs/ → .ai/ restructure - build_candidates filters directories to those with .ai/protocols.org present. Previously listed every dir under ~/code/ and ~/projects/ including third-party clones and non-template projects, which would fail silently when Claude tried to read a missing protocols file. New projects that haven't been initialized (no .ai/ yet) will not appear in the fzf list. Bootstrap those with a direct claude invocation; the first-session workflow takes over once .ai/ exists. --- dotfiles/common/.local/bin/aix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'dotfiles/common') diff --git a/dotfiles/common/.local/bin/aix b/dotfiles/common/.local/bin/aix index ad40d84..6f94cfb 100755 --- a/dotfiles/common/.local/bin/aix +++ b/dotfiles/common/.local/bin/aix @@ -22,7 +22,7 @@ done # Claude command — separated for safe editing AI_CMD="claude" -AI_INSTRUCTIONS='Read docs/protocols.org and follow all instructions.' +AI_INSTRUCTIONS='Read .ai/protocols.org and follow all instructions.' # Create a window in the session and launch claude; prints window ID create_window() { @@ -41,18 +41,25 @@ read_selections() { done <<<"$1" } +# Add a directory to candidates only if it's a Claude-template project +# (has .ai/protocols.org). New projects need manual setup outside aix. +maybe_add_candidate() { + local dir="$1" + [ -f "$dir/.ai/protocols.org" ] && candidates+=("~/${dir#"$HOME"/}") +} + # Build candidate directory list build_candidates() { candidates=() - [ -d "$HOME/.emacs.d" ] && candidates+=("~/.emacs.d") + maybe_add_candidate "$HOME/.emacs.d" if [ -d "$HOME/code" ]; then while IFS= read -r d; do - candidates+=("~/${d#"$HOME"/}") + maybe_add_candidate "$d" done < <(find "$HOME/code" -maxdepth 1 -mindepth 1 -type d | sort) fi if [ -d "$HOME/projects" ]; then while IFS= read -r d; do - candidates+=("~/${d#"$HOME"/}") + maybe_add_candidate "$d" done < <(find "$HOME/projects" -maxdepth 1 -mindepth 1 -type d | sort) fi } -- cgit v1.2.3