Central hub for Utensil's infrastructure code: dev environment setup, just tasks, dotfiles, and container stacks
0

Configure Feed

Select the types of activity you want to include in your feed.

docs: port full G-commit section from forest AGENTS.md [AGENT]

Expanded G-commit golden rule to match forest's version:
- Added explicit instruction to commit before pausing for further instructions
- Added constraint against committing unrelated files from working directory

Replaced minimal commit discipline section with full jj workflow from forest:
- Pre-commit: use `jj` status/log, `jj diff` to review changes
- During commit: granular/targeted commits with jj path syntax, no sensitive info
- Post-commit: how to edit messages with `jj desc`
- Full commit message checklist: conventional commits, descriptive title+body, [AGENT] tag
- Added human discipline note about reviewing AI-generated code

author
utensil
date (May 9, 2026, 3:51 PM +0800) commit 286a5ff1 parent b33e9af3 change-id qsrpmvsu
+37 -6
+37 -6
AGENTS.md
··· 42 42 - ❌ **Must NOT**: Run destructive operations or execute tasks with side effects without permission 43 43 44 44 ### G-commit: Commit changes to version control system 45 - - ✅ **Should**: Commit changes after editing. ALL commits MUST include [AGENT] tag. 46 - - ❌ **Must NOT**: Commit `.env` or files containing secrets/credentials 45 + 46 + - ✅ **Should**: After editing files, before pausing and asking for further instructions, commit changes to version control system. ALWAYS commit per section "Commit discipline" below. ALL commits MUST include [AGENT] tag. 47 + - ❌ **Must NOT**: Commit files that are not directly related to current task. Only commit files intentionally modified as part of the specific work requested. Do not commit unrelated changes, even if they exist in working directory. 47 48 48 49 ### G-safe: Prioritize data safety 49 50 - ✅ **Should**: Use `rip` instead of `rm` for file/directory removal ··· 98 99 99 100 ## 4. Commit discipline 100 101 101 - - **Granular commits**: One logical change per commit. 102 - - **Conventional commits**: `feat:`, `fix:`, `docs:`, `refactor:`, etc. 103 - - **MANDATORY [AGENT] tag**: ALL agent-generated commits MUST end the title with `[AGENT]`. 104 - - **No secrets**: Never commit passwords, credentials, or `.env` files. 102 + The version control system is `jj`, NOT git. 103 + 104 + ALWAYS follow this `jj` commit workflow: 105 + 106 + - Before committing: 107 + - use `jj` (which combines `jj status` and `jj log` in a customized way) to learn about status and recent revisions 108 + - so it's clear which revision to commit, and won't commit an empty or unrelated revision 109 + - fallback to use `jj log --no-graph -T 'change_id.short(7) ++ " " ++ commit_id.short(7) ++ " | " ++ author.name() ++ " | " ++ committer.timestamp().ago() ++ " | " ++ if(local_bookmarks, local_bookmarks ++ " | ", "") ++ description.first_line() ++ "\n"' -n <N>` to view the last N revisions in a concise format 110 + - run `jj diff` or `jj diff -r <rev>` to review all changes in the working copy or the revision to commit. 111 + - During committing: 112 + - **Granular commits**: One logical change per commit. 113 + - **Targeted commit**: 114 + - Only include changes for files intentionally edited, for both the files to commit, and the content of the commit message 115 + - To commit file `A.txt`, `B that has spaces.txt`, and directory `src`, use `jj commit 'A.txt | "B that has spaces.txt" | src ' -m "<message>"`. 116 + - **No sensitive information**: If the diff to be committed includes passwords, credentials, real environment variables, IP addresses, absolute paths outside the project, or other personal/private information, refuse to commit and alert the user; never add such information into the commit message too. 117 + - After committing, if asked to improve commit message: 118 + - To edit the commit message of any commit, use `jj desc -r <rev> -m "<message>"` for a specific revision. 119 + 120 + To determine the commit message, ALWAYS follow this checklist: 121 + 122 + * **Use conventional commits**: `feat:`, `fix:`, `docs:`, `style:`, `refactor:`, etc. 123 + * **Descriptive commit messages**: ALWAYS include both: 124 + - Short title explaining the *why* (what problem this solves) 125 + - Detailed description of *what* changed (specific files, functions, behavior, related issue links, etc.) 126 + - inspect the full diff for the edited files for summarization, and don't use only recent rounds of conversation to describe the whole commit that contain changes from earlier conversations 127 + - NEVER cite the rules (e.g. (per G-verify)) in the commit message 128 + - Example: `fix: resolve missing task in sync workflow [AGENT]` + description of which files were modified and how 129 + * **MANDATORY [AGENT] tag**: ALL agent-generated commits MUST end the title of the commit message with `[AGENT]` tag. NO EXCEPTIONS. 130 + - ✅ Correct: `feat: add helix config sync task [AGENT]` 131 + - ❌ Wrong: `feat: add helix config sync task` (missing [AGENT] tag) 132 + 133 + Disciplines for humans: 134 + 135 + * **Review AI-generated code**: Never merge code you don't understand. 105 136 106 137 --- 107 138