-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Adds initial agents.md file #250833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Adds initial agents.md file #250833
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # Kibana | ||
|
|
||
| ## Setup | ||
| - Run `yarn kbn bootstrap` for initial setup, after switching branches, or when encountering dependency errors | ||
|
|
||
| ## Overview | ||
| - Kibana is organized into modules, each defined by a `kibana.jsonc`: core, packages, and plugin packages. Aside from tooling and testing, most code lives in these modules. | ||
| - Packages are reusable units with explicit boundaries and a single public entry point (no subpath imports), usually with a focused purpose. | ||
| - Plugins are a package type (`type: "plugin"`) that include a plugin class with setup/start/stop lifecycles, utilized by the core platform to enable applications. | ||
| - Plugins that depend on other plugins rely on the contracts returned by those lifecycles, so circular dependencies must be avoided. | ||
| - Module IDs (typically `@kbn/...`) live in `kibana.jsonc`; `package.json` names are derived where present. | ||
| - Plugin IDs are additional camelCase IDs under `plugin.id` in `kibana.jsonc`, used by core platform and other plugins. | ||
| - Modules are grouped by domain (platform vs solutions) with visibility rules (`shared` vs `private`) that limit cross-group access. | ||
| - Utility scripts live in `scripts/` (e.g., `node scripts/generate.js`). | ||
|
|
||
| ## Critical Thinking | ||
| - Fix root cause (not band-aid). | ||
| - Unsure: read more code; if still stuck, ask w/ short options. | ||
| - Conflicts: call out; pick safer path. | ||
| - Unrecognized changes: assume other agent; keep going; focus your changes. If it causes issues, stop + ask user. | ||
|
|
||
| ## Testing | ||
|
|
||
| ### Jest unit | ||
| `yarn test:jest [--config=<pathToConfigFile>] [TestPathPattern]` | ||
|
|
||
| ### Jest integration | ||
| `yarn test:jest_integration [--config=<pathToConfigFile>] [TestPathPattern]` | ||
|
|
||
| ### Type check | ||
| `yarn test:type_check [--project path/to/tsconfig.json]` | ||
|
|
||
| ### Function Test Runner (FTR) | ||
| `yarn test:ftr [--config <file1> [--config <file2> ...]]` | ||
| - For new tests, prefer using Scout | ||
|
|
||
| ### Scout (UI/API with Playwright) | ||
| `node scripts/scout.js run-tests --stateful --config <scoutConfigPath>` (or `--testFiles <specPath1,specPath2>`) | ||
|
|
||
| ## Code Style Guidelines | ||
| Follow existing patterns in the target area first; below are common defaults. | ||
|
|
||
| ### TypeScript & Types | ||
| - Use TypeScript for all new code; avoid `any`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you!!! It adds anys every time! |
||
| - Prefer explicit return types for public APIs and exported functions. | ||
| - Use `import type` for type-only imports. | ||
| - Avoid non-null assertions (`!`) unless locally justified. | ||
| - Prefer `readonly` and `as const` for immutable structures. | ||
| - Prefer const arrow functions | ||
| - Prefer explicit import/exports over "*" | ||
| - Prefer destructuring of variables, rather than property access | ||
|
|
||
| ### Formatting | ||
| - Follow existing formatting in the file; do not reformat unrelated code. | ||
| - `yarn llm` runs ESLint `--fix` on changed JS/TS files and may apply formatting-style fixes. | ||
| - Prefer single quotes in TS/JS unless the file uses double quotes. | ||
|
|
||
| ### Naming | ||
| - `PascalCase` for classes, types, and React components. | ||
| - `camelCase` for functions, variables, and object keys. | ||
| - New filenames must be `snake_case` (lowercase with underscores) unless an existing convention requires otherwise. | ||
| - Use descriptive names; avoid single-letter names outside tight loops. | ||
|
|
||
| ### Control Flow & Error Handling | ||
| - Prefer early returns and positive conditions. | ||
| - Handle errors explicitly; return typed errors from APIs when possible. | ||
| - Keep async logic linear; avoid nested `try` blocks when possible. | ||
|
|
||
| ### React / UI Conventions | ||
| - Use functional components; type props explicitly. | ||
| - Keep hooks at the top level; avoid conditional hooks. | ||
| - Avoid inline styles unless consistent with the file’s conventions. | ||
| - Use `@elastic/eui` components with Emotion (`@emotion/react`) for styling. | ||
|
|
||
| ## Contribution Hygiene | ||
| - Make focused changes; avoid unrelated refactors. | ||
| - Update docs when behavior or usage changes. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it worth calling out the
dev_docs/directory as a place to look for help first? that's where most of our developer docs come from and is a good resource. possibly alsoexamples/There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Examples too ++