repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

add git workflow prompts

362b87efb55ad616f88dabbda0d09639ab832bf1

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (2)

pi/agent/prompts/ci.md

Added
new file mode 100644
1 +---
2 +description: Commit current git changes
3 +argument-hint: "[hint]"
4 +---
6 +Commit current repo changes. Hint: $ARGUMENTS
8 +1. Inspect:
9 + - `git status --short --branch`
10 + - `git diff --stat && git diff`
11 + - `git diff --cached --stat && git diff --cached` if staged
12 + - read untracked files before staging
13 +2. Stop if clean.
14 +3. Exclude generated/cache/secret files. Ask only if ambiguous.
15 +4. Split unrelated changes into focused commits when safe; otherwise ask.
16 +5. Run obvious fast checks if available. Skip expensive/unclear checks with reason.
17 +6. Stage relevant files. Commit. If hooks change files, inspect, restage, retry once.
18 +7. Do not push.
19 +8. Report hash, subject, checks.
21 +Message style:
23 +- Short, concrete subject. Subject-only OK.
24 +- Prefer `add`, `fix`, `update`, `remove`, `replace`, `track`, `show`, `rework`.
25 +- Use `type(scope): summary` when natural: `feat`, `fix`, `docs`, `chore`, `refactor`, `test`, `perf`, `build`, `ci`.
26 +- Use domain prefix when clearer: `ui: ...`, `db: ...`, `cli: ...`, `docs: ...`.
27 +- Lowercase after prefix. No final period.
28 +- Body only when useful: bullets, rationale, tests.
29 +- Preserve issue IDs.
30 +- No AI attribution/trailers.

pi/agent/prompts/ff.md

Added
new file mode 100644
1 +---
2 +description: Sync current branch into trunk via rebase + fast-forward
3 +argument-hint: "[trunk] [test-command]"
4 +---
6 +Sync current branch into trunk. Linear history only. No merge commits. Never force-push trunk.
8 +Args: if `$1` is branch/ref → trunk, `${@:2}` → tests. Else infer trunk, `$ARGUMENTS` → tests.
10 +1. Inspect
11 + - Run: `git status --short --branch`, `git branch --show-current`, `git remote -v`, `git worktree list --porcelain`, `git branch -vv`.
12 + - Stop on: non-git, detached HEAD, merge/rebase in progress, dirty index/worktree, dirty trunk worktree.
13 + - Record: branch, upstream, remote, trunk, HEAD.
15 +2. Find trunk
16 + - Prefer arg.
17 + - Else infer: upstream/base metadata → remote HEAD → `main` → `master` → `trunk` → `develop`.
18 + - Ambiguous → ask.
19 + - If trunk checked out in worktree, use that worktree for trunk ops.
21 +3. Fetch/update trunk
22 + - `git fetch --prune --tags <remote>`.
23 + - If trunk worktree: `git -C <wt> pull --ff-only`.
24 + - Else if local trunk exists: `git fetch <remote> <trunk>:<trunk>` (no `+`).
25 + - Else create from remote: `git branch --track <trunk> <remote>/<trunk>`.
26 + - Trunk divergence → stop.
28 +4. If already on trunk
29 + - `git pull --ff-only`.
30 + - Run tests if given/obvious.
31 + - Push if ahead: `git push <remote> <trunk>`.
32 + - Report.
34 +5. Rebase branch
35 + - Check diff/log: `git log --oneline --left-right --cherry-pick <trunk>...HEAD`, `git diff --stat <trunk>...HEAD`.
36 + - If needed: `git rebase <trunk>`.
37 + - Conflict → stop; show status/files/next commands.
38 + - Verify branch still has intended commits/diff.
40 +6. Test
41 + - Run supplied test cmd, else cheap obvious checks from project files.
42 + - Failure → stop. No merge/push.
44 +7. Fast-forward trunk
45 + - Require: `git merge-base --is-ancestor <trunk> HEAD`.
46 + - If trunk worktree: `git -C <wt> merge --ff-only <branch-or-sha>`.
47 + - Else: `git update-ref refs/heads/<trunk> HEAD <old-trunk-sha>`.
49 +8. Push
50 + - `git push <remote> <trunk>`.
51 + - Rejected → fetch, re-evaluate, rebase once if safe, retest critical checks, retry.
52 + - Never force-push trunk.
54 +Report: trunk/remote, branch old→new SHA, rebase yes/no, tests, pushed SHA, follow-up.