oh-my-customcode 0.136.0 → 0.136.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -222,7 +222,7 @@ Key rules: R010 (orchestrator never writes files), R009 (parallel execution mand
222
222
 
223
223
  ---
224
224
 
225
- ### Guides (49)
225
+ ### Guides (50)
226
226
 
227
227
  Reference documentation covering best practices, architecture decisions, and integration patterns. Located in `guides/` at project root, covering topics from agent design to CI/CD to observability.
228
228
 
@@ -279,7 +279,7 @@ your-project/
279
279
  │ ├── specs/ # Extracted canonical specs
280
280
  │ ├── contexts/ # 4 shared context files
281
281
  │ └── ontology/ # Knowledge graph for RAG
282
- └── guides/ # 49 reference documents
282
+ └── guides/ # 50 reference documents
283
283
  ```
284
284
 
285
285
  ---
package/dist/cli/index.js CHANGED
@@ -2334,7 +2334,7 @@ var init_package = __esm(() => {
2334
2334
  workspaces: [
2335
2335
  "packages/*"
2336
2336
  ],
2337
- version: "0.136.0",
2337
+ version: "0.136.1",
2338
2338
  description: "Batteries-included agent harness for Claude Code",
2339
2339
  type: "module",
2340
2340
  bin: {
package/dist/index.js CHANGED
@@ -2014,7 +2014,7 @@ var package_default = {
2014
2014
  workspaces: [
2015
2015
  "packages/*"
2016
2016
  ],
2017
- version: "0.136.0",
2017
+ version: "0.136.1",
2018
2018
  description: "Batteries-included agent harness for Claude Code",
2019
2019
  type: "module",
2020
2020
  bin: {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "workspaces": [
4
4
  "packages/*"
5
5
  ],
6
- "version": "0.136.0",
6
+ "version": "0.136.1",
7
7
  "description": "Batteries-included agent harness for Claude Code",
8
8
  "type": "module",
9
9
  "bin": {
@@ -52,10 +52,15 @@ Types: feat, fix, docs, style, refactor, test, chore
52
52
 
53
53
  ## Safety Rules
54
54
 
55
- - NEVER force push to main/master
56
- - NEVER reset --hard without confirmation
55
+ - NEVER force push to main/master (use `--force-with-lease` only on feature branches with explicit user approval)
56
+ - NEVER `git reset --hard` without confirmation — verify `git status` shows clean tree OR user explicitly accepts loss
57
+ - NEVER `git checkout -- <path>` / `git restore <path>` without confirmation — uncommitted changes are unrecoverable
58
+ - NEVER `git clean -fd` without prior `git clean -nd` dry-run + user approval
59
+ - NEVER `git branch -D <branch>` without showing `git log <branch>` first if branch has unmerged commits
57
60
  - NEVER skip pre-commit hooks without reason
58
61
  - ALWAYS create new commits (avoid --amend unless requested)
62
+ - ALWAYS check `git reflog` before declaring work lost — most destructive ops are recoverable for 30 days
63
+ - Reference: R001 Destructive Git Commands section, #1146 (v0.136.0 working tree loss incident)
59
64
 
60
65
  ## Push Rules (R016)
61
66
 
@@ -11,6 +11,20 @@
11
11
  | Commands | `rm -rf /` or broad deletes, shutdown/restart, sudo/su, network config changes |
12
12
  | External | Access URLs without approval, send user data externally, download/execute unknown scripts |
13
13
 
14
+ ## Destructive Git Commands (Working Tree Loss Risk)
15
+
16
+ The following git commands have caused working tree loss in past sessions (#1146, v0.136.0). REQUIRE explicit user approval per invocation:
17
+
18
+ | Command | Risk | Required Action |
19
+ |---------|------|----------------|
20
+ | `git reset --hard <ref>` (especially to remote/old SHA) | Erases uncommitted + committed local changes | Confirm uncommitted state with `git status`; show ref delta; explicit approval |
21
+ | `git checkout -- <path>` / `git restore <path>` (without `--source`) | Discards uncommitted file changes | Confirm file is intentionally being reverted; explicit approval |
22
+ | `git clean -fd` / `git clean -fdx` | Permanently deletes untracked files (incl. ignored with `-x`) | List files with `git clean -nd` first; explicit approval |
23
+ | `git branch -D <name>` (when branch has unmerged commits) | Loses unmerged work | Show `git log <branch>` first; confirm commits are pushed elsewhere; explicit approval |
24
+ | `git push --force` / `git push --force-with-lease` to shared branches | Rewrites shared history | NEVER on main/master; explicit approval for feature branches with active collaborators |
25
+
26
+ **Recovery hint**: If working tree loss occurs, check `git reflog` immediately — most operations are recoverable within 30 days.
27
+
14
28
  ## Required Before Destructive Operations
15
29
 
16
30
  Verify target, assess impact scope, check recoverability, get user approval.
@@ -0,0 +1,97 @@
1
+ # Git Safety Guide
2
+
3
+ Reference for safe git operations in autonomous AI agent flows. Born from #1146 (v0.136.0 working tree loss incident).
4
+
5
+ ## Destructive Commands Quick Reference
6
+
7
+ | Command | Risk | Required Action |
8
+ |---------|------|----------------|
9
+ | `git reset --hard <ref>` | Erases uncommitted + committed local changes | Confirm `git status` clean; show ref delta; explicit user approval |
10
+ | `git checkout -- <path>` / `git restore <path>` | Discards uncommitted file changes | Confirm intentional revert; explicit approval |
11
+ | `git clean -fd` / `-fdx` | Permanently deletes untracked files | Run `git clean -nd` dry-run first; explicit approval |
12
+ | `git branch -D <name>` (unmerged) | Loses unmerged work | Show `git log <branch>` first; confirm pushed elsewhere |
13
+ | `git push --force` (shared branch) | Rewrites shared history | NEVER on main/master; explicit approval for collaborative branches |
14
+
15
+ ## Pre-Flight Checks
16
+
17
+ Before any destructive operation:
18
+
19
+ ```bash
20
+ git status --porcelain | wc -l # MUST be 0 for safe destructive op
21
+ git stash list # check if work was previously stashed
22
+ git reflog -n 20 # baseline before any history-rewriting op
23
+ ```
24
+
25
+ ## Recovery Procedures
26
+
27
+ ### From `git reset --hard`
28
+
29
+ ```bash
30
+ git reflog # find pre-reset SHA
31
+ git reset --hard <pre-reset-sha> # restore HEAD
32
+ ```
33
+
34
+ Most operations are recoverable within 30 days (default reflog expiry).
35
+
36
+ ### From `git clean -fd`
37
+
38
+ Untracked file deletion is **permanent**. Recovery requires:
39
+ - Editor history (VS Code, JetBrains)
40
+ - Filesystem snapshots (Time Machine, ZFS, btrfs)
41
+ - Container layer cache (if in Docker)
42
+
43
+ ### From `git branch -D` (unmerged commits)
44
+
45
+ ```bash
46
+ git reflog # find branch tip SHA
47
+ git branch <name> <sha> # recreate branch
48
+ ```
49
+
50
+ ### From orphaned commits (no ref)
51
+
52
+ ```bash
53
+ git fsck --lost-found # find dangling commits
54
+ git show <sha> # inspect candidates
55
+ git branch recovered <sha> # save as branch
56
+ ```
57
+
58
+ ## Agent-Specific Rules
59
+
60
+ For AI agents executing git in autonomous flows:
61
+
62
+ 1. **Pre-check is mandatory** — never assume "small change"
63
+ 2. **Report uncommitted state** — show `git status` output to user before destructive ops
64
+ 3. **Stash before reset** — `git stash push -u "pre-reset-<reason>"` is cheap insurance
65
+ 4. **Reflog baseline** — capture `git reflog -n 5` before any history-rewriting op
66
+
67
+ ## Cross-References
68
+
69
+ - **R001** (`.claude/rules/MUST-safety.md`) — Destructive Git Commands section
70
+ - **mgr-gitnerd** (`.claude/agents/mgr-gitnerd.md`) — Safety Rules section
71
+ - **Issue #1146** — Original v0.136.0 working tree loss incident
72
+ - **mgr-gitnerd memory** (`.claude/agent-memory/mgr-gitnerd/MEMORY.md`) — Incident lessons
73
+
74
+ ## Reference Implementation Patterns
75
+
76
+ ### Safe reset wrapper (pseudo-code)
77
+
78
+ ```bash
79
+ safe_reset() {
80
+ local target=$1
81
+ local dirty=$(git status --porcelain | wc -l)
82
+ if [ "$dirty" -gt 0 ]; then
83
+ echo "WARNING: $dirty uncommitted change(s). Stash or commit first."
84
+ git status --short
85
+ return 1
86
+ fi
87
+ echo "Reset preview:"
88
+ git log HEAD..$target --oneline
89
+ git log $target..HEAD --oneline
90
+ read -p "Proceed? [y/N] " confirm
91
+ [ "$confirm" = "y" ] && git reset --hard "$target"
92
+ }
93
+ ```
94
+
95
+ ### Destructive op detection (advisory)
96
+
97
+ See `.claude/hooks/scripts/git-delegation-guard.sh` for the existing R010 advisory pattern. A future `destructive-git-guard.sh` (T2 from #1146, deferred) will add R001 destructive-op-specific warnings.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.136.0",
2
+ "version": "0.136.1",
3
3
  "lastUpdated": "2026-05-14T00:00:00.000Z",
4
4
  "omcustomMinClaudeCode": "2.1.121",
5
5
  "omcustomMinClaudeCodeReason": "Sensitive-path direct Write/Edit on .claude/** under bypassPermissions (R010 deprecation, #1101)",
@@ -26,7 +26,7 @@
26
26
  "name": "guides",
27
27
  "path": "guides",
28
28
  "description": "Reference documentation",
29
- "files": 49
29
+ "files": 50
30
30
  },
31
31
  {
32
32
  "name": "hooks",