# Headlamp agent guide Headlamp is a monorepo: React/TypeScript in `frontend/`, Go in `backend/`, Electron in `app/`, and plugin tooling/examples in `plugins/`. Paths in these guides are repository-root-relative unless stated otherwise. ## Start here - Read the nearest `AGENTS.md` for the area you are changing. Its rules are in addition to this file. - Run `git status --short` before editing. Preserve unrelated and pre-existing changes, especially generated snapshots. - Inspect the relevant `package.json`, Makefile, or nearby tests before choosing commands. Do not infer scripts or copy commands from a different package. - State the working directory for commands; `npm --prefix` is relative to it. - Read only the source and documentation needed for the task. Prefer the docs linked by the nearest scoped guide over a repository-wide documentation scan. - Handle simple lookups and a single code trace directly. Delegate only bounded, independent work that needs separate context; do not duplicate that work. ## Scope and safety - Make the smallest complete change that addresses the request. Do not refactor, reformat, rename, or update dependencies without a direct reason. - Follow existing local patterns and public behavior. Add or update a focused regression test when changing behavior. - Do not add secrets, credentials, personal data, or generated build output. - Ask for human review before changing `.github/workflows/`, Dockerfiles, `charts/`, `kubernetes-*.yaml`, `SECURITY*`, `OWNERS*`, `LICENSE`, `NOTICE`, `code-of-conduct.md`, or release/publishing configuration. ## Validate proportionately Use the narrowest existing checks that exercise the changed behavior: 1. Run a targeted test first. 2. Run the package's typecheck/lint command when applicable. 3. Run the full package suite or build only for broad, cross-cutting, generated, or dependency-related changes. 4. For UI behavior, use the browser only when the change needs visual or runtime verification. Keep screenshots out of the repository. Do not repeatedly run overlapping full suites after a targeted check has already passed. For documentation-only changes, verify paths and documented commands; application builds and runtime tests are unnecessary unless the docs require them. Install dependencies only after a manifest change or a check fails because they are missing, then rerun that check. Do not mask failures by weakening checks. | Scope | Read next | | -------------------- | --------------------------------- | | `frontend/` | `frontend/AGENTS.md` | | `backend/` | `backend/AGENTS.md` | | `app/` | `app/AGENTS.md` | | `docs/` | `docs/AGENTS.md` | | `plugins/` | `plugins/AGENTS.md` | | `charts/headlamp/` | `charts/AGENTS.md` | | `e2e-tests/` | `e2e-tests/AGENTS.md` | | `tools/releaser/` | `tools/releaser/AGENTS.md` | | `tools/i18n/` | `tools/i18n/AGENTS.md` | | `plugins/pluginctl/` | `plugins/pluginctl/AGENTS.md` | | `load-tests/` | `load-tests/AGENTS.md` | | `eslint-config/` | `eslint-config/AGENTS.md` | | PR review | `.github/copilot-instructions.md` | For exact repository-level scripts, consult the root `package.json`; for contributor workflow and PR guidance, consult `docs/contributing.md`. The guide layout and supporting evidence are documented in `docs/agentsdocs.md`. ## Generated and synchronized files - Change generated snapshots or API output only when an intentional, task-related source, story, test, or documentation change requires regeneration. - Do not hand-edit generated files. Use the repository's generator or test update command, then review the resulting diff for unrelated churn. - If unchanged snapshots keep appearing dirty, inspect `git ls-files --eol` and `git check-attr -a -- ` before repeating restores or regeneration. - Stage explicit task-related paths, not all working-tree changes. Keep unrelated snapshot or line-ending normalization out of progress commits. - Treat synchronized dependency/plugin manifests as a unit. Follow the scoped instructions before editing one part. ## PR work - Follow `.github/copilot-instructions.md` for review, CI, and history checks. Read the PR template and discussion; keep the body aligned with the final diff. - At handoff, verify the published head and current, fully paginated review/check state. - Before rewriting history, verify the remote head and use an explicit `--force-with-lease=:`. Stop writes on a rejected lease or denied push; inspect new changes or report the permission blocker. - Never redirect a denied push to another remote, approve a PR, or merge for a human. Fork-workflow approval requires explicit human authorization. ## Finish clearly Report changes, checks/results, and validation not completed. Follow `docs/contributing.md` for commits: `: `. Use an established same-file primary scope verbatim; an optional short component comes after it. History teaches scope conventions, not subjects to copy. Compose a fresh, meaningful, accurate action about the actual diff. A self-contained subject can stand alone; add a body when non-obvious intent/constraints need it. Never invent filler, release benefits or check claims to satisfy a body rule. Keep one physical subject (~50–60 characters, maximum 72). If there is a body, separate it with a blank line and hard-wrap it (~60–65 characters, maximum 72). Example: `frontend: HomeButton: Restore home navigation`. Follow explicit user attribution policies, omit issue-closing text, and claim only checks actually run. Before pushing, inspect `git log -1 --format=%B`; disclose unavailable native Git access rather than claiming direct execution.