oh-my-customcode 0.37.2 → 0.38.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.
Files changed (27) hide show
  1. package/README.md +20 -5
  2. package/dist/cli/index.js +1189 -99
  3. package/dist/index.js +4 -1
  4. package/package.json +3 -1
  5. package/templates/.claude/hooks/hooks.json +23 -11
  6. package/templates/.claude/hooks/scripts/context-budget-advisor.sh +1 -1
  7. package/templates/.claude/hooks/scripts/eval-core-batch-save.sh +23 -0
  8. package/templates/.claude/hooks/scripts/session-env-check.sh +20 -0
  9. package/templates/.claude/hooks/scripts/stuck-detector.sh +1 -1
  10. package/templates/.claude/hooks/scripts/task-outcome-recorder.sh +13 -1
  11. package/templates/.claude/rules/MAY-optimization.md +12 -0
  12. package/templates/.claude/rules/MUST-agent-design.md +45 -7
  13. package/templates/.claude/rules/MUST-completion-verification.md +81 -0
  14. package/templates/.claude/rules/SHOULD-memory-integration.md +81 -0
  15. package/templates/.claude/skills/de-lead-routing/SKILL.md +8 -92
  16. package/templates/.claude/skills/deep-plan/SKILL.md +55 -4
  17. package/templates/.claude/skills/dev-lead-routing/SKILL.md +9 -21
  18. package/templates/.claude/skills/dev-refactor/SKILL.md +34 -1
  19. package/templates/.claude/skills/evaluator-optimizer/SKILL.md +53 -0
  20. package/templates/.claude/skills/qa-lead-routing/SKILL.md +7 -242
  21. package/templates/.claude/skills/research/SKILL.md +74 -7
  22. package/templates/.claude/skills/sauron-watch/SKILL.md +81 -0
  23. package/templates/.claude/skills/secretary-routing/SKILL.md +3 -18
  24. package/templates/.claude/skills/structured-dev-cycle/SKILL.md +20 -3
  25. package/templates/guides/claude-code/index.yaml +5 -0
  26. package/templates/manifest.json +3 -3
  27. package/templates/.claude/hooks/scripts/session-compliance-report.sh +0 -65
@@ -53,6 +53,59 @@ Ensure complete synchronization of agents, skills, documentation, and project st
53
53
  □ All routing skills have complete agent mappings
