commit 17f53777390eaef0f4b9f3a848d9f000ba3b5659 equwal <13551856+equwal@users.noreply.github.com> 2026-10-04 04:19:16 -0700 Add rule: give changes as patches the patch command applies
acsync.toml | 1 + rules/patches.md | 9 +++++++++ 2 files changed, 10 insertions(+)
diff --git a/acsync.toml b/acsync.toml index a2d73f5..465c372 100644 --- a/acsync.toml +++ b/acsync.toml @@ -42,6 +42,7 @@ adopt_heading = "## MANDATORY on the Windows PC: PowerShell 7.6 syntax" [rules.undo-commands] machines = ["pc"] # g never had it; add "g" to roll it out there adopt_heading = "## MANDATORY: Undo commands are copy-only" +[rules.patches] # ---------- skills (all 8 skills folders) ---------- # ste-writing: retired; must not exist in any skills folder. diff --git a/rules/patches.md b/rules/patches.md new file mode 100644 index 0000000..0843772 --- /dev/null +++ b/rules/patches.md @@ -0,0 +1,9 @@ +## MANDATORY: Give changes as patches + +When you show the user a change to a file, give it as a unified diff that the `patch` command applies. Do not give loose code lines or whole files. + +- Make the diff with `diff -u` or `git diff`, so each hunk has context lines and a `@@` header. +- Give the command that applies it in the same block, for example `patch -p1 <<'EOF'` ... `EOF`, with the correct `-p` level and the path the user runs it from. +- For a file on another host, wrap it in one command: `ssh HOST 'cd DIR && patch -p1' <<'EOF'` ... `EOF`. +- Give a whole file only when the file is new or the user asks for the whole file. +- This rule is for changes you show the user. When you edit files yourself, use your edit tools as usual.