@owlmeans/agent-skills 0.1.12 → 0.1.15

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.
@@ -1,10 +1,24 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@owlmeans/agent-skills",
4
- "version": "0.1.12",
5
- "generatedAt": "2026-06-17T14:51:24.131Z",
4
+ "version": "0.1.15",
5
+ "generatedAt": "2026-08-07T17:06:32.899Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
+ {
9
+ "kind": "skill",
10
+ "name": "self-education",
11
+ "category": "general",
12
+ "file": "skills/self-education/SKILL.md",
13
+ "canonicalPath": ".claude/skills/self-education/SKILL.md"
14
+ },
15
+ {
16
+ "kind": "skill",
17
+ "name": "router-plugins",
18
+ "category": "general",
19
+ "file": "skills/router-plugins/SKILL.md",
20
+ "canonicalPath": ".claude/skills/router-plugins/SKILL.md"
21
+ },
8
22
  {
9
23
  "kind": "skill",
10
24
  "name": "getting-started",
@@ -19,6 +33,20 @@
19
33
  "file": "skills/shadcn-web/SKILL.md",
20
34
  "canonicalPath": ".claude/skills/shadcn-web/SKILL.md"
21
35
  },
36
+ {
37
+ "kind": "skill",
38
+ "name": "memory-recompact",
39
+ "category": "general",
40
+ "file": "skills/memory-recompact/SKILL.md",
41
+ "canonicalPath": ".claude/skills/memory-recompact/SKILL.md"
42
+ },
43
+ {
44
+ "kind": "skill",
45
+ "name": "git",
46
+ "category": "general",
47
+ "file": "skills/git/SKILL.md",
48
+ "canonicalPath": ".claude/skills/git/SKILL.md"
49
+ },
22
50
  {
23
51
  "kind": "skill",
24
52
  "name": "agent-memory",
@@ -47,6 +75,13 @@
47
75
  "file": "skills/skill-authoring/SKILL.md",
48
76
  "canonicalPath": ".claude/skills/skill-authoring/SKILL.md"
49
77
  },
78
+ {
79
+ "kind": "skill",
80
+ "name": "memory-promotion",
81
+ "category": "general",
82
+ "file": "skills/memory-promotion/SKILL.md",
83
+ "canonicalPath": ".claude/skills/memory-promotion/SKILL.md"
84
+ },
50
85
  {
51
86
  "kind": "skill",
52
87
  "name": "shadcn-versions",
@@ -68,6 +103,20 @@
68
103
  "file": "instructions/getting-started.instructions.md",
69
104
  "canonicalPath": ".github/instructions/getting-started.instructions.md"
70
105
  },
106
+ {
107
+ "kind": "instruction",
108
+ "name": "self-education",
109
+ "category": "general",
110
+ "file": "instructions/self-education.instructions.md",
111
+ "canonicalPath": ".github/instructions/self-education.instructions.md"
112
+ },
113
+ {
114
+ "kind": "instruction",
115
+ "name": "memory-recompact",
116
+ "category": "general",
117
+ "file": "instructions/memory-recompact.instructions.md",
118
+ "canonicalPath": ".github/instructions/memory-recompact.instructions.md"
119
+ },
71
120
  {
72
121
  "kind": "instruction",
73
122
  "name": "scaffolding",
@@ -82,6 +131,13 @@
82
131
  "file": "instructions/skill-authoring.instructions.md",
83
132
  "canonicalPath": ".github/instructions/skill-authoring.instructions.md"
84
133
  },
134
+ {
135
+ "kind": "instruction",
136
+ "name": "router-plugins",
137
+ "category": "general",
138
+ "file": "instructions/router-plugins.instructions.md",
139
+ "canonicalPath": ".github/instructions/router-plugins.instructions.md"
140
+ },
85
141
  {
86
142
  "kind": "instruction",
87
143
  "name": "shadcn-versions",
@@ -89,6 +145,13 @@
89
145
  "file": "instructions/shadcn-versions.instructions.md",
90
146
  "canonicalPath": ".github/instructions/shadcn-versions.instructions.md"
91
147
  },
