Files
dotfiles-public/dot_codex/AGENTS.md
T
bcherb2 afbd45bab5 feat: Codex and Pi AGENTS.md carry beads, vault and dev-server rules
The beads sections come from live. The vault and dev-server text mirrors
the global CLAUDE.md, replacing the older sysjournal-only section.
2026-11-18 01:25:43 -05:00

140 lines
5.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Global Codex Configuration
## Tool Preferences
### Search And Navigation
- Always use `rg` over `grep` for code search.
- Prefer narrow searches over broad sweeps.
- Use precise file globs and code-aware navigation when available.
- Prefer MCP tools when they provide better precision than shell commands.
### Code Manipulation
- Read the relevant code before editing.
- Prefer structural understanding over blind text replacement.
- Make the smallest change that solves the problem.
- Do not rewrite surrounding code without a concrete reason.
### Verification
- Every change needs verification.
- Verification can be tests, a build, a targeted command, or frontend validation with Playwright.
- For non-trivial work, state the verification method before implementing.
## Language Patterns
### Python
- Prefer `black` or `ruff format` for formatting.
- Prefer `ruff` for linting.
- Use type hints on public code.
- Prefer `pytest`.
- Check for `.venv/` or `venv/` before assuming interpreter paths.
### Go
- Use `gofmt`.
- Prefer `go vet` for linting and `go test ./...` for verification.
- Check `go.mod` for module structure.
- Do not ignore errors with `_` unless there is a defensible reason.
### TypeScript
- Prefer `prettier` and `eslint` when present.
- Check `package.json` for the repo's actual test and build commands.
- Check `tsconfig.json` before changing compiler-sensitive code.
- Prefer strict typing patterns.
## Workflow Principles
### Research First
Before changing unfamiliar code:
1. Identify the relevant files and relationships.
2. Understand the local pattern in that area.
3. Check for similar implementations elsewhere.
4. Look for tests that define expected behavior.
### Plan Before Implement
For non-trivial work:
1. State what is changing and why.
2. Name the files or components likely to change.
3. Define how the change will be verified.
4. Note obvious risks or breakpoints.
### Preserve Context
- Keep findings compressed and structured.
- Reuse existing project artifacts like `.claude/progress.md`, `PITFALLS.md`, and project `CLAUDE.md` when they exist.
- If a repo already uses `.claude/` planning or checkpoint files, continue to respect them rather than inventing a second system.
## Session Workflow
### Starting A Session
1. Check for `.claude/progress.md` and load it as prior context when present.
2. Read `PITFALLS.md` if present.
3. Read project instructions from `AGENTS.md`. Codex is also configured to treat project `CLAUDE.md` as a fallback instruction file.
### During Work
- Research unfamiliar areas before editing.
- Make plans for non-trivial work.
- Review changes before commit when risk is non-trivial.
### Ending A Session
- If the repo uses `.claude/progress.md`, update it when useful.
- If there are uncommitted changes, leave the next session enough context to resume cleanly.
## Shell
- Use zsh-compatible syntax when writing shell commands or scripts.
- Assume `~/.zshrc` can affect shell behavior.
## Anti-Patterns
- Do not search broadly and read dozens of files without narrowing scope.
- Do not change code before understanding the local pattern.
- Do not skip verification.
- Do not rewrite code that does not need to change.
- Do not add comments, docstrings, or annotations to untouched code without a clear reason.
## Obsidian vaults
`~/Documents/Obsidian-Work` and `~/Documents/Obsidian-Personal` are the user's
long-term memory. **Both vaults carry their own instructions, and those are
authoritative.** This file is per-machine and drifts; the vault copies sync.
- The **`obsidian-notes` skill** owns the protocol — `vault` and `sysjournal`
usage, recall-before-answering, folder ownership, guardrails. If this agent
has not loaded it, read
`~/Documents/Obsidian-Personal/Meta/skills/obsidian-notes/SKILL.md`.
- Each vault's **`Meta/Note Conventions.md`** owns its note rules, and they are
deliberately different between the two. Read with
`vault conventions --vault <work|personal>` before authoring anything
substantial.
Two things to know without reading anything:
1. **Recall first.** `vault search <terms>` before answering from scratch about a
work project or customer, the user's machines and home network, or anything
they may have solved before. Terms are ANDed — 2–3 specific words.
2. **Host/environment changes go to `sysjournal`, never `vault`.** The skill's
"Which tool" table draws the line and states the trigger.
`~/Documents/Obsidian25` is the pre-split original. It is **not** yet frozen: a
VPS cron still writes `_planning/`, `_agent/` and `Health/Garmin/` there nightly.
Never hand-write anywhere in it, and treat those three folders as owned by their
programs in every vault.
## Dev servers
- **Always bind dev, desk and preview servers to `0.0.0.0`, never `127.0.0.1` or
`localhost`.** The user views them from another machine. This applies to every
server started for the user to look at, including test-harness servers. If the
app refuses non-loopback Host headers, turn that check off for the dev run too
(e.g. an `-allow-lan` flag). Report the URL with the host's LAN name or IP.
## Beads (`bd`)
Some repos track execution work in beads. A repo is wired in when `bd where` succeeds there.
- In a wired repo, the session-start hook injects the workflow from `.beads/PRIME.md`. If it is
missing from context — after compaction, or in a harness without the hook — run `bd prime`.
- Beads holds execution work: tasks, blockers, discovered follow-ups, handoff. Intent stays in
`.design/` when the repo has one; a bead never stands in for a plan.
- Memory stays where it is: the harness memory and the Obsidian vaults. Never `bd remember`.
- Beads syncs itself: each write pushes to origin, and the session-start hook pulls first. Don't
run `bd dolt push` by hand unless a sync failure was reported. At handoff, say which beads
changed.
- To wire a repo in, run `~/code/agent-templates/beads/setup <repo>` — never plain
`bd init`, which rewrites `AGENTS.md` and commits tool config.