oh-my-customcode 0.97.0 → 0.98.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/README.md +2 -2
- package/dist/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/.claude/hooks/hooks.json +13 -1
- package/templates/.claude/hooks/scripts/task-state-precompact.sh +58 -0
- package/templates/CLAUDE.md +1 -1
- package/templates/guides/multi-provider-exec/README.md +83 -0
- package/templates/manifest.json +2 -2
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 (
|
|
225
|
+
### Guides (38)
|
|
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/ #
|
|
282
|
+
└── guides/ # 38 reference documents
|
|
283
283
|
```
|
|
284
284
|
|
|
285
285
|
---
|
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -311,13 +311,25 @@
|
|
|
311
311
|
"description": "Log task completion events for Agent Teams coordination"
|
|
312
312
|
}
|
|
313
313
|
],
|
|
314
|
+
"PreCompact": [
|
|
315
|
+
{
|
|
316
|
+
"matcher": "*",
|
|
317
|
+
"hooks": [
|
|
318
|
+
{
|
|
319
|
+
"type": "command",
|
|
320
|
+
"command": "bash .claude/hooks/scripts/task-state-precompact.sh"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"description": "Serialize active task state before compaction — pairs with PostCompact restore (#922)"
|
|
324
|
+
}
|
|
325
|
+
],
|
|
314
326
|
"PostCompact": [
|
|
315
327
|
{
|
|
316
328
|
"matcher": "*",
|
|
317
329
|
"hooks": [
|
|
318
330
|
{
|
|
319
331
|
"type": "prompt",
|
|
320
|
-
"prompt": "Context compacted. RULES ACTIVE.\n\nR007: next response MUST start with ┌─ Agent: claude (default) / └─ Task: {task}\nR008: before EVERY tool call → [claude][model] → Tool: Name / Target: path\nR010: write→delegate to subagent; orchestrator read-only (Read/Glob/Grep); git→mgr-gitnerd\nR009: 2+ independent tasks → parallel agents, same message\nR018: 3+ agents OR review cycle → Agent Teams\nR000: user communication in Korean (한국어); code/files in English — NON-NEGOTIABLE\nR001: prohibited actions (no secrets, no system files, no rm -rf); stop on violation → preserve state → report → wait\nR002: tool tiers (Read/Grep=free, Write/Edit=notify, Bash=approval); no writes outside project; no .env/.git/config\n\nAutonomous mode: if /tmp/.claude-autonomous-$PPID exists → simple git (add/commit/push) may run directly; Write/Edit still delegates.\nbypassPermissions does NOT persist across compaction — re-enable if tasks seem blocked.\n\nRe-read CLAUDE.md NOW."
|
|
332
|
+
"prompt": "Context compacted. RULES ACTIVE.\n\nR007: next response MUST start with ┌─ Agent: claude (default) / └─ Task: {task}\nR008: before EVERY tool call → [claude][model] → Tool: Name / Target: path\nR010: write→delegate to subagent; orchestrator read-only (Read/Glob/Grep); git→mgr-gitnerd\nR009: 2+ independent tasks → parallel agents, same message\nR018: 3+ agents OR review cycle → Agent Teams\nR000: user communication in Korean (한국어); code/files in English — NON-NEGOTIABLE\nR001: prohibited actions (no secrets, no system files, no rm -rf); stop on violation → preserve state → report → wait\nR002: tool tiers (Read/Grep=free, Write/Edit=notify, Bash=approval); no writes outside project; no .env/.git/config\n\nAutonomous mode: if /tmp/.claude-autonomous-$PPID exists → simple git (add/commit/push) may run directly; Write/Edit still delegates.\nbypassPermissions does NOT persist across compaction — re-enable if tasks seem blocked.\n\nTask state restore: if /tmp/.claude-task-state-$PPID.json exists, read it to recover active pipeline, dev stage, and autonomous mode state. This was saved by PreCompact hook.\n\nRe-read CLAUDE.md NOW."
|
|
321
333
|
}
|
|
322
334
|
],
|
|
323
335
|
"description": "Reinforce enforced rules after context compaction — prevents rule amnesia (v2.1.76+)"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# PreCompact hook: serialize active task state before context compaction
|
|
3
|
+
# Pairs with PostCompact prompt that restores this state
|
|
4
|
+
|
|
5
|
+
STATE_FILE="/tmp/.claude-task-state-$PPID.json"
|
|
6
|
+
|
|
7
|
+
collect_state() {
|
|
8
|
+
local pipeline_state=""
|
|
9
|
+
local autonomous=""
|
|
10
|
+
local dev_stage=""
|
|
11
|
+
local tool_count=""
|
|
12
|
+
local loop_count=""
|
|
13
|
+
|
|
14
|
+
# Pipeline state
|
|
15
|
+
for f in /tmp/.claude-pipeline-*-$PPID.json; do
|
|
16
|
+
[ -f "$f" ] && pipeline_state=$(cat "$f" 2>/dev/null | jq -c '.' 2>/dev/null) && break
|
|
17
|
+
done
|
|
18
|
+
|
|
19
|
+
# Autonomous mode
|
|
20
|
+
[ -f "/tmp/.claude-autonomous-$PPID" ] && autonomous="true"
|
|
21
|
+
|
|
22
|
+
# Dev stage (structured-dev-cycle)
|
|
23
|
+
[ -f "/tmp/.claude-dev-stage" ] && dev_stage=$(cat "/tmp/.claude-dev-stage" 2>/dev/null)
|
|
24
|
+
|
|
25
|
+
# Tool call counter
|
|
26
|
+
[ -f "/tmp/claude-tool-count-$PPID" ] && tool_count=$(cat "/tmp/claude-tool-count-$PPID" 2>/dev/null)
|
|
27
|
+
|
|
28
|
+
# Auto-continue loop count
|
|
29
|
+
[ -f "/tmp/.claude-loop-count-$PPID" ] && loop_count=$(cat "/tmp/.claude-loop-count-$PPID" 2>/dev/null)
|
|
30
|
+
|
|
31
|
+
# Build JSON (keep under 500 bytes for context efficiency)
|
|
32
|
+
jq -n \
|
|
33
|
+
--arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
|
34
|
+
--arg pipeline "$pipeline_state" \
|
|
35
|
+
--arg auto "$autonomous" \
|
|
36
|
+
--arg stage "$dev_stage" \
|
|
37
|
+
--arg tools "$tool_count" \
|
|
38
|
+
--arg loops "$loop_count" \
|
|
39
|
+
'{
|
|
40
|
+
captured_at: $ts,
|
|
41
|
+
pipeline: (if $pipeline != "" then ($pipeline | fromjson? // null) else null end),
|
|
42
|
+
autonomous_mode: ($auto == "true"),
|
|
43
|
+
dev_stage: (if $stage != "" then $stage else null end),
|
|
44
|
+
tool_calls: (if $tools != "" then ($tools | tonumber? // null) else null end),
|
|
45
|
+
loop_count: (if $loops != "" then ($loops | tonumber? // null) else null end)
|
|
46
|
+
} | del(.[] | nulls)'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
state=$(collect_state 2>/dev/null)
|
|
50
|
+
|
|
51
|
+
if [ -n "$state" ] && [ "$state" != "{}" ]; then
|
|
52
|
+
echo "$state" > "$STATE_FILE"
|
|
53
|
+
echo "[PreCompact] Task state saved to $STATE_FILE" >&2
|
|
54
|
+
else
|
|
55
|
+
echo "[PreCompact] No active task state to save" >&2
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
cat
|
package/templates/CLAUDE.md
CHANGED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Multi-Provider Exec
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Unified reference for executing prompts through external LLM providers via exec skills. Complements the [Multi-Model Routing](../multi-model-routing/README.md) guide (Claude model selection) with cross-provider execution capabilities.
|
|
6
|
+
|
|
7
|
+
Inspired by OpenHarness's provider profile switching pattern, adapted for oh-my-customcode's skill-based architecture.
|
|
8
|
+
|
|
9
|
+
## Provider Matrix
|
|
10
|
+
|
|
11
|
+
| Provider | Skill | CLI Dependency | Model | Strengths |
|
|
12
|
+
|----------|-------|---------------|-------|-----------|
|
|
13
|
+
| OpenAI (Codex) | `codex-exec` | `codex` CLI | GPT-5.4 | Code generation, broad knowledge |
|
|
14
|
+
| Google (Gemini) | `gemini-exec` | `gemini` CLI | Gemini 2.5 Pro | Long context, multimodal |
|
|
15
|
+
| RTK (proxy) | `rtk-exec` | `rtk` CLI | Configurable | Token-optimized output, cost reduction |
|
|
16
|
+
|
|
17
|
+
## Availability Detection
|
|
18
|
+
|
|
19
|
+
The `session-env-check.sh` hook (SessionStart) auto-detects available providers:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
[SessionStart] Checking external CLI availability...
|
|
23
|
+
codex: ✓ available
|
|
24
|
+
gemini: ✗ not found
|
|
25
|
+
rtk: ✓ available
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Providers are opt-in — missing CLIs are silently skipped.
|
|
29
|
+
|
|
30
|
+
## Usage Patterns
|
|
31
|
+
|
|
32
|
+
### Direct Invocation
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
/codex-exec "Review this function for security issues"
|
|
36
|
+
/gemini-exec "Analyze this architecture diagram"
|
|
37
|
+
/rtk-exec "List files matching pattern X"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Provider Selection Guide
|
|
41
|
+
|
|
42
|
+
| Task | Recommended Provider | Rationale |
|
|
43
|
+
|------|---------------------|-----------|
|
|
44
|
+
| Second opinion on code review | codex-exec | Independent model reduces confirmation bias |
|
|
45
|
+
| Long document analysis | gemini-exec | 1M+ context window |
|
|
46
|
+
| Token-heavy batch operations | rtk-exec | Compressed output reduces context cost |
|
|
47
|
+
| Security audit cross-check | codex-exec | Different training data catches different patterns |
|
|
48
|
+
| Multi-model verification | All three | `/multi-model-verification` skill orchestrates this |
|
|
49
|
+
|
|
50
|
+
### Integration with Existing Skills
|
|
51
|
+
|
|
52
|
+
| Skill | Uses Provider | How |
|
|
53
|
+
|-------|--------------|-----|
|
|
54
|
+
| `multi-model-verification` | codex-exec + gemini-exec | Parallel verification with severity classification |
|
|
55
|
+
| `reasoning-sandwich` | Any exec skill | Pre/post reasoning with different models |
|
|
56
|
+
| `model-escalation` | Claude models only | Internal escalation (haiku→sonnet→opus), not cross-provider |
|
|
57
|
+
|
|
58
|
+
## Relationship to Multi-Model Routing
|
|
59
|
+
|
|
60
|
+
| Aspect | Multi-Model Routing | Multi-Provider Exec |
|
|
61
|
+
|--------|--------------------|--------------------|
|
|
62
|
+
| Scope | Claude model selection | Cross-provider execution |
|
|
63
|
+
| Models | haiku / sonnet / opus | GPT-5.4 / Gemini 2.5 / RTK proxy |
|
|
64
|
+
| Mechanism | `model` frontmatter field | Exec skill invocation |
|
|
65
|
+
| Use case | Cost/quality optimization within Claude | Independent verification, specialized tasks |
|
|
66
|
+
| Guide | `guides/multi-model-routing/` | `guides/multi-provider-exec/` |
|
|
67
|
+
|
|
68
|
+
## Configuration
|
|
69
|
+
|
|
70
|
+
No global configuration required. Each exec skill reads its own CLI configuration:
|
|
71
|
+
|
|
72
|
+
| Skill | Config Source |
|
|
73
|
+
|-------|-------------|
|
|
74
|
+
| codex-exec | `~/.codex/config` or CODEX_API_KEY env |
|
|
75
|
+
| gemini-exec | `~/.gemini/config` or GEMINI_API_KEY env |
|
|
76
|
+
| rtk-exec | RTK proxy running on localhost |
|
|
77
|
+
|
|
78
|
+
## Limitations
|
|
79
|
+
|
|
80
|
+
- Provider availability depends on user's CLI installations
|
|
81
|
+
- Cross-provider results are advisory — Claude remains the primary execution engine
|
|
82
|
+
- No automatic fallback between providers (by design — explicit selection preferred)
|
|
83
|
+
- Rate limits and costs are provider-specific and not tracked by oh-my-customcode
|
package/templates/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.98.0",
|
|
3
3
|
"lastUpdated": "2026-04-18T00:00:00.000Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"name": "guides",
|
|
25
25
|
"path": "guides",
|
|
26
26
|
"description": "Reference documentation",
|
|
27
|
-
"files":
|
|
27
|
+
"files": 38
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"name": "hooks",
|