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.
npx agentmods add instructions/lisachenko/z-engine/agents-mdgit clone --depth 1 https://github.com/lisachenko/z-engineWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.05224 | $0.05224 |
| Opus 5 | $0.02612 | $0.02612 |
| Sonnet 5 | $0.01045 | $0.01045 |
| Haiku 4.5 | $0.00522 | $0.00522 |
Grade A, and why
z-engine AGENTS.md scanned grade A with 0 findings 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 2d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 365 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Working on z-engine
z-engine reaches into the Zend Engine's own memory through PHP FFI. That makes it uniquely powerful and uniquely fragile: a wrong struct offset or a call against the wrong PHP version does not throw — it corrupts memory and segfaults the interpreter. These rules exist to keep that from happening. They apply to human contributors and automated agents alike.
The one rule that is non-negotiable: version matching
Never run z-engine code or tests against a PHP minor version other than the
one the current branch targets. The engine's C structures change between
every minor version (zend_class_entry alone changed size in 8.1, 8.3 and
8.4). z-engine reads those structures by offset. Run it on a mismatched
version and you are reading and writing the wrong memory — the result is a
crash, or worse, silent corruption.
mastertargets the newest supported PHP minor (currently 8.5).- Branch
8.4targets PHP 8.4. - Branch
8.0is the frozen legacy line for PHP 8.0.
Core::init() enforces this at runtime and refuses to boot on the wrong minor.
Do not try to defeat that guard.
Branch model
Fixes land on the minimum affected version branch and are merged upward,
never cherry-picked downward. The succession is declared in
.github/branch-flow.json and automated by .github/workflows/merge-up.yml,
which opens a merge-up PR when a version branch is pushed.
8.0 (frozen) 8.4 ──► master (8.5)
So a bug that exists in both 8.4 and 8.5 is fixed on 8.4, and the cascade
carries it into master. A bug that only exists on 8.5 is fixed on master
directly. When resolving a merge-up conflict inside include/, do not
merge the generated headers textually — regenerate them on the target branch
(composer gen-headers) instead.
Generated engine definitions — never hand-edit
Everything under include/<minor>/<os>-<arch>-<ts>/ is generated:
| File | What it is |
|---|---|
engine.h |
FFI header (structs, functions, globals) sliced from the PHP source |
constants.php |
#define/enum/opcode values, the ground truth for the PHP class constants |
layouts.json |
sizeof/offsetof of every dereferenced struct, from the C compiler |
probe.c |
the generated C probe (kept so a probe-only run can reuse it) |
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.
- 2d ago First seen · 365 lines · 5,224 tokens per session scan A c16a48ded4fe
z-engine AGENTS.md is an instructions file published in the GitHub repository lisachenko/z-engine (457 stars, last pushed 3d ago), licensed MIT. It adds 5,224 tokens to every session, about $0.0261 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
catch-admin AGENTS.md
Instructions for JaguarJack/catch-admin, covering catchadmin v5 - ai agent guidelines, role, 规则, 技术栈 and project 目录说明.
instructor-php AGENTS.md
Instructions for cognesy/instructor-php, covering key reference files, monorepo root, individual subpackages, code style and agents package style.
laravel AGENTS.md
AGENTS.md instructions for laravel/laravel, covering laravel application, prerequisites and agent setup.
marko CLAUDE.md
Instructions for marko-php/marko, covering marko framework, core principles, commands, run all tests including destructive integration tests and run with coverage.
FreshRSS php.instructions.md
Instructions for FreshRSS/FreshRSS, covering php files and autoloader.
FreshRSS _general.instructions.md
Instructions for FreshRSS/FreshRSS, covering freshrss general instructions, kiss principle: keep it simple, style and formatting and spelling.