@syntesseraai/opencode-feature-factory 0.2.45 → 0.3.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.
Files changed (46) hide show
  1. package/agents/building.md +13 -14
  2. package/agents/ff-acceptance.md +12 -15
  3. package/agents/ff-research.md +12 -16
  4. package/agents/ff-review.md +12 -15
  5. package/agents/ff-security.md +12 -15
  6. package/agents/ff-validate.md +12 -15
  7. package/agents/ff-well-architected.md +12 -15
  8. package/agents/planning.md +12 -24
  9. package/agents/reviewing.md +12 -24
  10. package/dist/index.js +7 -7
  11. package/dist/local-recall/daemon.d.ts +35 -0
  12. package/dist/local-recall/daemon.js +188 -0
  13. package/dist/local-recall/index.d.ts +14 -0
  14. package/dist/local-recall/index.js +20 -0
  15. package/dist/local-recall/mcp-server.d.ts +38 -0
  16. package/dist/local-recall/mcp-server.js +71 -0
  17. package/dist/local-recall/mcp-tools.d.ts +90 -0
  18. package/dist/local-recall/mcp-tools.js +162 -0
  19. package/dist/local-recall/memory-service.d.ts +31 -0
  20. package/dist/local-recall/memory-service.js +156 -0
  21. package/dist/local-recall/model-router.d.ts +23 -0
  22. package/dist/local-recall/model-router.js +41 -0
  23. package/dist/local-recall/processed-log.d.ts +41 -0
  24. package/dist/local-recall/processed-log.js +82 -0
  25. package/dist/local-recall/session-extractor.d.ts +19 -0
  26. package/dist/local-recall/session-extractor.js +172 -0
  27. package/dist/local-recall/storage-reader.d.ts +40 -0
  28. package/dist/local-recall/storage-reader.js +147 -0
  29. package/dist/local-recall/thinking-extractor.d.ts +16 -0
  30. package/dist/local-recall/thinking-extractor.js +132 -0
  31. package/dist/local-recall/types.d.ts +129 -0
  32. package/dist/local-recall/types.js +7 -0
  33. package/package.json +1 -1
  34. package/skills/ff-learning/SKILL.md +166 -689
  35. package/dist/learning/memory-get.d.ts +0 -24
  36. package/dist/learning/memory-get.js +0 -155
  37. package/dist/learning/memory-search.d.ts +0 -20
  38. package/dist/learning/memory-search.js +0 -193
  39. package/dist/learning/memory-store.d.ts +0 -20
  40. package/dist/learning/memory-store.js +0 -85
  41. package/dist/plugins/ff-learning-get-plugin.d.ts +0 -2
  42. package/dist/plugins/ff-learning-get-plugin.js +0 -55
  43. package/dist/plugins/ff-learning-search-plugin.d.ts +0 -2
  44. package/dist/plugins/ff-learning-search-plugin.js +0 -65
  45. package/dist/plugins/ff-learning-store-plugin.d.ts +0 -2
  46. package/dist/plugins/ff-learning-store-plugin.js +0 -70
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ff-learning
3
- description: Enables agents to capture, store, and retrieve learnings from their work. Use this skill to create memory files with YAML frontmatter, search past learnings, and build organizational knowledge over time.
3
+ description: Enables agents to capture, store, and retrieve learnings from their work. Uses Local-Recall MCP-backed memory system with automatic extraction from OpenCode sessions.
4
4
  license: MIT
5
5
  compatibility: opencode
6
6
  metadata:
@@ -8,151 +8,82 @@ metadata:
8
8
  category: knowledge-management
9
9
  ---
10
10
 
11
- # Learning Skill
11
+ # Learning Skill (Local-Recall)
12
12
 
13
- Use this skill to capture insights, store knowledge, and retrieve past learnings to improve future work.
13
+ Use this skill to capture insights, store knowledge, and retrieve past learnings to improve future work. Memories are stored as JSON in `.feature-factory/local-recall/memories/` and automatically extracted from OpenCode session history.
14
14
 
15
- ## When to Use
16
-
17
- ### Required (ALWAYS use when):
15
+ ## How It Works
18
16
 
19
- - **Completing any significant task** - Store what was learned
20
- - **Resolving errors or issues** - Document the solution for future reference
21
- - **Discovering new patterns** - Capture reusable approaches
22
- - **Making architectural decisions** - Record rationale and context
23
- - **Researching technologies** - Save key findings and sources
24
-
25
- ### Optional (use when helpful):
17
+ The Local-Recall memory system has two paths for creating memories:
26
18
 
27
- - **Quick fixes** - Simple one-line changes may not need learning capture
28
- - **Routine tasks** - Well-understood repetitive work
29
- - **Draft work** - Temporary explorations that won't be retained
19
+ 1. **Automatic extraction** A background daemon reads OpenCode session history (`~/.local/share/opencode/storage/`) and extracts insights from assistant messages and thinking blocks.
20
+ 2. **Explicit storage** Agents can store learnings directly using the `ff-learning-store` tool.
30
21
 
31
- ## Memory Types
22
+ Both paths write to the same JSON-based memory store, ensuring a unified search experience.
32
23
 
33
- Agents can create three types of memories:
34
-
35
- ### 1. Episodic Memories (Experiences)
36
-
37
- **What:** Specific experiences, events, or task executions
38
- **When to use:** After completing tasks, resolving issues, or having significant interactions
39
- **Example:** "Successfully implemented OAuth flow - encountered CSRF issue, resolved by adding state parameter"
40
- **File naming:** `YYYY-MM-DD-HH-mm-ss-{agent}-{type}.md`
24
+ ## When to Use
41
25
 
