oh-my-customcode 0.80.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 +9 -9
- package/dist/cli/index.js +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
- package/templates/.claude/agents/wiki-curator.md +72 -0
- package/templates/.claude/hooks/hooks.json +10 -0
- package/templates/.claude/hooks/scripts/adaptive-harness-scan.sh +45 -0
- package/templates/.claude/rules/MUST-continuous-improvement.md +10 -0
- package/templates/.claude/rules/MUST-sync-verification.md +17 -5
- package/templates/.claude/rules/SHOULD-wiki-sync.md +67 -0
- package/templates/.claude/skills/adaptive-harness/SKILL.md +335 -0
- package/templates/.claude/skills/analysis/SKILL.md +19 -0
- package/templates/.claude/skills/wiki/SKILL.md +426 -0
- package/templates/.claude/skills/wiki-rag/SKILL.md +154 -0
- package/templates/.github/workflows/wiki-sync.yml +132 -0
- package/templates/CLAUDE.md +12 -7
- 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 +6 -6
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
name: Wiki Sync
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- develop
|
|
7
|
+
paths:
|
|
8
|
+
- '.claude/agents/**'
|
|
9
|
+
- '.claude/skills/**'
|
|
10
|
+
- '.claude/rules/**'
|
|
11
|
+
- 'guides/**'
|
|
12
|
+
- 'wiki/**'
|
|
13
|
+
pull_request:
|
|
14
|
+
branches:
|
|
15
|
+
- develop
|
|
16
|
+
paths:
|
|
17
|
+
- '.claude/agents/**'
|
|
18
|
+
- '.claude/skills/**'
|
|
19
|
+
- '.claude/rules/**'
|
|
20
|
+
- 'guides/**'
|
|
21
|
+
- 'wiki/**'
|
|
22
|
+
|
|
23
|
+
concurrency:
|
|
24
|
+
group: wiki-sync-${{ github.ref }}
|
|
25
|
+
cancel-in-progress: true
|
|
26
|
+
|
|
27
|
+
permissions:
|
|
28
|
+
contents: read
|
|
29
|
+
|
|
30
|
+
jobs:
|
|
31
|
+
wiki-staleness-check:
|
|
32
|
+
name: Wiki Staleness Check
|
|
33
|
+
runs-on: macos-latest
|
|
34
|
+
steps:
|
|
35
|
+
- name: Checkout
|
|
36
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
37
|
+
|
|
38
|
+
- name: Check wiki directory exists
|
|
39
|
+
run: |
|
|
40
|
+
if [ ! -d "wiki" ]; then
|
|
41
|
+
echo "::error::wiki/ directory does not exist"
|
|
42
|
+
echo ""
|
|
43
|
+
echo "The wiki/ directory is required for this project."
|
|
44
|
+
echo "Fix: run '/omcustom:wiki' to generate the initial wiki"
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
- name: Check for missing wiki pages
|
|
49
|
+
run: |
|
|
50
|
+
#!/bin/bash
|
|
51
|
+
ERRORS=0
|
|
52
|
+
STALE=0
|
|
53
|
+
MISSING=0
|
|
54
|
+
|
|
55
|
+
# Check agents
|
|
56
|
+
for src in .claude/agents/*.md; do
|
|
57
|
+
name=$(basename "$src" .md)
|
|
58
|
+
wiki_page="wiki/agents/${name}.md"
|
|
59
|
+
if [ ! -f "$wiki_page" ]; then
|
|
60
|
+
echo "::error::Missing wiki page: $wiki_page (source: $src)"
|
|
61
|
+
MISSING=$((MISSING + 1))
|
|
62
|
+
ERRORS=$((ERRORS + 1))
|
|
63
|
+
fi
|
|
64
|
+
done
|
|
65
|
+
|
|
66
|
+
# Check skills
|
|
67
|
+
for src in $(find .claude/skills -name "SKILL.md"); do
|
|
68
|
+
name=$(basename $(dirname "$src"))
|
|
69
|
+
wiki_page="wiki/skills/${name}.md"
|
|
70
|
+
if [ ! -f "$wiki_page" ]; then
|
|
71
|
+
echo "::error::Missing wiki page: $wiki_page (source: $src)"
|
|
72
|
+
MISSING=$((MISSING + 1))
|
|
73
|
+
ERRORS=$((ERRORS + 1))
|
|
74
|
+
fi
|
|
75
|
+
done
|
|
76
|
+
|
|
77
|
+
# Check rules
|
|
78
|
+
for src in .claude/rules/*.md; do
|
|
79
|
+
# Extract rule ID (R000, R007, etc.) from content
|
|
80
|
+
rule_id=$(grep -oE 'ID\*\*: R[0-9]+' "$src" | grep -oE '[0-9]+' | head -1)
|
|
81
|
+
if [ -n "$rule_id" ]; then
|
|
82
|
+
wiki_page="wiki/rules/r$(printf '%03d' "$((10#$rule_id))").md"
|
|
83
|
+
if [ ! -f "$wiki_page" ]; then
|
|
84
|
+
echo "::error::Missing wiki page: $wiki_page (source: $src)"
|
|
85
|
+
MISSING=$((MISSING + 1))
|
|
86
|
+
ERRORS=$((ERRORS + 1))
|
|
87
|
+
fi
|
|
88
|
+
fi
|
|
89
|
+
done
|
|
90
|
+
|
|
91
|
+
# Check guides
|
|
92
|
+
for src in $(find guides -mindepth 1 -maxdepth 1 -type d); do
|
|
93
|
+
name=$(basename "$src")
|
|
94
|
+
wiki_page="wiki/guides/${name}.md"
|
|
95
|
+
if [ ! -f "$wiki_page" ]; then
|
|
96
|
+
echo "::error::Missing wiki page: $wiki_page (source: $src)"
|
|
97
|
+
MISSING=$((MISSING + 1))
|
|
98
|
+
ERRORS=$((ERRORS + 1))
|
|
99
|
+
fi
|
|
100
|
+
done
|
|
101
|
+
|
|
102
|
+
# Check index.md exists
|
|
103
|
+
if [ ! -f "wiki/index.yaml" ]; then
|
|
104
|
+
echo "::error::Missing wiki/index.yaml"
|
|
105
|
+
ERRORS=$((ERRORS + 1))
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
# Summary
|
|
109
|
+
TOTAL_WIKI=$(find wiki -name "*.md" ! -name "index.md" ! -name "log.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
110
|
+
echo "Wiki pages: $TOTAL_WIKI"
|
|
111
|
+
echo "Missing pages: $MISSING"
|
|
112
|
+
|
|
113
|
+
if [ "$ERRORS" -gt 0 ]; then
|
|
114
|
+
echo ""
|
|
115
|
+
echo "Fix: run '/omcustom:wiki' to regenerate wiki pages"
|
|
116
|
+
exit 1
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
echo "Wiki sync check passed"
|
|
120
|
+
|
|
121
|
+
- name: Report results
|
|
122
|
+
if: success()
|
|
123
|
+
run: |
|
|
124
|
+
TOTAL_AGENTS=$(ls .claude/agents/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
125
|
+
TOTAL_SKILLS=$(find .claude/skills -name "SKILL.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
126
|
+
TOTAL_RULES=$(ls .claude/rules/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
127
|
+
TOTAL_GUIDES=$(find guides -mindepth 1 -maxdepth 1 -type d 2>/dev/null | wc -l | tr -d ' ')
|
|
128
|
+
TOTAL_WIKI=$(find wiki -name "*.md" ! -name "index.md" ! -name "log.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
129
|
+
|
|
130
|
+
echo "Source entities: agents=$TOTAL_AGENTS skills=$TOTAL_SKILLS rules=$TOTAL_RULES guides=$TOTAL_GUIDES"
|
|
131
|
+
echo "Wiki pages: $TOTAL_WIKI"
|
|
132
|
+
echo "All wiki pages present — sync OK"
|
package/templates/CLAUDE.md
CHANGED
|
@@ -84,6 +84,7 @@ oh-my-customcode로 구동됩니다.
|
|
|
84
84
|
| R012 | HUD 상태줄 | 실시간 상태 표시 |
|
|
85
85
|
| R013 | Ecomode | 배치 작업 토큰 효율성 |
|
|
86
86
|
| R019 | Ontology-RAG 라우팅 | 라우팅 스킬의 ontology-RAG enrichment |
|
|
87
|
+
| R022 | Wiki 동기화 | 에이전트/스킬/룰/가이드 변경 시 위키 자동 동기화 |
|
|
87
88
|
|
|
88
89
|
### MAY (선택)
|
|
89
90
|
| ID | 규칙 | 설명 |
|
|
@@ -104,7 +105,10 @@ oh-my-customcode로 구동됩니다.
|
|
|
104
105
|
| `/omcustom:fix-refs` | 깨진 참조 수정 |
|
|
105
106
|
| `/omcustom:harness-eval` | 15 SE task 구조적 벤치마크 평가 |
|
|
106
107
|
| `/omcustom:auto-improve` | 개선 사항 자동 적용 워크플로우 |
|
|
108
|
+
| `/omcustom:adaptive-harness` | 프로젝트 컨텍스트 기반 하네스 자동 최적화 |
|
|
107
109
|
| `/omcustom:claude-native` | Claude Code 릴리즈 모니터링 및 이슈 자동 생성 |
|
|
110
|
+
| `/omcustom:wiki` | 코드베이스 위키 생성/유지 (Karpathy LLM Wiki 패턴) |
|
|
111
|
+
| `/omcustom:wiki-rag` | 위키 기반 코드베이스 질의응답 (RAG) |
|
|
108
112
|
| `/omcustom:improve-report` | eval-core 기반 개선 현황 리포트 |
|
|
109
113
|
| `/omcustom-takeover` | 기존 에이전트/스킬에서 canonical spec 추출 |
|
|
110
114
|
| `/adversarial-review` | 공격자 관점 보안 코드 리뷰 |
|
|
@@ -128,6 +132,7 @@ oh-my-customcode로 구동됩니다.
|
|
|
128
132
|
| `/optimize-report` | 최적화 리포트 생성 |
|
|
129
133
|
| `/research` | 10-team 병렬 딥 분석 및 교차 검증 |
|
|
130
134
|
| `/scout` | 외부 URL 분석 및 프로젝트 적합성 평가 |
|
|
135
|
+
| `/skill-extractor` | 세션 성공 패턴에서 스킬 후보 추출 |
|
|
131
136
|
| `/deep-plan` | 연구 검증 기반 계획 수립 (research → plan → verify) |
|
|
132
137
|
| `/deep-verify` | 다중 관점 릴리즈 품질 검증 |
|
|
133
138
|
| `/professor-triage` | 이슈 교차 분석 트리아지 (omc_issue_analyzer 댓글 기반) |
|
|
@@ -151,12 +156,12 @@ oh-my-customcode로 구동됩니다.
|
|
|
151
156
|
project/
|
|
152
157
|
+-- CLAUDE.md # 진입점
|
|
153
158
|
+-- .claude/
|
|
154
|
-
| +-- agents/ # 서브에이전트 정의 (
|
|
155
|
-
| +-- skills/ # 스킬 (
|
|
156
|
-
| +-- rules/ # 전역 규칙 (R000-
|
|
159
|
+
| +-- agents/ # 서브에이전트 정의 (48 파일)
|
|
160
|
+
| +-- skills/ # 스킬 (104 디렉토리)
|
|
161
|
+
| +-- rules/ # 전역 규칙 (R000-R022)
|
|
157
162
|
| +-- hooks/ # 훅 스크립트 (보안, 검증, HUD)
|
|
158
163
|
| +-- contexts/ # 컨텍스트 파일 (ecomode)
|
|
159
|
-
+-- guides/ # 레퍼런스 문서 (
|
|
164
|
+
+-- guides/ # 레퍼런스 문서 (36 토픽)
|
|
160
165
|
```
|
|
161
166
|
|
|
162
167
|
## 오케스트레이션
|
|
@@ -210,8 +215,8 @@ oh-my-customcode는 소프트웨어 컴파일과 동일한 구조를 따릅니
|
|
|
210
215
|
| Infra Engineer | 2 | infra-docker-expert, infra-aws-expert |
|
|
211
216
|
| QA Team | 3 | qa-planner, qa-writer, qa-engineer |
|
|
212
217
|
| Manager | 6 | mgr-creator, mgr-updater, mgr-supplier, mgr-gitnerd, mgr-sauron, mgr-claude-code-bible |
|
|
213
|
-
| System |
|
|
214
|
-
| **총계** | **
|
|
218
|
+
| System | 3 | sys-memory-keeper, sys-naggy, wiki-curator |
|
|
219
|
+
| **총계** | **48** | |
|
|
215
220
|
|
|
216
221
|
## Agent Teams (MUST when enabled)
|
|
217
222
|
|
|
@@ -292,4 +297,4 @@ claude-mem setup
|
|
|
292
297
|
|
|
293
298
|
<!-- omcustom:git-workflow -->
|
|
294
299
|
|
|
295
|
-
<!-- omcustom:end -->
|
|
300
|
+
<!-- omcustom:end -->
|
|
@@ -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,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"lastUpdated": "2026-
|
|
2
|
+
"version": "0.82.0",
|
|
3
|
+
"lastUpdated": "2026-04-12T00:00:00.000Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "rules",
|
|
7
7
|
"path": ".claude/rules",
|
|
8
8
|
"description": "Agent behavior rules and guidelines",
|
|
9
|
-
"files":
|
|
9
|
+
"files": 22
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"name": "agents",
|
|
13
13
|
"path": ".claude/agents",
|
|
14
14
|
"description": "AI agent definitions (flat .md files with prefixes)",
|
|
15
|
-
"files":
|
|
15
|
+
"files": 48
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"name": "skills",
|
|
19
19
|
"path": ".claude/skills",
|
|
20
20
|
"description": "Reusable skill modules (includes slash commands)",
|
|
21
|
-
"files":
|
|
21
|
+
"files": 104
|
|
22
22
|
},
|
|
23
23
|
{
|
|
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",
|