agentleFS
memi-designmemi-design/memi/CLAUDE.md

memi

CLAUDE.md47 starsChanged 7 months agoMITView on GitHub

The file

We split this CLAUDE.md into the rules it gives an agent

9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the Figma Control Plane as an operator surface, not only as a bridge transport

    line 16
  2. Very specific:

    Check Jobs first for sync, capture, inspect, and healer state

    line 17
  3. Very specific:

    Use Selection for node IDs, styles, variants, layout facts, and quick actions

    line 18
  4. Very specific:

    Use System for bridge state, ports, latency, and buffered change-stream visibility

    line 19
  5. Distinctive:

    Treat canvas agent widgets as task/status surfaces, not as a durable communication log

    line 20
  6. Very specific:

    Use memi connect --json and memi doctor --json when an agent needs machine-readable widget and bridge health

    line 21
  7. Very specific:

    Config: Run memi mcp config --target claude-code to get a ready-to-paste .mcp.json config.

    line 113
  8. Very specific:

    After every Mémoire engine commit: add the hash and message to CHANGELOG.md, log architectural decisions, and keep preview/changelog.html …

    line 146
  9. Distinctive:

    Check Code Connect first — use existing mappings

    line 152

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Mémoire — Guidelines for Claude

<!-- CRITICAL: These top rules are highest priority. Repeat at bottom for recency anchoring. -->

