@owlmeans/create-app 0.1.18-rc.2 → 0.1.18-rc.21
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 +38 -1
- package/build/args.d.ts +8 -0
- package/build/args.d.ts.map +1 -1
- package/build/args.js +60 -6
- package/build/args.js.map +1 -1
- package/build/index.d.ts +4 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/naming.d.ts +11 -0
- package/build/naming.d.ts.map +1 -0
- package/build/naming.js +18 -0
- package/build/naming.js.map +1 -0
- package/build/run.d.ts.map +1 -1
- package/build/run.js +19 -13
- package/build/run.js.map +1 -1
- package/build/scaffold.d.ts +21 -0
- package/build/scaffold.d.ts.map +1 -0
- package/build/scaffold.js +18 -0
- package/build/scaffold.js.map +1 -0
- package/build/template.d.ts +19 -3
- package/build/template.d.ts.map +1 -1
- package/build/template.js +52 -12
- package/build/template.js.map +1 -1
- package/package.json +4 -3
- package/template/AGENTS.md +28 -1
- package/template/README.bare.md +57 -0
- package/template/README.md +5 -61
- package/template/_agents/scripts/link-skills.sh +310 -15
- package/template/_agents/skills/agent-memory/SKILL.md +12 -11
- package/template/_agents/skills/getting-started/SKILL.md +26 -86
- package/template/_agents/skills/memory-promotion/SKILL.md +10 -4
- package/template/_agents/skills/memory-recompact/SKILL.md +15 -14
- package/template/_agents/skills/reuse-code/SKILL.md +36 -8
- package/template/_agents/skills/self-education/SKILL.md +19 -5
- package/template/_agents/skills/skill-authoring/SKILL.md +53 -11
- package/template/_bare.json +23 -0
- package/template/_gitignore +3 -0
- package/template/bunfig.toml +2 -0
- package/template/package.json +3 -2
- package/template/sources/api/package.json +3 -3
- package/template/sources/api/src/app/session/add.ts +7 -6
- package/template/sources/api/src/app/session/list.ts +12 -9
- package/template/sources/api/src/app/session/remove.ts +7 -6
- package/template/sources/api/src/context.bare.ts +11 -0
- package/template/sources/api/src/entrypoints.bare.ts +4 -0
- package/template/sources/api/src/entrypoints.ts +13 -0
- package/template/sources/api/src/index.ts +2 -2
- package/template/sources/api/src/types.bare.ts +5 -0
- package/template/sources/common/package.json +6 -6
- package/template/sources/common/src/consts.bare.ts +8 -0
- package/template/sources/common/src/consts.ts +0 -13
- package/template/sources/common/src/entrypoints.bare.ts +14 -0
- package/template/sources/common/src/entrypoints.ts +60 -0
- package/template/sources/common/src/index.bare.ts +3 -0
- package/template/sources/common/src/index.ts +1 -1
- package/template/sources/common/src/schemas.ts +7 -7
- package/template/sources/web/index.html +3 -1
- package/template/sources/web/package.json +13 -11
- package/template/sources/web/src/components/ui/navigation-menu.tsx +169 -0
- package/template/sources/web/src/context.bare.ts +13 -0
- package/template/sources/web/src/context.ts +14 -2
- package/template/sources/web/src/entrypoints.bare.ts +13 -0
- package/template/sources/web/src/entrypoints.ts +16 -0
- package/template/sources/web/src/index.css +7 -0
- package/template/sources/web/src/index.tsx +2 -2
- package/template/sources/web/src/layout/main.tsx +16 -19
- package/template/sources/web/src/nav.bare.ts +21 -0
- package/template/sources/web/src/nav.ts +28 -0
- package/template/sources/web/src/screens/about.tsx +19 -0
- package/template/sources/web/src/screens/home.bare.tsx +17 -0
- package/template/sources/web/src/screens/session.tsx +28 -14
- package/template/sources/web/src/vite-env.d.ts +1 -0
- package/template/sources/api/src/modules.ts +0 -11
- package/template/sources/common/src/modules.ts +0 -26
- package/template/sources/web/src/components/nav/main.tsx +0 -15
- package/template/sources/web/src/modules.ts +0 -20
|
@@ -1,105 +1,45 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: getting-started
|
|
3
|
-
description:
|
|
4
|
-
user-invocable: true
|
|
3
|
+
description: Start a protocol-first OwlMeans application with shared contracts, server entrypoints and browser entrypoints.
|
|
5
4
|
metadata:
|
|
6
5
|
scope: general
|
|
7
6
|
---
|
|
8
7
|
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
9
8
|
|
|
10
|
-
#
|
|
9
|
+
# Protocol-first application shape
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
sources/
|
|
16
|
-
├── common/ # shared entrypoints (routes), AJV schemas, types, config — the single source of truth
|
|
17
|
-
├── api/ # @owlmeans/server-app backend; handlers attached to the shared entrypoints
|
|
18
|
-
└── web/ # @owlmeans/web-panel + shadcn UI; screens attached to the same entrypoints
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
The full, runnable walkthrough (scaffolded **and** manual) lives in
|
|
22
|
-
[`docs/getting-started.md`](../../../docs/getting-started.md). To generate this exact project, use
|
|
23
|
-
[[scaffolding]] (`npm create @owlmeans/app`). This skill is the mental model.
|
|
24
|
-
|
|
25
|
-
## The core idea: one contract, two sides
|
|
26
|
-
|
|
27
|
-
Declare each route once in `common` as an **entrypoint**, then `elevate()` it on each side:
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
// common/modules.ts — declaration + validation, no implementation
|
|
31
|
-
export const sessionModules = [
|
|
32
|
-
entrypoint(route(session.base, '/session')),
|
|
33
|
-
entrypoint(route(session.list, '/:sid/items', { parent: session.base, method: RouteMethod.GET }),
|
|
34
|
-
filter(params<SessionParams>(SessionParamsSchema))),
|
|
35
|
-
entrypoint(route(session.add, '/:sid/items', { parent: session.base, method: RouteMethod.POST }),
|
|
36
|
-
filter(params<SessionParams>(SessionParamsSchema, body<AddItemPayload>(AddItemSchema)))),
|
|
37
|
-
]
|
|
38
|
-
```
|
|
11
|
+
An OwlMeans application owns one shared protocol declaration and creates local entrypoints for each
|
|
12
|
+
runtime. The declaration is never modified by a server or browser.
|
|
39
13
|
|
|
40
14
|
```ts
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
15
|
+
// common/src/entrypoints.ts
|
|
16
|
+
export const sessionEntrypoints = {
|
|
17
|
+
list: protocol(
|
|
18
|
+
route(session.list, '/session', backend()),
|
|
19
|
+
contract.request({ query: typed<SessionQuery>(SessionQuerySchema) }, typed<Session[]>())
|
|
20
|
+
),
|
|
21
|
+
}
|
|
44
22
|
```
|
|
45
23
|
|
|
46
24
|
```ts
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
[[server-app]], [[web-client]], [[web-panel]].
|
|
54
|
-
|
|
55
|
-
## Shared config (where services live)
|
|
56
|
-
|
|
57
|
-
`common/config.ts` registers both services so the web knows where the API is. `base: 'api'`
|
|
58
|
-
prefixes API routes with `/api`:
|
|
59
|
-
|
|
60
|
-
```ts
|
|
61
|
-
const cfg = service({ type: AppType.Frontend, service: APP_WEB, host: 'localhost', port: 3001 })
|
|
62
|
-
service({ type: AppType.Backend, service: APP_API, host: 'localhost', port: 3000, base: 'api' }, cfg)
|
|
63
|
-
cfg.debug = { all: true }
|
|
64
|
-
export const commonConfig = cfg
|
|
25
|
+
// api/src/entrypoints.ts
|
|
26
|
+
const api = handlers<Context>()
|
|
27
|
+
export const appEntrypoints = [
|
|
28
|
+
...frameworkEntrypoints,
|
|
29
|
+
bind(sessionEntrypoints.list, api.request(sessionEntrypoints.list, listSessions)),
|
|
30
|
+
]
|
|
65
31
|
```
|
|
66
32
|
|
|
67
|
-
api: `config(APP_API, commonConfig)` (+ `cfg.port`). web: `config(APP_WEB, commonConfig)`. See [[config]].
|
|
68
|
-
|
|
69
|
-
## Backend bootstrap + in-memory data
|
|
70
|
-
|
|
71
33
|
```ts
|
|
72
|
-
//
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
Handlers use `handleRequest` / `handleBody` / `handleParams` (validated payload, then context, then
|
|
78
|
-
req). Read/write `ctx.getStaticResource<T>(alias)` — full CRUD (`get/load/list/create/save/delete`).
|
|
79
|
-
**`static-resource.list()` takes no criteria** — list all and filter in JS (e.g. by `sessionId`).
|
|
80
|
-
`main(context, appModules)` starts the server. See [[static-resource]], [[server-app]], [[resource]].
|
|
81
|
-
|
|
82
|
-
Swap `@owlmeans/static-resource` for [[mongo-resource]] / [[redis-resource]] when you need
|
|
83
|
-
persistence — the handler shape is identical.
|
|
84
|
-
|
|
85
|
-
## Web bootstrap (shadcn)
|
|
86
|
-
|
|
87
|
-
`@owlmeans/web-panel`'s `PanelApp` is shadcn/Tailwind v4 (no MUI). The **app provides** the shadcn
|
|
88
|
-
primitives at the `@` alias — `web-panel` references `@/lib/utils` and
|
|
89
|
-
`@/components/ui/{alert,button,card,input,label,progress}`; copy those into `src/`. Render with
|
|
90
|
-
`provide` from `@owlmeans/web-client`:
|
|
34
|
+
// web/src/entrypoints.ts
|
|
35
|
+
export const appEntrypoints = [
|
|
36
|
+
...frameworkEntrypoints,
|
|
37
|
+
...bindAll(sessionEntrypoints),
|
|
38
|
+
]
|
|
91
39
|
|
|
92
|
-
|
|
93
|
-
basicRender(<PanelApp context={context} provide={provide} />)
|
|
40
|
+
const sessions = await context.entrypoint(sessionEntrypoints.list).call({ query: { sid } })
|
|
94
41
|
```
|
|
95
42
|
|
|
96
|
-
`
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
Screens call the backend with `context.entrypoint(alias).call({ params, body })` → `[data, outcome]`.
|
|
100
|
-
See [[web-panel]], [[web-client]], [[shadcn-web]], [[client-entrypoint]].
|
|
101
|
-
|
|
102
|
-
## Authentication
|
|
103
|
-
|
|
104
|
-
This shape is intentionally **auth-free**. To add it: `@owlmeans/server-auth` + `@owlmeans/client-auth`
|
|
105
|
-
and `guard(...)` on entrypoints. See [[auth-protocol]], [[server-auth]], [[client-auth]].
|
|
43
|
+
Use `schema<T>(...)` or `typed<T>(...)` at the contract boundary. Bind all route parents with their
|
|
44
|
+
children. Keep organization entity values on the wire as `entitySlug`; database relations use
|
|
45
|
+
`entityId` only.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memory-promotion
|
|
3
|
-
description: Transform procedure-shaped or repeatedly-used memory into skills
|
|
3
|
+
description: Transform procedure-shaped or repeatedly-used memory into skills — 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
4
|
user-invocable: true
|
|
5
5
|
metadata:
|
|
6
6
|
scope: general
|
|
@@ -9,7 +9,7 @@ metadata:
|
|
|
9
9
|
|
|
10
10
|
# Memory promotion
|
|
11
11
|
|
|
12
|
-
Memory holds **facts**; **procedures** belong in skills
|
|
12
|
+
Memory holds **facts**; **procedures** belong in skills, where they auto-invoke and
|
|
13
13
|
stop consuming memory-read cycles. Promotion is how the store stays compact and the harness
|
|
14
14
|
teaches itself.
|
|
15
15
|
|
|
@@ -79,8 +79,8 @@ Evaluable by reading the file alone — no tooling required.
|
|
|
79
79
|
|
|
80
80
|
## Update vs create
|
|
81
81
|
|
|
82
|
-
**Default is update** — extend the existing skill
|
|
83
|
-
|
|
82
|
+
**Default is update** — extend the existing skill whose scope covers the activity, even
|
|
83
|
+
partially. Create a NEW skill only when:
|
|
84
84
|
|
|
85
85
|
- (a) a new subsystem or technology entered the repo;
|
|
86
86
|
- (b) an activity with no covering skill needed memory read/write more than once (a
|
|
@@ -90,6 +90,12 @@ even partially; keep both twins in sync. Create a NEW pair only when:
|
|
|
90
90
|
New skills multiply lookup cost — compactness applies to the skill population *and* to each
|
|
91
91
|
skill's body.
|
|
92
92
|
|
|
93
|
+
The covering skill may be one this project does not own — a `.agents/linked-skills/<name>` entry
|
|
94
|
+
symlinked into an upstream repo or installed package, or an installer-placed copy carrying the
|
|
95
|
+
`AUTO-GENERATED` banner. Never write the promotion into either: put the distilled rule in a local
|
|
96
|
+
skill and name it after the activity, because a local skill named after the upstream one shadows
|
|
97
|
+
that skill for the whole project (`self-education` → Skills this project does not own).
|
|
98
|
+
|
|
93
99
|
## Procedure
|
|
94
100
|
|
|
95
101
|
1. Collect the flagged / procedure-shaped memory lines.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memory-recompact
|
|
3
|
-
description: Recompact
|
|
3
|
+
description: Recompact 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 memory records kept anywhere else. Use when a store degrades into event logs, when indexes bloat or conflict, or when scattered records have to become one store.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
metadata:
|
|
6
6
|
scope: general
|
|
@@ -9,9 +9,9 @@ metadata:
|
|
|
9
9
|
|
|
10
10
|
# Memory recompaction
|
|
11
11
|
|
|
12
|
-
Whole-store maintenance for `.agents/memory/` (protocol: `agent-memory`)
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
Whole-store maintenance for `.agents/memory/` (protocol: `agent-memory`), and the procedure for
|
|
13
|
+
folding records kept anywhere else into it. Store-wide rewrite — propose it when triggers appear;
|
|
14
|
+
the operator invokes it.
|
|
15
15
|
|
|
16
16
|
## When
|
|
17
17
|
|
|
@@ -20,7 +20,8 @@ it when triggers appear; the operator invokes it.
|
|
|
20
20
|
- The same fact stated in two or more nodes.
|
|
21
21
|
- More than ~20% of a node is stale `Status` content.
|
|
22
22
|
- A node's `updated:` is months behind commits touching its scope.
|
|
23
|
-
-
|
|
23
|
+
- Memory records live outside `.agents/memory/` — a second store, a per-agent directory, a stray
|
|
24
|
+
notes file → fold them in with the merge pass below.
|
|
24
25
|
|
|
25
26
|
## Build the target node map first
|
|
26
27
|
|
|
@@ -43,14 +44,14 @@ For each old file or section:
|
|
|
43
44
|
4. Procedure-shaped survivors do not enter nodes — route them to `memory-promotion`. Routing
|
|
44
45
|
means distilling them into general rules, never handing the text over verbatim.
|
|
45
46
|
|
|
46
|
-
##
|
|
47
|
+
## Folding in an outside store
|
|
47
48
|
|
|
48
|
-
1. Union
|
|
49
|
-
|
|
49
|
+
1. Union every source. Two same-named files are two drifted sources of ONE node — merge both;
|
|
50
|
+
the code-consistent version wins.
|
|
50
51
|
2. Index-only entries with no backing file: extract the fact into its node, or drop if stale.
|
|
51
|
-
3.
|
|
52
|
-
|
|
53
|
-
4. When the new store verifies (below), delete
|
|
52
|
+
3. `## Skills` / "Key Files" index sections are dropped — skills self-describe; harness layout
|
|
53
|
+
belongs to `AGENTS.md`. Move genuinely non-obvious dispatch hints there.
|
|
54
|
+
4. When the new store verifies (below), delete every merged source entirely.
|
|
54
55
|
|
|
55
56
|
## Regenerate the index
|
|
56
57
|
|
|
@@ -62,9 +63,9 @@ index incrementally.
|
|
|
62
63
|
- Every node file is listed in the index; every listed node exists; every wiki-link resolves.
|
|
63
64
|
- All caps met (index ≤ 50 lines; nodes ≤ 120; entries ≤ 3 lines; Status ≤ 5 dated lines).
|
|
64
65
|
- No dates outside `Status` and `updated:`; no event-keyed filenames.
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
|
|
66
|
+
- The root `AGENTS.md` Memory section points at `.agents/memory/`.
|
|
67
|
+
- `.agents/memory/` is the only memory store left: every merged source directory or file is
|
|
68
|
+
deleted, and nothing in the harness still points at one.
|
|
68
69
|
|
|
69
70
|
## Report
|
|
70
71
|
|
|
@@ -18,9 +18,17 @@ order — during planning **and** during implementation.
|
|
|
18
18
|
Before suggesting any external library or writing custom code, look for an `@owlmeans/*` package that
|
|
19
19
|
already solves the problem.
|
|
20
20
|
|
|
21
|
-
- **Consult the deployed skills.**
|
|
22
|
-
|
|
23
|
-
does.
|
|
21
|
+
- **Consult the deployed skills.** `.agents/skills/` is the local catalogue of installed
|
|
22
|
+
capabilities: one directory per skill, each holding a `SKILL.md` that describes what a package
|
|
23
|
+
does and how it is consumed. A directory is named after the **skill**, not the package —
|
|
24
|
+
`@owlmeans/test-ui` deploys `testing-ui`, `@owlmeans/server-auth` deploys `server-auth` **and**
|
|
25
|
+
`supervisor-auth`, `@owlmeans/test` deploys `testing-unit` and `testing-overview` — so list the
|
|
26
|
+
directory instead of guessing a path from a package name.
|
|
27
|
+
- **Read `.agents/linked-skills/` too when it is there.** `.agents/scripts/link-skills.sh` links
|
|
28
|
+
the skills that ship inside the installed `@owlmeans/*` packages into it (and mirrors them into
|
|
29
|
+
`.claude/skills/` for Claude Code), with a skill / origin / description table in its
|
|
30
|
+
`INDEX.md`. It is generated and git-ignored, and a skill of the same name in `.agents/skills/`
|
|
31
|
+
always wins.
|
|
24
32
|
- **Scan installed packages.** Look in `node_modules/@owlmeans/*` **and**, in a workspace monorepo,
|
|
25
33
|
the nested `sources/*/node_modules/@owlmeans/*` (bun nests workspace deps).
|
|
26
34
|
- **Discover packages that aren't installed yet** by researching the **owlmeans/common** repository —
|
|
@@ -39,13 +47,31 @@ How you research the repo depends on whether `@owlmeans/*` is linked locally:
|
|
|
39
47
|
**https://github.com/owlmeans/common** — `tree.md` and package READMEs — to find the right package.
|
|
40
48
|
|
|
41
49
|
This is the same dev-linked detection `@owlmeans/agent-skills` uses (see its `detectLinked`). After
|
|
42
|
-
adding an `@owlmeans/*` dependency, run `npx @owlmeans/agent-skills` to deploy its
|
|
43
|
-
`@owlmeans/*` package over a third-party library or bespoke code whenever one fits.
|
|
50
|
+
adding an `@owlmeans/*` dependency, run `npx @owlmeans/agent-skills@^0.1.18-rc.12` to deploy its
|
|
51
|
+
skill. Prefer an `@owlmeans/*` package over a third-party library or bespoke code whenever one fits.
|
|
52
|
+
|
|
53
|
+
### Never add an OwlMeans dependency without an explicit range
|
|
54
|
+
|
|
55
|
+
Write the range yourself, as a caret at the version the rest of this project already uses for its
|
|
56
|
+
other `@owlmeans/*` packages:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@owlmeans/queue": "^0.1.18-rc.13"
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
A `bun add` that names no version — and a hand-written `"latest"`, `"next"`, `"*"` or empty range
|
|
65
|
+
— resolves through a dist-tag instead. OwlMeans publishes prereleases under `next`, so the tag
|
|
66
|
+
named `latest` points at an OLDER version than the one every other package here is pinned to. The
|
|
67
|
+
install succeeds, nothing warns, and the code you wrote against the current API is compiled
|
|
68
|
+
against the previous one. Put the version in the same breath as the package name, or copy the
|
|
69
|
+
`**Install:**` line from that package's own skill, which always carries a current range.
|
|
44
70
|
|
|
45
71
|
## 2. Reuse or extend before writing custom
|
|
46
72
|
|
|
47
73
|
If an installed package nearly fits, **configure or extend it** rather than writing something new — use
|
|
48
|
-
its resources, services,
|
|
74
|
+
its resources, services, entrypoints, and helpers. A small extension of a framework package beats a new
|
|
49
75
|
parallel implementation.
|
|
50
76
|
|
|
51
77
|
## 3. No package? Reuse code and extract an abstraction
|
|
@@ -60,5 +86,7 @@ Once code is written, review it: can it be **shorter, clearer, or expressed with
|
|
|
60
86
|
Lean on framework utilities, remove dead branches, collapse needless indirection. Less code that reuses
|
|
61
87
|
the framework is better than more bespoke code.
|
|
62
88
|
|
|
63
|
-
See `[[
|
|
64
|
-
`
|
|
89
|
+
See `[[scaffolding]]` for how a project is assembled, and `[[agent-skills]]` for keeping the
|
|
90
|
+
deployed skill catalogue current. The package map itself is `tree.md` at the root of the
|
|
91
|
+
[owlmeans/common](https://github.com/owlmeans/common) repository — layer by layer, every package
|
|
92
|
+
and what it depends on.
|
|
@@ -27,7 +27,8 @@ Also recommended after any unplanned change that made an existing skill inaccura
|
|
|
27
27
|
|
|
28
28
|
For each area the work touched:
|
|
29
29
|
|
|
30
|
-
1. Which existing skill covers it?
|
|
30
|
+
1. Which existing skill covers it? Check `.agents/skills/`, and — where the project has one —
|
|
31
|
+
`.agents/linked-skills/`, for ground a skill this project does not own already covers.
|
|
31
32
|
2. Do its commands, paths, APIs, and behavior claims still hold after the change?
|
|
32
33
|
3. Fix in place — rewrite the affected lines so they describe current behavior; never append a
|
|
33
34
|
note about what this change did.
|
|
@@ -46,11 +47,24 @@ rewrite recipe is `memory-promotion` → Distillation.
|
|
|
46
47
|
|
|
47
48
|
Test: a finished skill reads as though the feature was always this way.
|
|
48
49
|
|
|
49
|
-
##
|
|
50
|
+
## Skills this project does not own
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
A skill that came from somewhere else is not edited here, and the two kinds fail differently:
|
|
53
|
+
|
|
54
|
+
- An entry under `.agents/linked-skills/<name>` is a symlink into the repo or installed package
|
|
55
|
+
that owns the skill. Writing through it edits the owner's own file — an unrequested change in
|
|
56
|
+
another project, which nothing here undoes: the link script only creates and prunes symlinks.
|
|
57
|
+
- A skill placed by the `@owlmeans/agent-skills` installer is a real file at
|
|
58
|
+
`.agents/skills/<name>/SKILL.md` carrying
|
|
59
|
+
`<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->`. The next install
|
|
60
|
+
overwrites every file still carrying that banner, so an edit made under it is lost; strip the
|
|
61
|
+
banner and the file instead becomes a conflict the installer skips and reports.
|
|
62
|
+
|
|
63
|
+
When such a skill gained an important usage pattern during the work, capture the pattern in a
|
|
64
|
+
local skill under `.agents/skills/`, named after the pattern — a local skill named after the
|
|
65
|
+
upstream one shadows it for the whole project — and list the upstream skill in the report as an
|
|
66
|
+
upstream candidate. Changing the skill at its source is a separate change in the owning project,
|
|
67
|
+
made only on explicit operator request.
|
|
54
68
|
|
|
55
69
|
## External docs
|
|
56
70
|
|
|
@@ -9,13 +9,26 @@ metadata:
|
|
|
9
9
|
|
|
10
10
|
# Authoring agent guidance (skills)
|
|
11
11
|
|
|
12
|
-
OwlMeans
|
|
12
|
+
An OwlMeans project carries agent guidance in up to three places:
|
|
13
13
|
|
|
14
14
|
| What | Where | Loaded |
|
|
15
15
|
|---|---|---|
|
|
16
16
|
| Always-on project context | `AGENTS.md` at the repo root | every session |
|
|
17
|
+
| Always-on policy, kept out of `AGENTS.md` | `.agents/rules/<topic>.md`, pulled in from `AGENTS.md` by an `@.agents/rules/<topic>.md` import line | every session |
|
|
17
18
|
| Topic guidance | `.agents/skills/<name>/SKILL.md` | on demand, by topic or `/<name>` |
|
|
18
19
|
|
|
20
|
+
The middle tier is optional and belongs to a repo that has grown standing policy of its own. A
|
|
21
|
+
project scaffolded by `@owlmeans/create-app` starts without a `.agents/rules/` directory: its
|
|
22
|
+
generated `AGENTS.md` states the git policy inline and points at the seeded `git` skill for the
|
|
23
|
+
rest. Follow the layout the project already has — add a rules file only where `AGENTS.md` already
|
|
24
|
+
imports one.
|
|
25
|
+
|
|
26
|
+
**Rule or skill?** A rule is policy that has to hold whether or not anyone thought to load
|
|
27
|
+
anything — the git workflow is the standing example, whether a repo keeps it as
|
|
28
|
+
`.agents/rules/git.md` or inline in `AGENTS.md`. A skill is guidance for a task, loaded when that
|
|
29
|
+
task comes up. If it only matters while you are doing X, write a skill; if breaking it is wrong at
|
|
30
|
+
any moment, put it where `AGENTS.md` loads it every session.
|
|
31
|
+
|
|
19
32
|
`.agents/skills/` is the [Agent Skills](https://agentskills.io) standard location: GitHub Copilot
|
|
20
33
|
and Codex discover it natively. Claude Code reads skills only from `.claude/skills/`, so each skill
|
|
21
34
|
is bridged there by a generated symlink — see "Refresh the Claude Code links" below. **Write a skill
|
|
@@ -38,20 +51,35 @@ once; never author a per-agent copy** (`.github/instructions/*.instructions.md`,
|
|
|
38
51
|
name: my-skill # REQUIRED, must equal the directory name (lowercase, hyphens, ≤64 chars)
|
|
39
52
|
description: What it does and WHEN to use it. # REQUIRED, ≤1024 chars — the auto-invocation signal
|
|
40
53
|
user-invocable: true # false = background knowledge only, hidden from the / menu
|
|
41
|
-
allowed-tools: Bash(bun *) Read # optional —
|
|
54
|
+
allowed-tools: Bash(bun *), Read # optional — COMMA-separated; tools usable without per-call approval
|
|
42
55
|
metadata: # optional — anything non-standard goes here
|
|
43
56
|
scope: general
|
|
44
57
|
---
|
|
45
58
|
```
|
|
46
59
|
|
|
60
|
+
The `name` is not free: it is the key every store is keyed by, and a LOCAL skill always wins over
|
|
61
|
+
one that arrives from a dependency. Naming a skill after a package you depend on therefore hides
|
|
62
|
+
that package's own guidance completely, and the installer reports the file as a conflict on every
|
|
63
|
+
run. Give a skill about your own use of `@owlmeans/payment` a name of its own — `billing`, or your
|
|
64
|
+
product's name with a suffix — never `payment`.
|
|
65
|
+
|
|
47
66
|
The `description` is the most important field: every agent uses it to decide when to load the
|
|
48
67
|
skill, so state both the topic and the trigger ("Use when …"). Keep it under 1024 characters —
|
|
49
|
-
Copilot rejects longer ones.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
68
|
+
Copilot rejects longer ones. It is YAML, so a value containing `: ` (colon-space) has to be quoted
|
|
69
|
+
or the file stops parsing and the skill silently disappears from every agent.
|
|
70
|
+
|
|
71
|
+
`allowed-tools` is parsed as a list split on commas, newlines and YAML `-` bullets — never on
|
|
72
|
+
plain spaces. `Bash(bun *) Read` is read as one tool named `Bash(bun *) Read`, which matches
|
|
73
|
+
nothing; write `Bash(bun *), Read`.
|
|
74
|
+
|
|
75
|
+
Six keys are what the Agent Skills frontmatter parser in `@owlmeans/agent-skills` stores:
|
|
76
|
+
`name`, `description`, `license`, `compatibility`, `allowed-tools` and nested `metadata`.
|
|
77
|
+
Project-specific keys — including the OwlMeans `scope: general` routing marker, which sends a skill
|
|
78
|
+
to the installer bundle rather than to one package — belong under `metadata:`, so a skill stays
|
|
79
|
+
valid in every agent that reads it. The invocation switches sit outside what that parser stores and
|
|
80
|
+
are written at the top level alongside it: `user-invocable` (`false` hides a skill from the `/`
|
|
81
|
+
menu, marking it background knowledge), plus `disable-model-invocation` and `argument-hint`, which
|
|
82
|
+
Claude Code understands. Set any of them only when the skill needs it.
|
|
55
83
|
|
|
56
84
|
## Refresh the Claude Code links
|
|
57
85
|
|
|
@@ -61,9 +89,23 @@ After creating, renaming, or deleting a skill, run:
|
|
|
61
89
|
sh .agents/scripts/link-skills.sh
|
|
62
90
|
```
|
|
63
91
|
|
|
64
|
-
It creates `.claude/skills/<name>` → `../../.agents/skills/<name>` for every skill and prunes
|
|
65
|
-
whose skill is gone. The links are gitignored and are recreated at session start
|
|
66
|
-
|
|
92
|
+
It creates `.claude/skills/<name>` → `../../.agents/skills/<name>` for every local skill and prunes
|
|
93
|
+
links whose skill is gone. The links are gitignored and are recreated at session start (a committed
|
|
94
|
+
`SessionStart` hook, and on every install where the project declares a root `prepare` script that
|
|
95
|
+
calls it), but a skill added mid-session is invisible to Claude Code until the script runs.
|
|
96
|
+
|
|
97
|
+
The same script also brings in the skills of everything this project depends on, from whichever of
|
|
98
|
+
two sources applies. In a linked checkout — a repo whose root `package.json` lists an upstream
|
|
99
|
+
repo's packages as workspace entries — it resolves those upstream repos first, recursing into each
|
|
100
|
+
one's own manifest up to four levels, and links the skills from the upstream's own
|
|
101
|
+
`.agents/skills/`. A project that declares no such linked upstream falls back to what a plain npm
|
|
102
|
+
install gives it: the read-only `agent-meta/skills/` copies shipped inside each installed
|
|
103
|
+
`@owlmeans/*` package. Either way the links land in `.agents/linked-skills/<name>` (Copilot, Codex)
|
|
104
|
+
and `.claude/skills/<name>` (Claude Code), with a generated `.agents/linked-skills/INDEX.md` listing
|
|
105
|
+
skill, origin and description. Load one by name exactly like a local skill. A local skill of the
|
|
106
|
+
same name always wins, and a nearer dependency wins over a farther one. The whole
|
|
107
|
+
`.agents/linked-skills/` directory is generated and git-ignored — never edit or commit it, and never
|
|
108
|
+
edit an `agent-meta/` copy: fix the skill in the package that ships it.
|
|
67
109
|
|
|
68
110
|
## Skill vs memory
|
|
69
111
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"remove": [
|
|
3
|
+
"sources/common/src/types.ts",
|
|
4
|
+
"sources/common/src/schemas.ts",
|
|
5
|
+
"sources/api/src/consts.ts",
|
|
6
|
+
"sources/api/src/app",
|
|
7
|
+
"sources/web/src/screens/about.tsx",
|
|
8
|
+
"sources/web/src/screens/session.tsx"
|
|
9
|
+
],
|
|
10
|
+
"overrides": {
|
|
11
|
+
"README.md": "README.bare.md",
|
|
12
|
+
"sources/common/src/consts.ts": "sources/common/src/consts.bare.ts",
|
|
13
|
+
"sources/common/src/entrypoints.ts": "sources/common/src/entrypoints.bare.ts",
|
|
14
|
+
"sources/common/src/index.ts": "sources/common/src/index.bare.ts",
|
|
15
|
+
"sources/api/src/context.ts": "sources/api/src/context.bare.ts",
|
|
16
|
+
"sources/api/src/entrypoints.ts": "sources/api/src/entrypoints.bare.ts",
|
|
17
|
+
"sources/api/src/types.ts": "sources/api/src/types.bare.ts",
|
|
18
|
+
"sources/web/src/context.ts": "sources/web/src/context.bare.ts",
|
|
19
|
+
"sources/web/src/entrypoints.ts": "sources/web/src/entrypoints.bare.ts",
|
|
20
|
+
"sources/web/src/nav.ts": "sources/web/src/nav.bare.ts",
|
|
21
|
+
"sources/web/src/screens/home.tsx": "sources/web/src/screens/home.bare.tsx"
|
|
22
|
+
}
|
|
23
|
+
}
|
package/template/_gitignore
CHANGED
package/template/package.json
CHANGED
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"packageManager": "bun@1.
|
|
6
|
+
"packageManager": "bun@1.4.0",
|
|
7
7
|
"workspaces": [
|
|
8
8
|
"sources/*"
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "bun run --filter './sources/common' build && bun run --filter './sources/*' --parallel dev",
|
|
12
12
|
"build": "bun run --filter './sources/*' build",
|
|
13
|
-
"typecheck": "bun run --filter './sources/*' typecheck"
|
|
13
|
+
"typecheck": "bun run --filter './sources/*' typecheck",
|
|
14
|
+
"prepare": "sh -c 'test -f .agents/scripts/link-skills.sh && sh .agents/scripts/link-skills.sh || true'"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
17
|
"nodemon": "^3.1.14"
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"typecheck": "tsc -b"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@owlmeans/server-app": "^0.1.
|
|
15
|
-
"@owlmeans/static-resource": "^0.1.
|
|
14
|
+
"@owlmeans/server-app": "^0.1.18-rc.22",
|
|
15
|
+
"@owlmeans/static-resource": "^0.1.18-rc.13",
|
|
16
16
|
"__APP_SLUG__-common": "workspace:^"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@owlmeans/dep-config": "^0.1.
|
|
19
|
+
"@owlmeans/dep-config": "^0.1.18-rc.6",
|
|
20
20
|
"@types/node": "^24.10.1",
|
|
21
21
|
"typescript": "^7.0.2"
|
|
22
22
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto'
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { handlers } from '@owlmeans/server-app'
|
|
3
|
+
import { session, type SessionItem } from '__APP_SLUG__-common'
|
|
4
4
|
import { SESSION_ITEMS } from '../../consts.js'
|
|
5
5
|
import type { Context } from '../../types.js'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
7
|
+
const handle = handlers<Context>()
|
|
8
|
+
|
|
9
|
+
export const add = handle.body(session.add, async (payload, context, request) => {
|
|
10
|
+
const { sid } = request.params
|
|
11
|
+
const resource = context.getStaticResource<SessionItem>(SESSION_ITEMS)
|
|
11
12
|
|
|
12
13
|
const item: SessionItem = {
|
|
13
14
|
id: randomUUID(),
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { handlers } from '@owlmeans/server-app'
|
|
2
|
+
import { session, type SessionItem } from '__APP_SLUG__-common'
|
|
3
3
|
import { SESSION_ITEMS } from '../../consts.js'
|
|
4
4
|
import type { Context } from '../../types.js'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const handle = handlers<Context>()
|
|
7
|
+
|
|
8
|
+
export const list = handle.params(session.list, async (params, context) => {
|
|
9
|
+
const resource = context.getStaticResource<SessionItem>(SESSION_ITEMS)
|
|
10
|
+
|
|
11
|
+
// The resource answers the whole question — this session's items, newest first.
|
|
12
|
+
const { items } = await resource.list(
|
|
13
|
+
{ sessionId: params.sid },
|
|
14
|
+
{ sort: [{ field: 'createdAt', order: 'desc' }] }
|
|
15
|
+
)
|
|
9
16
|
|
|
10
|
-
// The static resource lists every record; filter to this session and sort newest first.
|
|
11
|
-
const { items } = await resource.list<SessionItem>()
|
|
12
17
|
return items
|
|
13
|
-
.filter(item => item.sessionId === params.sid)
|
|
14
|
-
.sort((a, b) => (a.createdAt < b.createdAt ? 1 : -1))
|
|
15
18
|
})
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { handlers } from '@owlmeans/server-app'
|
|
2
|
+
import { session, type SessionItem } from '__APP_SLUG__-common'
|
|
3
3
|
import { SESSION_ITEMS } from '../../consts.js'
|
|
4
4
|
import type { Context } from '../../types.js'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
const ctx = context as Context
|
|
8
|
-
const resource = ctx.getStaticResource<SessionItem>(SESSION_ITEMS)
|
|
6
|
+
const handle = handlers<Context>()
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
export const remove = handle.params(session.remove, async (params, context) => {
|
|
9
|
+
const resource = context.getStaticResource<SessionItem>(SESSION_ITEMS)
|
|
10
|
+
|
|
11
|
+
const existing = await resource.load(params.id)
|
|
11
12
|
// Only remove the item if it belongs to the requesting session.
|
|
12
13
|
if (existing == null || existing.sessionId !== params.sid) {
|
|
13
14
|
return { removed: false }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { makeContext as makeBasicContext } from '@owlmeans/server-app'
|
|
2
|
+
import type { Config, Context } from './types.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Where the app's resources are registered. `@owlmeans/static-resource` is already a dependency,
|
|
6
|
+
* so `appendStaticResource<C, T>(context, ALIAS)` gives you an in-memory store with no database
|
|
7
|
+
* behind it; a mongo/postgres resource takes its place once the data has to outlive the process.
|
|
8
|
+
* Whatever you append here must also widen `Context` in `types.ts`, or the getter will not exist.
|
|
9
|
+
*/
|
|
10
|
+
export const makeContext = <C extends Config, T extends Context<C>>(cfg: C): T =>
|
|
11
|
+
makeBasicContext<C, T>(cfg, true)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { entrypoints } from '@owlmeans/server-app'
|
|
2
|
+
import { bind } from '@owlmeans/server-entrypoint'
|
|
3
|
+
import { appEntrypoints as protocols } from '__APP_SLUG__-common'
|
|
4
|
+
import * as handlers from './app/session/index.js'
|
|
5
|
+
|
|
6
|
+
/** Local server bindings for the shared session protocol tree. */
|
|
7
|
+
export const appEntrypoints = [
|
|
8
|
+
...entrypoints,
|
|
9
|
+
bind(protocols.api.session.base),
|
|
10
|
+
bind(protocols.api.session.list, handlers.list),
|
|
11
|
+
bind(protocols.api.session.add, handlers.add),
|
|
12
|
+
bind(protocols.api.session.remove, handlers.remove),
|
|
13
|
+
]
|