@markus-global/cli 0.4.19 → 0.4.21

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.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: markitdown
3
+ description: Convert documents (PDF, Word, Excel, PowerPoint, images) to Markdown text for LLM processing
4
+ ---
5
+
6
+ # MarkItDown File Converter
7
+
8
+ You have access to the MarkItDown MCP tool (`markitdown__convert_to_markdown`) for converting files to Markdown.
9
+
10
+ ## When to use
11
+
12
+ Use this tool when:
13
+ - The user asks you to read, analyze, or summarize a document (PDF, Word, Excel, PowerPoint, etc.)
14
+ - You need to extract text content from an image (OCR)
15
+ - The user shares a file path and wants you to understand its contents
16
+ - You are working with a file format that your text tools cannot directly read
17
+
18
+ **Note:** For images attached directly in chat, the system automatically handles conversion when your model doesn't support vision. This skill is for converting files on disk that you encounter during tasks.
19
+
20
+ ## Supported formats
21
+
22
+ MarkItDown supports 29+ file formats including:
23
+ - **Documents**: PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx/.xls)
24
+ - **Images**: JPEG, PNG, GIF, WebP (EXIF metadata + OCR)
25
+ - **Web**: HTML, XML
26
+ - **Data**: CSV, JSON
27
+ - **Other**: ZIP (iterates contents), EPUB, Outlook messages (.msg)
28
+
29
+ ## Usage
30
+
31
+ ```
32
+ markitdown__convert_to_markdown({ uri: "file:///path/to/document.pdf" })
33
+ ```
34
+
35
+ The tool accepts a file URI and returns the content converted to Markdown format.
36
+
37
+ ## Prerequisites
38
+
39
+ MarkItDown requires Python 3.10+ and the `markitdown` package:
40
+
41
+ ```bash
42
+ pip install 'markitdown[all]'
43
+ ```
44
+
45
+ Or install only specific format support:
46
+
47
+ ```bash
48
+ pip install 'markitdown[pdf,docx,pptx]'
49
+ ```
50
+
51
+ ## Best practices
52
+
53
+ 1. **Check file existence first**: Verify the file path is valid before attempting conversion.
54
+ 2. **Large files**: For very large documents, the converted markdown may be lengthy. Summarize key sections for the user rather than dumping everything.
55
+ 3. **Image OCR quality**: OCR results depend on image clarity. Mention if text extraction seems incomplete.
56
+ 4. **Fallback**: If conversion fails (e.g., markitdown not installed), inform the user and suggest installing with `pip install 'markitdown[all]'`.
@@ -0,0 +1,20 @@
1
+ {
2
+ "type": "skill",
3
+ "name": "markitdown",
4
+ "displayName": "MarkItDown File Converter",
5
+ "version": "1.0.0",
6
+ "description": "Convert documents (PDF, Word, Excel, PowerPoint, images) to Markdown text for LLM processing",
7
+ "author": "markus",
8
+ "category": "data",
9
+ "tags": ["ocr", "pdf", "document", "conversion", "multimodal"],
10
+ "skill": {
11
+ "skillFile": "SKILL.md",
12
+ "requiredPermissions": ["file"],
13
+ "mcpServers": {
14
+ "markitdown": {
15
+ "command": "uvx",
16
+ "args": ["markitdown-mcp"]
17
+ }
18
+ }
19
+ }
20
+ }
@@ -1,222 +1,200 @@
1
1
  ---
2
2
  name: self-evolution
3
- description: Learn from mistakes, corrections, and successful strategies evolve your role, tool preferences, and SOPs over time
3
+ description: Learn from experience capture insights, organize knowledge, share reusable practices as skills, and refine your role over time
4
4
  ---
5
5
 
6
6
  # Self-Evolution
7
7
 
8
- You have the ability to learn from experience and evolve yourself over time. This goes beyond remembering facts — you can refine your own role definition, optimize your tool usage patterns, and develop standard operating procedures (SOPs) that make you more effective.
8
+ You learn from experience and evolve yourself over time. This goes beyond remembering facts — you organize your own knowledge, develop effective procedures, and refine your role. Continuous self-improvement is a core part of being an effective agent.
9
9
 
