wentout

mnemonica-core

Instance inheritance system for JavaScript/TypeScript using prototype chains. Use when the user mentions mnemonica, define(), prototype inheritance, TypeRegistry, lookupTyped, tactica, instance inheritance, or when working with the mnemonica core library. Covers: define() patterns, type-safe lookup with tactica, Proxy-based architecture, hook system, async constructors, strict chain validation, and 100% test coverage requirements.

wentout 38 4 Updated 4w ago

Resources

15
GitHub

Install

npx skillscat add wentout/mnemonica

Install via the SkillsCat registry.

SKILL.md

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

High-priority checklist: Adding a new type

When the task involves adding or modifying a type definition:

  1. Use type for data, interface for behavior contracts

    • Instance data → type MyTypeData = { ... }
    • Constructor contract → interface MyTypeConstructor { ... }
    • See rules-skill/type-system.md
  2. Check TypeRegistry augmentation (if using tactica)

  3. 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
  4. 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

Patterns

Architecture

Philosophy & Design

Quality

Contributing

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

Categories