mb-engineering-core

Shared engineering instructions used by Memory Bank implementation agents. They require reading the work specification and project rules, writing tests before code, and collecting evidence before claiming that work is complete.

In plain words
What is it for?
Use them to implement one defined work item at a time, follow TDD, apply architecture and coding rules, handle edge cases, and report completion against explicit acceptance criteria.
Why use it?
They provide a common quality process for different specialist agents. This reduces untested changes, misunderstood requirements, and claims based only on local assumptions.

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/fockus/skill-memory-bank/mb-engineering-core
Clone the repo
git clone --depth 1 https://github.com/fockus/skill-memory-bank
Per session 51 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,020 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00051 $0.02020
Opus 5 $0.00026 $0.01010
Sonnet 5 $0.00010 $0.00404
Haiku 4.5 $0.00005 $0.00202

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

Security

Grade A, and why

mb-engineering-core 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 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.

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.

agents/mb-engineering-core.md · 157 lines

How it starts

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

MB Engineering Core — shared discipline

This is a prepended partial, not an agent. /mb work inlines this block ahead of the role-specific agent delta. It carries the discipline every MB implementer obeys; the role file that follows adds domain-specific rules and the output contract. When the two conflict, the stricter rule wins.

You implement one work item at a time against its DoD. Quality means production-ready, not tests-pass-on-my-machine.

1. Read before you type

Read the work item (heading + body + DoD) in full, plus ./.memory-bank/RULES.md and the global ~/.claude/RULES.md. If a plan/spec path is provided, read the linked stages and ## Edge Cases. Do not start coding before you understand the contract. Code understanding is graph-first: use the role file's code-graph routing table (mb-graph-query.py, fail-open to Grep/Glob/Read when stale).

2. TDD — test before code (Red → Green → Refactor)

  • Red: write the failing test first. Assert a business fact, not an implementation detail (assert order.is_paid, not assert mock.calls == [...]).
  • Green: the minimal code to pass. No more.
  • Refactor: remove duplication, improve names — tests stay green.

Skip TDD ONLY for typo-fixes, formatting, or exploratory prototypes the user explicitly approved.

3. Contract-First

Before a non-trivial component: define the Protocol / ABC / interface (ISP: ≤5 methods, else split), write contract tests against the abstraction (must pass for ANY conforming impl), then implement.

Contract drift = BUG. The implementation signature must match the interface EXACTLY — argument types, return type, keyword vs positional. commit(ns, entries: list) and commit(ns, key, value) are different contracts; shipping the second against the first is a defect, not a detail.

4. Clean Architecture — dependency direction is one-way

Layer May depend on MUST NOT depend on
Domain stdlib / language only application, infrastructure, frameworks, ORM, HTTP, SDK
Application domain, shared infrastructure, interfaces
Infrastructure domain, application, shared interfaces
Interfaces domain, application, shared

Read the full file on GitHub · 157 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 · 157 lines · 51 tokens per session scan A c5061d8c194c

Subscribe to this mod's changes

mb-engineering-core is an agent published in the GitHub repository fockus/skill-memory-bank (25 stars, last pushed 1mo ago), licensed MIT. It adds 51 tokens to every session and 2,020 once invoked, about $0.0003 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.