|
1 | 1 | # Agent Instructions |
2 | 2 |
|
3 | | -## General |
4 | | - |
5 | | -- ALWAYS ask before pushing git changes to remotes |
6 | | - |
7 | 3 | ## Tools |
8 | 4 |
|
9 | 5 | - Always use `rg` (ripgrep) instead of `grep` for searching file contents. |
10 | | -- Always use `fd` instead of `find` for searching files and directories. Key differences from `find`: |
| 6 | +- Always use `fd` instead of `find` for searching files and directories. Key |
| 7 | + differences from `find`: |
11 | 8 | - Pattern comes first, path second (opposite of `find`): `fd PATTERN [PATH]` |
12 | | - - Patterns are regex by default; use `--glob` for glob patterns: `fd --glob '*.c'` |
13 | | - - No `-name`, `-type`, `-path` flags needed — just: `fd foo`, `fd --type f`, `fd --type d` |
| 9 | + - Patterns are regex by default; use `--glob` for glob patterns: |
| 10 | + `fd --glob '*.c'` |
| 11 | + - No `-name`, `-type`, `-path` flags needed - just: `fd foo`, `fd --type f`, |
| 12 | + `fd --type d` |
14 | 13 | - Includes hidden files with `-H`; follows symlinks with `-L` |
15 | 14 | - Use `--exec` instead of `-exec`: `fd --glob '*.log' --exec rm {}` |
16 | | -- Always use the `gh` CLI when accessing or operating on GitHub resources (PRs, issues, releases, etc.). |
17 | | -- When accessing serial ports, ALWAYS use named ports via `/dev/serial/by-id` (Linux — not macOS-style `/dev/tty.usbserial-*` paths). |
| 15 | +- Always use the `gh` CLI when accessing or operating on GitHub resources (PRs, |
| 16 | + issues, releases, etc.). |
| 17 | +- When accessing serial ports, ALWAYS use named ports via `/dev/serial/by-id` |
| 18 | + (Linux - not macOS-style `/dev/tty.usbserial-*` paths). |
| 19 | + |
| 20 | +## Approval required: external writes / pushes |
| 21 | + |
| 22 | +NEVER execute an operation that writes, sends, or publishes anything outside |
| 23 | +this machine without explicit approval - regardless of permission mode (this |
| 24 | +applies even in auto-accept / bypass-permissions mode). Approval for one |
| 25 | +operation does not carry over to subsequent ones. Read-only access (API GETs, |
| 26 | +`gh pr view`, `git fetch`/`pull`, search/list/read MCP tools) is always fine |
| 27 | +without asking. |
| 28 | + |
| 29 | +Categories (non-exhaustive - when in doubt, ask): |
| 30 | + |
| 31 | +- git: push to any remote, including tags, force-push, and deleting remote |
| 32 | + branches |
| 33 | +- GitHub (`gh` or API): PR/issue creation, comments, reviews, merges, |
| 34 | + label/state changes, releases, gists, repo or org settings |
| 35 | +- Cloud/infra: any mutating AWS / GCP / Cloudflare / Kubernetes / Terraform |
| 36 | + operation (deploys, applies, DNS changes, bucket/database writes, resource |
| 37 | + create/delete) |
| 38 | +- Publishing artifacts: npm / PyPI / cargo / Docker registry pushes, homebrew |
| 39 | + taps, etc. |
| 40 | +- Messaging & docs: sending or scheduling Slack messages, email, |
| 41 | + Jira/Confluence/Notion/Salesforce creates, edits, comments, or state |
| 42 | + transitions - any MCP tool call that mutates remote state |
| 43 | +- Browser automation: clicking, submitting forms, or filling inputs on live |
| 44 | + sites where the action changes server-side state. Exception when operating |
| 45 | + on local host (eg debugging locally running applications). |
| 46 | +- Secrets: never include credentials, tokens, private keys, or env-var values in |
| 47 | + any content that leaves this machine (PR bodies, messages, pastes, external |
| 48 | + API calls) |
| 49 | + |
| 50 | +Read-only operations are fine (eg using `gh` to pull information). |
| 51 | + |
| 52 | +## Approval required: destructive local operations |
| 53 | + |
| 54 | +Also ask before irreversible local actions, even though they're not external: |
| 55 | + |
| 56 | +- deleting or overwriting files outside the current working repo; bulk deletes |
| 57 | + (`rm -rf`) of anything non-trivial |
| 58 | +- destroying git state: `reset --hard`, `checkout -- .`/`restore` over |
| 59 | + uncommitted work, `clean -fd`, deleting branches or stashes with unmerged |
| 60 | + work, rewriting history |
| 61 | +- system-level changes: `sudo`, installing/removing system packages, editing |
| 62 | + system config, enabling/disabling services |
| 63 | +- attached hardware: mass-erase/recover/unlock commands, fuse/OTP writes, or |
| 64 | + writing to block devices (`dd`). Routine dev-board flashing (`west flash`, |
| 65 | + `idf.py flash`, etc.) is fine without asking. |
0 commit comments