10
- This is not optional — continuous self-improvement is a core part of being an effective agent.
10
+ ## Knowledge Stores
11
+
12
+ Your memory has two stores with distinct roles:
13
+
14
+ | Store | File | Purpose | Written by |
15
+ |---|---|---|---|
16
+ | **Observation buffer** | `memories.json` | Raw observations, individual insights, tool tips | `memory_save` |
17
+ | **Curated knowledge** | `MEMORY.md` | Validated procedures, consolidated insights, proven patterns | `memory_update_longterm` |
18
+
19
+ **Flow**: Observations enter the buffer → recurring patterns get promoted to MEMORY.md (by you or by dream cycles) → source entries are pruned.
20
+
21
+ MEMORY.md is always loaded into your context as `## Your Knowledge`. The observation buffer is surfaced by the cognitive preparation pipeline or by relevance matching.
11
22
 
12
23
  ## When to Reflect
13
24
 
14
- Trigger the reflection process when any of these happen:
25
+ Trigger reflection when any of these happen:
26
+
27
+ 1. **User correction** — "no, do X instead", "that's wrong". Strongest signal.
28
+ 2. **Task revision** — Your submission was rejected. The system prompts you automatically.
29
+ 3. **Self-correction** — One approach failed, a different one worked.
30
+ 4. **Resolved error** — Unexpected failure you diagnosed and fixed.
31
+ 5. **Efficiency insight** — A faster/cleaner/more reliable way for a recurring task.
32
+ 6. **Pattern recognition** — You keep doing something the same way and it could be standardized.
15
33
 
16
- 1. **User correction**The user says "no, do X instead", "that's wrong", or redirects your approach. Strongest signal.
17
- 2. **Task revision** — A task you submitted was rejected and sent back. The system will prompt you to reflect after a revised task is accepted.
18
- 3. **Self-correction** — You tried one approach, it failed, and you found a different approach that worked.
19
- 4. **Resolved error** — An unexpected error (tool failure, wrong API assumption, misunderstood requirement) that you diagnosed and fixed.
20
- 5. **Efficiency insight** — You discover a faster, cleaner, or more reliable way to accomplish a recurring task.
21
- 6. **Pattern recognition** — You notice you keep doing something the same way and realize it could be standardized.
34
+ Skip trivial matterstypos, one-off path errors, situations that won't recur.
22
35
 
23
- Do NOT trigger reflection for trivial matters typos, one-off path errors, or situations that won't recur.
36
+ ## Decision MatrixWhere Does This Insight Go?
24
37
 
25
- ## Layer 1: Lessons (Immediate Memory)
38
+ | What you learned | Where to save | How |
39
+ |---|---|---|
40
+ | Single insight, gotcha, mistake | Observation buffer | `memory_save` with tags: `["insight", ...]` |
41
+ | Tool tip or preference | Observation buffer | `memory_save` with tags: `["insight", "tool:<name>"]` |
42
+ | Validated pattern from successful task | Observation buffer | `memory_save` with tags: `["insight", ...]` |
43
+ | Multi-step repeatable workflow (personal) | MEMORY.md | `memory_update_longterm({ section: "<your-section>", mode: "patch" })` |
44
+ | Practice worth sharing with the team | Skill package | Create via **skill-building**, install with `builder_install` |
45
+ | 3+ related insights → behavioral rule | ROLE.md | Read → append → log change |
26
46
 
27
- ### How to Extract a Lesson
47
+ ## Capturing Insights (Observation Buffer)
28
48
 
29
- When a reflection trigger fires, think through:
49
+ ### Extracting an Insight
50
+
51
+ When a reflection trigger fires:
30
52
 
31
53
  1. **Situation** — What were you trying to do?
32
54
  2. **What went wrong** — What assumption or action was incorrect?
33
55
  3. **What worked** — What was the correct approach?
34
56
  4. **Generalized rule** — A reusable principle beyond this specific instance.
