mneme
Architectural governance for this project. Use this skill when the user asks about project decisions, ADRs, architectural constraints, or wants to review, record, or enforce decisions. Also use before non-trivial edits when the project has a `.mneme/` directory so the relevant architectural context is visible before implementation.
MnemeHQ · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add MnemeHQ/mneme --skill mneme技能说明
name: mneme
description: |
Architectural governance for this project. Use this skill when the user
asks about project decisions, ADRs, architectural constraints, or wants to
review, record, or enforce decisions. Also use before non-trivial edits when
the project has a .mneme/ directory so the relevant architectural context
is visible before implementation.
Mneme — project memory & architectural governance
This project uses Mneme to keep AI-assisted changes aligned with recorded architectural decisions.
The Skill is the workflow interface: it helps Claude retrieve decisions,
record them, check proposed content, and review pending changes. The Skill does
not implement a second policy engine. Deterministic verdicts come from the
existing mneme check engine and the Claude Code hook.
When the plugin is enabled, Mneme uses a prevent → catch → verify model:
PreToolUseevaluates reconstructable file mutations before they land.Stopaudits session-introduced changes that could not be safely preflighted.- CI remains the final verification boundary.
When this skill activates
- User mentions "ADR", "decision", "constraint", "anti-pattern", "architecture", or architectural review.
- A
.mneme/project_memory.jsonfile exists in the repo. - About to make a non-trivial edit in an area that may be governed by recorded decisions.
- Reviewing a proposed or completed change for architectural compliance.
How to use it
-
Before non-trivial edits — run
/mneme:contextwith a descriptive task phrase such as "storage layer changes" or "auth middleware refactor". Domain language is more useful than a generic file name for retrieval-based guidance. -
To gate a draft — run
/mneme:checkagainst the proposed content with the real target path when available. Treat the command's verdict as the authority; do not infer PASS from the Skill's own reasoning. -
To record a new decision — run
/mneme:record. Choose clear scope and applicability so future retrieval and enforcement can identify where the decision belongs. -
To review pending changes — run
/mneme:review. Use the output as the evidence layer for an architectural review: which decisions apply, which changes comply, which are denied or warned, and which surfaces were not mechanically evaluated.
Retrieval is not enforcement
Mneme deliberately separates architectural context from deterministic policy checks.
/mneme:contextretrieves relevant decisions for guidance.- Legacy text constraints may still depend on retrieval semantics.
- Typed rules such as
FORBID_LITERALare enforced independently of retrieval ranking across the decision corpus, subject to explicit path applicability. mneme check --target-pathis the authority for path-scoped evaluation.- An
UNKNOWN/ incomplete applicability state is not a PASS.
Do not assume that a decision was unenforced merely because it was absent from the top retrieved context.
Hook enforcement
The plugin's PreToolUse hook covers direct Edit, Write, and compatible
MultiEdit mutations by reconstructing the proposed post-edit content and
calling the existing Mneme checker.
For shell mutations, Mneme only preflight-blocks forms whose resulting path and
content can be proven from the command itself, such as supported simple quoted
heredoc writes. Pipelines, substitutions, interpreters, generators, and other
opaque shell forms are allowed to run and are evaluated at the Stop boundary
from the session delta where possible.
The Stop audit is a catch boundary, not proof that every external or remote
mutation surface is governed. If evaluation is unavailable or incomplete,
Mneme must surface that state rather than silently calling it PASS.
In strict mode, a trusted violating verdict can block the mutation or completion boundary and surfaces the violated decision id so Claude can correct course. Anything the adapter cannot evaluate reliably fails open visibly.
Architectural review workflow
For a substantive review, use this order:
- State the implementation intent and affected paths.
- Retrieve the relevant project decisions with
/mneme:context. - Inspect the proposed or pending change.
- Use
/mneme:checkor/mneme:reviewfor deterministic evidence. - Separate the result into:
- mechanically enforced violations or passes;
- guidance-only architectural concerns;
- unevaluated / unsupported mutation surfaces.
- Recommend the smallest compliant correction rather than inventing new architectural requirements.
This is the foundation for a richer Architecture Review Skill surface on the roadmap; today it is an executable review workflow over existing Mneme commands, not a new enforcement subsystem.
Requirements & configuration
- Mneme must be installed and
mneme-hookmust be onPATH. Use the version documented by the plugin README; the runtime and plugin are separate artifacts. - Enforcement mode is set by the plugin's
modeconfiguration option and reaches the hook asCLAUDE_PLUGIN_OPTION_MODE. Precedence:MNEME_HOOK_MODE>CLAUDE_PLUGIN_OPTION_MODE>strict; unknown values fall back tostrict. - Use
warnwhile iterating on decisions if blocking would create unnecessary friction, but do not represent WARN as PASS.
Related
- Project memory:
.mneme/project_memory.json - CLI reference:
mneme --help - Plugin README:
integrations/claude-code-plugin/README.md - Canonical support matrix:
docs/integrations/README.md - Current roadmap:
docs/roadmap/README.md