42
- ### 2. Semantic Memories (Facts & Knowledge)
26
+ ### Required (ALWAYS use when):
43
27
 
44
- **What:** Factual knowledge, concepts, or understanding about the domain
45
- **When to use:** When researching technologies, understanding requirements, or documenting patterns
46
- **Example:** "React Server Components require 'use client' directive for client-side interactivity"
47
- **File naming:** `{category}-{uuid}.md`
28
+ - **Completing any significant task** Store what was learned
29
+ - **Resolving errors or issues** Document the solution for future reference
30
+ - **Discovering new patterns** Capture reusable approaches
31
+ - **Making architectural decisions** – Record rationale and context
32
+ - **Researching technologies** – Save key findings and sources
48
33
 
49
- ### 3. Procedural Memories (Skills & Procedures)
34
+ ### Optional (use when helpful):
50
35
 
51
- **What:** Step-by-step procedures, workflows, or how-to guides
52
- **When to use:** When documenting processes, creating reusable workflows, or standardizing approaches
53
- **Example:** "How to set up authentication with NextAuth.js in a Next.js application"
54
- **File naming:** `{skill-name}-{version}.md`
36
+ - **Quick fixes** – Simple one-line changes may not need learning capture
37
+ - **Routine tasks** Well-understood repetitive work
38
+ - **Draft work** Temporary explorations that won't be retained
55
39
 
56
- ## Frontmatter Schema
40
+ ## Memory Categories
57
41
 
58
- Every memory file MUST include YAML frontmatter with these fields:
42
+ Memories are organized by category:
59
43
 
60
- ```yaml
61
- ---
62
- id: 'uuid-v4-format' # Required: Unique identifier
63
- title: 'Brief, descriptive title' # Required: Human-readable title
64
- description: 'Detailed description' # Required: What was learned
65
- date: '2026-02-02T12:00:00Z' # Required: ISO 8601 timestamp
66
- memory_type: 'episodic|semantic|procedural' # Required: Type of memory
67
- agent_id: 'agent-name' # Required: Which agent created this
68
- importance: 0.0-1.0 # Required: 0.0 (low) to 1.0 (critical)
69
- tags: ['keyword1', 'keyword2'] # Required: Searchable keywords
70
- source: 'conversation|research|implementation|review' # Optional: Origin
71
- related_memories: ['uuid-1', 'uuid-2'] # Optional: Related memory IDs
72
- context: # Optional: Additional context
73
- project: 'project-name'
74
- task: 'task-description'
75
- files: ['file1.ts', 'file2.ts']
76
- ---
77
- ```
44
+ ### 1. Pattern
78
45
 
79
- ### Field Descriptions
80
-
81
- | Field | Type | Required | Description |
82
- | ------------------ | ------ | -------- | ------------------------------------------------------ |
83
- | `id` | string | Yes | UUID v4 format, uniquely identifies this memory |
84
- | `title` | string | Yes | Brief, searchable title (50-100 chars ideal) |
85
- | `description` | string | Yes | Detailed explanation of the learning |
86
- | `date` | string | Yes | ISO 8601 timestamp when memory was created |
87
- | `memory_type` | enum | Yes | One of: episodic, semantic, procedural |
88
- | `agent_id` | string | Yes | Name of the agent that created this memory |
89
- | `importance` | float | Yes | 0.0 to 1.0, higher = more important |
90
- | `tags` | array | Yes | Keywords for search and categorization |
91
- | `source` | enum | No | Origin: conversation, research, implementation, review |
92
- | `related_memories` | array | No | UUIDs of related memories for linking |
93
- | `context` | object | No | Additional structured context (project, task, files) |
46
+ **What:** Reusable code patterns, architectural patterns, and best practices
47
+ **When to use:** When a repeatable technique or approach is discovered
48
+ **Example:** "React Server Components require 'use client' directive for client-side interactivity"
94
49
 
95
- ## File Organization
50
+ ### 2. Decision
96
51
 
97
- ### Directory Structure
52
+ **What:** Architectural decisions, technology choices, and their rationale
53
+ **When to use:** When a significant decision is made during planning or implementation
54
+ **Example:** "Chose NextAuth.js over Auth0 for OAuth - simpler integration, lower cost for our scale"
98
55
 
99
- ```
100
- .feature-factory/memories/
101
- ├── episodic/ # Experience-based learnings
102
- │ └── YYYY/
103
- │ └── MM/
104
- │ └── DD/
105
- │ └── HH-mm-ss-{agent}-{type}.md
106
- ├── semantic/ # Factual knowledge
107
- │ └── {category}/
108
- │ └── {topic}-{uuid}.md
109
- ├── procedural/ # Skills and procedures
110
- │ └── {type}/
111
- │ └── {skill-name}-{version}.md
112
- └── index/ # Search indices (auto-generated)
113
- └── tags.json
114
- ```
56
+ ### 3. Debugging
115
57
 
116
- ### Naming Conventions
58
+ **What:** Error resolutions, debugging steps, and troubleshooting knowledge
59
+ **When to use:** After resolving a non-trivial bug or error
60
+ **Example:** "CSRF token mismatch in OAuth - resolved by adding explicit state parameter"
117
61
 