35
57
 
36
- ### How to Save a Lesson
58
+ ### Saving an Insight
37
59
 
38
60
  Use `memory_save` with:
39
61
 
40
- - **type**: `"note"`
41
- - **content**: Concise lesson in this format:
62
+ - **type**: `"insight"`
63
+ - **content** format:
42
64
  ```
43
- [LESSON] <one-line summary>
65
+ [INSIGHT] <one-line summary>
44
66
  Situation: <brief context>
45
67
  Mistake: <what went wrong>
46
68
  Correction: <what works>
47
- Rule: <generalized principle for future use>
69
+ Rule: <generalized principle>
48
70
  ```
49
- - **tags**: Always include `"lesson"` as the first tag, then add category tags:
50
- - `coding` — code patterns, language features, library usage
51
- - `tool-usage` — correct use of shell, file, git, or other tools
52
- - `communication` — how to interact with users, managers, or other agents
53
- - `architecture` — system design, file organization, dependency decisions
54
- - `process` — workflow, task management, review process
55
- - `domain:<topic>` — domain-specific knowledge (e.g., `domain:react`)
56
-
57
- ### Consolidating Lessons
58
-
59
- When you have 3+ unsaved lessons, consolidate into long-term memory:
60
-
61
- ```
62
- memory_update_longterm({
63
- section: "lessons-learned",
64
- content: "<numbered list of top 20 lessons>"
65
- })
66
- ```
71
+ - **tags**: Always include `"insight"` first, then category tags: `coding`, `tool-usage`, `communication`, `architecture`, `process`, `domain:<topic>`
67
72
 
68
- Each lesson: one actionable sentence. Replace older/less impactful ones when you exceed 20.
73
+ Dream cycles automatically promote recurring patterns (3+ similar insights) from the observation buffer to MEMORY.md and prune the source entries.
69
74
 
70
- ## Layer 2: Tool Preferences
75
+ ## Organizing Your Knowledge (MEMORY.md)
71
76
 
72
- Over time you will discover which tools work best for specific situations. Record these preferences so you can make better tool choices automatically.
77
+ MEMORY.md is **your** knowledge base. You decide what sections to create and how to organize it. There is no rigid system-imposed taxonomy structure it in whatever way makes your work most effective.
73
78
 
74
- ### When to Update Tool Preferences
79
+ ### Common Section Patterns
75
80
 
76
- - You discover a tool is significantly better than another for a specific task type
77
- - You find optimal parameters or flags for a tool (e.g., `grep_search` with specific flags vs. `glob_find`)
78
- - You learn that a tool has limitations you should work around
79
- - A tool combination (pipeline) works well for a recurring need
81
+ | Section name | Example content |
82
+ |---|---|
83
+ | `conventions` | Coding standards, naming rules, review criteria for your projects |
84
+ | `procedures` | Step-by-step workflows for recurring tasks |
85
+ | `preferences` | Tool choices, flags, parameter settings that work well |
86
+ | `domain-knowledge` | Technical facts specific to your area of expertise |
87
+ | `evolution-log` | Chronological record of ROLE.md changes |
80
88
 
81
- ### How to Save Tool Preferences
82
-
83
- Use `memory_save` with:
89
+ You are not limited to these create whatever sections make sense for your work.
84
90
 
85
- - **type**: `"note"`
86
- - **content**:
87
- ```
88
- [TOOL-PREF] <one-line summary>
89
- Task: <what kind of task>
90
- Preferred: <tool and how to use it>
91
- Avoid: <what doesn't work well and why>
92
- Reason: <why this preference>
93
- ```
94
- - **tags**: `["lesson", "tool-preference", "<tool-name>"]`
91
+ ### How to Add Knowledge
95
92
 
96
- Periodically consolidate into long-term memory:
93
+ Use `memory_update_longterm` with `mode: "patch"` to append without overwriting:
97
94
 
