cass-memory
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCASS Memory - Contextual Learning System
CASS Memory - 上下文学习系统
Build and use a personal playbook of coding patterns learned from your sessions.
构建并使用从你的会话中学习到的个人编码模式手册。
Prerequisites
前提条件
The CLI should be available (part of cass-memory system).
cmInitialize:
bash
cm init需安装 CLI(属于cass-memory系统的一部分)。
cm初始化:
bash
cm initOr with a starter playbook
或使用入门手册
cm init --starter typescript
cm init --starter react
cm init --starter python
cm init --starter go
undefinedcm init --starter typescript
cm init --starter react
cm init --starter python
cm init --starter go
undefinedCLI Reference
CLI参考
Get Context for a Task
获取任务上下文
bash
undefinedbash
undefinedTHE main command - get relevant rules before starting work
核心命令 - 开始工作前获取相关规则
cm context "Description of your task" --json
This returns:
- Relevant rules from your playbook
- Anti-patterns to avoid
- History snippets from similar past workcm context "你的任务描述" --json
该命令返回:
- 手册中的相关规则
- 需要避免的反模式
- 类似过往工作的历史片段Reflection (Extract Patterns)
反思(提取模式)
bash
undefinedbash
undefinedRun reflection on recent sessions
对近期会话进行反思
cm reflect --json
cm reflect --json
Specify lookback period
指定回溯周期
cm reflect --days 7 --json
cm reflect --days 30 --json
undefinedcm reflect --days 7 --json
cm reflect --days 30 --json
undefinedPlaybook Management
手册管理
bash
undefinedbash
undefinedList all rules
列出所有规则
cm playbook list --json
cm playbook list --json
Get specific rule details
获取特定规则详情
cm playbook get b-8f3a2c --json
cm playbook get b-8f3a2c --json
Add a new rule
添加新规则
cm playbook add "Always use optional chaining for nested object access" --json
undefinedcm playbook add "嵌套对象访问始终使用可选链操作符" --json
undefinedFeedback on Rules
规则反馈
bash
undefinedbash
undefinedMark rule as helpful
标记规则为有帮助
cm mark b-8f3a2c --helpful --json
cm mark b-8f3a2c --helpful --reason "Prevented null error" --json
cm mark b-8f3a2c --helpful --json
cm mark b-8f3a2c --helpful --reason "防止了空值错误" --json
Mark rule as harmful
标记规则为有害
cm mark b-8f3a2c --harmful --json
cm mark b-8f3a2c --harmful --reason "Caused false positive" --json
undefinedcm mark b-8f3a2c --harmful --json
cm mark b-8f3a2c --harmful --reason "导致了误判" --json
undefinedRecord Session Outcomes
记录会话结果
bash
undefinedbash
undefinedRecord success
记录成功
cm outcome --status success --json
cm outcome --status success --rules "b-8f3a2c,b-4d2e1f" --json
cm outcome --status success --json
cm outcome --status success --rules "b-8f3a2c,b-4d2e1f" --json
Record failure
记录失败
cm outcome --status failure --text "Build failed due to type error" --json
cm outcome --status failure --text "因类型错误导致构建失败" --json
Mixed results
记录混合结果
cm outcome --status mixed --text "Partial completion" --json
undefinedcm outcome --status mixed --text "部分完成" --json
undefinedStatistics
统计信息
bash
undefinedbash
undefinedGet playbook stats
获取手册统计数据
cm stats --json
undefinedcm stats --json
undefinedTop Rules
热门规则
bash
undefinedbash
undefinedShow most effective rules
显示最有效的规则
cm top --json
cm top 5 --json
cm top 20 --json
undefinedcm top --json
cm top 5 --json
cm top 20 --json
undefinedHealth Check
健康检查
bash
undefinedbash
undefinedCheck system health
检查系统健康状况
cm doctor --json
cm doctor --json
Auto-fix issues
自动修复问题
cm doctor --fix --json
undefinedcm doctor --fix --json
undefinedFind Stale Rules
查找过时规则
bash
undefinedbash
undefinedRules without recent feedback
无近期反馈的规则
cm stale --json
cm stale --days 30 --json
cm stale --days 60 --json
undefinedcm stale --json
cm stale --days 30 --json
cm stale --days 60 --json
undefinedValidate Rules
验证规则
bash
undefinedbash
undefinedValidate a proposed rule against history
根据历史记录验证拟议规则
cm validate "Proposed rule text" --json
undefinedcm validate "拟议规则文本" --json
undefinedExplain Rule Origin
解释规则来源
bash
undefinedbash
undefinedShow evidence and reasoning for a rule
显示规则的依据和推理过程
cm why b-8f3a2c --json
undefinedcm why b-8f3a2c --json
undefinedUsage Statistics
使用统计
bash
cm usage --jsonbash
cm usage --jsonStarter Playbooks
入门手册
bash
undefinedbash
undefinedList available starters
列出可用的入门手册
cm starters --json
undefinedcm starters --json
undefinedWorkflow Patterns
工作流模式
Session Start
会话开始
bash
undefinedbash
undefinedGet context before starting a task
开始任务前获取上下文
cm context "Implement user authentication with JWT" --json
undefinedcm context "使用JWT实现用户认证" --json
undefinedDuring Work
工作中
When a rule helps:
bash
cm mark b-8f3a2c --helpful --jsonWhen a rule leads astray:
bash
cm mark b-8f3a2c --harmful --reason "Not applicable to this framework" --json当规则有帮助时:
bash
cm mark b-8f3a2c --helpful --json当规则误导时:
bash
cm mark b-8f3a2c --harmful --reason "不适用于此框架" --jsonSession End
会话结束
bash
undefinedbash
undefinedRecord outcome
记录结果
cm outcome --status success --rules "b-8f3a2c,b-4d2e1f" --json
undefinedcm outcome --status success --rules "b-8f3a2c,b-4d2e1f" --json
undefinedPeriodic Maintenance
定期维护
bash
undefinedbash
undefinedWeekly: Run reflection to extract new patterns
每周:运行反思以提取新模式
cm reflect --days 7 --json
cm reflect --days 7 --json
Monthly: Review stale rules
每月:审核过时规则
cm stale --days 30 --json
cm stale --days 30 --json
Check system health
检查系统健康
cm doctor --json
undefinedcm doctor --json
undefinedBuilding Your Playbook
构建你的手册
bash
undefinedbash
undefinedManually add a pattern you've learned
手动添加你学到的模式
cm playbook add "Use React.memo() for components receiving complex objects as props" --json
cm playbook add "为接收复杂对象作为props的组件使用React.memo()" --json
After adding, use it in context queries
添加后,在上下文查询中使用它
cm context "Create a list component with filtering" --json
undefinedcm context "创建带筛选功能的列表组件" --json
undefinedRule Lifecycle
规则生命周期
- Creation - Rules emerge from reflection or manual addition
- Usage - Rules surface in context queries
- Feedback - Mark as helpful/harmful based on experience
- Evolution - High-feedback rules rise, low-feedback rules become stale
- Retirement - Stale rules get reviewed and pruned
- 创建 - 规则通过反思或手动添加产生
- 使用 - 规则在上下文查询中显示
- 反馈 - 根据使用体验标记为有帮助/有害
- 演化 - 高反馈规则优先级提升,低反馈规则变为过时
- 淘汰 - 过时规则被审核并移除
Best Practices
最佳实践
- Always get context first - Run before starting work
cm context "task" - Provide feedback - Mark rules as helpful/harmful
- Record outcomes - Track session success/failure
- Run reflection regularly - Weekly reflection extracts new patterns
- Review stale rules - Don't let old rules accumulate
- Add rules manually - When you learn something important
- 始终先获取上下文 - 开始工作前运行
cm context "任务" - 提供反馈 - 标记规则为有帮助/有害
- 记录结果 - 跟踪会话的成功/失败
- 定期运行反思 - 每周反思提取新模式
- 审核过时规则 - 不要积累旧规则
- 手动添加规则 - 当你学到重要内容时
Integration Tips
集成技巧
Pre-Task Context
任务前上下文
Before any significant coding task:
bash
CONTEXT=$(cm context "Your task description" --json)在任何重要编码任务前:
bash
CONTEXT=$(cm context "你的任务描述" --json)Use context to inform your approach
使用上下文指导你的方法
undefinedundefinedPost-Session Recording
会话后记录
At end of coding session:
bash
cm outcome --status success --text "Completed feature X" --json编码会话结束时:
bash
cm outcome --status success --text "完成功能X" --json