diff --git a/AGENTS.md b/AGENTS.md index 47de5e2..449c47e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,110 +1,118 @@ # dotfiles-nixos -One flake that builds every machine the user owns. -The domain model (Host, Module, Skeleton, Auto-loader, Enable convention, overlays) lives in `~/Documents/ai-artifacts/projects/dotfiles/003-dotfiles-context.md`. +One flake builds every machine I own. -## Conventions +## Repository Conventions -- Comments posted to Gitea (pull requests, issues, reviews) go out under the operator's account, so sign every one to make clear the author is the agent, not the operator. - End the comment with a `— Claude` sign-off. - (A dedicated bot account may replace this later. - Until then, the sign-off is the only marker.) -- Commit messages follow Conventional Commits, specified in `docs/conventional-commits.md`. - Scope is the module or host the change belongs to (`fish`, `nvim`, `neogaia`), omitted for repo-wide changes. - Keep messages free of Gitea-specific references: this repository is mirrored to GitHub, where issue and pull-request numbers resolve to unrelated things. -- When a graphical application is added, give it a `window-rewrite` icon mapping in `modules/desktop/waybar.nix`. - Without one its windows fall back to the generic default glyph on the workspace indicator instead of showing a recognisable per-application icon. - Match on the window class, which `hyprctl clients -j | jq -r '.[].class' | sort -u` lists for the running session. +- Follow `docs/technical-writing.md` for comments, user-facing descriptions, commit prose, pull-request prose, and Markdown documentation. +- Comments posted to the forge under the operator's account must end with `— Pi`. + The sign-off identifies the agent as the author instead of the operator. +- Commit messages follow Conventional Commits, defined in `docs/conventional-commits.md`. + Use a scope for the changed module or host, such as `fish`, `nvim`, or `neogaia`. +- Keep commit messages about the Git history, not the forge workflow. + Do not reference issue or pull-request numbers unless the commit itself requires a stable external reference. +- Use `gitea-axi` for Gitea issues, pull requests, labels, reviews, comments, and milestones. + It resolves this repository from the `origin` remote inside the checkout. + +## Dotfiles Conventions + +### Desktop + +- When adding a graphical application, add a `window-rewrite` icon mapping in `modules/desktop/waybar.nix`. + The workspace indicator uses this mapping to show an application icon instead of the generic default glyph. + Match the mapping on the window class. + Run `hyprctl clients -j | jq -r '.[].class' | sort -u` to list classes in the running session. +- Set Hyprland session environment variables in `modules/desktop/hyprland/hyprland.nix` with `env = KEY,VALUE`. + `home.sessionVariables` do **not** reach the Hyprland session because UWSM does not source `hm-session-vars.sh`. + Source cursor values from `config.stylix.cursor`. + Set `XCURSOR_*` and `HYPRCURSOR_*` to the same theme for Bibata. +- Configure the Steam desktop client as an XWayland application. + SDL Wayland selectors do not make the visible client native Wayland. + Keep fractional scaling sharp with Hyprland's `xwayland.force_zero_scaling` and Steam's `STEAM_FORCE_DESKTOPUI_SCALING`. + +### Firefox + +- Manage Firefox search engines through `programs.firefox.search` with `force = true`. + Hide built-in engines with `.metaData.hidden = true` because omission does not remove them. + Use current engine ids, such as `default = "ddg"` instead of `"DuckDuckGo"`. + Decode the built `search.json.mozlz4` with `mozlz4a -d ` to check the result. +- Avoid Home Manager Firefox extension settings unless the whole profile can use the legacy extension-storage backend. + Any non-empty `profiles..extensions.settings..settings` sets `extensions.webextensions.ExtensionStorageIDB.enabled = false` for the whole profile. + +### Neovim + +- Nixvim's flake input follows the root nixpkgs source, but its Home Manager module does not reuse the host's `pkgs` instance. + Keep `programs.nixvim.nixpkgs.useGlobalPackages = true`. + That setting makes Nixvim use the shared package set without warning that its source default changed. + +### AI Tooling + +- Use produced literals for Herdr key names that include shifted punctuation. + For example, use `prefix+<` instead of `prefix+shift+comma`. +- Treat `~/.pi/agent/skills` as generated output from Home Manager. + Do not edit skills in that directory. + A new file created there stays outside the repo. + Shared global skills come from the `skills` flake through `modules/agents/skills.nix`. + Update the `skills` flake input, then rebuild. +- Keep generated `.agents/skills/.gitignore` files from ignoring symlinked skills. + Pi skill discovery honors `.gitignore`, `.ignore`, and `.fdignore` inside scanned skill directories. + An ignored symlinked skill does not load even when `.agents/skills//SKILL.md` exists. +- Write directly to flake-managed Pi extension, prompt, and skill directories only for throwaway development or local experiments. + Home Manager activation can overwrite or hide unmanaged files in those directories. + Promote finished work into the dotfiles module before treating it as deployed. ## Gotchas +### Architecture + - Guest modules are host-agnostic wiring, while host files own deployment-specific service configuration such as served volumes and host paths. For example, `guests/copyparty.nix` should expose options and translate them into guest mounts/service settings, while `hosts/pikachu/default.nix` chooses `/inbox`, `/media`, and their backing paths. -- `sops.secrets..owner` must name a user known on the decrypting host. - For guest-only service users, do not set the owner to the guest uid unless the host also declares that user. - Use a host-visible owner plus a shared group mode when an identity-mapped guest service can read through its group. -- Actual Budget's NixOS service runs `actual-server` with `WorkingDirectory = services.actual.settings.dataDir`, and the `actual-server` CLI wrapper sets `ACTUAL_CONFIG_PATH=./config.json` when that current directory contains `config.json`, overriding the NixOS module's generated config path before the server loads configuration. - When migrating old community-script state to the normal upstream `/data` shape, move or rewrite a copied `/data/config.json` so it cannot shadow the declarative module settings. -- Subagent completion delivery is non-blocking through immediate spawn, milestone notifications, retained terminal entries, and `subagent_list` or `subagent_result` retrieval. - `subagent_wait` intentionally blocks the parent tool call until its condition or timeout, so do not use it merely to keep background work alive during an interactive workflow. -- Nixvim's flake input following the root nixpkgs source does not make its Home Manager module reuse the host's `pkgs` instance. - Keep `programs.nixvim.nixpkgs.useGlobalPackages = true` so Nixvim uses the shared package set without warning that its source default was affected. -- This host has no `python` or `python3` command on its ordinary `PATH`. - For ad hoc Python, use Nix explicitly, such as `nix shell nixpkgs#python3 -c python3