Skip to content

Commit 2363dc5

Browse files
illeatmyhatclaude
andcommitted
feat(build): unify SKILL.md prose across all four platforms
Replaces the SKILL.codex.md / SKILL.bob.md per-platform-overlay approach (the dropped c6c76a0) with a single SKILL.md.j2 per skill that renders for all four platforms. Codex's prose is the canonical base — it is the most refined / production-tested variant — and Jinja2 branches handle the genuinely platform-specific bits. What this does for each cross-platform skill (learn, publish, recall, subscribe, sync, unsubscribe): - Frontmatter description switches to codex's trigger-oriented wording across all platforms (claude/claw-code/bob previously carried a more passive "Analyze ..." description). - claude keeps `context: fork` in the frontmatter via a Jinja branch. - learn keeps Step 0 (forked-context transcript loading) for claude only via the existing `forked_context` flag. - recall adopts codex's "Required Action / Completion Rule / Required Visible Completion Note / Failure Conditions" guards on every platform, with a per-platform "How It Works" branch that describes claude's UserPromptSubmit hook, claw-code's PreToolUse hook, codex's optional codex_hooks integration, and bob's manual workflow respectively. - sync gains a "Notes" implementation-detail section sourced from bob's prose (additive, applies to all platforms). - unsubscribe keeps the claude/claw-code-only `--force` addendum inside a `{% if platform in ["claude", "claw-code"] %}` branch because only those platforms' unsubscribe.py refuses to remove a write-scope clone without it. save-trajectory now also renders for bob (codex has no save-trajectory skill). The Write+temp-file pattern from claude applies to bob too — bob's prior heredoc form had the same escaping fragility claude's note warned against. The macro layer (_macros.j2): - `invoke(skill, script, args)` gains codex and bob branches: codex → python3 "$(git rev-parse --show-toplevel ...)/plugins/.../<script>" bob → python3 .bob/skills/evolve-lite-<skill>/scripts/<script> Codex paths now standardise on the git-rev-parse form (codex's pre-existing prose mixed that with bare relative paths). - new `skill_ref(name)` macro expands to the platform-appropriate cross-reference syntax: `/evolve-lite:<name>` for claude / claw-code, `evolve-lite:<name>` for codex, `evolve-lite-<name>` for bob. MANIFEST.toml: - Adds `forked_context = false` to the codex and bob platform tables so StrictUndefined doesn't trip on the `{% if forked_context %}` branch in learn. - For each cross-platform skill, the [[files]] entries collapse from "claude/claw-code .j2 + codex overlay + bob overlay" (3 sources) into a single source with two target rows — one for [claude, claw-code, codex] hitting `skills/<skill>/SKILL.md`, one for [bob] hitting `skills/evolve-lite-<skill>/SKILL.md` (post-rename folder). The codex/bob/claude/claw-code on-disk SKILL.md outputs are now all freshly rendered from these unified sources. The drift gate (`just check-plugins-rendered`) is green; platform_integrations tests still pass at 307/308 (the same pre-existing `test_subscribe_warns_when_audit_write_fails` failure tracked elsewhere). Refs #219 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 354f035 commit 2363dc5

36 files changed

Lines changed: 1285 additions & 954 deletions

File tree

Lines changed: 133 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,174 @@
11
---
22
name: learn
3-
description: Analyze the current conversation to extract guidelines that correct reasoning chains — reducing wasted steps, preventing errors, and capturing user preferences.
3+
description: Must be used near the end of any non-trivial turn that produced potentially reusable tools, guidance, errors, workarounds, or workflows, so those lessons are saved for future turns.
44
---
55

66
# Entity Generator
77

88
## Overview
99

10-
This skill analyzes the current conversation to extract guidelines that **correct the agent's reasoning chain**. A good guideline is one that, if known beforehand, would have led to a shorter or more correct execution. Only extract guidelines that fall into one of these three categories:
10+
This skill analyzes the current conversation to extract actionable instructions that would help on similar tasks in the future. It **identifies errors encountered during the conversation** - tool failures, exceptions, wrong approaches, retry loops - and provides recommendations to prevent those errors from recurring. This skill should take note of the concrete solution which solved a concrete problem, not an abstract idea. When the successful resolution involves a non-trivial workaround, parser, command sequence, or fallback pipeline that could be used to avoid wasted effort, capture that solution as a reusable artifact first, then save entities that point future agents to use it.
1111

