@syntesseraai/opencode-feature-factory 0.3.5 → 0.4.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 +0 -27
- package/agents/building.md +0 -30
- package/agents/ff-acceptance.md +0 -27
- package/agents/ff-research.md +0 -28
- package/agents/ff-review.md +0 -27
- package/agents/ff-security.md +0 -27
- package/agents/ff-validate.md +0 -27
- package/agents/ff-well-architected.md +0 -27
- package/agents/planning.md +0 -29
- package/agents/reviewing.md +0 -29
- package/bin/ff-deploy.js +0 -11
- package/dist/feature-factory-setup.d.ts +1 -1
- package/dist/feature-factory-setup.js +3 -3
- package/dist/index.js +3 -14
- package/dist/local-recall/prompt-injection.d.ts +2 -0
- package/dist/local-recall/prompt-injection.js +194 -0
- package/dist/mcp-config.d.ts +0 -5
- package/dist/mcp-config.js +0 -5
- package/package.json +3 -6
- package/skills/ff-context-tracking/SKILL.md +3 -6
- package/bin/ff-local-recall-mcp.js +0 -9
- package/skills/ff-learning/SKILL.md +0 -339
package/README.md
CHANGED
|
@@ -29,33 +29,6 @@ This will:
|
|
|
29
29
|
- Copy skills to `~/.config/opencode/skills/`
|
|
30
30
|
- Configure MCP servers in `~/.config/opencode/opencode.json`
|
|
31
31
|
|
|
32
|
-
## Local Recall MCP Daemon
|
|
33
|
-
|
|
34
|
-
The plugin now includes a local MCP daemon binary: `ff-local-recall-mcp`.
|
|
35
|
-
|
|
36
|
-
- `ff-deploy` adds a local MCP server entry named `ff-local-recall`
|
|
37
|
-
- The server exposes memory tools:
|
|
38
|
-
- `local_recall.search`
|
|
39
|
-
- `local_recall.get`
|
|
40
|
-
- `local_recall.store`
|
|
41
|
-
- `local_recall.index.start`
|
|
42
|
-
- `local_recall.index.status`
|
|
43
|
-
- `local_recall.index.stop`
|
|
44
|
-
- `local_recall.index.rebuild`
|
|
45
|
-
|
|
46
|
-
### Environment Variables
|
|
47
|
-
|
|
48
|
-
- `FF_LOCAL_RECALL_DIRECTORY` - Directory that contains `ff-memories/` (default: current working directory)
|
|
49
|
-
- `FF_LOCAL_RECALL_DAEMON_AUTOSTART` - Start index daemon automatically (`true` by default)
|
|
50
|
-
- `FF_LOCAL_RECALL_INDEX_INTERVAL_MS` - Background daemon interval in milliseconds (default: `15000`)
|
|
51
|
-
- `FF_LOCAL_RECALL_EXTRACTION_ENABLED` - Run extraction during daemon cycles (`true` by default)
|
|
52
|
-
- `FF_LOCAL_RECALL_EMBEDDING_PROVIDER` - Embedding provider (`ollama` default, `openai` optional)
|
|
53
|
-
- `FF_LOCAL_RECALL_OLLAMA_URL` - Ollama base URL (default: `http://127.0.0.1:11434`)
|
|
54
|
-
- `FF_LOCAL_RECALL_OLLAMA_MODEL` - Ollama embedding model (default: `nomic-embed-text`)
|
|
55
|
-
- `FF_LOCAL_RECALL_OPENAI_URL` - OpenAI embeddings endpoint base (default: `https://api.openai.com/v1`)
|
|
56
|
-
- `FF_LOCAL_RECALL_OPENAI_MODEL` - OpenAI embedding model (default: `text-embedding-3-small`)
|
|
57
|
-
- `OPENAI_API_KEY` - Required when `FF_LOCAL_RECALL_EMBEDDING_PROVIDER=openai`
|
|
58
|
-
|
|
59
32
|
## Agents Provided
|
|
60
33
|
|
|
61
34
|
### Primary Agents
|
package/agents/building.md
CHANGED
|
@@ -68,7 +68,6 @@ At the start of EVERY building task:
|
|
|
68
68
|
5. **Load the ff-delegation skill** and assess parallelization opportunities
|
|
69
69
|
6. **Load the ff-mini-plan skill** and create an execution plan
|
|
70
70
|
7. **Load the ff-todo-management skill** and create a todo list for tracking progress
|
|
71
|
-
8. **Load the ff-learning skill** to capture implementation insights
|
|
72
71
|
9. **Load the ff-severity-classification skill** to assess risks of changes
|
|
73
72
|
10. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/building-{UUID}.md`
|
|
74
73
|
11. **Check for existing plans** - Use `ff-plans-list` and `ff-plans-get` to find implementation plans
|
|
@@ -451,32 +450,3 @@ When @reviewing agent returns findings:
|
|
|
451
450
|
```
|
|
452
451
|
|
|
453
452
|
Create todos for each critical/high item, fix them, then re-invoke @reviewing if needed.
|
|
454
|
-
|
|
455
|
-
## Capture Learnings
|
|
456
|
-
|
|
457
|
-
Before completing your building task:
|
|
458
|
-
|
|
459
|
-
1. **Reflect on insights gained** during implementation:
|
|
460
|
-
- Technical challenges overcome
|
|
461
|
-
- Code patterns and best practices discovered
|
|
462
|
-
- Error resolutions and debugging insights
|
|
463
|
-
- Integration challenges and solutions
|
|
464
|
-
|
|
465
|
-
2. **Store important learnings** using the `ff-learning-store` MCP tool:
|
|
466
|
-
- Use category `pattern` for technical patterns and best practices
|
|
467
|
-
- Use category `context` for significant implementation experiences
|
|
468
|
-
- Use category `procedure` for reusable workflows discovered
|
|
469
|
-
- Tag with relevant technology names and categories
|
|
470
|
-
|
|
471
|
-
3. **Example learning capture:**
|
|
472
|
-
|
|
473
|
-
```
|
|
474
|
-
ff-learning-store(
|
|
475
|
-
title: "Implementation Pattern: [Pattern Name]",
|
|
476
|
-
description: "Best practice for [scenario] in [technology]",
|
|
477
|
-
category: "pattern",
|
|
478
|
-
tags: ["implementation", "pattern", "{technology}"],
|
|
479
|
-
importance: 0.8,
|
|
480
|
-
content: "Detailed explanation of the pattern..."
|
|
481
|
-
)
|
|
482
|
-
```
|
package/agents/ff-acceptance.md
CHANGED
|
@@ -53,7 +53,6 @@ At the start of EVERY validation task:
|
|
|
53
53
|
3. **Read relevant contexts** - Use `ff-agents-show()` to read contexts from @building, @planning, etc.
|
|
54
54
|
4. **Load the ff-mini-plan skill** and create a quick 2-5 step plan for your validation approach
|
|
55
55
|
5. **Load the ff-todo-management skill** and create a todo list from your plan
|
|
56
|
-
6. **Load the ff-learning skill** to capture validation insights and patterns
|
|
57
56
|
7. **Load the ff-severity-classification skill** to ensure consistent issue classification
|
|
58
57
|
8. **Load the ff-report-templates skill** for standardized output formatting
|
|
59
58
|
9. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/ff-acceptance-{UUID}.md`
|
|
@@ -277,29 +276,3 @@ Use ff-severity-classification skill standards:
|
|
|
277
276
|
11. Mark all todos complete before finishing
|
|
278
277
|
|
|
279
278
|
Remember: Your role is to be the "gatekeeper" ensuring requirements are fully and correctly implemented before proceeding.
|
|
280
|
-
|
|
281
|
-
## Capture Learnings
|
|
282
|
-
|
|
283
|
-
Before completing your validation task:
|
|
284
|
-
|
|
285
|
-
1. **Reflect on insights gained** during validation:
|
|
286
|
-
- Requirement validation patterns and insights
|
|
287
|
-
- Acceptance criteria patterns observed
|
|
288
|
-
- Ambiguity resolutions and scope clarifications
|
|
289
|
-
- Common gaps between requirements and implementation
|
|
290
|
-
|
|
291
|
-
2. **Store important learnings** using `ff-learning-store` MCP tool:
|
|
292
|
-
- Use category `pattern` for requirement patterns and validation techniques
|
|
293
|
-
- Use category `decision` for significant scope clarifications and findings
|
|
294
|
-
- Tag with requirement types, categories, and validation insights
|
|
295
|
-
|
|
296
|
-
3. **Example MCP tool call:**
|
|
297
|
-
```
|
|
298
|
-
ff-learning-store(
|
|
299
|
-
title: "Validation Pattern: [Pattern Name]",
|
|
300
|
-
description: "Common pattern of [issue] in [type] requirements",
|
|
301
|
-
category: "pattern",
|
|
302
|
-
tags: ["validation", "requirements", "pattern", "{category}"],
|
|
303
|
-
importance: 0.7
|
|
304
|
-
)
|
|
305
|
-
```
|
package/agents/ff-research.md
CHANGED
|
@@ -55,7 +55,6 @@ At the start of EVERY research task:
|
|
|
55
55
|
5. **Load the ff-research-methods skill** for research methodology
|
|
56
56
|
6. **Load the ff-mini-plan skill** and create a research plan
|
|
57
57
|
7. **Load the ff-todo-management skill** and create a todo list
|
|
58
|
-
8. **Load the ff-learning skill** to capture research findings and knowledge
|
|
59
58
|
9. **Load the ff-report-templates skill** for output formatting
|
|
60
59
|
10. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/ff-research-{UUID}.md`
|
|
61
60
|
|
|
@@ -422,30 +421,3 @@ Structure research findings using ff-report-templates:
|
|
|
422
421
|
- **Stay current** - Technology changes rapidly, verify dates
|
|
423
422
|
|
|
424
423
|
Remember: Your research enables other agents to make informed implementation decisions. Be thorough, current, and precise.
|
|
425
|
-
|
|
426
|
-
## Capture Learnings
|
|
427
|
-
|
|
428
|
-
Before completing your research task:
|
|
429
|
-
|
|
430
|
-
1. **Reflect on insights gained** during research:
|
|
431
|
-
- Key findings and conclusions
|
|
432
|
-
- Technology comparisons and evaluations
|
|
433
|
-
- Best practices discovered
|
|
434
|
-
- Source quality assessments
|
|
435
|
-
|
|
436
|
-
2. **Store important learnings** using `ff-learning-store` MCP tool:
|
|
437
|
-
- Use category `pattern` for key findings and reusable knowledge
|
|
438
|
-
- Use category `context` for significant research discoveries and context
|
|
439
|
-
- Tag with research topics, technologies, and categories
|
|
440
|
-
- Set high importance (0.8-1.0) for critical findings
|
|
441
|
-
|
|
442
|
-
3. **Example MCP tool call:**
|
|
443
|
-
```
|
|
444
|
-
ff-learning-store(
|
|
445
|
-
title: "Research Finding: [Topic]",
|
|
446
|
-
description: "Key finding about [topic] from [source]",
|
|
447
|
-
category: "pattern",
|
|
448
|
-
tags: ["research", "{topic}", "{technology}", "best-practices"],
|
|
449
|
-
importance: 0.9
|
|
450
|
-
)
|
|
451
|
-
```
|
package/agents/ff-review.md
CHANGED
|
@@ -53,7 +53,6 @@ At the start of EVERY review task:
|
|
|
53
53
|
3. **Read relevant contexts** - Use `ff-agents-show()` to read contexts from @building, @planning, etc.
|
|
54
54
|
4. **Load the ff-mini-plan skill** and create a quick 2-5 step plan for your review approach
|
|
55
55
|
5. **Load the ff-todo-management skill** and create a todo list from your plan
|
|
56
|
-
6. **Load the ff-learning skill** to capture code quality insights and patterns
|
|
57
56
|
7. **Load the ff-severity-classification skill** to ensure consistent issue classification
|
|
58
57
|
8. **Load the ff-report-templates skill** for standardized output formatting
|
|
59
58
|
9. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/ff-review-{UUID}.md`
|
|
@@ -280,29 +279,3 @@ Use ff-severity-classification skill standards:
|
|
|
280
279
|
10. **CRITICAL: Clean up** - `ff-agents-clear()` to remove your context file
|
|
281
280
|
11. Mark all todos complete before finishing
|
|
282
281
|
12. Recommend delegating to other agents if specialized issues found
|
|
283
|
-
|
|
284
|
-
## Capture Learnings
|
|
285
|
-
|
|
286
|
-
Before completing your code review:
|
|
287
|
-
|
|
288
|
-
1. **Reflect on insights gained** during the review:
|
|
289
|
-
- Code quality patterns observed
|
|
290
|
-
- Common issues and their solutions
|
|
291
|
-
- Best practices identified
|
|
292
|
-
- Review technique improvements
|
|
293
|
-
|
|
294
|
-
2. **Store important learnings** using `ff-learning-store` MCP tool:
|
|
295
|
-
- Use category `pattern` for code patterns and anti-patterns
|
|
296
|
-
- Use category `decision` for significant review findings and trade-offs
|
|
297
|
-
- Tag with code quality categories, technologies, and patterns
|
|
298
|
-
|
|
299
|
-
3. **Example MCP tool call:**
|
|
300
|
-
```
|
|
301
|
-
ff-learning-store(
|
|
302
|
-
title: "Code Pattern: [Pattern Name]",
|
|
303
|
-
description: "Effective pattern for [scenario] in [technology]",
|
|
304
|
-
category: "pattern",
|
|
305
|
-
tags: ["code-quality", "pattern", "{technology}", "{category}"],
|
|
306
|
-
importance: 0.7
|
|
307
|
-
)
|
|
308
|
-
```
|
package/agents/ff-security.md
CHANGED
|
@@ -53,7 +53,6 @@ At the start of EVERY security audit:
|
|
|
53
53
|
3. **Read relevant contexts** - Use `ff-agents-show()` to read contexts from @building, @planning, etc.
|
|
54
54
|
4. **Load the ff-mini-plan skill** and create a quick 2-5 step plan for your audit approach
|
|
55
55
|
5. **Load the ff-todo-management skill** and create a todo list from your plan
|
|
56
|
-
6. **Load the ff-learning skill** to capture security insights and vulnerability patterns
|
|
57
56
|
7. **Load the ff-severity-classification skill** to ensure consistent vulnerability classification
|
|
58
57
|
8. **Load the ff-report-templates skill** for standardized output formatting
|
|
59
58
|
9. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/ff-security-{UUID}.md`
|
|
@@ -314,29 +313,3 @@ Use ff-severity-classification skill standards with security-specific definition
|
|
|
314
313
|
10. **CRITICAL: Clean up** - `ff-agents-clear()` to remove your context file
|
|
315
314
|
11. Mark all todos complete before finishing
|
|
316
315
|
12. Recommend delegating to other agents if additional issues found
|
|
317
|
-
|
|
318
|
-
## Capture Learnings
|
|
319
|
-
|
|
320
|
-
Before completing your security audit:
|
|
321
|
-
|
|
322
|
-
1. **Reflect on insights gained** during the audit:
|
|
323
|
-
- Vulnerability patterns discovered
|
|
324
|
-
- Security best practices identified
|
|
325
|
-
- Threat model insights
|
|
326
|
-
- Common security mistakes observed
|
|
327
|
-
|
|
328
|
-
2. **Store important learnings** using `ff-learning-store` MCP tool:
|
|
329
|
-
- Use category `pattern` for vulnerability patterns and fixes
|
|
330
|
-
- Use category `debugging` for significant security findings and investigations
|
|
331
|
-
- Tag with security categories, vulnerability types, and technologies
|
|
332
|
-
|
|
333
|
-
3. **Example MCP tool call:**
|
|
334
|
-
```
|
|
335
|
-
ff-learning-store(
|
|
336
|
-
title: "Security Pattern: [Vulnerability Type]",
|
|
337
|
-
description: "Common [vulnerability] pattern in [context] and how to fix it",
|
|
338
|
-
category: "pattern",
|
|
339
|
-
tags: ["security", "vulnerability", "{type}", "{technology}"],
|
|
340
|
-
importance: 0.9
|
|
341
|
-
)
|
|
342
|
-
```
|
package/agents/ff-validate.md
CHANGED
|
@@ -53,7 +53,6 @@ At the start of EVERY validation orchestration:
|
|
|
53
53
|
3. **Read relevant contexts** - Use `ff-agents-show()` to read contexts from @building, @planning, etc.
|
|
54
54
|
4. **Load the ff-mini-plan skill** and create a quick plan for your orchestration approach
|
|
55
55
|
5. **Load the ff-todo-management skill** and create a todo list for tracking
|
|
56
|
-
6. **Load the ff-learning skill** to capture validation insights and patterns
|
|
57
56
|
7. **Load the ff-severity-classification skill** for consistent issue classification
|
|
58
57
|
8. **Load the ff-report-templates skill** for standardized output formatting
|
|
59
58
|
9. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/ff-validate-{UUID}.md`
|
|
@@ -308,29 +307,3 @@ When multiple agents report findings:
|
|
|
308
307
|
- **Provide actionable feedback** - Every issue should have a clear fix
|
|
309
308
|
- **Include metrics** - Quantify the validation results where possible
|
|
310
309
|
- **Consider context** - Weight findings based on the scope of changes
|
|
311
|
-
|
|
312
|
-
## Capture Learnings
|
|
313
|
-
|
|
314
|
-
Before completing your validation:
|
|
315
|
-
|
|
316
|
-
1. **Reflect on insights gained** during validation:
|
|
317
|
-
- Validation patterns and effective techniques
|
|
318
|
-
- Common issues found across different dimensions
|
|
319
|
-
- Validation efficiency improvements
|
|
320
|
-
- Cross-dimensional finding patterns
|
|
321
|
-
|
|
322
|
-
2. **Store important learnings** using `ff-learning-store` MCP tool:
|
|
323
|
-
- Use category `pattern` for validation patterns and effective techniques
|
|
324
|
-
- Use category `decision` for significant validation findings
|
|
325
|
-
- Tag with validation types and categories
|
|
326
|
-
|
|
327
|
-
3. **Example MCP tool call:**
|
|
328
|
-
```
|
|
329
|
-
ff-learning-store(
|
|
330
|
-
title: "Validation Pattern: [Pattern Name]",
|
|
331
|
-
description: "Common pattern of [findings] when validating [type] changes",
|
|
332
|
-
category: "pattern",
|
|
333
|
-
tags: ["validation", "pattern", "{category}"],
|
|
334
|
-
importance: 0.7
|
|
335
|
-
)
|
|
336
|
-
```
|
|
@@ -53,7 +53,6 @@ At the start of EVERY architecture review:
|
|
|
53
53
|
3. **Read relevant contexts** - Use `ff-agents-show()` to read contexts from @building, @planning, etc.
|
|
54
54
|
4. **Load the ff-mini-plan skill** and create a quick 2-5 step plan for your review approach
|
|
55
55
|
5. **Load the ff-todo-management skill** and create a todo list from your plan
|
|
56
|
-
6. **Load the ff-learning skill** to capture architectural insights and patterns
|
|
57
56
|
7. **Load the ff-severity-classification skill** to ensure consistent issue classification
|
|
58
57
|
8. **Load the ff-report-templates skill** for standardized output formatting
|
|
59
58
|
9. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/ff-well-architected-{UUID}.md`
|
|
@@ -276,29 +275,3 @@ Use ff-severity-classification skill standards:
|
|
|
276
275
|
12. Invoke other agents if specialized issues found
|
|
277
276
|
|
|
278
277
|
Focus on providing actionable, specific recommendations that improve the overall architecture quality across all six pillars.
|
|
279
|
-
|
|
280
|
-
## Capture Learnings
|
|
281
|
-
|
|
282
|
-
Before completing your architecture review:
|
|
283
|
-
|
|
284
|
-
1. **Reflect on insights gained** during the review:
|
|
285
|
-
- Architectural patterns and anti-patterns observed
|
|
286
|
-
- Pillar-specific insights (Operational Excellence, Security, Reliability, etc.)
|
|
287
|
-
- Scalability and efficiency considerations
|
|
288
|
-
- Cross-pillar interactions and trade-offs
|
|
289
|
-
|
|
290
|
-
2. **Store important learnings** using `ff-learning-store` MCP tool:
|
|
291
|
-
- Use category `pattern` for architectural patterns and best practices
|
|
292
|
-
- Use category `decision` for significant architectural trade-offs
|
|
293
|
-
- Tag with pillar names, architecture categories, and patterns
|
|
294
|
-
|
|
295
|
-
3. **Example MCP tool call:**
|
|
296
|
-
```
|
|
297
|
-
ff-learning-store(
|
|
298
|
-
title: "Architecture Pattern: [Pattern Name]",
|
|
299
|
-
description: "Pattern for achieving [pillar] excellence in [context]",
|
|
300
|
-
category: "pattern",
|
|
301
|
-
tags: ["architecture", "{pillar}", "pattern", "{category}"],
|
|
302
|
-
importance: 0.8
|
|
303
|
-
)
|
|
304
|
-
```
|
package/agents/planning.md
CHANGED
|
@@ -73,7 +73,6 @@ At the start of EVERY planning task:
|
|
|
73
73
|
5. **Load the ff-delegation skill** and assess parallelization opportunities
|
|
74
74
|
6. **Load the ff-mini-plan skill** and assess task complexity
|
|
75
75
|
7. **Load the ff-todo-management skill** and create a todo list for the planning process
|
|
76
|
-
8. **Load the ff-learning skill** to capture planning insights and patterns
|
|
77
76
|
9. **Load the ff-report-templates skill** for standardized output formatting
|
|
78
77
|
10. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/planning-{UUID}.md`
|
|
79
78
|
|
|
@@ -357,31 +356,3 @@ Recommend escalation to full architectural planning when:
|
|
|
357
356
|
- **Consider edge cases** - Plan for error scenarios
|
|
358
357
|
- **Include validation** - Specify how to verify the implementation
|
|
359
358
|
- **Escalate appropriately** - Don't try to fit complex work into simple plans
|
|
360
|
-
|
|
361
|
-
## Capture Learnings
|
|
362
|
-
|
|
363
|
-
Before completing your planning task:
|
|
364
|
-
|
|
365
|
-
1. **Reflect on insights gained** during planning:
|
|
366
|
-
- Architecture decisions made and their rationale
|
|
367
|
-
- Risk factors identified and mitigation strategies
|
|
368
|
-
- Pattern discoveries from codebase exploration
|
|
369
|
-
- Estimation accuracy and lessons learned
|
|
370
|
-
|
|
371
|
-
2. **Store important learnings** using the `ff-learning-store` MCP tool:
|
|
372
|
-
- Use category `pattern` for architectural patterns discovered
|
|
373
|
-
- Use category `decision` for significant planning decisions
|
|
374
|
-
- Tag with relevant keywords (architecture, patterns, risks, decisions)
|
|
375
|
-
|
|
376
|
-
3. **Example learning capture:**
|
|
377
|
-
|
|
378
|
-
```
|
|
379
|
-
ff-learning-store(
|
|
380
|
-
title: "Architecture Decision: [Decision Name]",
|
|
381
|
-
description: "Rationale for choosing [approach] over [alternatives]",
|
|
382
|
-
category: "decision",
|
|
383
|
-
tags: ["architecture", "decision", "{technology}"],
|
|
384
|
-
importance: 0.8,
|
|
385
|
-
content: "Detailed explanation of the decision..."
|
|
386
|
-
)
|
|
387
|
-
```
|
package/agents/reviewing.md
CHANGED
|
@@ -71,7 +71,6 @@ At the start of EVERY review task:
|
|
|
71
71
|
3. **Read relevant contexts** - Use `ff-agents-show()` to read contexts from @building, @ff-security, etc.
|
|
72
72
|
4. **Generate your UUID** - Create unique ID: `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`
|
|
73
73
|
5. **Load the ff-todo-management skill** and create a todo list for tracking review progress
|
|
74
|
-
6. **Load the ff-learning skill** to capture review patterns and insights
|
|
75
74
|
7. **Load the ff-report-templates skill** for standardized output formatting
|
|
76
75
|
8. **Load the ff-severity-classification skill** to classify findings consistently
|
|
77
76
|
9. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/reviewing-{UUID}.md`
|
|
@@ -481,31 +480,3 @@ Typical workflow:
|
|
|
481
480
|
8. Repeat until clean or only low-priority items remain
|
|
482
481
|
|
|
483
482
|
This creates a tight feedback loop for high-quality output.
|
|
484
|
-
|
|
485
|
-
## Capture Learnings
|
|
486
|
-
|
|
487
|
-
Before completing your review task:
|
|
488
|
-
|
|
489
|
-
1. **Reflect on insights gained** during validation:
|
|
490
|
-
- Common issues and patterns identified across reviews
|
|
491
|
-
- Quality patterns observed in good implementations
|
|
492
|
-
- Review effectiveness and process improvements
|
|
493
|
-
- Tool and technique discoveries
|
|
494
|
-
|
|
495
|
-
2. **Store important learnings** using the `ff-learning-store` MCP tool:
|
|
496
|
-
- Use category `pattern` for common issue patterns and solutions
|
|
497
|
-
- Use category `decision` for significant review findings
|
|
498
|
-
- Tag with review type, categories, and technologies reviewed
|
|
499
|
-
|
|
500
|
-
3. **Example learning capture:**
|
|
501
|
-
|
|
502
|
-
```
|
|
503
|
-
ff-learning-store(
|
|
504
|
-
title: "Review Pattern: [Common Issue Type]",
|
|
505
|
-
description: "Common pattern of [issue] found in [context]",
|
|
506
|
-
category: "pattern",
|
|
507
|
-
tags: ["review", "pattern", "{issue-type}", "{technology}"],
|
|
508
|
-
importance: 0.7,
|
|
509
|
-
content: "Detailed explanation of the pattern and solution..."
|
|
510
|
-
)
|
|
511
|
-
```
|
package/bin/ff-deploy.js
CHANGED
|
@@ -29,17 +29,6 @@ const isInteractive = process.stdin.isTTY && process.stdout.isTTY;
|
|
|
29
29
|
|
|
30
30
|
// Default MCP configuration
|
|
31
31
|
const DEFAULT_MCP_SERVERS = {
|
|
32
|
-
'ff-local-recall': {
|
|
33
|
-
type: 'local',
|
|
34
|
-
command: [
|
|
35
|
-
'npx',
|
|
36
|
-
'-y',
|
|
37
|
-
'--package=@syntesseraai/opencode-feature-factory@latest',
|
|
38
|
-
'--',
|
|
39
|
-
'ff-local-recall-mcp',
|
|
40
|
-
],
|
|
41
|
-
enabled: true,
|
|
42
|
-
},
|
|
43
32
|
'jina-ai': {
|
|
44
33
|
type: 'remote',
|
|
45
34
|
url: 'https://mcp.jina.ai/v1',
|
|
@@ -3,7 +3,7 @@ type BunShell = any;
|
|
|
3
3
|
/**
|
|
4
4
|
* Initialize the Feature Factory directory structure.
|
|
5
5
|
* Creates .feature-factory/ and .feature-factory/agents/ directories.
|
|
6
|
-
* Migrates legacy CI scripts (
|
|
6
|
+
* Migrates legacy CI scripts (ff-ci.sh and .feature-factory/ci.sh) to ff-ci.sh if they exist.
|
|
7
7
|
*/
|
|
8
8
|
export declare function initializeFeatureFactory(input: PluginInput, $: BunShell): Promise<void>;
|
|
9
9
|
export {};
|
|
@@ -50,7 +50,7 @@ function isValidDirectory(directory) {
|
|
|
50
50
|
/**
|
|
51
51
|
* Initialize the Feature Factory directory structure.
|
|
52
52
|
* Creates .feature-factory/ and .feature-factory/agents/ directories.
|
|
53
|
-
* Migrates legacy CI scripts (
|
|
53
|
+
* Migrates legacy CI scripts (ff-ci.sh and .feature-factory/ci.sh) to ff-ci.sh if they exist.
|
|
54
54
|
*/
|
|
55
55
|
export async function initializeFeatureFactory(input, $) {
|
|
56
56
|
const { directory, client } = input;
|
|
@@ -84,8 +84,8 @@ export async function initializeFeatureFactory(input, $) {
|
|
|
84
84
|
// Continue even if directory creation fails - it might already exist
|
|
85
85
|
}
|
|
86
86
|
// Check for CI script migration (with timeout protection)
|
|
87
|
-
// Check both legacy locations:
|
|
88
|
-
const legacyCiPaths = [`${directory}/
|
|
87
|
+
// Check both legacy locations: ff-ci.sh and .feature-factory/ci.sh
|
|
88
|
+
const legacyCiPaths = [`${directory}/ff-ci.sh`, `${featureFactoryDir}/ci.sh`];
|
|
89
89
|
const newCiPath = `${directory}/ff-ci.sh`;
|
|
90
90
|
try {
|
|
91
91
|
// Check if new location already exists (with timeout)
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import { $ } from 'bun';
|
|
|
5
5
|
import { createFFAgentsCurrentTool } from './plugins/ff-agents-current-plugin.js';
|
|
6
6
|
import { createFFAgentsShowTool } from './plugins/ff-agents-show-plugin.js';
|
|
7
7
|
import { createFFAgentsClearTool } from './plugins/ff-agents-clear-plugin.js';
|
|
8
|
-
import { createLearningStoreTool, createLearningSearchTool, createLearningGetTool, createLearningIndexStartTool, createLearningIndexStatusTool, createLearningIndexStopTool, createLearningIndexRebuildTool, initLocalRecall, } from './local-recall/index.js';
|
|
9
8
|
import { createFFPlanCreateTool } from './plugins/ff-plan-create-plugin.js';
|
|
10
9
|
import { createFFPlanUpdateTool } from './plugins/ff-plan-update-plugin.js';
|
|
11
10
|
import { createFFAgentContextCreateTool } from './plugins/ff-agent-context-create-plugin.js';
|
|
@@ -36,16 +35,14 @@ export const FeatureFactoryPlugin = async (input) => {
|
|
|
36
35
|
if (!directory || directory === '' || directory === '/') {
|
|
37
36
|
return {};
|
|
38
37
|
}
|
|
39
|
-
// Initialize local-recall memory system
|
|
40
|
-
initLocalRecall(directory);
|
|
41
38
|
// Update MCP server configuration in global OpenCode config
|
|
42
39
|
// This ensures Feature Factory MCP servers are available across projects
|
|
43
40
|
try {
|
|
44
41
|
await updateMCPConfig($);
|
|
45
42
|
}
|
|
46
|
-
catch
|
|
47
|
-
//
|
|
48
|
-
|
|
43
|
+
catch {
|
|
44
|
+
// Just log or ignore errors during config update to not break plugin load
|
|
45
|
+
console.error('Failed to update MCP config in OpenCode plugin');
|
|
49
46
|
}
|
|
50
47
|
// Load hooks from the quality gate plugin
|
|
51
48
|
const qualityGateHooks = await StopQualityGateHooksPlugin(input).catch(() => ({}));
|
|
@@ -55,14 +52,6 @@ export const FeatureFactoryPlugin = async (input) => {
|
|
|
55
52
|
'ff-agents-current': createFFAgentsCurrentTool(),
|
|
56
53
|
'ff-agents-show': createFFAgentsShowTool(),
|
|
57
54
|
'ff-agents-clear': createFFAgentsClearTool(),
|
|
58
|
-
// Learning/memory tools (local-recall)
|
|
59
|
-
'ff-learning-store': createLearningStoreTool(),
|
|
60
|
-
'ff-learning-search': createLearningSearchTool(),
|
|
61
|
-
'ff-learning-get': createLearningGetTool(),
|
|
62
|
-
'ff-learning-index-start': createLearningIndexStartTool(),
|
|
63
|
-
'ff-learning-index-status': createLearningIndexStatusTool(),
|
|
64
|
-
'ff-learning-index-stop': createLearningIndexStopTool(),
|
|
65
|
-
'ff-learning-index-rebuild': createLearningIndexRebuildTool(),
|
|
66
55
|
// Plan tools
|
|
67
56
|
'ff-plan-create': createFFPlanCreateTool(),
|
|
68
57
|
'ff-plan-update': createFFPlanUpdateTool(),
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { searchLearningMemories } from './mcp-server.js';
|
|
2
|
+
const MEMORY_CONTEXT_HEADER = '## Local Recall: Relevant Memories';
|
|
3
|
+
const MEMORY_CONTEXT_GUIDANCE = 'Use these prior project learnings only when they directly improve the current response.';
|
|
4
|
+
const DEFAULT_INTERNAL_MARKERS = ['[LOCAL_RECALL_INTERNAL]'];
|
|
5
|
+
const APPROX_CHARS_PER_TOKEN = 4;
|
|
6
|
+
const pendingContextBySession = new Map();
|
|
7
|
+
function parseBooleanEnv(name, fallback) {
|
|
8
|
+
const value = process.env[name];
|
|
9
|
+
if (!value) {
|
|
10
|
+
return fallback;
|
|
11
|
+
}
|
|
12
|
+
const normalized = value.trim().toLowerCase();
|
|
13
|
+
if (['1', 'true', 'yes', 'on'].includes(normalized)) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
if (['0', 'false', 'no', 'off'].includes(normalized)) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return fallback;
|
|
20
|
+
}
|
|
21
|
+
function parseNumberEnv(name, fallback, options) {
|
|
22
|
+
const value = process.env[name];
|
|
23
|
+
if (!value) {
|
|
24
|
+
return fallback;
|
|
25
|
+
}
|
|
26
|
+
const parsed = Number(value);
|
|
27
|
+
if (!Number.isFinite(parsed)) {
|
|
28
|
+
return fallback;
|
|
29
|
+
}
|
|
30
|
+
const withInteger = options?.integer ? Math.trunc(parsed) : parsed;
|
|
31
|
+
const min = options?.min ?? Number.NEGATIVE_INFINITY;
|
|
32
|
+
const max = options?.max ?? Number.POSITIVE_INFINITY;
|
|
33
|
+
return Math.min(max, Math.max(min, withInteger));
|
|
34
|
+
}
|
|
35
|
+
function parseInternalMarkers() {
|
|
36
|
+
const configured = process.env.FF_LOCAL_RECALL_PROMPT_INTERNAL_MARKERS;
|
|
37
|
+
if (!configured) {
|
|
38
|
+
return DEFAULT_INTERNAL_MARKERS;
|
|
39
|
+
}
|
|
40
|
+
const markers = configured
|
|
41
|
+
.split(',')
|
|
42
|
+
.map((entry) => entry.trim())
|
|
43
|
+
.filter((entry) => entry.length > 0);
|
|
44
|
+
return markers.length > 0 ? markers : DEFAULT_INTERNAL_MARKERS;
|
|
45
|
+
}
|
|
46
|
+
function getPromptInjectionConfig() {
|
|
47
|
+
return {
|
|
48
|
+
enabled: parseBooleanEnv('FF_LOCAL_RECALL_PROMPT_INJECTION_ENABLED', true),
|
|
49
|
+
minPromptChars: parseNumberEnv('FF_LOCAL_RECALL_PROMPT_INJECTION_MIN_PROMPT_CHARS', 20, {
|
|
50
|
+
min: 1,
|
|
51
|
+
max: 2000,
|
|
52
|
+
integer: true,
|
|
53
|
+
}),
|
|
54
|
+
maxQueryChars: parseNumberEnv('FF_LOCAL_RECALL_PROMPT_INJECTION_MAX_QUERY_CHARS', 2000, {
|
|
55
|
+
min: 64,
|
|
56
|
+
max: 20000,
|
|
57
|
+
integer: true,
|
|
58
|
+
}),
|
|
59
|
+
searchLimit: parseNumberEnv('FF_LOCAL_RECALL_PROMPT_INJECTION_SEARCH_LIMIT', 8, {
|
|
60
|
+
min: 1,
|
|
61
|
+
max: 50,
|
|
62
|
+
integer: true,
|
|
63
|
+
}),
|
|
64
|
+
maxResults: parseNumberEnv('FF_LOCAL_RECALL_PROMPT_INJECTION_MAX_RESULTS', 5, {
|
|
65
|
+
min: 1,
|
|
66
|
+
max: 20,
|
|
67
|
+
integer: true,
|
|
68
|
+
}),
|
|
69
|
+
minRelevance: parseNumberEnv('FF_LOCAL_RECALL_PROMPT_INJECTION_MIN_RELEVANCE', 0.2, {
|
|
70
|
+
min: 0,
|
|
71
|
+
max: 1,
|
|
72
|
+
}),
|
|
73
|
+
minImportance: parseNumberEnv('FF_LOCAL_RECALL_PROMPT_INJECTION_MIN_IMPORTANCE', 0.2, {
|
|
74
|
+
min: 0,
|
|
75
|
+
max: 1,
|
|
76
|
+
}),
|
|
77
|
+
maxTokens: parseNumberEnv('FF_LOCAL_RECALL_PROMPT_INJECTION_MAX_TOKENS', 400, {
|
|
78
|
+
min: 50,
|
|
79
|
+
max: 4000,
|
|
80
|
+
integer: true,
|
|
81
|
+
}),
|
|
82
|
+
sessionOnly: parseBooleanEnv('FF_LOCAL_RECALL_PROMPT_INJECTION_SESSION_ONLY', false),
|
|
83
|
+
internalMarkers: parseInternalMarkers(),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function estimateTokens(text) {
|
|
87
|
+
return Math.ceil(text.length / APPROX_CHARS_PER_TOKEN);
|
|
88
|
+
}
|
|
89
|
+
function normalizeInlineText(value) {
|
|
90
|
+
return value.replace(/\s+/g, ' ').trim();
|
|
91
|
+
}
|
|
92
|
+
function extractUserPromptText(parts) {
|
|
93
|
+
const text = parts
|
|
94
|
+
.filter((part) => part.type === 'text')
|
|
95
|
+
.filter((part) => !part.synthetic)
|
|
96
|
+
.map((part) => part.text)
|
|
97
|
+
.join('\n')
|
|
98
|
+
.trim();
|
|
99
|
+
return text;
|
|
100
|
+
}
|
|
101
|
+
function isInternalPrompt(prompt, markers) {
|
|
102
|
+
return markers.some((marker) => marker.length > 0 && prompt.includes(marker));
|
|
103
|
+
}
|
|
104
|
+
function scoreMemory(memory) {
|
|
105
|
+
return memory.relevance * 0.75 + memory.importance * 0.25;
|
|
106
|
+
}
|
|
107
|
+
function rankMemories(memories, config) {
|
|
108
|
+
return memories
|
|
109
|
+
.filter((memory) => memory.relevance >= config.minRelevance)
|
|
110
|
+
.sort((a, b) => {
|
|
111
|
+
const scoreDifference = scoreMemory(b) - scoreMemory(a);
|
|
112
|
+
if (scoreDifference !== 0) {
|
|
113
|
+
return scoreDifference;
|
|
114
|
+
}
|
|
115
|
+
return b.createdAt - a.createdAt;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function formatMemoryLine(index, memory) {
|
|
119
|
+
const title = normalizeInlineText(memory.title);
|
|
120
|
+
const tags = memory.tags.length > 0 ? ` | tags: ${memory.tags.slice(0, 5).join(', ')}` : '';
|
|
121
|
+
return `${index}. ${title} (category: ${memory.category}, relevance: ${memory.relevance.toFixed(2)}, importance: ${memory.importance.toFixed(2)}${tags})`;
|
|
122
|
+
}
|
|
123
|
+
function buildMemoryContext(memories, config) {
|
|
124
|
+
const lines = [];
|
|
125
|
+
let usedTokens = estimateTokens(MEMORY_CONTEXT_HEADER) + estimateTokens(MEMORY_CONTEXT_GUIDANCE);
|
|
126
|
+
for (const memory of memories) {
|
|
127
|
+
if (lines.length >= config.maxResults) {
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
const line = formatMemoryLine(lines.length + 1, memory);
|
|
131
|
+
const lineTokens = estimateTokens(line);
|
|
132
|
+
if (lines.length > 0 && usedTokens + lineTokens > config.maxTokens) {
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
lines.push(line);
|
|
136
|
+
usedTokens += lineTokens;
|
|
137
|
+
}
|
|
138
|
+
if (lines.length === 0) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
return [MEMORY_CONTEXT_HEADER, MEMORY_CONTEXT_GUIDANCE, ...lines.map((line) => `- ${line}`)].join('\n');
|
|
142
|
+
}
|
|
143
|
+
export function createLocalRecallPromptHooks(directory) {
|
|
144
|
+
const config = getPromptInjectionConfig();
|
|
145
|
+
if (!config.enabled) {
|
|
146
|
+
return {};
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
'chat.message': async (input, output) => {
|
|
150
|
+
const promptText = extractUserPromptText(output.parts);
|
|
151
|
+
if (promptText.length < config.minPromptChars) {
|
|
152
|
+
pendingContextBySession.delete(input.sessionID);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (isInternalPrompt(promptText, config.internalMarkers)) {
|
|
156
|
+
pendingContextBySession.delete(input.sessionID);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const criteria = {
|
|
160
|
+
query: promptText.slice(0, config.maxQueryChars),
|
|
161
|
+
limit: config.searchLimit,
|
|
162
|
+
minImportance: config.minImportance,
|
|
163
|
+
};
|
|
164
|
+
if (config.sessionOnly) {
|
|
165
|
+
criteria.sessionID = input.sessionID;
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
const searchOutput = await searchLearningMemories(directory, criteria);
|
|
169
|
+
const ranked = rankMemories(searchOutput.results, config);
|
|
170
|
+
const context = buildMemoryContext(ranked, config);
|
|
171
|
+
if (!context) {
|
|
172
|
+
pendingContextBySession.delete(input.sessionID);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
pendingContextBySession.set(input.sessionID, context);
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
pendingContextBySession.delete(input.sessionID);
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
'experimental.chat.system.transform': async (input, output) => {
|
|
182
|
+
const sessionID = input.sessionID;
|
|
183
|
+
if (!sessionID) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const pendingContext = pendingContextBySession.get(sessionID);
|
|
187
|
+
if (!pendingContext) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
output.system.push(pendingContext);
|
|
191
|
+
pendingContextBySession.delete(sessionID);
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
}
|
package/dist/mcp-config.d.ts
CHANGED
|
@@ -4,11 +4,6 @@ type BunShell = any;
|
|
|
4
4
|
* These servers will be merged into the global OpenCode config.
|
|
5
5
|
*/
|
|
6
6
|
export declare const DEFAULT_MCP_SERVERS: {
|
|
7
|
-
readonly 'ff-local-recall': {
|
|
8
|
-
readonly type: "local";
|
|
9
|
-
readonly command: "ff-local-recall-mcp";
|
|
10
|
-
readonly enabled: true;
|
|
11
|
-
};
|
|
12
7
|
readonly 'jina-ai': {
|
|
13
8
|
readonly type: "remote";
|
|
14
9
|
readonly url: "https://mcp.jina.ai/v1";
|
package/dist/mcp-config.js
CHANGED
|
@@ -8,11 +8,6 @@ const GLOBAL_OPENCODE_CONFIG_PATH = join(GLOBAL_OPENCODE_DIR, 'opencode.json');
|
|
|
8
8
|
* These servers will be merged into the global OpenCode config.
|
|
9
9
|
*/
|
|
10
10
|
export const DEFAULT_MCP_SERVERS = {
|
|
11
|
-
'ff-local-recall': {
|
|
12
|
-
type: 'local',
|
|
13
|
-
command: 'ff-local-recall-mcp',
|
|
14
|
-
enabled: true,
|
|
15
|
-
},
|
|
16
11
|
'jina-ai': {
|
|
17
12
|
type: 'remote',
|
|
18
13
|
url: 'https://mcp.jina.ai/v1',
|
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@syntesseraai/opencode-feature-factory",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "OpenCode plugin for Feature Factory agents - provides sub-agents and skills for validation, review, security, and architecture assessment",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"bin": {
|
|
11
|
-
"ff-deploy": "./bin/ff-deploy.js"
|
|
12
|
-
"ff-local-recall-mcp": "./bin/ff-local-recall-mcp.js"
|
|
11
|
+
"ff-deploy": "./bin/ff-deploy.js"
|
|
13
12
|
},
|
|
14
13
|
"files": [
|
|
15
14
|
"dist",
|
|
@@ -35,9 +34,7 @@
|
|
|
35
34
|
"dependencies": {
|
|
36
35
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
37
36
|
"@opencode-ai/plugin": "^1.1.48",
|
|
38
|
-
"
|
|
39
|
-
"glob": "^10.0.0",
|
|
40
|
-
"uuid": "^9.0.0"
|
|
37
|
+
"glob": "^10.0.0"
|
|
41
38
|
},
|
|
42
39
|
"devDependencies": {
|
|
43
40
|
"@types/bun": "^1.2.6",
|
|
@@ -465,12 +465,6 @@ Clean up agent context files.
|
|
|
465
465
|
- Add "Clean up context" as final todo item
|
|
466
466
|
- Track progress in both todo list AND context file
|
|
467
467
|
|
|
468
|
-
### With ff-learning
|
|
469
|
-
|
|
470
|
-
- Store important findings from other agents' contexts
|
|
471
|
-
- Create memories about coordination patterns
|
|
472
|
-
- Learn from how other agents approached similar tasks
|
|
473
|
-
|
|
474
468
|
## Best Practices Summary
|
|
475
469
|
|
|
476
470
|
### DO:
|
|
@@ -513,7 +507,9 @@ ff-agents-show(id: "planning-uuid") → Read implementation plan
|
|
|
513
507
|
ff-agents-update:
|
|
514
508
|
fileName: "building-{my-uuid}.md"
|
|
515
509
|
content: |
|
|
510
|
+
|
|
516
511
|
---
|
|
512
|
+
|
|
517
513
|
id: "{my-uuid}"
|
|
518
514
|
agent: "building"
|
|
519
515
|
title: "Implement OAuth"
|
|
@@ -522,6 +518,7 @@ status: "in-progress"
|
|
|
522
518
|
started: "2026-02-02T14:30:00Z"
|
|
523
519
|
parent: null
|
|
524
520
|
delegated_to: []
|
|
521
|
+
|
|
525
522
|
---
|
|
526
523
|
|
|
527
524
|
## Context
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { runLocalRecallMCPServer } from '../dist/local-recall/mcp-stdio-server.js';
|
|
4
|
-
|
|
5
|
-
runLocalRecallMCPServer().catch((error) => {
|
|
6
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
7
|
-
console.error(`Failed to start ff-local-recall MCP server: ${message}`);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
});
|
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ff-learning
|
|
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
|
-
license: MIT
|
|
5
|
-
compatibility: opencode
|
|
6
|
-
metadata:
|
|
7
|
-
audience: agents
|
|
8
|
-
category: knowledge-management
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Learning Skill (Local-Recall)
|
|
12
|
-
|
|
13
|
-
Use this skill to capture insights, store knowledge, and retrieve past learnings to improve future work. Memories are stored as JSON in `ff-memories/memories/` and automatically extracted from OpenCode session history.
|
|
14
|
-
|
|
15
|
-
## How It Works
|
|
16
|
-
|
|
17
|
-
The Local-Recall memory system has two paths for creating memories:
|
|
18
|
-
|
|
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.
|
|
21
|
-
|
|
22
|
-
Both paths write to the same JSON-based memory store, ensuring a unified search experience.
|
|
23
|
-
|
|
24
|
-
## When to Use
|
|
25
|
-
|
|
26
|
-
### Required (ALWAYS use when):
|
|
27
|
-
|
|
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
|
|
33
|
-
|
|
34
|
-
### Optional (use when helpful):
|
|
35
|
-
|
|
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
|
|
39
|
-
|
|
40
|
-
## Memory Categories
|
|
41
|
-
|
|
42
|
-
Memories are organized by category:
|
|
43
|
-
|
|
44
|
-
### 1. Pattern
|
|
45
|
-
|
|
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"
|
|
49
|
-
|
|
50
|
-
### 2. Decision
|
|
51
|
-
|
|
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"
|
|
55
|
-
|
|
56
|
-
### 3. Debugging
|
|
57
|
-
|
|
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"
|
|
61
|
-
|
|
62
|
-
### 4. Preference
|
|
63
|
-
|
|
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"
|
|
67
|
-
|
|
68
|
-
### 5. Context
|
|
69
|
-
|
|
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"
|
|
73
|
-
|
|
74
|
-
### 6. Procedure
|
|
75
|
-
|
|
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"
|
|
79
|
-
|
|
80
|
-
## Tools
|
|
81
|
-
|
|
82
|
-
The ff-learning skill provides three tools for interacting with the memory system.
|
|
83
|
-
|
|
84
|
-
### Tool 1: Store Learning (ff-learning-store)
|
|
85
|
-
|
|
86
|
-
**Purpose:** Create a new memory explicitly
|
|
87
|
-
|
|
88
|
-
**When to use:**
|
|
89
|
-
|
|
90
|
-
- At end of task completion
|
|
91
|
-
- When insight or pattern is discovered
|
|
92
|
-
- After error resolution
|
|
93
|
-
- When research findings are significant
|
|
94
|
-
|
|
95
|
-
**Input parameters:**
|
|
96
|
-
|
|
97
|
-
- `title` (string, required): Brief title for the learning
|
|
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
|
|
105
|
-
|
|
106
|
-
**Example:**
|
|
107
|
-
|
|
108
|
-
```markdown
|
|
109
|
-
Store a learning using ff-learning-store:
|
|
110
|
-
|
|
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."
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Tool 2: Search Learnings (ff-learning-search)
|
|
120
|
-
|
|
121
|
-
**Purpose:** Find relevant memories by keywords and filters
|
|
122
|
-
|
|
123
|
-
**When to use:**
|
|
124
|
-
|
|
125
|
-
- At start of new task (find related past work)
|
|
126
|
-
- When facing similar problem to previous one
|
|
127
|
-
- For context gathering before planning
|
|
128
|
-
- To avoid repeating mistakes
|
|
129
|
-
|
|
130
|
-
**Input parameters:**
|
|
131
|
-
|
|
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
|
|
137
|
-
|
|
138
|
-
**Example:**
|
|
139
|
-
|
|
140
|
-
```markdown
|
|
141
|
-
Search learnings:
|
|
142
|
-
|
|
143
|
-
- query: "OAuth authentication"
|
|
144
|
-
- tags: ["security"]
|
|
145
|
-
- limit: 5
|
|
146
|
-
```
|
|
147
|
-
|
|
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)
|
|
151
|
-
|
|
152
|
-
**Purpose:** Retrieve the full content of a specific memory
|
|
153
|
-
|
|
154
|
-
**When to use:**
|
|
155
|
-
|
|
156
|
-
- After search to read full details
|
|
157
|
-
- When referenced by ID in another memory
|
|
158
|
-
- For deep dive into specific learning
|
|
159
|
-
|
|
160
|
-
**Input parameters:**
|
|
161
|
-
|
|
162
|
-
- `memoryId` (string, required): UUID of the memory to retrieve
|
|
163
|
-
|
|
164
|
-
**Returns:** Complete memory object with all fields (id, sessionID, messageID, category, title, body, tags, importance, createdAt, extractedBy).
|
|
165
|
-
|
|
166
|
-
## File Organization
|
|
167
|
-
|
|
168
|
-
### Directory Structure
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
ff-memories/
|
|
172
|
-
├── memories/ # All memory JSON files
|
|
173
|
-
│ ├── {uuid}.json # Individual memory files
|
|
174
|
-
│ └── ...
|
|
175
|
-
└── processed.json # Tracks which messages have been processed
|
|
176
|
-
```
|
|
177
|
-
|
|
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
|
-
}
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
## Usage by Agent Type
|
|
198
|
-
|
|
199
|
-
### Planning Agent
|
|
200
|
-
|
|
201
|
-
**When to capture:** After planning sessions, architectural decisions, risk identification
|
|
202
|
-
**What to capture:** Architecture decisions (decision), risk factors (context), pattern discoveries (pattern)
|
|
203
|
-
|
|
204
|
-
### Building Agent
|
|
205
|
-
|
|
206
|
-
**When to capture:** After implementing features, overcoming challenges, resolving errors
|
|
207
|
-
**What to capture:** Code patterns (pattern), error resolutions (debugging), integration insights (context)
|
|
208
|
-
|
|
209
|
-
### Reviewing Agent
|
|
210
|
-
|
|
211
|
-
**When to capture:** After completing reviews, identifying common issues
|
|
212
|
-
**What to capture:** Common issue patterns (pattern), quality insights (context)
|
|
213
|
-
|
|
214
|
-
### Research Agent
|
|
215
|
-
|
|
216
|
-
**When to capture:** After research, significant findings, technology evaluations
|
|
217
|
-
**What to capture:** Key findings (pattern), technology comparisons (decision), best practices (procedure)
|
|
218
|
-
|
|
219
|
-
### Security Agent
|
|
220
|
-
|
|
221
|
-
**When to capture:** After audits, vulnerability findings
|
|
222
|
-
**What to capture:** Vulnerability patterns (debugging), security best practices (procedure)
|
|
223
|
-
|
|
224
|
-
## Integration with Other Skills
|
|
225
|
-
|
|
226
|
-
### With ff-delegation
|
|
227
|
-
|
|
228
|
-
- Store learnings from delegated agents
|
|
229
|
-
- Capture insights from parallel work
|
|
230
|
-
- Link related memories across agent boundaries
|
|
231
|
-
|
|
232
|
-
### With ff-todo-management
|
|
233
|
-
|
|
234
|
-
- Add "Capture learnings" as final todo item
|
|
235
|
-
- Track learning capture in todo list
|
|
236
|
-
|
|
237
|
-
### With ff-mini-plan
|
|
238
|
-
|
|
239
|
-
- Search past learnings during planning
|
|
240
|
-
- Use previous patterns to inform new plans
|
|
241
|
-
|
|
242
|
-
## Best Practices
|
|
243
|
-
|
|
244
|
-
### Do:
|
|
245
|
-
|
|
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
|
|
253
|
-
|
|
254
|
-
### Don't:
|
|
255
|
-
|
|
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
|
|
261
|
-
|
|
262
|
-
## Additional Tools for Read-Only Agents
|
|
263
|
-
|
|
264
|
-
Since @planning and @reviewing agents are read-only (cannot write/edit files), the following tools are provided for essential file operations:
|
|
265
|
-
|
|
266
|
-
### Tool 4: Create Plan (ff-plan-create)
|
|
267
|
-
|
|
268
|
-
**Purpose:** Create a new implementation plan file in `.feature-factory/plans/`
|
|
269
|
-
|
|
270
|
-
**Input parameters:**
|
|
271
|
-
|
|
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
|
|
278
|
-
|
|
279
|
-
### Tool 5: Create Agent Context (ff-agent-context-create)
|
|
280
|
-
|
|
281
|
-
**Purpose:** Create a new agent context file in `.feature-factory/agents/`
|
|
282
|
-
|
|
283
|
-
**Input parameters:**
|
|
284
|
-
|
|
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
|
|
293
|
-
|
|
294
|
-
### Tool 6: Update Agent Context (ff-agent-context-update)
|
|
295
|
-
|
|
296
|
-
**Purpose:** Update an existing agent context file
|
|
297
|
-
|
|
298
|
-
**Input parameters:**
|
|
299
|
-
|
|
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
|
|
306
|
-
|
|
307
|
-
## Quick Reference
|
|
308
|
-
|
|
309
|
-
### Creating a Memory
|
|
310
|
-
|
|
311
|
-
```markdown
|
|
312
|
-
Store a learning:
|
|
313
|
-
|
|
314
|
-
- title: "Descriptive searchable title"
|
|
315
|
-
- description: "Detailed explanation of what was learned"
|
|
316
|
-
- category: "pattern"
|
|
317
|
-
- tags: ["relevant", "keywords"]
|
|
318
|
-
- importance: 0.8
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
### Searching Memories
|
|
322
|
-
|
|
323
|
-
```markdown
|
|
324
|
-
Search learnings:
|
|
325
|
-
|
|
326
|
-
- query: "authentication"
|
|
327
|
-
- tags: ["oauth", "security"]
|
|
328
|
-
- limit: 5
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
### Memory Checklist
|
|
332
|
-
|
|
333
|
-
Before storing a memory, verify:
|
|
334
|
-
|
|
335
|
-
- [ ] Title is descriptive and searchable
|
|
336
|
-
- [ ] Description explains what was learned
|
|
337
|
-
- [ ] Tags are relevant and consistent
|
|
338
|
-
- [ ] Importance is appropriate (0.0-1.0)
|
|
339
|
-
- [ ] No sensitive data included
|