Skip to content
Skillv1.0.0

mnemonica-core

Instance inheritance system for JavaScript/TypeScript using prototype chains. Use when the user mentions mnemonica, define(), prototype inheritance, TypeRegistry, lookup, tactica, instance inheritance

by wentout(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from wentout/mnemonica (SKILL.md). Install upstream with npx skills add wentout/mnemonica. Copyright stays with the author.

Mnemonica Core - AI Skill

When to use

Activate this skill when:

  • User mentions mnemonica, define(), lookup, 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-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:

  1. Use type for data, interface for behavior contracts

    • Instance data → type MyTypeData = { ... }
    • Constructor contract → interface MyTypeConstructor { ... }
    • See rules-type-system.md
  2. Check how lookup() is typed (in order of preference)

    • Builder mode (mnemonica.define / createTypesCollection)? Nothing to do — the registry is local.
    • Free lookup() on a builder project? Use the one-line RegistryOf bridge — see docs/typed-lookup.md.
    • Using tactica / @decorate()? Does .tactica/types.ts need updating? Is lookup('MyType') properly typed? See typed-lookup.md
  3. If the constructor needs a getter, use .lazy()

    • .define() no longer accepts an anonymous first-argument function.
    • Use Type.lazy('Name', () => Constructor) or the free lazy(...) export.
    • See rules-define-patterns.md
  4. 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-testing.md
  5. 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          # tsc only — lint is a separate gate
npx eslint ./src       # zero warnings allowed
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

  • rules-philosophy.md — HoTT concepts (Univalence, Path Types, Higher Inductive Types) applied to mnemonica's self-reflection model
  • rules-ecosystem.md — PACT framework: personas, collaboration modes, integration points

Quality

Contributing

  • rules-contributing.md — behavioral guidelines: think before coding, simplicity, surgical changes, goal-driven execution

Contributing

This checklist covers working in this repository (both usage questions and library changes). If you are modifying the library itself, read AGENTS.md first (mandatory) and .ai/ONBOARDING.md for the contributor quickstart.

External Resources

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/wentout-mnemonica-mnemonica-core/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

wentout-mnemonica-mnemonica-core.ocm.jsonjson
{
  "ocm": "1",
  "id": "wentout-mnemonica-mnemonica-core",
  "kind": "skill",
  "name": "mnemonica-core",
  "description": "Instance inheritance system for JavaScript/TypeScript using prototype chains. Use when the user mentions mnemonica, define(), prototype inheritance, TypeRegistry, lookup, 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.",
  "publisher": "wentout",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding",
      "math"
    ],
    "tags": [
      "skill-md",
      "mnemonica",
      "typescript",
      "prototype-inheritance",
      "type-system",
      "nodejs",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Instance inheritance system for JavaScript/TypeScript using prototype chains. Use when the user mentions mnemonica, define(), prototype inheritance, TypeRegistry, lookup, 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."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/wentout/mnemonica",
      "path": "SKILL.md",
      "ref": "3c16ad114ed714d592b763870e40f971ed8ba4ce",
      "url": "https://github.com/wentout/mnemonica/blob/3c16ad114ed714d592b763870e40f971ed8ba4ce/SKILL.md",
      "key": "wentout/mnemonica/SKILL.md"
    }
  },
  "instructions": "# Mnemonica Core - AI Skill\n\n## When to use\n\nActivate this skill when:\n- User mentions `mnemonica`, `define()`, `lookup`, `TypeRegistry`\n- User asks about prototype chain inheritance in JavaScript/TypeScript\n- User is modifying files in `core/src/` or `core/test/`\n- User asks about tactica-generated types or `.tactica/` directory\n- Task involves: type definitions, hooks, async constructors, error handling\n\n## Functional vs Class-Based — Both Are Equally Supported\n\n`define()` and `@decorate()` are runtime equivalents. When working in a codebase, **match the style already in use**. See [rules-de",
  "cost": {
    "context_tokens": 1234
  }
}

Fetch it by URL: GET /api/v1/registry/wentout-mnemonica-mnemonica-core/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.