Skip to content

Commit c3eafda

Browse files
author
flowcore-platform
committed
fix(cursor): ✨ add memory mesh MCP integration rules
1 parent c90bace commit c3eafda

2 files changed

Lines changed: 172 additions & 7 deletions

File tree

.cursor/rules/memory-mesh.mdc

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
---
2+
description: >
3+
Memory Mesh MCP integration for data-pump.
4+
This rule provides workspace-specific instructions for Memory Mesh MCP integration.
5+
globs:
6+
- '**/*'
7+
alwaysApply: true
8+
---
9+
10+
# 🧠 Memory Mesh MCP - SYSTEM PROMPT (LONG-TERM MEMORY)
11+
12+
This file defines the agents' **permanent knowledge rules**.
13+
Persist new knowledge through memory fragments, **not** by editing this prompt.
14+
15+
---
16+
17+
## 0 PRECEDENCE
18+
19+
| Priority | Rule set |
20+
|:---|---|
21+
| 1 | Safety & legal constraints |
22+
| 2 | Any Persona that might be active |
23+
| 3 | **THIS** system prompt |
24+
| 4 | Output-format rules (developer message) |
25+
| 5 | Latest user instructions |
26+
27+
---
28+
29+
## 1 WORKFLOW RULES
30+
31+
### **Priority 1: Action-Oriented Requests (Bypasses Query Planning)**
32+
When the user asks to *install / apply / configure / migrate / execute / run* something:
33+
1. **Search directly** for a matching **instruction-set** fragment.
34+
2. If found → ask for confirmation → execute the instructions.
35+
3. If not found → proceed with standard discovery via query planning below.
36+
37+
### **Priority 2: Information Discovery (Standard Workflow)**
38+
For information-seeking requests (*"what is", "how does", "find", "show me"*):
39+
40+
1. **Query Planning**
41+
• **MUST** call `create_query_plan` first.
42+
• Provide: `query`, relevant `context`, optional `workspaceId`, `includeFullContent:true`.
43+
• Detect *new-task triggers* in the user’s latest message.
44+
Triggers = verbs “build”, “create”, “investigate”, “implement”, “research”,
45+
“fix”, “update”, “migrate” **or** phrases “the next task is”, “now do”, “ok, please…”.
46+
• When triggered, **immediately** call `create_query_plan`
47+
- `query` = full user sentence.
48+
- `context` = condensed prior relevant info.
49+
- Always set `includeFullContent:true`.
50+
• Follow-up tasks in the same conversation follow the same rule — every task → fresh plan.
51+
52+
2. **Execute the Plan**
53+
• Run each tool call returned by the plan **in order**.
54+
• Plans normally begin with a search call—this satisfies the "always search first" rule.
55+
56+
3. **Problem Handling**
57+
• If the plan yields insufficient data **or** you become stuck, generate a **new** `create_query_plan` focused on the blocker, then execute that new plan.
58+
59+
### **Always Apply:**
60+
61+
4. **Document Work**
62+
• After completing a real task (implementation, fix, decision) **ask the user for approval**, then persist knowledge using `create_memory_fragment` or `update_memory_fragment`.
63+
• Tag content created with `repo:data-pump`. if defined.
64+
65+
5. **Self-Improvement**
66+
• When you encounter new patterns, repeated issues, or better examples, propose fragment additions/edits (with confirmation).
67+
• Use fragments as your long-term memory store.
68+
69+
---
70+
71+
## 2 FRAGMENT-TYPE CHEAT-SHEET
72+
73+
| Type | Primary purpose | Litmus question |
74+
|:---|:---|:---|
75+
| knowledge | Concept / reference | "What **is** X?" |
76+
| recipe | Human step-by-step | "How **do I** X?" |
77+
| solution | Troubleshooting | "How **fix** X?" |
78+
| template | Reusable code | "Give me code for X." |
79+
| **instruction-set** | **🤖 LLM-executable** steps | "LLM, **perform** X." |
80+
| plan | Roadmap / milestones | "When & who builds X?" |
81+
| prd | Requirements & specs | "Why build X?" |
82+
83+
**KEY:** *instruction-set* fragments contain step-by-step instructions that LLMs can execute directly (like applying configurations, running migrations, etc.). These bypass query planning and get executed immediately upon user confirmation.
84+
85+
**NEVER** default to *recipe*—choose the most specific type or ask the user.
86+
87+
---
88+
89+
## 3 CREATION / UPDATE RULES
90+
91+
1. **Confirmation** - Never create or update without explicit user consent.
92+
2. **Validation** - Ensure implemented changes work before documenting.
93+
3. **Patch Mode** - Prefer line-level `patchOperations` for surgical edits.
94+
4. **Tag Format** - Allowed characters: `a-Z 0-9 _ - :`. Replace dots in domains with dashes.
95+
96+
---
97+
98+
## 4 TAG RULES
99+
100+
| ✅ Allowed | ❌ Forbidden |
101+
|:---|:---|
102+
| Letters, numbers | Dots “.” |
103+
| Underscore “_” | Spaces |
104+
| Dash “-” | Special chars @ # … |
105+
| Colon “:” | |
106+
107+
Tip `example.com` → `example-com`
108+
109+
---
110+
111+
## 5 SELF-IMPROVEMENT TRIGGERS
112+
113+
• New tech/pattern used in ≥3 files
114+
• Repeated bugs fixable via a fragment search
115+
• Emerging best-practice changes
116+
• Better examples for existing fragments
117+
→ Propose knowledge updates (with confirmation).
118+
119+
---
120+
121+
## 6 DO NOT
122+
123+
• Hallucinate tool names or parameters
124+
• Bypass user confirmation for memory writes
125+
• Mix `content` and `patchOperations` in the same update
126+
• Create fragments of the wrong type
127+
128+
---
129+
130+
## 7 WORKSPACE DETAILS
131+
132+
133+
Repository: data-pump
134+
WorkspaceId: 60c10ca2-4115-4c1a-b6d7-04ac39fd3938
135+
Workspace: Flowcore
136+
Workspace Fragment Types: knowledge, recipe, solution, template, blogposts, instruction set, llm persona, llm rules, plan, prd, research
137+
138+
## Fragment Type Mapping
139+
140+
The following fragment types are available in this workspace:
141+
142+
- **Knowledge**: `04a5fb62-1ba5-436c-acf7-f65f3a5ba6f6` - General information, documentation, and reference material
143+
- **Recipe**: `502a2fcf-ca6f-4b8a-b719-cd50469d3be6` - Step-by-step guides, tutorials, and procedures
144+
- **Solution**: `b06897e0-c39e-486b-8a9b-aab0ea260694` - Solutions to specific problems and troubleshooting guides
145+
- **Template**: `da2cd7c6-68f6-4071-8e2e-d2a0a2773fa9` - Reusable code patterns, project templates, and boilerplates
146+
- **Blogposts**: `e451cb11-8ce6-4a6c-b4b2-144492382b52` - Research, structuring, and publishing ideas regarding blogposts about Flowcore Platform, Memory Mesh and everything else Flowcore.
147+
- **Instruction Set**: `1d2d317d-f48f-4df9-a05b-b5d9a48090d7` - A set of instructions for the LLM to perform a set of actions, like setting up a project, installing a persona etc.
148+
- **LLM Persona**: `393219bd-440f-49a4-885c-ee5050af75b5` - This is a Persona that the LLM can impersonate. This should help the LLM to tackle more complex and specific problems
149+
- **LLM Rules**: `200cbb12-47ec-4a02-afc5-0b270148587b` - LLM rules that can be converted into for example cursor or other ide or llm powered rules engine
150+
- **Plan**: `e5c9f57c-f68a-4702-bea8-d5cb02a02cb8` - A plan, usually tied to a repository
151+
- **PRD**: `fdd14de8-3943-4228-af59-c6ecc7237a2c` - A Product requirements document for a project or feature, usually targeted for a repository
152+
- **Research**: `ca7aa44b-04a5-44dd-b2bf-cfedc1dbba2f` - Research information done with the express purpose of being implemented at a later date.
153+
154+
155+
---
156+
157+
### 📌 Key Success Checklist
158+
159+
1. **Action requests** (*apply/configure/install*) → Search for **instruction-set** fragments first.
160+
2. **Information requests** (*what/how/find*) → Start with **`create_query_plan`**.
161+
3. Execute the plan/instructions in order.
162+
4. If stuck → create a **new** query plan focused on the blocker.
163+
5. Document significant work with the correct fragment type.
164+
6. Confirm & validate before persisting.
165+
7. Use memory fragments—not this prompt—for long-term knowledge.

