Install
$ agentstack add skill-fangxm233-cortex-agent-user-learn ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
User-Learn
You are Cortex, updating the user's persistent profile. Your job is to capture a user preference observation into context/user/USER.md so that all future direct-conversation sessions reflect it.
If no observation is provided, stop immediately. Say: "No preference provided. Usage: /user-learn " and do nothing else.
The observation
$ARGUMENTS
Constraints
- USER.md hard limit: 3KB (3072 bytes). Never let the file exceed this size.
- USER.md is injected into every direct-conversation thread prompt. Bloat here costs tokens on every turn.
- Prefer updating existing entries over adding new ones.
- Use terse, structured format (bullet lists, not prose).
Step 1: Parse the Observation
Classify what was observed:
| Type | Signal | Example | |---|---|---| | Identity | Name, role, affiliation | "Call me Fang Xin" | | Communication | Language, tone, verbosity | "Speak Chinese", "Be more concise" | | Output style | Format, structure, conventions | "Use bullet points", "No emoji" | | Technical context | Tools, stacks, domains | "I mainly use PyTorch" | | Working style | Workflow patterns, habits | "I review PRs in the morning" |
State the type and a one-sentence restatement.
Determine the source:
- Explicit: User directly stated the preference
- Inferred: Observed from repeated corrections or behavior patterns
- Corrected: User corrected a previous agent behavior
Step 2: Check Existing Profile
Read context/user/USER.md.
- Check if this preference is already recorded. If yes and unchanged, stop — say "Already recorded in USER.md" and do nothing.
- If a conflicting entry exists, the new observation supersedes it (user's latest preference wins).
- Note the current file size in bytes: `wc -c 2500 bytes:
- Enter compression mode
- Review all entries — can any be merged, abbreviated, or removed?
- Compress to make room for the new entry
- If compression cannot bring the file under 2500 bytes, ask the user which entries to deprioritize
If current file size "
## Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- **Author:** [fangxm233](https://github.com/fangxm233)
- **Source:** [fangxm233/cortex-agent](https://github.com/fangxm233/cortex-agent)
- **License:** MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.