From 8f992af2b85faa65a9eb648d2c54944b5ca55248 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 19 May 2026 01:48:26 -0500 Subject: feat(rules): add triggers.md for cross-project launch phrases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds claude-rules/triggers.md as the home for phrases the user says from any cwd to invoke a cross-project action. First entry: "launch project X" → run the ai script in single-project mode targeting the matched basename. Ambiguity handling: list candidates and ask rather than guess. The trigger phrases already in protocols.org ("Let's run the [X] workflow", "Wrap it up") are project-scoped. They assume an active .ai/ session. Cross-project launchers don't fit that layer; they need to work from any cwd, including outside any project. None of the existing claude-rules files (commits.md, testing.md, verification.md, subagents.md, interaction.md, cross-project.md, todo-format.md) had a clean fit either. A new file is the smallest architectural change. Makefile picks up new claude-rules/*.md files via wildcard, so no Makefile change needed. make install created the symlink at ~/.claude/rules/triggers.md; make doctor reports 39/0/0. --- claude-rules/triggers.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 claude-rules/triggers.md (limited to 'claude-rules') diff --git a/claude-rules/triggers.md b/claude-rules/triggers.md new file mode 100644 index 0000000..e45e660 --- /dev/null +++ b/claude-rules/triggers.md @@ -0,0 +1,33 @@ +# Cross-Project Trigger Phrases + +Applies to: `**/*` + +Trigger phrases the user can say from any session to invoke a cross-project action. These live in the global rules layer because they cross project boundaries — the user can be sitting in any cwd, including outside a project, and the phrase still means the same thing. + +## "Launch project X" + +Synonyms: "Launch X", "Open project X", "Switch to project X". + +**Action:** run the `ai` script (the Claude Code session launcher, installed at `~/.local/bin/ai`) in single-project mode targeting the named project. + +``` +ai +``` + +The `ai` script handles tmux session creation, window placement, and the per-project Claude opening line — see `~/code/rulesets/claude-templates/bin/ai` for the canonical source. + +**Resolving X.** Match against project basenames discoverable by `ai` — directories under `~/code/`, `~/projects/`, and `~/.emacs.d` that contain `.ai/protocols.org`. + +- Exact basename match (case-insensitive) → invoke `ai ` directly. +- No match → list all available basenames, ask which to launch. +- Multiple partial matches (X is a substring of two or more candidates) → list the matching basenames, ask which. + +Do not guess. The cost of asking once is one short turn; launching the wrong project is a wrong-context Claude session that has to be killed and restarted. + +## Why a separate file + +Other claude-rules files cover specific concerns: `commits.md` for the publish flow, `subagents.md` for delegation, `testing.md` for test discipline. None is a natural home for "phrases the user says to trigger global actions." The trigger phrases in `protocols.org` (`Let's run the [X] workflow`, `Wrap it up`) are project-scoped — they assume an active `.ai/` session. Cross-project launchers warrant their own file. + +## Adding new triggers + +Same shape. Each entry: phrase (in quotes), synonyms, the action, ambiguity handling. -- cgit v1.2.3