Skip to content

Commit ae8a7e8

Browse files
committed
chore(agents): apply review fixes to global rules
Scope em-dash ban to inline punctuation, split clone-vs-curl from schema-guess rule, add post-push secret rotation guidance, fold redundant chezmoi-managed note, split worktree bullet, cover .mise.toml variant.
1 parent 8498a62 commit ae8a7e8

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

home/dot_agents/AGENTS.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ These rules apply to every coding session, across every project.
88

99
These constraints are unconditional. Apply them without being asked.
1010

11-
- **No em dashes.** Use commas, colons, or restructure the sentence. Never generate ``, `---`, or `—`.
12-
- **Never guess schemas or APIs.** Read the authoritative source first: Go structs, official docs, or the project's own examples. Blog posts and AI-generated examples are not acceptable. To inspect repo source, `git clone` first and read locally; never `curl` GitHub API endpoints or fetch raw URLs, even when docs don't render.
11+
- **No em dashes.** Use commas, colons, or restructure the sentence. Never generate inline `` or `—` as punctuation. (Markdown horizontal rules — `---` alone on a line — are fine.)
12+
- **Never guess schemas or APIs.** Read the authoritative source first: Go structs, official docs, or the project's own examples. Blog posts and AI-generated examples are not acceptable.
13+
- **Clone, don't curl.** To inspect repo source, `git clone` first and read locally. Never `curl` GitHub API endpoints or fetch raw URLs, even when docs don't render.
1314
- **All Python through mise.** Never invoke `python`, `pip`, `uv`, or `uvx` directly. Use `mise x -- <command>` for all Python toolchain work.
1415
- **Never accept a limitation without investigating.** Keep working until the problem is actually solved. Suggesting workarounds as a final answer is not acceptable.
1516
- **Deliver the answer, not instructions to derive it.** When the user asks you to find, fetch, or compute a specific value, produce the value. Do not respond with a snippet for them to run, a formula to apply, or "tell me which one and I'll convert it" when you have the tools to do the lookup yourself. The user delegated the work; punting it back defeats the purpose.
1617
- **Don't say "Docker containers."** Docker is a brand name, not a container type. Write "containers" or "OCI images" in prose. Action references like `docker/login-action` are fine as-is.
17-
- **Never commit secrets.** No API keys, tokens, `.env` files, credentials, or private keys in any repo. If staged accidentally, unstage and remove from history before pushing.
18+
- **Never commit secrets.** No API keys, tokens, `.env` files, credentials, or private keys in any repo. If staged accidentally, unstage and remove from history before pushing. If already pushed, rotate the secret immediately; force-push history rewrite only with explicit user confirmation.
1819
- **Never log PII.** No email, phone, name, address, or payment data in logs, traces, or monitoring payloads.
1920

2021
---
@@ -27,11 +28,9 @@ After every non-trivial task, run a retrospective before closing out.
2728

2829
## Memory
2930

30-
Global memory is `~/.agents/AGENTS.md` (source: `~/.local/share/chezmoi/home/dot_agents/AGENTS.md`).
31+
Global memory is `~/.agents/AGENTS.md`. Edit the chezmoi source at `~/.local/share/chezmoi/home/dot_agents/AGENTS.md`, not the deployed file.
3132
Local memory is the `AGENTS.md` in the current project root (or nearest ancestor).
3233

33-
Never edit `~/.agents/AGENTS.md` directly; it is chezmoi-managed.
34-
3534
For rules specific to the chezmoi dotfiles repo itself, the target is `~/.local/share/chezmoi/AGENTS.md`.
3635

3736
When updating any memory file: review nearby rules for contradictions, duplication, and scope conflicts; reconcile in the same edit. Keep cross-cutting rules in global memory; keep project-specific rules in local memory.
@@ -44,7 +43,10 @@ When updating any memory file: review nearby rules for contradictions, duplicati
4443
- Commit message format: `type(scope): description`. Types: `feat`, `fix`, `chore`. Check `git log --oneline` to match repo style.
4544
- After any branch switch (including `gh pr checkout`), verify with `git branch --show-current`. If `gh pr checkout` fails or lands on the wrong branch, use `git checkout <branch>` directly.
4645
- A stale `.git/index.lock` blocks all git operations. Remove it with `rm -f .git/index.lock` before retrying the blocked command.
47-
- **Worktree context.** When the cwd is inside a Claude Code worktree (e.g. `.claude/worktrees/<id>`), git and gh commands act on the worktree branch. The main repo's working tree may be locked by another agent; do not `git checkout` or `gh pr checkout` against it. To pull a PR branch, materialize it into a new worktree: `git -C /path/to/main-repo fetch origin <branch> && git -C /path/to/main-repo worktree add <path> origin/<branch>`. Use `git -C <path>` for all subsequent commands, and confirm the active branch with `git -C <path> branch --show-current` before reading or editing files.
46+
- **Worktree context.**
47+
- When the cwd is inside a Claude Code worktree (e.g. `.claude/worktrees/<id>`), git and gh commands act on the worktree branch. The main repo's working tree may be locked by another agent; do not `git checkout` or `gh pr checkout` against it.
48+
- To pull a PR branch, materialize it into a new worktree: `git -C /path/to/main-repo fetch origin <branch> && git -C /path/to/main-repo worktree add <path> origin/<branch>`.
49+
- Use `git -C <path>` for all subsequent commands. Confirm the active branch with `git -C <path> branch --show-current` before reading or editing files.
4850
- **Cloning for tag comparison.** `--depth=1 --no-single-branch` does not fetch tags. When you need to compare specific tags, either clone without `--depth`, or run `git fetch --tags` after the shallow clone.
4951
- **Inspecting a PR's diff.** Always diff the remote PR branch against `origin/main` (e.g. `git diff origin/main...origin/<pr-branch>`), not local HEAD. Local HEAD may be on an unrelated branch, so a diff against it is meaningless and returns empty output without any error.
5052

@@ -64,4 +66,4 @@ When updating any memory file: review nearby rules for contradictions, duplicati
6466
## Toolchain
6567

6668
- When a CLI can be managed by `mise`, run it through `mise x -- <command>`. Do not invoke managed tools directly.
67-
- When entering a new worktree that has a `mise.toml`, run `mise trust <worktree-path>/mise.toml` before any `mise x --` call. Otherwise every mise invocation fails with `Config files in <path> are not trusted`.
69+
- When entering a new worktree that has a `mise.toml` or `.mise.toml`, run `mise trust <worktree-path>/{mise,.mise}.toml` (or the specific file present) before any `mise x --` call. Otherwise every mise invocation fails with `Config files in <path> are not trusted`.

0 commit comments

Comments
 (0)