Loading...
Loading...
Compare original and translation side by side
| Trigger | Context | Action |
|---|---|---|
| New project | No memory files exist | Full discovery (Phases 2-5) |
| Unfamiliar area | Working in unknown part of codebase | Targeted discovery (Phase 2-3 for that area) |
| User correction | User says "that's wrong" or corrects an assumption | Correction protocol (Phase 6) |
Explicit | User invokes the command | Full discovery (Phases 2-5) |
| Session start | Memory files exist but may be stale | Load and validate memory (Phase 7) |
STOP: Identify your trigger before proceeding. Different triggers require different phases.
| 触发条件 | 上下文 | 操作 |
|---|---|---|
| 新项目 | 不存在内存文件 | 全面发现(阶段2-5) |
| 不熟悉的代码区域 | 正在处理代码库中未知的部分 | 定向发现(仅针对该区域执行阶段2-3) |
| 用户纠正 | 用户指出"that's wrong"或纠正某个假设 | 纠正协议(阶段6) |
显式调用 | 用户执行该命令 | 全面发现(阶段2-5) |
| 会话启动 | 存在内存文件但可能已过时 | 加载并验证内存(阶段7) |
停止:继续操作前先确认你的触发条件,不同触发条件需要执行不同阶段。
| File/Directory | What It Reveals | Priority |
|---|---|---|
| Tech stack, dependencies, scripts | Critical |
| Project purpose, conventions, rules | Critical |
| Directory structure (top 2 levels) | Architecture pattern (monorepo, MVC, hexagonal, etc.) | Critical |
| Coding standards, strictness level | High |
| What is excluded, deployment hints | High |
| Infrastructure, services | Medium |
| CI/CD setup, required checks | Medium |
| Environment variables, external services | Medium |
| Existing specifications and documentation | Medium |
STOP: Complete the structure scan before analyzing code patterns.
| 文件/目录 | 可获取的信息 | 优先级 |
|---|---|---|
| 技术栈、依赖、脚本 | 极高 |
| 项目用途、规范、规则 | 极高 |
| 目录结构(前2层) | 架构模式(monorepo、MVC、六边形架构等) | 极高 |
| 编码规范、严格级别 | 高 |
| 要排除的内容、部署提示 | 高 |
| 基础设施、服务 | 中 |
| CI/CD配置、必填检查项 | 中 |
| 环境变量、外部服务 | 中 |
| 现有规范和文档 | 中 |
停止:完成结构扫描后再分析代码模式。
| Pattern Category | What to Look For | Example Indicators |
|---|---|---|
| Naming conventions | Variable/function/file naming | camelCase, snake_case, kebab-case, PascalCase |
| Import/export | Module organization | Barrel exports, relative vs absolute paths, path aliases |
| Error handling | How failures are managed | try/catch, Result types, error boundaries, custom exceptions |
| Testing patterns | Test framework and style | File naming ( |
| State management | How data flows | Redux, Zustand, Context, Vuex, Pinia, Livewire |
| API patterns | Communication style | REST, GraphQL, tRPC, RPC, WebSocket |
| Database access | Data layer approach | ORM (Prisma, Eloquent, TypeORM), raw SQL, query builder |
| Component patterns | UI structure | Atomic design, feature folders, co-located styles |
| 模式类别 | 需要查找的内容 | 示例标识 |
|---|---|---|
| 命名规范 | 变量/函数/文件命名 | camelCase, snake_case, kebab-case, PascalCase |
| 导入/导出 | 模块组织 | 桶导出、相对路径与绝对路径、路径别名 |
| 错误处理 | 故障处理方式 | try/catch, Result types, error boundaries, custom exceptions |
| 测试模式 | 测试框架和风格 | 文件命名( |
| 状态管理 | 数据流转方式 | Redux, Zustand, Context, Vuex, Pinia, Livewire |
| API模式 | 通信风格 | REST, GraphQL, tRPC, RPC, WebSocket |
| 数据库访问 | 数据层实现方式 | ORM(Prisma, Eloquent, TypeORM)、原生SQL、查询构建器 |
| 组件模式 | UI结构 | 原子设计、功能文件夹、就近样式 |
git log --oneline -20 # Recent commits — development velocity, commit style
git shortlog -sn -20 # Active contributors
git branch -a # Branching strategy
git log --diff-filter=A --name-only --pretty=format: -10 | head -30 # Recently added filesSTOP: Complete all discovery phases before persisting to memory.
git log --oneline -20 # Recent commits — development velocity, commit style
git shortlog -sn -20 # Active contributors
git branch -a # Branching strategy
git log --diff-filter=A --name-only --pretty=format: -10 | head -30 # Recently added files停止:完成所有发现阶段后再持久化到内存。
memory/project-context.mdmemory/project-context.mdundefinedundefinedundefinedundefinedmemory/learned-patterns.mdmemory/learned-patterns.mdundefinedundefinedundefinedundefinedmemory/user-preferences.mdmemory/user-preferences.mdundefinedundefinedundefinedundefinedmemory/decisions-log.mdmemory/decisions-log.mdundefinedundefined
---
---| Correction Type | Memory File to Update | Example |
|---|---|---|
| Naming convention wrong | | "We use snake_case, not camelCase" |
| Tech stack wrong | | "We use Vitest, not Jest" |
| Workflow preference | | "Always create PRs, never push to main" |
| Architecture misunderstanding | | "That is a microservice, not a monolith" |
| Decision context | | "We chose X because of Y, not Z" |
Do NOT skip the memory update. Corrections that are not persisted will be repeated.
| 纠正类型 | 需要更新的内存文件 | 示例 |
|---|---|---|
| 命名规范错误 | | "我们使用snake_case,不是camelCase" |
| 技术栈错误 | | "我们使用Vitest,不是Jest" |
| 工作流偏好 | | "永远要创建PR,不要直接push到main分支" |
| 架构理解错误 | | "那是微服务,不是单体应用" |
| 决策背景 | | "我们选择X是因为Y,不是Z" |
不要跳过内存更新步骤。没有持久化的纠正内容会导致后续重复犯错。
memory/Last updatedpackage.jsonmemory/最后更新package.json| Situation | Discovery Depth | Time Budget |
|---|---|---|
| Brand new project, no memory files | Full (all phases) | 3-5 minutes |
| New area of known project | Targeted (Phase 2-3 for that area only) | 1-2 minutes |
| User correction | Correction protocol only (Phase 6) | 30 seconds |
| Session start with existing memory | Validation only (Phase 7) | 1 minute |
| Major refactor detected (many changed files) | Full re-scan | 3-5 minutes |
| 场景 | 发现深度 | 时间预算 |
|---|---|---|
| 全新项目,没有内存文件 | 全面(所有阶段) | 3-5分钟 |
| 已知项目的新区域 | 定向(仅针对该区域执行阶段2-3) | 1-2分钟 |
| 用户纠正 | 仅执行纠正协议(阶段6) | 30秒 |
| 会话启动,已有内存文件 | 仅验证(阶段7) | 1分钟 |
| 检测到大规模重构(大量文件变更) | 全面重扫描 | 3-5分钟 |
| What NOT to Do | Why It Fails | What to Do Instead |
|---|---|---|
| Read every file in the project | Wastes context window, slow | Scan strategically: config files first, then 3-5 representative code files |
| Assume conventions from one file | One file may be an outlier | Verify patterns across 2+ files before persisting |
| Overwrite memory files completely | Loses historical context and user corrections | Append or update specific sections, preserve history |
| Skip git history | Misses development velocity and team patterns | Always check recent commits and contributors |
| Persist guesses as facts | Poisons future sessions with wrong context | Only persist observations backed by evidence |
| Ignore user corrections | Repeats the same mistakes | Corrections override observations immediately |
| Deep-dive into implementation details | Loses the forest for the trees | Focus on patterns and conventions, not specific logic |
| Skip memory validation on session start | Uses stale context | Always spot-check memory against current codebase |
| 禁止操作 | 失败原因 | 正确做法 |
|---|---|---|
| 读取项目中的所有文件 | 浪费上下文窗口,速度慢 | 策略性扫描:优先看配置文件,然后看3-5个代表性代码文件 |
| 仅凭单个文件推断规范 | 单个文件可能是个例 | 持久化前在2个以上文件中验证模式 |
| 完全覆盖内存文件 | 丢失历史上下文和用户纠正内容 | 追加或更新特定部分,保留历史记录 |
| 跳过Git历史分析 | 遗漏开发速度和团队模式信息 | 始终检查近期commit和贡献者 |
| 将猜测作为事实持久化 | 错误上下文会影响后续会话 | 仅持久化有证据支撑的观察结果 |
| 忽略用户纠正 | 重复犯相同错误 | 纠正内容优先级高于观察结果,立即生效 |
| 深入研究实现细节 | 只见树木不见森林 | 关注模式和规范,而非具体逻辑 |
| 会话启动时跳过内存验证 | 使用过时的上下文 | 始终对照当前代码库抽样检查内存内容 |
| Thought | Reality |
|---|---|
| "I already know this framework" | You do not know THIS project's conventions. Scan. |
| "The memory files are recent enough" | Spot-check anyway. Code changes fast. |
| "This correction is minor" | Minor corrections prevent major errors. Persist it. |
| "I will remember this without writing it down" | You will not. Sessions are independent. Persist to memory. |
| "Scanning will take too long" | Not scanning leads to wrong assumptions that take longer to fix. |
Do NOT skip memory persistence. If you discovered it, write it down.
| 想法 | 实际情况 |
|---|---|
| "我已经了解这个框架了" | 你不了解这个项目的规范,去扫描。 |
| "内存文件足够新" | 还是抽样检查一下,代码迭代很快。 |
| "这个纠正不重要" | 小纠正能避免大错误,把它记下来。 |
| "我不用写下来也能记住" | 你记不住的,会话之间是独立的,持久化到内存。 |
| "扫描太费时间了" | 不扫描会导致错误假设,后续修复花费的时间更长。 |
不要跳过内存持久化步骤,只要你发现了就记下来。
| Skill | Relationship |
|---|---|
| Triggers self-learning at session start |
| Loads project context before idea generation |
| Uses learned patterns to propose consistent approaches |
| Checks code against learned conventions |
| Records discovery effectiveness metrics |
| Failure patterns inform future approach selection |
| 技能 | 关系 |
|---|---|
| 会话启动时触发自学习 |
| 生成想法前加载项目上下文 |
| 使用已学习的模式提出一致的实现方案 |
| 对照已学习的规范检查代码 |
| 记录发现效果指标 |
| 故障模式为后续方案选择提供参考 |
undefinedundefinedundefinedundefinedundefinedundefinedmigrations/
---migrations/
---