memi
CLAUDE.md47 starsChanged 7 months agoMITView on GitHub
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/rules/agents.mdAGENTS.md
- llms.txtllms.txt
- audit-frontend-designSkill
- build-swiftui-interfaceSkill
- enforce-design-ciSkill
- memoire-design-toolingSkill
- remember-design-systemSkill
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
- Distinctive: line 16
Use the Figma Control Plane as an operator surface, not only as a bridge transport
- Very specific: line 17
Check Jobs first for sync, capture, inspect, and healer state
- Very specific: line 18
Use Selection for node IDs, styles, variants, layout facts, and quick actions
- Very specific: line 19
Use System for bridge state, ports, latency, and buffered change-stream visibility
- Distinctive: line 20
Treat canvas agent widgets as task/status surfaces, not as a durable communication log
- Very specific: line 21
Use memi connect --json and memi doctor --json when an agent needs machine-readable widget and bridge health
- Very specific: line 113
Config: Run memi mcp config --target claude-code to get a ready-to-paste .mcp.json config.
- Very specific: line 146
After every Mémoire engine commit: add the hash and message to CHANGELOG.md, log architectural decisions, and keep preview/changelog.html …
- Distinctive: line 152
Check Code Connect first — use existing mappings
≈ “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.
Files
Mémoire — Guidelines for Claude
<!-- CRITICAL: These top rules are highest priority. Repeat at bottom for recency anchoring. -->Prime Directives
- 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.)
- Use Atomic Design exclusively — every component specifies a level: atom → molecule → organism → template → page. (Why: enforced in specs, codegen, and Figma structure.)
- 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.)
- Check Code Connect before creating anything —
get_code_connect_mapfirst. Use mapped components when they exist. (Why: duplicate components are the #1 design system debt source.) - 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
Jobsfirst for sync, capture, inspect, and healer state - Use
Selectionfor node IDs, styles, variants, layout facts, and quick actions - Use
Systemfor 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 --jsonandmemi doctor --jsonwhen an agent needs machine-readable widget and bridge health
Architecture
| Directory | Purpose |
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
| Level | Output Folder | Composition Rule |
atom | components/ui/ | Standalone primitives — composesSpecs must be empty |
molecule | components/molecules/ | Composes 2-5 atoms |
organism | components/organisms/ | Composes molecules and/or atoms, manages state |
template | components/templates/ | Page layout skeleton — defines structure, not content |
page | Uses PageSpec | Template 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.
| Category | Purpose | Examples |
| craft | Design craft | Mobile design, systems thinking, accessibility, animation |
| research | User research | Competitive analysis, data synthesis, survey design |
| connect | Integrations | Notion, Linear, Slack, custom API connectors |
| generate | Specialized codegen | React 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
| Command | Purpose |
memi connect | Connect to Figma (auto-discovers plugin) |
memi connect --role <role> | Connect as a named agent with a role |
memi pull | Extract 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|report | Research pipeline |
memi tokens | Export design tokens |
memi compose "<intent>" | Agent orchestrator: classify → plan → execute → report |
memi preview | Start localhost preview server |
memi dashboard | Launch Mémoire dashboard |
memi ia extract|create|show|validate|list | Information architecture tools |
memi watch | Watch specs for changes, auto-regenerate code |
memi watch --code | Also watch generated/ for code changes |
memi status | Project status |
memi sync | Full sync pipeline (Figma → design system → specs → code) |
memi sync --live | Keep running and sync on every change |
memi sync --direction <dir> | Sync direction: figma-to-code, code-to-figma, bidirectional |
memi sync --conflicts | Show and resolve pending sync conflicts |
memi daemon start | Start daemon with auto-pull/spec/generate pipeline |
memi daemon stop|status|restart | Manage daemon lifecycle |
memi mcp start | Start Mémoire as an MCP server (stdio transport) |
memi mcp config | Print MCP config for Claude Code / Cursor |
memi agent spawn <role> | Spawn a persistent agent worker |
memi agent list | List all registered agents |
memi agent kill <id> | Kill an agent by ID |
memi agent status | Show agent registry + task queue status |
memi notes install <source> | Install a Note (local path or github:user/repo) |
memi notes list | Show 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
pushTokensbridge 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
| Skill | File | When to Load |
| SUPERPOWER | skills/SUPERPOWER.md | Every session (default autonomous mode) |
| /figma-use | skills/FIGMA_USE.md | Any Figma canvas operation (base for all /figma-* skills) |
| /figma-generate-design | skills/FIGMA_GENERATE_DESIGN.md | Creating new screens/pages from components |
| /figma-generate-library | skills/FIGMA_GENERATE_LIBRARY.md | Building component library from codebase |
| /figma-audit | skills/FIGMA_AUDIT.md | Design system quality checks |
| /figma-prototype | skills/FIGMA_PROTOTYPE.md | Interactive prototypes with flows |
| /multi-agent | skills/MULTI_AGENT.md | Parallel agent orchestration |
| Atomic Design | skills/ATOMIC_DESIGN.md | Component classification reference |
| Component Catalog | skills/COMPONENT_CATALOG.md | 56-component universal registry, spec scaffolding |
| Dashboard from Research | skills/DASHBOARD_FROM_RESEARCH.md | Research data → dashboards |
| /motion-video | skills/MOTION_VIDEO_DESIGN.md | Animation, motion, video production |
| Design System Reference | skills/DESIGN_SYSTEM_REFERENCE.md | Cross-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)
- Operate autonomously — superagent mode by default
- Atomic Design on every component — atom/molecule/organism/template/page
- Self-heal after every canvas write — screenshot and validate
- Check Code Connect first — use existing mappings
- Load the right skill before acting
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
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.

