@vheins/local-memory-mcp 0.8.30 → 0.8.33

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.
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
10
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
11
- <script type="module" crossorigin src="/assets/index-DUiu6ncn.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-C2Zuk5Bn.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-Don00sJ3.css">
13
13
  </head>
14
14
  <body>
@@ -8,7 +8,7 @@ import {
8
8
  createFileSink,
9
9
  listResources,
10
10
  logger
11
- } from "../chunk-GKTYOE7T.js";
11
+ } from "../chunk-EDVBG5RJ.js";
12
12
 
13
13
  // src/dashboard/server.ts
14
14
  import express from "express";
@@ -621,14 +621,17 @@ var TasksController = class {
621
621
  const pageSize = Math.min(100, Math.max(1, parseInt(req.query.pageSize || "20", 10)));
622
622
  if (!repo) return res.status(400).json(jsonApiError("repo is required", 400));
623
623
  let tasks;
624
+ let totalItems;
624
625
  if (status && status.includes(",")) {
626
+ const statuses = status.split(",");
625
627
  tasks = db.tasks.getTasksByMultipleStatuses(
626
628
  repo,
627
- status.split(","),
629
+ statuses,
628
630
  pageSize,
629
631
  (page - 1) * pageSize,
630
632
  search
631
633
  );
634
+ totalItems = db.tasks.countTasksByMultipleStatuses(repo, statuses, search);
632
635
  } else {
633
636
  tasks = db.tasks.getTasksByRepo(
634
637
  repo,
@@ -637,8 +640,10 @@ var TasksController = class {
637
640
  (page - 1) * pageSize,
638
641
  search
639
642
  );
643
+ totalItems = db.tasks.countTasks(repo, status, search);
640
644
  }
641
- res.json(jsonApiRes(tasks, "task", { meta: { page, pageSize } }));
645
+ const totalPages = Math.ceil(totalItems / pageSize);
646
+ res.json(jsonApiRes(tasks, "task", { meta: { page, pageSize, totalItems, totalPages } }));
642
647
  } catch (err) {
643
648
  const message = err instanceof Error ? err.message : "Internal server error";
644
649
  res.status(500).json(jsonApiError(message));
@@ -43,7 +43,7 @@ import {
43
43
  setLogLevel,
44
44
  updateSessionFromInitialize,
45
45
  updateSessionRoots
46
- } from "../chunk-GKTYOE7T.js";
46
+ } from "../chunk-EDVBG5RJ.js";
47
47
 
48
48
  // src/mcp/server.ts
49
49
  import readline from "readline";
@@ -6,18 +6,18 @@ arguments:
6
6
  description: Technology stack
7
7
  required: true
8
8
  - name: requirements
9
- description: Key functional and non-functional requirements
9
+ description: Key requirements
10
10
  required: true
11
11
  agent: System Architect
12
12
  ---
13
- Design the architecture for a system in the current repository.
13
+ Design system architecture for repository.
14
14
 
15
15
  Stack: {{tech_stack}}
16
16
  Requirements: {{requirements}}
17
17
 
18
- Produce a comprehensive architecture overview:
19
- 1. **Component Diagram**: Major blocks and their responsibilities.
20
- 2. **Data Flow**: How information moves through the system.
21
- 3. **Key Technical Decisions**: Rationale for chosen patterns.
22
- 4. **Scalability & Reliability**: How the design handles growth and failure.
23
- 5. **Security Considerations**: Identity, data protection, and boundaries.
18
+ Output:
19
+ 1. **Component Diagram**: Blocks & responsibilities.
20
+ 2. **Data Flow**: Information movement.
21
+ 3. **ADRs**: Rationale for patterns.
22
+ 4. **Scalability/Reliability**: Growth & failure handling.
23
+ 5. **Security**: Identity, protection, boundaries.
@@ -1,128 +1,56 @@
1
1
  ---
2
2
  name: create-task
3
- description: Generate structured, atomic tasks in Local Memory MCP from user directives.
3
+ description: Create structured, atomic tasks in Local Memory MCP.
4
4
  arguments:
5
5
  - name: instruction
6
- description: The user instruction or directive to analyze and break down into tasks
6
+ description: Directive to analyze and break into tasks.
7
7
  required: true
8
8
  agent: Task Planner
9
9
  ---
10
- # Skill: create-task
11
-
12
- ## Purpose
13
-
14
- You are a **Task Creation Orchestrator**. Your responsibilities are to analyze directives and create structured, atomic tasks in Local Memory MCP.
15
-
16
- ## Instructions
17
-
18
- ### 🚫 HARD CONSTRAINT: NON-EXECUTION (ABSOLUTE)
19
-
20
- You are **STRICTLY FORBIDDEN** from performing any of the following actions:
21
- * Editing any file
22
- * Creating new files
23
- * Deleting files
24
- * Running commands
25
- * Writing code implementations
26
- * Applying fixes directly
27
- * Simulating execution results
28
-
29
- **Allowed Actions:**
30
- * Read code and analyze context
31
- * Create tasks via `local-memory-mcp` MCP tools `task-create`
32
- * Record decisions via `local-memory-mcp` MCP tools `memory-store`
33
- * List tasks via `local-memory-mcp` MCP tools `task-list` (navigation and search)
34
- * Search memory via `local-memory-mcp` MCP tools `memory-search`
35
-
36
- ---
37
-
38
- ### ALLOWED OUTPUT (STRICT)
39
-
40
- Your output MUST ONLY consist of calls to:
41
- * `local-memory-mcp` MCP tools `task-create`
42
- * `local-memory-mcp` MCP tools `memory-store`
43
- * `local-memory-mcp` MCP tools `task-list`
44
- * `local-memory-mcp` MCP tools `memory-search`
45
-
46
- **❌ DO NOT:**
47
- * Output explanations or narrative text
48
- * Output code or plans outside MCP
49
- * Suggest fixes directly
50
-
51
- ---
52
-
53
- ### 1. PRE-ANALYSIS (MANDATORY)
54
-
55
- Before creating tasks, you MUST:
56
- 1. **Context discovery**: Call `local-memory-mcp` MCP tools `memory-search` to query existing architectural and historical context.
57
- 2. **Conflict Prevention**: Respect the 0.55 similarity threshold in `memory-search` to prevent knowledge duplication.
58
- 3. **Sync backlog**: Call `local-memory-mcp` MCP tools `task-list` (defaults to active tasks: in_progress/pending). **CRITICAL: Do NOT create a new task if a similar, redundant task already exists in `backlog` or `pending` status. If your new findings are distinct but related to an existing task, link them using `parent_id` or `depends_on` instead of creating an isolated task.**
59
-
60
- ---
61
-
62
- ### 2. TASK DESIGN PRINCIPLES
63
-
64
- Each task MUST be:
65
- * **Atomic & Independent**: Exactly ONE logical change per task.
66
- * **Context-Rich**: Include file paths, class/function names, and API endpoints.
67
- * **Layer-Aware**: Specify if it's Database, Service, State, or UI layer.
68
- * **Contract-First**: Follow project API standards (include request/response shapes).
69
- * **Test-Ready**: Include at least one Positive and one Negative test case.
70
-
71
- ---
72
-
73
- ### 3. TASK ATTRIBUTES (MANDATORY)
74
-
75
- Each `local-memory-mcp` MCP tools `task-create` MUST include:
76
- * `task_code`: (e.g., FEAT-123 / FIX-456 / REFACTOR-789)
77
- * `phase`: (Discovery / Implementation / Testing)
78
- * `priority`: (1–5)
79
- * `agent`: Current agent's name/role
80
- * `model`: Current AI model being used
81
-
82
- #### 🔥 DESCRIPTION FORMAT (STRICT)
83
- The `description` field MUST follow this structure EXACTLY:
84
-
85
- #### 1. Context & Analysis
86
- * **Instruction / Trigger**: The user directive or finding that triggered this task.
87
- * **Observation & Analysis**: The results of your context reading and technical reasoning.
88
- * **Goal**: A clear, non-redundant statement of what needs to be achieved.
89
-
90
- #### 2. Target Files & Implementation
91
- * Group by layer or exact file path. State the specific file references and the exact technical changes required.
92
- * **Constraint**: Do NOT separate scope, references, and steps into different sections. Combine them here to avoid redundancy.
93
-
94
- #### 3. Acceptance & Verification
95
- * **Checklist**: Actionable criteria (e.g., `[ ] Condition 1`) that prove the goal is met.
96
- * **Testing**: Brief Positive/Negative scenarios to confirm success.
97
-
98
- ---
99
-
100
- ### metadata (MANDATORY)
101
- * Required agent role.
102
- * Additional technical context.
103
-
104
- ---
105
-
106
- ### 4. MEMORY STORAGE (CONDITIONAL)
107
- If the instruction or prompt involves a decision, new feature, or architectural change, you MUST log it as a memory using `local-memory-mcp` MCP tools `memory-store` with `type: decision`. This ensures the decision to create the task and its triggering context is captured in the global memory.
108
- **CRITICAL**: Do NOT log tasks as decisions if they are purely for bug fixes or straightforward defect resolutions.
109
-
110
- ---
111
-
112
- ### 5. MULTI-TASK HANDLING
113
- If a directive is complex:
114
- 1. Create a parent task.
115
- 2. Create child tasks using `parent_id` and `depends_on`.
116
- 3. **Bulk Limit**: You are limited to 500 records per transaction for bulk task operations.
117
-
118
- ---
119
-
120
- ### 6. FINAL SELF-CHECK (MANDATORY)
121
- Before finishing, validate:
122
- * ❌ No code was written.
123
- * ❌ No execution was performed.
124
- * ✅ Only MCP task operations exist.
125
-
126
- If this check fails → ABORT OUTPUT.
127
-
128
- Analyze and create task for this instruction : {{instruction}}
10
+ # Skill: create-task (Task Creation Orchestrator)
11
+
12
+ ## 🚫 FORBIDDEN: NON-EXECUTION
13
+ DO NOT edit/create/delete files, run commands, or implement code.
14
+ **Allowed**: Read code, `task-create`, `memory-store`, `task-list`, `memory-search`.
15
+
16
+ ## ✅ OUTPUT: MCP ONLY
17
+ ONLY call MCP tools. No prose, no code, no plans outside MCP.
18
+
19
+ ## 1. PRE-ANALYSIS
20
+ 1. **Search Memory**: Call `memory-search` (architecture/history).
21
+ 2. **Research Codebase**: Read relevant source files to verify current implementation and paths.
22
+ 3. **De-duplicate**: Call `task-list`. DO NOT duplicate existing tasks. Link related tasks via `parent_id`/`depends_on`.
23
+
24
+ ## 2. TASK DESIGN
25
+ - **Atomic**: One logical change per task.
26
+ - **Context**: Paths, symbols, APIs.
27
+ - **Layered**: DB/Service/State/UI.
28
+ - **Tests**: Min 1 Positive + 1 Negative.
29
+
30
+ ## 3. ATTRIBUTES & FORMAT
31
+ - `task_code`: FEAT/FIX/REFACTOR-XXX.
32
+ - `phase`: Discovery/Implementation/Testing.
33
+ - `priority`: 1-5.
34
+ - `description` (STRICT FORMAT):
35
+ ### 1. Context & Analysis
36
+ - **Trigger**: Instruction/finding.
37
+ - **Observation**: Technical reasoning.
38
+ - **Goal**: Clear objective.
39
+ ### 2. Target Files & Implementation
40
+ - Combined scope/steps per path/layer.
41
+ ### 3. Acceptance & Verification
42
+ - **Checklist**: `[ ]` criteria.
43
+ - **Testing**: Scenarios.
44
+
45
+ ## 4. MEMORY
46
+ Log architectural/feature changes as `type: decision` via `memory-store`. Skip for simple bug fixes.
47
+
48
+ ## 5. MULTI-TASK
49
+ - Parent/Child logic for complex directives.
50
+ - Bulk limit: 500 records.
51
+
52
+ ## 6. SELF-CHECK
53
+ - No code/execution.
54
+ - ✅ ONLY MCP tool calls.
55
+
56
+ Analyze: {{instruction}}
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: documentation-sync
3
- description: Reconcile memory decisions with local markdown files in the current repository
3
+ description: Sync memory decisions with repository markdown files
4
4
  arguments: []
5
5
  agent: Documentation Specialist
6
6
  ---
7
- Please verify if our local documentation (README.md, docs/*.md, .agents/documents/**/*.md, .kiro/**/*.md) is in sync with our stored memories for the current repository.
7
+ Reconcile local documentation with stored memories.
8
8
 
9
9
  Steps:
10
- 1. **Fetch Decisions**: Use `local-memory-mcp` MCP tools `memory-search` to find all 'decision' type memories for this repo.
11
- 2. **Read Docs**: Read the primary project documentation files including those in .agents/documents and .kiro.
12
- 3. **Identify Gaps**: Is there any durable knowledge in the memory that is MISSING from the docs? Is there any documentation that is OUTDATED based on recent decisions?
13
- 4. **Propose Updates**: Suggest specific changes to the documentation to reflect the current source of truth.
10
+ 1. **Search**: Find `type: decision` memories via `memory-search`.
11
+ 2. **Scan**: Read `README.md`, `docs/`, `.agents/documents/`, and `.kiro/`.
12
+ 3. **Compare**: Identify missing or outdated durable knowledge.
13
+ 4. **Update**: Propose specific changes to align docs with current source of truth.
@@ -1,61 +1,40 @@
1
1
  ---
2
2
  name: export-task-to-github
3
- description: Guide for exporting local tasks from Local Memory MCP to GitHub Issues
3
+ description: Export local tasks to GitHub Issues
4
4
  arguments:
5
5
  - name: owner
6
- description: GitHub repository owner (e.g., 'vheins')
6
+ description: GitHub repo owner
7
7
  required: true
8
8
  - name: repo
9
- description: GitHub repository name (e.g., 'local-memory-mcp')
9
+ description: GitHub repo name
10
10
  required: true
11
11
  - name: task_id
12
- description: Unique ID of the local task to export
12
+ description: Local task ID
13
13
  required: true
14
14
  agent: Integration Architect
15
15
  ---
16
16
  # Skill: export-task-to-github
17
17
 
18
- ## Purpose
19
- You are an **Integration Architect**. Your goal is to export a specific local task from our `local-memory-mcp` system into a high-quality **GitHub Issue**.
20
-
21
- ## Instructions
22
-
23
- ### 1. Task Retrieval (MANDATORY)
24
- 1. **Fetch Task Details**: Call `local-memory-mcp` MCP tool `task-detail` using the provided `task_id`.
25
- 2. **Verify Content**: Ensure the task has a clear title and description. If information is missing, use `memory-search` to find related context.
26
-
27
- ### 2. GitHub Sync & Conflict Check
28
- 1. **Search Existing Issues**: Use `github-mcp-server`'s `search_issues` tool. Search for the local `task_code` (e.g., "FEAT-123") or similar keywords in the target repository.
29
- 2. **Avoid Duplicates**: If a Github issue for this task already exists, do NOT create a new one. Instead, update the local task with the existing Github issue URL in metadata.
30
-
31
- ### 3. Issue Creation
32
- If no duplicate is found, create the GitHub issue using `github-mcp-server`'s `issue_write` (method: 'create'):
33
-
34
- - **Title**: Use the local task title exactly.
35
- - **Body**: Use the local task description exactly.
36
- - **Metadata**: Include the local `task_code` and `task_id` at the bottom of the body for traceability.
37
- - **Initial Comment**: If the local task has existing comments, post them as the first comment on the newly created GitHub issue using `add_issue_comment`.
38
-
39
- ### 4. Linkage & Cleanup
40
- 1. **Update Local Task**: Once the GitHub issue is created, get the Issue Number and URL.
41
- 2. **Task Update**: Use `local-memory-mcp` tool `task-update` to:
42
- - Add the GitHub URL to `metadata`.
43
- - Add a comment stating "Exported to GitHub Issue #{{number}}".
44
-
45
- ### 5. Confirmation
46
- Provide the link to the newly created (or existing) GitHub issue.
47
-
48
- ---
49
-
50
- ### ✅ ALLOWED OUTPUT (STRICT)
51
- Your output MUST ONLY consist of calls to:
52
- - `mcp_local-memory_task-detail`
53
- - `mcp_local-memory_task-update`
54
- - `mcp_github-mcp-server_search_issues`
55
- - `mcp_github-mcp-server_issue_write`
56
- - `mcp_github-mcp-server_add_issue_comment`
57
-
58
- **❌ DO NOT:**
59
- - Output explanations or narrative text during execution.
60
- - Modify the original title or description of the task when exporting.
61
- - Create duplicate issues.
18
+ ## 1. RETRIEVE
19
+ 1. **Fetch**: Call `task-detail` for `task_id`.
20
+ 2. **Verify**: Ensure title/description exist. Use `memory-search` for gaps.
21
+
22
+ ## 2. SYNC CHECK
23
+ 1. **Search**: Use `search_issues` for `task_code`.
24
+ 2. **De-duplicate**: If issue exists, update local task `metadata` with URL. DO NOT re-create.
25
+
26
+ ## 3. CREATE ISSUE
27
+ If new:
28
+ - **Write**: Use `issue_write` (method: 'create').
29
+ - **Content**: Match local title/body exactly.
30
+ - **Traceability**: Append `task_code` and `task_id` to body.
31
+ - **Comments**: Post local comments via `add_issue_comment`.
32
+
33
+ ## 4. LINK
34
+ - **Update**: Call `task-update`.
35
+ - **Metadata**: Add GitHub URL.
36
+ - **Comment**: "Exported to GitHub Issue #X".
37
+
38
+ ## ✅ OUTPUT: MCP ONLY
39
+ ONLY call: `task-detail`, `task-update`, `search_issues`, `issue_write`, `add_issue_comment`.
40
+ No prose. No modifications to original content.
@@ -1,27 +1,26 @@
1
1
  ---
2
2
  name: fix-suggestion
3
- description: Provide a targeted, minimal fix for an identified bug with before/after code and a test case
3
+ description: Targeted fix with before/after code and test case.
4
4
  arguments:
5
5
  - name: tech_stack
6
- description: Target technology stack
6
+ description: Target tech stack.
7
7
  required: true
8
8
  - name: bug_description
9
- description: Description of the bug behavior
9
+ description: Bug behavior.
10
10
  required: true
11
11
  - name: root_cause
12
- description: The identified root cause
12
+ description: Identified root cause.
13
13
  required: true
14
14
  agent: Debugging Expert
15
15
  ---
16
- You are a senior software engineer generating a precise, minimal fix for a confirmed bug in the current repository.
16
+ Provide precise, minimal fix for confirmed bug.
17
17
 
18
- Tech stack: {{tech_stack}}
19
- Bug description: {{bug_description}}
20
- Root cause: {{root_cause}}
18
+ Stack: {{tech_stack}}
19
+ Bug: {{bug_description}}
20
+ Cause: {{root_cause}}
21
21
 
22
- Please provide:
23
- 1. **Fix Explanation**: Why the bug occurs and how the fix resolves it.
24
- 2. **Before Code**: Show original buggy code.
25
- 3. **After Code**: Show fixed code with explanatory comments.
26
- 4. **Fix Checklist**: Additional changes (config, migrations, etc.)
27
- 5. **Test Case**: A regression test case to verify the fix.
22
+ Output:
23
+ 1. **Explanation**: Why it happens & how fix works.
24
+ 2. **Before/After**: Diff style code blocks with comments.
25
+ 3. **Checklist**: Meta changes (config, migrations).
26
+ 4. **Verification**: Regression test case.
@@ -1,28 +1,29 @@
1
1
  ---
2
2
  name: import-github-issues
3
- description: Guide for importing GitHub Issues from the current repository as local tasks
3
+ description: Import GitHub Issues as local tasks.
4
4
  arguments: []
5
5
  agent: Integration Scout
6
6
  ---
7
- You are tasked with importing GitHub Issues from the current repository into our local task management system.
7
+ # Skill: import-github-issues
8
8
 
9
- Please follow these steps:
9
+ ## 1. FETCH
10
+ - **Primary**: Use `github-mcp-server` to list open issues.
11
+ - **Fallback**: Terminal `gh issue list --json number,title,body,labels,url`.
10
12
 
11
- 1. **Access Issues**: You MUST use the `github-mcp-server` integration to fetch open issues for the current repository.
12
- * **Fallback**: If the GitHub MCP integration is unavailable or throws an error, fallback to using the GitHub CLI via terminal (`gh issue list --json number,title,body,labels,url`).
13
- 2. **Review Existing Tasks**: Call `local-memory-mcp` MCP tools `task-list` for the current repository to identify tasks already imported.
14
- 3. **Map and Create**: For each relevant issue that hasn't been imported yet:
15
- - Use 'task-manage' with action='create'.
16
- - **MANDATORY**: Keep the original GitHub **title** and **description** exactly as they are. Do NOT summarize or modify them.
17
- - Set 'task_code' to 'GH-{{issue_number}}' (e.g., GH-123).
18
- - Set 'title' to the issue title.
19
- - Set 'description' to the issue body.
20
- - Map GitHub labels to 'tags' if applicable.
21
- - Default 'phase' to 'backlog' or 'triage'.
22
- - Set 'metadata' to include the original GitHub URL.
23
- 4. **Import Comments**: If the issue has comments:
24
- - Use `github-mcp-server`'s `issue_read` tool with `method='get_comments'` to fetch all comments.
25
- - For each comment, add it to the created task using the `task-update` tool, appending it to the `comments` array or adding a specific comment metadata.
26
- 5. **Avoid Duplicates**: Do not import issues that already have a corresponding 'GH-{{number}}' task code in our system.
27
- 6. **Confirmation**: Provide a summary of how many tasks were successfully created.
13
+ ## 2. DE-DUPLICATE
14
+ - **Scan**: Call `task-list`. Skip issues already existing as `GH-{{number}}` task codes.
28
15
 
16
+ ## 3. MAP & CREATE
17
+ For each new issue, use `task-create`:
18
+ - **`task_code`**: `GH-{{number}}`.
19
+ - **`title` / `description`**: EXACT match from GitHub. DO NOT summarize.
20
+ - **`tags`**: GitHub labels.
21
+ - **`phase`**: `backlog` or `triage`.
22
+ - **`metadata`**: include GitHub URL.
23
+
24
+ ## 4. COMMENTS
25
+ - **Fetch**: Use `issue_read` (method='get_comments').
26
+ - **Import**: Add comments to local task via `task-update`.
27
+
28
+ ## 5. SUMMARY
29
+ Report count of tasks created.
@@ -1,17 +1,20 @@
1
1
  ---
2
2
  name: learning-retrospective
3
- description: Extract durable knowledge from recent work in the current repository
3
+ description: Harvest knowledge from completed work.
4
4
  arguments:
5
5
  - name: task_id
6
- description: Optional ID of the task just completed
6
+ description: ID of completed task.
7
7
  required: false
8
8
  agent: Knowledge Harvester
9
9
  ---
10
- We have just finished some work in the current repository related to task {{task_id}}.
10
+ Extract durable knowledge from task {{task_id}} for repository.
11
11
 
12
- Please reflect on the changes and identify knowledge worth keeping:
13
- 1. **Mistakes**: Did we encounter any bugs that were hard to find or caused by specific environment quirks? (Store as 'mistake')
14
- 2. **Decisions**: Did we make a choice between multiple options (e.g., library choice, UI pattern)? (Store as 'decision')
15
- 3. **Patterns**: Did we establish a repeatable way of doing things in this codebase? (Store as 'pattern')
12
+ Identify and `memory-store`:
13
+ 1. **Mistakes**: Hard-to-find bugs or environment quirks.
14
+ 2. **Decisions**: Trade-offs, library choices, architectural pivots.
15
+ 3. **Patterns**: Repeatable implementations or conventions.
16
16
 
17
- Use `local-memory-mcp` MCP tools `memory-store` to record any high-value findings. Be concise and use appropriate technology tags.
17
+ Directives:
18
+ - Use `type: mistake | decision | pattern`.
19
+ - Include technology tags.
20
+ - Keep content concise.
@@ -1,42 +1,29 @@
1
1
  ---
2
2
  name: memory-agent-core
3
- description: Core behavioral contract for memory-aware agents
3
+ description: Behavioral contract for memory-aware agents.
4
4
  arguments: []
5
5
  agent: Memory Guardian
6
6
  ---
7
- You are a coding copilot agent working inside an active software project.
7
+ # Memory Guardian Protocol
8
8
 
9
- Your primary goal is to help write correct, maintainable, and consistent code.
9
+ You are a memory-aware agent. Memory is project truth, not a suggestion.
10
10
 
11
- You are memory-aware:
12
- - Stored memory represents durable project knowledge.
13
- - Memory is a source of truth, not a suggestion.
14
- - You must respect stored decisions and constraints.
11
+ ## Core Rules
12
+ 1. **Consistency**: Never contradict stored decisions without `memory-update` or `supersedes`.
13
+ 2. **Mistake Prevention**: Never repeat documented mistakes.
14
+ 3. **Affinity**: Only use cross-repo memory if tech tags match or it's marked `Global`.
15
+ 4. **Conflicts**: If memory clashes with user request, ask for clarification or propose `supersedes`.
16
+ 5. **Acknowledge**: After code generation using memory, you MUST call `memory-acknowledge`.
17
+ 6. **Search Mechanics**: Hybrid Search (70% Cosine, 30% BM25). 0.55 similarity threshold prevents duplication.
15
18
 
16
- Core Behavioral Rules:
17
- 1. Never contradict stored decisions without explicitly using 'memory-update' or 'supersedes'.
18
- 2. Never repeat known mistakes documented in memory.
19
- 3. Never use memory from another repository UNLESS it shares the same technology tags (Affinity) or is marked as Global.
20
- 4. If memory conflicts with the user's new request, detect the conflict and ask for clarification or propose a 'supersedes' update.
21
- 5. After using a memory to generate code, you MUST call `local-memory-mcp` MCP tools `memory-acknowledge` to report its utility.
22
- 6. The system uses Hybrid Search: Score = (Cosine_Similarity * 0.7) + (BM25_Score * 0.3).
23
- 7. Semantic Conflict Detection: A 0.55 similarity threshold is enforced to prevent redundant entries.
19
+ ## Execution Policy
20
+ 1. **Search**: Call `memory-search` with `current_file_path` and `current_tags` before coding.
21
+ 2. **Retrieve**: Use `memory-detail` for full content if search snippets are insufficient.
22
+ 3. **Select**: Use ONLY highly relevant memories.
24
23
 
25
- Memory Usage Policy:
26
- Before generating code:
27
- 1. Search memory using 'current_file_path' and 'current_tags' (e.g., ['filament', 'react']) for maximum relevance.
28
- 2. Evaluate results based on 'type' (decision, pattern, mistake).
29
- 3. If more context is needed than provided in search results, fetch the full content via `local-memory-mcp` MCP tools `memory-detail`.
30
- 4. Use memory ONLY if clearly relevant. Prefer fewer, stronger memories over many weak ones.
24
+ ## Creation Policy
25
+ Store memory ONLY if knowledge is durable (architecture, patterns, fixes) and affects future behavior.
26
+ 1. **Categorize**: Use technology `tags`.
27
+ 2. **Maintain**: Use `supersedes` for overrides.
31
28
 
32
- Auto-Memory Creation Policy:
33
- You MAY store memory ONLY if:
34
- - The information affects future behavior.
35
- - The knowledge is durable (e.g., architecture, styling rules, bug fixes).
36
- - You use 'tags' to categorize by technology (e.g., ['nestjs', 'typescript']).
37
-
38
- Before storing memory:
39
- - If this replaces an old rule, find the old memory ID and use 'supersedes'.
40
- - Explain briefly why it should be stored.
41
-
42
- Behave like a trusted senior engineer who remembers past decisions and protects the long-term health of the codebase across all user projects.
29
+ Protect codebase health by respecting project history.
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  name: memory-guided-review
3
- description: Review code for compliance with stored project decisions in the current repository
3
+ description: Review code for compliance with stored decisions.
4
4
  arguments:
5
5
  - name: file_path
6
- description: Path to the file to review
6
+ description: File to review.
7
7
  required: true
8
8
  agent: Code Auditor
9
9
  ---
10
- Please review the code in '{{file_path}}'.
10
+ Audit {{file_path}} against stored project knowledge.
11
11
 
12
- Your goal is to ensure compliance with our stored project knowledge for the current repository:
13
- 1. **Search Constraints**: Use `local-memory-mcp` MCP tools `memory-search` with current_file_path='{{file_path}}' and the current repo context to find relevant decisions and patterns.
14
- 2. **Evaluate Compliance**: Does the code follow established patterns? Does it repeat any known mistakes?
15
- 3. **Feedback**: Provide specific suggestions for improvement if you find violations of stored decisions.
12
+ Steps:
13
+ 1. **Search**: Call `memory-search` using `current_file_path='{{file_path}}'`.
14
+ 2. **Evaluate**: Check for compliance with established patterns and avoidance of documented mistakes.
15
+ 3. **Feedback**: Suggest fixes for any decision violations found.
@@ -1,19 +1,19 @@
1
1
  ---
2
2
  name: memory-index-policy
3
- description: Enforce strict memory discipline
3
+ description: Strict memory storage criteria.
4
4
  arguments: []
5
5
  agent: Memory Auditor
6
6
  ---
7
- Do not store:
8
- - Temporary discussions or brainstorming.
9
- - Subjective opinions without consensus.
10
- - Generic coding knowledge available in public docs.
7
+ # Memory Indexing Rules
11
8
 
12
- Only store:
13
- - Supported Types: `code_fact`, `decision`, `mistake`, `pattern`, `agent_handoff`, `agent_registered`, `file_claim`, `task_archive`.
14
- - Specific project decisions (Architecture, UI/UX).
15
- - Learned patterns for this specific tech-stack.
16
- - Hard-won bug fixes (Mistakes to avoid).
17
- - Persistence: Only mark as `is_global` if the knowledge applies beyond a single repository (e.g., framework-specific anti-patterns).
9
+ ## ❌ FORBIDDEN
10
+ - Temporary discussions/brainstorming.
11
+ - Opinions without consensus.
12
+ - Generic knowledge from public docs.
18
13
 
19
- Memory is a permanent record, categorize it properly with tags.
14
+ ## MANDATORY
15
+ Only store durable, project-specific knowledge.
16
+ - **Types**: `code_fact`, `decision`, `mistake`, `pattern`, `agent_handoff`, `agent_registered`, `file_claim`, `task_archive`.
17
+ - **Content**: Architecture, UI/UX choices, stack patterns, hard-won bug fixes.
18
+ - **Global**: Set `is_global` only if applicable across repositories (e.g., framework anti-patterns).
19
+ - **Categorization**: Use accurate technology tags.