118
- **Episodic:**
62
+ ### 4. Preference
119
63
 
120
- - Format: `YYYY-MM-DD-HH-mm-ss-{agent}-{descriptor}.md`
121
- - Example: `2026-02-02-14-30-00-building-oauth-implementation.md`
64
+ **What:** Team conventions, style preferences, and configuration choices
65
+ **When to use:** When establishing or discovering project conventions
66
+ **Example:** "Team prefers barrel exports for module directories"
122
67
 
123
- **Semantic:**
68
+ ### 5. Context
124
69
 
125
- - Format: `{category}-{uuid}.md`
126
- - Example: `react-server-components-550e8400-e29b-41d4-a716-446655440000.md`
70
+ **What:** Domain knowledge, project context, and environmental information
71
+ **When to use:** When important contextual information is gathered during research
72
+ **Example:** "Production DB uses read replicas - write queries must target primary"
127
73
 
128
- **Procedural:**
74
+ ### 6. Procedure
129
75
 
130
- - Format: `{skill-name}-{version}.md`
131
- - Example: `nextauth-setup-v1.md`
76
+ **What:** Step-by-step procedures, workflows, and how-to guides
77
+ **When to use:** When documenting a process that should be repeatable
78
+ **Example:** "How to set up authentication with NextAuth.js in a Next.js application"
132
79
 
133
80
  ## Tools
134
81
 
135
- The ff-learning skill provides three tools for agents to interact with the memory system. These tools are especially important for **read-only agents** (like @planning and @reviewing) that cannot directly write files.
136
-
137
- ### Using the Tools
138
-
139
- **For read-only agents:** Use the tool calls directly:
140
-
141
- ```markdown
142
- Store a learning using ff-learning-store tool:
143
-
144
- - title: "OAuth Implementation Pattern"
145
- - description: "Successfully implemented OAuth with NextAuth.js"
146
- - memoryType: "semantic"
147
- - tags: ["oauth", "nextauth", "authentication"]
148
- - importance: 0.8
149
- ```
150
-
151
- **For agents with write permissions:** Can use either tools or direct file operations.
82
+ The ff-learning skill provides three tools for interacting with the memory system.
152
83
 
153
84
  ### Tool 1: Store Learning (ff-learning-store)
154
85
 
155
- **Purpose:** Create a new memory file with proper frontmatter
86
+ **Purpose:** Create a new memory explicitly
156
87
 
157
88
  **When to use:**
158
89
 
@@ -164,40 +95,30 @@ Store a learning using ff-learning-store tool:
164
95
  **Input parameters:**
165
96
 
166
97
  - `title` (string, required): Brief title for the learning
167
- - `description` (string, required): Detailed description
168
- - `memory_type` (enum, required): episodic, semantic, or procedural
169
- - `tags` (array, required): Relevant keywords
170
- - `importance` (float, required): 0.0 to 1.0
171
- - `content` (string, optional): Additional markdown content
172
- - `source` (enum, optional): Origin of the learning
173
- - `related_memories` (array, optional): UUIDs of related memories
174
-
175
- **Process:**
176
-
177
- 1. Generate UUID using `uuidgen` or similar
178
- 2. Get current timestamp in ISO 8601 format
179
- 3. Determine appropriate directory based on memory_type
180
- 4. Format frontmatter with all required fields
181
- 5. Write file to appropriate location
182
- 6. Return the file path
98
+ - `description` (string, required): Detailed description of the learning
99
+ - `category` (enum, required): One of `pattern`, `decision`, `debugging`, `preference`, `context`, or `procedure`
100
+ - `tags` (array of strings, required): Relevant keywords for search
101
+ - `importance` (float, required): 0.0 to 1.0 (0.8+ for critical learnings)
102
+ - `content` (string, optional): Additional body content
103
+ - `source` (enum, optional): Origin conversation, research, implementation, review
104
+ - `relatedMemories` (array, optional): IDs of related memories
183
105
 
184
106
  **Example:**
185
107
 
186
108
  ```markdown
187
- ## Store Learning Example
188
-
189
- After implementing OAuth:
109
+ Store a learning using ff-learning-store:
190
110
 
191
- 1. Generate UUID: `uuidgen` `550e8400-e29b-41d4-a716-446655440000`
192
- 2. Create timestamp: `date -u +%Y-%m-%dT%H:%M:%SZ` `2026-02-02T14:30:00Z`
193
- 3. Determine directory: `semantic/authentication/`
194
- 4. Write file: `semantic/authentication/oauth-implementation-550e8400.md`
195
- 5. Content includes frontmatter + detailed implementation notes
111
+ - title: "OAuth Implementation Pattern"
112
+ - description: "Successfully implemented OAuth with NextAuth.js, resolved CSRF issues"
113
+ - category: "pattern"
114
+ - tags: ["oauth", "nextauth", "authentication"]
115
+ - importance: 0.8
116
+ - content: "Used state parameter to prevent CSRF. JWT strategy for session persistence."
196
117
  ```
197
118
 
198
- ### Tool 2: Search Learnings
119
+ ### Tool 2: Search Learnings (ff-learning-search)
199
120
 
200
- **Purpose:** Find relevant memories by keywords/tags
121
+ **Purpose:** Find relevant memories by keywords and filters
201
122
 
202
123
  **When to use:**
203
124
 
@@ -208,38 +129,27 @@ After implementing OAuth:
208
129
 
