enforcement_matrix

enforcement_matrix is an agent for coding agents from atebites-hub/PJTemplate. It costs 0 tokens per session (4,251 once invoked), scanned B, original, MIT.

A project template built around one compliance-checking script for verifying required task memories, code documentation mirrors, and recorded reasoning.

In plain words
What is it for?
Use it to check that development work includes the required memories, documentation files, and reasoning records across different coding-agent tools.
Why use it?
It replaces scattered manual checks and tool-specific hooks with one stated source of truth for whether a change follows the project's process.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/atebites-hub/pjtemplate/enforcement_matrix
Clone the repo
git clone --depth 1 https://github.com/atebites-hub/PJTemplate

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for enforcement_matrix

README.md
[![agentmods](https://agentmods.dev/badge/agents/atebites-hub/pjtemplate/enforcement_matrix.svg)](https://agentmods.dev/agents/atebites-hub/pjtemplate/enforcement_matrix)
Your own site
<a href="https://agentmods.dev/agents/atebites-hub/pjtemplate/enforcement_matrix"><img src="https://agentmods.dev/badge/agents/atebites-hub/pjtemplate/enforcement_matrix.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,251 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.04251
Opus 5 $0.00000 $0.02125
Sonnet 5 $0.00000 $0.00850
Haiku 4.5 $0.00000 $0.00425

Measured 3d ago against content hash f962f62de6a6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

enforcement_matrix scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

| **Claude Code** | `PreToolUse`, `PostToolUse`, `Stop`, `SubagentStop`, `SessionStart`, `SessionEnd`, `UserPromptSubmit`, `Notification`, `PreCompact`, and more. `Stop` fires "when Claude finishes responding." `SessionS
docs/agents/enforcement_matrix.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Enforcement Capability Matrix

1. The problem and the three-tier design

This template enforces process artifacts — task memories (docs/memories/), docs/code/ mirrors for every code file, and recorded reasoning — through a single script, scripts/check-task-compliance.sh. The script is the one source of truth for "is this change compliant?"; everything else is just a trigger that runs it.

The core constraint: there is no universal, cross-agent hook standard. Each coding harness (Claude Code, Cursor, Codex, Copilot CLI, Droid, etc.) ships its own hook schema, event names, and config location, and several popular tools (notably Google Antigravity at time of writing) have no stable, documented hook mechanism at all. Hook event names are even superficially similar across tools — PreToolUse/Stop appear in Claude Code, Codex, and Droid — but the JSON shapes, config paths, and exit-code semantics differ, and none is contractually stable. Building authoritative enforcement on any single harness's hooks would (a) break the moment a teammate uses a different agent, and (b) silently disappear if that harness changes or drops its hook API.

Because of this, enforcement is layered into three tiers, ordered by authority:

  • Tier 1 — Authoritative, portable spine: a native committed git hook. .githooks/pre-commit (activated per clone with git config core.hooksPath .githooks) calls scripts/check-task-compliance.sh --staged. This depends only on git itself — no Python framework, no Node, no per-harness API — and runs identically regardless of which agent (or human) produced the commit. It is the layer we treat as definitive locally.
  • Tier 2 — Fast in-loop accelerators: optional per-harness adapters. Where a harness does expose a documented "the agent just finished" lifecycle event, we can wire that event to the same script (--task) so the agent gets feedback during its loop instead of waiting for git commit. These are conveniences, not guarantees; they are opt-in and harness-specific. We ship exactly one: the Claude Code Stop hook.
  • Tier 3 — Non-bypassable backstop: CI. Any client-side git hook — native, husky, or pre-commit framework — is trivially skipped with git commit --no-verify (git docs: githooks; Adam Johnson: Git skip hooks). The only enforcement a developer cannot locally bypass is a server-side / CI gate. CI re-runs the same script over the PR commit range (--range BASE..HEAD) and branch protection blocks the merge on failure.

Read the full file on GitHub · 139 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 139 lines · 0 tokens per session scan B f962f62de6a6

Subscribe to this mod's changes

enforcement_matrix is an agent published in the GitHub repository atebites-hub/PJTemplate (2 stars, last pushed 11d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,251 tokens. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.