148
+ {
149
+ "kind": "instruction",
150
+ "name": "memory-promotion",
151
+ "category": "general",
152
+ "file": "instructions/memory-promotion.instructions.md",
153
+ "canonicalPath": ".github/instructions/memory-promotion.instructions.md"
154
+ },
92
155
  {
93
156
  "kind": "instruction",
94
157
  "name": "agent-memory",
@@ -102,6 +165,13 @@
102
165
  "category": "general",
103
166
  "file": "instructions/shadcn-web.instructions.md",
104
167
  "canonicalPath": ".github/instructions/shadcn-web.instructions.md"
168
+ },
169
+ {
170
+ "kind": "instruction",
171
+ "name": "git",
172
+ "category": "general",
173
+ "file": "instructions/git.instructions.md",
174
+ "canonicalPath": ".github/instructions/git.instructions.md"
105
175
  }
106
176
  ]
107
177
  }
@@ -1,52 +1,142 @@
1
1
  ---
2
2
  name: agent-memory
3
- description: How project memory works in an OwlMeans app — where to store facts/decisions/gotchas for Claude Code (.claude/memory/) and Copilot (.github/memory/), the MEMORY.md index, and when to read and write memory. Use when asked to remember something about the project, or to decide where a note belongs.
3
+ description: Shared agent memory protocol — the .agents/memory/ graph store used by both Claude Code and GitHub Copilot: MEMORY.md index, subsystem nodes, compact-on-write merging, size caps, and the read protocol. Use when reading or writing project memory, when asked to remember something, or to decide where knowledge belongs.
4
4
  user-invocable: true
5
5
  scope: general
6
6
  ---
7
7
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
8
8
 
9
- # Project memory
9
+ # Agent memory (`.agents/memory/`)
10
10
 
11
- Memory is how durable, project-specific knowledge survives across sessions. Keep it **inside the
12
- project**, never in `~/.claude/` or `~/.copilot/`.
11
+ One shared memory store per repository, used by **both** Claude Code and GitHub Copilot: a graph
12
+ of subsystem nodes rooted in the `MEMORY.md` index. Compactness is the core value — every write
13
+ merges and compacts; nothing is ever appended as a log.
13
14
 
14
- | Tool | Memory dir | Index |
15
- |---|---|---|
16
- | Claude Code | `.claude/memory/` | `.claude/memory/MEMORY.md` |
17
- | GitHub Copilot | `.github/memory/` | `.github/memory/MEMORY.md` |
15
+ Never write memory to `.claude/memory/`, `.github/memory/`, `~/.claude/`, `~/.copilot/`, or
16
+ anywhere outside the repository. Legacy `.claude/memory/` / `.github/memory/` stores are
17
+ retired — if one exists, flag it for `memory-recompact` migration instead of writing there.
18
18
 
19
- Each memory is one Markdown file holding one fact, decision, or gotcha. The `MEMORY.md` index has a
20
- one-line pointer per file (`- [Title](file.md) — hook`) and is loaded every session, so it must stay
21
- current.
19
+ ## Store layout
22
20
 
23
- ## When to read memory
21
+ ```
22
+ .agents/memory/
23
+ ├── MEMORY.md # graph root: the only always-read file
24
+ └── <node>.md # one file per subsystem / concern / integration
25
+ ```
24
26
 
25
- - **At the start of every session** — read `MEMORY.md`, then open any file relevant to the task.
26
- - **Before a non-trivial task** — check for a memory file on that topic and read it first.
27
- - Don't rely on assumptions when a memory file exists; read it.
27
+ Flat directory — graph structure lives in scopes and wiki-links, not subdirectories.
28
28
 
29
- ## When to write memory
29
+ ## Node naming
30
30
 
31
- After a task produces knowledge that isn't obvious from the code or git history:
31
+ Node id = lowercase-kebab name of the **project-structure part** the knowledge attaches to:
32
32
 
