Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wisdom",
"version": "3.2.0",
"version": "3.2.1",
"owner": {
"name": "cmj",
"url": "https://github.com/cmj0121"
Expand All @@ -9,7 +9,7 @@
{
"name": "wisdom",
"description": "Single-purpose skills to plan, build, review and ship software, led by smith.",
"version": "3.2.0",
"version": "3.2.1",
"source": "./plugins/wisdom"
}
]
Expand Down
2 changes: 1 addition & 1 deletion plugins/wisdom/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wisdom",
"description": "Single-purpose skills to plan, build, review and ship software, led by smith.",
"version": "3.2.0",
"version": "3.2.1",
"license": "MIT",
"author": {
"name": "cmj",
Expand Down
16 changes: 15 additions & 1 deletion plugins/wisdom/hooks/shortcut-prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,26 @@
(`metadata.shortcut` in their frontmatter) and, on a hit, tells the model which
skill to run. Dispatch therefore no longer depends on the model choosing to run
the `shortcut` skill, and no skill file is read at the model's expense.
Silent no-op when no word matches.
Silent no-op when no word matches, or when the prompt is not the user's own text.
"""
import glob
import json
import os
import re
import sys

# How Claude Code opens a prompt the user did not type: a subagent's report, a
# background-task event, a message from another session. A magic word in one
# is something a model wrote, so it must not dispatch a skill.
NOT_USER = (
"Another Claude session sent a message:",
"<agent-message",
"[Subagent hand-back]",
"<cross-session-message",
"<task-notification",
"[SYSTEM NOTIFICATION",
)

# Highest priority first, mirroring how Claude Code resolves a skill name.
# The wisdom skills are invoked as `wisdom:<name>`; user and project ones bare.
def sources(cwd, plugin_root):
Expand Down Expand Up @@ -56,6 +68,8 @@ def main() -> int:
# tell the model to run what it is running.
if not prompt.strip() or prompt.lstrip().startswith("/"):
return 0
if prompt.lstrip().startswith(NOT_USER):
return 0

cwd = data.get("cwd") or os.environ.get("CLAUDE_PROJECT_DIR") or os.getcwd()
plugin_root = os.environ.get("CLAUDE_PLUGIN_ROOT") or os.path.dirname(os.path.dirname(__file__))
Expand Down
Loading