@owlmeans/create-app 0.1.13 → 0.1.14

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.
Files changed (30) hide show
  1. package/README.md +10 -0
  2. package/build/run.d.ts.map +1 -1
  3. package/build/run.js +26 -24
  4. package/build/run.js.map +1 -1
  5. package/build/template.d.ts.map +1 -1
  6. package/build/template.js +3 -0
  7. package/build/template.js.map +1 -1
  8. package/package.json +5 -5
  9. package/template/CLAUDE.md +58 -20
  10. package/template/README.md +13 -4
  11. package/template/_agents/memory/MEMORY.md +17 -0
  12. package/template/_claude/skills/agent-memory/SKILL.md +138 -0
  13. package/template/_claude/skills/getting-started/SKILL.md +104 -0
  14. package/template/_claude/skills/git/SKILL.md +53 -0
  15. package/template/_claude/skills/memory-promotion/SKILL.md +67 -0
  16. package/template/_claude/skills/memory-recompact/SKILL.md +71 -0
  17. package/template/_claude/skills/reuse-code/SKILL.md +63 -0
  18. package/template/_claude/skills/self-education/SKILL.md +68 -0
  19. package/template/_claude/skills/skill-authoring/SKILL.md +80 -0
  20. package/template/_github/copilot-instructions.md +65 -21
  21. package/template/_github/instructions/agent-memory.instructions.md +139 -0
  22. package/template/_github/instructions/getting-started.instructions.md +62 -0
  23. package/template/_github/instructions/git.instructions.md +52 -0
  24. package/template/_github/instructions/memory-promotion.instructions.md +67 -0
  25. package/template/_github/instructions/memory-recompact.instructions.md +72 -0
  26. package/template/_github/instructions/reuse-code.instructions.md +50 -0
  27. package/template/_github/instructions/self-education.instructions.md +69 -0
  28. package/template/_github/instructions/skill-authoring.instructions.md +62 -0
  29. package/template/_claude/memory/MEMORY.md +0 -11
  30. package/template/_github/memory/MEMORY.md +0 -11
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: memory-promotion
3
+ description: Transform procedure-shaped or repeatedly-used memory into skills and instructions — the procedure-shape test, 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, 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
+ ## Triggers
16
+
17
+ - **Procedure shape**: the content answers *how to do X* — ordered steps, imperative verbs,
18
+ command lines, if-this-do-that tables. Promote it.
19
+ - **Repeated touch**: an existing ` → promote?` flag on content you are touching again means
20
+ promote now; if mid-task, promotion becomes the first row of the completion report.
21
+ - **Over-cap**: a node past the 120-line hard cap with roughly a third or more procedure-shaped
22
+ content → promote the procedures instead of splitting the node.
23
+ - Corroborating only (weak — agents don't commit, so only user commits appear):
24
+ `git log --oneline -- .agents/memory/<node>.md` showing ≥ 3 commits within ~a month marks a
25
+ hot node worth evaluating.
26
+
27
+ ## Procedure-shape test
28
+
29
+ Procedure-shaped answers *how to do X*: ordered steps, imperative verbs, commands, action tables.
30
+ Fact-shaped answers *what is true*: declarative structure, invariants, symptom→cause pairs.
31
+ Mixed entries split — the fact stays in the node, the "then do" moves out.
32
+
33
+ ## Flagging (how content earns promotion)
34
+
35
+ When you **merge** procedure-shaped content into a node, or you **use** (not merely check) a
36
+ node's content to perform a task, append ` → promote?` to that line or section heading.
37
+ Evaluable by reading the file alone — no tooling required.
38
+
39
+ ## Update vs create
40
+
41
+ **Default is update** — extend the existing skill/instruction whose scope covers the activity,
42
+ even partially; keep both twins in sync. Create a NEW pair only when:
43
+
44
+ - (a) a new subsystem or technology entered the repo;
45
+ - (b) an activity with no covering skill needed memory read/write more than once (a
46
+ re-encountered ` → promote?` flag);
47
+ - (c) an external technology required internet docs and has no governing skill.
48
+
49
+ New skills multiply lookup cost — compactness applies to the skill population too.
50
+
51
+ ## Procedure
52
+
53
+ 1. Collect the flagged / procedure-shaped memory lines.
54
+ 2. Author or extend the SKILL.md and its `.github/instructions/<name>.instructions.md` twin,
55
+ following the repo's `skill-authoring` or `create-skill` conventions.
56
+ 3. Shrink the node: delete the promoted prose; leave one pointer line (format below).
57
+ 4. Remove the ` → promote?` flags.
58
+ 5. Update the node's index hook if its main value moved; bump `updated:`.
59
+ 6. Report per the Reporting rule.
60
+
61
+ ## Post-promotion state
62
+
63
+ The node keeps exactly one line under `## Pointers`:
64
+
65
+ ```
66
+ - <activity> → skill `<name>` (procedure lives in .claude/skills/<name>/ + .github/instructions/<name>.instructions.md)
67
+ ```
@@ -0,0 +1,71 @@
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`.
43
+
44
+ ## Legacy-store merge (migration)
45
+
46
+ 1. Union `.claude/memory/` and `.github/memory/`. Same-named files are two drifted sources of
47
+ ONE node — merge both; the code-consistent version wins.
48
+ 2. Index-only entries with no backing file: extract the fact into its node, or drop if stale.
49
+ 3. Old `## Skills` / "Key Files" index sections are dropped — skills self-describe; harness
50
+ layout belongs to `CLAUDE.md` / `.github/copilot-instructions.md`. Move genuinely non-obvious
51
+ dispatch hints there.
52
+ 4. When the new store verifies (below), delete both legacy dirs entirely.
53
+
54
+ ## Regenerate the index
55
+
56
+ Rebuild `MEMORY.md` from the resulting nodes per the `agent-memory` format — never edit the old
57
+ index incrementally.
58
+
59
+ ## Verify
60
+
61
+ - Every node file is listed in the index; every listed node exists; every wiki-link resolves.
62
+ - All caps met (index ≤ 50 lines; nodes ≤ 120; entries ≤ 3 lines; Status ≤ 5 dated lines).
63
+ - No dates outside `Status` and `updated:`; no event-keyed filenames.
64
+ - Both root instruction files' Memory sections point at `.agents/memory/`.
65
+ - Legacy dirs gone; `grep -rn '\.claude/memory\|\.github/memory'` over the repo's harness files
66
+ returns nothing but allowlisted historical mentions.
67
+
68
+ ## Report
69
+
70
+ One table: **Node** | **Sources merged** | **Lines before → after**. Follow the Reporting rule
71
+ (what, not why).
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: reuse-code
3
+ description: Discovery-first, reuse-first workflow for OwlMeans projects. Use BEFORE planning or building any feature, before proposing a third-party library or a custom solution, and after writing code. Find an existing @owlmeans/* package or existing code first; extend before writing new; simplify what you write.
4
+ user-invocable: true
5
+ scope: general
6
+ ---
7
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
8
+
9
+ # Reuse before you build
10
+
11
+ OwlMeans ships a large framework of `@owlmeans/*` packages. Before you propose a third-party library,
12
+ design a custom solution, or finish a feature, exhaust what already exists. Apply these four steps in
13
+ order — during planning **and** during implementation.
14
+
15
+ ## 1. Find an `@owlmeans/*` package first
16
+
17
+ Before suggesting any external library or writing custom code, look for an `@owlmeans/*` package that
18
+ already solves the problem.
19
+
20
+ - **Consult the deployed skills.** Each installed `@owlmeans/*` package ships a skill at
21
+ `.claude/skills/<pkg>/SKILL.md` (and `.github/instructions/<pkg>.instructions.md`) describing what it
22
+ does. Read those first — they are your local catalogue of installed capabilities.
23
+ - **Scan installed packages.** Look in `node_modules/@owlmeans/*` **and**, in a workspace monorepo,
24
+ the nested `sources/*/node_modules/@owlmeans/*` (bun nests workspace deps).
25
+ - **Discover packages that aren't installed yet** by researching the **owlmeans/common** repository —
26
+ its dependency map (`tree.md`) and the per-package READMEs name every package and its purpose.
27
+
28
+ ### Local vs. web research (the symlink rule)
29
+
30
+ How you research the repo depends on whether `@owlmeans/*` is linked locally:
31
+
32
+ - Run `ls -la node_modules/@owlmeans/<pkg>` (try a package you know is installed). If it is a **symlink
33
+ whose target escapes `node_modules`** — or if the project's *own* workspace publishes `@owlmeans/*`
34
+ packages (i.e. **this is the common repo**) — you have the source locally. **Research locally:** read
35
+ `tree.md`, browse the framework's package sources, and read the canonical `.claude/skills/`. **Do
36
+ not** use the internet.
37
+ - Otherwise (a clean install from npm), **research the web**: fetch/search
38
+ **https://github.com/owlmeans/common** — `tree.md` and package READMEs — to find the right package.
39
+
40
+ This is the same dev-linked detection `@owlmeans/agent-skills` uses (see its `detectLinked`). After
41
+ adding an `@owlmeans/*` dependency, run `npx @owlmeans/agent-skills` to deploy its skill. Prefer an
42
+ `@owlmeans/*` package over a third-party library or bespoke code whenever one fits.
43
+
44
+ ## 2. Reuse or extend before writing custom
45
+
46
+ If an installed package nearly fits, **configure or extend it** rather than writing something new — use
47
+ its resources, services, modules, and helpers. A small extension of a framework package beats a new
48
+ parallel implementation.
49
+
50
+ ## 3. No package? Reuse code and extract an abstraction
51
+
52
+ When no package solves it, search the codebase for code that already solves a **similar** problem.
53
+ Prefer factoring out a shared helper, base, or generic function — extract an abstraction — over
54
+ duplicating logic or writing from scratch. Only write genuinely new code when nothing reusable exists.
55
+
56
+ ## 4. Simplify after writing
57
+
58
+ Once code is written, review it: can it be **shorter, clearer, or expressed with fewer moving parts**?
59
+ Lean on framework utilities, remove dead branches, collapse needless indirection. Less code that reuses
60
+ the framework is better than more bespoke code.
61
+
62
+ See `[[dependency-tree]]` for the package map, `[[scaffolding]]` for how a project is assembled, and
63
+ `[[bun]]` for adding dependencies.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: self-education
3
+ description: Mandatory post-development guidance updating — after functionality is added or changed, update the project skills/instructions the work touched, record external-doc findings (URL + gist) in the governing skill, or add skills/instructions for new subsystems and technologies. Required before the completion report whenever development started from a plan agreed with the agent.
4
+ user-invocable: true
5
+ scope: general
6
+ ---
7
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
8
+
9
+ # Self-education
10
+
11
+ After functionality is added or changed, the guidance that describes it must catch up — the agent
12
+ teaches itself for next time. This pass runs after implementation and verification, **before**
13
+ the completion report.
14
+
15
+ ## When (mandatory)
16
+
17
+ Development "started from planning" when the session produced a plan the operator approved before
18
+ implementation — a plan-mode approval, an agreed written plan/spec, or an explicit "go ahead" on
19
+ a proposed approach. **Approval of a plan is simultaneously approval of its implicit final step:
20
+ this self-education pass.** A planned task is not finishable without it. If guidance files cannot
21
+ be edited (read-only run), list the required updates in the report instead.
22
+
23
+ Also recommended after any unplanned change that made an existing skill/instruction inaccurate.
24
+
25
+ ## Review checklist
26
+
27
+ For each area the work touched:
28
+
29
+ 1. Which existing skill/instruction covers it? (Check `.claude/skills/` +
30
+ `.github/instructions/`.)
31
+ 2. Do its commands, paths, APIs, and behavior claims still hold after the change?
32
+ 3. Fix in place — and keep the skill and its instruction twin in sync.
33
+
34
+ ## Non-project skills
35
+
36
+ If a general or imported skill gained an important usage pattern during the work, add the pattern
37
+ to the **deployed copy** in this repo and note it in the report as an upstream candidate —
38
+ canonical archive copies change only on explicit operator request.
39
+
40
+ ## External docs
41
+
42
+ If the work required reading internet documentation for an external API, library, or service,
43
+ the governing skill must record it under an `## External docs` heading:
44
+
45
+ ```
46
+ - <URL> — <one-line gist of what it settled> (<version/date if load-bearing>)
47
+ ```
48
+
49
+ Governing skill = the project skill covering the touched area; else the skill covering that
50
+ library; if none exists and the technology will recur, create one (update-vs-create rule in
51
+ `memory-promotion`). Never leave doc findings only in memory or the conversation.
52
+
53
+ ## New subsystems / technologies
54
+
55
+ When new technology or a new subsystem entered the repo: create the skill/instruction pair for
56
+ its procedures, and/or the `.agents/memory/` node for its facts — split along the
57
+ memory-vs-skill boundary (`agent-memory` / `memory-promotion`).
58
+
59
+ ## Completion gate
60
+
61
+ The completion report must contain a Self-education table:
62
+
63
+ | Item | Action | Path |
64
+ |---|---|---|
65
+ | <area/skill> | updated / created / none-needed | <path> |
66
+
67
+ "none-needed" requires a one-phrase reason. A post-plan completion report without this table is
68
+ a protocol violation.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: skill-authoring
3
+ description: How to add agent guidance to an OwlMeans project — author a Claude Code skill (.claude/skills/<name>/SKILL.md) and its matching GitHub Copilot instruction (.github/instructions/<name>.instructions.md), keep the two in sync, choose frontmatter, and decide skill vs memory. Use when asked to capture knowledge as a skill, add a slash command, or document a repeatable procedure.
4
+ user-invocable: true
5
+ scope: general
6
+ ---
7
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
8
+
9
+ # Authoring agent guidance (skills + instructions)
10
+
11
+ OwlMeans projects carry agent guidance in two parallel places so both Claude Code and GitHub
12
+ Copilot can use it:
13
+
14
+ | Tool | Location | Shape |
15
+ |---|---|---|
16
+ | Claude Code | `.claude/skills/<name>/SKILL.md` | one directory per skill, `SKILL.md` is the entrypoint |
17
+ | GitHub Copilot | `.github/instructions/<name>.instructions.md` | one file per topic |
18
+
19
+ Author **both** for any guidance you want available to either tool. Keep the same `<name>` on both
20
+ sides so they read as one topic.
21
+
22
+ ## SKILL.md (Claude Code)
23
+
24
+ ```
25
+ .claude/skills/<name>/
26
+ ├── SKILL.md # required — frontmatter + body
27
+ ├── reference.md # optional — deeper detail loaded on demand
28
+ └── scripts/ # optional — shell scripts the skill runs
29
+ ```
30
+
31
+ Frontmatter:
32
+
33
+ ```yaml
34
+ ---
35
+ name: my-skill # the /slash-command (lowercase, hyphens)
36
+ description: What it does and WHEN to use it. # primary auto-invocation signal
37
+ user-invocable: true # false = background knowledge only, hidden from the / menu
38
+ allowed-tools: Bash(bun *) Read # optional — tools usable without per-call approval
39
+ ---
40
+ ```
41
+
42
+ The `description` is the most important field: Claude uses it to decide when to auto-invoke the
43
+ skill, so describe both the topic and the trigger ("Use when …").
44
+
45
+ ## <name>.instructions.md (Copilot)
46
+
47
+ ```yaml
48
+ ---
49
+ description: "Short summary — apply when …"
50
+ applyTo: "**/*.ts, **/relevant/**" # globs that auto-attach this instruction
51
+ ---
52
+ ```
53
+
54
+ `applyTo` controls when Copilot pulls the instruction in. Use the file patterns the guidance is
55
+ actually about; fall back to `**/*.ts, **/*.tsx` if it is broadly relevant.
56
+
57
+ ## Keep the pair in sync
58
+
59
+ When you change one side, change the other. They do not have to be identical prose, but they must
60
+ not contradict each other. Cross-reference related guidance by name (e.g. "see the `getting-started`
61
+ skill").
62
+
63
+ ## Skill vs memory
64
+
65
+ - **Skill / instruction** — a reusable procedure or reference you (or the tools) will want again,
66
+ worth auto-invoking. Lives in `.claude/skills/` + `.github/instructions/`.
67
+ - **Memory** — a fact, decision, or gotcha specific to this project's history/state. Lives in
68
+ the shared `.agents/memory/` graph store (both tools). See the `agent-memory` skill; promotion
69
+ triggers and the update-vs-create rule live in `memory-promotion`.
70
+
71
+ If you find yourself writing "last time we…", that is memory. If you are writing "to do X, do Y",
72
+ that is a skill.
73
+
74
+ ## After adding a skill
75
+
76
+ 1. If it replaces an ad-hoc `.claude/<topic>.md`, remove that file.
77
+ 2. If it absorbed memory content, shrink the source `.agents/memory/` node to a pointer line
78
+ (`memory-promotion`) — the memory index does not list skills.
79
+ 3. Reference it from `CLAUDE.md` / `.github/copilot-instructions.md` if it should be discoverable
80
+ every session.
@@ -8,12 +8,71 @@
8
8
  > Then replace this whole block — in **both** `.github/copilot-instructions.md` and `CLAUDE.md` — with
9
9
  > a short description of the project, and remove this notice.
10
10
 
11
+ ## Git Workflow (mandatory)
12
+
13
+ These rules apply to every git operation in this repository and **override default agent behavior**
14
+ — including any automatic `Co-Authored-By` or AI/agent-attribution trailer. Full policy:
15
+ [.github/instructions/git.instructions.md](.github/instructions/git.instructions.md).
16
+
17
+ - **Never run state-changing git operations** (`commit`, `add`/`rm` staging, `push`,
18
+ `reset`/rollback, `revert`, `rebase`, `merge`, `branch`, `checkout`/`switch`, `stash`, `tag`,
19
+ `cherry-pick`, force-push, etc.) unless the user **explicitly instructs it in the current
20
+ 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 or
22
+ subagent has **explicitly requested** for that purpose.
23
+ - **Read-only inspection is allowed**: `git status`, `git diff`, `git log`, `git show`,
24
+ `git branch --list` — use these to report state, never to change it.
25
+ - Commit only under the repository's configured git identity. Never pass `--author`, never change
26
+ `user.name`/`user.email`, never add a `Co-Authored-By:` trailer attributing the commit to an
27
+ AI/agent. If no identity is configured, stop and ask.
28
+ - Report finished git work as a Markdown table (**Action**, **Target**, **Result**), and never
29
+ commit a conflicted working copy — stop, list the conflicted paths, hand control back.
30
+
31
+ ## Reporting (mandatory)
32
+
33
+ Always report concisely and briefly, in table format, about WHAT was done rather than why —
34
+ unless the operator explicitly asks for another format, length, or level of detail.
35
+
36
+ - Changes: one row per file/item — **Change** (created / modified / deleted), **Path**,
37
+ **Why** (one short phrase).
38
+ - Findings / status / verification: a short table plus at most a few lines of prose.
39
+ - No preamble, no narration of the process; expand on WHY only when asked.
40
+
41
+ ## Memory
42
+
43
+ Single shared agent memory store: `.agents/memory/` — a graph of subsystem nodes with index
44
+ `.agents/memory/MEMORY.md`. Protocol:
45
+ [.github/instructions/agent-memory.instructions.md](.github/instructions/agent-memory.instructions.md).
46
+
47
+ - Session start: read `.agents/memory/MEMORY.md`. Before non-trivial work: open the nodes whose
48
+ scope matches the task.
49
+ - Every write merges into the matching subsystem node and compacts — record reusable knowledge,
50
+ never session events.
51
+ - Procedure-shaped or repeatedly-touched memory must become an instruction/skill — follow
52
+ `.github/instructions/memory-promotion.instructions.md`.
53
+ - If the store degrades (event logs, oversized nodes, bloated index) — follow
54
+ `.github/instructions/memory-recompact.instructions.md`.
55
+ - Never write memory to `.claude/memory/`, `.github/memory/`, `~/.copilot/`, or anywhere outside
56
+ this repository.
57
+ - Context that must load every session belongs in this file; on-demand context goes in
58
+ `.github/instructions/<topic>.instructions.md`.
59
+
60
+ ## Self-Education (mandatory)
61
+
62
+ Whenever development started from a plan agreed with the agent, the work is not complete until
63
+ [.github/instructions/self-education.instructions.md](.github/instructions/self-education.instructions.md)
64
+ has been applied: update the project instructions/skills the change touched, record external-doc
65
+ findings (URL + gist) in the governing instruction, or add an instruction/skill for a new
66
+ subsystem or technology. The completion report must include the self-education outcome — or
67
+ state why none was needed.
68
+
11
69
  ## What this is
12
70
 
13
71
  `__APP_NAME__` is a fullstack [OwlMeans Common](https://github.com/owlmeans/common) app: a bun-workspace
14
72
  monorepo with three packages under `sources/` — `common` (shared route entrypoints, schemas, config),
15
- `api` (`@owlmeans/server-app` backend), and `web` (`@owlmeans/web-panel` + shadcn UI). See the
16
- `getting-started.instructions.md` for how the pieces fit together.
73
+ `api` (`@owlmeans/server-app` backend), and `web` (`@owlmeans/web-panel` + shadcn UI). See
74
+ `getting-started.instructions.md` for how the pieces fit together, and `scaffolding.instructions.md`
75
+ for how it was generated.
17
76
 
18
77
  ## Reuse before you build (mandatory)
19
78
 
@@ -22,24 +81,6 @@ Before planning or writing any feature, follow `reuse-code.instructions.md`: sea
22
81
  code that already solves the problem **before** proposing a third-party library or a custom solution,
23
82
  and simplify whatever you do write. This is required for every planning and development task.
24
83
 
25
- ## Memory & Meta-file Rules
26
-
27
- All project memory and meta-information lives **inside this project**, never in `~/.copilot/`:
28
-
29
- - **Always** write new memory files to `.github/memory/` in this project root.
30
- - **Always** update `.github/memory/MEMORY.md` when adding a memory file.
31
- - **Never** write project memory outside the repository.
32
- - Context that should load every session goes in `.github/copilot-instructions.md`; on-demand context
33
- goes in `.github/instructions/<topic>.instructions.md`.
34
- - When asked to remember something about this project, save it to `.github/memory/<topic>.md` and
35
- update the index. See `agent-memory.instructions.md`.
36
-
37
- ### When to read memory
38
-
39
- - **At the start of every session**: read `.github/memory/MEMORY.md`, then any relevant file.
40
- - **Before a non-trivial task**: read the relevant memory or instruction first.
41
- - **After completing a task** that produced new knowledge: save it to memory.
42
-
43
84
  ## Instructions
44
85
 
45
86
  Reusable guidance lives in `.github/instructions/<name>.instructions.md`, deployed by
@@ -47,7 +88,10 @@ Reusable guidance lives in `.github/instructions/<name>.instructions.md`, deploy
47
88
 
48
89
  - After adding or updating any `@owlmeans/*` dependency, run `npx @owlmeans/agent-skills` to refresh
49
90
  the deployed skills and instructions.
50
- - To capture your own guidance, see `skill-authoring.instructions.md`.
91
+ - Deployed files carry an `AUTO-GENERATED` banner and are refreshed in place — never hand-edit them.
92
+ - To capture your own guidance, see `skill-authoring.instructions.md`; to turn repeatedly-used memory
93
+ into an instruction, `memory-promotion.instructions.md`. Keep it inside this repository — never in
94
+ `~/.copilot/`.
51
95
 
52
96
  ## Develop
53
97
 
@@ -0,0 +1,139 @@
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.
@@ -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.