ac-framework 1.7.0 → 1.8.0
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 +26 -0
- package/bin/postinstall.js +8 -1
- package/framework/.agent/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.agent/workflows/ac-lite.md +192 -0
- package/framework/.agent/workflows/ac.md +40 -0
- package/framework/.amazonq/prompts/ac-lite.md +192 -0
- package/framework/.amazonq/prompts/ac.md +40 -0
- package/framework/.amazonq/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.antigravity/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.antigravity/workflows/ac-lite.md +192 -0
- package/framework/.antigravity/workflows/ac.md +40 -0
- package/framework/.augment/commands/ac-lite.md +192 -0
- package/framework/.augment/commands/ac.md +40 -0
- package/framework/.augment/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.claude/commands/opsx/ac-lite.md +192 -0
- package/framework/.claude/commands/opsx/ac.md +40 -0
- package/framework/.claude/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.cline/commands/opsx/ac-lite.md +192 -0
- package/framework/.cline/commands/opsx/ac.md +40 -0
- package/framework/.cline/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.clinerules/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.clinerules/workflows/ac-lite.md +192 -0
- package/framework/.clinerules/workflows/ac.md +40 -0
- package/framework/.codebuddy/commands/opsx/ac-lite.md +192 -0
- package/framework/.codebuddy/commands/opsx/ac.md +40 -0
- package/framework/.codebuddy/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.codex/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.continue/prompts/ac-lite.md +192 -0
- package/framework/.continue/prompts/ac.md +40 -0
- package/framework/.continue/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.cospec/openspec/commands/ac-lite.md +192 -0
- package/framework/.cospec/openspec/commands/ac.md +40 -0
- package/framework/.cospec/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.crush/commands/opsx/ac-lite.md +192 -0
- package/framework/.crush/commands/opsx/ac.md +40 -0
- package/framework/.crush/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.cursor/commands/ac-lite.md +192 -0
- package/framework/.cursor/commands/ac.md +40 -0
- package/framework/.cursor/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.factory/commands/ac-lite.md +192 -0
- package/framework/.factory/commands/ac.md +40 -0
- package/framework/.factory/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.gemini/commands/opsx/ac-lite.md +192 -0
- package/framework/.gemini/commands/opsx/ac.md +40 -0
- package/framework/.gemini/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.github/prompts/ac-lite.md +192 -0
- package/framework/.github/prompts/ac.md +40 -0
- package/framework/.github/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.iflow/commands/ac-lite.md +192 -0
- package/framework/.iflow/commands/ac.md +40 -0
- package/framework/.iflow/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.kilocode/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.kilocode/workflows/ac-lite.md +192 -0
- package/framework/.kilocode/workflows/ac.md +40 -0
- package/framework/.kimi/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.kimi/workflows/ac-lite.md +192 -0
- package/framework/.kimi/workflows/ac.md +40 -0
- package/framework/.opencode/command/ac-lite.md +192 -0
- package/framework/.opencode/command/ac.md +40 -0
- package/framework/.opencode/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.qoder/commands/opsx/ac-lite.md +192 -0
- package/framework/.qoder/commands/opsx/ac.md +40 -0
- package/framework/.qoder/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.qwen/commands/ac-lite.md +192 -0
- package/framework/.qwen/commands/ac.md +40 -0
- package/framework/.qwen/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.roo/commands/ac-lite.md +192 -0
- package/framework/.roo/commands/ac.md +40 -0
- package/framework/.roo/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.trae/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.windsurf/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.windsurf/workflows/ac-lite.md +192 -0
- package/framework/.windsurf/workflows/ac.md +40 -0
- package/framework/AGENTS.md +39 -0
- package/framework/CLAUDE.md +39 -0
- package/framework/GEMINI.md +39 -0
- package/framework/copilot-instructions.md +39 -0
- package/package.json +2 -1
- package/src/cli.js +2 -0
- package/src/commands/memory.js +772 -0
- package/src/index.js +46 -0
- package/src/memory/autosave.js +382 -0
- package/src/memory/database.js +178 -0
- package/src/memory/engine.js +727 -0
- package/src/memory/index.js +62 -0
- package/src/memory/utils.js +128 -0
- package/src/services/spec-engine.js +69 -1
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: acfm-memory
|
|
3
|
+
description: Autonomous memory system for persistent learning across sessions. Automatically saves architectural decisions, bugfixes, patterns, and insights. Use to recall context from previous work and build institutional knowledge.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AC Framework Memory System
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
The AC Framework Memory System provides **autonomous persistent memory** for AI agents. It automatically detects and saves valuable knowledge during development, then recalls relevant context when needed.
|
|
11
|
+
|
|
12
|
+
**Key Capabilities:**
|
|
13
|
+
- **Automatic saving**: Detects and stores important decisions, patterns, and solutions
|
|
14
|
+
- **Full-text search**: Find relevant memories instantly
|
|
15
|
+
- **Context recall**: Get relevant knowledge before starting tasks
|
|
16
|
+
- **Pattern analysis**: Detect recurring themes and errors
|
|
17
|
+
- **Timeline view**: See chronological context around any memory
|
|
18
|
+
|
|
19
|
+
## When to Use This Skill
|
|
20
|
+
|
|
21
|
+
### Before Starting Work
|
|
22
|
+
- **Recall relevant context**: `acfm memory recall "<task description>"`
|
|
23
|
+
- **Check for similar changes**: `acfm memory search "<topic>"`
|
|
24
|
+
- **Review patterns**: `acfm memory patterns`
|
|
25
|
+
|
|
26
|
+
### During Work (Automatic)
|
|
27
|
+
The agent automatically saves memories when:
|
|
28
|
+
- Completing architectural proposals
|
|
29
|
+
- Fixing bugs (especially after multiple attempts)
|
|
30
|
+
- Refactoring code successfully
|
|
31
|
+
- Optimizing performance
|
|
32
|
+
- Discovering important patterns
|
|
33
|
+
|
|
34
|
+
### After Work
|
|
35
|
+
- **Review learnings**: `acfm memory stats`
|
|
36
|
+
- **Export for sharing**: `acfm memory export team-memory.json`
|
|
37
|
+
- **Find gaps**: `acfm memory patterns --min-frequency 1`
|
|
38
|
+
|
|
39
|
+
## Memory Types
|
|
40
|
+
|
|
41
|
+
| Type | Description | Auto-Trigger |
|
|
42
|
+
|------|-------------|--------------|
|
|
43
|
+
| `architectural_decision` | Major design decisions | After proposal/design |
|
|
44
|
+
| `bugfix_pattern` | Solutions to bugs | After fixing error |
|
|
45
|
+
| `refactor_technique` | Successful refactoring patterns | After refactor |
|
|
46
|
+
| `performance_insight` | Optimization learnings | After performance work |
|
|
47
|
+
| `security_fix` | Security vulnerability fixes | After security patch |
|
|
48
|
+
| `api_pattern` | API design patterns | After API work |
|
|
49
|
+
| `convention` | Project conventions | After establishing pattern |
|
|
50
|
+
| `workaround` | Temporary solutions | After implementing hack |
|
|
51
|
+
| `context_boundary` | System limitations | After defining boundaries |
|
|
52
|
+
|
|
53
|
+
## Commands
|
|
54
|
+
|
|
55
|
+
### Core Commands
|
|
56
|
+
|
|
57
|
+
#### Initialize Memory System
|
|
58
|
+
```bash
|
|
59
|
+
acfm memory init
|
|
60
|
+
```
|
|
61
|
+
Creates the SQLite database at `~/.acfm/memory.db`.
|
|
62
|
+
|
|
63
|
+
#### Save Memory (Manual)
|
|
64
|
+
```bash
|
|
65
|
+
acfm memory save "Descripción de la decisión o patrón" \
|
|
66
|
+
--type architectural_decision \
|
|
67
|
+
--importance high \
|
|
68
|
+
--tags "react,performance"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Recall Context
|
|
72
|
+
```bash
|
|
73
|
+
# For specific task
|
|
74
|
+
acfm memory recall "implementing authentication"
|
|
75
|
+
|
|
76
|
+
# For current project (general context)
|
|
77
|
+
acfm memory recall
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### Search Memories
|
|
81
|
+
```bash
|
|
82
|
+
# Basic search
|
|
83
|
+
acfm memory search "JWT"
|
|
84
|
+
|
|
85
|
+
# Filtered search
|
|
86
|
+
acfm memory search "database" --type architectural_decision --importance high
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Advanced Commands
|
|
90
|
+
|
|
91
|
+
#### Timeline View
|
|
92
|
+
```bash
|
|
93
|
+
acfm memory timeline <memory-id>
|
|
94
|
+
```
|
|
95
|
+
Shows what happened before and after a specific memory.
|
|
96
|
+
|
|
97
|
+
#### Connections
|
|
98
|
+
```bash
|
|
99
|
+
acfm memory connections <memory-id> --depth 2
|
|
100
|
+
```
|
|
101
|
+
Shows related memories as a graph.
|
|
102
|
+
|
|
103
|
+
#### Pattern Detection
|
|
104
|
+
```bash
|
|
105
|
+
acfm memory patterns
|
|
106
|
+
acfm memory patterns --type bugfix_pattern
|
|
107
|
+
```
|
|
108
|
+
Finds recurring topics and frequent error types.
|
|
109
|
+
|
|
110
|
+
#### Predictive Recall
|
|
111
|
+
```bash
|
|
112
|
+
acfm memory anticipate "caching strategy"
|
|
113
|
+
```
|
|
114
|
+
Predicts which memories will be relevant for a future task.
|
|
115
|
+
|
|
116
|
+
#### Statistics
|
|
117
|
+
```bash
|
|
118
|
+
acfm memory stats
|
|
119
|
+
acfm memory stats --project /path/to/project
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### Export/Import
|
|
123
|
+
```bash
|
|
124
|
+
# Export for sharing
|
|
125
|
+
acfm memory export team-memory.json
|
|
126
|
+
|
|
127
|
+
# Import shared knowledge
|
|
128
|
+
acfm memory import team-memory.json
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Auto-Save Behavior
|
|
132
|
+
|
|
133
|
+
### What Triggers Auto-Save
|
|
134
|
+
|
|
135
|
+
The agent evaluates content using a confidence score (0-1):
|
|
136
|
+
|
|
137
|
+
**High confidence triggers (auto-save):**
|
|
138
|
+
- Contains decision keywords: "decidimos", "optamos", "mejor usar"
|
|
139
|
+
- Describes solution to problem
|
|
140
|
+
- Contains architectural guidance
|
|
141
|
+
- Has error + solution pair
|
|
142
|
+
- Takes >10 minutes to resolve
|
|
143
|
+
|
|
144
|
+
**Low confidence (skip):**
|
|
145
|
+
- Very short content (<50 chars)
|
|
146
|
+
- Contains specific IDs/UUIDs
|
|
147
|
+
- Temporary TODOs
|
|
148
|
+
- Obvious/common knowledge
|
|
149
|
+
|
|
150
|
+
### Confidence Scoring
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
Base: 0.5
|
|
154
|
+
+ Decision keywords: +0.25
|
|
155
|
+
+ Contains solution: +0.20
|
|
156
|
+
+ Bug fix: +0.15
|
|
157
|
+
+ Architecture: +0.20
|
|
158
|
+
+ Optimization: +0.15
|
|
159
|
+
+ Security: +0.25
|
|
160
|
+
- Too short: -0.20
|
|
161
|
+
- Specific IDs: -0.15
|
|
162
|
+
- TODO/FIXME: -0.20
|
|
163
|
+
|
|
164
|
+
Threshold for auto-save: 0.60
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Notification
|
|
168
|
+
|
|
169
|
+
When auto-saving, the agent will display:
|
|
170
|
+
```
|
|
171
|
+
💾 Memory saved: [Brief description of what was learned]
|
|
172
|
+
Type: bugfix_pattern | Confidence: 85%
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Privacy
|
|
176
|
+
|
|
177
|
+
Content between `<private>` tags is automatically redacted:
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
Decidimos usar AWS para hosting. <private>Usaremos la cuenta
|
|
181
|
+
producción-env-123</private> para el deployment.
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Saved as:
|
|
185
|
+
```
|
|
186
|
+
Decidimos usar AWS para hosting. [REDACTED PRIVATE CONTENT]
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Integration with Spec Workflow
|
|
190
|
+
|
|
191
|
+
### Before Creating Artifacts
|
|
192
|
+
|
|
193
|
+
When you request `acfm spec instructions`, the system automatically:
|
|
194
|
+
|
|
195
|
+
1. Queries memories related to the change topic
|
|
196
|
+
2. Includes relevant memories in the response
|
|
197
|
+
3. Displays them as context for the agent
|
|
198
|
+
|
|
199
|
+
Example output:
|
|
200
|
+
```json
|
|
201
|
+
{
|
|
202
|
+
"instruction": "...",
|
|
203
|
+
"relevantMemories": [
|
|
204
|
+
{
|
|
205
|
+
"id": 42,
|
|
206
|
+
"type": "architectural_decision",
|
|
207
|
+
"content": "Previous auth system used JWT...",
|
|
208
|
+
"importance": "high"
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### During Apply Phase
|
|
215
|
+
|
|
216
|
+
When implementing tasks, the system recalls:
|
|
217
|
+
- Patterns from similar previous tasks
|
|
218
|
+
- Bugfixes related to current work
|
|
219
|
+
- Performance insights for optimization tasks
|
|
220
|
+
|
|
221
|
+
## Best Practices
|
|
222
|
+
|
|
223
|
+
### For Agents
|
|
224
|
+
|
|
225
|
+
1. **Always recall before starting**: Check `acfm memory recall` for relevant context
|
|
226
|
+
2. **Let auto-save work**: Don't manually save everything - trust the confidence scoring
|
|
227
|
+
3. **Use topic keys**: When manually saving, use consistent topic keys for deduplication
|
|
228
|
+
4. **Mark importance**: Critical decisions should be marked `critical` or `high`
|
|
229
|
+
5. **Add tags**: Tags improve searchability
|
|
230
|
+
|
|
231
|
+
### For Users
|
|
232
|
+
|
|
233
|
+
1. **Initialize once**: Run `acfm memory init` per machine
|
|
234
|
+
2. **Review periodically**: Check `acfm memory stats` to see what's been learned
|
|
235
|
+
3. **Export regularly**: Share knowledge with team via `acfm memory export`
|
|
236
|
+
4. **Prune old data**: Use `acfm memory prune` to archive obsolete memories
|
|
237
|
+
5. **Use private tags**: Mark sensitive content with `<private>` tags
|
|
238
|
+
|
|
239
|
+
## Examples
|
|
240
|
+
|
|
241
|
+
### Example 1: Bug Fix
|
|
242
|
+
|
|
243
|
+
**Agent fixes an authentication bug:**
|
|
244
|
+
```
|
|
245
|
+
💾 Memory saved: JWT refresh token fails when expired during request
|
|
246
|
+
Type: bugfix_pattern | Confidence: 87%
|
|
247
|
+
Solution: Implement token refresh interceptor
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Later, similar task:**
|
|
251
|
+
```bash
|
|
252
|
+
$ acfm memory recall "authentication token"
|
|
253
|
+
→ [Memory #42] JWT refresh token fails when expired...
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Example 2: Architectural Decision
|
|
257
|
+
|
|
258
|
+
**Agent completes proposal:**
|
|
259
|
+
```
|
|
260
|
+
💾 Memory saved: Microservices architecture chosen for scalability
|
|
261
|
+
Type: architectural_decision | Confidence: 92%
|
|
262
|
+
Tags: ["architecture", "microservices", "scalability"]
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Weeks later, new service:**
|
|
266
|
+
```bash
|
|
267
|
+
$ acfm memory search "microservices" --type architectural_decision
|
|
268
|
+
→ [Memory #15] Microservices architecture chosen for scalability
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Example 3: Pattern Detection
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
$ acfm memory patterns --type bugfix_pattern
|
|
275
|
+
|
|
276
|
+
Detected patterns:
|
|
277
|
+
- null-check-react (3×) - Null checks in React components
|
|
278
|
+
- async-race-condition (2×) - Race conditions in async code
|
|
279
|
+
- cors-preflight (2×) - CORS preflight issues
|
|
280
|
+
|
|
281
|
+
Recommendation: Consider adding ESLint rules for null checks
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Troubleshooting
|
|
285
|
+
|
|
286
|
+
### Memory not saving
|
|
287
|
+
- Check initialization: `acfm memory init`
|
|
288
|
+
- Content may be below confidence threshold
|
|
289
|
+
- May contain too many specific IDs
|
|
290
|
+
|
|
291
|
+
### Search not finding results
|
|
292
|
+
- Try broader keywords
|
|
293
|
+
- Use `acfm memory recall` without query for general context
|
|
294
|
+
- Check if memories exist: `acfm memory stats`
|
|
295
|
+
|
|
296
|
+
### Database locked
|
|
297
|
+
- Close other instances of `acfm`
|
|
298
|
+
- SQLite is single-writer; wait a moment and retry
|
|
299
|
+
|
|
300
|
+
## Related Skills
|
|
301
|
+
|
|
302
|
+
- `acfm-spec-workflow` - Foundation for spec-driven development
|
|
303
|
+
- `context-synthesizer` - For managing context in long conversations
|
|
304
|
+
- `systematic-debugging` - For complex problem resolution
|
|
305
|
+
|
|
306
|
+
## CLI Reference
|
|
307
|
+
|
|
308
|
+
See `acfm memory --help` for all commands and options.
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
**Remember**: The memory system learns from every interaction. The more you use it, the more valuable it becomes.
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: acfm-memory
|
|
3
|
+
description: Autonomous memory system for persistent learning across sessions. Automatically saves architectural decisions, bugfixes, patterns, and insights. Use to recall context from previous work and build institutional knowledge.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AC Framework Memory System
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
The AC Framework Memory System provides **autonomous persistent memory** for AI agents. It automatically detects and saves valuable knowledge during development, then recalls relevant context when needed.
|
|
11
|
+
|
|
12
|
+
**Key Capabilities:**
|
|
13
|
+
- **Automatic saving**: Detects and stores important decisions, patterns, and solutions
|
|
14
|
+
- **Full-text search**: Find relevant memories instantly
|
|
15
|
+
- **Context recall**: Get relevant knowledge before starting tasks
|
|
16
|
+
- **Pattern analysis**: Detect recurring themes and errors
|
|
17
|
+
- **Timeline view**: See chronological context around any memory
|
|
18
|
+
|
|
19
|
+
## When to Use This Skill
|
|
20
|
+
|
|
21
|
+
### Before Starting Work
|
|
22
|
+
- **Recall relevant context**: `acfm memory recall "<task description>"`
|
|
23
|
+
- **Check for similar changes**: `acfm memory search "<topic>"`
|
|
24
|
+
- **Review patterns**: `acfm memory patterns`
|
|
25
|
+
|
|
26
|
+
### During Work (Automatic)
|
|
27
|
+
The agent automatically saves memories when:
|
|
28
|
+
- Completing architectural proposals
|
|
29
|
+
- Fixing bugs (especially after multiple attempts)
|
|
30
|
+
- Refactoring code successfully
|
|
31
|
+
- Optimizing performance
|
|
32
|
+
- Discovering important patterns
|
|
33
|
+
|
|
34
|
+
### After Work
|
|
35
|
+
- **Review learnings**: `acfm memory stats`
|
|
36
|
+
- **Export for sharing**: `acfm memory export team-memory.json`
|
|
37
|
+
- **Find gaps**: `acfm memory patterns --min-frequency 1`
|
|
38
|
+
|
|
39
|
+
## Memory Types
|
|
40
|
+
|
|
41
|
+
| Type | Description | Auto-Trigger |
|
|
42
|
+
|------|-------------|--------------|
|
|
43
|
+
| `architectural_decision` | Major design decisions | After proposal/design |
|
|
44
|
+
| `bugfix_pattern` | Solutions to bugs | After fixing error |
|
|
45
|
+
| `refactor_technique` | Successful refactoring patterns | After refactor |
|
|
46
|
+
| `performance_insight` | Optimization learnings | After performance work |
|
|
47
|
+
| `security_fix` | Security vulnerability fixes | After security patch |
|
|
48
|
+
| `api_pattern` | API design patterns | After API work |
|
|
49
|
+
| `convention` | Project conventions | After establishing pattern |
|
|
50
|
+
| `workaround` | Temporary solutions | After implementing hack |
|
|
51
|
+
| `context_boundary` | System limitations | After defining boundaries |
|
|
52
|
+
|
|
53
|
+
## Commands
|
|
54
|
+
|
|
55
|
+
### Core Commands
|
|
56
|
+
|
|
57
|
+
#### Initialize Memory System
|
|
58
|
+
```bash
|
|
59
|
+
acfm memory init
|
|
60
|
+
```
|
|
61
|
+
Creates the SQLite database at `~/.acfm/memory.db`.
|
|
62
|
+
|
|
63
|
+
#### Save Memory (Manual)
|
|
64
|
+
```bash
|
|
65
|
+
acfm memory save "Descripción de la decisión o patrón" \
|
|
66
|
+
--type architectural_decision \
|
|
67
|
+
--importance high \
|
|
68
|
+
--tags "react,performance"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Recall Context
|
|
72
|
+
```bash
|
|
73
|
+
# For specific task
|
|
74
|
+
acfm memory recall "implementing authentication"
|
|
75
|
+
|
|
76
|
+
# For current project (general context)
|
|
77
|
+
acfm memory recall
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### Search Memories
|
|
81
|
+
```bash
|
|
82
|
+
# Basic search
|
|
83
|
+
acfm memory search "JWT"
|
|
84
|
+
|
|
85
|
+
# Filtered search
|
|
86
|
+
acfm memory search "database" --type architectural_decision --importance high
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Advanced Commands
|
|
90
|
+
|
|
91
|
+
#### Timeline View
|
|
92
|
+
```bash
|
|
93
|
+
acfm memory timeline <memory-id>
|
|
94
|
+
```
|
|
95
|
+
Shows what happened before and after a specific memory.
|
|
96
|
+
|
|
97
|
+
#### Connections
|
|
98
|
+
```bash
|
|
99
|
+
acfm memory connections <memory-id> --depth 2
|
|
100
|
+
```
|
|
101
|
+
Shows related memories as a graph.
|
|
102
|
+
|
|
103
|
+
#### Pattern Detection
|
|
104
|
+
```bash
|
|
105
|
+
acfm memory patterns
|
|
106
|
+
acfm memory patterns --type bugfix_pattern
|
|
107
|
+
```
|
|
108
|
+
Finds recurring topics and frequent error types.
|
|
109
|
+
|
|
110
|
+
#### Predictive Recall
|
|
111
|
+
```bash
|
|
112
|
+
acfm memory anticipate "caching strategy"
|
|
113
|
+
```
|
|
114
|
+
Predicts which memories will be relevant for a future task.
|
|
115
|
+
|
|
116
|
+
#### Statistics
|
|
117
|
+
```bash
|
|
118
|
+
acfm memory stats
|
|
119
|
+
acfm memory stats --project /path/to/project
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### Export/Import
|
|
123
|
+
```bash
|
|
124
|
+
# Export for sharing
|
|
125
|
+
acfm memory export team-memory.json
|
|
126
|
+
|
|
127
|
+
# Import shared knowledge
|
|
128
|
+
acfm memory import team-memory.json
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Auto-Save Behavior
|
|
132
|
+
|
|
133
|
+
### What Triggers Auto-Save
|
|
134
|
+
|
|
135
|
+
The agent evaluates content using a confidence score (0-1):
|
|
136
|
+
|
|
137
|
+
**High confidence triggers (auto-save):**
|
|
138
|
+
- Contains decision keywords: "decidimos", "optamos", "mejor usar"
|
|
139
|
+
- Describes solution to problem
|
|
140
|
+
- Contains architectural guidance
|
|
141
|
+
- Has error + solution pair
|
|
142
|
+
- Takes >10 minutes to resolve
|
|
143
|
+
|
|
144
|
+
**Low confidence (skip):**
|
|
145
|
+
- Very short content (<50 chars)
|
|
146
|
+
- Contains specific IDs/UUIDs
|
|
147
|
+
- Temporary TODOs
|
|
148
|
+
- Obvious/common knowledge
|
|
149
|
+
|
|
150
|
+
### Confidence Scoring
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
Base: 0.5
|
|
154
|
+
+ Decision keywords: +0.25
|
|
155
|
+
+ Contains solution: +0.20
|
|
156
|
+
+ Bug fix: +0.15
|
|
157
|
+
+ Architecture: +0.20
|
|
158
|
+
+ Optimization: +0.15
|
|
159
|
+
+ Security: +0.25
|
|
160
|
+
- Too short: -0.20
|
|
161
|
+
- Specific IDs: -0.15
|
|
162
|
+
- TODO/FIXME: -0.20
|
|
163
|
+
|
|
164
|
+
Threshold for auto-save: 0.60
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Notification
|
|
168
|
+
|
|
169
|
+
When auto-saving, the agent will display:
|
|
170
|
+
```
|
|
171
|
+
💾 Memory saved: [Brief description of what was learned]
|
|
172
|
+
Type: bugfix_pattern | Confidence: 85%
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Privacy
|
|
176
|
+
|
|
177
|
+
Content between `<private>` tags is automatically redacted:
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
Decidimos usar AWS para hosting. <private>Usaremos la cuenta
|
|
181
|
+
producción-env-123</private> para el deployment.
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Saved as:
|
|
185
|
+
```
|
|
186
|
+
Decidimos usar AWS para hosting. [REDACTED PRIVATE CONTENT]
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Integration with Spec Workflow
|
|
190
|
+
|
|
191
|
+
### Before Creating Artifacts
|
|
192
|
+
|
|
193
|
+
When you request `acfm spec instructions`, the system automatically:
|
|
194
|
+
|
|
195
|
+
1. Queries memories related to the change topic
|
|
196
|
+
2. Includes relevant memories in the response
|
|
197
|
+
3. Displays them as context for the agent
|
|
198
|
+
|
|
199
|
+
Example output:
|
|
200
|
+
```json
|
|
201
|
+
{
|
|
202
|
+
"instruction": "...",
|
|
203
|
+
"relevantMemories": [
|
|
204
|
+
{
|
|
205
|
+
"id": 42,
|
|
206
|
+
"type": "architectural_decision",
|
|
207
|
+
"content": "Previous auth system used JWT...",
|
|
208
|
+
"importance": "high"
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### During Apply Phase
|
|
215
|
+
|
|
216
|
+
When implementing tasks, the system recalls:
|
|
217
|
+
- Patterns from similar previous tasks
|
|
218
|
+
- Bugfixes related to current work
|
|
219
|
+
- Performance insights for optimization tasks
|
|
220
|
+
|
|
221
|
+
## Best Practices
|
|
222
|
+
|
|
223
|
+
### For Agents
|
|
224
|
+
|
|
225
|
+
1. **Always recall before starting**: Check `acfm memory recall` for relevant context
|
|
226
|
+
2. **Let auto-save work**: Don't manually save everything - trust the confidence scoring
|
|
227
|
+
3. **Use topic keys**: When manually saving, use consistent topic keys for deduplication
|
|
228
|
+
4. **Mark importance**: Critical decisions should be marked `critical` or `high`
|
|
229
|
+
5. **Add tags**: Tags improve searchability
|
|
230
|
+
|
|
231
|
+
### For Users
|
|
232
|
+
|
|
233
|
+
1. **Initialize once**: Run `acfm memory init` per machine
|
|
234
|
+
2. **Review periodically**: Check `acfm memory stats` to see what's been learned
|
|
235
|
+
3. **Export regularly**: Share knowledge with team via `acfm memory export`
|
|
236
|
+
4. **Prune old data**: Use `acfm memory prune` to archive obsolete memories
|
|
237
|
+
5. **Use private tags**: Mark sensitive content with `<private>` tags
|
|
238
|
+
|
|
239
|
+
## Examples
|
|
240
|
+
|
|
241
|
+
### Example 1: Bug Fix
|
|
242
|
+
|
|
243
|
+
**Agent fixes an authentication bug:**
|
|
244
|
+
```
|
|
245
|
+
💾 Memory saved: JWT refresh token fails when expired during request
|
|
246
|
+
Type: bugfix_pattern | Confidence: 87%
|
|
247
|
+
Solution: Implement token refresh interceptor
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Later, similar task:**
|
|
251
|
+
```bash
|
|
252
|
+
$ acfm memory recall "authentication token"
|
|
253
|
+
→ [Memory #42] JWT refresh token fails when expired...
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Example 2: Architectural Decision
|
|
257
|
+
|
|
258
|
+
**Agent completes proposal:**
|
|
259
|
+
```
|
|
260
|
+
💾 Memory saved: Microservices architecture chosen for scalability
|
|
261
|
+
Type: architectural_decision | Confidence: 92%
|
|
262
|
+
Tags: ["architecture", "microservices", "scalability"]
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Weeks later, new service:**
|
|
266
|
+
```bash
|
|
267
|
+
$ acfm memory search "microservices" --type architectural_decision
|
|
268
|
+
→ [Memory #15] Microservices architecture chosen for scalability
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Example 3: Pattern Detection
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
$ acfm memory patterns --type bugfix_pattern
|
|
275
|
+
|
|
276
|
+
Detected patterns:
|
|
277
|
+
- null-check-react (3×) - Null checks in React components
|
|
278
|
+
- async-race-condition (2×) - Race conditions in async code
|
|
279
|
+
- cors-preflight (2×) - CORS preflight issues
|
|
280
|
+
|
|
281
|
+
Recommendation: Consider adding ESLint rules for null checks
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Troubleshooting
|
|
285
|
+
|
|
286
|
+
### Memory not saving
|
|
287
|
+
- Check initialization: `acfm memory init`
|
|
288
|
+
- Content may be below confidence threshold
|
|
289
|
+
- May contain too many specific IDs
|
|
290
|
+
|
|
291
|
+
### Search not finding results
|
|
292
|
+
- Try broader keywords
|
|
293
|
+
- Use `acfm memory recall` without query for general context
|
|
294
|
+
- Check if memories exist: `acfm memory stats`
|
|
295
|
+
|
|
296
|
+
### Database locked
|
|
297
|
+
- Close other instances of `acfm`
|
|
298
|
+
- SQLite is single-writer; wait a moment and retry
|
|
299
|
+
|
|
300
|
+
## Related Skills
|
|
301
|
+
|
|
302
|
+
- `acfm-spec-workflow` - Foundation for spec-driven development
|
|
303
|
+
- `context-synthesizer` - For managing context in long conversations
|
|
304
|
+
- `systematic-debugging` - For complex problem resolution
|
|
305
|
+
|
|
306
|
+
## CLI Reference
|
|
307
|
+
|
|
308
|
+
See `acfm memory --help` for all commands and options.
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
**Remember**: The memory system learns from every interaction. The more you use it, the more valuable it becomes.
|