Using Mneme HQ to Preserve Tribal Knowledge in Legacy Codebases
The senior engineer bottleneck, solved. Give every coding assistant access to the undocumented rules that only your longest-tenured engineers know.
Legacy codebases run on invisible rules.
Never call the billing adapter directly. Always use feature flags for payment changes. The v1 auth middleware was quietly deprecated in 2021 — use v2. These rules exist only in Slack threads and the memory of senior engineers.
When a coding assistant generates code for a legacy system, it works from the code it can see — not the rules it can't. The result is PRs that break things that "everyone knows" shouldn't be touched.
Rule: Never call BillingAdapter directly from controllers.
Context: Direct calls bypass audit logging. Route through PaymentService only.
See: decisions/billing-adapter-constraint.yml
✗ FAIL decision/feature-flag-required-payments
Rule: All payment code changes require a feature flag.
Context: Required for staged rollout and emergency disable.
→ Surfaced 2 violations before code generation.
Tribal knowledge can't be captured in docs or linters.
| Approach | Limitation | With Mneme HQ |
|---|---|---|
| Onboarding docs | Describe architecture, not constraints; go stale; not queryable | Decisions are structured, retrievable, and enforced |
| Senior engineer review | Bottleneck; not scalable; knowledge is lost when they leave | Tribal knowledge is captured once, enforced forever |
| Code comments | Only in files that exist; scattered; not surfaced at prompt time | Centralized decision store surfaced before code is written |
| Linters / static analysis | Catch syntax/style violations; can't encode business reasoning | Captures intent and rationale, not just syntax rules |
Capture once. Enforce forever.
Document hidden constraints as decisions
Capture the rules that live only in senior engineers' heads: deprecated paths, required wrappers, fragile integrations.
Run mneme check before prompting
Pass your intended change through Mneme HQ. It retrieves relevant hidden constraints and flags any violations before the assistant generates a single line.
Generate assistant-specific rules files
mneme cursor generate distills your decision store into a compact rules file every assistant session loads automatically.
Gate CI on decision compliance
Add mneme check --mode strict to CI. PRs that violate legacy constraints fail before review — no senior engineer required.
What capturing tribal knowledge looks like.
id: no-direct-billing-adapter title: Never call BillingAdapter directly from controllers status: accepted rule: All billing operations must go through PaymentService. rationale: Direct calls bypass audit logging required for SOC 2. Discovered after billing incident in Q3 2023. See post-mortem PM-12. enforcement: strict tags: [legacy, billing, audit, anti-pattern]
$ mneme check "add a payment method to checkout" --mode strict Retrieving relevant decisions... (4 matched) ✓ PASS decision/use-paymentservice-wrapper ✓ PASS decision/checkout-idempotency-required ✗ FAIL decision/no-direct-billing-adapter Reason: Prompt implies direct BillingAdapter call from controller context. ✗ FAIL decision/feature-flag-required-payments Reason: Payment change detected; feature flag wrapping required. Result: FAIL (2 violations, strict mode)
# Interview format: "What should no one ever touch directly?" # Each answer becomes a decision YAML. $ ls decisions/ billing-adapter-constraint.yml v1-auth-deprecated.yml feature-flag-payments.yml never-delete-user-rows.yml sidekiq-queue-naming.yml legacy-mailer-wrapper.yml # 6 decisions captured in one session
What happens after tribal knowledge is enforced.
Common questions.
We have thousands of undocumented rules. Where do we start?
What if a constraint changes?
status: deprecated on a decision to disable enforcement without deleting the history. The decision record remains as context for why the rule existed.