3.9 KiB
3.9 KiB
AGENTS.md (Codex CLI guidance)
This repository is a screen reader. Prioritize accessibility, correctness, and stability over “clever” changes.
System interactions
- If a command requires
sudo, stop and ask the user to run it (no password entry is possible from here).
Build / run quick refs
- Local dev build + install:
./build-local.sh - Quick local sanity checks:
./test-local.sh - Clean local artifacts/install:
./clean-local.sh - Meson (manual):
meson setup _build --prefix=$HOME/.localmeson compile -C _buildmeson install -C _build
Runtime target and testing rules
- Make source changes in this repo, not in
~/.local/lib/python*/site-packages/cthulhu/, unless the user explicitly asks for an installed-package hotfix. - If you confirm the active import comes from
~/.local/..., that does not mean you should edit there. It means you should update the repo and then run./build-local.shto replace the installed copy for testing. - Default test/apply workflow for local Cthulhu fixes:
- edit repo files
- run
./build-local.sh - reproduce/test against the refreshed
~/.localinstall
- If repo and installed behavior differ, prefer rebuilding with
./build-local.shover patching the installed package directly. - Treat direct edits under
~/.local/.../cthulhu/as an exception path that requires explicit user approval.
Coding guidelines
- When modifying existing code: follow the surrounding code’s conventions.
- When writing new code from scratch: prefer
- variables:
camelCase - functions/methods:
snake_case - classes:
PascalCase
- variables:
- Keep changes clean and well-structured; avoid layering short-term workarounds when a focused fix is possible.
- Add debug logs where helpful for troubleshooting. When adding timestamps to logs, use:
"Message [timestamp]"(message first).
Accessibility requirements (high priority)
General
- Screen-reader-first UX: assume non-visual navigation.
- No keyboard traps; Tab/Shift+Tab must move through all controls.
- Use clear, complete labels (e.g., “Confirm Password”, not “Confirm”).
- No Speech-Dispatcher usage in GUI apps (no
spd-say); rely on the accessibility API.
Python GTK (Gtk 3)
- Associate labels with controls (mnemonics + buddy widget):
label.set_use_underline(True)label.set_mnemonic_widget(entry)
- For
Gtk.TextView, callset_accepts_tab(False)so Tab moves focus. - For custom widgets, set accessible name/role via ATK where applicable.
PySide6 / Qt
- Set
setAccessibleName()on all widgets. - Associate labels via
setBuddy(). - Use
setAccessibleDescription()when extra context is needed.
Shell script rules
- Bash variables must be
camelCase(except system env vars likeACCESSIBILITY_ENABLED). - If you edit a
#!/usr/bin/env bash,#!/bin/bash, or POSIXshscript, runshellcheckand fix issues. - Avoid colorized output unless explicitly requested (accessibility-first; keep scripts simple).
Plugins (Cthulhu)
- System plugins live in
src/cthulhu/plugins/. - Follow existing plugin patterns (keybinding registration, GTK dialog/window patterns, debug logging).
- Ensure plugin install integration is wired via Meson (
src/cthulhu/plugins/meson.build+ plugin subdirmeson.build).
Meson install reminder (important)
- If you add new Python modules under
src/cthulhu/, updatesrc/cthulhu/meson.buildso they get installed (otherwise imports can fail after install). - If you add a new plugin directory, update
src/cthulhu/plugins/meson.buildand add ameson.buildin the plugin directory.
Common Cthulhu agent mistakes
- Checking the import origin, seeing
~/.local/..., and then editing the installed package instead of the repo. - Forgetting that
./build-local.shis the normal way to apply repo changes into the installed copy for testing. - Making repo fixes and then diagnosing the old installed copy without rebuilding.