209
130
  **Input parameters:**
210
131
 
211
- - `query` (string, required): Search terms
212
- - `tags` (array, optional): Filter by specific tags
213
- - `memory_type` (enum, optional): Filter by type
214
- - `agent_id` (string, optional): Filter by agent
215
- - `limit` (number, optional): Max results (default: 10)
216
- - `min_importance` (float, optional): Minimum importance threshold
217
-
218
- **Process:**
219
-
220
- 1. Use `glob` to find all memory files: `.feature-factory/memories/**/*.md`
221
- 2. Read frontmatter from each file
222
- 3. Match against query (title, description, tags)
223
- 4. Apply filters (tags, type, agent, importance)
224
- 5. Sort by relevance and importance
225
- 6. Return array of matching memory metadata
132
+ - `query` (string, required): Search terms to match against title, body, and tags
133
+ - `tags` (array, optional): Filter to memories containing ALL specified tags
134
+ - `category` (enum, optional): Filter by category (`pattern`, `decision`, `debugging`, `preference`, `context`, `procedure`)
135
+ - `limit` (number, optional): Max results, 1-50 (default: 10)
136
+ - `minImportance` (float, optional): Minimum importance threshold
226
137
 
227
138
  **Example:**
228
139
 
229
140
  ```markdown
230
- ## Search Example
231
-
232
- Before implementing authentication:
141
+ Search learnings:
233
142
 
234
- 1. Search: `query: "OAuth", tags: ["authentication", "security"]`
235
- 2. Find: `semantic/authentication/oauth-implementation-550e8400.md`
236
- 3. Review: Read the memory to understand previous approach
237
- 4. Apply: Use lessons learned in new implementation
143
+ - query: "OAuth authentication"
144
+ - tags: ["security"]
145
+ - limit: 5
238
146
  ```
239
147
 
240
- ### Tool 3: Get Learning
148
+ **Returns:** Array of matching memories sorted by relevance × importance, with id, title, category, tags, importance, and relevance score.
149
+
150
+ ### Tool 3: Get Learning (ff-learning-get)
241
151
 
242
- **Purpose:** Retrieve full content of a specific memory
152
+ **Purpose:** Retrieve the full content of a specific memory
243
153
 
244
154
  **When to use:**
245
155
 
@@ -249,289 +159,67 @@ Before implementing authentication:
249
159
 
250
160
  **Input parameters:**
251
161
 
252
- - `memory_id` (string, optional): UUID of the memory
253
- - `file_path` (string, optional): Direct path to memory file
254
-
255
- **Process:**
256
-
257
- 1. If `memory_id` provided, search for file containing that ID
258
- 2. If `file_path` provided, read directly
259
- 3. Parse frontmatter and content
260
- 4. Return complete memory object
261
-
262
- **Example:**
263
-
264
- ```markdown
265
- ## Get Learning Example
266
-
267
- After finding a relevant memory:
268
-
269
- 1. Get by ID: `memory_id: "550e8400-e29b-41d4-a716-446655440000"`
270
- 2. Or get by path: `file_path: "semantic/authentication/oauth-implementation-550e8400.md"`
271
- 3. Read full content including implementation details
272
- 4. Apply learnings to current task
273
- ```
274
-
275
- ## Additional Tools for Read-Only Agents
276
-
277
- Since @planning and @reviewing agents are read-only (cannot write/edit files), the following tools are provided for essential file operations:
278
-
279
- ### Tool 4: Create Plan (ff-plan-create)
280
-
281
- **Purpose:** Create a new implementation plan file in `.feature-factory/plans/`
282
-
283
- **When to use:**
162
+ - `memoryId` (string, required): UUID of the memory to retrieve
284
163
 
285
- - At the end of planning sessions to document the plan
286
- - When creating architecture or migration plans
287
- - To document research findings as structured plans
164
+ **Returns:** Complete memory object with all fields (id, sessionID, messageID, category, title, body, tags, importance, createdAt, extractedBy).
288
165
 
289
- **Input parameters:**
290
-
291
- - `title` (string, required): Title of the plan
292
- - `description` (string, required): What the plan covers
293
- - `content` (string, required): Full markdown content
294
- - `planType` (enum, required): implementation, architecture, migration, or research
295
- - `relatedIssues` (array, optional): Related issue IDs
296
- - `estimatedEffort` (string, optional): Time estimate
297
-
298
- **Example:**
166
+ ## File Organization
299
167
 
300
- ```markdown
301
- Create plan using ff-plan-create:
168
+ ### Directory Structure
302
169
 
303
- - title: "OAuth Implementation Plan"
304
- - description: "Plan for implementing OAuth authentication"
305
- - content: "## Phase 1: Setup..."
306
- - planType: "implementation"
307
- - estimatedEffort: "2-3 hours"
308
170
  ```