33
- - A **decision** and why it was made (and what was rejected).
34
- - A **gotcha** or sharp edge discovered the hard way.
35
- - **Project state / goals** not derivable from the repo.
33
+ 1. **Subsystem** — workspace dir / package name: `manager-web`, `auth`, `vslots`. Deepest
34
+ unambiguous segment; prefix with the parent only on collision.
35
+ 2. **Cross-cutting concern** spanning subsystems: `build`, `testing`, `deploy`, `routing`, `i18n`.
36
+ 3. **Integration** — external service/library: `stripe`, `cloudflare`, `openrouter`.
37
+ 4. **`workspace`** — repo-level facts that fit nowhere else (remotes, branch topology, env model).
36
38
 
37
- Do **not** record what the code or git history already says, or what only matters to the current
38
- conversation.
39
+ File is `<node>.md`; the id is the wiki-link target: `[[manager-web]]`. **Never** key a node to an
40
+ event, date, phase, investigation, or task name.
39
41
 
40
- ## How to write one
42
+ ## Index format (`MEMORY.md`)
41
43
 
42
- 1. Create `.claude/memory/<topic>.md` (and the Copilot copy under `.github/memory/`) with a short
43
- slug name and a one-line description.
44
- 2. Write the single fact; for decisions/gotchas, add why it matters and how to apply it.
45
- 3. Add a one-line pointer to the matching `MEMORY.md` index.
46
- 4. Before saving, check for an existing file that already covers it — update that instead of
47
- duplicating. Delete memories that turn out to be wrong.
44
+ ```markdown
45
+ # Memory Graph — <project>
46
+
47
+ Shared agent memory (`agent-memory` protocol). Read this file at session start.
48
+ Before non-trivial work, open every node whose scope matches the task's files or topics.
49
+
50
+ ## Subsystems
51
+ - [[manager-web]] `sources/manager-web/**` — i18n 8-domain split; owl-theme wiring
52
+ ## Cross-cutting
53
+ - [[build]] `**/tsconfig*.json` — tsbuildinfo path pinning; tolerant library builds
54
+ ## Integrations
55
+ - [[stripe]] `ext:stripe` — sandbox topology; webhook fan-out
56
+ ```
57
+
58
+ Rules: exactly one line per node — `- [[<node>]] ` + backticked scope + ` — <hook>`; hook ≤ 100
59
+ chars; no dates; only non-empty groups; file ≤ 50 lines; no skills listed (skills self-describe).
60
+ The scope column is the router: match the task's paths/topics against scopes to decide which
61
+ nodes to open.
62
+
63
+ ## Node format
64
+
65
+ Frontmatter — exactly three fields:
66
+
67
+ ```yaml
68
+ ---
69
+ node: vslots # = filename without .md; = wiki-link target
70
+ scope: "scripts/vslots/**" # repo-relative globs; ext:<service> for integrations; . for workspace
71
+ updated: 2026-08 # month granularity only
72
+ ---
73
+ ```
74
+
75
+ Body — only non-empty sections, in this order:
76
+
77
+ - `## Facts` — what IS: structure, behavior, topology. 1–3 lines each.
78
+ - `## Invariants` — what MUST HOLD; optionally "broke when violated: <symptom>".
79
+ - `## Gotchas` — symptom → cause → counter-move, ≤ 3 lines each.
80
+ - `## Pointers` — key files, promoted-skill pointer lines, `External docs` (URL + gist).
81
+ - `## Status` — optional; in-flight state only; every line dated; prune resolved lines on every read.
82
+
83
+ `Status` is the **only** place dates and unfinished-work notes are allowed. Link related nodes
84
+ inline with `[[node]]`.
85
+
86
+ ## Read protocol
87
+
88
+ - **Session start**: read `.agents/memory/MEMORY.md` — the index only.
89
+ - **Before a non-trivial task**: open every node whose scope matches the task (typically 1–3).
90
+ - **When a topic surfaces mid-session** that the index names: open its node before acting.
91
+ - **Never bulk-read** the store — the index + scopes exist so you don't have to.
92
+
93
+ ## Write protocol (compact-on-write)
94
+
95
+ Every write is a merge, never an append:
96
+
97
+ 1. **Extract** — reduce the outcome to reusable knowledge atoms (rule below). Nothing survives →
98
+ write nothing.
99
+ 2. **Locate** — match scopes to find the node; none matches → create one per the naming rule and
100
+ add its index line.
101
+ 3. **Merge / supersede** — place each atom in the right section; if it refines or contradicts an
102
+ existing line, **rewrite that line in place** — never append a dated correction. The node
103
+ always reads as current truth.
104
+ 4. **Compact** — reread the node; collapse redundancy; delete anything the code or git history
105
+ now states; prune resolved `Status` lines.
106
+ 5. **Cap** — over soft cap: compact harder. Over hard cap: split by sub-scope into a linked child
107
+ node, or promote procedure-shaped overflow (`memory-promotion` where present, else
108
+ `skill-authoring`).
109
+ 6. **Index** — update the hook line if the node's center of gravity moved; bump `updated:`.
110
+
111
+ ## Knowledge, not events
112
+
113
+ **Record the rule, not the story.** For every line ask: *what must a future agent know to act
114
+ correctly, stated without reference to this session?* Keep invariants, cause→effect,
115
+ counter-moves, recognition fingerprints (symptoms). Drop dates, phase numbers, who did what,
116
+ attempt sequences, and anything recoverable from code or git.
117
+
118
+ Before (event log): "Verification 2026-06-11 … Bug found: script missing embedded-count logic.
119
+ Fix deployed to all copies; second run idempotent."
120
+ After (knowledge): "`nested-agent-context.sh` exists as byte-identical copies in the archive and
121
+ each repo — fan every fix out to all copies; verify with `diff`. Correct re-runs are no-ops."
122
+
123
+ ## Size caps (hard)
124
+
125
+ | Thing | Cap |
126
+ |---|---|
127
+ | Index entry | 1 line, hook ≤ 100 chars |
128
+ | `MEMORY.md` | ≤ 50 lines |
129
+ | Node file (soft / hard) | 80 / 120 lines |
130
+ | Single fact/gotcha | ≤ 3 lines |
131
+ | `Status` section | ≤ 5 dated lines |
132
+ | Nodes per store (soft) | ~25 — merge low-traffic siblings beyond |
48
133
 
