Skip to content

feat: add /add-user-memory skill for structured user profile (USER.md)#1063

Open
jialing-wu wants to merge 2 commits intoqwibitai:mainfrom
jialing-wu:skill/add-user-memory
Open

feat: add /add-user-memory skill for structured user profile (USER.md)#1063
jialing-wu wants to merge 2 commits intoqwibitai:mainfrom
jialing-wu:skill/add-user-memory

Conversation

@jialing-wu
Copy link

Summary

Adds a new /add-user-memory skill that creates a structured USER.md file at the nanoclaw root, giving all agents a shared, persistent user profile.

Closes #910.

What this skill does

  • Creates a USER.md template with four sections: Identity, Communication Preferences, Ongoing Context, and Recent Decisions
  • Updates groups/global/CLAUDE.md to instruct agents to read USER.md at session start and update it when preferences or context change
  • Enforces a 2 000-character hard limit so the file stays compact and never bloats the system prompt
  • Agents replace stale entries rather than appending, keeping the profile always current

Motivation

Without a shared user profile, agents repeatedly ask the same onboarding questions and lose context between sessions. USER.md gives every agent instant access to who the user is and how they prefer to work, without duplicating that information across multiple CLAUDE.md files.

No source code changes

This is a pure skill — no changes to NanoClaw core TypeScript. Users apply it with Claude Code via /add-user-memory.

Test plan

  • Run the skill on a fresh nanoclaw install, confirm USER.md is created
  • Restart NanoClaw and ask any agent "What do you know about me?" — agent should surface USER.md content
  • Edit USER.md to exceed 2 000 characters, confirm the optional guard rejects it
  • Simulate two agents writing simultaneously (unlikely in production but worth a quick check)

@Andy-NanoClaw-AI Andy-NanoClaw-AI added Status: Needs Review Ready for maintainer review PR: Skill Skill package or skill-related changes labels Mar 14, 2026
Copy link

@Dhebrank Dhebrank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Request Changes

The template structure is well-thought-out (Identity, Communication Preferences, Ongoing Context, Recent Decisions), but the core premise doesn't hold given NanoClaw's container architecture.

Blockers:

  1. USER.md at project root is not accessible to non-main containers. Only the main group gets the project root mounted (read-only at /workspace/project). Non-main groups only see their own groups/{name}/ and groups/global/. The skill's stated goal of "shared across all agents" fails for every group except main.

  2. Even main can't write to it — the project root mount is read-only. The instruction "Update USER.md when the user states a new preference" will fail with permission denied.

  3. No skills-engine integration. Other add-* skills use npx tsx scripts/apply-skill.ts with .nanoclaw/state.yaml tracking. This skill has no modify/ directory and no state tracking, making it invisible to /customize and /setup.

  4. Character limit enforcement uses line count as proxyawk 'END { if (NR > 80) ...' doesn't correlate to the stated 2000-character limit. Use wc -c instead.

Suggestion: Place USER.md inside groups/global/ (mounted into all containers) or use the existing vault mount pattern. Consider whether this overlaps with existing profile/memory systems that users may have set up.

The template content itself is good — just needs to land in the right place architecturally.

@jialing-wu
Copy link
Author

Thanks for the thorough review @Dhebrank! All four points are valid, just pushed fixes.

Fixed:

  • USER.md now lives at groups/global/USER.md (writable, mounted into all containers)
  • Updated all path references accordingly
  • Replaced the awk line-count proxy with wc -c for accurate byte enforcement, including a pre-commit guard snippet

On skills-engine integration (apply-skill.ts / .nanoclaw/state.yaml): I could not find scripts/apply-skill.ts or a .nanoclaw/ directory in the current codebase (only scripts/run-migrations.ts exists). Could you point me to an existing skill that uses this pattern, or is this a convention you want introduced here? Happy to add modify/ scaffolding once I understand the expected structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Skill Skill package or skill-related changes Status: Needs Review Ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Structured memory with USER.md and character limits

3 participants