309
-
310
- ### Tool 5: Create Agent Context (ff-agent-context-create)
311
-
312
- **Purpose:** Create a new agent context file in `.feature-factory/agents/`
313
-
314
- **When to use:**
315
-
316
- - At the start of EVERY agent task to document context
317
- - When delegating work to track parent-child relationships
318
- - To maintain agent state and progress
319
-
320
- **Input parameters:**
321
-
322
- - `id` (string, required): UUID for this agent instance
323
- - `agent` (string, required): Agent type (planning, building, etc.)
324
- - `title` (string, required): Task title
325
- - `description` (string, required): Task description
326
- - `status` (enum, optional): in-progress, completed, delegated, failed
327
- - `parent` (string, optional): Parent agent UUID
328
- - `delegatedTo` (array, optional): Child agent UUIDs
329
- - `notes` (string, optional): Additional notes
330
-
331
- **Example:**
332
-
333
- ```markdown
334
- Create agent context using ff-agent-context-create:
335
-
336
- - id: "550e8400-e29b-41d4-a716-446655440000"
337
- - agent: "planning"
338
- - title: "Implement OAuth"
339
- - description: "Plan OAuth implementation for customer portal"
340
- - status: "in-progress"
171
+ .feature-factory/local-recall/
172
+ ├── memories/ # All memory JSON files
173
+ │ ├── {uuid}.json # Individual memory files
174
+ │ └── ...
175
+ └── processed.json # Tracks which messages have been processed
341
176
  ```
342
177
 
