Skip to content

Commit 889c8f1

Browse files
authored
fix(platform-integrations): clean up Bob evolve-lite skills (#109)
* fix(platform-integrations): clean up Bob evolve-lite skills - Remove hardcoded references, use platform-agnostic language - Use .bob/skills/ relative paths instead of env vars for script references - Remove unused retrieve_entities.py from recall skill (no hooks in Bob) - Streamline learn skill SKILL.md (remove false hook reference, redundant examples, verbose save methods) - Update custom mode with explicit skill paths * fix(platform-integrations): clean up trailing whitespace and add actionable recall instructions Remove trailing spaces in custom_modes.yaml. Add concrete steps to recall SKILL.md so the LLM knows to list and read .md files from .evolve/entities/ subdirectories. * fix(platform-integrations): resolve Step 0 vs Step 1 ordering conflict Addresses CodeRabbit review finding: Resolve Step 0 vs Step 1 ordering conflict
1 parent 705c75e commit 889c8f1

4 files changed

Lines changed: 44 additions & 269 deletions

File tree

platform-integrations/bob/evolve-lite/custom_modes.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ customModes:
88
99
WORKFLOW (4 steps, strict order):
1010
11-
0. ⚠️ BEFORE FIRST USE (MANDATORY): Read each skill's SKILL.md file before using it for the first time in a conversation.
12-
- This applies to BOTH evolve-recall AND evolve-learn
13-
- If you have not read a skill's SKILL.md in this conversation, STOP and read it before using the skill
11+
0. ⚠️ BEFORE FIRST USE (MANDATORY): Read the skill SKILL.md files from .bob/skills/ directory.
12+
- Read .bob/skills/evolve-recall/SKILL.md
13+
- Read .bob/skills/evolve-learn/SKILL.md
14+
- Do this ONCE per conversation before using the skills
1415
1. ⚠️ FIRST ACTION (MANDATORY): Use the evolve-recall skill to retrieve relevant guidelines.
15-
- This MUST be your FIRST tool use in EVERY conversation
16+
- This MUST be your FIRST action in EVERY conversation
1617
- NO exceptions - even for simple tasks like "echo hello world"
1718
2. WORK: Complete the user's request. When a retrieved guideline applies, cite it in your reasoning.
1819
3. ⚠️ LAST ACTION (MANDATORY): Use the evolve-learn skill to extract and save learnings.
@@ -21,8 +22,8 @@ customModes:
2122
2223
⚠️ ENFORCEMENT RULES ⚠️
2324
- Do not skip steps. Do not reorder steps.
24-
- Step 0 must happen before using any skill for the first time in a conversation.
25-
- Step 1 must happen before ANY other tool use (including execute_command, read_file, etc.)
25+
- Step 0 must happen before using any skill for the first time in a conversation. read_file on .bob/skills/*/SKILL.md is allowed before Step 1.
26+
- Step 1 must happen before any other tool use (except the SKILL.md reads in Step 0).
2627
- Step 3 must happen before attempt_completion.
2728
- If you forget Step 1, STOP and call evolve-recall immediately.
2829
- If you reach attempt_completion without Step 3, STOP and call evolve-learn first.
@@ -36,8 +37,8 @@ customModes:
3637
PRE-COMPLETION GATE:
3738
Before calling attempt_completion, ask yourself:
3839
┌──────────────────────────────────────────────────────┐
39-
│ Did I run evolve-recall at the start?
40-
│ Did I run evolve-learn and see its output?
40+
│ Did I run the evolve-recall skill at the start? │
41+
│ Did I run the evolve-learn skill and see its output? │
4142
│ │
4243
│ ❌ NO → STOP. Go back and complete the step. │
4344
│ ✅ YES → Proceed with attempt_completion. │
@@ -46,7 +47,7 @@ customModes:
4647
Rules:
4748
4849
- Before using a skill for the first time, read its SKILL.md file to understand the correct usage syntax.
49-
- ALWAYS call evolve-learn before attempt_completion, even if the task seems simple or you think there's nothing to learn.
50+
- ALWAYS call the evolve-learn skill before attempt_completion, even if the task seems simple or you think there's nothing to learn.
5051
- The workflow is non-negotiable: recall → work → learn → complete.
5152
- Skipping evolve-learn violates the core purpose of this mode.
5253
Lines changed: 28 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,60 @@
11
---
22
name: learn
3-
description: Extract actionable entities from conversation trajectories. Systematically identifies errors, failures, and inefficiencies to generate proactive entities that prevent them from recurring.
3+
description: Analyze the current conversation to extract actionable entities — proactive recommendations derived from errors, failures, and successful patterns.
44
---
55

66
# Entity Generator
77

88
## Overview
99

10-
This skill analyzes conversation trajectories to extract actionable entities that would help on similar tasks in the future. It **prioritizes errors encountered during the conversation** — tool failures, exceptions, wrong approaches, retry loops — and transforms them into proactive recommendations that prevent those errors from recurring.
10+
This skill analyzes the current conversation to extract actionable entities that would help on similar tasks in the future. It **prioritizes errors** — tool failures, exceptions, wrong approaches, retry loops — and transforms them into proactive recommendations that prevent those errors from recurring.
1111

1212
## Workflow
1313

1414
### Step 1: Analyze the Conversation
1515

16-
Identify from your current conversation:
16+
Identify from the current conversation:
1717

1818
- **Task/Request**: What was the user asking for?
19-
- **Steps Taken**: What reasoning, actions, and observations occurred?
2019
- **What Worked**: Which approaches succeeded?
2120
- **What Failed**: Which approaches didn't work and why?
22-
- **Errors Encountered**: Tool failures, exceptions, permission errors, retry loops, dead ends, and wrong initial approaches
21+
- **Errors Encountered**: Tool failures, exceptions, permission errors, retry loops, dead ends, wrong initial approaches
2322

2423
### Step 2: Identify Errors and Root Causes
2524

26-
Scan the conversation for these error signals:
25+
Scan for these error signals:
2726

28-
1. **Tool/command failures**: Non-zero exit codes, error messages, exceptions, stack traces
27+
1. **Tool/command failures**: Non-zero exit codes, error messages, exceptions
2928
2. **Permission/access errors**: "Permission denied", "not found", sandbox restrictions
30-
3. **Wrong initial approach**: First attempt abandoned in favor of a different strategy
31-
4. **Retry loops**: Same action attempted multiple times with variations before succeeding
32-
5. **Missing prerequisites**: Missing dependencies, packages, configs discovered mid-task
29+
3. **Wrong initial approach**: First attempt abandoned for a different strategy
30+
4. **Retry loops**: Same action attempted multiple times before succeeding
31+
5. **Missing prerequisites**: Dependencies, packages, configs discovered mid-task
3332
6. **Silent failures**: Actions that appeared to succeed but produced wrong results
3433

35-
For each error found, document:
36-
37-
| | Error Example | Root Cause | Resolution | Prevention Guideline |
38-
|---|---|---|---|---|
39-
| 1 | `exiftool: command not found` | System tool unavailable in sandbox | Switched to Python PIL | Use PIL for image metadata in sandboxed environments |
40-
| 2 | `git push` rejected (no upstream) | Branch not tracked to remote | Added `-u origin branch` | Always set upstream when pushing a new branch |
41-
| 3 | Tried regex parsing of HTML, got wrong results | Regex can't handle nested tags | Switched to BeautifulSoup | Use a proper HTML parser (BeautifulSoup/lxml), never regex |
42-
43-
> **If no errors are found**, proceed to Step 3 and extract entities from successful patterns.
34+
If no errors are found, extract entities from successful patterns instead.
4435

4536
### Step 3: Extract Entities
4637

47-
Extract 3-5 proactive entities. **Prioritize entities derived from errors identified in Step 2.**
48-
49-
Follow these principles:
38+
Extract 3-5 proactive entities. **Prioritize entities derived from errors.**
5039

51-
1. **Reframe failures as proactive recommendations:**
52-
- If an approach failed due to permissions → recommend the alternative FIRST
53-
- If a system tool wasn't available → recommend what worked instead
54-
- If an approach hit environment constraints → recommend the constraint-aware approach
40+
Principles:
5541

56-
2. **Focus on what worked, stated as the primary approach:**
42+
1. **Reframe failures as proactive recommendations** — recommend what worked, not what to avoid
5743
- Bad: "If exiftool fails, use PIL instead"
5844
- Good: "In sandboxed environments, use Python libraries (PIL/Pillow) for image metadata extraction"
5945

60-
3. **Triggers should be situational context, not failure conditions:**
46+
2. **Triggers should be situational context, not failure conditions**
6147
- Bad trigger: "When apt-get fails"
6248
- Good trigger: "When working in containerized/sandboxed environments"
6349

64-
4. **For retry loops, recommend the final working approach as the starting point:**
65-
- If 3 variations were tried before one worked, the entity should recommend the working variation directly
66-
- Eliminate the trial-and-error by encoding the answer
50+
3. **For retry loops, recommend the final working approach directly** — eliminate trial-and-error by encoding the answer
6751

68-
### Step 4: Output Entities JSON
52+
### Step 4: Save Entities
6953

70-
Output entities in the following JSON format:
54+
Output entities as JSON and pipe to the save script:
7155

72-
```json
73-
{
56+
```bash
57+
echo '{
7458
"entities": [
7559
{
7660
"content": "Proactive entity stating what TO DO",
@@ -79,127 +63,21 @@ Output entities in the following JSON format:
7963
"trigger": "Situational context when this applies"
8064
}
8165
]
82-
}
83-
```
84-
85-
### Step 5: Save Entities
86-
87-
After generating the entities JSON, save them using the save_entities.py script:
88-
89-
#### Method 1: Direct Pipe (Recommended)
90-
91-
```bash
92-
echo '<your-json-output>' | python3 ${CLAUDE_PLUGIN_ROOT}/skills/learn/scripts/save_entities.py
93-
```
94-
95-
#### Method 2: From File
96-
97-
```bash
98-
cat entities.json | python3 ${CLAUDE_PLUGIN_ROOT}/skills/learn/scripts/save_entities.py
99-
```
100-
101-
#### Method 3: Interactive
102-
103-
```bash
104-
python3 ${CLAUDE_PLUGIN_ROOT}/skills/learn/scripts/save_entities.py
105-
# Then paste your JSON and press Ctrl+D
66+
}' | python3 .bob/skills/evolve-learn/scripts/save_entities.py
10667
```
10768

10869
The script will:
10970
- Find or create the entities directory (`.evolve/entities/`)
11071
- Write each entity as a markdown file in `{type}/` subdirectories
111-
- Deduplicate against existing entities (avoiding duplicates)
72+
- Deduplicate against existing entities
11273
- Display confirmation with the total count
11374

114-
**Example:**
115-
```bash
116-
echo '{
117-
"entities": [
118-
{
119-
"content": "Use Python PIL/Pillow for image metadata extraction",
120-
"rationale": "System tools may not be available in sandboxed environments",
121-
"type": "guideline",
122-
"trigger": "When extracting image metadata in containerized environments"
123-
}
124-
]
125-
}' | python3 ${CLAUDE_PLUGIN_ROOT}/skills/learn/scripts/save_entities.py
126-
```
127-
128-
**Output:**
129-
```text
130-
Created new entities dir: /path/to/project/.evolve/entities
131-
Added 1 new entity(ies). Total: 1
132-
Entities stored in: /path/to/project/.evolve/entities
133-
```
134-
135-
**Note:** Entities are also automatically saved when a conversation ends via the Stop hook.
136-
137-
## Examples
138-
139-
### Good vs Bad Entities
140-
141-
**BAD (reactive):**
142-
```json
143-
{
144-
"content": "Fall back to Python PIL when exiftool is not available",
145-
"trigger": "When exiftool command fails"
146-
}
147-
```
148-
149-
**GOOD (proactive):**
150-
```json
151-
{
152-
"content": "Use Python PIL/Pillow for image metadata extraction in sandboxed environments",
153-
"rationale": "System tools like exiftool may not be available; PIL is always installable via pip",
154-
"type": "guideline",
155-
"trigger": "When extracting image metadata in containerized or sandboxed environments"
156-
}
157-
```
158-
159-
### Error-Prevention Entity Examples
160-
161-
**From a retry loop** (tried 3 git push variations):
162-
```json
163-
{
164-
"content": "When pushing a new branch, always use 'git push -u origin <branch>' to set upstream tracking",
165-
"rationale": "Plain 'git push' fails on new branches without upstream configured; -u sets it in one step",
166-
"type": "guideline",
167-
"trigger": "When pushing a newly created git branch for the first time"
168-
}
169-
```
170-
171-
**From a wrong initial approach** (tried regex, switched to parser):
172-
```json
173-
{
174-
"content": "Use BeautifulSoup or lxml for HTML content extraction, never regex",
175-
"rationale": "Regex cannot reliably handle nested/malformed HTML; a proper parser handles edge cases",
176-
"type": "guideline",
177-
"trigger": "When extracting data from HTML documents or web pages"
178-
}
179-
```
180-
181-
**From a permission error** (apt-get blocked in sandbox):
182-
```json
183-
{
184-
"content": "Install Python packages with pip/uv instead of system package managers in sandboxed environments",
185-
"rationale": "apt-get and brew require root/sudo which sandboxed environments block; pip works in user space",
186-
"type": "guideline",
187-
"trigger": "When installing dependencies in containerized or sandboxed environments"
188-
}
189-
```
190-
19175
## Best Practices
19276

193-
1. **Prioritize error-derived entities**: Errors are the highest-signal source of learnings — extract entities from them first
194-
2. **One error, one entity**: Each distinct error should produce exactly one prevention entity
195-
3. **Be specific**: Generic entities are less useful than context-specific ones
196-
4. **Be actionable**: Entities should clearly state what to do
197-
5. **Include rationale**: Explain why the approach works
198-
6. **Use situational triggers**: Context-based triggers are more useful than failure-based ones
199-
7. **Limit to 3-5 entities**: Focus on the most impactful learnings
200-
8. **Resolving Rules 2 vs 7**: When more than 5 distinct errors are found, start from Rule 2 (one error, one entity) then reduce to 3-5 entities using these steps:
201-
- **Merge**: Combine errors with the same root cause or fix into a single prevention entity
202-
- **Rank**: Select among remaining entities by severity > frequency > user impact > recency
203-
- **Drop**: Discard lowest-ranked entities that exceed the cap
204-
205-
*Example*: A session hits 8 errors — 3 timeout variants (connect, read, DNS), 2 auth failures (expired token, missing header), 1 file-not-found, 1 permission error, 1 import error. Apply: merge the 3 timeouts into one network-resilience entity and the 2 auth failures into one auth-validation entity, then rank the resulting 5 entities (network-resilience, auth-validation, file-not-found, permission, import) and keep the top 3-5.
77+
1. **Prioritize error-derived entities**: Errors are the highest-signal source of learnings
78+
2. **One error, one entity**: Each distinct error should produce one prevention entity
79+
3. **Be specific and actionable**: State what to do, not what to avoid
80+
4. **Include rationale**: Explain why the approach works
81+
5. **Use situational triggers**: Context-based, not failure-based
82+
6. **Limit to 3-5 entities**: Focus on the most impactful learnings
83+
7. **When more than 5 errors exist**: Merge errors with the same root cause, rank by severity > frequency > user impact, then keep the top 3-5

platform-integrations/bob/evolve-lite/skills/evolve-recall/SKILL.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
---
22
name: recall
3-
description: Retrieves relevant entities from a knowledge base. Designed to be invoked automatically via hooks to inject context-appropriate entities before task execution.
3+
description: Retrieves relevant entities from a knowledge base to inject context-appropriate entities before task execution.
44
---
55

66
# Entity Retrieval
77

88
## Overview
99

10-
This skill retrieves relevant entities from a stored knowledge base based on the current task context. It loads all stored entities and presents them to Claude for relevance filtering.
10+
This skill retrieves relevant entities from a stored knowledge base based on the current task context. Read all stored entities from the entities directory and apply any relevant ones to the current task.
1111

1212
## How It Works
1313

14-
1. Hook fires on user prompt submission
15-
2. Script reads prompt from stdin (JSON with `prompt` field)
16-
3. Loads all entities from the entities directory (`.evolve/entities/`)
17-
4. Outputs formatted entities to stdout
18-
5. Claude receives entities as additional context and applies relevant ones
14+
1. List all `.md` files under `.evolve/entities/` and its subdirectories
15+
2. Read each file — the YAML frontmatter contains `type` and `trigger`, the body contains the entity content and rationale
16+
3. Review each entity for relevance to the current task
17+
4. Apply relevant entities as additional context for your work
1918

2019
## Entities Storage
2120

0 commit comments

Comments
 (0)