You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Add an `AGENTS.md` to `src/core` documenting sub-package naming
conventions (`-server`, `-server-internal`, `-browser`,
`-browser-internal`, `-mocks`, `common`), visibility rules, mock
patterns, and top-level re-export structure. Intended as a concise
reference for agents working in core.
Hopefully speeds agent based work up a little bit and saves some tokens.
## Test plan
- N/A — documentation only.
Made with [Cursor](https://cursor.com)
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Code lives in `src/core/packages/`, organized by domain (e.g., `http`, `elasticsearch`, `saved-objects`). Each domain contains sub-packages following a naming convention.
4
+
5
+
## Sub-package suffixes
6
+
7
+
| Suffix | Role | Visibility |
8
+
|---|---|---|
9
+
|`-server`| Public server-side types and contracts |`shared`|
|`-browser-mocks`| Jest mocks for browser contracts |`shared`, `devOnly`|
15
+
|`common`| Types/utilities shared across server and browser |`shared`|
16
+
17
+
-`-server` / `-browser` packages export **types and pure utilities only**. No implementation.
18
+
-`-internal` packages contain the implementation. They depend on the public API package, never the reverse.
19
+
-`-mocks` packages depend on the public API types to produce typed mock objects.
20
+
21
+
## Visibility
22
+
23
+
Each package declares `visibility` in its `kibana.jsonc`:
24
+
25
+
-**`shared`** — any package in Kibana may import it. Used for public API types (`-server`, `-browser`, `common`) and mocks (`-mocks`).
26
+
-**`private`** — only other `src/core` packages may import it. Used for all `-internal` packages since they contain implementation details that should not leak to plugins.
27
+
28
+
## KEEP THIS FILE UP TO DATE
29
+
30
+
If you (agent working in `src/core`) notice a discrepancy between this document and the actual code while working in `src/core`, include a fix to this AGENTS.md as part of your changeset.
31
+
32
+
## Related docs
33
+
34
+
-`src/core/CONVENTIONS.md` — plugin structure, API design, and mock patterns
0 commit comments