memory-schema — Claude Code skill: what it does, how to install
Manages note schemas in Basic Memory by finding untyped entries, generating schema definitions, checking field consistency, and catching structural drift.
npx skills add basicmachines-co/basic-memory --skill memory-schema -a claude-codeWhat memory-schema does
This skill structures knowledge graphs in Basic Memory using Picoschema notation. When unstructured notes like meetings or tasks accumulate, it groups similar records and infers a baseline schema. Each definition lives inside the schema/ directory.
The workflow relies on bm_schema and bm_write calls. You can adjust the detection threshold between 0.0 and 1.0 to catch rare attributes. Keep in mind that validation inspects observation lines inside note bodies, so values stored only in frontmatter metadata fail the check. The diff mode flags missing fields and cardinality mismatches without blocking daily writes.
What it helps with
- find untyped note clusters across the knowledge graph
- infer a Picoschema definition from existing notes
- validate entries against required fields and enum values
- detect schema drift when notes introduce new properties
Example prompts for the agent
- Validate all meeting notes against the Meeting schema
- Find untyped notes and suggest a schema for Person
- Run a diff on the Task schema to spot new fields
How to install memory-schema
1Skills CLI (Vercel)
npx skills add basicmachines-co/basic-memory --skill memory-schema -a claude-code2Manually: put the files in place
~/.claude/skills/memory-schema/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/memory-schema/
1Skills CLI (Vercel)
npx skills add basicmachines-co/basic-memory --skill memory-schema -a codex2Manually: put the files in place
.agents/skills/memory-schema/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add basicmachines-co/basic-memory --skill memory-schema -a cursor2Manually: put the files in place
.cursor/skills/memory-schema/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install basicmachines-co/basic-memory memory-schema2Manually: put the files in place
.github/skills/memory-schema/SKILL.md1Skills CLI (Vercel)
npx skills add basicmachines-co/basic-memory --skill memory-schema -a gemini-cli2Platform CLI
gemini skills install https://github.com/basicmachines-co/basic-memory --path skills/memory-schemaManually: put the files in place
.devin/skills/memory-schema/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add basicmachines-co/basic-memory --skill memory-schema -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about memory-schema
How do I install memory-schema in Claude Code?
Run npx skills add basicmachines-co/basic-memory --skill memory-schema -a claude-code. This command registers the skill directly in Claude Code.
What does memory-schema do?
It enforces note consistency in Basic Memory using Picoschema declarations. The skill infers field layouts from existing entries, validates data rules, and detects unmapped attributes.
Why does validation fail if frontmatter metadata is already filled?
The bm_schema(command="validate") tool checks for field values formatted as observations in the note body, such as - [field] value. If properties exist only in frontmatter metadata, validation marks them as missing.