|
| 1 | +--- |
| 2 | +name: save-learning |
| 3 | +description: Saves user instructions as persistent learnings for future sessions. Use when the user says 'remember this', 'always do X', 'from now on', 'never do Y', or gives any instruction they want persisted across sessions. Proactively suggest when the user states a preference, convention, or rule they clearly want followed in the future. |
| 4 | +--- |
| 5 | + |
| 6 | +# Save Learning |
| 7 | + |
| 8 | +Save a user's instruction or preference as a persistent learning that |
| 9 | +will be applied in all future sessions on this project. |
| 10 | + |
| 11 | +## Instructions |
| 12 | + |
| 13 | +1. Detect when the user gives an instruction to remember, such as: |
| 14 | + - "remember this", "save this", "always do X", "never do Y" |
| 15 | + - "from now on", "going forward", "in this project we..." |
| 16 | + - Any stated convention, preference, or rule |
| 17 | +2. Refine the instruction into a clean, actionable learning bullet with |
| 18 | + an appropriate type prefix: |
| 19 | + - `**[convention]**` — coding style, workflow, git conventions |
| 20 | + - `**[pattern]**` — reusable code patterns |
| 21 | + - `**[anti-pattern]**` — things to avoid |
| 22 | + - `**[preference]**` — personal/team preferences |
| 23 | + - `**[context]**` — project-specific context |
| 24 | +3. Show the refined learning to the user and ask for confirmation |
| 25 | +4. If confirmed, run: |
| 26 | + ```bash |
| 27 | + caliber learn add "<refined learning>" |
| 28 | + ``` |
| 29 | + For personal preferences (not project-level), add `--personal`: |
| 30 | + ```bash |
| 31 | + caliber learn add --personal "<refined learning>" |
| 32 | + ``` |
| 33 | +5. Stage the learnings file for the next commit: |
| 34 | + ```bash |
| 35 | + git add CALIBER_LEARNINGS.md |
| 36 | + ``` |
| 37 | + |
| 38 | +## Examples |
| 39 | + |
| 40 | +User: "when developing features, push to next branch not master, remember it" |
| 41 | +-> Refine: `**[convention]** Push feature commits to the \`next\` branch, not \`master\`` |
| 42 | +-> "I'll save this as a project learning: |
| 43 | + **[convention]** Push feature commits to the \`next\` branch, not \`master\` |
| 44 | + Save for future sessions?" |
| 45 | +-> If yes: run `caliber learn add "**[convention]** Push feature commits to the next branch, not master"` |
| 46 | +-> Run `git add CALIBER_LEARNINGS.md` |
| 47 | + |
| 48 | +User: "always use bun instead of npm" |
| 49 | +-> Refine: `**[preference]** Use \`bun\` instead of \`npm\` for package management` |
| 50 | +-> Confirm and save |
| 51 | + |
| 52 | +User: "never use any in TypeScript, use unknown instead" |
| 53 | +-> Refine: `**[convention]** Use \`unknown\` instead of \`any\` in TypeScript` |
| 54 | +-> Confirm and save |
| 55 | + |
| 56 | +## When NOT to trigger |
| 57 | + |
| 58 | +- The user is giving a one-time instruction for the current task only |
| 59 | +- The instruction is too vague to be actionable |
| 60 | +- The user explicitly says "just for now" or "only this time" |
0 commit comments