98
95
  ```
99
96
  memory_update_longterm({
100
- section: "tool-preferences",
101
- content: "<list of tool preferences by task type>"
97
+ section: "procedures",
98
+ mode: "patch",
99
+ content: "### <Name>\nTrigger: <when to use>\nSteps:\n1. ...\n2. ...\nNotes: <gotchas>\nLast updated: <date>"
102
100
  })
103
101
  ```
104
102
 
105
- Format as a compact reference table your future self can quickly scan.
106
-
107
- ## Layer 3: SOPs (Standard Operating Procedures)
108
-
109
- When you find yourself repeatedly doing a multi-step process, document it as an SOP. When you later find a better way, update it.
110
-
111
- ### When to Create or Update an SOP
103
+ ### How to Update Existing Knowledge
112
104
 
113
- - You've done the same multi-step workflow 2+ times and want to standardize it
114
- - You found a significantly better sequence of steps for an existing SOP
115
- - A step in an existing SOP failed or was suboptimal, and you found a fix
116
- - **During heartbeat review**: You reviewed recently completed tasks and identified a repeatable pattern that led to successful outcomes (especially first-pass approvals)
117
-
118
- ### Extracting SOPs from Completed Tasks
119
-
120
- During each heartbeat, review your recently completed tasks to mine for SOP-worthy patterns:
121
-
122
- 1. **Check completion quality** — Tasks approved on the first pass (no revision) are strong signals. The approach you used is worth preserving.
123
- 2. **Identify the workflow** — What sequence of steps did you follow? Was there a specific order that mattered? What tools and techniques were critical?
124
- 3. **Generalize** — Strip task-specific details. Ask: "If I faced a similar class of problem, would these steps still work?"
125
- 4. **Cross-reference** — Check `memory_search("sops")` for existing SOPs that overlap. Update existing ones rather than creating duplicates.
126
- 5. **Save or update** — Use `memory_update_longterm({ section: "sops", ... })` with the full SOP set (including the new or updated one).
127
-
128
- Best practices that are too narrow for an SOP (single-step tips, one-liner rules) should be saved as lessons instead.
129
-
130
- ### How to Save SOPs
131
-
132
- Use `memory_update_longterm` with section `"sops"`:
105
+ Use `mode: "replace"` with the full updated section content (read existing first, modify, then write back):
133
106
 
134
107
  ```
135
108
  memory_update_longterm({
136
- section: "sops",
137
- content: "<all your SOPs>"
109
+ section: "procedures",
110
+ mode: "replace",
111
+ content: "<full updated section content>"
138
112
  })
139
113
  ```
140
114
 
141
- Format each SOP as:
115
+ ### Using Your Knowledge (Before Starting Work)
142
116
 
143
- ```
144
- ### SOP: <Name>
145
- Trigger: <when to use this SOP>
146
- Steps:
147
- 1. <step 1>
148
- 2. <step 2>
149
- ...
150
- Notes: <gotchas, tips, common failures>
151
- Last updated: <date>
152
- ```
117
+ Before starting a task, check your existing knowledge:
153
118
 
154
- Keep SOPs concise and actionable. Maximum 10 SOPs merge or retire outdated ones.
119
+ 1. **MEMORY.md** Your curated knowledge appears in the system context above as `## Your Knowledge`. Read and follow any procedures whose trigger matches.
120
+ 2. **Skills** — Use `discover_tools({ mode: "list_skills" })` to see available team skills. Activate relevant ones with `discover_tools({ name: ["skill-name"] })`.
121
+ 3. **Past experience** — Use `recall_activity` to query your execution history for relevant context.
155
122
 
156
- ## Layer 4: Role Evolution (ROLE.md)
123
+ Do not reinvent approaches you have already codified. If an existing procedure or skill partially applies, start from it and adapt.
157
124
 
158
- This is the deepest level of self-evolution. Your ROLE.md defines your core identity, system prompt, and behavioral guidelines. When you accumulate enough lessons and experience in a domain, you can evolve your own role definition.
125
+ ### Limits
159
126
 
160
- **Your ROLE.md path**: `{AGENT_DATA_DIR}/role/ROLE.md` (the system tells you your data directory in the workspace section of your context)
127
+ - Per-section: 3000 chars max
128
+ - Total MEMORY.md: 15000 chars max
129
+ - Merge or retire outdated entries when sections grow large
161
130
 
