diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-20 08:56:59 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-20 08:56:59 -0500 |
| commit | 93c137a953e7a5fe69d781ebdb49fcc85ae67b0c (patch) | |
| tree | 31462099bf846d29913d76e163841ae237236623 /dotfiles | |
| parent | e065b4e10bf6c08587750911ffa9f4afa1d7842d (diff) | |
| download | archsetup-93c137a953e7a5fe69d781ebdb49fcc85ae67b0c.tar.gz archsetup-93c137a953e7a5fe69d781ebdb49fcc85ae67b0c.zip | |
aix: update to .ai/ layout; filter candidates to template projects
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.
Diffstat (limited to 'dotfiles')
| -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 } |
