diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-19 01:48:26 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-19 01:48:26 -0500 |
| commit | 8f992af2b85faa65a9eb648d2c54944b5ca55248 (patch) | |
| tree | dee1bfe9e6cfd7ebe2f457a35c368327368e9191 | |
| parent | 68569726f4ca1e550a3e4e288a8f861703cdeb8e (diff) | |
| download | rulesets-8f992af2b85faa65a9eb648d2c54944b5ca55248.tar.gz rulesets-8f992af2b85faa65a9eb648d2c54944b5ca55248.zip | |
feat(rules): add triggers.md for cross-project launch phrases
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.
| -rw-r--r-- | claude-rules/triggers.md | 33 |
1 files changed, 33 insertions, 0 deletions
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 <project-path> +``` + +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 <path>` 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. |