54
54
  ```
55
55
 
56
+ #### Structural Lint Rules
57
+
58
+ In addition to workflow alignment checks, verify these structural invariants:
59
+
60
+ **Lint 1: Routing Coverage**
61
+ ```
62
+ For each agent in .claude/agents/*.md:
63
+ Check if agent name appears in at least one routing skill:
64
+ - secretary-routing/SKILL.md
65
+ - dev-lead-routing/SKILL.md
66
+ - de-lead-routing/SKILL.md
67
+ - qa-lead-routing/SKILL.md
68
+
69
+ If not found in any routing skill:
70
+ WARN: "{agent} is unreachable — not referenced in any routing skill"
71
+ ```
72
+
73
+ **Lint 2: Orphan Skill Detection**
74
+ ```
75
+ For each skill in .claude/skills/*/SKILL.md:
76
+ Check if skill name appears in:
77
+ - Any agent's skills: [] frontmatter field
78
+ - Any routing skill's content
79
+ - CLAUDE.md command table (for user-invocable skills)
80
+
81
+ If not referenced anywhere:
82
+ WARN: "{skill} is orphaned — not referenced by any agent or routing skill"
83
+ ```
84
+
85
+ **Lint 3: Circular Dependency Check**
86
+ ```
87
+ Build dependency graph:
88
+ For each agent → extract skills: [] references
89
+ For each skill → extract agent references in body
90
+
91
+ Detect cycles: agent-A → skill-X → agent-A
92
+ If cycle found:
93
+ ERROR: "Circular dependency: {cycle path}"
94
+ ```
95
+
96
+ **Lint 4: Context Fork Cap Verification**
97
+ ```
98
+ Count skills with context: fork in frontmatter:
99
+ grep "context: fork" .claude/skills/*/SKILL.md
100
+
101
+ If count > 10:
102
+ ERROR: "Context fork cap exceeded: {count}/10"
103
+ If count >= 8:
104
+ WARN: "Context fork usage high: {count}/10 — only {10-count} slots remaining"
105
+ ```
106
+
107
+ All structural lints are **advisory** (WARN level) except circular dependencies and fork cap exceeded (ERROR level — should block commit).
108
+
56
109
  #### Deep Round 2: Reference Verification
57
110
  ```
58
111
  □ All skill references exist
@@ -73,6 +126,34 @@ Ensure complete synchronization of agents, skills, documentation, and project st
73
126
  □ All MUST rules enforced, SHOULD rules recommended
74
127
  ```
75
128
 
129
+ #### Spec Density Check (Advisory)
130
+
131
+ Check each agent's body-to-skill ratio to detect agents with too much inline implementation detail:
132
+
133
+ ```
134
+ For each agent in .claude/agents/*.md:
135
+ agent_body_LOC = count non-frontmatter, non-blank lines in agent body
136
+ referenced_skills = extract skills from frontmatter skills: field
137
+ total_skill_LOC = sum of LOC in each referenced SKILL.md
138
+
139
+ if total_skill_LOC > 0:
140
+ spec_density = agent_body_LOC / total_skill_LOC
141
+ if spec_density > 0.5:
142
+ WARN: "{agent} has spec density {spec_density:.2f} — consider extracting inline details to skills"
143
+ else:
144
+ if agent_body_LOC > 50:
145
+ INFO: "{agent} has {agent_body_LOC} LOC with no skill references — consider creating skills"
146
+ ```
147
+
148
+ **Thresholds**:
149
+ | Density | Status | Meaning |
150
+ |---------|--------|---------|
151
+ | ≤ 0.3 | Good | Agent properly delegates to skills |
152
+ | 0.3-0.5 | OK | Acceptable inline detail |
153
+ | > 0.5 | WARNING | Too much implementation in agent body |
154
+
155
+ This check is **advisory only** — it does not block commits.
156
+
76
157
  ### Phase 2.5: Documentation Accuracy
77
158
  ```
78
159
  □ Every agent name in CLAUDE.md matches actual filename
@@ -56,26 +56,11 @@ batch → multiple (parallel)
56
56
 
57
57
  ### Ontology-RAG Enrichment (R019)
58
58
 
59
- After agent selection, enrich the spawned agent's prompt with ontology context:
59
+ If `get_agent_for_task` MCP tool is available, call it with the original query and inject `suggested_skills` into the agent prompt. Skip silently on failure.
60
60
 
61
- 1. Call `get_agent_for_task(original_query)` via MCP
62
- 2. Extract `suggested_skills` from response
63
- 3. If `suggested_skills` non-empty, prepend to spawned agent prompt:
64
- `"Ontology context suggests these skills may be relevant: {suggested_skills}"`
65
- 4. On MCP failure: skip silently, proceed with unmodified prompt
61
+ ### Step 5: Soul Injection (R006)
66
62
 
67
- **This step is advisory only it never changes which agent is selected.**
68
-
69
- ### Step 5: Soul Injection
70
-
71
- If the selected agent has `soul: true` in its frontmatter:
72
-
73
- 1. Read `.claude/agents/souls/{agent-name}.soul.md`
74
- 2. If file exists, prepend soul content to the agent's prompt:
75
- `"Identity context:\n{soul content}\n\n---\n\n"`
76
- 3. If file doesn't exist → skip silently (no error, no injection)
77
-
78
- **This step runs after ontology-RAG enrichment. Soul content is identity context, not capability instructions.**
63
+ If the selected agent has `soul: true` in frontmatter, read and prepend `.claude/agents/souls/{agent-name}.soul.md` content to the prompt. Skip silently if file doesn't exist.
79
64
 
80
65
  ## Routing Rules
81
66
 
@@ -25,6 +25,21 @@ Inspired by Pi Coding Agent Workflow Extension's structured development approach
25
25
  | 5 | **Compound** | Read, Bash (tests only) | Write, Edit | Integration testing, cross-module validation |
26
26
  | 6 | **Done** | Read | Write, Edit, Bash | Summary and documentation |
27
27
 
28
+ ### Stage Model Recommendations
29
+
30
+ Following the [reasoning-sandwich](/skills/reasoning-sandwich) pattern:
31
+
32
+ | Stage | Recommended Model | Rationale |
33
+ |-------|------------------|-----------|
34
+ | 1: Plan | opus | Architectural reasoning, requirement analysis |
35
+ | 2: Verify Plan | opus | Edge case detection, alternative evaluation |
36
+ | 3: Implement | sonnet | Code generation, file creation optimized |
37
+ | 4: Verify Implementation | sonnet | Test execution, structural review |
38
+ | 5: Compound | sonnet | Integration testing, cross-module validation |
39
+ | 6: Done | haiku | Checklist validation, summary generation |
40
+
41
+ Model selection is advisory — the orchestrator may override based on task complexity.
42
+
28
43
  ## Stage Tracking
29
44
 
30
45
  Stage state is tracked via a marker file for hook enforcement:
@@ -80,9 +95,11 @@ A PreToolUse hook in `.claude/hooks/hooks.json` checks this marker and blocks Wr
80
95
 
81
96
  **Codex-Exec Hybrid Option**: When entering Stage 3:
82
97
  1. Check `/tmp/.claude-env-status-*` for codex CLI availability
83
- 2. If available AND task involves new file creation:
84
- - Suggest: `[Codex Hybrid Available] New file generation can use codex-exec for faster scaffolding. Orchestrator may delegate initial code generation to codex-exec, then have Claude expert review.`
85
- 3. If unavailable proceed with standard implementation via Claude experts
98
+ 2. If available AND task involves new file creation → automatically delegate scaffolding to `/codex-exec`:
99
+ - Display: `[Codex Hybrid] Delegating scaffolding to codex-exec...`
100
+ - codex-exec generates initial code (strength: fast generation)
101
+ - Claude expert reviews and refines codex output (strength: reasoning, quality)
102
+ 3. If unavailable → display `[Codex] Unavailable — proceeding with Claude experts directly` and proceed with standard implementation via Claude experts
86
103
 
87
104
  Suitable for codex hybrid: new files, boilerplate, test stubs, scaffolding
88
105
  Not suitable: modifying existing code, architecture-dependent changes
@@ -49,3 +49,8 @@ documents:
49
49
  description: 프로덕션 에이전트 운영
50
50
  path: ./10-monitoring.md
51
51
  status: placeholder # 공식 문서 미공개
52
+
53
+ - name: workflow-patterns
54
+ title: 워크플로우 패턴
55
+ description: AI 에이전트 작업에 적합한 워크플로우 패턴 선택 가이드
56
+ path: ./12-workflow-patterns.md
@@ -1,12 +1,12 @@
1
1
  {
2
- "version": "0.37.2",
3
- "lastUpdated": "2026-03-14T00:00:00.000Z",
2
+ "version": "0.38.0",
3
+ "lastUpdated": "2026-03-16T00: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": 19
9
+ "files": 20
10
10
  },
11
11
  {
12
12
  "name": "agents",
@@ -1,65 +0,0 @@
1
- #!/bin/bash
2
- # Stop hook: Session compliance report (R265 Phase 1)
3
- # Reads violation logs collected by PreToolUse hooks during the session
4
- # Advisory only — never blocks session termination
5
- # Ref: https://github.com/baekenough/oh-my-customcode/issues/265
6
-
7
- set -euo pipefail
8
-
9
- input=$(cat)
10
-
11
- VIOLATIONS_FILE="/tmp/.claude-violations-${PPID}"
12
- TASK_COUNT_FILE="/tmp/.claude-task-count-${PPID}"
13
-
14
- echo "" >&2
15
- echo "╔══════════════════════════════════════════════╗" >&2
16
- echo "║ Session Compliance Report ║" >&2
17
- echo "╚══════════════════════════════════════════════╝" >&2
18
-
19
- # Count total Agent/Task calls
20
- if [ -f "$TASK_COUNT_FILE" ]; then
21
- TOTAL_TASKS=$(cat "$TASK_COUNT_FILE")
22
- echo "[Compliance] Agent/Task calls this session: ${TOTAL_TASKS}" >&2
23
- else
24
- TOTAL_TASKS=0
25
- echo "[Compliance] Agent/Task calls this session: 0" >&2
26
- fi
27
-
28
- # Check violations
29
- if [ -f "$VIOLATIONS_FILE" ] && [ -s "$VIOLATIONS_FILE" ]; then
30
- VIOLATION_COUNT=$(wc -l < "$VIOLATIONS_FILE" | tr -d ' ')
31
- echo "[Compliance] Violations detected: ${VIOLATION_COUNT}" >&2
32
- echo "" >&2
33
-
34
- # Group by rule
35
- R010_COUNT=$(grep -c '"rule":"R010"' "$VIOLATIONS_FILE" 2>/dev/null || echo "0")
36
- R018_COUNT=$(grep -c '"rule":"R018"' "$VIOLATIONS_FILE" 2>/dev/null || echo "0")
37
-
38
- if [ "$R010_COUNT" -gt 0 ]; then
39
- echo " R010 (Git Delegation): ${R010_COUNT} violation(s)" >&2
40
- grep '"rule":"R010"' "$VIOLATIONS_FILE" | jq -r '.detail' 2>/dev/null | while read -r detail; do
41
- echo " - ${detail}" >&2
42
- done
43
- fi
44
-
45
- if [ "$R018_COUNT" -gt 0 ]; then
46
- echo " R018 (Agent Teams): ${R018_COUNT} violation(s)" >&2
47
- grep '"rule":"R018"' "$VIOLATIONS_FILE" | jq -r '.detail' 2>/dev/null | while read -r detail; do
48
- echo " - ${detail}" >&2
49
- done
50
- fi
51
-
52
- echo "" >&2
53
- echo "[Compliance] Review violations above and consider rule updates per R016." >&2
54
- else
55
- echo "[Compliance] No violations detected. All clear!" >&2
56
- fi
57
-
58
- echo "────────────────────────────────────────────────" >&2
59
-
60
- # Cleanup temp files (best effort)
61
- rm -f "$VIOLATIONS_FILE" 2>/dev/null || true
62
-
63
- # CRITICAL: Always pass through input and exit 0
64
- echo "$input"
65
- exit 0