49
134
  ## Memory vs skill
50
135
 
51
- If you are writing a **repeatable procedure** ("to do X, do Y"), that is a skill — see the
52
- `skill-authoring` skill. Memory is for **facts about this project** ("we chose X because Y").
136
+ Fact-shaped ("what is true") stays here. Procedure-shaped ("to do X, do Y") becomes a skill —
137
+ follow `memory-promotion` where present, otherwise `skill-authoring`. Repeated use of a node to
138
+ *perform* tasks, and over-cap nodes full of steps, are promotion triggers.
139
+
140
+ Promotion is a **rewrite, never a move**: never paste node text into a skill. "Record the rule,
141
+ not the story" and the size caps above bind skill bodies at least as tightly as they bind nodes
142
+ (`memory-promotion` → Distillation).
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: git
3
+ description: "Git workflow policy — never run state-changing git without an explicit instruction, commit only under the repository's configured identity (no AI-attribution trailer), report finished git work as a Markdown table, never commit a conflicted working copy. Use before any git operation."
4
+ user-invocable: false
5
+ scope: general
6
+ ---
7
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
8
+
9
+ # Git Workflow Rules
10
+
11
+ **Mandatory and universal.** These rules apply to every git operation in this repository and
12
+ **override any default agent behavior** — including any automatic `Co-Authored-By` or
13
+ AI/agent-attribution trailer. Consult them before running any git command.
14
+
15
+ ## 0. Never run state-changing git without explicit instruction
16
+
17
+ - **Never run state-changing git operations** (`commit`, `add`/`rm` staging, `push`,
18
+ `reset`/rollback, `revert`, `rebase`, `merge`, `branch`, `checkout`/`switch`, `stash`,
19
+ `tag`, `cherry-pick`, force-push, etc.) unless the user **explicitly instructs it in the
20
+ current request**. Permission to make code edits is **not** permission to touch git.
21
+ - **Only exception**: creating and operating inside a **temporary git worktree** that a task
22
+ or subagent has **explicitly requested** for that purpose. Outside such an explicitly
23
+ requested tmp worktree, do nothing with git.
24
+ - **Read-only inspection is allowed**: `git status`, `git diff`, `git log`, `git show`,
25
+ `git branch --list`, etc. — use these to report state, never to change it.
26
+
27
+ ## 1. Never commit under the agent's identity
28
+
29
+ - Commit only under the repository's preconfigured git identity — whatever `git config user.name`
30
+ and `git config user.email` resolve to (set by the user, globally or locally).
31
+ - **Never** override authorship: do not pass `--author`, do not set or change `user.name` /
32
+ `user.email`, and never substitute an AI / agent / assistant name or email.
33
+ - **Never** add a `Co-Authored-By:` trailer (or any other trailer) attributing the commit to
34
+ Claude, Copilot, or any AI/agent. Every commit is the user's, attributed solely to the user.
35
+ - If the repository has no git identity configured (neither local nor global), stop and ask the
36
+ user — do not invent one.
37
+
38
+ ## 2. Always report finished git work as a table
39
+
40
+ - After completing any git action (commit, push, branch, checkout, merge, rebase, stash, tag,
41
+ reset, etc.), summarize what was done as a Markdown table.
42
+ - One row per action. Include at least **Action**, **Target** (branch / remote / files / ref),
43
+ and **Result** (commit SHA, `pushed`, `up to date`, `conflict`, …). Add a **Notes** column
44
+ when useful.
45
+
46
+ ## 3. Never commit a conflicted working copy
47
+
48
+ - If a `merge`, `rebase`, `cherry-pick`, `stash pop`/`apply`, or `pull` produces conflicts,
49
+ **do not** finalize it: do not run `git commit`, `git merge --continue`,
50
+ `git rebase --continue`, or stage-and-commit the conflicted tree to "resolve" it on the
51
+ user's behalf.
52
+ - Stop, list the conflicted paths in the report table, and hand control back to the user —
53
+ unless the user has explicitly told you how to resolve the conflict and commit.
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: memory-promotion
3
+ description: Transform procedure-shaped or repeatedly-used memory into skills and instructions — the procedure-shape test, the mandatory distillation rewrite, promote? repeated-touch flags, over-cap trigger, update-vs-create decision, and the post-promotion pointer state. Use when memory content reads as "how to", when a promote? flag is encountered again, when writing memory-derived content into a skill, or during recompaction.
4
+ user-invocable: true
5
+ scope: general
6
+ ---
7
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
8
+
9
+ # Memory promotion
10
+
11
+ Memory holds **facts**; **procedures** belong in skills/instructions, where they auto-invoke and
12
+ stop consuming memory-read cycles. Promotion is how the store stays compact and the harness
13
+ teaches itself.
14
+
15
+ Promotion is a **rewrite, never a move**. Memory text pasted into a skill is the single most
16
+ common way this harness degrades — see Distillation below.
17
+
18
+ ## Triggers
19
+
20
+ - **Procedure shape**: the content answers *how to do X* — ordered steps, imperative verbs,
21
+ command lines, if-this-do-that tables. Promote it.
22
+ - **Repeated touch**: an existing ` → promote?` flag on content you are touching again means
23
+ promote now; if mid-task, promotion becomes the first row of the completion report.
24
+ - **Over-cap**: a node past the 120-line hard cap with roughly a third or more procedure-shaped
25
+ content → promote the procedures instead of splitting the node.
26
+ - Corroborating only (weak — agents don't commit, so only user commits appear):
27
+ `git log --oneline -- .agents/memory/<node>.md` showing ≥ 3 commits within ~a month marks a
28
+ hot node worth evaluating.
29
+
30
+ ## Procedure-shape test
31
+
32
+ Procedure-shaped answers *how to do X*: ordered steps, imperative verbs, commands, action tables.
33
+ Fact-shaped answers *what is true*: declarative structure, invariants, symptom→cause pairs.
34
+ Mixed entries split — the fact stays in the node, the "then do" is distilled into a rule in the
35
+ skill.
36
+
37
+ ## Distillation (mandatory)
38
+
39
+ **Never paste memory text into a skill.** A promoted line leaves the node as prose about a past
40
+ occurrence and enters the skill as **one general rule**: *when this applies → do this → or this
41
+ breaks*, stated so it holds next time rather than describing last time.
42
+
43
+ | Strip | Keep |
44
+ |---|---|
45
+ | dates, phase/status markers, "COMPLETE", "landed" | the condition that makes the rule apply |
46
+ | versions, image tags, SHAs — unless the rule turns on the version | the step to take |
47
+ | "was X, now Y", "the former X was removed" | the failure it prevents |
48
+ | who did it, attempt sequences, incident narrative | the recognition fingerprint (symptom) |
49
+ | point-in-time inventories, counts, snapshots | |
50
+
51
+ Before (memory): "2026-07-05 — the control-board git card was removed; the dialog now owns all
52
+ git actions."
53
+ After (rule): "Git actions live in the git dialog; the control board holds none."
54
+
55
+ Before (memory): "Phase 3 (COMPLETE, 2026-06-13): added the init-container build, publisher
56
+ `src/build.ts`, kephemeral v0.1.5."
57
+ After (rule): "Production images build in an init container driven by `publisher/src/build.ts`."
58
+
59
+ **If the rule cannot be stated without saying when it happened, it is not promotable** — it stays
60
+ a memory fact, or it is dropped.
61
+
62
+ ### Budget
63
+
64
+ A promotion normally adds **1–5 lines** to an existing skill, and a single rule is ≤ 3 lines. A
65
+ whole new section, or more text added than the node lost, means the content was moved rather than
66
+ distilled — redo it.
67
+
68
+ A skill may legitimately run long when it maps a large subsystem, so length alone is not the test:
69
+ **every line must be a rule, a contract, or a pointer.** A section that reads as the story of how
70
+ the code got there is pollution at any length. "Record the rule, not the story" (`agent-memory`)
71
+ binds skill bodies at least as tightly as it binds nodes.
72
+
73
+ ## Flagging (how content earns promotion)
74
+
75
+ When you **merge** procedure-shaped content into a node, or you **use** (not merely check) a
76
+ node's content to perform a task, append ` → promote?` to that line or section heading.
77
+ Evaluable by reading the file alone — no tooling required.
78
+
79
+ ## Update vs create
80
+
81
+ **Default is update** — extend the existing skill/instruction whose scope covers the activity,
82
+ even partially; keep both twins in sync. Create a NEW pair only when:
83
+
84
+ - (a) a new subsystem or technology entered the repo;
85
+ - (b) an activity with no covering skill needed memory read/write more than once (a
86
+ re-encountered ` → promote?` flag);
87
+ - (c) an external technology required internet docs and has no governing skill.
88
+
89
+ New skills multiply lookup cost — compactness applies to the skill population *and* to each
90
+ skill's body.
91
+
92
+ ## Procedure
93
+
94
+ 1. Collect the flagged / procedure-shaped memory lines.
95
+ 2. **Distill** each into a general rule (section above). Not optional — skipping it is the
96
+ failure mode this skill exists to prevent.
97
+ 3. Author or extend the SKILL.md and its `.github/instructions/<name>.instructions.md` twin,
98
+ following the repo's `skill-authoring` or `create-skill` conventions. Where an existing rule
99
+ already covers the ground, **rewrite that rule in place**; append only when nothing covers it.
100
+ 4. Shrink the node: delete the source lines; leave one pointer line (format below).
101
+ 5. Remove the ` → promote?` flags.
102
+ 6. Update the node's index hook if its main value moved; bump `updated:`.
103
+ 7. Report per the Reporting rule.
104
+
105
+ ## Post-promotion state
106
+
107
+ The node keeps exactly one line under `## Pointers`:
108
+
109
+ ```
110
+ - <activity> → skill `<name>` (procedure lives in .claude/skills/<name>/ + .github/instructions/<name>.instructions.md)
111
+ ```
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: memory-recompact
3
+ description: Recompact or migrate a whole .agents/memory/ store — rebuild the node map from project structure, merge event-shaped records into subsystem nodes, deduplicate, enforce caps, regenerate the MEMORY.md index, and fold in legacy .claude/memory and .github/memory stores. Use when a store degrades into event logs, indexes bloat or conflict, or for one-time migration.
4
+ disable-model-invocation: true
5
+ scope: general
6
+ ---
7
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
8
+
9
+ # Memory recompaction
10
+
11
+ Whole-store maintenance for `.agents/memory/` (protocol: `agent-memory`). Also the migration
12
+ procedure for legacy `.claude/memory/` + `.github/memory/` stores. Store-wide rewrite — propose
13
+ it when triggers appear; the operator invokes it.
14
+
15
+ ## When
16
+
17
+ - An index entry runs longer than one line, or the index exceeds 50 lines.
18
+ - Nodes keyed by event/date/phase/task, or bodies reading as session narratives.
19
+ - The same fact stated in two or more nodes.
20
+ - More than ~20% of a node is stale `Status` content.
21
+ - A node's `updated:` is months behind commits touching its scope.
22
+ - Legacy `.claude/memory/` or `.github/memory/` dirs exist → run the migration below.
23
+
24
+ ## Build the target node map first
25
+
26
+ Before reading any record bodies, derive the node set from **project structure**: workspaces
27
+ array / top-level dirs → subsystem nodes; then the cross-cutting concerns and external
28
+ integrations actually present. Write the map down (old file/section → target node). Every
29
+ existing record must land in exactly one node — or split into atoms landing in several. Only
30
+ then process records.
31
+
32
+ ## Per-record pass
33
+
34
+ For each old file or section:
35
+
36
+ 1. Apply the `agent-memory` extraction rule — keep invariants, cause→effect, counter-moves,
37
+ symptom fingerprints; drop narratives, dates, attempt logs, anything code/git already states.
38
+ 2. Route each surviving atom to its node's section (Facts / Invariants / Gotchas / Pointers;
39
+ genuinely in-flight state → `Status`, dated).
40
+ 3. On conflict between records, the version consistent with **current code** wins — check the
41
+ code, don't average.
42
+ 4. Procedure-shaped survivors do not enter nodes — route them to `memory-promotion`. Routing
43
+ means distilling them into general rules, never handing the text over verbatim.
44
+
45
+ ## Legacy-store merge (migration)
46
+
47
+ 1. Union `.claude/memory/` and `.github/memory/`. Same-named files are two drifted sources of
48
+ ONE node — merge both; the code-consistent version wins.
49
+ 2. Index-only entries with no backing file: extract the fact into its node, or drop if stale.
50
+ 3. Old `## Skills` / "Key Files" index sections are dropped — skills self-describe; harness
51
+ layout belongs to `CLAUDE.md` / `.github/copilot-instructions.md`. Move genuinely non-obvious
52
+ dispatch hints there.
53
+ 4. When the new store verifies (below), delete both legacy dirs entirely.
54
+
55
+ ## Regenerate the index
56
+
57
+ Rebuild `MEMORY.md` from the resulting nodes per the `agent-memory` format — never edit the old
58
+ index incrementally.
59
+
60
+ ## Verify
61
+
62
+ - Every node file is listed in the index; every listed node exists; every wiki-link resolves.
63
+ - All caps met (index ≤ 50 lines; nodes ≤ 120; entries ≤ 3 lines; Status ≤ 5 dated lines).
64
+ - No dates outside `Status` and `updated:`; no event-keyed filenames.
65
+ - Both root instruction files' Memory sections point at `.agents/memory/`.
66
+ - Legacy dirs gone; `grep -rn '\.claude/memory\|\.github/memory'` over the repo's harness files
67
+ returns nothing but allowlisted historical mentions.
68
+
69
+ ## Report
70
+
71
+ One table: **Node** | **Sources merged** | **Lines before → after**. Follow the Reporting rule
72
+ (what, not why).
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: router-plugins
3
+ description: How OwlMeans UI routing plugins work — the RouterPlugin contract, cascade selection, choosing/switching the router at context provisioning (default OwlMeans vs opt-in react-router), and authoring a new plugin (e.g. SSR). Read before wiring routing in an app or writing a routing plugin.
4
+ scope: general
5
+ user-invocable: false
6
+ ---
7
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
8
+
9
+ # OwlMeans routing plugins
10
+
11
+ OwlMeans UI routing is pluggable. The core `@owlmeans/router` package is a **host**: it defines the
12
+ `RouterService` facade and holds a registry of `RouterPlugin`s, selecting the active one by
13
+ **cascade**. Route *descriptions* are react-router-compatible (same path placeholders: static,
14
+ `:param`, nested, index) so the same route trees work across plugins.
15
+
16
+ ## Plugins that ship today
17
+
18
+ | Plugin | Package | Registration | Priority |
19
+ |--------|---------|--------------|----------|
20
+ | OwlMeans in-browser (default) | `@owlmeans/web-router` | `appendWebRouter(ctx)` | 0 |
21
+ | react-router v7 (opt-in) | `@owlmeans/web-router-react-router` | `appendReactRouter(ctx)` | 100 |
22
+ | Native (RN) | `@owlmeans/native-router` | native app wiring | — |
23
+ | SSR | *(future)* | higher-priority `match: env => env.ssr` | >0 |
24
+
25
+ ## Choosing the router at context provisioning
26
+
27
+ `@owlmeans/web-client` (and `web-panel`) call `appendWebRouter` by default, so **OwlMeans routing is
28
+ the default**. To switch a specific app to react-router, add the opt-in plugin in your `makeContext`
29
+ — its higher priority wins the cascade:
30
+
31
+ ```typescript
32
+ import { makeContext as makeBase } from '@owlmeans/web-panel'
33
+ import { appendReactRouter } from '@owlmeans/web-router-react-router'
34
+
35
+ export const makeContext = (cfg) => {
36
+ const context = makeBase(cfg)
37
+ appendReactRouter(context) // now react-router handles routing instead of OwlMeans
38
+ return context
39
+ }
40
+ ```
41
+
42
+ You no longer pass a `provide`/`createBrowserRouter` prop to `<App>`/`<PanelApp>` — routing resolves
43
+ its compiler from the active plugin (`context.router().compile`). The former `provide` export from
44
+ `@owlmeans/web-client` is now a deprecated `undefined` kept only for source compatibility.
45
+
46
+ ## The RouterPlugin contract
47
+
48
+ ```typescript
49
+ interface RouterPlugin {
50
+ alias: string
51
+ priority?: number // higher wins; default 0
52
+ mode?: string // 'browser' | 'ssr' | …
53
+ match?: (env: RouterEnv, ctx?) => boolean // undefined ⇒ always applies
54
+ compile: (routes: RouteObject[], ctx?) => LibraryRouter | Promise<LibraryRouter>
55
+ provider: () => ComponentType<{ router }> // renders the compiled router
56
+ outlet: () => ComponentType // renders the next nested match
57
+ useParams; useLocation; useNavigate; useSearchParams // hooks backed by the plugin
58
+ }
59
+ ```
60
+
61
+ - `RouteObject` is the neutral IR (`{ index?, path?, children?, Component? }`), produced by
62
+ `@owlmeans/client` from the entrypoint tree — the same objects both plugins consume.
63
+ - `RouterEnv` (`{ hasWindow, ssr, request? }`) drives selection. The browser plugin matches always;
64
+ an SSR plugin would register at a higher priority with `match: env => env.ssr`.
65
+
66
+ ## Authoring a plugin (e.g. SSR)
67
+
68
+ 1. Implement `RouterPlugin` (reuse the pure matcher from `@owlmeans/router`: `flattenRoutes`,
69
+ `rankRouteBranches`, `matchRoutes` — they are DOM-free and SSR-safe).
70
+ 2. Expose `appendMyRouter(ctx)` = `ensureRouterService(ctx).registerPlugin(makeMyPlugin())`.
71
+ 3. Set `priority` above the default (0) and a `match` that fires only in your environment.
72
+ 4. Keep the `RouterService` facade methods assignable (native-safety invariant).
73
+
74
+ ## Related
75
+
76
+ - [[router]] (host + matcher) · [[web-router]] (default browser plugin)
77
+ - `@owlmeans/web-router-react-router` (react-router plugin)