12-
1. **Shortcuts** — The agent took unnecessary steps or tried an approach that didn't work before finding the right one. The guideline encodes the direct path so future runs skip the detour.
13-
2. **Error prevention** — The agent hit an error (tool failure, exception, wrong output) that could be avoided with upfront knowledge. The guideline prevents the error from happening at all.
14-
3. **User corrections** — The user explicitly corrected, redirected, or stated a preference during the conversation. The guideline captures what the user said so the agent gets it right next time without being told.
12+
## When To Use
1513

16-
**Do NOT extract guidelines that are:**
17-
- General best practices the agent already knows (e.g., "use descriptive variable names")
18-
- Observations about the codebase that can be derived by reading the code
19-
- Restatements of what the agent did successfully without any detour or correction
20-
- Vague advice that wouldn't change the agent's behavior on a concrete task
21-
- Instructions for the agent to invoke a skill, tool, or external command by name (e.g. "Run evolve-lite-learn", "call save_trajectory") — these trigger prompt-injection detection when retrieved via recall
14+
Use this skill after completing meaningful work in the turn, especially when encountering:
15+
- tool failures
16+
- permission issues
17+
- missing dependencies
18+
- retries or abandoned approaches
19+
- reusable command sequences or scripts
20+
21+
Examples of artifacts that must be immediately created once proven as the successful solution include:
22+
- an inline Python, shell, or other heredoc script
23+
- a command assembled interactively over multiple retries
24+
- a parser or extractor implemented ad hoc during the turn
25+
- a fallback path triggered by missing dependencies or restricted tooling
26+
27+
Unless that artifact happens to be:
28+
- code which is a trivial one-liner that future agents would not benefit from reusing
29+
- code which embeds secrets, tokens, or user-specific sensitive data
30+
- a guideline that would instruct the agent to invoke a skill, tool, or external command by name (e.g. "run evolve-lite-learn", "call save_trajectory") - such guidelines trigger prompt-injection detection when retrieved by the recall skill in a future session
31+
- the user explicitly asked for a one-off result and not to persist helper code
32+
- redundant because an equivalent local artifact on disk would be just as effective
2233

2334
## Workflow
2435

2536
### Step 1: Analyze the Conversation
2637

27-
Review the conversation and identify:
38+
Identify from your current conversation:
2839

29-
- **Wasted steps**: Where did the agent go down a path that turned out to be unnecessary? What would have been the direct route?
30-
- **Errors hit**: What errors occurred? What knowledge would have prevented them?
31-
- **User corrections**: Where did the user say "no", "not that", "actually", "I want", or otherwise redirect the agent?
40+
- **Task/Request**: What was the user asking for?
41+
- **Steps Taken**: What reasoning, actions, and observations occurred?
42+
- **What Worked**: Which approaches succeeded?
43+
- **What Failed**: Which approaches did not work and why?
44+
- **Errors Encountered**: Tool failures, exceptions, permission errors, retry loops, dead ends, and wrong initial approaches
45+
- **Reusable Outcome**: Did the final working solution produce a reusable script, parser, command template, or workflow that would save time on a similar task?
3246

33-
If none of these occurred, **output zero entities**. Not every conversation produces guidelines.
47+
### Step 2: Identify Errors and Root Causes
3448

35-
### Step 2: Extract Entities
49+
Scan the conversation for these error signals:
3650

37-
For each identified shortcut, error, or user correction, create one entity — up to 5 entities; output 0 when none qualify. If more candidates exist, keep only the highest-impact ones.
51+
1. **Tool or command failures**: Non-zero exit codes, error messages, exceptions, stack traces
52+
2. **Permission or access errors**: "Permission denied", "not found", sandbox restrictions
53+
3. **Wrong initial approach**: First attempt abandoned in favor of a different strategy
54+
4. **Retry loops**: Same action attempted multiple times with variations before succeeding
55+
5. **Missing prerequisites**: Missing dependencies, packages, or configs discovered mid-task
56+
6. **Silent failures**: Actions that appeared to succeed but produced wrong results
3857