162
- ### When to Modify ROLE.md
131
+ ## Shareable Skills (Team Practices)
163
132
 
164
- Only modify your ROLE.md when ALL of these conditions are met:
133
+ When a practice would benefit **other agents on the team** (not just you), package it as an installable skill instead of a personal MEMORY.md entry.
165
134
 
166
- 1. **Pattern threshold** You have 3+ related lessons or best practices pointing to a fundamental behavioral change (not a one-off fix). Heartbeat task reviews are a primary source of these patterns.
167
- 2. **High confidence** — The change reflects proven experience from successfully completed tasks, not speculation
168
- 3. **Systemic impact** — The improvement would affect how you handle many future tasks, not just one type
169
- 4. **Not contradicting core role** — The change refines or extends your role, not contradicts it
135
+ ### Personal Knowledge vs Skill when to choose which
170
136
 
171
- **Heartbeat-driven role evolution**: During heartbeat, after reviewing completed tasks and extracting best practices, check if accumulated best practices (tagged `best-practice`) form a coherent behavioral guideline. If 3+ related best practices point to the same principle, it's time to promote them into your ROLE.md as a permanent behavioral guideline.
137
+ | Criterion | MEMORY.md entry | Skill |
138
+ |---|---|---|
139
+ | Who benefits | Only you | Multiple agents |
140
+ | Storage | MEMORY.md (your context) | Installable skill package |
141
+ | Visibility | Only in your prompt | Available to all agents after install |
142
+ | Examples | "How I deploy service X" | "Code review checklist", "Git workflow for this repo" |
172
143
 
173
- ### How to Modify ROLE.md
144
+ ### Before Creating Check First
174
145
 
175
- 1. First, read your current ROLE.md via `file_read`
176
- 2. Identify where the new guideline fits — append to existing sections or add a new section
177
- 3. Use `file_edit` to make a surgical change — never rewrite the entire file
178
- 4. Log the change in memory:
146
+ Before creating a new skill, check if one already exists:
147
+ 1. Run `discover_tools({ mode: "list_skills" })` to see all installed skills
148
+ 2. Run `builder_list` to see artifacts in builder-artifacts
149
+ 3. If a similar skill exists, **update it** instead of creating a new one
179
150
 
180
- ```
181
- memory_save({
182
- type: "note",
183
- content: "[ROLE-EVOLUTION] <summary of change>\nReason: <why this change>\nLessons: <which lessons led to this>\nChange: <what was added/modified in ROLE.md>",
184
- tags: ["lesson", "role-evolution"]
185
- })
186
- ```
151
+ ### How to Create and Install
187
152
 
188
- ### ROLE.md Evolution Rules
153
+ 1. Use the **skill-building** skill to create the package:
154
+ - Write `skill.json` manifest + `SKILL.md` instructions to `~/.markus/builder-artifacts/skills/{name}/`
155
+ 2. Install with `builder_install({ type: "skill", name: "{name}" })`
156
+ 3. Log the creation via `memory_save` with tags `["insight", "skill-created"]`
189
157
 
190
- - **APPEND, don't replace** Add new guidelines, don't remove existing ones unless they're clearly wrong
191
- - **Keep it concise** — Each new guideline should be 1-3 lines. ROLE.md should not grow beyond 200 lines
192
- - **Never touch the header** — The `# Role Name` and core identity section must stay intact
193
- - **Log every change** — Always save a `role-evolution` tagged memory entry explaining why
194
- - **One change at a time** — Don't batch multiple unrelated role changes
195
- - **Consolidate evolution history** periodically:
158
+ ### How to Update an Existing Skill
196
159
 