343
- ### Tool 6: Update Agent Context (ff-agent-context-update)
344
-
345
- **Purpose:** Update an existing agent context file
346
-
347
- **When to use:**
348
-
349
- - When status changes (e.g., completed, delegated)
350
- - When adding delegated child agents
351
- - When appending progress updates or notes
352
-
353
- **Input parameters:**
354
-
355
- - `agentId` (string, required): Agent UUID to update
356
- - `agent` (string, required): Agent type
357
- - `status` (enum, optional): New status
358
- - `addDelegatedTo` (string, optional): Add child agent UUID
359
- - `notes` (string, optional): Notes to append
360
- - `progressUpdate` (string, optional): Progress line to add
361
-
362
- **Example:**
363
-
364
- ```markdown
365
- Update agent context using ff-agent-context-update:
366
-
367
- - agentId: "550e8400-e29b-41d4-a716-446655440000"
368
- - agent: "planning"
369
- - status: "completed"
370
- - notes: "Planning finished successfully"
178
+ ### Memory JSON Schema
179
+
180
+ Each memory is a JSON file with these fields:
181
+
182
+ ```json
183
+ {
184
+ "id": "uuid-v4",
185
+ "sessionID": "ses_xxx",
186
+ "messageID": "msg_xxx",
187
+ "category": "pattern|decision|debugging|preference|context|procedure",
188
+ "title": "Brief descriptive title",
189
+ "body": "Detailed learning content",
190
+ "tags": ["keyword1", "keyword2"],
191
+ "importance": 0.8,
192
+ "createdAt": 1707900000000,
193
+ "extractedBy": "session|thinking|explicit"
194
+ }
371
195
  ```
372
196
 
373
197
  ## Usage by Agent Type
374
198
 
375
199
  ### Planning Agent
376
200
 
377
- **When to capture:**
378
-
379
- - After completing planning session
380
- - When architectural decisions are made
381
- - When risks are identified
382
-
383
- **What to capture:**
384
-
385
- - Architecture decisions and rationale
386
- - Risk factors and mitigation strategies
387
- - Pattern discoveries from codebase exploration
388
- - Estimation accuracy reflections
389
-
390
- **Example workflow:**
391
-
392
- ```markdown
393
- At end of planning session:
394
-
395
- 1. Reflect on what was learned
396
- 2. Store key insights:
397
- - Architecture decisions made
398
- - Risk factors identified
399
- - Pattern discoveries
400
- 3. Tag with relevant keywords
401
- 4. Link related memories
402
- ```
201
+ **When to capture:** After planning sessions, architectural decisions, risk identification
202
+ **What to capture:** Architecture decisions (decision), risk factors (context), pattern discoveries (pattern)
403
203
 
404
204
  ### Building Agent
405
205
 
406
- **When to capture:**
407
-
408
- - After implementing feature
409
- - When technical challenge is overcome
410
- - When error is resolved
411
- - When new pattern is discovered
412
-
413
- **What to capture:**
414
-
415
- - Technical implementation details
416
- - Code patterns and best practices
417
- - Error resolutions and debugging steps
418
- - Integration challenges and solutions
419
-
420
- **Example workflow:**
421
-
422
- ```markdown
423
- After implementing feature:
424
-
425
- 1. Document technical learnings
426
- 2. Store code patterns discovered
427
- 3. Record error resolutions
428
- 4. Tag with technology names
429
- 5. Link to related documentation
430
- ```
206
+ **When to capture:** After implementing features, overcoming challenges, resolving errors
207
+ **What to capture:** Code patterns (pattern), error resolutions (debugging), integration insights (context)
431
208
 
432
209
  ### Reviewing Agent
433
210
 
434
- **When to capture:**
435
-
436
- - After completing review
437
- - When common issues are identified
438
- - When quality patterns are observed
439
-
440
- **What to capture:**
441
-
442
- - Common issues and their solutions
443
- - Quality patterns observed
444
- - Review effectiveness insights
445
- - Improvement recommendations
446
-
447
- **Example workflow:**
448
-
449
- ```markdown
450
- After completing review:
451
-
452
- 1. Summarize findings
453
- 2. Store patterns of issues found
454
- 3. Document effective review techniques
455
- 4. Tag with review type and categories
456
- ```
211
+ **When to capture:** After completing reviews, identifying common issues
212
+ **What to capture:** Common issue patterns (pattern), quality insights (context)
457
213
 
458
214
  ### Research Agent
459
215
 
460
- **When to capture:**
461
-
462
- - After completing research
463
- - When significant findings are discovered
464
- - When technology evaluation is complete
465
-
466
- **What to capture:**
467
-
468
- - Key findings and conclusions
469
- - Technology comparisons
470
- - Best practices discovered
471
- - Source references and links
472
-
473
- **Example workflow:**
474
-
475
- ```markdown
476
- After completing research:
477
-
478
- 1. Store key findings as semantic memories
479
- 2. Tag with research topics
480
- 3. Link to sources
481
- 4. Set high importance for critical findings
482
- ```
216
+ **When to capture:** After research, significant findings, technology evaluations
217
+ **What to capture:** Key findings (pattern), technology comparisons (decision), best practices (procedure)
483
218
 
484
219
  ### Security Agent
485
220
 
486
- **When to capture:**
487
-
488
- - After security audit
489
- - When vulnerabilities are found
490
- - When security patterns are identified
491
-
492
- **What to capture:**
493
-
494
- - Vulnerability findings and fixes
495
- - Security best practices
496
- - Threat model insights
497
- - Compliance considerations
498
-
499
- **Example workflow:**
500
-
501
- ```markdown
502
- After security audit:
503
-
504
- 1. Document vulnerabilities found
505
- 2. Store security best practices
506
- 3. Record threat model insights
507
- 4. Tag with security categories
508
- ```
509
-
510
- ### Acceptance Agent
511
-
512
- **When to capture:**
513
-
514
- - After validating requirements
515
- - When acceptance criteria insights are gained
516
- - When requirement patterns are identified
517
-
518
- **What to capture:**
519
-
520
- - Requirement validation insights
521
- - Acceptance criteria patterns
522
- - Ambiguity resolutions
523
- - Scope clarifications
524
-
525
- **Example workflow:**
526
-
527
- ```markdown
528
- After validating requirements:
529
-
530
- 1. Document requirement insights
531
- 2. Store acceptance criteria patterns
532
- 3. Record ambiguity resolutions
533
- 4. Tag with requirement types
534
- ```
221
+ **When to capture:** After audits, vulnerability findings
222
+ **What to capture:** Vulnerability patterns (debugging), security best practices (procedure)
535
223
 
536
224
  ## Integration with Other Skills
537
225
 
@@ -545,318 +233,107 @@ After validating requirements:
545
233
 
546
234
  - Add "Capture learnings" as final todo item
547
235
  - Track learning capture in todo list
548
- - Ensure learnings are not forgotten
549
236
 
550
237
  ### With ff-mini-plan
551
238
 
552
239
  - Search past learnings during planning
553
240
  - Use previous patterns to inform new plans
554
- - Store plan effectiveness as episodic memory
555
-
556
- ### With ff-report-templates
557
-
558
- - Use standardized formats for memory content
559
- - Include severity/confidence in technical learnings
560
- - Apply report structure to procedural memories
561
241
 
562
242
  ## Best Practices
563
243
 
564
244
  ### Do:
565
245
 
566
- - **Be specific** - Concrete details are more useful than generalities
567
- - **Use consistent tags** - Establish tag conventions for your project
568
- - **Set appropriate importance** - Reserve 0.8-1.0 for truly critical learnings
569
- - **Link related memories** - Create connections between related learnings
570
- - **Include context** - Project, task, and file context helps retrieval
571
- - **Write searchable titles** - Use keywords that future you will search for
572
- - **Capture failures too** - What didn't work is as valuable as what did
573
- - ✅ **Review periodically** - Search old learnings before starting new tasks
246
+ - **Be specific** Concrete details are more useful than generalities
247
+ - **Use consistent tags** Establish tag conventions for your project
248
+ - **Set appropriate importance** Reserve 0.8-1.0 for truly critical learnings
249
+ - **Write searchable titles** Use keywords that future you will search for
250
+ - **Capture failures too** What didn't work is as valuable as what did
251
+ - **Search before storing** Avoid duplicate memories
252
+ - **Review periodically** Search old learnings before starting new tasks
574
253
 
575
254
  ### Don't:
576
255
 
577
- - **Store everything** - Not every small change needs a memory
578
- - **Use vague titles** - "Fixed bug" is not helpful; "Fixed race condition in auth middleware" is
579
- - **Duplicate memories** - Search first to avoid redundancy
580
- - **Forget tags** - Untagged memories are hard to find
581
- - **Store secrets** - Never put credentials or sensitive data in memories
582
- - ❌ **Be too brief** - One-line descriptions lack context
583
-
584
- ## Common Mistakes to Avoid
585
-
586
- ### Mistake 1: Not Searching First
587
-
588
- **Problem:** Creating duplicate memories for the same learning
589
- **Solution:** Always search before storing: `Search learnings with query and tags`
590
-
591
- ### Mistake 2: Poor Tagging
592
-
593
- **Problem:** Memories can't be found later due to inconsistent or missing tags
594
- **Solution:** Establish tag conventions: technology names, categories, project names
256
+ - **Store everything** Not every small change needs a memory
257
+ - **Use vague titles** "Fixed bug" is not helpful; "Fixed race condition in auth middleware" is
258
+ - **Store secrets** Never put credentials or sensitive data in memories
259
+ - **Be too brief** – One-line descriptions lack context
260
+ - **Forget tags** Untagged memories are hard to find
595
261
 
596
- ### Mistake 3: Wrong Memory Type
597
-
598
- **Problem:** Using episodic for procedural knowledge or vice versa
599
- **Solution:**
600
-
601
- - Episodic = specific event/task
602
- - Semantic = general knowledge
603
- - Procedural = how-to guide
604
-
605
- ### Mistake 4: Missing Context
606
-
607
- **Problem:** Memory lacks context to be useful later
608
- **Solution:** Always include project, task, and relevant files in context field
609
-
610
- ### Mistake 5: Not Capturing Failures
611
-
612
- **Problem:** Only storing successes, missing valuable failure lessons
613
- **Solution:** Store what didn't work and why - prevents future repetition
614
-
615
- ## Example Memory Files
616
-
617
- ### Example 1: Episodic Memory
618
-
619
- ````markdown
620
- ---
621
- id: '550e8400-e29b-41d4-a716-446655440000'
622
- title: 'OAuth Implementation with NextAuth.js'
623
- description: 'Successfully implemented OAuth authentication using NextAuth.js with Google provider. Encountered and resolved CSRF token issues.'
624
- date: '2026-02-02T14:30:00Z'
625
- memory_type: 'episodic'
626
- agent_id: 'building'
627
- importance: 0.8
628
- tags: ['oauth', 'nextauth', 'authentication', 'nextjs', 'csrf']
629
- source: 'implementation'
630
- context:
631
- project: 'customer-portal'
632
- task: 'Implement Google OAuth'
633
- files: ['app/api/auth/[...nextauth]/route.ts', 'lib/auth.ts']
634
- ---
635
-
636
- ## Implementation Details
637
-
638
- ### What Worked
639
-
640
- 1. Using NextAuth.js with Google provider
641
- 2. Configuring callback URLs properly
642
- 3. Storing user data in Supabase after OAuth
643
-
644
- ### Challenges Faced
645
-
646
- 1. **CSRF Token Mismatch**
647
- - Issue: State parameter not being validated
648
- - Solution: Added explicit state parameter in OAuth config
649
- - Code: See lib/auth.ts lines 45-52
650
-
651
- 2. **Session Persistence**
652
- - Issue: Sessions not persisting across page reloads
653
- - Solution: Configured JWT strategy with database persistence
654
-
655
- ### Key Code Pattern
656
-
657
- ```typescript
658
- // Always include state parameter for CSRF protection
659
- providers: [
660
- GoogleProvider({
661
- clientId: process.env.GOOGLE_CLIENT_ID!,
662
- clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
663
- authorization: {
664
- params: {
665
- state: generateState(),
666
- },
667
- },
668
- }),
669
- ],
670
- ```
671
- ````
672
-
673
- ### Lessons Learned
674
-
675
- - Always validate state parameter in OAuth flows
676
- - Test session persistence across page reloads
677
- - Use JWT strategy for serverless environments
678
-
679
- ````
680
-
681
- ### Example 2: Semantic Memory
682
-
683
- ```markdown
684
- ---
685
- id: '6ba7b810-9dad-11d1-80b4-00c04fd430c8'
686
- title: 'React Server Components Data Fetching'
687
- description: 'Understanding when and how to fetch data in React Server Components vs Client Components'
688
- date: '2026-02-01T10:00:00Z'
689
- memory_type: 'semantic'
690
- agent_id: 'research'
691
- importance: 0.9
692
- tags: ['react', 'server-components', 'data-fetching', 'nextjs', 'patterns']
693
- source: 'research'
694
- related_memories: ['550e8400-e29b-41d4-a716-446655440000']
695
- ---
262
+ ## Additional Tools for Read-Only Agents
696
263
 
