oh-my-customcode 0.8.0 → 0.9.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.
- package/README.md +10 -2
- package/dist/cli/index.js +517 -274
- package/dist/index.js +303 -101
- package/package.json +1 -1
- package/templates/.claude/skills/secretary-routing/SKILL.md +13 -119
- package/templates/.codex/agents/arch-documenter.md +97 -0
- package/templates/.codex/agents/arch-speckit-agent.md +134 -0
- package/templates/.codex/agents/be-express-expert.md +80 -0
- package/templates/.codex/agents/be-fastapi-expert.md +43 -0
- package/templates/.codex/agents/be-go-backend-expert.md +43 -0
- package/templates/.codex/agents/be-nestjs-expert.md +60 -0
- package/templates/.codex/agents/be-springboot-expert.md +85 -0
- package/templates/.codex/agents/db-postgres-expert.md +106 -0
- package/templates/.codex/agents/db-redis-expert.md +101 -0
- package/templates/.codex/agents/db-supabase-expert.md +71 -0
- package/templates/.codex/agents/de-airflow-expert.md +71 -0
- package/templates/.codex/agents/de-dbt-expert.md +72 -0
- package/templates/.codex/agents/de-kafka-expert.md +81 -0
- package/templates/.codex/agents/de-pipeline-expert.md +92 -0
- package/templates/.codex/agents/de-snowflake-expert.md +89 -0
- package/templates/.codex/agents/de-spark-expert.md +80 -0
- package/templates/.codex/agents/fe-svelte-agent.md +65 -0
- package/templates/.codex/agents/fe-vercel-agent.md +69 -0
- package/templates/.codex/agents/fe-vuejs-agent.md +65 -0
- package/templates/.codex/agents/infra-aws-expert.md +47 -0
- package/templates/.codex/agents/infra-docker-expert.md +47 -0
- package/templates/.codex/agents/lang-golang-expert.md +43 -0
- package/templates/.codex/agents/lang-java21-expert.md +65 -0
- package/templates/.codex/agents/lang-kotlin-expert.md +43 -0
- package/templates/.codex/agents/lang-python-expert.md +43 -0
- package/templates/.codex/agents/lang-rust-expert.md +43 -0
- package/templates/.codex/agents/lang-typescript-expert.md +43 -0
- package/templates/.codex/agents/mgr-claude-code-bible.md +246 -0
- package/templates/.codex/agents/mgr-creator.md +120 -0
- package/templates/.codex/agents/mgr-gitnerd.md +113 -0
- package/templates/.codex/agents/mgr-sauron.md +154 -0
- package/templates/.codex/agents/mgr-supplier.md +120 -0
- package/templates/.codex/agents/mgr-sync-checker.md +99 -0
- package/templates/.codex/agents/mgr-updater.md +103 -0
- package/templates/.codex/agents/qa-engineer.md +96 -0
- package/templates/.codex/agents/qa-planner.md +74 -0
- package/templates/.codex/agents/qa-writer.md +97 -0
- package/templates/.codex/agents/sys-memory-keeper.md +117 -0
- package/templates/.codex/agents/sys-naggy.md +90 -0
- package/templates/.codex/agents/tool-bun-expert.md +71 -0
- package/templates/.codex/agents/tool-npm-expert.md +88 -0
- package/templates/.codex/agents/tool-optimizer.md +87 -0
- package/templates/.codex/codex-native-hash.txt +1 -0
- package/templates/.codex/contexts/dev.md +20 -0
- package/templates/.codex/contexts/ecomode.md +63 -0
- package/templates/.codex/contexts/index.yaml +41 -0
- package/templates/.codex/contexts/research.md +28 -0
- package/templates/.codex/contexts/review.md +23 -0
- package/templates/.codex/hooks/hooks.json +151 -0
- package/templates/.codex/install-hooks.sh +100 -0
- package/templates/.codex/rules/MAY-optimization.md +93 -0
- package/templates/.codex/rules/MUST-agent-design.md +162 -0
- package/templates/.codex/rules/MUST-agent-identification.md +108 -0
- package/templates/.codex/rules/MUST-continuous-improvement.md +132 -0
- package/templates/.codex/rules/MUST-intent-transparency.md +199 -0
- package/templates/.codex/rules/MUST-language-policy.md +62 -0
- package/templates/.codex/rules/MUST-orchestrator-coordination.md +471 -0
- package/templates/.codex/rules/MUST-parallel-execution.md +469 -0
- package/templates/.codex/rules/MUST-permissions.md +84 -0
- package/templates/.codex/rules/MUST-safety.md +69 -0
- package/templates/.codex/rules/MUST-sync-verification.md +281 -0
- package/templates/.codex/rules/MUST-tool-identification.md +195 -0
- package/templates/.codex/rules/SHOULD-agent-teams.md +183 -0
- package/templates/.codex/rules/SHOULD-ecomode.md +145 -0
- package/templates/.codex/rules/SHOULD-error-handling.md +102 -0
- package/templates/.codex/rules/SHOULD-hud-statusline.md +112 -0
- package/templates/.codex/rules/SHOULD-interaction.md +103 -0
- package/templates/.codex/rules/SHOULD-memory-integration.md +132 -0
- package/templates/.codex/rules/index.yaml +141 -0
- package/templates/.codex/skills/airflow-best-practices/SKILL.md +56 -0
- package/templates/.codex/skills/audit-agents/SKILL.md +116 -0
- package/templates/.codex/skills/aws-best-practices/SKILL.md +280 -0
- package/templates/.codex/skills/claude-code-bible/SKILL.md +180 -0
- package/templates/.codex/skills/claude-code-bible/scripts/fetch-docs.js +244 -0
- package/templates/.codex/skills/create-agent/SKILL.md +91 -0
- package/templates/.codex/skills/dbt-best-practices/SKILL.md +54 -0
- package/templates/.codex/skills/de-lead-routing/SKILL.md +230 -0
- package/templates/.codex/skills/dev-lead-routing/SKILL.md +253 -0
- package/templates/.codex/skills/dev-refactor/SKILL.md +123 -0
- package/templates/.codex/skills/dev-review/SKILL.md +81 -0
- package/templates/.codex/skills/docker-best-practices/SKILL.md +275 -0
- package/templates/.codex/skills/fastapi-best-practices/SKILL.md +270 -0
- package/templates/.codex/skills/fix-refs/SKILL.md +107 -0
- package/templates/.codex/skills/go-backend-best-practices/SKILL.md +338 -0
- package/templates/.codex/skills/go-best-practices/CLAUDE.md +9 -0
- package/templates/.codex/skills/go-best-practices/SKILL.md +203 -0
- package/templates/.codex/skills/help/SKILL.md +125 -0
- package/templates/.codex/skills/intent-detection/SKILL.md +215 -0
- package/templates/.codex/skills/intent-detection/patterns/agent-triggers.yaml +349 -0
- package/templates/.codex/skills/kafka-best-practices/SKILL.md +52 -0
- package/templates/.codex/skills/kotlin-best-practices/SKILL.md +256 -0
- package/templates/.codex/skills/lists/SKILL.md +78 -0
- package/templates/.codex/skills/memory-management/SKILL.md +195 -0
- package/templates/.codex/skills/memory-recall/SKILL.md +152 -0
- package/templates/.codex/skills/memory-save/SKILL.md +126 -0
- package/templates/.codex/skills/monitoring-setup/SKILL.md +115 -0
- package/templates/.codex/skills/npm-audit/SKILL.md +72 -0
- package/templates/.codex/skills/npm-publish/SKILL.md +63 -0
- package/templates/.codex/skills/npm-version/SKILL.md +75 -0
- package/templates/.codex/skills/optimize-analyze/SKILL.md +55 -0
- package/templates/.codex/skills/optimize-bundle/SKILL.md +67 -0
- package/templates/.codex/skills/optimize-report/SKILL.md +74 -0
- package/templates/.codex/skills/pipeline-architecture-patterns/SKILL.md +83 -0
- package/templates/.codex/skills/postgres-best-practices/SKILL.md +66 -0
- package/templates/.codex/skills/python-best-practices/SKILL.md +222 -0
- package/templates/.codex/skills/qa-lead-routing/SKILL.md +277 -0
- package/templates/.codex/skills/react-best-practices/SKILL.md +101 -0
- package/templates/.codex/skills/redis-best-practices/SKILL.md +83 -0
- package/templates/.codex/skills/result-aggregation/SKILL.md +164 -0
- package/templates/.codex/skills/rust-best-practices/SKILL.md +267 -0
- package/templates/.codex/skills/sauron-watch/SKILL.md +144 -0
- package/templates/.codex/skills/secretary-routing/SKILL.md +190 -0
- package/templates/.codex/skills/snowflake-best-practices/SKILL.md +65 -0
- package/templates/.codex/skills/spark-best-practices/SKILL.md +52 -0
- package/templates/.codex/skills/springboot-best-practices/SKILL.md +357 -0
- package/templates/.codex/skills/status/SKILL.md +153 -0
- package/templates/.codex/skills/supabase-postgres-best-practices/SKILL.md +99 -0
- package/templates/.codex/skills/typescript-best-practices/SKILL.md +321 -0
- package/templates/.codex/skills/update-docs/SKILL.md +140 -0
- package/templates/.codex/skills/update-external/SKILL.md +149 -0
- package/templates/.codex/skills/vercel-deploy/SKILL.md +73 -0
- package/templates/.codex/skills/web-design-guidelines/SKILL.md +118 -0
- package/templates/.codex/skills/writing-clearly-and-concisely/SKILL.md +64 -0
- package/templates/.codex/uninstall-hooks.sh +52 -0
- package/templates/AGENTS.md.en +39 -0
- package/templates/AGENTS.md.ko +39 -0
- package/templates/manifest.codex.json +43 -0
- package/templates/manifest.json +5 -5
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kotlin-best-practices
|
|
3
|
+
description: Idiomatic Kotlin patterns from JetBrains conventions
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Apply idiomatic Kotlin patterns and best practices from official JetBrains documentation.
|
|
10
|
+
|
|
11
|
+
## Core Principles
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Concise yet readable
|
|
15
|
+
Null safety by design
|
|
16
|
+
Interoperability with Java
|
|
17
|
+
Functional when appropriate
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
|
|
22
|
+
### 1. Naming Conventions
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
packages:
|
|
26
|
+
style: lowercase, no underscores
|
|
27
|
+
example: org.example.project
|
|
28
|
+
|
|
29
|
+
classes_objects:
|
|
30
|
+
style: UpperCamelCase
|
|
31
|
+
example: DeclarationProcessor
|
|
32
|
+
|
|
33
|
+
functions_variables:
|
|
34
|
+
style: lowerCamelCase
|
|
35
|
+
example: processDeclarations, declarationCount
|
|
36
|
+
|
|
37
|
+
constants:
|
|
38
|
+
style: SCREAMING_SNAKE_CASE
|
|
39
|
+
example: const val MAX_COUNT = 8
|
|
40
|
+
|
|
41
|
+
backing_properties:
|
|
42
|
+
style: underscore prefix
|
|
43
|
+
example: private val _elementList
|
|
44
|
+
|
|
45
|
+
acronyms:
|
|
46
|
+
two_letters: both uppercase (IOStream)
|
|
47
|
+
three_plus: capitalize first only (XmlFormatter)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 2. Source File Organization
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
file_naming:
|
|
54
|
+
single_class: name after the class (MyClass.kt)
|
|
55
|
+
multiple_classes: descriptive UpperCamelCase (ProcessDeclarations.kt)
|
|
56
|
+
platform_specific: add suffix (Platform.jvm.kt)
|
|
57
|
+
|
|
58
|
+
class_layout:
|
|
59
|
+
1: Property declarations and initializer blocks
|
|
60
|
+
2: Secondary constructors
|
|
61
|
+
3: Method declarations
|
|
62
|
+
4: Companion object
|
|
63
|
+
|
|
64
|
+
directory_structure:
|
|
65
|
+
- Follow package structure with common root omitted
|
|
66
|
+
- Example: org.example.kotlin.network → network/
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 3. Formatting
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
indentation:
|
|
73
|
+
- 4 spaces (no tabs)
|
|
74
|
+
- Opening brace at end of line
|
|
75
|
+
- Closing brace on separate line
|
|
76
|
+
|
|
77
|
+
horizontal_whitespace:
|
|
78
|
+
around_binary_operators: "a + b"
|
|
79
|
+
no_around_range: "0..i"
|
|
80
|
+
no_around_unary: "a++"
|
|
81
|
+
after_control_keywords: "if (condition)"
|
|
82
|
+
no_before_parentheses: "method()"
|
|
83
|
+
never_around_dot: "foo.bar()"
|
|
84
|
+
|
|
85
|
+
colons:
|
|
86
|
+
type_supertype: "class Foo : Bar"
|
|
87
|
+
declaration_type: "val x: Int"
|
|
88
|
+
always_space_after: true
|
|
89
|
+
|
|
90
|
+
trailing_commas:
|
|
91
|
+
recommended: true
|
|
92
|
+
reason: cleaner diffs, easier reordering
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 4. Functions
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
expression_bodies:
|
|
99
|
+
prefer: "fun foo() = 1"
|
|
100
|
+
over: |
|
|
101
|
+
fun foo(): Int {
|
|
102
|
+
return 1
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
default_parameters:
|
|
106
|
+
prefer: "fun foo(a: String = \"a\")"
|
|
107
|
+
over: overloaded functions
|
|
108
|
+
|
|
109
|
+
single_line_signatures:
|
|
110
|
+
if_fits: "fun foo(a: Int): String = ..."
|
|
111
|
+
otherwise: |
|
|
112
|
+
fun longMethodName(
|
|
113
|
+
argument: ArgumentType = defaultValue,
|
|
114
|
+
argument2: AnotherArgumentType,
|
|
115
|
+
): ReturnType { }
|
|
116
|
+
|
|
117
|
+
unit_return:
|
|
118
|
+
avoid: "fun foo(): Unit { }"
|
|
119
|
+
prefer: "fun foo() { }"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 5. Null Safety
|
|
123
|
+
|
|
124
|
+
```yaml
|
|
125
|
+
principles:
|
|
126
|
+
- Prefer non-null types by default
|
|
127
|
+
- Use ? only when nullability is meaningful
|
|
128
|
+
- Leverage safe calls (?.) and elvis (?:)
|
|
129
|
+
|
|
130
|
+
patterns: |
|
|
131
|
+
// Safe call
|
|
132
|
+
val length = text?.length
|
|
133
|
+
|
|
134
|
+
// Elvis operator
|
|
135
|
+
val name = user?.name ?: "Anonymous"
|
|
136
|
+
|
|
137
|
+
// Let for null checks
|
|
138
|
+
user?.let {
|
|
139
|
+
println(it.name)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Not-null assertion (use sparingly)
|
|
143
|
+
val name = user!!.name
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 6. Idiomatic Patterns
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
immutability:
|
|
150
|
+
prefer: "val over var"
|
|
151
|
+
collections: "listOf() over arrayListOf()"
|
|
152
|
+
|
|
153
|
+
conditionals:
|
|
154
|
+
binary: use if
|
|
155
|
+
multiple: use when
|
|
156
|
+
|
|
157
|
+
patterns: |
|
|
158
|
+
// if expression
|
|
159
|
+
return if (x) foo() else bar()
|
|
160
|
+
|
|
161
|
+
// when expression
|
|
162
|
+
return when(x) {
|
|
163
|
+
0 -> "zero"
|
|
164
|
+
else -> "nonzero"
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
functional:
|
|
168
|
+
prefer: "list.filter { it > 10 }.map { it * 2 }"
|
|
169
|
+
over: manual loops (except forEach)
|
|
170
|
+
|
|
171
|
+
ranges:
|
|
172
|
+
prefer: "for (i in 0..<n)"
|
|
173
|
+
avoid: "for (i in 0..n - 1)"
|
|
174
|
+
|
|
175
|
+
type_aliases:
|
|
176
|
+
use_for: |
|
|
177
|
+
typealias MouseClickHandler = (Any, MouseEvent) -> Unit
|
|
178
|
+
typealias PersonIndex = Map<String, Person>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### 7. Lambdas
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
formatting:
|
|
185
|
+
- Spaces around curly braces: "list.filter { it > 10 }"
|
|
186
|
+
- Single lambda outside parentheses
|
|
187
|
+
- it for single parameter
|
|
188
|
+
|
|
189
|
+
patterns: |
|
|
190
|
+
// Outside parentheses
|
|
191
|
+
list.filter { it > 10 }
|
|
192
|
+
|
|
193
|
+
// Multiple parameters
|
|
194
|
+
list.fold(0) { acc, item -> acc + item }
|
|
195
|
+
|
|
196
|
+
// Destructuring
|
|
197
|
+
map.forEach { (key, value) -> println("$key = $value") }
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### 8. Coroutines
|
|
201
|
+
|
|
202
|
+
```yaml
|
|
203
|
+
principles:
|
|
204
|
+
- Use suspend functions for async operations
|
|
205
|
+
- Structured concurrency with scopes
|
|
206
|
+
- Proper exception handling
|
|
207
|
+
|
|
208
|
+
patterns: |
|
|
209
|
+
// Suspend function
|
|
210
|
+
suspend fun fetchData(): Data {
|
|
211
|
+
return withContext(Dispatchers.IO) {
|
|
212
|
+
api.getData()
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Coroutine scope
|
|
217
|
+
lifecycleScope.launch {
|
|
218
|
+
val data = fetchData()
|
|
219
|
+
updateUI(data)
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Exception handling
|
|
223
|
+
try {
|
|
224
|
+
val result = async { fetchData() }.await()
|
|
225
|
+
} catch (e: Exception) {
|
|
226
|
+
handleError(e)
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### 9. Documentation
|
|
231
|
+
|
|
232
|
+
```yaml
|
|
233
|
+
format: |
|
|
234
|
+
/**
|
|
235
|
+
* Returns the absolute value of the given [number].
|
|
236
|
+
*/
|
|
237
|
+
fun abs(number: Int): Int { ... }
|
|
238
|
+
|
|
239
|
+
best_practices:
|
|
240
|
+
- Incorporate parameters into description
|
|
241
|
+
- Use brackets for parameter references
|
|
242
|
+
- Use @param/@return only for lengthy descriptions
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Application
|
|
246
|
+
|
|
247
|
+
When writing or reviewing Kotlin code:
|
|
248
|
+
|
|
249
|
+
1. **Always** prefer val over var
|
|
250
|
+
2. **Always** use null-safe types appropriately
|
|
251
|
+
3. **Prefer** expression bodies for simple functions
|
|
252
|
+
4. **Prefer** functional operations over loops
|
|
253
|
+
5. **Use** default parameters over overloads
|
|
254
|
+
6. **Use** when for multiple conditions
|
|
255
|
+
7. **Leverage** extension functions
|
|
256
|
+
8. **Document** public APIs
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lists
|
|
3
|
+
description: Show all available commands
|
|
4
|
+
argument-hint: "[--category <category>] [--verbose]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# List Commands Skill
|
|
8
|
+
|
|
9
|
+
Show all available commands with optional filtering and detailed information.
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
--verbose, -v Show detailed descriptions
|
|
15
|
+
--category, -c Filter by category (system, manager, dev)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Output Format
|
|
19
|
+
|
|
20
|
+
### Default
|
|
21
|
+
```
|
|
22
|
+
AI Agent System - Available Commands
|
|
23
|
+
|
|
24
|
+
System:
|
|
25
|
+
lists Show all available commands
|
|
26
|
+
status Show system status
|
|
27
|
+
help Show help information
|
|
28
|
+
|
|
29
|
+
Manager:
|
|
30
|
+
/create-agent Create a new agent
|
|
31
|
+
/update-docs Sync documentation with project structure
|
|
32
|
+
/update-external Update agents from external sources
|
|
33
|
+
/audit-agents Audit agent dependencies
|
|
34
|
+
/fix-refs Fix broken references
|
|
35
|
+
|
|
36
|
+
Dev:
|
|
37
|
+
/dev-review Review code for best practices
|
|
38
|
+
/dev-refactor Refactor code
|
|
39
|
+
|
|
40
|
+
Use "<command> --help" for detailed information.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Verbose Output
|
|
44
|
+
```
|
|
45
|
+
lists --verbose
|
|
46
|
+
|
|
47
|
+
AI Agent System - Available Commands (Detailed)
|
|
48
|
+
|
|
49
|
+
System Commands:
|
|
50
|
+
┌─────────┬──────────────────────────────────────────────┐
|
|
51
|
+
│ Command │ Description │
|
|
52
|
+
├─────────┼──────────────────────────────────────────────┤
|
|
53
|
+
│ lists │ Show all available commands │
|
|
54
|
+
│ status │ Show system status and health checks │
|
|
55
|
+
│ help │ Show help for commands and agents │
|
|
56
|
+
└─────────┴──────────────────────────────────────────────┘
|
|
57
|
+
|
|
58
|
+
Manager Commands:
|
|
59
|
+
┌──────────────────┬──────────────────────────────────────┐
|
|
60
|
+
│ Command │ Description │
|
|
61
|
+
├──────────────────┼──────────────────────────────────────┤
|
|
62
|
+
│ /create-agent │ Create a new agent with structure │
|
|
63
|
+
│ /update-docs │ Sync all docs with project state │
|
|
64
|
+
│ /update-external │ Update from external sources │
|
|
65
|
+
│ /audit-agents │ Check dependencies and refs │
|
|
66
|
+
│ /fix-refs │ Auto-fix broken references │
|
|
67
|
+
└──────────────────┴──────────────────────────────────────┘
|
|
68
|
+
|
|
69
|
+
Dev Commands:
|
|
70
|
+
┌──────────────┬────────────────────────────────────────┐
|
|
71
|
+
│ Command │ Description │
|
|
72
|
+
├──────────────┼────────────────────────────────────────┤
|
|
73
|
+
│ /dev-review │ Review code against best practices │
|
|
74
|
+
│ /dev-refactor│ Suggest and apply refactoring │
|
|
75
|
+
└──────────────┴────────────────────────────────────────┘
|
|
76
|
+
|
|
77
|
+
Total: 10 commands available
|
|
78
|
+
```
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-management
|
|
3
|
+
description: Memory persistence operations using claude-mem
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Provide memory persistence operations using claude-mem for session context survival across compactions.
|
|
10
|
+
|
|
11
|
+
## Operations
|
|
12
|
+
|
|
13
|
+
### 1. Save Context
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
operation: save
|
|
17
|
+
description: Store session context in claude-mem
|
|
18
|
+
steps:
|
|
19
|
+
1. Collect session data:
|
|
20
|
+
- Tasks completed
|
|
21
|
+
- Decisions made
|
|
22
|
+
- Open items
|
|
23
|
+
- Key code changes
|
|
24
|
+
2. Format document:
|
|
25
|
+
- Add project tag: "my-project"
|
|
26
|
+
- Add session ID: {date}-{uuid}
|
|
27
|
+
- Add relevant tags
|
|
28
|
+
3. Store in claude-mem:
|
|
29
|
+
- Use chroma_add_documents
|
|
30
|
+
- Include metadata
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. Recall Context
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
operation: recall
|
|
37
|
+
description: Search and retrieve relevant memories
|
|
38
|
+
steps:
|
|
39
|
+
1. Build query:
|
|
40
|
+
- Always prefix with "my-project"
|
|
41
|
+
- Add user-provided search terms
|
|
42
|
+
- Include date for temporal searches
|
|
43
|
+
2. Search claude-mem:
|
|
44
|
+
- Use chroma_query_documents
|
|
45
|
+
- Request top N results
|
|
46
|
+
3. Format results:
|
|
47
|
+
- Sort by relevance
|
|
48
|
+
- Present summary
|
|
49
|
+
- Provide access to full content
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 3. Get Specific Memory
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
operation: get
|
|
56
|
+
description: Retrieve specific memory by ID
|
|
57
|
+
steps:
|
|
58
|
+
1. Use chroma_get_documents with ID
|
|
59
|
+
2. Return full document content
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Query Patterns
|
|
63
|
+
|
|
64
|
+
### Semantic Search (Primary)
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
# Always include project name
|
|
68
|
+
chroma_query_documents(["my-project {search_terms}"])
|
|
69
|
+
|
|
70
|
+
# Examples:
|
|
71
|
+
chroma_query_documents(["my-project authentication flow"])
|
|
72
|
+
chroma_query_documents(["my-project 2025-01-24 memory system"])
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Get by ID
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
# When you have a specific document ID
|
|
79
|
+
chroma_get_documents(ids=["document_id"])
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Document Format
|
|
83
|
+
|
|
84
|
+
### Save Format
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
content: |
|
|
88
|
+
## Session Summary
|
|
89
|
+
Date: {date}
|
|
90
|
+
Session: {session_id}
|
|
91
|
+
|
|
92
|
+
### Tasks Completed
|
|
93
|
+
- Task 1: Description
|
|
94
|
+
- Task 2: Description
|
|
95
|
+
|
|
96
|
+
### Decisions Made
|
|
97
|
+
- Decision 1: Rationale
|
|
98
|
+
- Decision 2: Rationale
|
|
99
|
+
|
|
100
|
+
### Open Items
|
|
101
|
+
- Item 1: Status
|
|
102
|
+
- Item 2: Status
|
|
103
|
+
|
|
104
|
+
### Notes
|
|
105
|
+
Additional context...
|
|
106
|
+
|
|
107
|
+
metadata:
|
|
108
|
+
project: my-project
|
|
109
|
+
session: {date}-{uuid}
|
|
110
|
+
tags: [session, task, decision, ...]
|
|
111
|
+
created_at: {timestamp}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Recall Response Format
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
results:
|
|
118
|
+
- id: doc_1
|
|
119
|
+
score: 0.95
|
|
120
|
+
summary: "Authentication flow implementation"
|
|
121
|
+
date: 2025-01-20
|
|
122
|
+
tags: [authentication, oauth]
|
|
123
|
+
- id: doc_2
|
|
124
|
+
score: 0.87
|
|
125
|
+
summary: "JWT token decision"
|
|
126
|
+
date: 2025-01-18
|
|
127
|
+
tags: [authentication, decision]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Best Practices
|
|
131
|
+
|
|
132
|
+
### Query Tips
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
do:
|
|
136
|
+
- Always include "my-project" prefix
|
|
137
|
+
- Use semantic, intent-based queries
|
|
138
|
+
- Include dates for temporal searches
|
|
139
|
+
- Use multiple queries for better coverage
|
|
140
|
+
|
|
141
|
+
dont:
|
|
142
|
+
- Use complex where filters ($and, $or)
|
|
143
|
+
- Omit project name
|
|
144
|
+
- Use overly generic terms
|
|
145
|
+
- Expect exact string matching
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Save Tips
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
do:
|
|
152
|
+
- Include meaningful tags
|
|
153
|
+
- Write clear summaries
|
|
154
|
+
- Capture decisions with rationale
|
|
155
|
+
- Note open items for future reference
|
|
156
|
+
|
|
157
|
+
dont:
|
|
158
|
+
- Save trivial conversations
|
|
159
|
+
- Include sensitive data (API keys, etc.)
|
|
160
|
+
- Create duplicate entries
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Integration
|
|
164
|
+
|
|
165
|
+
### With sys-memory-keeper Agent
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
sys-memory-keeper agent uses this skill for:
|
|
169
|
+
- sys-memory-keeper:save command
|
|
170
|
+
- sys-memory-keeper:recall command
|
|
171
|
+
- PreCompact hook
|
|
172
|
+
- SessionStart hook
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### With Other Agents
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
Other agents can trigger memory operations via:
|
|
179
|
+
- Direct sys-memory-keeper:save/recall commands
|
|
180
|
+
- Delegating to sys-memory-keeper
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Error Handling
|
|
184
|
+
|
|
185
|
+
```yaml
|
|
186
|
+
save_errors:
|
|
187
|
+
- Connection failure: Retry 3 times, then log and continue
|
|
188
|
+
- Invalid format: Validate before save, report issues
|
|
189
|
+
- Storage full: Archive old memories, then retry
|
|
190
|
+
|
|
191
|
+
recall_errors:
|
|
192
|
+
- No results: Suggest alternative queries
|
|
193
|
+
- Connection failure: Return empty with warning
|
|
194
|
+
- Invalid query: Help user reformulate
|
|
195
|
+
```
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-recall
|
|
3
|
+
description: Search and recall memories from claude-mem
|
|
4
|
+
argument-hint: "<query> [--recent] [--limit <n>]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Memory Recall Skill
|
|
8
|
+
|
|
9
|
+
Search and recall relevant memories from claude-mem using semantic search.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
| Name | Type | Required | Description |
|
|
14
|
+
|------|------|----------|-------------|
|
|
15
|
+
| query | string | yes* | Search query (*not required with --recent) |
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
--recent, -r Recall most recent memories
|
|
21
|
+
--limit, -l Maximum results to return (default: 5)
|
|
22
|
+
--verbose, -v Show full memory content
|
|
23
|
+
--date, -d Filter by date (YYYY-MM-DD)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
1. Build semantic query
|
|
30
|
+
├── Prefix with "my-project"
|
|
31
|
+
├── Add user query terms
|
|
32
|
+
└── Include date if specified
|
|
33
|
+
|
|
34
|
+
2. Search claude-mem
|
|
35
|
+
└── chroma_query_documents
|
|
36
|
+
|
|
37
|
+
3. Format results
|
|
38
|
+
├── Sort by relevance score
|
|
39
|
+
├── Show summary for each
|
|
40
|
+
└── Provide memory IDs for detailed access
|
|
41
|
+
|
|
42
|
+
4. Present to user
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Query Tips
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
effective_queries:
|
|
49
|
+
- "authentication flow" (topic-based)
|
|
50
|
+
- "2025-01-20 oauth" (temporal + topic)
|
|
51
|
+
- "decision jwt" (type + topic)
|
|
52
|
+
- "agent creation workflow" (semantic intent)
|
|
53
|
+
|
|
54
|
+
avoid:
|
|
55
|
+
- Single generic words like "code" or "task"
|
|
56
|
+
- Very long queries (keep it focused)
|
|
57
|
+
- Special characters or complex syntax
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Output Format
|
|
61
|
+
|
|
62
|
+
### Basic Search
|
|
63
|
+
```
|
|
64
|
+
[sys-memory-keeper:recall authentication]
|
|
65
|
+
|
|
66
|
+
Searching memories for: "my-project authentication"
|
|
67
|
+
|
|
68
|
+
Found 3 relevant memories:
|
|
69
|
+
|
|
70
|
+
[1] mem_abc123 (Score: 0.95)
|
|
71
|
+
Date: 2025-01-20
|
|
72
|
+
Summary: Implemented OAuth flow with Google provider
|
|
73
|
+
Tags: [authentication, oauth, google]
|
|
74
|
+
|
|
75
|
+
[2] mem_def456 (Score: 0.87)
|
|
76
|
+
Date: 2025-01-18
|
|
77
|
+
Summary: JWT token decision - RS256 algorithm
|
|
78
|
+
Tags: [authentication, decision, jwt]
|
|
79
|
+
|
|
80
|
+
[3] mem_ghi789 (Score: 0.82)
|
|
81
|
+
Date: 2025-01-15
|
|
82
|
+
Summary: Authentication architecture discussion
|
|
83
|
+
Tags: [authentication, architecture, planning]
|
|
84
|
+
|
|
85
|
+
Use "sys-memory-keeper:recall --verbose" for full content.
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Verbose Output
|
|
89
|
+
```
|
|
90
|
+
[sys-memory-keeper:recall authentication --verbose]
|
|
91
|
+
|
|
92
|
+
Searching memories for: "my-project authentication"
|
|
93
|
+
|
|
94
|
+
[1] mem_abc123 (Score: 0.95)
|
|
95
|
+
Date: 2025-01-20
|
|
96
|
+
Tags: [authentication, oauth, google]
|
|
97
|
+
|
|
98
|
+
Content:
|
|
99
|
+
## Session Summary
|
|
100
|
+
Date: 2025-01-20
|
|
101
|
+
|
|
102
|
+
### Tasks Completed
|
|
103
|
+
- Implemented OAuth flow with Google provider
|
|
104
|
+
- Added callback handler for OAuth response
|
|
105
|
+
- Created user session management
|
|
106
|
+
|
|
107
|
+
### Decisions Made
|
|
108
|
+
- Use passport.js for OAuth handling
|
|
109
|
+
Rationale: Well-maintained, good documentation
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
[2] mem_def456 (Score: 0.87)
|
|
114
|
+
...
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Recent Memories
|
|
118
|
+
```
|
|
119
|
+
[sys-memory-keeper:recall --recent]
|
|
120
|
+
|
|
121
|
+
Fetching recent memories for: my-project
|
|
122
|
+
|
|
123
|
+
[1] mem_xyz999 (Score: 1.00)
|
|
124
|
+
Date: 2025-01-24
|
|
125
|
+
Summary: Memory system Phase 1 implementation
|
|
126
|
+
Tags: [session, memory, phase1]
|
|
127
|
+
|
|
128
|
+
[2] mem_xyz888 (Score: 0.98)
|
|
129
|
+
Date: 2025-01-23
|
|
130
|
+
Summary: Agent identification rules update
|
|
131
|
+
Tags: [session, rules, enforcement]
|
|
132
|
+
|
|
133
|
+
...
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### No Results
|
|
137
|
+
```
|
|
138
|
+
[sys-memory-keeper:recall "nonexistent topic"]
|
|
139
|
+
|
|
140
|
+
Searching memories for: "my-project nonexistent topic"
|
|
141
|
+
|
|
142
|
+
No memories found matching your query.
|
|
143
|
+
|
|
144
|
+
Suggestions:
|
|
145
|
+
- Try different keywords
|
|
146
|
+
- Use broader search terms
|
|
147
|
+
- Check available memories with "sys-memory-keeper:recall --recent"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Related
|
|
151
|
+
|
|
152
|
+
- memory-save - Save current context
|