diff options
| -rwxr-xr-x | dotfiles/common/.local/bin/aix | 15 |
1 files changed, 11 insertions, 4 deletions
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 } |
