Skip to main content
CORE:S:0029 deterministic high structure core

Hook Command Has Field

Hook configuration must contain at least one "command" key with a non-empty string value. The check scans for "command": "..." anywhere in the config file.

Antipatterns

  • Missing command field. Defining "type": "command" without a "command" key.
  • Empty command string. Setting "command": "" — the regex requires at least one character.
  • Command in wrong location. A "command" key outside the hooks block satisfies this check but may not function as a hook.

Pass / Fail

Pass

{ "type": "command", "command": "npm run lint" }

Fail

{ "type": "command" }

Limitations

Checks for any "command": "..." pattern in the file. Does not verify the field is inside a hook handler or that the handler's type is "command". Agent-specific rules supersede with additional context.