Mnemonica Core - AI Skill
When to use
Activate this skill when:
- User mentions
mnemonica, define(), lookupTyped, TypeRegistry
- User asks about prototype chain inheritance in JavaScript/TypeScript
- User is modifying files in
core/src/ or core/test/
- User asks about tactica-generated types or
.tactica/ directory
- Task involves: type definitions, hooks, async constructors, error handling
Functional vs Class-Based — Both Are Equally Supported
define() and @decorate() are runtime equivalents. When working in a codebase, match the style already in use. See rules-skill/define-patterns.md for a side-by-side comparison.
High-priority checklist: Adding a new type
When the task involves adding or modifying a type definition:
Use type for data, interface for behavior contracts
- Instance data →
type MyTypeData = { ... }
- Constructor contract →
interface MyTypeConstructor { ... }
- See rules-skill/type-system.md
Check TypeRegistry augmentation (if using tactica)
- Does
.tactica/types.ts need updating?
- Is
lookupTyped('MyType') properly typed?
- See rules-skill/lookup-typed.md
Test both success and error paths
- Mocha test in
test/ for runtime behavior
- Jest test in
test-jest/ for type coverage
- Error path: test
ALREADY_DECLARED, WRONG_MODIFICATION_PATTERN
- See rules-skill/testing.md
Run coverage before completing
npm run test:cov (Mocha + build)
npm run test:jest:cov (Jest on TypeScript source)
Non-discoverable rules (must be in SKILL.md)
type vs interface rule — not enforced by lint, not in code
- 100% coverage requirement — not discoverable from jest.config.js alone
- Space before function parens — convention, not linted
- Error constructor names are String objects — runtime quirk
- Jest tests must mirror Mocha patterns from
test/environment.js — not in code
Build Commands
npm run build # Full build with linting
npm run test:cov # Mocha tests with coverage (includes build:all)
npm run test:jest:cov # Jest tests with coverage
npm run watch # Watch mode
Rule Reference
Read individual rule files for detailed explanations and code examples:
Type System
- rules-skill/type-system.md —
Proto<P,T>, TypeConstructor, type vs interface
Patterns
- rules-skill/define-patterns.md —
define() usage, subtypes, config options
- rules-skill/lookup-typed.md —
TypeRegistry, lookupTyped, tactica integration
- rules-skill/async-constructors.md — async constructors,
awaitReturn, chaining
Architecture
- rules-skill/proxy-architecture.md — TypeProxy, InstanceCreator, Mnemosyne pipeline
- rules-skill/instance-methods.md —
extract(), fork(), parent(), internal props
- rules-skill/hooks.md —
preCreation, postCreation, creationError
Philosophy & Design
- rules-skill/philosophy.md — HoTT concepts (Univalence, Path Types, Higher Inductive Types) applied to mnemonica's self-reflection model
- rules-skill/ecosystem.md — PACT framework: personas, collaboration modes, integration points
Quality
- rules-skill/testing.md — 100% coverage, Mocha + Jest, error path patterns
- rules-skill/code-style.md — tabs, spacing, type vs interface
- rules-skill/error-system.md —
BASE_MNEMONICA_ERROR, constructError, stack cleaning
Contributing
- rules-skill/contributing.md — behavioral guidelines: think before coding, simplicity, surgical changes, goal-driven execution
Contributing
This file covers usage of mnemonica only. If you are modifying the library
itself, read AGENTS.md (or .ai/AGENTS.md
for framework-agnostic rules).
External Resources
Source: wentout/mnemonica — distributed by TomeVault.
1---2name: wentout-mnemonica-mnemonica3description: Mnemonica Core - AI Skill4---56# Mnemonica Core - AI Skill78## When to use910Activate this skill when:11- User mentions `mnemonica`, `define()`, `lookupTyped`, `TypeRegistry`12- User asks about prototype chain inheritance in JavaScript/TypeScript13- User is modifying files in `core/src/` or `core/test/`14- User asks about tactica-generated types or `.tactica/` directory15- Task involves: type definitions, hooks, async constructors, error handling1617## Functional vs Class-Based — Both Are Equally Supported1819`define()` and `@decorate()` are runtime equivalents. When working in a codebase, **match the style already in use**. See [rules-skill/define-patterns.md](.ai/rules-skill/define-patterns.md) for a side-by-side comparison.2021## High-priority checklist: Adding a new type2223When the task involves adding or modifying a type definition:24251. **Use `type` for data, `interface` for behavior contracts**26 - Instance data → `type MyTypeData = { ... }`27 - Constructor contract → `interface MyTypeConstructor { ... }`28 - See [rules-skill/type-system.md](.ai/rules-skill/type-system.md)29302. **Check TypeRegistry augmentation** (if using tactica)31 - Does `.tactica/types.ts` need updating?32 - Is `lookupTyped('MyType')` properly typed?33 - See [rules-skill/lookup-typed.md](.ai/rules-skill/lookup-typed.md)34353. **Test both success and error paths**36 - Mocha test in `test/` for runtime behavior37 - Jest test in `test-jest/` for type coverage38 - Error path: test `ALREADY_DECLARED`, `WRONG_MODIFICATION_PATTERN`39 - See [rules-skill/testing.md](.ai/rules-skill/testing.md)40414. **Run coverage before completing**42 - `npm run test:cov` (Mocha + build)43 - `npm run test:jest:cov` (Jest on TypeScript source)4445## Non-discoverable rules (must be in SKILL.md)4647- `type` vs `interface` rule — not enforced by lint, not in code48- 100% coverage requirement — not discoverable from jest.config.js alone49- Space before function parens — convention, not linted50- Error constructor names are String objects — runtime quirk51- Jest tests must mirror Mocha patterns from `test/environment.js` — not in code5253## Build Commands5455```bash56npm run build # Full build with linting57npm run test:cov # Mocha tests with coverage (includes build:all)58npm run test:jest:cov # Jest tests with coverage59npm run watch # Watch mode60```6162## Rule Reference6364Read individual rule files for detailed explanations and code examples:6566### Type System67- [rules-skill/type-system.md](.ai/rules-skill/type-system.md) — `Proto<P,T>`, `TypeConstructor`, type vs interface6869### Patterns70- [rules-skill/define-patterns.md](.ai/rules-skill/define-patterns.md) — `define()` usage, subtypes, config options71- [rules-skill/lookup-typed.md](.ai/rules-skill/lookup-typed.md) — `TypeRegistry`, `lookupTyped`, tactica integration72- [rules-skill/async-constructors.md](.ai/rules-skill/async-constructors.md) — async constructors, `awaitReturn`, chaining7374### Architecture75- [rules-skill/proxy-architecture.md](.ai/rules-skill/proxy-architecture.md) — TypeProxy, InstanceCreator, Mnemosyne pipeline76- [rules-skill/instance-methods.md](.ai/rules-skill/instance-methods.md) — `extract()`, `fork()`, `parent()`, internal props77- [rules-skill/hooks.md](.ai/rules-skill/hooks.md) — `preCreation`, `postCreation`, `creationError`7879### Philosophy & Design80- [rules-skill/philosophy.md](.ai/rules-skill/philosophy.md) — HoTT concepts (Univalence, Path Types, Higher Inductive Types) applied to mnemonica's self-reflection model81- [rules-skill/ecosystem.md](.ai/rules-skill/ecosystem.md) — PACT framework: personas, collaboration modes, integration points8283### Quality84- [rules-skill/testing.md](.ai/rules-skill/testing.md) — 100% coverage, Mocha + Jest, error path patterns85- [rules-skill/code-style.md](.ai/rules-skill/code-style.md) — tabs, spacing, type vs interface86- [rules-skill/error-system.md](.ai/rules-skill/error-system.md) — `BASE_MNEMONICA_ERROR`, `constructError`, stack cleaning8788### Contributing89- [rules-skill/contributing.md](.ai/rules-skill/contributing.md) — behavioral guidelines: think before coding, simplicity, surgical changes, goal-driven execution9091## Contributing9293This file covers **usage** of mnemonica only. If you are modifying the library94itself, read [`AGENTS.md`](./AGENTS.md) (or [`.ai/AGENTS.md`](./.ai/AGENTS.md)95for framework-agnostic rules).9697## External Resources9899- Repository: https://github.com/wentout/mnemonica100- Main README: [README.md](./README.md)101- Contributor Guidelines: [AGENTS.md](./AGENTS.md)102103---104> Source: [wentout/mnemonica](https://github.com/wentout/mnemonica) — distributed by [TomeVault](https://tomevault.io).105<!-- tomevault:4.0:skill_md:2026-06-17 -->