When to Use
User has coding style preferences, stack decisions, or patterns they want remembered. Agent learns ONLY from explicit corrections and confirmations, never from observation.
Architecture
Memory lives in ~/coding/ with tiered structure. See memory-template.md for setup.
CODEBLOCK0
Quick Reference
| Topic | File |
|---|
| Categories of preferences | INLINECODE2 |
| When to add preferences |
criteria.md |
| Memory templates |
memory-template.md |
Data Storage
All data stored in ~/coding/. Create on first use:
CODEBLOCK1
Scope
This skill ONLY:
- - Learns from explicit user corrections ("I prefer X over Y")
- Stores preferences in local files (
~/coding/) - Applies stored preferences to code output
This skill NEVER:
- - Reads project files to infer preferences
- Observes coding patterns without consent
- Makes network requests
- Reads files outside INLINECODE7
- Modifies its own SKILL.md
Core Rules
1. Learn from Explicit Feedback Only
- - User corrects output → ask: "Should I remember this preference?"
- User confirms → add to INLINECODE8
- Never infer from silence or observation
2. Confirmation Required
No preference is stored without explicit user confirmation:
- - "Actually, I prefer X" → "Should I remember: prefer X?"
- User says yes → store
- User says no → don't store, don't ask again
3. Ultra-Compact Format
Keep each entry 5 words max:
- - INLINECODE9
- INLINECODE10
- INLINECODE11
4. Category Organization
Group by type (see
dimensions.md):
- - Stack — frameworks, databases, tools
- Style — naming, formatting, comments
- Structure — folders, tests, configs
- Never — explicitly rejected patterns
5. Memory Limits
- - memory.md ≤100 lines
- When full → archive old patterns to history.md
- Merge similar entries: "no Prettier" + "no ESLint" → "minimal tooling"
6. On Session Start
- 1. Load
~/coding/memory.md if exists - Apply stored preferences to responses
- If no file exists, start with no assumptions
7. Query Support
User can ask:
- - "Show my coding preferences" → display memory.md
- "Forget X" → remove from memory
- "What do you know about my Python style?" → show relevant entries
Common Traps
- - Adding preferences without confirmation → user loses trust
- Inferring from project structure → privacy violation
- Exceeding 100 lines → context bloat
- Vague entries ("good code") → useless, be specific
Security & Privacy
Data that stays local:
- - All preferences stored in INLINECODE14
- No telemetry or analytics
This skill does NOT:
- - Send data externally
- Access files outside INLINECODE15
- Observe without explicit user input
Feedback
- - If useful: INLINECODE16
- Stay updated: INLINECODE17
技能名称:编码
详细描述:
使用时机
用户有编码风格偏好、技术栈决策或希望被记住的模式。代理仅从明确的纠正和确认中学习,绝不通过观察学习。
架构
记忆存储在 ~/coding/ 目录下,采用分层结构。设置方法请参见 memory-template.md。
~/coding/
├── memory.md # 当前偏好(不超过100行)
└── history.md # 已归档的旧偏好
快速参考
| 主题 | 文件 |
|---|
| 偏好类别 | dimensions.md |
| 何时添加偏好 |
criteria.md |
| 记忆模板 | memory-template.md |
数据存储
所有数据存储在 ~/coding/ 目录下。首次使用时创建:
bash
mkdir -p ~/coding
范围
本技能仅:
- - 从用户的明确纠正中学习(我更喜欢X而不是Y)
- 将偏好存储在本地文件(~/coding/)中
- 将存储的偏好应用于代码输出
本技能绝不:
- - 读取项目文件来推断偏好
- 未经同意观察编码模式
- 发起网络请求
- 读取 ~/coding/ 以外的文件
- 修改自身的 SKILL.md
核心规则
1. 仅从明确反馈中学习
- - 用户纠正输出 → 询问:我应该记住这个偏好吗?
- 用户确认 → 添加到 ~/coding/memory.md
- 绝不从沉默或观察中推断
2. 需要确认
未经用户明确确认,不存储任何偏好:
- - 实际上,我更喜欢X → 我应该记住:偏好X?
- 用户说是 → 存储
- 用户说否 → 不存储,不再询问
3. 超紧凑格式
每条记录最多5个词:
- - python: 偏好 3.11+
- 命名: 文件使用蛇形命名法
- 测试: 同目录存放,不单独建文件夹
4. 按类别组织
按类型分组(参见 dimensions.md):
- - 技术栈 — 框架、数据库、工具
- 风格 — 命名、格式、注释
- 结构 — 文件夹、测试、配置
- 绝不 — 明确拒绝的模式
5. 记忆限制
- - memory.md 不超过100行
- 满时 → 将旧模式归档到 history.md
- 合并相似条目:不使用 Prettier + 不使用 ESLint → 最小化工具链
6. 会话启动时
- 1. 加载 ~/coding/memory.md(如果存在)
- 将存储的偏好应用于响应
- 如果文件不存在,从无假设开始
7. 查询支持
用户可以询问:
- - 显示我的编码偏好 → 显示 memory.md
- 忘记X → 从记忆中移除
- 你对我的Python风格了解多少? → 显示相关条目
常见陷阱
- - 未经确认添加偏好 → 用户失去信任
- 从项目结构推断 → 隐私侵犯
- 超过100行 → 上下文膨胀
- 模糊条目(好代码)→ 无用,需具体
安全与隐私
本地存储的数据:
- - 所有偏好存储在 ~/coding/ 中
- 无遥测或分析
本技能不:
- - 外部发送数据
- 访问 ~/coding/ 以外的文件
- 未经用户明确输入进行观察
反馈
- - 如果有用:clawhub star coding
- 保持更新:clawhub sync