Skip to content

Commit 9885f3f

Browse files
illeatmyhatclaude
andauthored
feat(evolve-lite): unify sharing into scoped repos list (#217) (#218)
* feat(evolve-lite): unify sharing into scoped repos list (#217) Collapse public_repo and subscriptions into a single repos: list where each entry has scope: read (subscribe only) or scope: write (publish target, also synced) — closes #217. Update publish / subscribe / sync / unsubscribe / recall skills for both Claude and Codex plugins to operate on the unified model. Write-scope repos double as publish targets and sync sources, so co-writers see each other's publishes through normal sync. Add helpers in lib/config.py (normalize_repos, read_repos, write_repos, set_repos, get_repo, is_valid_repo_name) and broaden tests across tests/platform_integrations/. Sync becomes scope-aware: read = fetch + reset --hard (clobber local), write = fetch + rebase (preserve local unpushed publishes). Symlink filtering moves from sync to retrieve, since sync no longer mirrors and just maintains the clone. Publish requires the write-scope clone to already exist (subscribe/sync own that step) and writes into the clone's working tree; the SKILL.md drives the commit/push flow, including conflict-recovery via rebase + push-with-retry. Unsubscribe warns when removing a write-scope repo (in SKILL.md). Co-authored-by: Punleuk Oum <5661986+illeatmyhat@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7364300 commit 9885f3f

47 files changed

Lines changed: 2311 additions & 1294 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

platform-integrations/bob/evolve-lite/README.md

Lines changed: 92 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A Bob integration that helps you learn from conversations by automatically extra
88

99
- **Manual Learning**: Use `evolve-lite:learn` to extract and save guidelines from conversations
1010
- **Manual Retrieval**: Use `evolve-lite:recall` to retrieve and apply stored guidelines
11-
- **Guideline Sharing**: Publish your guidelines and subscribe to others' via Git repositories
11+
- **Guideline Sharing**: Subscribe to read-scope repos and publish to write-scope repos via Git
1212

1313
## Installation
1414

@@ -27,17 +27,21 @@ This installs:
2727

2828
### Guideline Storage
2929

30-
Guidelines are stored as individual markdown files in `.evolve/entities/`, organized by source:
30+
Guidelines are stored as individual markdown files in `.evolve/entities/`,
31+
organized by source. Both read-scope subscriptions and write-scope publish
32+
targets live under `entities/subscribed/{name}/`:
3133

3234
```text
3335
.evolve/entities/
34-
guideline/ # Private guidelines
36+
guideline/ # Private guidelines
3537
use-context-managers.md
36-
public/ # Your published guidelines
37-
best-practice.md
3838
subscribed/
39-
alice/ # Guidelines from alice
40-
her-guideline.md
39+
memory/ # write-scope clone (publishes land here)
40+
guideline/
41+
my-published-guideline.md
42+
alice/ # read-scope clone
43+
guideline/
44+
her-guideline.md
4145
```
4246

4347
Each file uses markdown with YAML frontmatter:
@@ -58,79 +62,111 @@ Context managers ensure proper resource cleanup
5862

5963
## Sharing Guidelines
6064

61-
Evolve Lite supports sharing guidelines between users via public Git repositories. You can publish your own guidelines so others can subscribe to them, and subscribe to guidelines published by others.
65+
Evolve Lite treats shared guidelines as multi-reader / multi-writer git
66+
databases. A single unified `repos:` list in `evolve.config.yaml`
67+
describes every external guideline repo; each entry has a `scope` of
68+
`read` (subscribe only) or `write` (publish target that is also pulled
69+
on sync).
6270

6371
### Setup
6472

65-
Sharing requires an `evolve.config.yaml` at the project root. If it doesn't exist, the subscribe or publish skills will prompt you to create one. Minimal structure:
73+
Sharing requires `evolve.config.yaml` at the project root. If it doesn't
74+
exist, the subscribe or publish skills will prompt you to create one.
75+
Minimal structure:
6676

6777
```yaml
6878
identity:
6979
user: yourname # used to stamp ownership on published guidelines
70-
public_repo:
71-
remote: git@github.com:yourname/evolve-guidelines.git
72-
branch: main
73-
subscriptions: []
74-
```
75-
76-
The `.evolve/` directory is kept out of version control — the skills automatically add it to `.gitignore`.
77-
78-
### Publishing Guidelines
7980

80-
Use `evolve-lite:publish` to share one or more of your local guidelines with others:
81-
82-
1. The skill lists files in `.evolve/entities/guideline/`
83-
2. You pick which ones to publish
84-
3. Each selected file is moved to `.evolve/public/guideline/`, stamped with your username as the owner, committed, and pushed to your `public_repo.remote`
81+
repos:
82+
- name: memory
83+
scope: write
84+
remote: git@github.com:yourname/evolve-memory.git
85+
branch: main
86+
notes: public memory for my open-source projects
87+
- name: team
88+
scope: read
89+
remote: git@github.com:myorg/evolve-guidelines.git
90+
branch: main
91+
92+
sync:
93+
on_session_start: false
94+
```
8595
86-
Others can then subscribe using that remote URL.
96+
The `.evolve/` directory is kept out of version control — the skills
97+
automatically add it to `.gitignore`.
8798

88-
### Subscribing to Guidelines
99+
### Subscribing to a Repo
89100

90-
Use `evolve-lite:subscribe` to pull in guidelines from another user's public repo:
101+
Use `evolve-lite:subscribe` to add either a read-scope subscription or a
102+
write-scope publish target:
91103

92104
```text
93105
evolve-lite:subscribe
94106
> Remote URL: git@github.com:alice/evolve-guidelines.git
95107
> Short name: alice
108+
> Scope: read
96109
```
97110

98-
The repo is cloned directly into `.evolve/entities/subscribed/alice/` (this directory serves as both the git clone and the recall mirror).
111+
The repo is cloned directly into `.evolve/entities/subscribed/{name}/`
112+
(this directory serves as both the git clone and the recall mirror).
99113

100-
### Syncing Subscriptions
114+
### Publishing Guidelines
101115

102-
Use `evolve-lite:sync` to pull the latest changes from all subscribed repos:
116+
Use `evolve-lite:publish` to share local guidelines via a **write-scope** repo:
117+
118+
1. The skill picks (or asks about) the write-scope target repo
119+
2. Lists files in `.evolve/entities/guideline/`
120+
3. You pick which ones to publish
121+
4. Each selected file is moved into the write-scope clone at
122+
`.evolve/entities/subscribed/{repo}/guideline/`, stamped with your
123+
username, committed, and pushed to the remote
124+
125+
Because the publish target is also a subscribed repo, your next sync
126+
pulls in anything other writers have pushed to the same remote.
127+
128+
### Syncing Repos
129+
130+
Use `evolve-lite:sync` to pull the latest changes from every configured
131+
repo:
103132

104133
```text
105134
evolve-lite:sync
106-
> Synced 2 repo(s): alice (+2 added, 0 updated, 0 removed), bob (+0 added, 1 updated, 0 removed)
135+
> Synced 2 repo(s): memory [write] (+0 added, 1 updated, 0 removed), alice [read] (+2 added, 0 updated, 0 removed)
107136
```
108137

138+
Read-scope repos use `git fetch` + `git reset --hard`. Write-scope repos
139+
use `git fetch` + `git rebase` so any unpushed local publish commits are
140+
preserved.
141+
109142
### Unsubscribing
110143

111-
Use `evolve-lite:unsubscribe` to remove a subscription and delete its locally cloned files:
144+
Use `evolve-lite:unsubscribe` to remove a configured repo and delete
145+
its locally cloned files:
112146

113147
```text
114148
evolve-lite:unsubscribe
115-
> Which subscription would you like to remove?
116-
> 1. alice
117-
> 2. bob
149+
> Which repo would you like to remove?
150+
> 1. memory [write]
151+
> 2. alice [read]
118152
```
119153

120154
The skill confirms before deleting `.evolve/entities/subscribed/{name}/`.
155+
Removing a write-scope repo will also discard any unpushed local
156+
publish commits, so the skill warns first.
121157

122158
### Sharing Storage Layout
123159

124160
```text
125161
.evolve/
126-
public/ # git repo pushed to your public remote
127-
guideline/
128-
guideline-name.md # owner-stamped guideline
129162
entities/
130-
guideline/ # your private guidelines
163+
guideline/ # your private guidelines
131164
my-guideline.md
132165
subscribed/
133-
alice/ # git clone (also serves as recall mirror)
166+
memory/ # write-scope clone (publishes land here)
167+
guideline/
168+
my-published-guideline.md
169+
alice/ # read-scope clone (also serves as recall mirror)
134170
guideline/
135171
her-guideline.md
136172
```
@@ -147,43 +183,43 @@ Manually invoke to extract guidelines from the current conversation:
147183
### `evolve-lite:recall`
148184

149185
Manually invoke to retrieve and display stored guidelines:
150-
- Loads guidelines from private, public, and subscribed sources
186+
- Loads guidelines from private and subscribed sources
151187
- Formats and displays them for your review
152188
- Annotates subscribed guidelines with their source
153189

154190
### `evolve-lite:publish`
155191

156-
Publish private guidelines to your public repository:
192+
Publish private guidelines to a write-scope repo:
157193
- Lists available private guidelines
158-
- Moves selected guidelines to `.evolve/public/`
159-
- Stamps with owner and published_at metadata
160-
- Commits and pushes to your public remote
194+
- Moves selected guidelines into the write-scope clone at
195+
`.evolve/entities/subscribed/{repo}/guideline/`
196+
- Stamps with `owner`, `published_at`, and `source` metadata
197+
- Commits and pushes to the configured remote
161198

162199
### `evolve-lite:subscribe`
163200

164-
Subscribe to another user's public guidelines:
165-
- Clones their public repository
166-
- Mirrors guidelines to `.evolve/entities/subscribed/`
167-
- Adds subscription to config
201+
Add a configured repo to the unified `repos:` list:
202+
- Clones the remote into `.evolve/entities/subscribed/{name}/`
203+
- Adds an entry with `scope: read` or `scope: write` to config
168204

169205
### `evolve-lite:sync`
170206

171-
Sync all subscribed repositories:
172-
- Pulls latest changes from each subscription
173-
- Updates mirrored guidelines
207+
Sync every configured repo:
208+
- Read-scope: fetch + reset --hard (clobbers any local edits)
209+
- Write-scope: fetch + rebase (preserves unpushed local publishes)
174210
- Reports changes (added, updated, removed)
175211

176212
### `evolve-lite:unsubscribe`
177213

178-
Remove a subscription:
179-
- Lists current subscriptions
180-
- Deletes selected subscription's local files
181-
- Removes from config
214+
Remove a configured repo:
215+
- Lists current repos with their scope and notes
216+
- Deletes the local clone at `.evolve/entities/subscribed/{name}/`
217+
- Removes the entry from config
182218

183219
## Environment Variables
184220

185221
- `EVOLVE_DIR`: Override the default `.evolve` directory location (guidelines, config, etc. are stored here)
186222

187223
## Verification
188224

189-
After installation, the skills should be available in Bob's skill list.
225+
After installation, the skills should be available in Bob's skill list.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
name: evolve-lite:publish
3-
description: Publish a private guideline to your public repo
3+
description: Publish a private guideline to a configured write-scope repo
44
---
5-
Use the publish skill to share your private guidelines with others. Follow the skill's instructions exactly.
5+
Use the publish skill to share your private guidelines via a configured write-scope repo. Follow the skill's instructions exactly.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
name: evolve-lite:subscribe
3-
description: Subscribe to another user's public guidelines repo
3+
description: Add a shared guidelines repo (read- or write-scope) to the unified repos list
44
---
5-
Use the subscribe skill to learn from others' guidelines. Follow the skill's instructions exactly.
5+
Use the subscribe skill to add a shared guidelines repo — either a read-scope subscription or a write-scope publish target. Follow the skill's instructions exactly.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
name: evolve-lite:sync
3-
description: Pull the latest guidelines from all subscribed repos
3+
description: Pull the latest guidelines from every configured repo (read- and write-scope)
44
---
5-
Use the sync skill to update your subscribed guidelines. Follow the skill's instructions exactly.
5+
Use the sync skill to update your configured guidelines repos. Follow the skill's instructions exactly.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
name: evolve-lite:unsubscribe
3-
description: Remove a subscription and delete locally synced guidelines
3+
description: Remove a repo from the unified repos list and delete its local clone
44
---
5-
Use the unsubscribe skill to remove a subscription. Follow the skill's instructions exactly.
5+
Use the unsubscribe skill to remove a configured repo and delete its local clone. Follow the skill's instructions exactly.

0 commit comments

Comments
 (0)