opencastle 1.9.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +28 -14
  2. package/bin/cli.mjs +2 -2
  3. package/dist/cli/adapters/claude-code.d.ts +7 -2
  4. package/dist/cli/adapters/claude-code.d.ts.map +1 -1
  5. package/dist/cli/adapters/claude-code.js +13 -2
  6. package/dist/cli/adapters/claude-code.js.map +1 -1
  7. package/dist/cli/adapters/rules-dir-base.d.ts.map +1 -1
  8. package/dist/cli/adapters/rules-dir-base.js +12 -2
  9. package/dist/cli/adapters/rules-dir-base.js.map +1 -1
  10. package/dist/cli/adapters/rules-dir-base.test.js +3 -1
  11. package/dist/cli/adapters/rules-dir-base.test.js.map +1 -1
  12. package/dist/cli/adapters/vscode.d.ts.map +1 -1
  13. package/dist/cli/adapters/vscode.js +12 -2
  14. package/dist/cli/adapters/vscode.js.map +1 -1
  15. package/dist/cli/ci.d.ts +8 -0
  16. package/dist/cli/ci.d.ts.map +1 -1
  17. package/dist/cli/ci.js +24 -17
  18. package/dist/cli/ci.js.map +1 -1
  19. package/dist/cli/convoy/findings.js +3 -2
  20. package/dist/cli/convoy/findings.js.map +1 -1
  21. package/dist/cli/docs-accuracy.test.js +4 -4
  22. package/dist/cli/docs-accuracy.test.js.map +1 -1
  23. package/dist/cli/init.d.ts.map +1 -1
  24. package/dist/cli/init.js +9 -0
  25. package/dist/cli/init.js.map +1 -1
  26. package/dist/cli/lesson.js +3 -2
  27. package/dist/cli/lesson.js.map +1 -1
  28. package/dist/cli/lessons-rules.d.ts +45 -0
  29. package/dist/cli/lessons-rules.d.ts.map +1 -0
  30. package/dist/cli/lessons-rules.js +130 -0
  31. package/dist/cli/lessons-rules.js.map +1 -0
  32. package/dist/cli/lessons-rules.test.d.ts +2 -0
  33. package/dist/cli/lessons-rules.test.d.ts.map +1 -0
  34. package/dist/cli/lessons-rules.test.js +65 -0
  35. package/dist/cli/lessons-rules.test.js.map +1 -0
  36. package/dist/cli/memory-hooks.d.ts +51 -0
  37. package/dist/cli/memory-hooks.d.ts.map +1 -0
  38. package/dist/cli/memory-hooks.js +200 -0
  39. package/dist/cli/memory-hooks.js.map +1 -0
  40. package/dist/cli/memory-hooks.test.d.ts +2 -0
  41. package/dist/cli/memory-hooks.test.d.ts.map +1 -0
  42. package/dist/cli/memory-hooks.test.js +83 -0
  43. package/dist/cli/memory-hooks.test.js.map +1 -0
  44. package/dist/cli/memory-sources.d.ts.map +1 -1
  45. package/dist/cli/memory-sources.js +3 -2
  46. package/dist/cli/memory-sources.js.map +1 -1
  47. package/dist/cli/promote-command.test.js +40 -10
  48. package/dist/cli/promote-command.test.js.map +1 -1
  49. package/dist/cli/promote.d.ts.map +1 -1
  50. package/dist/cli/promote.js +41 -11
  51. package/dist/cli/promote.js.map +1 -1
  52. package/dist/cli/remove.d.ts.map +1 -1
  53. package/dist/cli/remove.js +27 -0
  54. package/dist/cli/remove.js.map +1 -1
  55. package/dist/cli/status.d.ts +0 -5
  56. package/dist/cli/status.d.ts.map +1 -1
  57. package/dist/cli/status.js +2 -24
  58. package/dist/cli/status.js.map +1 -1
  59. package/dist/cli/sync-check.d.ts +1 -1
  60. package/dist/cli/sync-check.d.ts.map +1 -1
  61. package/dist/cli/sync-check.js +27 -2
  62. package/dist/cli/sync-check.js.map +1 -1
  63. package/dist/cli/update.d.ts.map +1 -1
  64. package/dist/cli/update.js +17 -0
  65. package/dist/cli/update.js.map +1 -1
  66. package/package.json +2 -2
  67. package/src/cli/adapters/claude-code.ts +15 -2
  68. package/src/cli/adapters/rules-dir-base.test.ts +3 -1
  69. package/src/cli/adapters/rules-dir-base.ts +11 -2
  70. package/src/cli/adapters/vscode.ts +11 -2
  71. package/src/cli/ci.ts +23 -16
  72. package/src/cli/convoy/findings.ts +2 -2
  73. package/src/cli/docs-accuracy.test.ts +4 -4
  74. package/src/cli/init.ts +10 -0
  75. package/src/cli/lesson.ts +2 -2
  76. package/src/cli/lessons-rules.test.ts +71 -0
  77. package/src/cli/lessons-rules.ts +128 -0
  78. package/src/cli/memory-hooks.test.ts +102 -0
  79. package/src/cli/memory-hooks.ts +207 -0
  80. package/src/cli/memory-sources.ts +3 -2
  81. package/src/cli/promote-command.test.ts +43 -10
  82. package/src/cli/promote.ts +37 -11
  83. package/src/cli/remove.ts +22 -0
  84. package/src/cli/status.ts +2 -28
  85. package/src/cli/sync-check.ts +30 -3
  86. package/src/cli/update.ts +17 -0
  87. package/src/orchestrator/instructions/general.instructions.md +1 -1
  88. package/src/orchestrator/prompts/implement-feature.prompt.md +1 -1
  89. package/src/orchestrator/skills/self-improvement/SKILL.md +14 -13
