Skip to content

Commit 1de9f99

Browse files
authored
Add CLAUDE.md, update instructions (#235)
1 parent 0f27091 commit 1de9f99

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ test/perf/.generated
5858
.eslintcache
5959
.stylelintcache
6060
**/tsconfig.tsbuildinfo
61+
62+
# Agents
63+
**/CLAUDE.local.md

AGENTS.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
# Project Instructions
22

3-
This codebase is a fork of https://github.com/ChromeDevTools/devtools-frontend.
3+
This is the React Native DevTools frontend, a fork of [Chrome DevTools](https://github.com/ChromeDevTools/devtools-frontend).
44

5-
## Editing Policy
5+
Changes should generally be scoped to the `front_end/` directory. Do not edit `front_end/generated/`.
6+
7+
## Guidelines
68

79
- Make minimal edits. No speculative refactors.
8-
- Changes should generally be scoped to the `front_end/` directory. Focus code searches here.
10+
- Use `.js` extensions in TypeScript imports. Use `type` imports where possible (`import type`).
11+
- New files in Meta-owned paths must prepend `// Copyright (c) Meta Platforms, Inc. and affiliates.` as the first line of the license header, above the Chromium Authors license. Keep in sync with `META_CODE_PATHS` in `scripts/eslint_rules/lib/check-license-header.js`.
12+
13+
## Build system
914

10-
## Workflow
15+
Each module directory has a `BUILD.gn` file. Update these when adding new files or dependencies.
1116

12-
- Update `BUILD.gn` files when adding new modules and imports.
13-
- New files should prepend "Copyright (c) Meta Platforms, Inc. and affiliates." as the first line of the license header, above the Chromium Authors license. Keep in sync with `META_CODE_PATHS` in `scripts/eslint_rules/lib/check-license-header.js`.
17+
- `generate_css("css_files")` — lists `.css` source files.
18+
- `devtools_module("name")` — lists `.ts` source files in `sources` and dependencies as `:bundle` refs in `deps`.
19+
- `devtools_entrypoint("bundle")` — declares the barrel file that re-exports the module's public API.
20+
- `devtools_entrypoint("meta")` — declares the `-meta.ts` file that registers panels/views. Use `visibility` to restrict to specific entrypoints.
21+
- `ts_library("unittests")` — lists `.test.ts` files with `testonly = true`.
1422

1523
## Architecture
1624

17-
- For UI code, prefer modern `html` template code and locate styles in one adjacent CSS file. Example: `front_end/ui/components/cards/Cards.ts`.
25+
- **UI components** extend `HTMLElement`, use Lit `html` templates (from `front_end/ui/lit/lit.js`), and locate styles in one adjacent CSS file. Prefix custom elements with `devtools-`. Example: `front_end/ui/components/cards/Card.ts`.
26+
- **Panels** extend `UI.Widget.VBox` and are registered via a `-meta.ts` file using `UI.ViewManager.registerViewExtension()`, which lazily loads the panel implementation.
27+
- **Entrypoints**: `front_end/entrypoints/rn_fusebox/` is the primary React Native entry point.
28+
- **RN-specific code** lives in paths listed in `META_CODE_PATHS` (e.g. `panels/rn_welcome/`, `panels/react_devtools/`, `models/react_native/`, `core/rn_experiments/`).

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

0 commit comments

Comments
 (0)