Prime Directives

  1. Operate as an autonomous superagent — read designs, drive canvas, generate specs and code without waiting for permission. Burn tokens for quality. (Why: Mémoire is built for hands-free operation; hesitation breaks the flow.)
  2. Use Atomic Design exclusively — every component specifies a level: atom → molecule → organism → template → page. (Why: enforced in specs, codegen, and Figma structure.)
  3. Self-heal after every canvas operation — CREATE → SCREENSHOT → ANALYZE → FIX → VERIFY (max 3 rounds). (Why: floating elements, wrong sizing, and raw hex values are the top defects.)
  4. Check Code Connect before creating anything — get_code_connect_map first. Use mapped components when they exist. (Why: duplicate components are the #1 design system debt source.)
  5. Load relevant skills before acting — skills in skills/ define how agents operate. Read the skill file that matches your task.

What is Mémoire

AI-native design intelligence engine. Bridges Figma, user research, and code generation into a spec-driven system. Auto-discovers and connects to the Figma plugin, generates shadcn/ui components from structured specs, and exposes on-canvas agent status widgets for task visibility.

Widget V2 Operating Model

  • Use the Figma Control Plane as an operator surface, not only as a bridge transport
  • Check Jobs first for sync, capture, inspect, and healer state
  • Use Selection for node IDs, styles, variants, layout facts, and quick actions
  • Use System for bridge state, ports, latency, and buffered change-stream visibility
  • Treat canvas agent widgets as task/status surfaces, not as a durable communication log
  • Use memi connect --json and memi doctor --json when an agent needs machine-readable widget and bridge health

Architecture

DirectoryPurpose
src/engine/Core orchestrator, project detection, registry, token-differ, sync, code-watcher, pipeline
src/figma/Figma bridge (WebSocket auto-discovery on ports 9223-9232), tokens, stickies
src/research/Research engine (Excel, web, stickies → insights)
src/specs/Spec types (component, page, dataviz, design, ia) + Zod validation
src/codegen/Code generation (shadcn mapper, dataviz, pages) → atomic folders
src/notes/Mémoire Notes — downloadable skill packs (loader, resolver, installer)
src/preview/Localhost preview gallery (HTML + API server + pipeline/sync/agent dashboards)
src/agents/Agent orchestrator, multi-agent registry, task queue, agent bridge, agent workers
src/mcp/MCP server (stdio transport) — 14 tools, 3 resources for Claude Code/Cursor
src/tui/Terminal UI (Ink/React)
src/commands/CLI commands (Commander.js)
skills/Built-in skill definitions — ship with the npm package
plugin/Figma plugin (auto-discovers Mémoire on ports 9223-9232)

Atomic Design Levels

LevelOutput FolderComposition Rule
atomcomponents/ui/Standalone primitives — composesSpecs must be empty
moleculecomponents/molecules/Composes 2-5 atoms
organismcomponents/organisms/Composes molecules and/or atoms, manages state
templatecomponents/templates/Page layout skeleton — defines structure, not content
pageUses PageSpecTemplate filled with real content and data

Stack & Conventions

  • shadcn/ui exclusively for components (Why: consistent API, Code Connect parity with Figma)
  • Tailwind exclusively for styling — no CSS modules, no styled-components
  • TypeScript strict — all code strictly typed
  • Zod schemas — all data shapes validated
  • Spec-first — every component starts as a JSON spec before code generation
  • Node.js 20+, TypeScript 5.x, ESM modules, Commander.js, Ink, WebSocket, ExcelJS, Recharts, Vite

Mémoire Notes (Downloadable Skill Packs)

Notes extend what Mémoire can do. Each Note is a folder with note.json manifest + markdown skill files.

CategoryPurposeExamples
craftDesign craftMobile design, systems thinking, accessibility, animation
researchUser researchCompetitive analysis, data synthesis, survey design
connectIntegrationsNotion, Linear, Slack, custom API connectors
generateSpecialized codegenReact Native, Vue, SwiftUI, Flutter

Notes are loaded at engine init and injected into agent prompts when their activateOn context matches the classified intent. Built-in skills (in skills/) are auto-adapted as Notes.

Storage: .memoire/notes/{note-name}/note.json

CLI Commands

CommandPurpose
memi connectConnect to Figma (auto-discovers plugin)
memi connect --role <role>Connect as a named agent with a role
memi pullExtract design system from Figma
memi spec component|page|dataviz <name>Create a spec
memi generate [name]Generate code from specs → atomic folders
memi research from-file|from-stickies|synthesize|reportResearch pipeline
memi tokensExport design tokens
memi compose "<intent>"Agent orchestrator: classify → plan → execute → report
memi previewStart localhost preview server
memi dashboardLaunch Mémoire dashboard
memi ia extract|create|show|validate|listInformation architecture tools
memi watchWatch specs for changes, auto-regenerate code
memi watch --codeAlso watch generated/ for code changes
memi statusProject status
memi syncFull sync pipeline (Figma → design system → specs → code)
memi sync --liveKeep running and sync on every change
memi sync --direction <dir>Sync direction: figma-to-code, code-to-figma, bidirectional
memi sync --conflictsShow and resolve pending sync conflicts
memi daemon startStart daemon with auto-pull/spec/generate pipeline
memi daemon stop|status|restartManage daemon lifecycle
memi mcp startStart Mémoire as an MCP server (stdio transport)
memi mcp configPrint MCP config for Claude Code / Cursor
memi agent spawn <role>Spawn a persistent agent worker
memi agent listList all registered agents
memi agent kill <id>Kill an agent by ID
memi agent statusShow agent registry + task queue status
memi notes install <source>Install a Note (local path or github:user/repo)
memi notes listShow all installed Notes with status
memi notes remove <name>Uninstall a Note
memi notes create <name>Scaffold a new Note
memi notes info <name>Show Note details

MCP Server

Mémoire exposes 14 tools and 3 resources via the Model Context Protocol. Any MCP-compatible AI tool (Claude Code, Cursor, Windsurf) can use Mémoire as a design layer.

Tools: pull_design_system, get_specs, get_spec, create_spec, generate_code, get_tokens, update_token, capture_screenshot, get_selection, compose, run_audit, get_research, figma_execute, get_page_tree

Resources: memoire://design-system, memoire://specs/{name}, memoire://project

Config: Run memi mcp config --target claude-code to get a ready-to-paste .mcp.json config.

Multi-Agent Orchestration

Multiple Claude instances can operate as persistent agents, each owning a role:

  • Roles: token-engineer, component-architect, layout-designer, dataviz-specialist, code-generator, accessibility-checker, design-auditor, research-analyst, general
  • Lifecycle: spawn → register → heartbeat (10s) → claim tasks → execute → report → evict after 30s stale
  • Dispatch: Orchestrator checks AgentRegistry for external agents first, falls back to internal execution
  • Task Queue: Dependency resolution, lock-based claiming, timeout reclamation (120s default)

Bidirectional Sync

Design-code sync uses per-entity SHA-256 hashing to track changes on both sides:

  • Figma → Code: Variable/component changes detected via granular plugin events
  • Code → Figma: Token changes pushed via pushTokens bridge command
  • Conflicts: Detected when both sides change within 1s window. Logged to .memoire/sync-conflicts.json
  • Guard: Prevents echo loops during push operations (orchestrator enables guard before Figma writes)

Skills

SkillFileWhen to Load
SUPERPOWERskills/SUPERPOWER.mdEvery session (default autonomous mode)
/figma-useskills/FIGMA_USE.mdAny Figma canvas operation (base for all /figma-* skills)
/figma-generate-designskills/FIGMA_GENERATE_DESIGN.mdCreating new screens/pages from components
/figma-generate-libraryskills/FIGMA_GENERATE_LIBRARY.mdBuilding component library from codebase
/figma-auditskills/FIGMA_AUDIT.mdDesign system quality checks
/figma-prototypeskills/FIGMA_PROTOTYPE.mdInteractive prototypes with flows
/multi-agentskills/MULTI_AGENT.mdParallel agent orchestration
Atomic Designskills/ATOMIC_DESIGN.mdComponent classification reference
Component Catalogskills/COMPONENT_CATALOG.md56-component universal registry, spec scaffolding
Dashboard from Researchskills/DASHBOARD_FROM_RESEARCH.mdResearch data → dashboards
/motion-videoskills/MOTION_VIDEO_DESIGN.mdAnimation, motion, video production
Design System Referenceskills/DESIGN_SYSTEM_REFERENCE.mdCross-industry component gallery, 110+ systems indexed

Changelog Protocol

After every Mémoire engine commit: add the hash and message to CHANGELOG.md, log architectural decisions, and keep preview/changelog.html in sync. This tracks Mémoire the product — user project state lives in .memoire/ locally.

Prime Directives (Repeated — recency anchor)

  1. Operate autonomously — superagent mode by default
  2. Atomic Design on every component — atom/molecule/organism/template/page
  3. Self-heal after every canvas write — screenshot and validate
  4. Check Code Connect first — use existing mappings
  5. Load the right skill before acting

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.