oh-my-customcode 0.81.0 → 0.82.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 +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
- package/templates/CLAUDE.md +1 -1
- package/templates/guides/agents-md-quality/README.md +110 -0
- package/templates/guides/index.yaml +19 -0
- package/templates/guides/multi-model-routing/README.md +101 -0
- package/templates/guides/worktree-lifecycle/README.md +104 -0
- package/templates/manifest.json +2 -2
package/README.md
CHANGED
|
@@ -235,7 +235,7 @@ Key rules: R010 (orchestrator never writes files), R009 (parallel execution mand
|
|
|
235
235
|
|
|
236
236
|
---
|
|
237
237
|
|
|
238
|
-
### Guides (
|
|
238
|
+
### Guides (36)
|
|
239
239
|
|
|
240
240
|
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.
|
|
241
241
|
|
|
@@ -292,7 +292,7 @@ your-project/
|
|
|
292
292
|
│ ├── specs/ # Extracted canonical specs
|
|
293
293
|
│ ├── contexts/ # 4 shared context files
|
|
294
294
|
│ └── ontology/ # Knowledge graph for RAG
|
|
295
|
-
└── guides/ #
|
|
295
|
+
└── guides/ # 36 reference documents
|
|
296
296
|
```
|
|
297
297
|
|
|
298
298
|
---
|
package/dist/cli/index.js
CHANGED
|
@@ -2301,7 +2301,7 @@ var init_package = __esm(() => {
|
|
|
2301
2301
|
workspaces: [
|
|
2302
2302
|
"packages/*"
|
|
2303
2303
|
],
|
|
2304
|
-
version: "0.
|
|
2304
|
+
version: "0.82.0",
|
|
2305
2305
|
description: "Batteries-included agent harness for Claude Code",
|
|
2306
2306
|
type: "module",
|
|
2307
2307
|
bin: {
|
|
@@ -28047,7 +28047,8 @@ async function installSettingsLocal(targetDir, result) {
|
|
|
28047
28047
|
statusLine: {
|
|
28048
28048
|
type: "command",
|
|
28049
28049
|
command: ".claude/statusline.sh",
|
|
28050
|
-
padding: 0
|
|
28050
|
+
padding: 0,
|
|
28051
|
+
refreshInterval: 10
|
|
28051
28052
|
}
|
|
28052
28053
|
};
|
|
28053
28054
|
if (await fileExists(settingsPath)) {
|
package/dist/index.js
CHANGED
|
@@ -1654,7 +1654,8 @@ async function installSettingsLocal(targetDir, result) {
|
|
|
1654
1654
|
statusLine: {
|
|
1655
1655
|
type: "command",
|
|
1656
1656
|
command: ".claude/statusline.sh",
|
|
1657
|
-
padding: 0
|
|
1657
|
+
padding: 0,
|
|
1658
|
+
refreshInterval: 10
|
|
1658
1659
|
}
|
|
1659
1660
|
};
|
|
1660
1661
|
if (await fileExists(settingsPath)) {
|
|
@@ -1973,7 +1974,7 @@ var package_default = {
|
|
|
1973
1974
|
workspaces: [
|
|
1974
1975
|
"packages/*"
|
|
1975
1976
|
],
|
|
1976
|
-
version: "0.
|
|
1977
|
+
version: "0.82.0",
|
|
1977
1978
|
description: "Batteries-included agent harness for Claude Code",
|
|
1978
1979
|
type: "module",
|
|
1979
1980
|
bin: {
|
package/package.json
CHANGED
package/templates/CLAUDE.md
CHANGED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Agent Definition Quality Standards
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Quality criteria for `.claude/agents/*.md` files. Adapted from ETH Zurich research on LLM-generated agent configurations, modified to fit oh-my-customcode's "create, connect, use" philosophy.
|
|
6
|
+
|
|
7
|
+
## Core Principle: LLM Generation + Human Verification
|
|
8
|
+
|
|
9
|
+
> ETH Zurich finding: Purely LLM-generated AGENTS.md files perform worse than human-crafted ones.
|
|
10
|
+
>
|
|
11
|
+
> oh-my-customcode adaptation: LLM generation is the core workflow (via mgr-creator), but **verification is mandatory**. The creation tool generates; the verification process validates.
|
|
12
|
+
|
|
13
|
+
| Approach | Status |
|
|
14
|
+
|----------|--------|
|
|
15
|
+
| Pure LLM generation without review | Not recommended |
|
|
16
|
+
| LLM generation + mgr-sauron verification | Required (current workflow) |
|
|
17
|
+
| Human-crafted from scratch | Acceptable but not required |
|
|
18
|
+
|
|
19
|
+
## Four-Section Structure
|
|
20
|
+
|
|
21
|
+
Every agent file SHOULD contain these conceptual sections:
|
|
22
|
+
|
|
23
|
+
### 1. STYLE — How the agent communicates
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
# In frontmatter or body
|
|
27
|
+
# - Output format preferences
|
|
28
|
+
# - Verbosity level (maps to effort: low/medium/high)
|
|
29
|
+
# - Language conventions
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. GOTCHAS — Known pitfalls and edge cases
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
## Known Issues
|
|
36
|
+
- This agent cannot handle files larger than X
|
|
37
|
+
- Requires MCP server Y to be running
|
|
38
|
+
- Output format changes when ecomode is active
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 3. ARCH_DECISIONS — Why this agent exists this way
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
## Design Decisions
|
|
45
|
+
- Uses sonnet (not opus) because task complexity is moderate
|
|
46
|
+
- Skills X and Y are included because they cover the primary workflow
|
|
47
|
+
- Memory scope is project (not user) because knowledge is repo-specific
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 4. TEST_STRATEGY — How to verify the agent works
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
## Verification
|
|
54
|
+
- Run with sample input: `Agent(subagent_type: "this-agent", prompt: "test task")`
|
|
55
|
+
- Expected: output matches format X
|
|
56
|
+
- Edge case: empty input should return guidance, not error
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Frontmatter Quality Checklist
|
|
60
|
+
|
|
61
|
+
| Field | Required | Quality Check |
|
|
62
|
+
|-------|----------|---------------|
|
|
63
|
+
| `name` | Yes | Matches filename (kebab-case) |
|
|
64
|
+
| `description` | Yes | One line, specific (not generic "handles X") |
|
|
65
|
+
| `model` | Yes | Justified by task complexity |
|
|
66
|
+
| `tools` | Yes | Minimal set needed (no unnecessary tools) |
|
|
67
|
+
| `skills` | No | Referenced skills must exist |
|
|
68
|
+
| `domain` | No | Matches actual specialization |
|
|
69
|
+
| `limitations` | No | Honest about what agent cannot do |
|
|
70
|
+
|
|
71
|
+
## Anti-Patterns
|
|
72
|
+
|
|
73
|
+
| Anti-Pattern | Problem | Fix |
|
|
74
|
+
|-------------|---------|-----|
|
|
75
|
+
| Kitchen-sink tools | `tools: [Read, Write, Edit, Bash, Agent, ...]` | Minimal tool set for the role |
|
|
76
|
+
| Vague description | "Handles various tasks" | Specific: "Reviews Go code for idiomatic patterns" |
|
|
77
|
+
| Copy-paste body | Duplicates guide content | Reference guide, don't copy |
|
|
78
|
+
| Missing limitations | Sets unrealistic expectations | Declare what agent cannot do |
|
|
79
|
+
| Orphaned skill refs | References non-existent skills | mgr-supplier audit catches this |
|
|
80
|
+
| Excessive instructions | 500+ line body with detailed how-to | Move details to skills, keep agent body focused |
|
|
81
|
+
|
|
82
|
+
## Verification Workflow
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
mgr-creator generates agent
|
|
86
|
+
→ mgr-sauron verifies (R017)
|
|
87
|
+
→ Frontmatter valid?
|
|
88
|
+
→ Skills exist?
|
|
89
|
+
→ Tools minimal?
|
|
90
|
+
→ Description specific?
|
|
91
|
+
→ Human reviews (optional but recommended for complex agents)
|
|
92
|
+
→ Agent deployed
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Quality Metrics
|
|
96
|
+
|
|
97
|
+
| Metric | Target |
|
|
98
|
+
|--------|--------|
|
|
99
|
+
| Body length | 50-200 lines (excluding frontmatter) |
|
|
100
|
+
| Tool count | 3-8 (role-appropriate) |
|
|
101
|
+
| Skill references | All resolvable |
|
|
102
|
+
| Description length | 10-80 characters |
|
|
103
|
+
| Limitations declared | At least 1 for complex agents |
|
|
104
|
+
|
|
105
|
+
## Related
|
|
106
|
+
|
|
107
|
+
- R006 — Agent design rules (frontmatter format, separation of concerns)
|
|
108
|
+
- R017 — Sync verification (mgr-sauron validation)
|
|
109
|
+
- `mgr-creator` — Agent creation workflow
|
|
110
|
+
- `mgr-supplier` — Dependency audit
|
|
@@ -244,3 +244,22 @@ guides:
|
|
|
244
244
|
path: ./web-scraping/
|
|
245
245
|
source:
|
|
246
246
|
type: internal
|
|
247
|
+
|
|
248
|
+
# Agent Operations
|
|
249
|
+
- name: worktree-lifecycle
|
|
250
|
+
description: Worktree lifecycle automation aliases (agent-spin/merge/clean) for AI agent workflows
|
|
251
|
+
path: ./worktree-lifecycle/
|
|
252
|
+
source:
|
|
253
|
+
type: internal
|
|
254
|
+
|
|
255
|
+
- name: multi-model-routing
|
|
256
|
+
description: Role-based model selection strategy for AI agent workflows
|
|
257
|
+
path: ./multi-model-routing/
|
|
258
|
+
source:
|
|
259
|
+
type: internal
|
|
260
|
+
|
|
261
|
+
- name: agents-md-quality
|
|
262
|
+
description: Agent definition quality standards adapted from ETH Zurich research
|
|
263
|
+
path: ./agents-md-quality/
|
|
264
|
+
source:
|
|
265
|
+
type: internal
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Multi-Model Routing
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Role-based model selection strategy for AI agent workflows. Consolidates model routing conventions from R006 (agent design), R008 (tool identification), and agent frontmatter into a single reference.
|
|
6
|
+
|
|
7
|
+
## Model Aliases
|
|
8
|
+
|
|
9
|
+
| Alias | Full ID | Cost | Speed | Use Case |
|
|
10
|
+
|-------|---------|------|-------|----------|
|
|
11
|
+
| `haiku` | claude-haiku-4-5 | $ | Fast | Search, simple edits, file discovery |
|
|
12
|
+
| `sonnet` | claude-sonnet-4-6 | $$ | Moderate | Code generation, general tasks (default) |
|
|
13
|
+
| `opus` | claude-opus-4-6 | $$$ | Slower | Complex reasoning, architecture, planning |
|
|
14
|
+
| `opusplan` | claude-opus-4-6 + plan mode | $$$ | Slower | Architecture with approval gates |
|
|
15
|
+
|
|
16
|
+
Extended context: `[1m]` suffix enables 1M token context (e.g., `claude-opus-4-6[1m]`).
|
|
17
|
+
|
|
18
|
+
## Role-Based Routing Table
|
|
19
|
+
|
|
20
|
+
| Role | Recommended Model | Rationale |
|
|
21
|
+
|------|------------------|-----------|
|
|
22
|
+
| Code search / file discovery | haiku | Fast, cheap, sufficient for retrieval |
|
|
23
|
+
| Code review | sonnet | Needs understanding, not deep reasoning |
|
|
24
|
+
| Code generation | sonnet | Good balance of quality and speed |
|
|
25
|
+
| Bug fix (simple) | sonnet | Pattern recognition sufficient |
|
|
26
|
+
| Bug fix (complex) | opus | Needs deep reasoning across modules |
|
|
27
|
+
| Architecture design | opus / opusplan | Requires holistic thinking |
|
|
28
|
+
| Test generation | sonnet | Template-driven, moderate complexity |
|
|
29
|
+
| Documentation | sonnet | Straightforward generation |
|
|
30
|
+
| Release verification | opus | Cross-cutting validation |
|
|
31
|
+
| Orchestration | opus | Routing decisions need broad context |
|
|
32
|
+
|
|
33
|
+
## Cost-Quality Tradeoff Matrix
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Quality ▲
|
|
37
|
+
│ ┌─────────┐
|
|
38
|
+
│ │ opus │ Complex reasoning
|
|
39
|
+
│ └────┬────┘
|
|
40
|
+
│ │
|
|
41
|
+
│ ┌────┴────┐
|
|
42
|
+
│ │ sonnet │ General purpose (default)
|
|
43
|
+
│ └────┬────┘
|
|
44
|
+
│ │
|
|
45
|
+
│ ┌────┴────┐
|
|
46
|
+
│ │ haiku │ Retrieval, simple tasks
|
|
47
|
+
│ └─────────┘
|
|
48
|
+
└──────────────────────► Cost
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## MODEL_ROUTING.md Convention
|
|
52
|
+
|
|
53
|
+
Projects can declare a `MODEL_ROUTING.md` file to override default routing:
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
# Model Routing
|
|
57
|
+
|
|
58
|
+
| Agent Pattern | Model | Override Reason |
|
|
59
|
+
|---------------|-------|-----------------|
|
|
60
|
+
| lang-*-expert | sonnet | Default sufficient for code generation |
|
|
61
|
+
| mgr-sauron | opus | Verification requires deep analysis |
|
|
62
|
+
| Explore | haiku | Search-only, no generation needed |
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Place in project root or `.claude/` directory.
|
|
66
|
+
|
|
67
|
+
## Agent Frontmatter Integration
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
# .claude/agents/example.md
|
|
71
|
+
name: example-agent
|
|
72
|
+
model: sonnet # Use alias from table above
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The `model` field in agent frontmatter sets the default. The Agent tool's `model` parameter overrides at spawn time.
|
|
76
|
+
|
|
77
|
+
## Escalation Pattern
|
|
78
|
+
|
|
79
|
+
When a task fails at a lower model tier, escalate:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
haiku → sonnet → opus
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Configuration in agent frontmatter:
|
|
86
|
+
```yaml
|
|
87
|
+
escalation:
|
|
88
|
+
enabled: true
|
|
89
|
+
path: haiku → sonnet → opus
|
|
90
|
+
threshold: 2 # failures before escalation advisory
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Fast Mode Interaction
|
|
94
|
+
|
|
95
|
+
Fast Mode (`/fast` toggle) uses the same model with faster output (~2.5x). It does NOT change the model — it reduces reasoning depth while maintaining the configured model tier.
|
|
96
|
+
|
|
97
|
+
## Related
|
|
98
|
+
|
|
99
|
+
- R006 — Agent design rules (model aliases, frontmatter format)
|
|
100
|
+
- R008 — Tool identification (model in agent:model format)
|
|
101
|
+
- `guides/skill-bundle-design/` — Skill architecture patterns
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Worktree Lifecycle Automation
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Three shell aliases for managing git worktree lifecycle in AI agent workflows: **spin** (create), **merge** (integrate), **clean** (remove). Builds on basic worktree knowledge from `guides/git-worktree-workflow/`.
|
|
6
|
+
|
|
7
|
+
## Aliases
|
|
8
|
+
|
|
9
|
+
### agent-spin — Create worktree for agent work
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
agent-spin() {
|
|
13
|
+
local branch="$1"
|
|
14
|
+
local base="${2:-develop}"
|
|
15
|
+
local repo_name=$(basename "$(git rev-parse --show-toplevel)")
|
|
16
|
+
local worktree_dir="../${repo_name}-${branch}"
|
|
17
|
+
|
|
18
|
+
git fetch origin "$base"
|
|
19
|
+
git worktree add -b "$branch" "$worktree_dir" "origin/$base"
|
|
20
|
+
echo "Worktree ready: $worktree_dir (branch: $branch, base: $base)"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Usage**: `agent-spin feature/session-autofix develop`
|
|
25
|
+
|
|
26
|
+
### agent-merge — Integrate worktree branch
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
agent-merge() {
|
|
30
|
+
local branch="$1"
|
|
31
|
+
local target="${2:-develop}"
|
|
32
|
+
local repo_name=$(basename "$(git rev-parse --show-toplevel)")
|
|
33
|
+
local worktree_dir="../${repo_name}-${branch}"
|
|
34
|
+
|
|
35
|
+
# Switch to main worktree
|
|
36
|
+
cd "$(git worktree list | head -1 | awk '{print $1}')"
|
|
37
|
+
|
|
38
|
+
git checkout "$target"
|
|
39
|
+
git merge --no-ff "$branch" -m "Merge branch '$branch' into $target"
|
|
40
|
+
|
|
41
|
+
echo "Merged $branch into $target"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Usage**: `agent-merge feature/session-autofix develop`
|
|
46
|
+
|
|
47
|
+
### agent-clean — Remove worktree and branch
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
agent-clean() {
|
|
51
|
+
local branch="$1"
|
|
52
|
+
local repo_name=$(basename "$(git rev-parse --show-toplevel)")
|
|
53
|
+
local worktree_dir="../${repo_name}-${branch}"
|
|
54
|
+
|
|
55
|
+
git worktree remove "$worktree_dir" --force
|
|
56
|
+
git branch -d "$branch"
|
|
57
|
+
|
|
58
|
+
echo "Cleaned: worktree $worktree_dir, branch $branch"
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Usage**: `agent-clean feature/session-autofix`
|
|
63
|
+
|
|
64
|
+
## Setup
|
|
65
|
+
|
|
66
|
+
Add to `~/.zshrc` or `~/.bashrc`:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Agent worktree lifecycle
|
|
70
|
+
source ~/dotfiles/agent-worktree.sh # or inline the functions above
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Claude Code Integration
|
|
74
|
+
|
|
75
|
+
Claude Code's `EnterWorktree` / `ExitWorktree` tools provide built-in worktree support for subagents. The aliases above complement this for manual or hook-driven workflows.
|
|
76
|
+
|
|
77
|
+
| Method | Use Case |
|
|
78
|
+
|--------|----------|
|
|
79
|
+
| `EnterWorktree` tool | Agent-managed isolation (automatic) |
|
|
80
|
+
| `agent-spin` alias | Manual or hook-triggered worktree creation |
|
|
81
|
+
| Agent frontmatter `isolation: worktree` | Declarative per-agent isolation |
|
|
82
|
+
|
|
83
|
+
## Lifecycle Flow
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
agent-spin feature/x develop
|
|
87
|
+
└── Work in isolated worktree
|
|
88
|
+
└── Tests pass
|
|
89
|
+
└── agent-merge feature/x develop
|
|
90
|
+
└── agent-clean feature/x
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Best Practices
|
|
94
|
+
|
|
95
|
+
- Always base worktrees on `origin/develop` (not local) to avoid stale base
|
|
96
|
+
- Run tests in the worktree before merge
|
|
97
|
+
- Clean up worktrees promptly — orphaned worktrees accumulate disk usage
|
|
98
|
+
- For CI-driven flows, `agent-clean` should be in the finally/cleanup step
|
|
99
|
+
|
|
100
|
+
## Related
|
|
101
|
+
|
|
102
|
+
- `guides/git-worktree-workflow/` — Basic worktree commands and directory structure
|
|
103
|
+
- R006 `isolation: worktree` — Agent frontmatter isolation setting
|
|
104
|
+
- Claude Code `EnterWorktree` / `ExitWorktree` — Built-in tool support
|
package/templates/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.82.0",
|
|
3
3
|
"lastUpdated": "2026-04-12T00: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": 36
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"name": "hooks",
|