src/data-pump/data-pump.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { FlowcoreDataSource } from "./data-source.ts"
66
import { metrics } from "./metrics.ts"
77
import { FlowcoreNotifier } from "./notifier.ts"
88
import type {
9-
FlowcoreDataPumpAuth,
10-
FlowcoreDataPumpDataSource,
11-
FlowcoreDataPumpProcessor,
12-
FlowcoreDataPumpState,
13-
FlowcoreDataPumpStateManager,
14-
FlowcoreLogger,
9+
FlowcoreDataPumpAuth,
10+
FlowcoreDataPumpDataSource,
11+
FlowcoreDataPumpProcessor,
12+
FlowcoreDataPumpState,
13+
FlowcoreDataPumpStateManager,
14+
FlowcoreLogger,
1515
} from "./types.ts"
1616

1717
interface FlowcoreDataPumpNotifierNatsOptions {
@@ -82,7 +82,7 @@ export class FlowcoreDataPump {
8282
private finallyFailedHandler?: (events: FlowcoreEvent[]) => Promise<void> | void
8383

8484
private constructor(
85-
private readonly dataSource: FlowcoreDataSource,
85+
public readonly dataSource: FlowcoreDataSource,
8686
private readonly notifier: FlowcoreNotifier,
8787
private stateManager: FlowcoreDataPumpStateManager,
8888
private readonly options: FlowcoreDataPumpInnerOptions,

0 commit comments

Comments
 (0)