197
- ```
198
- memory_update_longterm({
199
- section: "role-evolution-log",
200
- content: "<chronological list of role changes and reasons>"
201
- })
202
- ```
160
+ 1. Edit the files in `~/.markus/builder-artifacts/skills/{name}/` (use `file_read` then `file_edit`)
161
+ 2. Bump the version in `skill.json` (e.g., `"1.0.0"` → `"1.1.0"`)
162
+ 3. Re-install with `builder_install({ type: "skill", name: "{name}" })` — this overwrites the old version and re-registers
163
+ 4. Log the update via `memory_save` with tags `["insight", "skill-updated"]`
164
+
165
+ Only create a skill when you are confident the practice is validated (proven across 2+ tasks) and genuinely useful for others.
166
+
167
+ ## Role Evolution (ROLE.md)
168
+
169
+ The deepest level. Modify ROLE.md only when ALL conditions are met:
170
+
171
+ 1. **Pattern threshold** — 3+ related insights pointing to a fundamental behavioral change
172
+ 2. **High confidence** — Proven by successfully completed tasks
173
+ 3. **Systemic impact** — Affects many future tasks
174
+ 4. **Not contradicting core role** — Refines or extends, doesn't contradict
203
175
 
204
- ## Using Past Experience
176
+ ### How to Modify
205
177
 
206
- Your past evolution data is available in two ways:
178
+ 1. Read current ROLE.md via `file_read`
179
+ 2. Append the new guideline (never rewrite the whole file)
180
+ 3. Use `file_edit` for surgical changes
181
+ 4. Log: `memory_save` with tags `["insight", "role-evolution"]`
207
182
 
208
- 1. **Automatic** — Your `lessons-learned`, `tool-preferences`, `sops`, and `role-evolution-log` sections in MEMORY.md appear in your system context every session.
209
- 2. **On-demand** — Use `memory_search` with relevant keywords to find specific past lessons.
183
+ ## Quality Signal
210
184
 
211
- Before starting a task, briefly review relevant sections. This takes seconds and prevents repeating mistakes.
185
+ During heartbeat, check your revision rate:
186
+ - Tasks with `executionRound > 1` required revision
187
+ - High revision rate (>30%) means your knowledge isn't being applied effectively
188
+ - Check if saved insights cover the failure patterns you see
189
+ - Escalate recurring mistakes: insight → MEMORY.md procedure → role update
212
190
 
213
191
  ## Rules
214
192
 
215
- - **DO NOT** skip reflection when the system prompts you after a task revision.
216
- - **DO NOT** save trivial or non-generalizable lessons.
217
- - **DO NOT** let any long-term memory section grow unbounded. Limits: lessons-learned (20), tool-preferences (15), SOPs (10), role-evolution-log (20).
218
- - **DO NOT** modify ROLE.md for one-off situations only for proven patterns.
219
- - **DO** save lessons immediately when a correction happens, while context is fresh.
220
- - **DO** include specific, actionable advice. "Be more careful" is useless. "Always validate input schema before processing" is useful.
221
- - **DO** use tags consistently so lessons are discoverable via search.
222
- - **DO** periodically prune and consolidate each memory section to keep it current.
193
+ - **DO** save insights immediately while context is fresh
194
+ - **DO** include specific, actionable advice ("Always validate input schema before processing" > "Be more careful")
195
+ - **DO** use tags consistently for discoverability
196
+ - **DO** use `mode: "patch"` when adding to MEMORY.md sections
197
+ - **DO NOT** save trivial or non-generalizable observations
198
+ - **DO NOT** let MEMORY.md sections grow unbounded merge or prune regularly
199
+ - **DO NOT** modify ROLE.md for one-off situations
200
+ - **DO NOT** skip reflection when the system prompts you after a task revision
@@ -3,7 +3,7 @@
3
3
  "name": "self-evolution",
4
4
  "displayName": "Self-Evolution",
5
5
  "version": "1.0.0",
6
- "description": "Learn from mistakes, corrections, and successful strategies extract lessons and persist them as structured memories for future retrieval",
6
+ "description": "Learn from experience capture lessons, evolve SOPs, share best practices as skills, and refine your role over time",
7
7
  "author": "markus",
8
8
  "category": "productivity",
9
9
  "tags": ["learning", "reflection", "memory", "self-improvement", "evolution"],