Software configuration management: SCM (oma-scm)
Scheduling
Goal
Manage Git and software configuration management safely: commits, branches, merges, worktrees, releases, baselines, audit posture, CODEOWNERS, and Conventional Commits.
Intent signature
- User asks to commit, stage, branch, merge, rebase, cherry-pick, tag, release, resolve conflicts, manage worktrees, inspect SCM posture, or apply Conventional Commits.
- User needs safe Git operations with explicit file staging, secret awareness, and CM governance.
This skill is the single place for configuration management (CM) on a software repo and for Conventional Commits / safe staging.
When to use
- Commits: “commit this”,
/scm, message type/scope, splitting staged changes into multiple commits.
- CM / Git: branching (gitflow, GitHub Flow, GitLab Flow, trunk-based), protected branches, merge queue, merge conflicts, rebase, cherry-pick, worktrees, submodules/subtrees, tags and releases.
- Governance: issue/ADR links, breaking-change footers, changelog or release-tool alignment.
- Audit posture: signed commits, CI before merge, secret-sensitive paths.
When NOT to use
- Implementing product or application code -> use the relevant domain skill
- Debugging runtime failures without a Git or CM operation -> use
oma-debug
- Security, performance, or accessibility review -> use
oma-qa
- Planning feature requirements or decomposing work -> use
oma-pm
Expected inputs
- Git task, desired branch/commit/release operation, and affected files
- Current worktree status, staged diff, branch tracking, config files, and governance constraints
- Optional issue/ADR/PR/release context
Expected outputs
- Safe commit, branch, merge/rebase guidance, conflict plan, status accounting, or CM audit findings
- Conventional Commit message and explicit staged paths when committing
- Risk notes for shared history, secrets, CODEOWNERS, CI, and release evidence
Dependencies
- Git CLI and repository metadata
.agents/oma-config.yaml, Conventional Commit references, onboarding-risk and CODEOWNERS playbooks
Control-flow features
- Branches by quick commit path versus full CM/governance path
- Reads Git state and diffs; may write commits, branches, tags, or conflict resolutions
- Requires explicit approval for broad staging, shared-history rewrite, production-destructive operations, or secret-risk paths
Structural Flow
Entry
- Inspect Git status, branch, staged/unstaged changes, and user intent.
- Choose Quick Path for ordinary commits or Full CM Path for governance/risky history work.
- Read commit and CM config before enforcing project-specific rules.
Scenes
- PREPARE: Determine operation type, risk, and affected files.
- ACQUIRE: Read status, diff, logs, config, ownership, and release context.
- REASON: Split changes, choose message/scope, identify CM controls and risks.
- ACT: Stage explicit paths, commit, branch, resolve, or provide CM action plan.
- VERIFY: Check status, staged diff, CI expectations, signatures, secrets, and audit evidence.
- FINALIZE: Report operation result and remaining SCM tasks.
Transitions
- If user intent is commit-only, follow Quick Path and stop after safe commit.
- If branching/history/release/governance is involved, run Full CM Path.
- If shared history rewrite is requested, require maintainer approval.
- If changes span independent features, split commits unless user requests one commit.
Failure and recovery
- If worktree is dirty in unrelated files, avoid touching unrelated changes.
- If conflicts exist, resolve markers, test, and preserve target-branch context.
- If secrets are detected or suspected, stop before staging/committing.
Exit
- Success: requested SCM operation is complete or a safe, auditable plan is delivered.
- Partial success: blockers such as conflicts, missing approval, CI, or secret risk are explicit.
Logical Operations
Actions
| Action |
SSL primitive |
Evidence |
| Read Git state |
READ |
git status, diff, log, config |
| Select SCM path |
SELECT |
Quick Path vs Full CM Path |
| Compare change scopes |
COMPARE |
Split by type/scope/feature |
| Validate commit/governance rules |
VALIDATE |
Config and CM controls |
| Stage explicit files |
CALL_TOOL |
git add <specific-files> |
| Commit or manage refs |
CALL_TOOL |
Git commit/branch/merge/rebase/tag |
| Write audit notes |
WRITE |
Commit message or CM report |
| Report result |
NOTIFY |
Final SCM summary |
Tools and instruments
- Git CLI and repository metadata
- Commit/CM config, Conventional Commit guide, CODEOWNERS playbook, onboarding-risk signals
Canonical command path
git status -sb
git diff --staged
git log --oneline -5
Stage and commit only explicit paths:
git add <specific-files>
git commit -m "$(cat <<'EOF'
<type>(<scope>): <description>
[optional body]
Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
EOF
)"
Copy the co-author address, never recall it. Read it from
scm.co_author in .agents/oma-config.yaml rather than from memory.
GitHub matches a Co-authored-by: address against verified account emails
and credits whoever owns it as a contributor, so a one-character slip
attributes the work to a real, unrelated person — and refs/pull/* keeps
the commit reachable permanently, so rewriting history does not undo it.
A commit-msg hook at .githooks/commit-msg enforces this; a rejected
commit means the address is wrong, not that the hook is.
Resource scope
| Scope |
Resource target |
CODEBASE |
Tracked files, diffs, conflicts, CODEOWNERS |
LOCAL_FS |
Git metadata, config files, commit message temp files |
PROCESS |
Git commands and verification commands |
CREDENTIALS |
Secret-sensitive files must not be staged or committed |
Preconditions
- Repository and Git intent are identifiable.
- User has authorized the requested SCM operation.
Effects and side effects
- May stage files, create commits, branches, tags, worktrees, or history operations.
- Can affect shared repository history if unsafe commands are used, so approvals matter.
Guardrails
- Explicit user override (highest priority). When the user gives an explicit, unambiguous instruction on how to perform a Git/SCM operation, follow it exactly and do not argue, re-litigate, or block on the conditions below. This overrides every default and guardrail in this skill — including "no direct push to
main/protected branches", broad staging, the commit-split rules, single vs. multiple commits, message type/scope/length, and shared-history rewrite. State briefly what you are doing and proceed; do not ask for re-confirmation of an instruction the user already gave. Only confirm if the instruction is genuinely ambiguous (multiple plausible interpretations) — never as a way to push back on a clear directive.
- Single hard exception: likely-secret material (
.env, keys, raw tokens). If the user's instruction would stage/commit such material, surface it once before proceeding; everything else proceeds without challenge.
- Choose Quick Path for ordinary commits and Full CM Path for branching, history, release, or governance work.
- Read
.agents/oma-config.yaml before applying project-specific commit or CM rules.
- Stage only explicit files; never use broad staging unless the user explicitly approves it.
- Do not rewrite shared history without maintainer approval.
- Never stage or commit likely-secret material.
- Response language follows
oma-config.yaml language: user-facing SCM output (status summaries, conflict explanations, CM audit notes, action plans) is localized. Per i18n-guide.md, commit messages, PR titles/body, branch names, and status keywords stay in English regardless of the setting.
Configuration
| File |
Role |
.agents/oma-config.yaml |
Conventional Commit types, branch prefixes, message rules, and CM pointers |
Operating mode (choose first)
Quick Path (commit-focused, default)
Use this when the user intent is mainly "commit this safely."
- Follow Conventional Commits section only
- Stage explicit files only
- Validate message type/scope/length from
commit-config.yaml
- Stop after safe commit unless user asks CM/governance operations
Full CM Path (repo governance / risky history operations)
Use this when the user asks about branching strategy, merges, rebase/cherry-pick, worktrees, release refs, CODEOWNERS, or audit posture.
- Run CM workflows in order (Planning -> Identification -> Control -> Status accounting -> Verification)
- Add onboarding risk scan when inheriting or auditing a repository
- Include commit governance from Conventional Commits when creating commits
- For large-scope merge operations, use risk scoring and Ask Gate criteria from
../../workflows/scm.md
CM process map (software)
| CM function |
Intent |
Typical artefacts / actions |
| Management & planning |
Agreed rules |
CONTRIBUTING.md, SECURITY.md, commit-config.yaml |
| Configuration identification |
What is managed, naming |
Branch/tag rules, version files, .gitattributes, LFS |
| Configuration control |
Reviewed change |
PRs, checks, issue links, BREAKING CHANGE footers |
| Status accounting |
As-built truth |
main / release refs, CHANGELOG, tags, CI status |
| Verification & audit |
Evidence |
CI logs, signed commits, lockfiles / SBOM policy |
CM workflows (use before risky history operations)
1) Planning
- Read
commit-config.yaml and files listed under documented_process.
- If missing, infer from
CONTRIBUTING.md / README; state assumptions.
- Confirm branching model and whether force-push on shared branches is allowed (default: not without explicit approval).
2) Identification
- Canonical refs: default branch, release branches/tags, version sources (
package.json, etc.).
.gitattributes / LFS for binaries and generated assets.
- Branch names vs
commit-config.yaml branch_prefixes when the project uses them.
3) Control
- Small, reviewable units; align commits with PR / issue intent.
- Conflicts:
merge-base, git status, resolve markers, tests; suggest rerere when conflicts repeat.
- Worktrees:
git worktree add; merge/rebase from the target branch’s checkout; all worktrees share one object database.
- Do not rewrite shared history without maintainer approval; prefer
--force-with-lease if force-push is unavoidable.
4) Status accounting
git status -sb: branch, remote tracking, ahead/behind, merge state.
- Relate last tag / release branch to
CHANGELOG or tooling (semantic-release, release-please, changesets) if present.
5) Verification & audit
- Required CI and
merge_group when merge queue applies.
- Never stage/commit secrets (
.env, keys, raw tokens). Filename patterns from commit-config.yaml forbidden_patterns are enforced mechanically by the scm-guard PreToolUse hook; for content-level leaks (tokens hardcoded in ordinary source files), run a scanner when available (gitleaks protect --staged, trufflehog git) before large or unfamiliar commits.
- Call out signed-commit expectations when the org cares about verification badges.
CODEOWNERS maintenance checklist
- Validate CODEOWNERS file exists (prefer
.github/CODEOWNERS).
- Ensure critical paths are explicitly owned (not only fallback
*).
- Ensure owners are active and mapped to current teams.
- Confirm branch protection requires CODEOWNERS review where needed.
- Flag overlapping/ambiguous rules that can hide intended owners.
Read change_governance.require_codeowners and ownership.* in commit-config.yaml when present.
6) Onboarding risk scan (optional, recommended)
Use this quick scan when joining or inheriting a repository to identify risky areas before major changes.
- High churn files in
lookback window.
- Ownership concentration / bus-factor signals.
- Bug hotspot files from fix-related history.
- Velocity trend by month.
- Revert/hotfix/emergency frequency.
Read thresholds from commit-config.yaml onboarding_metrics when present and cite caveats:
- squash merge teams can distort ownership metrics,
- weak commit labeling reduces hotspot accuracy,
- monorepo commit counts can bias subsystem interpretation.
Conventional Commits
Commit types
| Type |
Description |
Branch Prefix |
| feat |
New feature |
feature/ |
| fix |
Bug fix |
fix/ |
| refactor |
Code improvement |
refactor/ |
| docs |
Documentation changes |
docs/ |
| test |
Test additions/modifications |
test/ |
| chore |
Build, configuration, etc. |
chore/ |
| style |
Code style changes |
style/ |
| perf |
Performance improvements |
perf/ |
| build |
Build system / external dependencies |
build/ |
| ci |
CI configuration and scripts |
ci/ |
| revert |
Revert a previous commit |
(none) |
Commit format
<type>(<scope>): <description>
[optional body]
Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
Commit workflow
Step 1: Analyze changes
git status
git diff --staged
git log --oneline -5
Step 1.5: Split by feature (if needed)
If changes span multiple features/domains, split commits by feature.
Split when: the changes are logically independent (different features, unrelated fixes).
Do not split when: one logical change (even if it touches code + tests + docs together), or the user asked for a single commit.
Precedence for edge cases (when both readings are defensible):
- Logical independence decides first — one logical change is one commit regardless of how many types/scopes it touches.
- File count is only a tiebreaker: ≤5 files lean single commit; >5 files spanning multiple scopes/types lean split.
- An explicit user instruction (single commit or split) overrides both.
Step 2: Determine type
- New capability →
feat · Bug fix → fix · Structure-only → refactor · Docs only → docs · Tests → test · Build/config → chore
Step 3: Scope
Use module/component: feat(auth):, fix(api):, or omit: chore: update dependencies
Step 4: Description
≤72 chars (per commit-config.yaml), imperative mood, lowercase start, no trailing period.
Step 5: Execute commit
Show the message, then commit with explicit paths:
git add <specific-files>
git commit -m "$(cat <<'EOF'
<type>(<scope>): <description>
[optional body]
Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
EOF
)"
If HEREDOC is unstable in your shell (or body is long), use file-based commit input:
git add <specific-files>
msgfile="$(mktemp)"
cat > "$msgfile" <<'EOF'
<type>(<scope>): <description>
[optional body]
Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
EOF
git commit -F "$msgfile"
rm -f "$msgfile"
Use HEREDOC by default, and switch to -F for long or flaky terminal sessions.
Push and PR safety (only when requested)
Push only when the user asks or a workflow requires it. Before pushing:
git status -sb — confirm branch, remote tracking, ahead/behind.
- Protected-branch check: if the target is the default/protected branch and
commit-config.yaml sets require_pr_for_default_branch: true, push a topic branch and open a PR (gh pr create) instead of pushing directly — unless the user explicitly instructed a direct push (Guardrail 0).
- Never plain
--force; after an approved history rewrite use git push --force-with-lease.
- If push is rejected (non-fast-forward), fetch and rebase/merge locally; do not retry with force.
Amend, fixup, autosquash
First determine whether the target commits are shared:
git status -sb # ahead/behind vs upstream
git log --oneline @{u}..HEAD # commits not yet pushed (errors when no upstream — treat all as unpushed)
- Unpushed commits:
git commit --amend, git commit --fixup <sha> + git rebase -i --autosquash, and interactive rebase are safe — proceed.
- Pushed/shared commits: this is a shared-history rewrite — require maintainer approval (Guardrail 4) and use
--force-with-lease when pushing the result.
- Before
--amend, check git diff --staged: the amend must not silently absorb unrelated staged changes.
References
.agents/oma-config.yaml
resources/conventional-commits.md
resources/onboarding-risk-signals.md
resources/codeowners-playbook.md
- Observability handoff:
../oma-observability/SKILL.md §Integrations — release markers (service.version), revert baseline diff
Important notes
- Explicit user instruction wins. A clear user directive on how to commit/push/branch overrides every rule below (and every other guardrail). Follow it without arguing; the only thing that still warrants a heads-up is likely-secret material.
- NEVER
git add -A or git add . without explicit user permission.
- NEVER commit likely-secret material.
- ALWAYS stage by explicit paths; tie non-trivial CM work to the five CM rows above, even briefly.
1---
2name: oma-scm
3description: "SCM (software configuration management) and Git: branching,
4 merges, conflicts, worktrees, baselines, audit readiness, plus Conventional
5 Commits and safe staging."
6---
7
8# Software configuration management: SCM (`oma-scm`)
9
10## Scheduling
11
12### Goal
13Manage Git and software configuration management safely: commits, branches, merges, worktrees, releases, baselines, audit posture, CODEOWNERS, and Conventional Commits.
14
15### Intent signature
16- User asks to commit, stage, branch, merge, rebase, cherry-pick, tag, release, resolve conflicts, manage worktrees, inspect SCM posture, or apply Conventional Commits.
17- User needs safe Git operations with explicit file staging, secret awareness, and CM governance.
18
19This skill is the **single** place for **configuration management (CM)** on a software repo and for **Conventional Commits** / safe staging.
20
21### When to use
22
23- **Commits:** “commit this”, `/scm`, message type/scope, splitting staged changes into multiple commits.
24- **CM / Git:** branching (gitflow, GitHub Flow, GitLab Flow, trunk-based), protected branches, merge queue, merge conflicts, rebase, cherry-pick, worktrees, submodules/subtrees, tags and releases.
25- **Governance:** issue/ADR links, breaking-change footers, changelog or release-tool alignment.
26- **Audit posture:** signed commits, CI before merge, secret-sensitive paths.
27
28### When NOT to use
29
30- Implementing product or application code -> use the relevant domain skill
31- Debugging runtime failures without a Git or CM operation -> use `oma-debug`
32- Security, performance, or accessibility review -> use `oma-qa`
33- Planning feature requirements or decomposing work -> use `oma-pm`
34
35### Expected inputs
36- Git task, desired branch/commit/release operation, and affected files
37- Current worktree status, staged diff, branch tracking, config files, and governance constraints
38- Optional issue/ADR/PR/release context
39
40### Expected outputs
41- Safe commit, branch, merge/rebase guidance, conflict plan, status accounting, or CM audit findings
42- Conventional Commit message and explicit staged paths when committing
43- Risk notes for shared history, secrets, CODEOWNERS, CI, and release evidence
44
45### Dependencies
46- Git CLI and repository metadata
47- `.agents/oma-config.yaml`, Conventional Commit references, onboarding-risk and CODEOWNERS playbooks
48
49### Control-flow features
50- Branches by quick commit path versus full CM/governance path
51- Reads Git state and diffs; may write commits, branches, tags, or conflict resolutions
52- Requires explicit approval for broad staging, shared-history rewrite, production-destructive operations, or secret-risk paths
53
54## Structural Flow
55
56### Entry
571. Inspect Git status, branch, staged/unstaged changes, and user intent.
582. Choose Quick Path for ordinary commits or Full CM Path for governance/risky history work.
593. Read commit and CM config before enforcing project-specific rules.
60
61### Scenes
621. **PREPARE**: Determine operation type, risk, and affected files.
632. **ACQUIRE**: Read status, diff, logs, config, ownership, and release context.
643. **REASON**: Split changes, choose message/scope, identify CM controls and risks.
654. **ACT**: Stage explicit paths, commit, branch, resolve, or provide CM action plan.
665. **VERIFY**: Check status, staged diff, CI expectations, signatures, secrets, and audit evidence.
676. **FINALIZE**: Report operation result and remaining SCM tasks.
68
69### Transitions
70- If user intent is commit-only, follow Quick Path and stop after safe commit.
71- If branching/history/release/governance is involved, run Full CM Path.
72- If shared history rewrite is requested, require maintainer approval.
73- If changes span independent features, split commits unless user requests one commit.
74
75### Failure and recovery
76- If worktree is dirty in unrelated files, avoid touching unrelated changes.
77- If conflicts exist, resolve markers, test, and preserve target-branch context.
78- If secrets are detected or suspected, stop before staging/committing.
79
80### Exit
81- Success: requested SCM operation is complete or a safe, auditable plan is delivered.
82- Partial success: blockers such as conflicts, missing approval, CI, or secret risk are explicit.
83
84## Logical Operations
85
86### Actions
87| Action | SSL primitive | Evidence |
88|--------|---------------|----------|
89| Read Git state | `READ` | `git status`, diff, log, config |
90| Select SCM path | `SELECT` | Quick Path vs Full CM Path |
91| Compare change scopes | `COMPARE` | Split by type/scope/feature |
92| Validate commit/governance rules | `VALIDATE` | Config and CM controls |
93| Stage explicit files | `CALL_TOOL` | `git add <specific-files>` |
94| Commit or manage refs | `CALL_TOOL` | Git commit/branch/merge/rebase/tag |
95| Write audit notes | `WRITE` | Commit message or CM report |
96| Report result | `NOTIFY` | Final SCM summary |
97
98### Tools and instruments
99- Git CLI and repository metadata
100- Commit/CM config, Conventional Commit guide, CODEOWNERS playbook, onboarding-risk signals
101
102### Canonical command path
103```bash
104git status -sb
105git diff --staged
106git log --oneline -5
107```
108
109Stage and commit only explicit paths:
110```bash
111git add <specific-files>
112git commit -m "$(cat <<'EOF'
113<type>(<scope>): <description>
114
115[optional body]
116
117Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
118EOF
119)"
120```
121
122> **Copy the co-author address, never recall it.** Read it from
123> `scm.co_author` in `.agents/oma-config.yaml` rather than from memory.
124> GitHub matches a `Co-authored-by:` address against verified account emails
125> and credits whoever owns it as a contributor, so a one-character slip
126> attributes the work to a real, unrelated person — and `refs/pull/*` keeps
127> the commit reachable permanently, so rewriting history does not undo it.
128> A `commit-msg` hook at `.githooks/commit-msg` enforces this; a rejected
129> commit means the address is wrong, not that the hook is.
130
131### Resource scope
132| Scope | Resource target |
133|-------|-----------------|
134| `CODEBASE` | Tracked files, diffs, conflicts, CODEOWNERS |
135| `LOCAL_FS` | Git metadata, config files, commit message temp files |
136| `PROCESS` | Git commands and verification commands |
137| `CREDENTIALS` | Secret-sensitive files must not be staged or committed |
138
139### Preconditions
140- Repository and Git intent are identifiable.
141- User has authorized the requested SCM operation.
142
143### Effects and side effects
144- May stage files, create commits, branches, tags, worktrees, or history operations.
145- Can affect shared repository history if unsafe commands are used, so approvals matter.
146
147### Guardrails
148
1490. **Explicit user override (highest priority).** When the user gives an explicit, unambiguous instruction on how to perform a Git/SCM operation, follow it exactly and do not argue, re-litigate, or block on the conditions below. This overrides every default and guardrail in this skill — including "no direct push to `main`/protected branches", broad staging, the commit-split rules, single vs. multiple commits, message type/scope/length, and shared-history rewrite. State briefly what you are doing and proceed; do not ask for re-confirmation of an instruction the user already gave. Only confirm if the instruction is genuinely ambiguous (multiple plausible interpretations) — never as a way to push back on a clear directive.
150 - **Single hard exception:** likely-secret material (`.env`, keys, raw tokens). If the user's instruction would stage/commit such material, surface it once before proceeding; everything else proceeds without challenge.
1511. Choose Quick Path for ordinary commits and Full CM Path for branching, history, release, or governance work.
1522. Read `.agents/oma-config.yaml` before applying project-specific commit or CM rules.
1533. Stage only explicit files; never use broad staging unless the user explicitly approves it.
1544. Do not rewrite shared history without maintainer approval.
1555. Never stage or commit likely-secret material.
1566. **Response language follows `oma-config.yaml` `language`**: user-facing SCM output (status summaries, conflict explanations, CM audit notes, action plans) is localized. Per `i18n-guide.md`, commit messages, PR titles/body, branch names, and status keywords stay in English regardless of the setting.
157
158### Configuration
159
160| File | Role |
161|------|------|
162| `.agents/oma-config.yaml` | Conventional Commit types, branch prefixes, message rules, and CM pointers |
163
164### Operating mode (choose first)
165
166### Quick Path (commit-focused, default)
167
168Use this when the user intent is mainly "commit this safely."
169
1701. Follow **Conventional Commits** section only
1712. Stage explicit files only
1723. Validate message type/scope/length from `commit-config.yaml`
1734. Stop after safe commit unless user asks CM/governance operations
174
175### Full CM Path (repo governance / risky history operations)
176
177Use this when the user asks about branching strategy, merges, rebase/cherry-pick, worktrees, release refs, CODEOWNERS, or audit posture.
178
1791. Run CM workflows in order (Planning -> Identification -> Control -> Status accounting -> Verification)
1802. Add onboarding risk scan when inheriting or auditing a repository
1813. Include commit governance from Conventional Commits when creating commits
1824. For large-scope merge operations, use risk scoring and Ask Gate criteria from `../../workflows/scm.md`
183
184### CM process map (software)
185
186| CM function | Intent | Typical artefacts / actions |
187|-------------|--------|------------------------------|
188| **Management & planning** | Agreed rules | `CONTRIBUTING.md`, `SECURITY.md`, `commit-config.yaml` |
189| **Configuration identification** | What is managed, naming | Branch/tag rules, version files, `.gitattributes`, LFS |
190| **Configuration control** | Reviewed change | PRs, checks, issue links, `BREAKING CHANGE` footers |
191| **Status accounting** | As-built truth | `main` / release refs, `CHANGELOG`, tags, CI status |
192| **Verification & audit** | Evidence | CI logs, signed commits, lockfiles / SBOM policy |
193
194### CM workflows (use before risky history operations)
195
196### 1) Planning
197
1981. Read `commit-config.yaml` and files listed under `documented_process`.
1992. If missing, infer from `CONTRIBUTING.md` / `README`; state assumptions.
2003. Confirm **branching model** and whether **force-push** on shared branches is allowed (default: not without explicit approval).
201
202### 2) Identification
203
2041. Canonical refs: default branch, release branches/tags, version sources (`package.json`, etc.).
2052. `.gitattributes` / LFS for binaries and generated assets.
2063. Branch names vs `commit-config.yaml` `branch_prefixes` when the project uses them.
207
208### 3) Control
209
2101. Small, reviewable units; align commits with PR / issue intent.
2112. **Conflicts:** `merge-base`, `git status`, resolve markers, tests; suggest `rerere` when conflicts repeat.
2123. **Worktrees:** `git worktree add`; merge/rebase from the **target branch’s** checkout; all worktrees share one object database.
2134. Do not rewrite **shared** history without maintainer approval; prefer `--force-with-lease` if force-push is unavoidable.
214
215### 4) Status accounting
216
2171. `git status -sb`: branch, remote tracking, ahead/behind, merge state.
2182. Relate last tag / release branch to `CHANGELOG` or tooling (semantic-release, release-please, changesets) if present.
219
220### 5) Verification & audit
221
2221. Required CI and `merge_group` when merge queue applies.
2232. Never stage/commit secrets (`.env`, keys, raw tokens). Filename patterns from `commit-config.yaml` `forbidden_patterns` are enforced mechanically by the `scm-guard` PreToolUse hook; for content-level leaks (tokens hardcoded in ordinary source files), run a scanner when available (`gitleaks protect --staged`, `trufflehog git`) before large or unfamiliar commits.
2243. Call out signed-commit expectations when the org cares about verification badges.
225
226#### CODEOWNERS maintenance checklist
227
2281. Validate CODEOWNERS file exists (prefer `.github/CODEOWNERS`).
2292. Ensure critical paths are explicitly owned (not only fallback `*`).
2303. Ensure owners are active and mapped to current teams.
2314. Confirm branch protection requires CODEOWNERS review where needed.
2325. Flag overlapping/ambiguous rules that can hide intended owners.
233
234Read `change_governance.require_codeowners` and `ownership.*` in `commit-config.yaml` when present.
235
236### 6) Onboarding risk scan (optional, recommended)
237
238Use this quick scan when joining or inheriting a repository to identify risky areas before major changes.
239
2401. High churn files in `lookback` window.
2412. Ownership concentration / bus-factor signals.
2423. Bug hotspot files from fix-related history.
2434. Velocity trend by month.
2445. Revert/hotfix/emergency frequency.
245
246Read thresholds from `commit-config.yaml` `onboarding_metrics` when present and cite caveats:
247- squash merge teams can distort ownership metrics,
248- weak commit labeling reduces hotspot accuracy,
249- monorepo commit counts can bias subsystem interpretation.
250
251---
252
253### Conventional Commits
254
255### Commit types
256
257| Type | Description | Branch Prefix |
258|------|-------------|---------------|
259| feat | New feature | feature/ |
260| fix | Bug fix | fix/ |
261| refactor | Code improvement | refactor/ |
262| docs | Documentation changes | docs/ |
263| test | Test additions/modifications | test/ |
264| chore | Build, configuration, etc. | chore/ |
265| style | Code style changes | style/ |
266| perf | Performance improvements | perf/ |
267| build | Build system / external dependencies | build/ |
268| ci | CI configuration and scripts | ci/ |
269| revert | Revert a previous commit | (none) |
270
271### Commit format
272
273```
274<type>(<scope>): <description>
275
276[optional body]
277
278Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
279```
280
281### Commit workflow
282
283#### Step 1: Analyze changes
284
285```bash
286git status
287git diff --staged
288git log --oneline -5
289```
290
291#### Step 1.5: Split by feature (if needed)
292
293If changes span multiple features/domains, **split commits by feature**.
294
295**Split when:** the changes are logically independent (different features, unrelated fixes).
296
297**Do not split when:** one logical change (even if it touches code + tests + docs together), or the user asked for a single commit.
298
299**Precedence for edge cases** (when both readings are defensible):
3001. Logical independence decides first — one logical change is one commit regardless of how many types/scopes it touches.
3012. File count is only a tiebreaker: ≤5 files lean single commit; >5 files spanning multiple scopes/types lean split.
3023. An explicit user instruction (single commit or split) overrides both.
303
304#### Step 2: Determine type
305
306- New capability → `feat` · Bug fix → `fix` · Structure-only → `refactor` · Docs only → `docs` · Tests → `test` · Build/config → `chore`
307
308#### Step 3: Scope
309
310Use module/component: `feat(auth):`, `fix(api):`, or omit: `chore: update dependencies`
311
312#### Step 4: Description
313
314≤72 chars (per `commit-config.yaml`), imperative mood, lowercase start, no trailing period.
315
316#### Step 5: Execute commit
317
318Show the message, then commit with explicit paths:
319
320```bash
321git add <specific-files>
322git commit -m "$(cat <<'EOF'
323<type>(<scope>): <description>
324
325[optional body]
326
327Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
328EOF
329)"
330```
331
332If HEREDOC is unstable in your shell (or body is long), use file-based commit input:
333
334```bash
335git add <specific-files>
336msgfile="$(mktemp)"
337cat > "$msgfile" <<'EOF'
338<type>(<scope>): <description>
339
340[optional body]
341
342Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
343EOF
344git commit -F "$msgfile"
345rm -f "$msgfile"
346```
347
348Use HEREDOC by default, and switch to `-F` for long or flaky terminal sessions.
349
350### Push and PR safety (only when requested)
351
352Push only when the user asks or a workflow requires it. Before pushing:
353
3541. `git status -sb` — confirm branch, remote tracking, ahead/behind.
3552. Protected-branch check: if the target is the default/protected branch and `commit-config.yaml` sets `require_pr_for_default_branch: true`, push a topic branch and open a PR (`gh pr create`) instead of pushing directly — unless the user explicitly instructed a direct push (Guardrail 0).
3563. Never plain `--force`; after an approved history rewrite use `git push --force-with-lease`.
3574. If push is rejected (non-fast-forward), fetch and rebase/merge locally; do not retry with force.
358
359### Amend, fixup, autosquash
360
361First determine whether the target commits are shared:
362
363```bash
364git status -sb # ahead/behind vs upstream
365git log --oneline @{u}..HEAD # commits not yet pushed (errors when no upstream — treat all as unpushed)
366```
367
368- **Unpushed commits:** `git commit --amend`, `git commit --fixup <sha>` + `git rebase -i --autosquash`, and interactive rebase are safe — proceed.
369- **Pushed/shared commits:** this is a shared-history rewrite — require maintainer approval (Guardrail 4) and use `--force-with-lease` when pushing the result.
370- Before `--amend`, check `git diff --staged`: the amend must not silently absorb unrelated staged changes.
371
372## References
373
374- `.agents/oma-config.yaml`
375- `resources/conventional-commits.md`
376- `resources/onboarding-risk-signals.md`
377- `resources/codeowners-playbook.md`
378- Observability handoff: `../oma-observability/SKILL.md` §Integrations — release markers (`service.version`), revert baseline diff
379
380### Important notes
381
382- **Explicit user instruction wins.** A clear user directive on how to commit/push/branch overrides every rule below (and every other guardrail). Follow it without arguing; the only thing that still warrants a heads-up is likely-secret material.
383- **NEVER** `git add -A` or `git add .` without explicit user permission.
384- **NEVER** commit likely-secret material.
385- **ALWAYS** stage by explicit paths; tie non-trivial CM work to the five CM rows above, even briefly.