@owlmeans/create-app 0.1.13 → 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.
- package/README.md +10 -0
- package/build/run.d.ts.map +1 -1
- package/build/run.js +26 -24
- package/build/run.js.map +1 -1
- package/build/template.d.ts.map +1 -1
- package/build/template.js +3 -0
- package/build/template.js.map +1 -1
- package/package.json +5 -5
- package/template/CLAUDE.md +60 -20
- package/template/README.md +13 -4
- package/template/_agents/memory/MEMORY.md +17 -0
- package/template/_claude/skills/agent-memory/SKILL.md +142 -0
- package/template/_claude/skills/getting-started/SKILL.md +104 -0
- package/template/_claude/skills/git/SKILL.md +53 -0
- package/template/_claude/skills/memory-promotion/SKILL.md +111 -0
- package/template/_claude/skills/memory-recompact/SKILL.md +72 -0
- package/template/_claude/skills/reuse-code/SKILL.md +63 -0
- package/template/_claude/skills/self-education/SKILL.md +83 -0
- package/template/_claude/skills/skill-authoring/SKILL.md +84 -0
- package/template/_github/copilot-instructions.md +66 -21
- package/template/_github/instructions/agent-memory.instructions.md +143 -0
- package/template/_github/instructions/getting-started.instructions.md +62 -0
- package/template/_github/instructions/git.instructions.md +52 -0
- package/template/_github/instructions/memory-promotion.instructions.md +111 -0
- package/template/_github/instructions/memory-recompact.instructions.md +73 -0
- package/template/_github/instructions/reuse-code.instructions.md +50 -0
- package/template/_github/instructions/self-education.instructions.md +85 -0
- package/template/_github/instructions/skill-authoring.instructions.md +66 -0
- package/template/_claude/memory/MEMORY.md +0 -11
- package/template/_github/memory/MEMORY.md +0 -11
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Shared agent memory protocol for the .agents/memory/ graph store (single store for Copilot and Claude Code) — MEMORY.md index, subsystem nodes, compact-on-write, size caps, read protocol. Apply when reading or writing project memory, or when any legacy .claude/memory or .github/memory path appears."
|
|
3
|
+
applyTo: "**/.agents/memory/**, **/.claude/memory/**, **/.github/memory/**"
|
|
4
|
+
scope: general
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# Agent memory (`.agents/memory/`)
|
|
9
|
+
|
|
10
|
+
One shared memory store per repository, used by **both** GitHub Copilot and Claude Code: a graph
|
|
11
|
+
of subsystem nodes rooted in the `MEMORY.md` index. Compactness is the core value — every write
|
|
12
|
+
merges and compacts; nothing is ever appended as a log.
|
|
13
|
+
|
|
14
|
+
Never write memory to `.claude/memory/`, `.github/memory/`, `~/.copilot/`, `~/.claude/`, or
|
|
15
|
+
anywhere outside the repository. Legacy `.claude/memory/` / `.github/memory/` stores are
|
|
16
|
+
retired — if one exists, flag it for migration
|
|
17
|
+
(`.github/instructions/memory-recompact.instructions.md`) instead of writing there.
|
|
18
|
+
|
|
19
|
+
## Store layout
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
.agents/memory/
|
|
23
|
+
├── MEMORY.md # graph root: the only always-read file
|
|
24
|
+
└── <node>.md # one file per subsystem / concern / integration
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Flat directory — graph structure lives in scopes and wiki-links, not subdirectories.
|
|
28
|
+
|
|
29
|
+
## Node naming
|
|
30
|
+
|
|
31
|
+
Node id = lowercase-kebab name of the **project-structure part** the knowledge attaches to:
|
|
32
|
+
|
|
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).
|
|
38
|
+
|
|
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.
|
|
41
|
+
|
|
42
|
+
## Index format (`MEMORY.md`)
|
|
43
|
+
|
|
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
|
|
108
|
+
(`.github/instructions/memory-promotion.instructions.md`, else the skill-authoring guidance).
|
|
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 |
|
|
133
|
+
|
|
134
|
+
## Memory vs instruction
|
|
135
|
+
|
|
136
|
+
Fact-shaped ("what is true") stays here. Procedure-shaped ("to do X, do Y") becomes an
|
|
137
|
+
instruction/skill — follow `.github/instructions/memory-promotion.instructions.md` where present,
|
|
138
|
+
otherwise the skill-authoring guidance. Repeated use of a node to *perform* tasks, and over-cap
|
|
139
|
+
nodes full of steps, are promotion triggers.
|
|
140
|
+
|
|
141
|
+
Promotion is a **rewrite, never a move**: never paste node text into an instruction. "Record the
|
|
142
|
+
rule, not the story" and the size caps above bind instruction bodies at least as tightly as they
|
|
143
|
+
bind nodes (memory-promotion instruction → Distillation).
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "How to build a fullstack OwlMeans Common app — the common/api/web three-workspace pattern, server and web context bootstrap, shared entrypoints + elevate(), and a session-scoped in-memory resource via @owlmeans/static-resource. Apply when starting a new OwlMeans project or wiring web↔api."
|
|
3
|
+
applyTo: "**/modules.ts, **/context.ts, **/config.ts, **/render.tsx, **/index.tsx, **/sources/**"
|
|
4
|
+
scope: general
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# Building a fullstack OwlMeans Common app
|
|
9
|
+
|
|
10
|
+
A minimal app is a **bun-workspace monorepo with three packages**:
|
|
11
|
+
|
|
12
|
+
- `sources/common` — shared **entrypoints** (routes), AJV schemas, types and config. The single
|
|
13
|
+
source of truth.
|
|
14
|
+
- `sources/api` — `@owlmeans/server-app` backend; handlers attached to the shared entrypoints.
|
|
15
|
+
- `sources/web` — `@owlmeans/web-panel` + shadcn UI; screens attached to the same entrypoints.
|
|
16
|
+
|
|
17
|
+
Full walkthrough: `docs/getting-started.md`. To generate it: `npm create @owlmeans/app`.
|
|
18
|
+
|
|
19
|
+
## One contract, two sides
|
|
20
|
+
|
|
21
|
+
Declare each route once in `common`, then `elevate()` it on both sides:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
// common/modules.ts
|
|
25
|
+
export const sessionModules = [
|
|
26
|
+
entrypoint(route(session.list, '/:sid/items', { parent: session.base, method: RouteMethod.GET }),
|
|
27
|
+
filter(params(SessionParamsSchema))),
|
|
28
|
+
]
|
|
29
|
+
// api/modules.ts → elevate(sessionModules, session.list, handlers.list)
|
|
30
|
+
// web/modules.ts → elevate(modules, session.list) // call-only; screens via handler(Component)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Config
|
|
34
|
+
|
|
35
|
+
`common/config.ts` registers both services; `base: 'api'` prefixes API routes with `/api`:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
const cfg = service({ type: AppType.Frontend, service: APP_WEB, host: 'localhost', port: 3001 })
|
|
39
|
+
service({ type: AppType.Backend, service: APP_API, host: 'localhost', port: 3000, base: 'api' }, cfg)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Backend + in-memory data
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
const context = makeContext(cfg, true)
|
|
46
|
+
appendStaticResource(context, SESSION_ITEMS) // @owlmeans/static-resource — no DB
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Handlers (`handleRequest`/`handleBody`/`handleParams`) use `ctx.getStaticResource<T>(alias)`.
|
|
50
|
+
`static-resource.list()` accepts no criteria — list all and filter in JS. `main(context, appModules)`
|
|
51
|
+
starts the server. Swap for `@owlmeans/mongo-resource` / `redis-resource` when you need persistence.
|
|
52
|
+
|
|
53
|
+
## Web (shadcn)
|
|
54
|
+
|
|
55
|
+
`web-panel`'s `PanelApp` is shadcn/Tailwind v4. The app **provides** `@/lib/utils` and
|
|
56
|
+
`@/components/ui/{alert,button,card,input,label,progress}` at the `@` alias (→ `src`). Render with
|
|
57
|
+
`provide` from `@owlmeans/web-client`: `basicRender(<PanelApp context={context} provide={provide} />)`.
|
|
58
|
+
A parent `BASE` route renders the layout via `handler(Layout)`; `HOME` is its default child. Screens
|
|
59
|
+
call the API with `context.entrypoint(alias).call({ params, body })`.
|
|
60
|
+
|
|
61
|
+
This shape is auth-free by design; add `@owlmeans/server-auth` + `@owlmeans/client-auth` and
|
|
62
|
+
`guard(...)` when needed.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Mandatory git rules — never run state-changing git without explicit instruction, commit only under the user's configured identity (never as the AI/agent, no Co-Authored-By trailer), report finished git work as a Markdown table, and never commit a conflicted working copy. Consult before any git operation."
|
|
3
|
+
applyTo: "**"
|
|
4
|
+
scope: general
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# Git Workflow Rules
|
|
9
|
+
|
|
10
|
+
**Mandatory and universal.** These rules apply to every git operation in this repository and
|
|
11
|
+
**override any default agent behavior** — including any automatic `Co-Authored-By` or
|
|
12
|
+
AI/agent-attribution trailer. Consult them before running any git command.
|
|
13
|
+
|
|
14
|
+
## 0. Never run state-changing git without explicit instruction
|
|
15
|
+
|
|
16
|
+
- **Never run state-changing git operations** (`commit`, `add`/`rm` staging, `push`,
|
|
17
|
+
`reset`/rollback, `revert`, `rebase`, `merge`, `branch`, `checkout`/`switch`, `stash`,
|
|
18
|
+
`tag`, `cherry-pick`, force-push, etc.) unless the user **explicitly instructs it in the
|
|
19
|
+
current request**. Permission to make code edits is **not** permission to touch git.
|
|
20
|
+
- **Only exception**: creating and operating inside a **temporary git worktree** that a task
|
|
21
|
+
or subagent has **explicitly requested** for that purpose. Outside such an explicitly
|
|
22
|
+
requested tmp worktree, do nothing with git.
|
|
23
|
+
- **Read-only inspection is allowed**: `git status`, `git diff`, `git log`, `git show`,
|
|
24
|
+
`git branch --list`, etc. — use these to report state, never to change it.
|
|
25
|
+
|
|
26
|
+
## 1. Never commit under the agent's identity
|
|
27
|
+
|
|
28
|
+
- Commit only under the repository's preconfigured git identity — whatever `git config user.name`
|
|
29
|
+
and `git config user.email` resolve to (set by the user, globally or locally).
|
|
30
|
+
- **Never** override authorship: do not pass `--author`, do not set or change `user.name` /
|
|
31
|
+
`user.email`, and never substitute an AI / agent / assistant name or email.
|
|
32
|
+
- **Never** add a `Co-Authored-By:` trailer (or any other trailer) attributing the commit to
|
|
33
|
+
Claude, Copilot, or any AI/agent. Every commit is the user's, attributed solely to the user.
|
|
34
|
+
- If the repository has no git identity configured (neither local nor global), stop and ask the
|
|
35
|
+
user — do not invent one.
|
|
36
|
+
|
|
37
|
+
## 2. Always report finished git work as a table
|
|
38
|
+
|
|
39
|
+
- After completing any git action (commit, push, branch, checkout, merge, rebase, stash, tag,
|
|
40
|
+
reset, etc.), summarize what was done as a Markdown table.
|
|
41
|
+
- One row per action. Include at least **Action**, **Target** (branch / remote / files / ref),
|
|
42
|
+
and **Result** (commit SHA, `pushed`, `up to date`, `conflict`, …). Add a **Notes** column
|
|
43
|
+
when useful.
|
|
44
|
+
|
|
45
|
+
## 3. Never commit a conflicted working copy
|
|
46
|
+
|
|
47
|
+
- If a `merge`, `rebase`, `cherry-pick`, `stash pop`/`apply`, or `pull` produces conflicts,
|
|
48
|
+
**do not** finalize it: do not run `git commit`, `git merge --continue`,
|
|
49
|
+
`git rebase --continue`, or stage-and-commit the conflicted tree to "resolve" it on the
|
|
50
|
+
user's behalf.
|
|
51
|
+
- Stop, list the conflicted paths in the report table, and hand control back to the user —
|
|
52
|
+
unless the user has explicitly told you how to resolve the conflict and commit.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Promote procedure-shaped or hot memory into skills/instructions — triggers (procedure test, promote? flags, over-cap), the mandatory distillation rewrite, update-vs-create rule, post-promotion pointer state. Apply when converting memory content into guidance files or when a promote? flag appears in a memory node."
|
|
3
|
+
applyTo: "**/.agents/memory/**, **/.claude/skills/**, **/.github/instructions/**"
|
|
4
|
+
scope: general
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# Memory promotion
|
|
9
|
+
|
|
10
|
+
Memory holds **facts**; **procedures** belong in instructions/skills, where they auto-apply and
|
|
11
|
+
stop consuming memory-read cycles. Promotion is how the store stays compact and the harness
|
|
12
|
+
teaches itself.
|
|
13
|
+
|
|
14
|
+
Promotion is a **rewrite, never a move**. Memory text pasted into an instruction is the single
|
|
15
|
+
most common way this harness degrades — see Distillation below.
|
|
16
|
+
|
|
17
|
+
## Triggers
|
|
18
|
+
|
|
19
|
+
- **Procedure shape**: the content answers *how to do X* — ordered steps, imperative verbs,
|
|
20
|
+
command lines, if-this-do-that tables. Promote it.
|
|
21
|
+
- **Repeated touch**: an existing ` → promote?` flag on content you are touching again means
|
|
22
|
+
promote now; if mid-task, promotion becomes the first row of the completion report.
|
|
23
|
+
- **Over-cap**: a node past the 120-line hard cap with roughly a third or more procedure-shaped
|
|
24
|
+
content → promote the procedures instead of splitting the node.
|
|
25
|
+
- Corroborating only (weak — agents don't commit, so only user commits appear):
|
|
26
|
+
`git log --oneline -- .agents/memory/<node>.md` showing ≥ 3 commits within ~a month marks a
|
|
27
|
+
hot node worth evaluating.
|
|
28
|
+
|
|
29
|
+
## Procedure-shape test
|
|
30
|
+
|
|
31
|
+
Procedure-shaped answers *how to do X*: ordered steps, imperative verbs, commands, action tables.
|
|
32
|
+
Fact-shaped answers *what is true*: declarative structure, invariants, symptom→cause pairs.
|
|
33
|
+
Mixed entries split — the fact stays in the node, the "then do" is distilled into a rule in the
|
|
34
|
+
instruction.
|
|
35
|
+
|
|
36
|
+
## Distillation (mandatory)
|
|
37
|
+
|
|
38
|
+
**Never paste memory text into an instruction.** A promoted line leaves the node as prose about a
|
|
39
|
+
past occurrence and enters the instruction as **one general rule**: *when this applies → do this
|
|
40
|
+
→ or this breaks*, stated so it holds next time rather than describing last time.
|
|
41
|
+
|
|
42
|
+
| Strip | Keep |
|
|
43
|
+
|---|---|
|
|
44
|
+
| dates, phase/status markers, "COMPLETE", "landed" | the condition that makes the rule apply |
|
|
45
|
+
| versions, image tags, SHAs — unless the rule turns on the version | the step to take |
|
|
46
|
+
| "was X, now Y", "the former X was removed" | the failure it prevents |
|
|
47
|
+
| who did it, attempt sequences, incident narrative | the recognition fingerprint (symptom) |
|
|
48
|
+
| point-in-time inventories, counts, snapshots | |
|
|
49
|
+
|
|
50
|
+
Before (memory): "2026-07-05 — the control-board git card was removed; the dialog now owns all
|
|
51
|
+
git actions."
|
|
52
|
+
After (rule): "Git actions live in the git dialog; the control board holds none."
|
|
53
|
+
|
|
54
|
+
Before (memory): "Phase 3 (COMPLETE, 2026-06-13): added the init-container build, publisher
|
|
55
|
+
`src/build.ts`, kephemeral v0.1.5."
|
|
56
|
+
After (rule): "Production images build in an init container driven by `publisher/src/build.ts`."
|
|
57
|
+
|
|
58
|
+
**If the rule cannot be stated without saying when it happened, it is not promotable** — it stays
|
|
59
|
+
a memory fact, or it is dropped.
|
|
60
|
+
|
|
61
|
+
### Budget
|
|
62
|
+
|
|
63
|
+
A promotion normally adds **1–5 lines** to an existing instruction, and a single rule is ≤ 3 lines.
|
|
64
|
+
A whole new section, or more text added than the node lost, means the content was moved rather than
|
|
65
|
+
distilled — redo it.
|
|
66
|
+
|
|
67
|
+
An instruction may legitimately run long when it maps a large subsystem, so length alone is not the
|
|
68
|
+
test: **every line must be a rule, a contract, or a pointer.** A section that reads as the story of
|
|
69
|
+
how the code got there is pollution at any length. "Record the rule, not the story"
|
|
70
|
+
(`agent-memory.instructions.md`) binds instruction bodies at least as tightly as it binds nodes.
|
|
71
|
+
|
|
72
|
+
## Flagging (how content earns promotion)
|
|
73
|
+
|
|
74
|
+
When you **merge** procedure-shaped content into a node, or you **use** (not merely check) a
|
|
75
|
+
node's content to perform a task, append ` → promote?` to that line or section heading.
|
|
76
|
+
Evaluable by reading the file alone — no tooling required.
|
|
77
|
+
|
|
78
|
+
## Update vs create
|
|
79
|
+
|
|
80
|
+
**Default is update** — extend the existing instruction/skill whose scope covers the activity,
|
|
81
|
+
even partially; keep both twins in sync. Create a NEW pair only when:
|
|
82
|
+
|
|
83
|
+
- (a) a new subsystem or technology entered the repo;
|
|
84
|
+
- (b) an activity with no covering instruction needed memory read/write more than once (a
|
|
85
|
+
re-encountered ` → promote?` flag);
|
|
86
|
+
- (c) an external technology required internet docs and has no governing instruction.
|
|
87
|
+
|
|
88
|
+
New instructions multiply lookup cost — compactness applies to the guidance population *and* to
|
|
89
|
+
each instruction's body.
|
|
90
|
+
|
|
91
|
+
## Procedure
|
|
92
|
+
|
|
93
|
+
1. Collect the flagged / procedure-shaped memory lines.
|
|
94
|
+
2. **Distill** each into a general rule (section above). Not optional — skipping it is the
|
|
95
|
+
failure mode this instruction exists to prevent.
|
|
96
|
+
3. Author or extend the `.github/instructions/<name>.instructions.md` and its
|
|
97
|
+
`.claude/skills/<name>/SKILL.md` twin, following the repo's skill-authoring / create-skill
|
|
98
|
+
conventions. Where an existing rule already covers the ground, **rewrite that rule in place**;
|
|
99
|
+
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,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Whole-store memory recompaction and migration for .agents/memory/ — rebuild node map from project structure, merge records, enforce caps, regenerate the index, fold in and delete legacy .claude/memory and .github/memory stores. Apply when restructuring a memory store or migrating legacy stores."
|
|
3
|
+
applyTo: "**/.agents/memory/**, **/.claude/memory/**, **/.github/memory/**"
|
|
4
|
+
scope: general
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# Memory recompaction
|
|
9
|
+
|
|
10
|
+
Whole-store maintenance for `.agents/memory/` (protocol:
|
|
11
|
+
`.github/instructions/agent-memory.instructions.md`). Also the migration procedure for legacy
|
|
12
|
+
`.claude/memory/` + `.github/memory/` stores. Store-wide rewrite — propose it when triggers
|
|
13
|
+
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
|
|
43
|
+
`.github/instructions/memory-promotion.instructions.md`. Routing means distilling them into
|
|
44
|
+
general rules, never handing the text over verbatim.
|
|
45
|
+
|
|
46
|
+
## Legacy-store merge (migration)
|
|
47
|
+
|
|
48
|
+
1. Union `.claude/memory/` and `.github/memory/`. Same-named files are two drifted sources of
|
|
49
|
+
ONE node — merge both; the code-consistent version wins.
|
|
50
|
+
2. Index-only entries with no backing file: extract the fact into its node, or drop if stale.
|
|
51
|
+
3. Old `## Skills` / "Key Files" index sections are dropped — skills self-describe; harness
|
|
52
|
+
layout belongs to `CLAUDE.md` / `.github/copilot-instructions.md`. Move genuinely non-obvious
|
|
53
|
+
dispatch hints there.
|
|
54
|
+
4. When the new store verifies (below), delete both legacy dirs entirely.
|
|
55
|
+
|
|
56
|
+
## Regenerate the index
|
|
57
|
+
|
|
58
|
+
Rebuild `MEMORY.md` from the resulting nodes per the agent-memory format — never edit the old
|
|
59
|
+
index incrementally.
|
|
60
|
+
|
|
61
|
+
## Verify
|
|
62
|
+
|
|
63
|
+
- Every node file is listed in the index; every listed node exists; every wiki-link resolves.
|
|
64
|
+
- All caps met (index ≤ 50 lines; nodes ≤ 120; entries ≤ 3 lines; Status ≤ 5 dated lines).
|
|
65
|
+
- No dates outside `Status` and `updated:`; no event-keyed filenames.
|
|
66
|
+
- Both root instruction files' Memory sections point at `.agents/memory/`.
|
|
67
|
+
- Legacy dirs gone; `grep -rn '\.claude/memory\|\.github/memory'` over the repo's harness files
|
|
68
|
+
returns nothing but allowlisted historical mentions.
|
|
69
|
+
|
|
70
|
+
## Report
|
|
71
|
+
|
|
72
|
+
One table: **Node** | **Sources merged** | **Lines before → after**. Follow the Reporting rule
|
|
73
|
+
(what, not why).
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Discovery-first, reuse-first workflow for OwlMeans projects. Apply before planning or building any feature, before proposing a third-party library or custom solution, and after writing code: find an existing @owlmeans/* package or existing code first, extend before writing new, and simplify what you write."
|
|
3
|
+
applyTo: "**/*.ts, **/*.tsx, **/package.json"
|
|
4
|
+
scope: general
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# Reuse before you build
|
|
9
|
+
|
|
10
|
+
OwlMeans ships a large framework of `@owlmeans/*` packages. Before proposing a third-party library,
|
|
11
|
+
designing a custom solution, or finishing a feature, exhaust what already exists. Apply these four
|
|
12
|
+
steps in order — during planning **and** implementation.
|
|
13
|
+
|
|
14
|
+
## 1. Find an `@owlmeans/*` package first
|
|
15
|
+
|
|
16
|
+
- **Consult the deployed instructions.** Each installed `@owlmeans/*` package ships
|
|
17
|
+
`.github/instructions/<pkg>.instructions.md` (and `.claude/skills/<pkg>/SKILL.md`) describing what it
|
|
18
|
+
does — your local catalogue of installed capabilities.
|
|
19
|
+
- **Scan installed packages** in `node_modules/@owlmeans/*` and, in a workspace, the nested
|
|
20
|
+
`sources/*/node_modules/@owlmeans/*`.
|
|
21
|
+
- **Discover not-yet-installed packages** by researching the **owlmeans/common** repository — its
|
|
22
|
+
`tree.md` dependency map and per-package READMEs.
|
|
23
|
+
|
|
24
|
+
### Local vs. web research (the symlink rule)
|
|
25
|
+
|
|
26
|
+
- `ls -la node_modules/@owlmeans/<pkg>`: a **symlink escaping `node_modules`** — or a project whose own
|
|
27
|
+
workspace publishes `@owlmeans/*` packages (**this is the common repo**) — means the source is local.
|
|
28
|
+
**Research locally** (`tree.md`, the package sources, the canonical instructions); do **not** use the
|
|
29
|
+
internet.
|
|
30
|
+
- Otherwise (clean npm install), **research the web**: https://github.com/owlmeans/common.
|
|
31
|
+
|
|
32
|
+
After adding an `@owlmeans/*` dependency, run `npx @owlmeans/agent-skills` to deploy its instruction.
|
|
33
|
+
Prefer an `@owlmeans/*` package over a third-party library or bespoke code.
|
|
34
|
+
|
|
35
|
+
## 2. Reuse or extend before writing custom
|
|
36
|
+
|
|
37
|
+
If an installed package nearly fits, configure or extend it (its resources, services, modules, helpers)
|
|
38
|
+
rather than writing a parallel implementation.
|
|
39
|
+
|
|
40
|
+
## 3. No package? Reuse code and extract an abstraction
|
|
41
|
+
|
|
42
|
+
Search the codebase for code solving a **similar** problem. Factor out a shared helper or abstraction
|
|
43
|
+
instead of duplicating or starting from scratch. Write new code only when nothing reusable exists.
|
|
44
|
+
|
|
45
|
+
## 4. Simplify after writing
|
|
46
|
+
|
|
47
|
+
Review new code: can it be shorter, clearer, fewer moving parts? Lean on framework utilities, drop dead
|
|
48
|
+
branches. Less code that reuses the framework beats more bespoke code.
|
|
49
|
+
|
|
50
|
+
See the `dependency-tree`, `scaffolding`, and `bun` instructions.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Mandatory post-development skill/instruction updating — after adding or changing functionality, rewrite touched project guidance as current rules (never as change notes), note external-doc findings in the governing instruction, or add instructions for new subsystems/technologies; required before the completion report when development started from an agreed plan. Apply when editing skills or instruction files after development."
|
|
3
|
+
applyTo: "**/.claude/skills/**, **/.github/instructions/**"
|
|
4
|
+
scope: general
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# Self-education
|
|
9
|
+
|
|
10
|
+
After functionality is added or changed, the guidance that describes it must catch up — the agent
|
|
11
|
+
teaches itself for next time. This pass runs after implementation and verification, **before**
|
|
12
|
+
the completion report.
|
|
13
|
+
|
|
14
|
+
## When (mandatory)
|
|
15
|
+
|
|
16
|
+
Development "started from planning" when the session produced a plan the operator approved before
|
|
17
|
+
implementation — a plan approval, an agreed written plan/spec, or an explicit "go ahead" on a
|
|
18
|
+
proposed approach. **Approval of a plan is simultaneously approval of its implicit final step:
|
|
19
|
+
this self-education pass.** A planned task is not finishable without it. If guidance files cannot
|
|
20
|
+
be edited (read-only run), list the required updates in the report instead.
|
|
21
|
+
|
|
22
|
+
Also recommended after any unplanned change that made an existing instruction/skill inaccurate.
|
|
23
|
+
|
|
24
|
+
## Review checklist
|
|
25
|
+
|
|
26
|
+
For each area the work touched:
|
|
27
|
+
|
|
28
|
+
1. Which existing instruction/skill covers it? (Check `.github/instructions/` +
|
|
29
|
+
`.claude/skills/`.)
|
|
30
|
+
2. Do its commands, paths, APIs, and behavior claims still hold after the change?
|
|
31
|
+
3. Fix in place — rewrite the affected lines so they describe current behavior; never append a
|
|
32
|
+
note about what this change did. Keep the instruction and its skill twin in sync.
|
|
33
|
+
|
|
34
|
+
## Shape of an update
|
|
35
|
+
|
|
36
|
+
Instructions and skills state **current rules, not what changed**. Every edit is a rewrite in
|
|
37
|
+
place of the affected lines.
|
|
38
|
+
|
|
39
|
+
Never write into an instruction or skill: dated bulletins ("2026-07-05 — …"), phase or migration
|
|
40
|
+
status ("Phase 3 complete", "migration done", "landed"), "formerly X, now Y", incident
|
|
41
|
+
narratives, fixed-bug logs, or point-in-time inventories. If a line only makes sense to someone
|
|
42
|
+
who watched the change happen, it does not belong in guidance — the rule it taught does, stated
|
|
43
|
+
timelessly. Facts too specific to generalize go to `.agents/memory/`
|
|
44
|
+
(`.github/instructions/agent-memory.instructions.md`); the rewrite recipe is
|
|
45
|
+
`.github/instructions/memory-promotion.instructions.md` → Distillation.
|
|
46
|
+
|
|
47
|
+
Test: a finished instruction reads as though the feature was always this way.
|
|
48
|
+
|
|
49
|
+
## Non-project instructions
|
|
50
|
+
|
|
51
|
+
If a general or imported instruction gained an important usage pattern during the work, add the
|
|
52
|
+
pattern to the **deployed copy** in this repo and note it in the report as an upstream
|
|
53
|
+
candidate — canonical archive copies change only on explicit operator request.
|
|
54
|
+
|
|
55
|
+
## External docs
|
|
56
|
+
|
|
57
|
+
If the work required reading internet documentation for an external API, library, or service,
|
|
58
|
+
the governing instruction must record it under an `## External docs` heading:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
- <URL> — <one-line gist of what it settled> (<version/date if load-bearing>)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Governing instruction = the project instruction covering the touched area; else the one covering
|
|
65
|
+
that library; if none exists and the technology will recur, create one (update-vs-create rule in
|
|
66
|
+
`.github/instructions/memory-promotion.instructions.md`). Never leave doc findings only in
|
|
67
|
+
memory or the conversation.
|
|
68
|
+
|
|
69
|
+
## New subsystems / technologies
|
|
70
|
+
|
|
71
|
+
When new technology or a new subsystem entered the repo: create the instruction/skill pair for
|
|
72
|
+
its procedures, and/or the `.agents/memory/` node for its facts — split along the
|
|
73
|
+
memory-vs-instruction boundary (`.github/instructions/agent-memory.instructions.md` /
|
|
74
|
+
`.github/instructions/memory-promotion.instructions.md`).
|
|
75
|
+
|
|
76
|
+
## Completion gate
|
|
77
|
+
|
|
78
|
+
The completion report must contain a Self-education table:
|
|
79
|
+
|
|
80
|
+
| Item | Action | Path |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| <area/skill> | updated / created / none-needed | <path> |
|
|
83
|
+
|
|
84
|
+
"none-needed" requires a one-phrase reason. A post-plan completion report without this table is
|
|
85
|
+
a protocol violation.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "How to add agent guidance to an OwlMeans project — author a Claude Code skill (.claude/skills/<name>/SKILL.md) and the matching Copilot instruction (.github/instructions/<name>.instructions.md), keep them in sync, and choose skill vs memory. Apply when capturing knowledge as a skill or instruction."
|
|
3
|
+
applyTo: "**/.claude/skills/**, **/.github/instructions/**"
|
|
4
|
+
scope: general
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# Authoring agent guidance (skills + instructions)
|
|
9
|
+
|
|
10
|
+
OwlMeans projects carry agent guidance in two parallel places so both Claude Code and GitHub
|
|
11
|
+
Copilot can use it:
|
|
12
|
+
|
|
13
|
+
| Tool | Location | Shape |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| Claude Code | `.claude/skills/<name>/SKILL.md` | one directory per skill, `SKILL.md` is the entrypoint |
|
|
16
|
+
| GitHub Copilot | `.github/instructions/<name>.instructions.md` | one file per topic |
|
|
17
|
+
|
|
18
|
+
Author **both** for any guidance you want available to either tool, using the same `<name>` on both
|
|
19
|
+
sides so they read as one topic.
|
|
20
|
+
|
|
21
|
+
## SKILL.md frontmatter (Claude Code)
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
---
|
|
25
|
+
name: my-skill # the /slash-command (lowercase, hyphens)
|
|
26
|
+
description: What it does and WHEN to use it. # primary auto-invocation signal
|
|
27
|
+
user-invocable: true # false = background knowledge only
|
|
28
|
+
allowed-tools: Bash(bun *) Read # optional
|
|
29
|
+
---
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The `description` decides when Claude auto-invokes the skill — describe the topic and the trigger.
|
|
33
|
+
|
|
34
|
+
## Instruction frontmatter (Copilot)
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
---
|
|
38
|
+
description: "Short summary — apply when …"
|
|
39
|
+
applyTo: "**/*.ts, **/relevant/**" # globs that auto-attach this instruction
|
|
40
|
+
---
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`applyTo` controls when Copilot attaches the instruction. Use the patterns the guidance is about;
|
|
44
|
+
fall back to `**/*.ts, **/*.tsx` if broadly relevant.
|
|
45
|
+
|
|
46
|
+
## Keep the pair in sync
|
|
47
|
+
|
|
48
|
+
Change one side, change the other. They need not be identical prose but must not contradict.
|
|
49
|
+
Cross-reference related guidance by name.
|
|
50
|
+
|
|
51
|
+
## Skill vs memory
|
|
52
|
+
|
|
53
|
+
- **Skill / instruction** — a reusable procedure or reference worth auto-invoking.
|
|
54
|
+
- **Memory** (shared `.agents/memory/` graph store, both tools) — a fact, decision, or gotcha
|
|
55
|
+
specific to this project's history. See the agent-memory instruction; promotion triggers live
|
|
56
|
+
in the memory-promotion instruction.
|
|
57
|
+
|
|
58
|
+
Never paste memory text into guidance. Memory content enters an instruction or skill only as a
|
|
59
|
+
restated general rule — trigger, step, and the failure it prevents, with dates, phase/status
|
|
60
|
+
markers, versions and incident narrative stripped (memory-promotion instruction → Distillation).
|
|
61
|
+
|
|
62
|
+
## After adding a skill
|
|
63
|
+
|
|
64
|
+
If it distilled memory content into rules, shrink the source `.agents/memory/` node to a pointer line
|
|
65
|
+
(memory-promotion instruction) — the memory index does not list skills. Reference it from
|
|
66
|
+
`.github/copilot-instructions.md` / `CLAUDE.md` if it should be discoverable every session.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Memory Index
|
|
2
|
-
|
|
3
|
-
Read this at the start of every session. Load any file relevant to the current task before acting.
|
|
4
|
-
|
|
5
|
-
When you learn something durable about __APP_NAME__ that isn't obvious from the code or git history —
|
|
6
|
-
a decision and why, a gotcha, project state or goals — save it to `.claude/memory/<topic>.md` and add
|
|
7
|
-
a one-line pointer below. See the `agent-memory` skill.
|
|
8
|
-
|
|
9
|
-
## Memory files
|
|
10
|
-
|
|
11
|
-
_(none yet)_
|