.claude/skills/notification-triggers/SKILL.md
Configurable regex-based alert system for detecting patterns in tool calls and session activity. Supports error triggers, content regex matching, token threshold triggers, and pattern detection with configurable actions.
npx skillsauth add oimiragieo/agent-studio notification-triggersInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Read relevant files and understand requirements
Perform the skill's main function using available tools
Return results and save artifacts if applicable
</execution_process>
<best_practices>
</best_practices> </instructions>
<examples> <usage_example> **Example Commands**:# Invoke this skill
/notification-triggers [arguments]
# Or run the script directly
node .claude/skills/notification-triggers/scripts/main.cjs --help
</usage_example> </examples>
Notification triggers are defined in .claude/context/runtime/notification-triggers.json:
{
"version": "1.0",
"triggers": [
{
"id": "unique-trigger-id",
"name": "Human-readable trigger name",
"description": "What this trigger detects",
"type": "error|regex|token_threshold|pattern",
"enabled": true,
"condition": {
"pattern": "regex pattern to match",
"minTokens": 120000,
"minOccurrences": 3,
"scope": "session|task|global"
},
"actions": [
{
"type": "log|alert|spawn_agent|interrupt",
"target": "agent-name|file-path",
"message": "Action message template"
}
]
}
]
}
Condition Fields:
pattern — JavaScript RegExp (error/regex triggers)minTokens — Token threshold for alert (token_threshold trigger)minOccurrences — Pattern match count before triggering (pattern trigger)scope — Where to evaluate: current session, task, or cumulativeAction Types:
log — Write to .claude/context/runtime/notifications.jsonlalert — Display alert in session outputspawn_agent — Create Task() to handle the notificationinterrupt — Pause execution for user inputStep 1: Load Configuration
.claude/context/runtime/notification-triggers.jsonStep 2: Evaluate Conditions For each enabled trigger:
pattern against tool stdout/stderrminTokensminOccurrencesStep 3: Execute Matched Actions If condition is true:
.claude/context/runtime/notification-log.jsonlStep 4: Record Event
{
"timestamp": "ISO-8601",
"triggerId": "id",
"triggerName": "name",
"matched": true,
"context": {
"sessionId": "current session",
"taskId": "current task",
"tokenCount": number
}
}
Log Action
// Append to notifications.jsonl
fs.appendFileSync(
notificationsPath,
JSON.stringify({
timestamp: new Date().toISOString(),
triggerId: trigger.id,
message: renderTemplate(action.message, context),
severity: 'info|warn|error',
}) + '\n'
);
Alert Action
// Write to stdout with standard format
console.log(`\n🔔 NOTIFICATION [${trigger.name}]\n${renderedMessage}\n`);
Spawn Agent Action
// Create async task to handle notification
Task({
task_id: `notify-${trigger.id}-${Date.now()}`,
subagent_type: action.target,
prompt: `Handle notification: ${trigger.description}\nContext: ${JSON.stringify(context)}`,
});
Interrupt Action
// Pause and ask user
const response = await AskUserQuestion({
question: `${trigger.name}: ${action.message}\n\nContinue? [y/n]`,
});
if (response.toLowerCase() !== 'y') {
process.exit(0);
}
{
"id": "token-threshold-warning",
"name": "High Token Usage Warning",
"description": "Alert when session exceeds 120K tokens",
"type": "token_threshold",
"enabled": true,
"condition": {
"minTokens": 120000,
"scope": "session"
},
"actions": [
{
"type": "log",
"message": "Session token count: ${tokenCount}"
},
{
"type": "alert",
"message": "⚠️ Token budget at 60% — consider compression"
},
{
"type": "spawn_agent",
"target": "context-compressor",
"message": "Proactive context compression triggered"
}
]
}
{
"id": "hook-error-pattern",
"name": "Hook Execution Errors",
"description": "Detect repeated hook failures in session",
"type": "pattern",
"enabled": true,
"condition": {
"pattern": "hook.*error|hook.*failed|HOOK_ERROR",
"minOccurrences": 3,
"scope": "session"
},
"actions": [
{
"type": "log",
"message": "Hook error pattern detected: ${patternMatches} occurrences"
},
{
"type": "alert",
"message": "🚨 Hook system unstable — check logs"
}
]
}
{
"id": "security-violation-detect",
"name": "Security Policy Violation",
"description": "Alert on potential security violations",
"type": "regex",
"enabled": true,
"condition": {
"pattern": "shell:\\s*true|JSON\\.parse\\(|eval\\(|exec\\(",
"scope": "task"
},
"actions": [
{
"type": "alert",
"message": "⚠️ Potential security issue detected — review code"
},
{
"type": "spawn_agent",
"target": "security-architect",
"message": "Review potential security issue in task output"
},
{
"type": "interrupt",
"message": "Continue despite security concern?"
}
]
}
For code discovery, follow this priority order:
pnpm search:code "<query>" (Primary intent-based search)ripgrep (for exact keyword/regex matches)Before starting:
cat .claude/context/memory/learnings.md
cat .claude/context/memory/decisions.md
After completing:
.claude/context/memory/learnings.md.claude/context/memory/issues.md.claude/context/memory/decisions.mdASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
tools
Comprehensive biosignal processing toolkit for analyzing physiological data including ECG, EEG, EDA, RSP, PPG, EMG, and EOG signals. Use this skill when processing cardiovascular signals, brain activity, electrodermal responses, respiratory patterns, muscle activity, or eye movements. Applicable for heart rate variability analysis, event-related potentials, complexity measures, autonomic nervous system assessment, psychophysiology research, and multi-modal physiological signal integration.
tools
Comprehensive toolkit for creating, analyzing, and visualizing complex networks and graphs in Python. Use when working with network/graph data structures, analyzing relationships between entities, computing graph algorithms (shortest paths, centrality, clustering), detecting communities, generating synthetic networks, or visualizing network topologies. Applicable to social networks, biological networks, transportation systems, citation networks, and any domain involving pairwise relationships.
data-ai
Molecular featurization for ML (100+ featurizers). ECFP, MACCS, descriptors, pretrained models (ChemBERTa), convert SMILES to features, for QSAR and molecular ML.
development
Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.