agentleFS
vanillagreencomvanillagreencom/kendex/hooks/AGENTS.md

kendex / hooks

AGENTS.md76 starsChanged 2 months agoMITView on GitHub

Catalog hooks, one bash script per hook, each with its suite under tests/<name>.test.sh.

The file

Files
AGENTS.md

hooks/

Catalog hooks, one bash script per hook, each with its suite under tests/<name>.test.sh.

  • A hook opens with a commented frontmatter block between # --- lines: name, event (a name from crates/core/src/hook.rs::EVENTS), matcher, description, summary, safety, timeout (seconds) and an optional harnesses: [..] restricting delivery (Antigravity is reached only when named there, because its payload is toolCall.args, not tool_input); crates/core/src/hook/spec.rs reads it.
  • description is the constraint, for the agent. summary is one or two plain sentences for the person browsing: what the hook stops and what it costs them. It is what a catalog row, a Library row and the package page show, and a hook that writes none is shown its description instead. Both are one line — the header is read line by line, not as YAML.
  • Exit 0 allows; exit 2 refuses with the reason on stderr; a payload that cannot be read is a refusal, never a pass.
  • A refusal states what it refused, why, and the preferred remedy first, before any exemption path.
  • The first line of a refusal or a notice is <hook-name>: <key>=<value>; the rule it follows — a stable key, the value acted on, English below it, the text in one place, and what a suite may assert about it — is ../skills/code-quality/SKILL.md. Nothing precedes it: where a command the hook runs writes its own words, capture them at the site and hand them to the message function, which prints the keyed line, then the English, then that cause. A suite asserts the keyed line at position 1 and the cause below it.
  • There is no exception for text a person or a model reads. A format is exempt only where a named program parses that exact whole output; none does here, so what a suite would have read out of prose — which base doc-drift-check compared against, which arm session-drift-check's exit code chose — is emitted as a value and pinned as one. What the hook relays under its keyed lines, such as kendex check's report, is preserved exactly and asserted only as present.
  • The one thing a hook cannot put under its keyed line is output it never invoked: a diagnostic from shell startup, before the script runs. Everything the hook itself runs is captured at the site and replayed.
  • Two hooks have their keys fixed by what reads them, and they do not move. block-bare-cd: missing-tools=<comma list, in check order jq,cat,grep,sed>, payload=invalid-json, refused=bare-cd, each exit 2; a command with no bare cd exits 0 saying nothing. pre-commit-check: missing-tools=<comma list, in check order jq,cat,grep>, payload=invalid-json, bypass=<the matched word, verbatim>, unarmed=<the directory judged>, each exit 2; judged=<the directory judged> at exit 0 for the repository-moving notice; an armed repository with no bypass word exits 0 saying nothing.
  • A change to hooks/<n> lands the copies under .claude/hooks, .codex/hooks and .pi/kendex/hooks only where those already track the file, judged per file by a tools/guard lane; tests/* renders nowhere.
  • Shell stays Bash 3.2 compatible; tools/bash32-lint names Bash 4+ constructs in the guard's commit lane, and tools/bash32-parse parses this tree with a real Bash 3.2 under tools/guard --full and the guards shard.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.