commit
Commit and push a change in titi the project way — one concern per commit, Conventional Commits with a prose body, straight to origin master, never force. Use when asked to commit, push, save, or ship a change.
- License 许可
- MIT
- 所属仓库
- robertt3kuk/titi
- 最近更新
- 2026-11-02
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- commit
- description
- Commit and push a change in titi the project way — one concern per commit, Conventional Commits with a prose body, straight to origin master, never force. Use when asked to commit, push, save, or ship a change.
03 SKILL.md 正文
commit
Rules live in docs/COMMITS.md; this is the procedure.
Several agents, one index
The index is a single resource shared by every agent in the checkout. git add
and the commit that follows are not atomic: between them another agent can
stage its own file, and your commit will carry someone else's work. Real
symptoms seen today: a commit whose subject names one crate and whose stat
lists another; a docs fix swept into a peer's commit three commits in a row so
its message never matched its content.
Serialize:
-
Take the workspace commit lock before staging, release it after the commit — and put the
git addinside the lock, never before it. Agit addthat runs beforemkdirsucceeds is staged for the whole checkout to sweep:while ! mkdir "$(git rev-parse --git-dir)/titi-commit.lock" 2>/dev/null; do sleep 1 done git add <paths> # inside the lock, by explicit path git diff --cached --name-only # must print exactly what you staged git commit -F - -- <paths> # commit by pathspec, so nothing else in the # index can ride along git status --short -- <paths> # must be empty afterwards rmdir "$(git rev-parse --git-dir)/titi-commit.lock"The lock directory belongs to whoever created it; a stale one must be reported (to the holder or the user), never deleted.
-
scripts/commit.sh <message-file> <path>...is this whole step in one command: it takes the lock, stages the paths given, prints what is cached, refuses (and releases) if the cached set holds anything outside them, commits with a pathspec, checks the paths are clean, and releases the lock on every exit path. Prefer it to hand-typing the chain. -
Stage by explicit path. Never
git add -A,git add ., orgit commit -am— that is how sibling work gets swept in. -
Before committing:
git diff --cached --name-onlyandgit status --short— anything staged that you did not stage is a stop sign. -
Never
git commit --amend, and neverresethistory another agent may be building on. -
Right after committing:
git show --stat --format='%h %s' HEAD. If it shows a path you did not stage, say so in your report — do not rewrite the commit to hide it. -
Never delete
.git/index.lock: it means another agent is mid-commit. Wait and retry.
Two commits in this session are misattributed by exactly this: f3b11ef swept
the agent_tool.rs, agents.rs, runtime.rs and tests/agent_tool.rs that
were staged for c1b2260 — which then carried nothing but its changelog line —
and several changelog lines landed in sibling commits beside the features they
describe.
git statusandgit diff— see exactly what changed. Unrelated hunks or files → split into separate commits (git add -pis interactive and unavailable; stage whole files or write patches).- Never stage secrets,
.env*,*.db,target/, or anything under~/.titi/agent. - Subject:
type(scope): summary— English, imperative, lowercase, no trailing dot, ~50 cols. Types: feat fix docs refactor test ci style chore. Scope: crate short name (cli,engine,tui,atlas, …) orci,cargo,workspace,readme,agents,commits,conveyor,skills,brain. - Body, wrapped ~78 cols, prose: why, what invariant now holds, why this
way and not the alternative. No filler. No
Co-Authored-Bytrailer. - Commit with a heredoc (
git commit -F -) so the body keeps its wrapping. - Push right away:
git push origin master.- Rejected (non-fast-forward) →
git fetch origin && git rebase origin/master, then push again. - Rebase conflict →
git rebase --abort, stop, report to the user. - Never
--force,--force-with-lease,reset --hard,clean -fd.
- Rejected (non-fast-forward) →
- After push:
gh run list --repo robertt3kuk/titi --branch master --limit 1and, for code changes, follow skillci-and-testsuntil green.
04 同仓库更多 Skills
tui-smoke
Manually verify a titi TUI change in a real terminal and record it in docs/QA_STATUS.md. Use after changing titi-tui or titi-cli screen code, keys, slash commands, rendering, or when asked to smoke-test the chat.
supervisor-review
Playbook for the lead agent in titi that dispatches workers and accepts or rejects their output — verify artifacts not reports, return wrong work to the same worker, serialize shared files. Use when orchestrating subagents or reviewing a subagent's result.
skill-authoring
How to turn a recurring multi-step procedure in titi into a new project skill under .agents/skills, and wire it for every agent. Use when a 3+ step routine repeats, or the user says "make this a skill".
security-review
titi project security checklist for changes touching keys, providers, tools, approval, sessions, memory, or prompts. Use when a change handles credentials, runs commands, reads/writes files for the model, or when asked for a security review.
dependency-update
Add, bump, or remove a crate dependency in the titi workspace safely — justification, RustSec check, lockfile, one commit. Use when a change needs a new crate or a version bump.
code-review
titi project self-review checklist for a titi change before calling it done — error handling, tests, engine boundary, secrets, commit hygiene. Use before reporting a task complete, or when asked to review a diff.