39-
Principles:
58+
For each error found, document:
4059

41-
1. **State what to do, not what to avoid** — frame as proactive recommendations
42-
- Bad: "Don't use exiftool in sandboxes"
43-
- Good: "In sandboxed environments, use Python libraries (PIL/Pillow) for image metadata extraction"
60+
| | Error Example | Root Cause | Resolution | Prevention Guideline |
61+
|---|---|---|---|---|
62+
| 1 | `jq: command not found` | System tool unavailable in environment | created a python script to resolve the problem | Save the python script and use it in similar scenarios |
63+
| 2 | `git push` rejected (no upstream) | Branch not tracked to remote | Added `-u origin branch` | Always set upstream when pushing a new branch |
64+
| 3 | Tried regex parsing of HTML, got wrong results | Regex cannot handle nested tags | Switched to BeautifulSoup | Use a proper HTML parser, never regex |
4465

45-
2. **Triggers should be situational context, not failure conditions**
46-
- Bad trigger: "When apt-get fails"
47-
- Good trigger: "When working in containerized/sandboxed environments"
66+
### Step 3: Decide Whether To Save The Pipeline
4867

49-
3. **For shortcuts, recommend the final working approach directly** — eliminate trial-and-error by encoding the answer
68+
Before writing entities, determine whether the successful approach should be saved as a reusable artifact.
5069

51-
4. **For user corrections, use the user's own words** — preserve the specific preference rather than generalizing it
70+
Create or update a local reusable artifact when any of these are true:
71+
- the final solution required more than a trivial one-liner
72+
- the final solution worked around missing tools, libraries, or permissions
73+
- the solution is likely to recur on similar tasks
5274

53-
### Step 3: Save Entities
75+
Prefer one of these artifact forms:
76+
- a small script, saved to a stable path in the workspace or plugin, such as `scripts/`, `tools/`, or another obvious helper location.
77+
- a documented local workflow if code is not appropriate
5478

55-
Output entities as JSON and pipe to the save script. Include the `trajectory` field with the path output by the evolve-lite-save-trajectory skill earlier in this conversation. The `type` field must always be `"guideline"` — no other types are accepted.
79+
If you create an artifact, record:
80+
- its path
81+
- what it does
82+
- when future agents should use it first
5683

