oh-my-customcode 0.16.4 → 0.17.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 +6 -7
- package/dist/cli/index.js +54 -0
- package/dist/index.js +54 -0
- package/package.json +1 -1
- package/templates/.claude/agents/mgr-sauron.md +16 -19
- package/templates/.claude/agents/mgr-updater.md +1 -0
- package/templates/.claude/agents/sys-memory-keeper.md +16 -1
- package/templates/.claude/hooks/hooks.json +5 -1
- package/templates/.claude/ontology/agents.yaml +1 -13
- package/templates/.claude/ontology/graphs/agent-skill.json +1 -2
- package/templates/.claude/ontology/graphs/full-graph.json +2 -9
- package/templates/.claude/ontology/graphs/routing.json +0 -2
- package/templates/.claude/ontology/skills.yaml +1 -1
- package/templates/.claude/rules/MUST-orchestrator-coordination.md +42 -0
- package/templates/.claude/rules/MUST-sync-verification.md +2 -2
- package/templates/.claude/rules/SHOULD-hud-statusline.md +55 -11
- package/templates/.claude/rules/SHOULD-memory-integration.md +32 -0
- package/templates/.claude/skills/claude-code-bible/SKILL.md +5 -94
- package/templates/.claude/skills/intent-detection/patterns/agent-triggers.yaml +0 -8
- package/templates/.claude/skills/sauron-watch/SKILL.md +61 -49
- package/templates/.claude/skills/secretary-routing/SKILL.md +3 -6
- package/templates/.claude/statusline.sh +263 -0
- package/templates/CLAUDE.md.en +4 -4
- package/templates/CLAUDE.md.ko +4 -4
- package/templates/guides/claude-code/08-testing.md +0 -2
- package/templates/guides/claude-code/09-guardrails.md +0 -2
- package/templates/guides/claude-code/10-monitoring.md +0 -2
- package/templates/manifest.json +2 -2
- package/templates/.claude/agents/mgr-sync-checker.md +0 -38
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: claude-code-bible
|
|
3
|
-
description: Fetch
|
|
3
|
+
description: Fetch Claude Code official documentation. Use when updating local reference docs or checking official spec.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ Official documentation reference management for Claude Code.
|
|
|
10
10
|
|
|
11
11
|
## Purpose
|
|
12
12
|
|
|
13
|
-
Maintain up-to-date local copies of Claude Code official documentation
|
|
13
|
+
Maintain up-to-date local copies of Claude Code official documentation.
|
|
14
14
|
|
|
15
15
|
## Commands
|
|
16
16
|
|
|
@@ -50,56 +50,6 @@ node .claude/skills/claude-code-bible/scripts/fetch-docs.js --output /path/to/ou
|
|
|
50
50
|
- `0`: Success (or cache is fresh)
|
|
51
51
|
- `1`: Fatal error
|
|
52
52
|
|
|
53
|
-
### /claude-code-bible verify
|
|
54
|
-
|
|
55
|
-
Verify agents and skills against official Claude Code specifications.
|
|
56
|
-
|
|
57
|
-
**What it checks:**
|
|
58
|
-
- Agent structure compliance (frontmatter fields, file format)
|
|
59
|
-
- Skill structure compliance (SKILL.md format, disable-model-invocation usage)
|
|
60
|
-
- Tool usage patterns match official recommendations
|
|
61
|
-
- Workflow patterns align with Claude Code best practices
|
|
62
|
-
- Agent/skill naming conventions follow official guidelines
|
|
63
|
-
|
|
64
|
-
**Usage:**
|
|
65
|
-
```bash
|
|
66
|
-
# Verify all agents and skills
|
|
67
|
-
/claude-code-bible verify
|
|
68
|
-
|
|
69
|
-
# Verify specific agent
|
|
70
|
-
/claude-code-bible verify --agent mgr-creator
|
|
71
|
-
|
|
72
|
-
# Verify specific skill
|
|
73
|
-
/claude-code-bible verify --skill go-best-practices
|
|
74
|
-
|
|
75
|
-
# Verbose output
|
|
76
|
-
/claude-code-bible verify --verbose
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
**Verification rules:**
|
|
80
|
-
1. **Agent frontmatter** must include:
|
|
81
|
-
- `name`: kebab-case identifier
|
|
82
|
-
- `description`: one-line summary
|
|
83
|
-
- `model`: sonnet | opus | haiku
|
|
84
|
-
- `tools`: array of allowed tools
|
|
85
|
-
- `skills`: array of skill names
|
|
86
|
-
|
|
87
|
-
2. **Skill frontmatter** must include:
|
|
88
|
-
- `name`: kebab-case identifier
|
|
89
|
-
- `description`: when/why to use this skill
|
|
90
|
-
- `disable-model-invocation`: true (if skill is procedural/scripted)
|
|
91
|
-
|
|
92
|
-
3. **Agent files** should NOT contain:
|
|
93
|
-
- Detailed skill instructions (belongs in .claude/skills/)
|
|
94
|
-
- Reference documentation (belongs in guides/)
|
|
95
|
-
- Implementation scripts (belongs in .claude/skills/{name}/scripts/)
|
|
96
|
-
|
|
97
|
-
4. **Skill files** should contain:
|
|
98
|
-
- Clear purpose statement
|
|
99
|
-
- Usage examples
|
|
100
|
-
- Input/output specifications
|
|
101
|
-
- Integration points with agents
|
|
102
|
-
|
|
103
53
|
## Implementation Notes
|
|
104
54
|
|
|
105
55
|
### Fetch Script (fetch-docs.js)
|
|
@@ -121,60 +71,21 @@ Verify agents and skills against official Claude Code specifications.
|
|
|
121
71
|
- Continues on individual page failures
|
|
122
72
|
- Prints summary of successes and failures
|
|
123
73
|
|
|
124
|
-
### Verify Command (future implementation)
|
|
125
|
-
|
|
126
|
-
The verify command should:
|
|
127
|
-
1. Read official specs from `~/.claude/references/claude-code/`
|
|
128
|
-
2. Parse all agents in `.claude/agents/*.md`
|
|
129
|
-
3. Parse all skills in `.claude/skills/*/SKILL.md`
|
|
130
|
-
4. Check each against official requirements
|
|
131
|
-
5. Report violations with suggestions for fixes
|
|
132
|
-
|
|
133
74
|
## Integration with Other Skills
|
|
134
75
|
|
|
135
|
-
### create-agent
|
|
136
|
-
- Should verify new agents against official spec
|
|
137
|
-
- Use `/claude-code-bible verify --agent <name>` after creation
|
|
138
|
-
|
|
139
76
|
### update-docs
|
|
140
77
|
- Should update local docs first: `/claude-code-bible update`
|
|
141
|
-
- Then verify sync with: `/claude-code-bible verify`
|
|
142
78
|
|
|
143
79
|
### dev-review
|
|
144
80
|
- Can reference official docs for best practices
|
|
145
|
-
- Verify code patterns against Claude Code recommendations
|
|
146
81
|
|
|
147
82
|
## Benefits
|
|
148
83
|
|
|
149
|
-
1. **
|
|
150
|
-
2. **
|
|
151
|
-
3. **
|
|
152
|
-
4. **Automation**: Verify compliance automatically before commits
|
|
153
|
-
5. **Learning**: Reference official patterns when creating new components
|
|
154
|
-
|
|
155
|
-
## Example Workflow
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
# 1. Update local docs
|
|
159
|
-
node .claude/skills/claude-code-bible/scripts/fetch-docs.js
|
|
160
|
-
|
|
161
|
-
# 2. Create a new agent
|
|
162
|
-
/create-agent my-new-agent
|
|
163
|
-
|
|
164
|
-
# 3. Verify it matches official spec
|
|
165
|
-
/claude-code-bible verify --agent my-new-agent
|
|
166
|
-
|
|
167
|
-
# 4. Fix any violations
|
|
168
|
-
|
|
169
|
-
# 5. Verify again
|
|
170
|
-
/claude-code-bible verify --agent my-new-agent
|
|
171
|
-
|
|
172
|
-
# 6. Commit when all checks pass
|
|
173
|
-
```
|
|
84
|
+
1. **Up-to-date**: Always have latest documentation locally
|
|
85
|
+
2. **Offline access**: Work with docs even without internet
|
|
86
|
+
3. **Learning**: Reference official patterns when creating new components
|
|
174
87
|
|
|
175
88
|
## Notes
|
|
176
89
|
|
|
177
|
-
- The verify command implementation is left for future work
|
|
178
90
|
- The fetch script is production-ready and can be used immediately
|
|
179
91
|
- Consider running `/claude-code-bible update` weekly to stay current
|
|
180
|
-
- Add this as a pre-commit hook to enforce compliance automatically
|
|
@@ -297,14 +297,6 @@ agents:
|
|
|
297
297
|
supported_actions: [commit, branch, pr, sync, status, push, pull, merge]
|
|
298
298
|
base_confidence: 40
|
|
299
299
|
|
|
300
|
-
mgr-sync-checker:
|
|
301
|
-
keywords:
|
|
302
|
-
korean: [동기화, 싱크, 검증]
|
|
303
|
-
english: [sync, synchronization, check, verify]
|
|
304
|
-
file_patterns: ["index.yaml", "CLAUDE.md", "COMMANDS.md"]
|
|
305
|
-
supported_actions: [check, agents, commands, docs, fix]
|
|
306
|
-
base_confidence: 40
|
|
307
|
-
|
|
308
300
|
mgr-sauron:
|
|
309
301
|
keywords:
|
|
310
302
|
korean: [검증, 전체검증, 무결성, 사우론]
|
|
@@ -1,75 +1,89 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sauron-watch
|
|
3
|
-
description: Full
|
|
3
|
+
description: Full R017 verification (5+3 rounds) before commit
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Sauron Watch Skill
|
|
8
8
|
|
|
9
|
-
Execute full
|
|
9
|
+
Execute full R017 verification process with 5 rounds of manager agent verification and 3 rounds of deep review.
|
|
10
10
|
|
|
11
11
|
## Purpose
|
|
12
12
|
|
|
13
|
-
Ensure complete synchronization of agents,
|
|
13
|
+
Ensure complete synchronization of agents, skills, documentation, and project structure before committing changes.
|
|
14
14
|
|
|
15
15
|
## Workflow
|
|
16
16
|
|
|
17
17
|
### Phase 1: Manager Agent Verification (5 rounds)
|
|
18
18
|
|
|
19
|
-
#### Round 1-2: Basic
|
|
19
|
+
#### Round 1-2: Basic Checks
|
|
20
20
|
```
|
|
21
|
-
□
|
|
22
|
-
□
|
|
21
|
+
□ mgr-supplier:audit - Check all agent dependencies and skill refs
|
|
22
|
+
□ mgr-updater:docs - Verify documentation sync
|
|
23
23
|
□ Fix any issues found
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
#### Round 3-4:
|
|
26
|
+
#### Round 3-4: Re-verify + Update
|
|
27
27
|
```
|
|
28
|
-
□
|
|
29
|
-
□
|
|
30
|
-
□ /update-docs - Check documentation sync
|
|
28
|
+
□ mgr-supplier:audit - Re-verify after fixes
|
|
29
|
+
□ mgr-updater:docs - Re-run and apply any detected changes
|
|
31
30
|
□ Fix any remaining issues
|
|
32
31
|
```
|
|
33
32
|
|
|
34
|
-
#### Round 5: Final Verification
|
|
33
|
+
#### Round 5: Final Count Verification
|
|
35
34
|
```
|
|
36
|
-
□
|
|
37
|
-
□
|
|
38
|
-
□
|
|
39
|
-
□
|
|
35
|
+
□ Agent count matches: CLAUDE.md vs actual .md files
|
|
36
|
+
□ Skill count matches: CLAUDE.md vs actual SKILL.md files
|
|
37
|
+
□ Memory field distribution correct
|
|
38
|
+
□ Hook/context/guide/rule counts match
|
|
39
|
+
□ All frontmatter valid
|
|
40
|
+
□ All skill refs exist
|
|
41
|
+
□ All memory scopes valid (project|user|local)
|
|
42
|
+
□ Routing patterns updated
|
|
40
43
|
```
|
|
41
44
|
|
|
42
45
|
### Phase 2: Deep Review (3 rounds)
|
|
43
46
|
|
|
44
47
|
#### Deep Round 1: Workflow Alignment
|
|
45
48
|
```
|
|
46
|
-
□ Agent
|
|
47
|
-
□
|
|
48
|
-
□
|
|
49
|
-
□ All
|
|
49
|
+
□ Agent workflows match purpose
|
|
50
|
+
□ Command definitions match implementations
|
|
51
|
+
□ Routing skill patterns are valid
|
|
52
|
+
□ All routing skills have complete agent mappings
|
|
50
53
|
```
|
|
51
54
|
|
|
52
55
|
#### Deep Round 2: Reference Verification
|
|
53
56
|
```
|
|
54
|
-
□ All
|
|
55
|
-
□ All
|
|
56
|
-
□
|
|
57
|
+
□ All skill references exist
|
|
58
|
+
□ All agent frontmatter valid
|
|
59
|
+
□ memory field values valid (user | project | local)
|
|
60
|
+
□ No orphaned agents
|
|
57
61
|
□ No circular references
|
|
58
62
|
```
|
|
59
63
|
|
|
60
64
|
#### Deep Round 3: Philosophy Compliance
|
|
61
65
|
```
|
|
62
|
-
□ R006:
|
|
63
|
-
□
|
|
64
|
-
□
|
|
65
|
-
□
|
|
66
|
+
□ R006: Agent design rules (including memory field spec)
|
|
67
|
+
□ R007: Agent identification rules
|
|
68
|
+
□ R008: Tool identification rules
|
|
69
|
+
□ R009: Parallel execution rules
|
|
70
|
+
□ R010: Orchestrator coordination rules
|
|
71
|
+
□ R011: Memory integration (native-first architecture)
|
|
66
72
|
□ All MUST rules enforced, SHOULD rules recommended
|
|
67
73
|
```
|
|
68
74
|
|
|
75
|
+
### Phase 2.5: Documentation Accuracy
|
|
76
|
+
```
|
|
77
|
+
□ Every agent name in CLAUDE.md matches actual filename
|
|
78
|
+
□ All counts cross-verified against filesystem
|
|
79
|
+
□ Every slash command has corresponding skill
|
|
80
|
+
□ Every agent reachable through routing skills
|
|
81
|
+
```
|
|
82
|
+
|
|
69
83
|
### Phase 3: Fix Issues
|
|
70
84
|
```
|
|
71
|
-
□
|
|
72
|
-
□
|
|
85
|
+
□ Auto-fix: count mismatches, missing fields, outdated refs
|
|
86
|
+
□ Report: missing files, invalid scopes, philosophy violations
|
|
73
87
|
□ Re-run verification if major fixes made
|
|
74
88
|
```
|
|
75
89
|
|
|
@@ -84,43 +98,41 @@ Ensure complete synchronization of agents, commands, documentation, and project
|
|
|
84
98
|
```
|
|
85
99
|
[mgr-sauron:watch]
|
|
86
100
|
|
|
87
|
-
Starting full
|
|
101
|
+
Starting full R017 verification...
|
|
88
102
|
|
|
89
103
|
═══════════════════════════════════════════════════════════
|
|
90
104
|
PHASE 1: Manager Agent Verification (5 rounds)
|
|
91
105
|
═══════════════════════════════════════════════════════════
|
|
92
106
|
|
|
93
|
-
[Round 1/5]
|
|
94
|
-
✓
|
|
107
|
+
[Round 1/5] mgr-supplier:audit
|
|
108
|
+
✓ 41 agents checked, 0 issues
|
|
95
109
|
|
|
96
|
-
[Round 2/5]
|
|
97
|
-
✓
|
|
110
|
+
[Round 2/5] mgr-updater:docs
|
|
111
|
+
✓ Documentation sync: OK
|
|
98
112
|
|
|
99
|
-
[Round 3/5]
|
|
100
|
-
✓
|
|
113
|
+
[Round 3/5] Re-verify: mgr-supplier:audit
|
|
114
|
+
✓ All dependencies valid
|
|
101
115
|
|
|
102
|
-
[Round 4/5]
|
|
103
|
-
✓
|
|
104
|
-
✓ Documentation synchronized
|
|
116
|
+
[Round 4/5] Re-verify: mgr-updater:docs
|
|
117
|
+
✓ No changes needed
|
|
105
118
|
|
|
106
|
-
[Round 5/5] Final verification
|
|
107
|
-
✓
|
|
108
|
-
✓
|
|
109
|
-
✓
|
|
110
|
-
✓
|
|
119
|
+
[Round 5/5] Final count verification
|
|
120
|
+
✓ Agents: 41/41 match
|
|
121
|
+
✓ Skills: 55/55 match
|
|
122
|
+
✓ All frontmatter valid
|
|
123
|
+
✓ All skill refs valid
|
|
124
|
+
✓ All memory scopes valid
|
|
111
125
|
|
|
112
126
|
═══════════════════════════════════════════════════════════
|
|
113
127
|
PHASE 2: Deep Review (3 rounds)
|
|
114
128
|
═══════════════════════════════════════════════════════════
|
|
115
129
|
|
|
116
130
|
[Round 1/3] Workflow alignment
|
|
117
|
-
✓
|
|
118
|
-
✓
|
|
119
|
-
✓ Orchestrators have complete manages sections
|
|
131
|
+
✓ All routing skills have complete agent mappings
|
|
132
|
+
✓ Command definitions match implementations
|
|
120
133
|
|
|
121
134
|
[Round 2/3] Reference verification
|
|
122
|
-
✓ All
|
|
123
|
-
✓ All rules referenced
|
|
135
|
+
✓ All skill references valid
|
|
124
136
|
✓ No orphaned agents
|
|
125
137
|
|
|
126
138
|
[Round 3/3] Philosophy compliance
|
|
@@ -140,5 +152,5 @@ Ready to commit. 커밋할까요?
|
|
|
140
152
|
|
|
141
153
|
## Related
|
|
142
154
|
|
|
143
|
-
-
|
|
155
|
+
- R017: Sync Verification Rules
|
|
144
156
|
- mgr-gitnerd: Git operations agent
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: secretary-routing
|
|
3
|
-
description: Routes agent management tasks to the correct manager agent. Use when user requests agent creation, updates, audits, git operations,
|
|
3
|
+
description: Routes agent management tasks to the correct manager agent. Use when user requests agent creation, updates, audits, git operations, or verification.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
10
10
|
|
|
11
|
-
Routes agent management tasks to the appropriate manager agent. This skill contains the coordination logic for orchestrating manager agents (mgr-creator, mgr-updater, mgr-supplier, mgr-gitnerd, mgr-
|
|
11
|
+
Routes agent management tasks to the appropriate manager agent. This skill contains the coordination logic for orchestrating manager agents (mgr-creator, mgr-updater, mgr-supplier, mgr-gitnerd, mgr-sauron).
|
|
12
12
|
|
|
13
13
|
## Manager Agents
|
|
14
14
|
|
|
@@ -18,8 +18,7 @@ Routes agent management tasks to the appropriate manager agent. This skill conta
|
|
|
18
18
|
| mgr-updater | Update external agents | "update agent", "sync" |
|
|
19
19
|
| mgr-supplier | Validate dependencies | "audit", "check deps" |
|
|
20
20
|
| mgr-gitnerd | Git operations | "commit", "push", "pr" |
|
|
21
|
-
| mgr-
|
|
22
|
-
| mgr-sauron | R016 auto-verification | "verify", "full check" |
|
|
21
|
+
| mgr-sauron | R017 auto-verification | "verify", "full check" |
|
|
23
22
|
| mgr-claude-code-bible | Claude Code spec compliance | "spec check", "verify compliance" |
|
|
24
23
|
| sys-memory-keeper | Memory operations | "save memory", "recall", "memory search" |
|
|
25
24
|
| sys-naggy | TODO management | "todo", "track tasks", "task list" |
|
|
@@ -33,7 +32,6 @@ create → mgr-creator
|
|
|
33
32
|
update → mgr-updater
|
|
34
33
|
audit → mgr-supplier
|
|
35
34
|
git → mgr-gitnerd
|
|
36
|
-
sync → mgr-sync-checker
|
|
37
35
|
verify → mgr-sauron
|
|
38
36
|
spec → mgr-claude-code-bible
|
|
39
37
|
memory → sys-memory-keeper
|
|
@@ -73,7 +71,6 @@ When command requires multiple independent operations:
|
|
|
73
71
|
| mgr-updater | sonnet | External sync, web fetch |
|
|
74
72
|
| mgr-supplier | haiku | File scan, validation |
|
|
75
73
|
| mgr-gitnerd | sonnet | Commit message quality |
|
|
76
|
-
| mgr-sync-checker | haiku | Fast verification |
|
|
77
74
|
| mgr-sauron | sonnet | Multi-round verification |
|
|
78
75
|
| mgr-claude-code-bible | sonnet | Spec compliance checks |
|
|
79
76
|
| sys-memory-keeper | sonnet | Memory operations, search |
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# statusline.sh — Claude Code statusline renderer
|
|
3
|
+
#
|
|
4
|
+
# Reads JSON from stdin (Claude Code statusline API, ~300ms intervals)
|
|
5
|
+
# and outputs a formatted status line, e.g.:
|
|
6
|
+
#
|
|
7
|
+
# $0.05 | my-project | develop | PR #160 | CTX:42%
|
|
8
|
+
#
|
|
9
|
+
# JSON input structure:
|
|
10
|
+
# {
|
|
11
|
+
# "model": { "display_name": "claude-opus-4-6" },
|
|
12
|
+
# "workspace": { "current_dir": "/path/to/project" },
|
|
13
|
+
# "context_window": { "used_percentage": 42, "context_window_size": 200000 },
|
|
14
|
+
# "cost": { "total_cost_usd": 0.05 }
|
|
15
|
+
# }
|
|
16
|
+
|
|
17
|
+
# ---------------------------------------------------------------------------
|
|
18
|
+
# 1. Color detection
|
|
19
|
+
# ---------------------------------------------------------------------------
|
|
20
|
+
if [[ -n "${NO_COLOR}" || "${TERM}" == "dumb" ]]; then
|
|
21
|
+
# Colors disabled
|
|
22
|
+
COLOR_RESET=""
|
|
23
|
+
COLOR_OPUS=""
|
|
24
|
+
COLOR_SONNET=""
|
|
25
|
+
COLOR_HAIKU=""
|
|
26
|
+
COLOR_CTX_OK=""
|
|
27
|
+
COLOR_CTX_WARN=""
|
|
28
|
+
COLOR_CTX_CRIT=""
|
|
29
|
+
else
|
|
30
|
+
COLOR_RESET="\033[0m"
|
|
31
|
+
COLOR_OPUS="\033[1;35m" # Magenta bold
|
|
32
|
+
COLOR_SONNET="\033[0;36m" # Cyan
|
|
33
|
+
COLOR_HAIKU="\033[0;32m" # Green
|
|
34
|
+
COLOR_CTX_OK="\033[0;32m" # Green (< 60%)
|
|
35
|
+
COLOR_CTX_WARN="\033[0;33m" # Yellow (60-79%)
|
|
36
|
+
COLOR_CTX_CRIT="\033[0;31m" # Red (>= 80%)
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# ---------------------------------------------------------------------------
|
|
40
|
+
# 2. jq availability check
|
|
41
|
+
# ---------------------------------------------------------------------------
|
|
42
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
43
|
+
echo "statusline: jq required"
|
|
44
|
+
exit 0
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
# ---------------------------------------------------------------------------
|
|
48
|
+
# 3. Read stdin into variable
|
|
49
|
+
# ---------------------------------------------------------------------------
|
|
50
|
+
json="$(cat)"
|
|
51
|
+
|
|
52
|
+
# Guard against empty input
|
|
53
|
+
if [[ -z "$json" ]]; then
|
|
54
|
+
echo "statusline: no input"
|
|
55
|
+
exit 0
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
# ---------------------------------------------------------------------------
|
|
59
|
+
# 4. Single jq call — extract all fields as TSV
|
|
60
|
+
# Fields: model_name, project_dir, ctx_pct, ctx_size, cost_usd
|
|
61
|
+
# ---------------------------------------------------------------------------
|
|
62
|
+
IFS=$'\t' read -r model_name project_dir ctx_pct ctx_size cost_usd <<< "$(
|
|
63
|
+
printf '%s' "$json" | jq -r '[
|
|
64
|
+
(.model.display_name // "unknown"),
|
|
65
|
+
(.workspace.current_dir // ""),
|
|
66
|
+
(.context_window.used_percentage // 0),
|
|
67
|
+
(.context_window.context_window_size // 0),
|
|
68
|
+
(.cost.total_cost_usd // 0)
|
|
69
|
+
] | @tsv'
|
|
70
|
+
)"
|
|
71
|
+
|
|
72
|
+
# ---------------------------------------------------------------------------
|
|
73
|
+
# 5. Model display name + color (bash 3.2 compatible case pattern matching)
|
|
74
|
+
# Model detection (kept for internal reference, not displayed in statusline)
|
|
75
|
+
# ---------------------------------------------------------------------------
|
|
76
|
+
case "$model_name" in
|
|
77
|
+
*[Oo]pus*) model_display="Opus"; model_color="${COLOR_OPUS}" ;;
|
|
78
|
+
*[Ss]onnet*) model_display="Sonnet"; model_color="${COLOR_SONNET}" ;;
|
|
79
|
+
*[Hh]aiku*) model_display="Haiku"; model_color="${COLOR_HAIKU}" ;;
|
|
80
|
+
*) model_display="$model_name"; model_color="${COLOR_RESET}" ;;
|
|
81
|
+
esac
|
|
82
|
+
|
|
83
|
+
# ---------------------------------------------------------------------------
|
|
84
|
+
# 5b. Cost display — format and colorize session API cost
|
|
85
|
+
# ---------------------------------------------------------------------------
|
|
86
|
+
# Ensure cost_usd is a valid number (fallback to 0)
|
|
87
|
+
if [[ -z "$cost_usd" ]] || ! printf '%f' "$cost_usd" >/dev/null 2>&1; then
|
|
88
|
+
cost_usd="0"
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
cost_display=$(printf '$%.2f' "$cost_usd")
|
|
92
|
+
|
|
93
|
+
# Color by cost threshold (cents for integer comparison)
|
|
94
|
+
cost_cents=$(printf '%.0f' "$(echo "$cost_usd * 100" | bc 2>/dev/null || echo 0)")
|
|
95
|
+
if ! [[ "$cost_cents" =~ ^[0-9]+$ ]]; then
|
|
96
|
+
cost_cents=0
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
if [[ "$cost_cents" -ge 500 ]]; then
|
|
100
|
+
cost_color="${COLOR_CTX_CRIT}" # Red (>= $5.00)
|
|
101
|
+
elif [[ "$cost_cents" -ge 100 ]]; then
|
|
102
|
+
cost_color="${COLOR_CTX_WARN}" # Yellow ($1.00 - $4.99)
|
|
103
|
+
else
|
|
104
|
+
cost_color="${COLOR_CTX_OK}" # Green (< $1.00)
|
|
105
|
+
fi
|
|
106
|
+
|
|
107
|
+
# ---------------------------------------------------------------------------
|
|
108
|
+
# 6. Project name — basename of workspace current_dir
|
|
109
|
+
# ---------------------------------------------------------------------------
|
|
110
|
+
if [[ -n "$project_dir" ]]; then
|
|
111
|
+
project_name="${project_dir##*/}"
|
|
112
|
+
else
|
|
113
|
+
project_name="unknown"
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
# ---------------------------------------------------------------------------
|
|
117
|
+
# 7. Git branch — read .git/HEAD directly (no subprocess, fast)
|
|
118
|
+
# ---------------------------------------------------------------------------
|
|
119
|
+
git_head_file="${project_dir}/.git/HEAD"
|
|
120
|
+
git_branch=""
|
|
121
|
+
if [[ -f "$git_head_file" ]]; then
|
|
122
|
+
git_head="$(cat "$git_head_file")"
|
|
123
|
+
case "$git_head" in
|
|
124
|
+
"ref: refs/heads/"*)
|
|
125
|
+
# Normal branch: strip the prefix
|
|
126
|
+
git_branch="${git_head#ref: refs/heads/}"
|
|
127
|
+
;;
|
|
128
|
+
*)
|
|
129
|
+
# Detached HEAD: show first 7 chars of commit hash
|
|
130
|
+
git_branch="${git_head:0:7}"
|
|
131
|
+
;;
|
|
132
|
+
esac
|
|
133
|
+
fi
|
|
134
|
+
|
|
135
|
+
# ---------------------------------------------------------------------------
|
|
136
|
+
# 7b. Branch URL — for OSC 8 clickable link
|
|
137
|
+
# ---------------------------------------------------------------------------
|
|
138
|
+
branch_url=""
|
|
139
|
+
if [[ -n "$git_branch" && -n "$project_dir" ]]; then
|
|
140
|
+
# Get remote URL from git config
|
|
141
|
+
git_config="${project_dir}/.git/config"
|
|
142
|
+
if [[ -f "$git_config" ]]; then
|
|
143
|
+
# Extract remote origin URL from git config (no subprocess)
|
|
144
|
+
remote_url=""
|
|
145
|
+
in_remote_origin=false
|
|
146
|
+
while IFS= read -r line; do
|
|
147
|
+
case "$line" in
|
|
148
|
+
'[remote "origin"]')
|
|
149
|
+
in_remote_origin=true
|
|
150
|
+
;;
|
|
151
|
+
'['*)
|
|
152
|
+
in_remote_origin=false
|
|
153
|
+
;;
|
|
154
|
+
*)
|
|
155
|
+
if $in_remote_origin; then
|
|
156
|
+
case "$line" in
|
|
157
|
+
*url\ =*)
|
|
158
|
+
remote_url="${line#*url = }"
|
|
159
|
+
;;
|
|
160
|
+
esac
|
|
161
|
+
fi
|
|
162
|
+
;;
|
|
163
|
+
esac
|
|
164
|
+
done < "$git_config"
|
|
165
|
+
|
|
166
|
+
# Convert remote URL to HTTPS browse URL
|
|
167
|
+
if [[ -n "$remote_url" ]]; then
|
|
168
|
+
case "$remote_url" in
|
|
169
|
+
git@github.com:*)
|
|
170
|
+
# git@github.com:owner/repo.git → https://github.com/owner/repo
|
|
171
|
+
repo_path="${remote_url#git@github.com:}"
|
|
172
|
+
repo_path="${repo_path%.git}"
|
|
173
|
+
branch_url="https://github.com/${repo_path}/tree/${git_branch}"
|
|
174
|
+
;;
|
|
175
|
+
https://github.com/*)
|
|
176
|
+
# https://github.com/owner/repo.git → https://github.com/owner/repo
|
|
177
|
+
repo_path="${remote_url#https://github.com/}"
|
|
178
|
+
repo_path="${repo_path%.git}"
|
|
179
|
+
branch_url="https://github.com/${repo_path}/tree/${git_branch}"
|
|
180
|
+
;;
|
|
181
|
+
esac
|
|
182
|
+
fi
|
|
183
|
+
fi
|
|
184
|
+
fi
|
|
185
|
+
|
|
186
|
+
# ---------------------------------------------------------------------------
|
|
187
|
+
# 8. PR number — cached by branch to avoid gh call on every refresh
|
|
188
|
+
# ---------------------------------------------------------------------------
|
|
189
|
+
pr_display=""
|
|
190
|
+
if [[ -n "$git_branch" ]] && command -v gh >/dev/null 2>&1; then
|
|
191
|
+
cache_file="/tmp/statusline-pr-${project_name}"
|
|
192
|
+
cached_branch=""
|
|
193
|
+
cached_pr=""
|
|
194
|
+
|
|
195
|
+
if [[ -f "$cache_file" ]]; then
|
|
196
|
+
IFS=$'\t' read -r cached_branch cached_pr < "$cache_file"
|
|
197
|
+
fi
|
|
198
|
+
|
|
199
|
+
if [[ "$cached_branch" == "$git_branch" ]]; then
|
|
200
|
+
# Cache hit — use cached PR number
|
|
201
|
+
pr_number="$cached_pr"
|
|
202
|
+
else
|
|
203
|
+
# Cache miss — query gh and update cache
|
|
204
|
+
pr_number="$(gh pr view --json number -q .number 2>/dev/null || echo "")"
|
|
205
|
+
printf '%s\t%s\n' "$git_branch" "$pr_number" > "$cache_file"
|
|
206
|
+
fi
|
|
207
|
+
|
|
208
|
+
if [[ -n "$pr_number" ]]; then
|
|
209
|
+
pr_display="PR #${pr_number}"
|
|
210
|
+
fi
|
|
211
|
+
fi
|
|
212
|
+
|
|
213
|
+
# ---------------------------------------------------------------------------
|
|
214
|
+
# 9. Context percentage with color
|
|
215
|
+
# ---------------------------------------------------------------------------
|
|
216
|
+
# ctx_pct may arrive as a float (e.g. 42.5); truncate to integer for comparison
|
|
217
|
+
ctx_int="${ctx_pct%%.*}"
|
|
218
|
+
# Ensure it's a valid integer (fallback to 0)
|
|
219
|
+
if ! [[ "$ctx_int" =~ ^[0-9]+$ ]]; then
|
|
220
|
+
ctx_int=0
|
|
221
|
+
fi
|
|
222
|
+
|
|
223
|
+
if [[ "$ctx_int" -ge 80 ]]; then
|
|
224
|
+
ctx_color="${COLOR_CTX_CRIT}"
|
|
225
|
+
elif [[ "$ctx_int" -ge 60 ]]; then
|
|
226
|
+
ctx_color="${COLOR_CTX_WARN}"
|
|
227
|
+
else
|
|
228
|
+
ctx_color="${COLOR_CTX_OK}"
|
|
229
|
+
fi
|
|
230
|
+
|
|
231
|
+
ctx_display="CTX:${ctx_int}%"
|
|
232
|
+
|
|
233
|
+
# ---------------------------------------------------------------------------
|
|
234
|
+
# 10. Assemble and output the status line
|
|
235
|
+
# ---------------------------------------------------------------------------
|
|
236
|
+
# Format branch with optional OSC 8 hyperlink
|
|
237
|
+
if [[ -n "$branch_url" && -n "${COLOR_RESET}" ]]; then
|
|
238
|
+
# OSC 8 hyperlink: ESC]8;;URL BEL visible-text ESC]8;; BEL
|
|
239
|
+
branch_display=$'\033]8;;'"${branch_url}"$'\a'"${git_branch}"$'\033]8;;\a'
|
|
240
|
+
else
|
|
241
|
+
branch_display="$git_branch"
|
|
242
|
+
fi
|
|
243
|
+
|
|
244
|
+
# Build the PR segment (with separator) if present
|
|
245
|
+
pr_segment=""
|
|
246
|
+
if [[ -n "$pr_display" ]]; then
|
|
247
|
+
pr_segment=" | ${pr_display}"
|
|
248
|
+
fi
|
|
249
|
+
|
|
250
|
+
if [[ -n "$git_branch" ]]; then
|
|
251
|
+
printf "${cost_color}%s${COLOR_RESET} | %s | %s%s | ${ctx_color}%s${COLOR_RESET}\n" \
|
|
252
|
+
"$cost_display" \
|
|
253
|
+
"$project_name" \
|
|
254
|
+
"$branch_display" \
|
|
255
|
+
"$pr_segment" \
|
|
256
|
+
"$ctx_display"
|
|
257
|
+
else
|
|
258
|
+
printf "${cost_color}%s${COLOR_RESET} | %s%s | ${ctx_color}%s${COLOR_RESET}\n" \
|
|
259
|
+
"$cost_display" \
|
|
260
|
+
"$project_name" \
|
|
261
|
+
"$pr_segment" \
|
|
262
|
+
"$ctx_display"
|
|
263
|
+
fi
|
package/templates/CLAUDE.md.en
CHANGED
|
@@ -173,7 +173,7 @@ Violation = immediate correction. No exception for "small changes".
|
|
|
173
173
|
project/
|
|
174
174
|
+-- CLAUDE.md # Entry point
|
|
175
175
|
+-- .claude/
|
|
176
|
-
| +-- agents/ # Subagent definitions (
|
|
176
|
+
| +-- agents/ # Subagent definitions (41 files)
|
|
177
177
|
| +-- skills/ # Skills (55 directories)
|
|
178
178
|
| +-- rules/ # Global rules (R000-R018)
|
|
179
179
|
| +-- hooks/ # Hook scripts (memory, HUD)
|
|
@@ -215,9 +215,9 @@ This is the core oh-my-customcode philosophy: **"No expert? CREATE one, connect
|
|
|
215
215
|
| SW Architect | 2 | arch-documenter, arch-speckit-agent |
|
|
216
216
|
| Infra Engineer | 2 | infra-docker-expert, infra-aws-expert |
|
|
217
217
|
| QA Team | 3 | qa-planner, qa-writer, qa-engineer |
|
|
218
|
-
| Manager |
|
|
218
|
+
| Manager | 6 | mgr-creator, mgr-updater, mgr-supplier, mgr-gitnerd, mgr-sauron, mgr-claude-code-bible |
|
|
219
219
|
| System | 2 | sys-memory-keeper, sys-naggy |
|
|
220
|
-
| **Total** | **
|
|
220
|
+
| **Total** | **41** | |
|
|
221
221
|
|
|
222
222
|
## Agent Teams (MUST when enabled)
|
|
223
223
|
|
|
@@ -271,7 +271,7 @@ Install via `/plugin install <name>`:
|
|
|
271
271
|
| obsidian-skills | - | Obsidian markdown support |
|
|
272
272
|
| context7 | claude-plugins-official | Library documentation lookup |
|
|
273
273
|
|
|
274
|
-
###
|
|
274
|
+
### Recommended MCP Servers
|
|
275
275
|
|
|
276
276
|
| Server | Purpose |
|
|
277
277
|
|--------|---------|
|