@@ -36,4 +36,4 @@ Implement the change the user gave with this command — a feature, a roadmap it
36
36
 
37
37
  - Commit on a feature branch and open a pull request; never push to `main` (**git-workflow**). Link the tracker issue when there is one.
38
38
  - Report what changed (files), how you verified it, what is still open, and anything you noticed outside the task, with its file and line.
39
- - Something you confirmed that is true for anyone working here, such as a fix after a failure or a convention the code does not show: record it as a lesson (**self-improvement**).
39
+ - Something you confirmed that is true for anyone working here, such as a fix after a failure or a convention the code does not show: save it as about the project (**self-improvement**).
@@ -1,27 +1,28 @@
1
1
  ---
2
2
  name: self-improvement
3
- description: "Keeps the team's memory: decides whether what you learned belongs to the team or to the user, records the team's as lessons in .opencastle/lessons/ with npx opencastle lesson, and re-verifies and graduates them. Use when you confirm something true for anyone working in the repository (a fix after a failure, a convention, a decision, a quirk, a correction about the code), before work past lessons may cover, when doctor reports a lesson's cited code changed, or when the lessons index grows long."
3
+ description: "Keeps the team's memory: where what you learned goes (your memory, shared with the team when it is about the project, or a lesson in .opencastle/lessons/), and how lessons are cited, re-verified and graduated. Use when you confirm something true for anyone working in the repository (a fix after a failure, a convention, a decision, a quirk, a correction about the code), when you touch a lesson copied from memory, when doctor reports a lesson's cited code changed, or when the lessons index grows long."
4
4
  ---
5
5
 
6
6
  # Self-Improvement
7
7
 
8
- Lessons are the team's memory. A lesson is a file in `.opencastle/lessons/`, committed with the change you made, so the team reviews it in that pull request; `.opencastle/LESSONS-LEARNED.md` is the index every agent reads first, rewritten from those files by every sync — never edit it by hand.
8
+ Lessons are the team's memory. A lesson is a file in `.opencastle/lessons/`, committed with the change you made, so the team reviews it in that pull request. `.opencastle/LESSONS-LEARNED.md` is the index, and Claude Code, VS Code, Cursor and Windsurf load a copy of it before every task; both are rewritten from the lesson files — never edit them by hand.
9
9
 
10
10
  ## The team's or the user's
11
11
 
12
- Decide when you learn it, not later. Nobody sorts memories afterwards.
12
+ Decide when you learn it, by how you save it. Nobody sorts memories afterwards.
13
13
 
14
- | It is about | Where it goes | For example |
15
- |-------------|---------------|-------------|
16
- | The project: true for anyone working in this repository | A lesson, as soon as you have confirmed it | `pnpm build` fails without `CI=1` set; every migration ships with a down file; the staging API allows 10 requests a second; the user says "we never use default exports" |
17
- | The user: true for them, wherever they work | Your own memory, never a lesson | They want short answers; they use fish; their role; their editor; paths on their machine |
18
- | Every repository in the organisation | A lesson here, whose problem says it holds in every repository; it graduates into the baseline's skill (below) | The company's deploy pipeline needs a manual approval; an internal service's API contract |
19
- | This task only | Nowhere | A one-off workaround; a guess you have not confirmed |
14
+ In Claude Code and VS Code, save it in your own memory as you normally do. When the session ends, OpenCastle copies what is about the project into a lesson, and leaves what is about the user. In any other assistant, record what is about the project as a lesson yourself (below).
20
15
 
21
- - Confirmed means the fix worked, the code shows it, or the user said so. A suspicion is not a lesson.
22
- - A correction from the user: about the code or the project, a lesson; about how they want you to work with them, your memory.
23
- - One place only. Never save the same thing as a lesson and in your own memory.
24
- - When unsure whether a teammate's agent would need it, ask: would it have saved them time on this repository? Yes: a lesson.
16
+ | It is about | Save it as | For example |
17
+ |-------------|------------|-------------|
18
+ | The project: true for anyone working in this repository | About the project (a correction, a project note, a pointer to where something lives) | `pnpm build` fails without `CI=1` set; every migration ships with a down file; the staging API allows 10 requests a second; the user says "we never use default exports" |
19
+ | The user: true for them, wherever they work | About the user. It stays theirs and never becomes a lesson | They want short answers; they use fish; their role; their editor; paths on their machine |
20
+ | Every repository in the organisation | About the project, saying it holds in every repository; it graduates into the baseline's skill (below) | The company's deploy pipeline needs a manual approval; an internal service's API contract |
21
+ | This task only | Nothing | A one-off workaround; a guess you have not confirmed |
22
+
23
+ - Confirmed means the fix worked, the code shows it, or the user said so. A suspicion is not worth saving.
24
+ - A correction from the user: about the code or the project, it is about the project; about how they want you to work with them, it is about the user.
25
+ - A lesson copied from memory is category `general`, severity `medium`, and cites nothing. When your task touches one, set them in its file, and cite the code with `npx opencastle lesson verify <id> --cite <path>`.
25
26
 
26
27
  ## Record a lesson
27
28