697
- ## Key Concepts
264
+ Since @planning and @reviewing agents are read-only (cannot write/edit files), the following tools are provided for essential file operations:
698
265
 
699
- ### Server Components
266
+ ### Tool 4: Create Plan (ff-plan-create)
700
267
 
701
- - Can be async functions
702
- - Can fetch data directly
703
- - Run on server only
704
- - Cannot use useState, useEffect, or browser APIs
268
+ **Purpose:** Create a new implementation plan file in `.feature-factory/plans/`
705
269
 
706
- ### Client Components
270
+ **Input parameters:**
707
271
 
708
- - Must use 'use client' directive
709
- - Cannot be async
710
- - Use useEffect for data fetching
711
- - Can use all React hooks and browser APIs
272
+ - `title` (string, required): Title of the plan
273
+ - `description` (string, required): What the plan covers
274
+ - `content` (string, required): Full markdown content
275
+ - `planType` (enum, required): implementation, architecture, migration, or research
276
+ - `relatedIssues` (array, optional): Related issue IDs
277
+ - `estimatedEffort` (string, optional): Time estimate
712
278
 
713
- ### Best Practices
279
+ ### Tool 5: Create Agent Context (ff-agent-context-create)
714
280
 
715
- 1. **Fetch in Server Components when possible**
716
- - Better performance
717
- - Reduced client-side JavaScript
718
- - Direct database access
281
+ **Purpose:** Create a new agent context file in `.feature-factory/agents/`
719
282
 
720
- 2. **Use Client Components for interactivity**
721
- - Forms with validation
722
- - Real-time updates
723
- - Browser-only features
283
+ **Input parameters:**
724
284
 