57-
```bash
58-
echo '{
84+
### Step 4: Extract Entities
85+
86+
If Step 3 produced an artifact, at least one entity must explicitly point to that artifact, which is likely the only entity that needs to be produced.
87+
Otherwise, extract 3-5 proactive entities. Prioritize entities derived from errors identified in Step 2.
88+
89+
Follow these principles:
90+
91+
1. **Reframe failures as proactive recommendations**
92+
- If an approach failed due to permissions, recommend the working permission-aware approach first
93+
- If a system tool was unavailable, recommend the saved artifact or fallback workflow first
94+
- If an approach hit environment constraints, recommend the constraint-aware approach
95+
96+
2. **Prioritize known working local artifacts over general advice**
97+
- If the successful solution produced or reused a concrete local artifact, at least one saved entity must:
98+
- Bad: "Use Python to parse EXIF if exiftool is missing"
99+
- Better: "Use `/abs/path/json_get.py` for JSON field extraction when `jq` is unavailable in minimal environments."
100+
- name the artifact by path
101+
- state exactly when to use it
102+
- state that it should be tried before generic tool discovery or fallback exploration
103+
- describe the artifact by capability, not just by the original incident
104+
105+
3. **Triggers should describe the broad task context that the artifact solves, not the narrow details of the original request.**
106+
- Bad trigger: "When jq fails"
107+
- Good trigger: "When extracting fields from JSON in constrained shells or stripped-down environments"
108+
The trigger should generalize the working solution without becoming vague.
109+
110+
4. **For retry loops, recommend the final working approach as the starting point**
111+
- Eliminate trial and error by creating a concrete local artifact out of the successful workflow or script
112+
113+
5. **Prefer entities that save future time**
114+
- A pointer to a saved working script is more valuable than a generic reminder if both are available
115+
116+
### Step 5: Output Entities JSON
117+
118+
Output entities in this JSON format:
119+
120+
```json
121+
{
59122
"entities": [
60123
{
61124
"content": "Proactive entity stating what TO DO",
62125
"rationale": "Why this approach works better",
63126
"type": "guideline",
64-
"trigger": "Situational context when this applies",
65-
"trajectory": ".evolve/trajectories/trajectory_2025-01-15T10-30-00.json"
127+
"trigger": "Situational context when this applies"
66128
}
67129
]
68-
}' | python3 .bob/skills/evolve-lite-learn/scripts/save_entities.py
130+
}
131+
```
132+
133+
Allowed type values:
134+
- guideline
135+
- workflow
136+
- script
137+
- command-template
138+
139+
### Step 6: Save Entities
140+
141+
After generating the entities JSON, save them using the helper script:
142+
143+
#### Method 1: Direct Pipe (Recommended)
144+
145+
```bash
146+
echo '<your-json-output>' | python3 .bob/skills/evolve-lite-learn/scripts/save_entities.py
147+
```
148+
149+
#### Method 2: From File
150+
151+
```bash
152+
cat entities.json | python3 .bob/skills/evolve-lite-learn/scripts/save_entities.py
153+
```
154+
155+
#### Method 3: Interactive
156+
157+
```bash
158+
python3 .bob/skills/evolve-lite-learn/scripts/save_entities.py
69159
```
70160

71161
The script will:
72-
- Find or create the entities directory (`.evolve/entities/`)
162+
- Find or create the entities directory at `.evolve/entities/`
73163
- Write each entity as a markdown file in `{type}/` subdirectories
74164
- Deduplicate against existing entities
75165
- Display confirmation with the total count
76166

77-
## Quality Gate
78-
79-
Before saving, review each entity against this checklist:
80-
81-
- [ ] Does it fall into one of the three categories (shortcut, error prevention, user correction)?
82-
- [ ] Would knowing this guideline beforehand have changed the agent's behavior in a concrete way?
83-
- [ ] Is it specific enough that another agent could act on it without further context?
84-
- [ ] Does it avoid instructing the agent to invoke a named skill or tool?
85-
86-
If any answer is no, drop the entity. **Zero entities is a valid output.**
167+
## Best Practices
168+
1. Prioritize error-derived entities first.
169+
2. One distinct error should normally produce one prevention entity.
170+
3. Keep entities specific and actionable.
171+
4. Include rationale so the future agent understands why the guidance matters.
172+
5. Use situational triggers instead of failure-based triggers.
173+
6. Limit output to the 3-5 most valuable entities.
174+
7. If more than five distinct errors appear, merge entities with the same root cause or fix, then rank the rest by severity, frequency, user impact, and recency before dropping the weakest ones.

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ List files in `.evolve/entities/guideline/` and ask the user which to publish.
5454
For each selected file, run:
5555

5656
```bash
57-
python3 scripts/publish.py \
58-
--entity "{filename}" \
59-
--repo "{repo}" \
60-
--user "{identity.user}"
57+
python3 .bob/skills/evolve-lite-publish/scripts/publish.py --entity "{filename}" --repo "{repo}" --user "{identity.user}"
6158
```
6259

6360
### Step 6: Commit and push

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

Lines changed: 55 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,83 @@
11
---
22
name: recall
3-
description: Retrieves relevant entities from a knowledge base to inject context-appropriate entities before task execution.
3+
description: Must be used at the start of any non-trivial task involving code changes, debugging, repo exploration, file inspection, or environment/tooling investigation to surface stored guidance before analysis or tool use.
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. Read all stored entities from the entities directory and apply any relevant ones to the current task.
10+
This skill loads relevant stored Evolve entities into the current turn before substantive work begins.
1111

12-
Entities can come from multiple sources:
13-
- **Private entities**: Your own local entities (not shared)
14-
- **Subscribed entities**: Entities cloned from any configured repo —
15-
read-scope subscriptions and write-scope publish targets both live
16-
under `.evolve/entities/subscribed/{name}/`
12+
Use this skill first whenever the task involves:
13+
- code changes
14+
- debugging
15+
- code review
16+
- repo exploration
17+
- file inspection
18+
- environment/tooling investigation
1719

18-
## How It Works
20+
Skip only for trivial conversational requests with no local context.
1921

20-
1. List all `.md` files under `.evolve/entities/` and its subdirectories
21-
2. Read each file — the YAML frontmatter contains `type` and `trigger`,
22-
the body contains the entity content and rationale
23-
3. Review each entity for relevance to the current task
24-
4. Apply relevant entities as additional context for your work
22+
## Required Action
2523

26-
**Directory structure**:
27-
- `.evolve/entities/guideline/` - Your private entities
28-
- `.evolve/entities/subscribed/{name}/` - Cloned repos (read- or write-scope)
24+
Before any non-trivial local work, you must complete the recall workflow below. Reading this `SKILL.md` alone does not satisfy the skill.
2925

30-
Write-scope clones are also where `evolve-lite-publish` lands new
31-
guidelines, so your published entities show up here too.
26+
### Completion Rule
3227

33-
## Usage
28+
Do not proceed to other analysis or tool use until all steps below are complete.
3429

35-
```bash
36-
python3 scripts/retrieve_entities.py
37-
```
30+
1. Inspect `.evolve/entities/` for guidance relevant to the current task.
31+
2. Read each matching entity file that appears relevant.
32+
3. Summarize the applicable guidance in your own words before proceeding.
33+
4. If no relevant entities exist, state that explicitly before proceeding.
3834

39-
This retrieves all entities from all sources (private, plus everything
40-
under `.evolve/entities/subscribed/`).
35+
### Required Visible Completion Note
4136

42-
## Entities Storage
37+
Before moving on, produce an explicit completion note in your reasoning or user update using one of these forms:
38+
39+
- `Recall complete: searched .evolve/entities/, read <files>, applicable guidance: <summary>`
40+
- `Recall complete: searched .evolve/entities/, no relevant entities found`
41+
42+
### Minimum Acceptable Procedure
43+
44+
1. List or search files under `.evolve/entities/`.
45+
2. Identify candidate entities relevant to the task.
46+
3. Open and read those entity files.
47+
4. Summarize what applies, or state that nothing applies.
48+
49+
### Failure Conditions
50+
51+
The skill is not complete if any of the following are true:
52+
53+
- You only read this `SKILL.md`
54+
- You did not inspect `.evolve/entities/`
55+
- You did not read the relevant entity files
56+
- You proceeded without stating whether guidance was found
4357

44-
Entities are stored as individual markdown files in `.evolve/entities/`,
45-
organized by source:
58+
## How It Works
59+
60+
Bob has no auto-injection hook for entity retrieval. Complete the **Required Action** workflow above on every applicable task.
61+
62+
Entities can come from multiple sources:
63+
- **Private entities**: Your own local entities (not shared)
64+
- **Subscribed entities**: Entities cloned from any configured repo —
65+
read-scope subscriptions and write-scope publish targets both live
66+
under `.evolve/entities/subscribed/{name}/`
67+
68+
## Entities Storage
4669

4770
```text
4871
.evolve/entities/
49-
guideline/ # Private entities
50-
use-context-managers.md
72+
guideline/
73+
use-context-managers-for-file-operations.md <- private
5174
subscribed/
52-
memory/ # write-scope clone (publishes land here)
75+
memory/ <- write-scope clone (publishes land here)
5376
guideline/
5477
my-published-guideline.md
55-
alice/ # read-scope clone
78+
alice/ <- read-scope clone
5679
guideline/
57-
error-handling.md
80+
alice-guideline.md <- annotated [from: alice]
5881
```
5982

6083
Each file uses markdown with YAML frontmatter:
@@ -63,8 +86,6 @@ Each file uses markdown with YAML frontmatter:
6386
---
6487
type: guideline
6588
trigger: When processing files or managing resources
66-
visibility: private
67-
owner: alice
6889
---
6990

7091
Use context managers for file operations
@@ -73,12 +94,3 @@ Use context managers for file operations
7394

7495
Ensures proper resource cleanup
7596
```
76-
77-
## Entity Annotations
78-
79-
Subscribed entities are annotated with their source:
80-
```
81-
- **[guideline]** [from: alice] Use context managers for file operations
82-
- _Rationale: Ensures proper resource cleanup_
83-
- _When: When processing files or managing resources_
84-
```

0 commit comments

Comments
 (0)