oh-my-customcode 0.78.3 → 0.79.0
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/dist/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/.claude/hooks/hooks.json +10 -0
- package/templates/.claude/hooks/scripts/rule-deletion-guard.sh +60 -0
- package/templates/.claude/rules/MUST-agent-design.md +21 -0
- package/templates/.claude/rules/MUST-enforcement-policy.md +7 -1
- package/templates/manifest.json +1 -1
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -92,6 +92,16 @@
|
|
|
92
92
|
],
|
|
93
93
|
"description": "RTK auto-intercept — transparently rewrites CLI commands through RTK proxy when available (R015 advisory)"
|
|
94
94
|
},
|
|
95
|
+
{
|
|
96
|
+
"matcher": "tool == \"Bash\" && tool_input.command matches \"(rm|git rm|mv|unlink|claude/rules)\"",
|
|
97
|
+
"hooks": [
|
|
98
|
+
{
|
|
99
|
+
"type": "command",
|
|
100
|
+
"command": "bash .claude/hooks/scripts/rule-deletion-guard.sh"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"description": "Block rule file deletion — requires individual user confirmation per rule (R001 safety)"
|
|
104
|
+
},
|
|
95
105
|
{
|
|
96
106
|
"matcher": "tool == \"Task\" || tool == \"Agent\"",
|
|
97
107
|
"hooks": [
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# rule-deletion-guard.sh — Block rule file deletion without individual user confirmation
|
|
3
|
+
# Requires: jq
|
|
4
|
+
|
|
5
|
+
set -uo pipefail
|
|
6
|
+
|
|
7
|
+
input=$(cat)
|
|
8
|
+
|
|
9
|
+
# Dependency check — allow if jq missing
|
|
10
|
+
if ! command -v jq &>/dev/null; then
|
|
11
|
+
echo "$input"
|
|
12
|
+
exit 0
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
# Parse tool input
|
|
16
|
+
tool=$(echo "$input" | jq -r '.tool // ""' 2>/dev/null) || { echo "$input"; exit 0; }
|
|
17
|
+
cmd=$(echo "$input" | jq -r '.tool_input.command // ""' 2>/dev/null) || { echo "$input"; exit 0; }
|
|
18
|
+
|
|
19
|
+
# Only check Bash tool
|
|
20
|
+
if [ "$tool" != "Bash" ]; then
|
|
21
|
+
echo "$input"
|
|
22
|
+
exit 0
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Check if command would delete parent directories containing rules
|
|
26
|
+
if echo "$cmd" | grep -qE '(^|\s)(rm|git\s+rm|mv|unlink)\s' && echo "$cmd" | grep -qE '\.claude/?(\s|$)'; then
|
|
27
|
+
echo "[Hook] ⛔ RULE DELETION BLOCKED — Parent directory deletion detected" >&2
|
|
28
|
+
echo "[Hook] This command would delete the entire .claude/ directory including all rules." >&2
|
|
29
|
+
echo "[Hook] Delete rules individually with user confirmation." >&2
|
|
30
|
+
exit 2
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Check if command targets .claude/rules/ for deletion (including mv, unlink)
|
|
34
|
+
if echo "$cmd" | grep -qE '(^|\s)(rm|git\s+rm|mv|unlink)\s' && echo "$cmd" | grep -qE '\.claude/rules(/|\s|$)'; then
|
|
35
|
+
# Extract target files
|
|
36
|
+
targets=$(echo "$cmd" | grep -oE '\.claude/rules/[^ ]+' | tr '\n' ', ' | sed 's/,$//')
|
|
37
|
+
target_count=$(echo "$cmd" | grep -oE '\.claude/rules/[^ ]+' | wc -l | tr -d ' ')
|
|
38
|
+
|
|
39
|
+
# Check for glob/wildcard patterns or multiple targets
|
|
40
|
+
if echo "$cmd" | grep -qE '\.claude/rules/\*|\.claude/rules/[^ ]*\*' || [ "$target_count" -gt 1 ]; then
|
|
41
|
+
echo "[Hook] ⛔ RULE DELETION BLOCKED — Multiple rules detected" >&2
|
|
42
|
+
echo "[Hook] Targets: $targets" >&2
|
|
43
|
+
echo "[Hook] Rule files must be deleted ONE AT A TIME with user confirmation." >&2
|
|
44
|
+
echo "[Hook] Delete each rule individually after asking: \"정말 {파일명}을(를) 삭제하시겠습니까?\"" >&2
|
|
45
|
+
exit 2
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
# Single rule file
|
|
49
|
+
filename=$(basename "$targets" 2>/dev/null || echo "$targets")
|
|
50
|
+
echo "[Hook] ⛔ RULE DELETION BLOCKED" >&2
|
|
51
|
+
echo "[Hook] Target: $filename" >&2
|
|
52
|
+
echo "[Hook] Rule files require individual user confirmation before deletion." >&2
|
|
53
|
+
echo "[Hook] Ask the user: \"정말 ${filename}을(를) 삭제하시겠습니까?\"" >&2
|
|
54
|
+
echo "[Hook] Only proceed after explicit user approval." >&2
|
|
55
|
+
exit 2
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
# Not a rule deletion — pass through
|
|
59
|
+
echo "$input"
|
|
60
|
+
exit 0
|
|
@@ -59,8 +59,11 @@ limitations: # Negative capability declarations
|
|
|
59
59
|
- "cannot execute tests"
|
|
60
60
|
- "cannot modify code"
|
|
61
61
|
domain: backend # backend | frontend | data-engineering | devops | universal
|
|
62
|
+
disableSkillShellExecution: true # Disable inline shell execution in skills (v2.1.91+)
|
|
62
63
|
```
|
|
63
64
|
|
|
65
|
+
> **Note**: When `disableSkillShellExecution` is enabled (v2.1.91+), skills that rely on inline shell execution (e.g., `codex-exec`, `gemini-exec`, `rtk-exec`) will have their shell blocks disabled. This is a security hardening option.
|
|
66
|
+
|
|
64
67
|
> **Note**: `isolation`, `background`, `maxTurns`, `maxTokens`, `mcpServers`, `hooks`, `permissionMode`, `disallowedTools`, `limitations` are supported in Claude Code v2.1.63+. Hook types `PostCompact`, `Elicitation`, `ElicitationResult` require v2.1.76+. `CwdChanged`, `FileChanged` hook events and `managed-settings.d/` drop-in directory require v2.1.83+. Conditional `if` field for hooks requires v2.1.85+.
|
|
65
68
|
|
|
66
69
|
## Hook Event Types
|
|
@@ -99,6 +102,17 @@ All supported hook event types in Claude Code. Agents and skills can reference t
|
|
|
99
102
|
| `http` | POST to HTTP endpoint | External integrations, webhooks |
|
|
100
103
|
| `agent` | Spawn agent to handle event | Complex event-driven workflows |
|
|
101
104
|
|
|
105
|
+
### PreToolUse Hook Return Values
|
|
106
|
+
|
|
107
|
+
| Return | Behavior | CC Version |
|
|
108
|
+
|--------|----------|------------|
|
|
109
|
+
| `exit 0` | Allow tool execution | All |
|
|
110
|
+
| `exit 1` | Block silently | All |
|
|
111
|
+
| `exit 2` + stderr | Block with message | All |
|
|
112
|
+
| `{"decision": "defer"}` | Pause execution; resume with `-p --resume` | v2.1.89+ |
|
|
113
|
+
|
|
114
|
+
The `defer` decision allows headless sessions to pause at a tool call for human review.
|
|
115
|
+
|
|
102
116
|
### Hook Matcher Syntax
|
|
103
117
|
|
|
104
118
|
```yaml
|
|
@@ -225,6 +239,12 @@ Fast Mode uses the same model with faster output. Activated via `/fast` toggle o
|
|
|
225
239
|
|
|
226
240
|
When Fast Mode is active, it reduces effective reasoning depth but does NOT override the `effort` frontmatter field. The effort field controls task complexity allocation; Fast Mode controls output generation speed.
|
|
227
241
|
|
|
242
|
+
### Default Effort Change (CC v2.1.94+)
|
|
243
|
+
|
|
244
|
+
Starting with Claude Code v2.1.94, the default effort level changed from `medium` to `high` for API-key, Bedrock/Vertex/Foundry, Team, and Enterprise users. Console (free-tier) users retain `medium` as the default.
|
|
245
|
+
|
|
246
|
+
This means agents WITHOUT an explicit `effort` field now run at `high` effort by default on paid tiers. To maintain previous behavior, set `effort: medium` explicitly in agent frontmatter.
|
|
247
|
+
|
|
228
248
|
## Skill Frontmatter
|
|
229
249
|
|
|
230
250
|
Location: `.claude/skills/{name}/SKILL.md`
|
|
@@ -255,6 +275,7 @@ hooks: # Skill-specific hooks (same syntax as agent
|
|
|
255
275
|
paths: ["src/**/*.ts"] # Conditional loading — skill auto-injected when matching files are open
|
|
256
276
|
shell: "bash" # Shell for embedded script execution
|
|
257
277
|
allowed-tools: [Read, Write, Bash] # Restrict tools available during skill execution
|
|
278
|
+
keep-coding-instructions: true # Preserve coding instructions in plugin output styles (v2.1.94+)
|
|
258
279
|
```
|
|
259
280
|
|
|
260
281
|
When both an agent and its invoked skill specify `effort`, the skill's value takes precedence (more specific invocation-time setting).
|
|
@@ -10,7 +10,7 @@ oh-my-customcode uses an **advisory-first enforcement model**. Most rules are en
|
|
|
10
10
|
|
|
11
11
|
| Tier | Mechanism | Rules | Behavior |
|
|
12
12
|
|------|-----------|-------|----------|
|
|
13
|
-
| Hard Block | PreToolUse hook, exit
|
|
13
|
+
| Hard Block | PreToolUse hook, exit 2 | stage-blocker, dev-server tmux, rule-deletion-guard | Prevents tool execution |
|
|
14
14
|
| Soft Block | Stop hook prompt | R011 session-end saves | Auto-performs then approves |
|
|
15
15
|
| Advisory | PostToolUse hooks | R007, R008, R009, R010, R018 | Warns via stderr, never blocks |
|
|
16
16
|
| Prompt-based | CLAUDE.md + rules/ + PostCompact | All MUST rules | Behavioral guidance in context |
|
|
@@ -33,6 +33,12 @@ If advisory enforcement proves insufficient for specific rules, these are candid
|
|
|
33
33
|
|
|
34
34
|
Promotion requires: (1) measured violation rate data, (2) user approval, (3) rollback plan.
|
|
35
35
|
|
|
36
|
+
### Promoted to Hard Block
|
|
37
|
+
|
|
38
|
+
| Hook | Date | Justification |
|
|
39
|
+
|------|------|---------------|
|
|
40
|
+
| `rule-deletion-guard.sh` | 2026-04-08 | User-requested: rule files must require individual confirmation before deletion. Prevents accidental bulk deletion of project rules. |
|
|
41
|
+
|
|
36
42
|
## Integration
|
|
37
43
|
|
|
38
44
|
| Rule | Interaction |
|
package/templates/manifest.json
CHANGED