Skip to content

Commit 0ad786a

Browse files
committed
feat: remember user's instructions
1 parent e150fc8 commit 0ad786a

1 file changed

Lines changed: 35 additions & 8 deletions

File tree

.ai-ready/rules/user-teaching-memory.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,44 @@ When a user teaches or instructs the AI assistant on how to perform a task or be
1515
## Purpose
1616
This creates a persistent memory of user preferences and instructions that can guide future interactions and customizations.
1717

18-
**You MUST READ the [Memory File](.monkeycode/MEMORY.md) as project level instruction before your first your reply!**
18+
## MUST DO
19+
20+
- You MUST CREATE the [Memory File](.monkeycode/MEMORY.md) according to the **File Template** before your first reply IF IT'S NOT EXIST!
21+
- You MUST READ the [Memory File](.monkeycode/MEMORY.md) as project level instruction before your first reply!
22+
- EVERY user input should be validated by the following **Trigger Conditions**, Once MATCHED, UPDATE the [Memory File](.monkeycode/MEMORY.md) with user's instruction IMMEDIATLY BEFORE DOING ANYTHING
1923

2024
## Trigger Conditions
21-
- User provides explicit instructions about how to behave
22-
- User corrects the assistant's behavior, for example:
23-
- Do something when some condition
24-
- Don't do something when some condition
25-
- Use (or don't use) XXX (command or method) to Do something In XXX project/module
26-
- User gives advice on preferred approaches
27-
- User explains how they'd like tasks to be performed
2825

26+
### 1. User provides EXPLICIT INSTRUCTIONS about how to behave
27+
28+
> Examples:
29+
> - "回复我的时候请用中文"
30+
> - "Always respond in bullet points"
31+
> - "代码注释统一用英文写"
32+
> - "不要在回复中使用 emoji"
33+
34+
### 2. User INSTRUCTS or CORRECTS the assistant's behavior
35+
36+
> Examples:
37+
> - **Do something when some condition**: "每次改完代码后自动跑一下 lint"、"When I ask you to refactor, always write unit tests first"
38+
> - **Don't do something when some condition**: "不要自动删除注释掉的代码"、"Don't modify files outside the src/ directory unless I explicitly say so"
39+
> - **Use (or don't use) XXX to do something in XXX project/module**: "这个项目用 pnpm 不要用 npm"、"Use `pytest` instead of `unittest` in this repo"、"在 backend 模块里不要用 print,用 logger"
40+
41+
### 3. User gives advice on preferred approaches
42+
43+
> Examples:
44+
> - "我更喜欢函数式写法,少用 class"
45+
> - "Prefer composition over inheritance in this project"
46+
> - "写 SQL 的时候用 CTE 而不是子查询"
47+
> - "CSS 优先用 Tailwind 的 utility class,不要写自定义样式"
48+
49+
### 4. User explains how they'd like tasks to be performed
50+
51+
> Examples:
52+
> - "改 bug 之前先帮我写个能复现问题的测试用例"
53+
> - "每次提交代码前先跑 `make check`"
54+
> - "重构的时候一次只改一个文件,改完我确认了再继续"
55+
> - "When adding a new API endpoint, always update the OpenAPI spec first"
2956
3057
## File Template for MEMORY.md
3158

0 commit comments

Comments
 (0)