agentleFS
gerphgerph/riscos-agent-skills/skills/using-git/SKILL.md

using-git

Skill4 starsChanged 7 months agoMITView on GitHub

Use when reading status, preparing commits, writing commit messages, comparing local changes, or handling dirty worktrees in this build environment. Focuses on safe non-interactive Git usage, selective staging, and avoiding interference with unrelated user changes.

  • Deletes or force-pushes

We split this skill into the rules it gives an agent

22 rules. About 0 are common, 17 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Use this skill when the task involves Git operations in the RISC OS build environment, especially when preparing commits or reasoning about …

    line 10
  2. Distinctive:

    Prefer non-interactive Git commands.

    line 16
  3. Very specific:

    Never use git add ., git add <directory>, or other broad staging when a narrower file list is possible.

    line 17
  4. Distinctive:

    Never revert or overwrite unrelated user changes unless the user explicitly asks for that.

    line 19
  5. Distinctive:

    Do not use destructive commands such as git reset --hard or git checkout -- unless explicitly requested.

    line 21
  6. Very specific:

    If the .git in the repository is a file, which refers to a non-existant directory, we are in a snapshot of a git submodule.

    line 25
  7. Distinctive:

    Start with targeted inspection:

    line 31
  8. Distinctive:

    When only a few files matter, ask Git about those files directly rather than trying to interpret the whole repository state.

    line 40
  9. Distinctive:

    If the worktree is noisy, prefer:

    line 58
  10. Distinctive:

    Use a short summary line followed by a wrapped body when needed.

    line 69
  11. Distinctive:

    Keep the subject concise and imperative.

    line 73
  12. Very specific:

    Do not embed literal \n escape sequences in git commit -m bodies.

    line 75
  13. Distinctive:

    If a multiline message is needed, feed it from standard input or a file.

    line 76
  14. Distinctive:

    If relevant, include information about how it was tested, but don't go into excessive detail.

    line 83
  15. Very specific:

    Use multiple -m arguments only for separate paragraphs, not to simulate line wrapping with escaped newlines.

    line 97
  16. Distinctive:

    Read carefully before committing if a file is already modified.

    line 111
  17. Distinctive:

    If a file has unrelated user edits, integrate with them rather than replacing them.

    line 112
  18. Distinctive:

    If the change set is mixed, commit only the files that belong to the current task.

    line 114
  19. Very specific:

    If a shell one-liner needs a multiline commit message, prefer printf piped into git commit -F -.

    line 123
  20. Distinctive:

    Commit messages should be wrapped properly because literal backslash escapes are not interpreted inside ordinary single-quoted shell …

    line 125
  21. Distinctive:

    When testing or building inside the environment, generated files should remain uncommitted unless they are part of the requested source …

    line 127
  22. Distinctive:

    Use this skill for tasks such as:

    line 132

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Using Git

Use this skill when the task involves Git operations in the RISC OS build environment, especially when preparing commits or reasoning about a dirty worktree.

Core rules

  • Prefer non-interactive Git commands.
  • Never use git add ., git add <directory>, or other broad staging when a narrower file list is possible.
  • Never revert or overwrite unrelated user changes unless the user explicitly asks for that.
  • Do not use destructive commands such as git reset --hard or git checkout -- unless explicitly requested.
  • Expect the worktree to contain many unrelated untracked files. Filter for the exact files relevant to the current task.
  • If the .git in the repository is a file, which refers to a non-existant directory, we are in a snapshot of a git submodule. We cannot do git operations. Do not try - give up and tell the user.

Status and inspection

Start with targeted inspection:

git status --short
git diff -- path/to/file
git diff --cached -- path/to/file
git rev-parse --short HEAD

When only a few files matter, ask Git about those files directly rather than trying to interpret the whole repository state.

Be explicit about whether you want unstaged or staged changes:

  • git diff -- path/to/file compares the working tree against the index, so it shows only unstaged changes.
  • git diff --cached -- path/to/file compares the index against HEAD, so use it when changes have already been staged and plain git diff appears empty.

Staging

Stage only the intended files:

git add path/to/file1 path/to/file2

If the worktree is noisy, prefer:

git status --short -- path/to/file1 path/to/file2

before committing, to confirm that only the intended paths are staged or modified.

Commit messages

Use a short summary line followed by a wrapped body when needed.

Rules:

  • Keep the subject concise and imperative.
  • Wrap commit message body lines to 74 characters.
  • Do not embed literal \n escape sequences in git commit -m bodies.
  • If a multiline message is needed, feed it from standard input or a file.
  • A good description opens with a short sentence or paragraph about why the change is being made so that the context is understood. This is important for code archeology - working out why something went wrong and what the reason was for a mistake.
  • This can then be followed by the detail about what has been done to address this, and how it has been tested.
  • It may include how the change is deficient because of time, or just because it's progressive work, etc
  • If relevant, include information about how it was tested, but don't go into excessive detail.
  • You may avoid these rules and make just a simple description if the change is self-explanatory - adding documentation, correcting typos, etc - or where background would not help. But never commit only a title line; there must always be some body text.

Preferred pattern:

printf '%s\n' \
  'Short subject line' \
  '' \
  'First wrapped body line.' \
  'Second wrapped body line.' | git commit -F -

Use multiple -m arguments only for separate paragraphs, not to simulate line wrapping with escaped newlines.

Dirty worktrees

This environment often has:

  • unrelated modified files,
  • many untracked files,
  • generated output under .rotransform/, build/, or similar paths.

Guidance:

  • Ignore unrelated untracked files unless they are directly relevant.
  • Read carefully before committing if a file is already modified.
  • If a file has unrelated user edits, integrate with them rather than replacing them.
  • If the change set is mixed, commit only the files that belong to the current task.

Environment-specific notes

Lessons from this environment:

  • The repository may contain wrapper tools on PATH with familiar names. Check which executable is being used if command behaviour looks unusual.
  • If a shell one-liner needs a multiline commit message, prefer printf piped into git commit -F -.
  • Commit messages should be wrapped properly because literal backslash escapes are not interpreted inside ordinary single-quoted shell strings.
  • When testing or building inside the environment, generated files should remain uncommitted unless they are part of the requested source change.

When to use this skill

Use this skill for tasks such as:

  • preparing a clean commit from a noisy worktree,
  • writing or reviewing commit messages,
  • staging only selected files,
  • checking whether a repository is safe to commit,
  • comparing local changes before a release or integration step.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.