725
- 3. **Pass data as props**
726
- - Server Component fetches data
727
- - Passes to Client Component as props
728
- - Client Component handles interactivity
285
+ - `id` (string, required): UUID for this agent instance
286
+ - `agent` (string, required): Agent type (planning, building, etc.)
287
+ - `title` (string, required): Task title
288
+ - `description` (string, required): Task description
289
+ - `status` (enum, optional): in-progress, completed, delegated, failed
290
+ - `parent` (string, optional): Parent agent UUID
291
+ - `delegatedTo` (array, optional): Child agent UUIDs
292
+ - `notes` (string, optional): Additional notes
729
293
 
730
- ### Code Example
294
+ ### Tool 6: Update Agent Context (ff-agent-context-update)
731
295
 
732
- ```typescript
733
- // Server Component (app/page.tsx)
734
- async function Page() {
735
- const data = await fetchData(); // Direct fetch
736
- return <ClientComponent initialData={data} />;
737
- }
296
+ **Purpose:** Update an existing agent context file
738
297
 
739
- // Client Component (components/ClientComponent.tsx)
740
- 'use client';
298
+ **Input parameters:**
741
299
 
742
- function ClientComponent({ initialData }) {
743
- const [data, setData] = useState(initialData);
744
- // Handle interactivity...
745
- }
746
- ````
300
+ - `agentId` (string, required): Agent UUID to update
301
+ - `agent` (string, required): Agent type
302
+ - `status` (enum, optional): New status
303
+ - `addDelegatedTo` (string, optional): Add child agent UUID
304
+ - `notes` (string, optional): Notes to append
305
+ - `progressUpdate` (string, optional): Progress line to add
747
306
 
748
- ````
307
+ ## Quick Reference
749
308
 
750
- ### Example 3: Procedural Memory
309
+ ### Creating a Memory
751
310
 
752
311
  ```markdown
753
- ---
754
- id: '6ba7b811-9dad-11d1-80b4-00c04fd430c8'
755
- title: 'Setting Up Feature Factory in New Project'
756
- description: 'Step-by-step procedure for installing and configuring Feature Factory in a new codebase'
757
- date: '2026-01-15T09:00:00Z'
758
- memory_type: 'procedural'
759
- agent_id: 'building'
760
- importance: 0.7
761
- tags: ['feature-factory', 'setup', 'installation', 'configuration']
762
- source: 'implementation'
763
- ---
764
-
765
- ## Prerequisites
766
-
767
- - Node.js 18+
768
- - Git repository initialized
769
- - opencode CLI installed
312
+ Store a learning:
770
313
 
771
- ## Steps
772
-
773
- ### 1. Install Plugin
774
-
775
- ```bash
776
- cd packages/opencode-plugin
777
- npm install
778
- npm run build
779
- ````
780
-
781
- ### 2. Configure Agents
782
-
783
- Create `.config/opencode/agents/` directory and copy agent files:
784
-
785
- ```bash
786
- mkdir -p .config/opencode/agents
787
- cp -r packages/opencode-plugin/agents/* .config/opencode/agents/
788
- ```
789
-
790
- ### 3. Configure Skills
791
-
792
- Create `.config/opencode/skills/` directory and copy skill files:
793
-
794
- ```bash
795
- mkdir -p .config/opencode/skills
796
- cp -r packages/opencode-plugin/skills/* .config/opencode/skills/
797
- ```
798
-
799
- ### 4. Initialize Feature Factory
800
-
801
- ```bash
802
- npx ff-setup
803
- ```
804
-
805
- ### 5. Verify Setup
806
-
807
- ```bash
808
- npx ff-doctor
314
+ - title: "Descriptive searchable title"
315
+ - description: "Detailed explanation of what was learned"
316
+ - category: "pattern"
317
+ - tags: ["relevant", "keywords"]
318
+ - importance: 0.8
809
319
  ```
810
320
 
811
- ## Common Issues
812
-
813
- ### Issue: Agents not found
814
-
815
- **Solution:** Check that agent files are in `.config/opencode/agents/`
816
-
817
- ### Issue: Skills not loading
818
-
819
- **Solution:** Verify skill files have proper frontmatter
820
-
821
- ## Next Steps
822
-
823
- - Read `docs/GETTING_STARTED.md`
824
- - Try running `@planning` agent
825
- - Create your first feature plan
826
-
827
- ````
828
-
829
- ## Quick Reference
830
-
831
- ### Creating a Memory
832
-
833
- 1. Generate UUID: `uuidgen`
834
- 2. Get timestamp: `date -u +%Y-%m-%dT%H:%M:%SZ`
835
- 3. Choose directory based on type
836
- 4. Write file with frontmatter + content
837
- 5. Include tags for searchability
838
-
839
321
  ### Searching Memories
840
322
 
841
323
  ```markdown
842
324
  Search learnings:
325
+
843
326
  - query: "authentication"
844
327
  - tags: ["oauth", "security"]
845
- - memory_type: "semantic"
846
328
  - limit: 5
847
- ````
329
+ ```
848
330
 
849
331
  ### Memory Checklist
850
332
 
851
333
  Before storing a memory, verify:
852
334
 
853
- - [ ] UUID is unique
854
335
  - [ ] Title is descriptive and searchable
855
336
  - [ ] Description explains what was learned
856
- - [ ] Date is ISO 8601 format
857
- - [ ] Memory type is correct
858
- - [ ] Agent ID is set
859
- - [ ] Importance is appropriate (0.0-1.0)
860
337
  - [ ] Tags are relevant and consistent
861
- - [ ] Context includes project/task/files
338
+ - [ ] Importance is appropriate (0.0-1.0)
862
339
  - [ ] No sensitive data included