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 skills/othmanadi/mddesign/memory-layernpx skills add OthmanAdi/MDDesign --skill memory-layergit clone --depth 1 https://github.com/OthmanAdi/MDDesignWhat 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.00056 | $0.01231 |
| Opus 5 | $0.00028 | $0.00616 |
| Sonnet 5 | $0.00011 | $0.00246 |
| Haiku 4.5 | $0.00006 | $0.00123 |
Grade A, and why
memory-layer 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 — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Memory Layer
Three-tier wrapper on top of code-memory-router plus a local file-tier scratchpad.
Tiers
| Tier | Purpose | Backend | Lifetime |
|---|---|---|---|
| scratch | Volatile session notes, in-flight findings | .agents/memory/scratch/<topic>.md (file-tier) |
Session, until promoted or /mddesign:handoff promote |
| WHERE | Locational queries (where is X, which file, which directory) | QMD via /memory-router |
Project lifetime |
| WHY | Decisions, rationale, post-mortems, "we picked X because" | MemPalace drawers via /memory-router |
Forever |
Operations
/mddesign:memory save <text> (default tier: scratch)
- Determine the active topic. The active phase id from
task_plan.mdis the default topic. If no plan exists, usegeneral. - Append
<text>plus an ISO timestamp to.agents/memory/scratch/<topic>.md. Create parent directories if needed. - Print confirmation: "Saved to scratch / topic=".
/mddesign:memory save --tier why <text>
- Print the text to the user with a clear "About to promote to MemPalace WHY tier. Approve? [y/N]" line.
- The PreToolUse hook intercepts the next Bash or
/memory-routerinvocation (named checkpoint:before_mempalace_write). - On approval, invoke
/memory-routerwith the canonical "save to MemPalace" pattern documented in code-memory-router's SKILL.md. Pass the text plus a project tag derived from CWD basename. - On the same approval, append a marker to
.agents/memory/scratch/<topic>.md: "PROMOTED to MemPalace at ." The original scratch entry stays in place for the rest of the session for context continuity.
/mddesign:memory recall <query>
Routing rule:
- If the query starts with "where", "which file", "find", "locate", route to WHERE.
- If the query starts with "why", "decision", "history", "what did we decide", route to WHY.
- Otherwise, peek at scratch first; if nothing matches, fall back to WHERE.
Routing target:
- WHERE → invoke
/memory-routerand let the router dispatch to QMD. - WHY → invoke
/memory-routerand let the router dispatch to MemPalace. - scratch → grep
.agents/memory/scratch/**/*.mdfor the query.
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 · 90 lines · 56 tokens per session scan A d55de2146ba2
memory-layer is a skill published in the GitHub repository OthmanAdi/MDDesign (13 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 56 tokens to every session and 1,231 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.
Other skills, from other repositories
kanban-orchestrator
Kanban orchestrator: decompose, route, verify. No executing.
kanban-worker
Kanban worker lifecycle: claim, work, heartbeat, complete.
execution
M-1.4 execution skill — 跑 single task 产 patch + 提交 envelope。.
review
M-1.5 review skill — 在 patch 跟 contract 之间找 finding,produce Finding 一等对象。.
fix-self-check
M-1.6 envelope self-check——独立性保证不自欺欺人 (5 blockingcheck)。由 CLI ./tw fix complete --self-check-mode fork(默认即 fork)自动派起,不经 Skill 工具调用;fix 主会话产 FixCompleted 前直读本文,是为理解双层验证关系。.
plan-decompose
从 completioncondition + conceptgraph 递归分解出 primitive task 提案。主 planner session 决定接受/调整/拆得更细。.