Skip to content

agent-events

Agent events must be an array with maximum 3 event names

From plugin
claudelint
1113 skills13 agents1 command1 hook
Install
$ npx -y skills add pdugan20/claudelint --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

Agent events must be an array with maximum 3 event names

Agent definition

agent-events.md
description: "Agent events must be an array with maximum 3 event names"

agent-events

<RuleHeader description="Agent events must be an array with maximum 3 event names" severity="error" :fixable="false" :configurable="false" category="Agents" />

Rule Details

This rule validates the `events` field in agent frontmatter. Events must be an array of strings with a maximum of 3 items. This constraint keeps agents focused on a small set of triggers rather than responding to every possible event. The validation is enforced via the AgentFrontmatterWithRefinements schema.

Incorrect

Agent with too many events

---
name: my-agent
description: Monitors everything
events:
  - PreToolUse
  - PostToolUse
  - Stop
  - SessionStart
---

Correct

Agent with a focused set of events

---
name: my-agent
description: Validates tool usage
events:
  - PreToolUse
  - PostToolUse
---

How To Fix

Reduce the `events` array to at most 3 entries. If you need to respond to more events, consider splitting the logic across multiple focused agents.

Options

This rule does not have any configuration options.

Related Rules

  • [`agent-hooks`](/rules/agents/agent-hooks)
  • [`agent-description`](/rules/agents/agent-description)

Resources

  • [Rule Implementation](https://github.com/pdugan20/claudelint/blob/main/src/rules/agents/agent-events.ts)
  • [Rule Tests](https://github.com/pdugan20/claudelint/blob/main/tests/rules/agents/agent-events.test.ts)

Version

Available since: v0.2.0

Read more
Ships withclaudelint

A linter for Claude Code projects. Validates CLAUDE.md files, skills, settings, hooks, MCP servers, plugins, and more.

Get the whole plugin, auto-invoked
Stats
11
Stars
0
Views
0
Forks
Active
Maintenance
TypeScript
Language
MIT
License
2d ago
Last commit
6mo ago
Created

Repo: pdugan20/claudelint