oh-my-customcode 0.1.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 (237) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +287 -0
  3. package/dist/cli/index.js +13299 -0
  4. package/dist/index.js +927 -0
  5. package/package.json +74 -0
  6. package/templates/.claude/contexts/dev.md +20 -0
  7. package/templates/.claude/contexts/ecomode.md +63 -0
  8. package/templates/.claude/contexts/index.yaml +41 -0
  9. package/templates/.claude/contexts/research.md +28 -0
  10. package/templates/.claude/contexts/review.md +23 -0
  11. package/templates/.claude/hooks/hooks.json +185 -0
  12. package/templates/.claude/hooks/hud/index.yaml +27 -0
  13. package/templates/.claude/hooks/hud/update-status.sh +32 -0
  14. package/templates/.claude/hooks/index.yaml +46 -0
  15. package/templates/.claude/hooks/memory-persistence/pre-compact.sh +37 -0
  16. package/templates/.claude/hooks/memory-persistence/session-end.sh +64 -0
  17. package/templates/.claude/hooks/memory-persistence/session-start.sh +41 -0
  18. package/templates/.claude/hooks/strategic-compact/suggest-compact.sh +50 -0
  19. package/templates/.claude/install-hooks.sh +100 -0
  20. package/templates/.claude/rules/MAY-optimization.md +93 -0
  21. package/templates/.claude/rules/MUST-agent-design.md +107 -0
  22. package/templates/.claude/rules/MUST-agent-identification.md +108 -0
  23. package/templates/.claude/rules/MUST-continuous-improvement.md +132 -0
  24. package/templates/.claude/rules/MUST-intent-transparency.md +199 -0
  25. package/templates/.claude/rules/MUST-language-policy.md +62 -0
  26. package/templates/.claude/rules/MUST-orchestrator-coordination.md +266 -0
  27. package/templates/.claude/rules/MUST-parallel-execution.md +341 -0
  28. package/templates/.claude/rules/MUST-permissions.md +84 -0
  29. package/templates/.claude/rules/MUST-safety.md +69 -0
  30. package/templates/.claude/rules/MUST-sync-verification.md +219 -0
  31. package/templates/.claude/rules/MUST-tool-identification.md +112 -0
  32. package/templates/.claude/rules/SHOULD-ecomode.md +145 -0
  33. package/templates/.claude/rules/SHOULD-error-handling.md +102 -0
  34. package/templates/.claude/rules/SHOULD-hud-statusline.md +89 -0
  35. package/templates/.claude/rules/SHOULD-interaction.md +103 -0
  36. package/templates/.claude/rules/SHOULD-memory-integration.md +114 -0
  37. package/templates/.claude/rules/SHOULD-pipeline-mode.md +165 -0
  38. package/templates/.claude/rules/index.yaml +125 -0
  39. package/templates/.claude/uninstall-hooks.sh +52 -0
  40. package/templates/CLAUDE.md.en +259 -0
  41. package/templates/CLAUDE.md.ko +259 -0
  42. package/templates/agents/index.yaml +237 -0
  43. package/templates/agents/infra-engineer/aws-expert/AGENT.md +47 -0
  44. package/templates/agents/infra-engineer/aws-expert/index.yaml +27 -0
  45. package/templates/agents/infra-engineer/docker-expert/AGENT.md +47 -0
  46. package/templates/agents/infra-engineer/docker-expert/index.yaml +27 -0
  47. package/templates/agents/manager/creator/AGENT.md +274 -0
  48. package/templates/agents/manager/creator/index.yaml +66 -0
  49. package/templates/agents/manager/gitnerd/AGENT.md +91 -0
  50. package/templates/agents/manager/gitnerd/index.yaml +55 -0
  51. package/templates/agents/manager/sauron/AGENT.md +153 -0
  52. package/templates/agents/manager/sauron/index.yaml +52 -0
  53. package/templates/agents/manager/supplier/AGENT.md +142 -0
  54. package/templates/agents/manager/supplier/index.yaml +31 -0
  55. package/templates/agents/manager/sync-checker/AGENT.md +34 -0
  56. package/templates/agents/manager/sync-checker/index.yaml +32 -0
  57. package/templates/agents/manager/updater/AGENT.md +125 -0
  58. package/templates/agents/manager/updater/index.yaml +31 -0
  59. package/templates/agents/orchestrator/dev-lead/AGENT.md +116 -0
  60. package/templates/agents/orchestrator/dev-lead/index.yaml +73 -0
  61. package/templates/agents/orchestrator/planner/AGENT.md +102 -0
  62. package/templates/agents/orchestrator/planner/index.yaml +38 -0
  63. package/templates/agents/orchestrator/qa-lead/AGENT.md +92 -0
  64. package/templates/agents/orchestrator/qa-lead/index.yaml +40 -0
  65. package/templates/agents/orchestrator/secretary/AGENT.md +132 -0
  66. package/templates/agents/orchestrator/secretary/index.yaml +55 -0
  67. package/templates/agents/qa-team/qa-engineer/AGENT.md +98 -0
  68. package/templates/agents/qa-team/qa-engineer/index.yaml +59 -0
  69. package/templates/agents/qa-team/qa-planner/AGENT.md +75 -0
  70. package/templates/agents/qa-team/qa-planner/index.yaml +47 -0
  71. package/templates/agents/qa-team/qa-writer/AGENT.md +98 -0
  72. package/templates/agents/qa-team/qa-writer/index.yaml +44 -0
  73. package/templates/agents/sw-architect/documenter/AGENT.md +120 -0
  74. package/templates/agents/sw-architect/documenter/index.yaml +39 -0
  75. package/templates/agents/sw-architect/speckit-agent/AGENT.md +127 -0
  76. package/templates/agents/sw-architect/speckit-agent/index.yaml +78 -0
  77. package/templates/agents/sw-engineer/backend/express-expert/AGENT.md +132 -0
  78. package/templates/agents/sw-engineer/backend/express-expert/index.yaml +36 -0
  79. package/templates/agents/sw-engineer/backend/fastapi-expert/AGENT.md +47 -0
  80. package/templates/agents/sw-engineer/backend/fastapi-expert/index.yaml +27 -0
  81. package/templates/agents/sw-engineer/backend/go-backend-expert/AGENT.md +47 -0
  82. package/templates/agents/sw-engineer/backend/go-backend-expert/index.yaml +27 -0
  83. package/templates/agents/sw-engineer/backend/nestjs-expert/AGENT.md +107 -0
  84. package/templates/agents/sw-engineer/backend/nestjs-expert/index.yaml +43 -0
  85. package/templates/agents/sw-engineer/backend/springboot-expert/AGENT.md +103 -0
  86. package/templates/agents/sw-engineer/backend/springboot-expert/index.yaml +69 -0
  87. package/templates/agents/sw-engineer/frontend/svelte-agent/AGENT.md +71 -0
  88. package/templates/agents/sw-engineer/frontend/svelte-agent/index.yaml +41 -0
  89. package/templates/agents/sw-engineer/frontend/vercel-agent/AGENT.md +67 -0
  90. package/templates/agents/sw-engineer/frontend/vercel-agent/index.yaml +43 -0
  91. package/templates/agents/sw-engineer/frontend/vuejs-agent/AGENT.md +71 -0
  92. package/templates/agents/sw-engineer/frontend/vuejs-agent/index.yaml +48 -0
  93. package/templates/agents/sw-engineer/language/golang-expert/AGENT.md +47 -0
  94. package/templates/agents/sw-engineer/language/golang-expert/index.yaml +27 -0
  95. package/templates/agents/sw-engineer/language/java21-expert/AGENT.md +122 -0
  96. package/templates/agents/sw-engineer/language/java21-expert/index.yaml +51 -0
  97. package/templates/agents/sw-engineer/language/kotlin-expert/AGENT.md +47 -0
  98. package/templates/agents/sw-engineer/language/kotlin-expert/index.yaml +27 -0
  99. package/templates/agents/sw-engineer/language/python-expert/AGENT.md +47 -0
  100. package/templates/agents/sw-engineer/language/python-expert/index.yaml +27 -0
  101. package/templates/agents/sw-engineer/language/rust-expert/AGENT.md +47 -0
  102. package/templates/agents/sw-engineer/language/rust-expert/index.yaml +27 -0
  103. package/templates/agents/sw-engineer/language/typescript-expert/AGENT.md +47 -0
  104. package/templates/agents/sw-engineer/language/typescript-expert/index.yaml +27 -0
  105. package/templates/agents/sw-engineer/tooling/bun-expert/AGENT.md +73 -0
  106. package/templates/agents/sw-engineer/tooling/bun-expert/index.yaml +46 -0
  107. package/templates/agents/sw-engineer/tooling/npm-expert/AGENT.md +160 -0
  108. package/templates/agents/sw-engineer/tooling/npm-expert/index.yaml +45 -0
  109. package/templates/agents/sw-engineer/tooling/optimizer/AGENT.md +170 -0
  110. package/templates/agents/sw-engineer/tooling/optimizer/index.yaml +45 -0
  111. package/templates/agents/system/memory-keeper/AGENT.md +126 -0
  112. package/templates/agents/system/memory-keeper/index.yaml +45 -0
  113. package/templates/agents/system/naggy/AGENT.md +72 -0
  114. package/templates/agents/system/naggy/index.yaml +35 -0
  115. package/templates/commands/COMMANDS.md +136 -0
  116. package/templates/commands/creator/agent.md +121 -0
  117. package/templates/commands/dev/refactor.md +126 -0
  118. package/templates/commands/dev/review.md +82 -0
  119. package/templates/commands/git/branch.yaml +8 -0
  120. package/templates/commands/git/commit.yaml +4 -0
  121. package/templates/commands/git/pr.yaml +4 -0
  122. package/templates/commands/git/status.yaml +4 -0
  123. package/templates/commands/git/sync.yaml +4 -0
  124. package/templates/commands/index.yaml +225 -0
  125. package/templates/commands/intent/explain.md +144 -0
  126. package/templates/commands/memory/recall.md +164 -0
  127. package/templates/commands/memory/save.md +128 -0
  128. package/templates/commands/naggy/add.yaml +8 -0
  129. package/templates/commands/naggy/done.yaml +8 -0
  130. package/templates/commands/naggy/list.yaml +4 -0
  131. package/templates/commands/naggy/priority.yaml +11 -0
  132. package/templates/commands/naggy/remind.yaml +4 -0
  133. package/templates/commands/npm/audit.yaml +62 -0
  134. package/templates/commands/npm/publish.yaml +52 -0
  135. package/templates/commands/npm/version.yaml +62 -0
  136. package/templates/commands/optimize/analyze.yaml +34 -0
  137. package/templates/commands/optimize/bundle.yaml +50 -0
  138. package/templates/commands/optimize/report.yaml +56 -0
  139. package/templates/commands/pipeline/list.md +81 -0
  140. package/templates/commands/pipeline/run.md +127 -0
  141. package/templates/commands/sauron/quick.yaml +4 -0
  142. package/templates/commands/sauron/report.yaml +4 -0
  143. package/templates/commands/sauron/watch.yaml +4 -0
  144. package/templates/commands/supplier/audit.md +133 -0
  145. package/templates/commands/supplier/fix.md +121 -0
  146. package/templates/commands/sync/agents.yaml +4 -0
  147. package/templates/commands/sync/check.yaml +4 -0
  148. package/templates/commands/sync/commands.yaml +4 -0
  149. package/templates/commands/sync/docs.yaml +4 -0
  150. package/templates/commands/sync/fix.yaml +4 -0
  151. package/templates/commands/system/help.md +137 -0
  152. package/templates/commands/system/lists.md +86 -0
  153. package/templates/commands/system/status.md +163 -0
  154. package/templates/commands/updater/docs.md +165 -0
  155. package/templates/commands/updater/external.md +214 -0
  156. package/templates/guides/aws/common-patterns.md +169 -0
  157. package/templates/guides/aws/index.yaml +26 -0
  158. package/templates/guides/aws/well-architected.md +143 -0
  159. package/templates/guides/claude-code/01-overview.md +42 -0
  160. package/templates/guides/claude-code/03-tools.md +107 -0
  161. package/templates/guides/claude-code/04-agent-skills.md +90 -0
  162. package/templates/guides/claude-code/05-agent-sdk.md +129 -0
  163. package/templates/guides/claude-code/06-mcp.md +165 -0
  164. package/templates/guides/claude-code/07-prompt-engineering.md +100 -0
  165. package/templates/guides/claude-code/08-testing.md +58 -0
  166. package/templates/guides/claude-code/09-guardrails.md +80 -0
  167. package/templates/guides/claude-code/10-monitoring.md +89 -0
  168. package/templates/guides/claude-code/index.yaml +51 -0
  169. package/templates/guides/docker/compose-best-practices.md +284 -0
  170. package/templates/guides/docker/dockerfile-best-practices.md +262 -0
  171. package/templates/guides/docker/index.yaml +26 -0
  172. package/templates/guides/fastapi/best-practices.md +232 -0
  173. package/templates/guides/fastapi/index.yaml +21 -0
  174. package/templates/guides/go-backend/index.yaml +26 -0
  175. package/templates/guides/go-backend/project-layout.md +243 -0
  176. package/templates/guides/go-backend/uber-style.md +212 -0
  177. package/templates/guides/golang/concurrency.md +282 -0
  178. package/templates/guides/golang/effective-go.md +309 -0
  179. package/templates/guides/golang/error-handling.md +250 -0
  180. package/templates/guides/golang/index.yaml +27 -0
  181. package/templates/guides/index.yaml +101 -0
  182. package/templates/guides/kotlin/coding-conventions.md +247 -0
  183. package/templates/guides/kotlin/idioms.md +234 -0
  184. package/templates/guides/kotlin/index.yaml +26 -0
  185. package/templates/guides/python/index.yaml +26 -0
  186. package/templates/guides/python/pep8-style-guide.md +202 -0
  187. package/templates/guides/python/zen-of-python.md +79 -0
  188. package/templates/guides/rust/error-handling.md +262 -0
  189. package/templates/guides/rust/index.yaml +26 -0
  190. package/templates/guides/rust/ownership.md +180 -0
  191. package/templates/guides/springboot/best-practices.md +361 -0
  192. package/templates/guides/springboot/index.yaml +22 -0
  193. package/templates/guides/typescript/advanced-types.md +225 -0
  194. package/templates/guides/typescript/index.yaml +26 -0
  195. package/templates/guides/typescript/type-system.md +219 -0
  196. package/templates/guides/web-design/accessibility.md +66 -0
  197. package/templates/guides/web-design/index.yaml +20 -0
  198. package/templates/guides/web-design/performance.md +102 -0
  199. package/templates/pipelines/examples/code-review.yaml +66 -0
  200. package/templates/pipelines/index.yaml +18 -0
  201. package/templates/pipelines/templates/pipeline-template.yaml +50 -0
  202. package/templates/skills/backend/fastapi-best-practices/SKILL.md +269 -0
  203. package/templates/skills/backend/fastapi-best-practices/index.yaml +25 -0
  204. package/templates/skills/backend/go-backend-best-practices/SKILL.md +337 -0
  205. package/templates/skills/backend/go-backend-best-practices/index.yaml +26 -0
  206. package/templates/skills/backend/springboot-best-practices/SKILL.md +356 -0
  207. package/templates/skills/backend/springboot-best-practices/index.yaml +27 -0
  208. package/templates/skills/development/go-best-practices/SKILL.md +202 -0
  209. package/templates/skills/development/go-best-practices/index.yaml +25 -0
  210. package/templates/skills/development/kotlin-best-practices/SKILL.md +255 -0
  211. package/templates/skills/development/kotlin-best-practices/index.yaml +27 -0
  212. package/templates/skills/development/python-best-practices/SKILL.md +221 -0
  213. package/templates/skills/development/python-best-practices/index.yaml +25 -0
  214. package/templates/skills/development/react-best-practices/SKILL.md +100 -0
  215. package/templates/skills/development/react-best-practices/index.yaml +39 -0
  216. package/templates/skills/development/rust-best-practices/SKILL.md +266 -0
  217. package/templates/skills/development/rust-best-practices/index.yaml +26 -0
  218. package/templates/skills/development/typescript-best-practices/SKILL.md +320 -0
  219. package/templates/skills/development/typescript-best-practices/index.yaml +28 -0
  220. package/templates/skills/development/vercel-deploy/SKILL.md +73 -0
  221. package/templates/skills/development/vercel-deploy/index.yaml +30 -0
  222. package/templates/skills/development/web-design-guidelines/SKILL.md +117 -0
  223. package/templates/skills/development/web-design-guidelines/index.yaml +34 -0
  224. package/templates/skills/index.yaml +129 -0
  225. package/templates/skills/infrastructure/aws-best-practices/SKILL.md +279 -0
  226. package/templates/skills/infrastructure/aws-best-practices/index.yaml +27 -0
  227. package/templates/skills/infrastructure/docker-best-practices/SKILL.md +274 -0
  228. package/templates/skills/infrastructure/docker-best-practices/index.yaml +26 -0
  229. package/templates/skills/orchestration/intent-detection/SKILL.md +214 -0
  230. package/templates/skills/orchestration/intent-detection/index.yaml +30 -0
  231. package/templates/skills/orchestration/intent-detection/patterns/agent-triggers.yaml +333 -0
  232. package/templates/skills/orchestration/pipeline-execution/SKILL.md +188 -0
  233. package/templates/skills/orchestration/pipeline-execution/index.yaml +27 -0
  234. package/templates/skills/system/memory-management/SKILL.md +194 -0
  235. package/templates/skills/system/memory-management/index.yaml +30 -0
  236. package/templates/skills/system/result-aggregation/SKILL.md +163 -0
  237. package/templates/skills/system/result-aggregation/index.yaml +36 -0
@@ -0,0 +1,41 @@
1
+ #!/bin/bash
2
+ # SessionStart Hook - Load previous context on new session
3
+ #
4
+ # Runs when a new Claude session starts. Checks for recent session
5
+ # files and learned skills to provide continuity hints.
6
+ #
7
+ # Hook config (in ~/.claude/settings.json):
8
+ # {
9
+ # "hooks": {
10
+ # "SessionStart": [{
11
+ # "matcher": "*",
12
+ # "hooks": [{
13
+ # "type": "command",
14
+ # "command": "~/.claude/hooks/memory-persistence/session-start.sh"
15
+ # }]
16
+ # }]
17
+ # }
18
+ # }
19
+
20
+ SESSIONS_DIR="${HOME}/.claude/sessions"
21
+ SKILLS_DIR="${HOME}/.claude/skills/learned"
22
+
23
+ # Check for recent session files (last 7 days)
24
+ if [ -d "$SESSIONS_DIR" ]; then
25
+ RECENT_SESSIONS=$(find "$SESSIONS_DIR" -name "*.tmp" -mtime -7 2>/dev/null | wc -l | tr -d ' ')
26
+ if [ "$RECENT_SESSIONS" -gt 0 ]; then
27
+ echo "[SessionStart] Found $RECENT_SESSIONS recent session(s)" >&2
28
+ LATEST=$(find "$SESSIONS_DIR" -name "*.tmp" -mtime -7 2>/dev/null | sort -r | head -1)
29
+ if [ -n "$LATEST" ]; then
30
+ echo "[SessionStart] Latest: $LATEST" >&2
31
+ fi
32
+ fi
33
+ fi
34
+
35
+ # Check for learned skills
36
+ if [ -d "$SKILLS_DIR" ]; then
37
+ SKILLS_COUNT=$(find "$SKILLS_DIR" -name "*.md" 2>/dev/null | wc -l | tr -d ' ')
38
+ if [ "$SKILLS_COUNT" -gt 0 ]; then
39
+ echo "[SessionStart] $SKILLS_COUNT learned skill(s) available" >&2
40
+ fi
41
+ fi
@@ -0,0 +1,50 @@
1
+ #!/bin/bash
2
+ # Strategic Compact Suggester - Suggest manual compaction at logical intervals
3
+ #
4
+ # Tracks tool usage and suggests compaction at strategic points.
5
+ # Manual compaction preserves context through logical phases.
6
+ #
7
+ # Best times to compact:
8
+ # - After completing an exploration phase, before starting execution
9
+ # - After reaching a milestone (feature complete, tests passing)
10
+ # - When context feels cluttered but before it auto-compacts
11
+ #
12
+ # Hook config (in ~/.claude/settings.json):
13
+ # {
14
+ # "hooks": {
15
+ # "PreToolUse": [{
16
+ # "matcher": "tool == \"Edit\" || tool == \"Write\"",
17
+ # "hooks": [{
18
+ # "type": "command",
19
+ # "command": "~/.claude/hooks/strategic-compact/suggest-compact.sh"
20
+ # }]
21
+ # }]
22
+ # }
23
+ # }
24
+
25
+ COUNTER_FILE="/tmp/claude-tool-count-$$"
26
+ THRESHOLD=${COMPACT_THRESHOLD:-50}
27
+
28
+ # Initialize or increment counter
29
+ if [ -f "$COUNTER_FILE" ]; then
30
+ COUNT=$(cat "$COUNTER_FILE")
31
+ COUNT=$((COUNT + 1))
32
+ else
33
+ COUNT=1
34
+ fi
35
+ echo "$COUNT" > "$COUNTER_FILE"
36
+
37
+ # Suggest compaction at threshold
38
+ if [ "$COUNT" -eq "$THRESHOLD" ]; then
39
+ echo "[StrategicCompact] Reached $THRESHOLD tool calls" >&2
40
+ echo "[StrategicCompact] Consider running /compact if at a logical breakpoint" >&2
41
+ echo "[StrategicCompact] Good times: after exploration, before implementation" >&2
42
+ fi
43
+
44
+ # Reminder every 25 calls after threshold
45
+ if [ "$COUNT" -gt "$THRESHOLD" ] && [ $(((COUNT - THRESHOLD) % 25)) -eq 0 ]; then
46
+ echo "[StrategicCompact] $COUNT tool calls - /compact reminder" >&2
47
+ fi
48
+
49
+ # Pass through input
50
+ cat
@@ -0,0 +1,100 @@
1
+ #!/bin/bash
2
+ # Claude Code Hooks & Contexts Installer
3
+ # Source: https://github.com/affaan-m/everything-claude-code
4
+ # Adapted for baekgom-agents project
5
+
6
+ set -e
7
+
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ CLAUDE_HOME="${HOME}/.claude"
10
+ SETTINGS_FILE="${CLAUDE_HOME}/settings.json"
11
+
12
+ echo "┌─────────────────────────────────────────────┐"
13
+ echo "│ Claude Code Hooks & Contexts Installer │"
14
+ echo "└─────────────────────────────────────────────┘"
15
+ echo ""
16
+
17
+ # Create directories
18
+ echo "[1/5] Creating directories..."
19
+ mkdir -p "${CLAUDE_HOME}/hooks/memory-persistence"
20
+ mkdir -p "${CLAUDE_HOME}/hooks/strategic-compact"
21
+ mkdir -p "${CLAUDE_HOME}/sessions"
22
+ mkdir -p "${CLAUDE_HOME}/skills/learned"
23
+ mkdir -p "${CLAUDE_HOME}/contexts"
24
+ echo " ✓ Directories created"
25
+
26
+ # Copy scripts
27
+ echo "[2/5] Copying hook scripts..."
28
+ cp "${SCRIPT_DIR}/hooks/memory-persistence/"*.sh "${CLAUDE_HOME}/hooks/memory-persistence/"
29
+ cp "${SCRIPT_DIR}/hooks/strategic-compact/"*.sh "${CLAUDE_HOME}/hooks/strategic-compact/"
30
+ echo " ✓ Scripts copied"
31
+
32
+ # Copy contexts
33
+ echo "[3/5] Copying context files..."
34
+ cp "${SCRIPT_DIR}/contexts/"*.md "${CLAUDE_HOME}/contexts/"
35
+ echo " ✓ Contexts copied"
36
+
37
+ # Set permissions
38
+ echo "[4/5] Setting execute permissions..."
39
+ chmod +x "${CLAUDE_HOME}/hooks/memory-persistence/"*.sh
40
+ chmod +x "${CLAUDE_HOME}/hooks/strategic-compact/"*.sh
41
+ echo " ✓ Permissions set"
42
+
43
+ # Handle settings.json
44
+ echo "[5/5] Configuring settings.json..."
45
+
46
+ if [ -f "$SETTINGS_FILE" ]; then
47
+ # Backup existing settings
48
+ BACKUP_FILE="${SETTINGS_FILE}.backup.$(date +%Y%m%d_%H%M%S)"
49
+ cp "$SETTINGS_FILE" "$BACKUP_FILE"
50
+ echo " ✓ Backed up existing settings to: $BACKUP_FILE"
51
+
52
+ # Check if jq is available for merging
53
+ if command -v jq &> /dev/null; then
54
+ # Merge hooks into existing settings
55
+ HOOKS_JSON="${SCRIPT_DIR}/hooks/hooks.json"
56
+ TEMP_FILE=$(mktemp)
57
+
58
+ # Extract hooks from hooks.json and merge with existing settings
59
+ jq -s '.[0] * .[1]' "$SETTINGS_FILE" "$HOOKS_JSON" > "$TEMP_FILE"
60
+ mv "$TEMP_FILE" "$SETTINGS_FILE"
61
+ echo " ✓ Merged hooks into settings.json"
62
+ else
63
+ echo " ⚠ jq not found. Please manually merge hooks."
64
+ echo " Copy content from: ${SCRIPT_DIR}/hooks/hooks.json"
65
+ echo " Into: ${SETTINGS_FILE}"
66
+ fi
67
+ else
68
+ # Create new settings.json from hooks.json
69
+ cp "${SCRIPT_DIR}/hooks/hooks.json" "$SETTINGS_FILE"
70
+ echo " ✓ Created new settings.json"
71
+ fi
72
+
73
+ echo ""
74
+ echo "┌─────────────────────────────────────────────┐"
75
+ echo "│ Installation Complete! │"
76
+ echo "└─────────────────────────────────────────────┘"
77
+ echo ""
78
+ echo "Installed to: ${CLAUDE_HOME}/"
79
+ echo ""
80
+ echo "Structure:"
81
+ echo " ~/.claude/"
82
+ echo " ├── settings.json (hooks config)"
83
+ echo " ├── hooks/"
84
+ echo " │ ├── memory-persistence/"
85
+ echo " │ │ ├── pre-compact.sh"
86
+ echo " │ │ ├── session-start.sh"
87
+ echo " │ │ └── session-end.sh"
88
+ echo " │ └── strategic-compact/"
89
+ echo " │ └── suggest-compact.sh"
90
+ echo " ├── contexts/"
91
+ echo " │ ├── dev.md"
92
+ echo " │ ├── review.md"
93
+ echo " │ └── research.md"
94
+ echo " ├── sessions/ (auto-created logs)"
95
+ echo " └── skills/learned/ (for future use)"
96
+ echo ""
97
+ echo "Next steps:"
98
+ echo " 1. Restart Claude Code to activate hooks"
99
+ echo " 2. Use contexts by referencing them in prompts"
100
+ echo ""
@@ -0,0 +1,93 @@
1
+ # [MAY] Optimization Guide
2
+
3
+ > **Priority**: MAY - Optional
4
+ > **Apply when**: Basic functionality is stable
5
+
6
+ ## Efficiency Optimization
7
+
8
+ ### Parallel Processing
9
+ ```
10
+ Apply when:
11
+ - 3+ independent tasks
12
+ - Each task is I/O bound
13
+
14
+ Example:
15
+ - Read multiple files simultaneously
16
+ - Run independent searches in parallel
17
+ ```
18
+
19
+ ### Caching
20
+ ```
21
+ Apply when:
22
+ - Same data accessed repeatedly
23
+ - Data changes infrequently
24
+
25
+ Example:
26
+ - Cache file contents
27
+ - Reuse search results
28
+ ```
29
+
30
+ ### Lazy Loading
31
+ ```
32
+ Apply when:
33
+ - Large datasets
34
+ - Only portion actually used
35
+
36
+ Example:
37
+ - Read only needed files
38
+ - Stream results
39
+ ```
40
+
41
+ ## Token Optimization
42
+
43
+ ### Context Management
44
+ ```
45
+ ✓ Include only necessary info
46
+ ✓ Remove duplicates
47
+ ✓ Use summaries
48
+ ```
49
+
50
+ ### Response Optimization
51
+ ```
52
+ ✓ Concise expressions
53
+ ✓ Minimize code blocks
54
+ ✓ Remove unnecessary repetition
55
+ ```
56
+
57
+ ## Task Optimization
58
+
59
+ ### Batch Processing
60
+ ```
61
+ Group similar tasks together
62
+ Example: Edit 10 files → Process at once
63
+ ```
64
+
65
+ ### Incremental Processing
66
+ ```
67
+ Process only changed parts
68
+ Example: Full build → Incremental build
69
+ ```
70
+
71
+ ## Apply Criteria
72
+
73
+ ### Do Optimize
74
+ ```
75
+ ✓ Repetitive tasks
76
+ ✓ Clear performance bottleneck
77
+ ✓ Measurable improvement
78
+ ```
79
+
80
+ ### Don't Optimize
81
+ ```
82
+ ✗ One-time tasks
83
+ ✗ Already fast enough
84
+ ✗ Complexity increase outweighs benefit
85
+ ```
86
+
87
+ ## Caution
88
+
89
+ ```
90
+ ⚠ Premature optimization is root of evil
91
+ ⚠ Readability > Optimization
92
+ ⚠ No optimization without measurement
93
+ ```
@@ -0,0 +1,107 @@
1
+ # [MUST] Agent Design Rules
2
+
3
+ > **Priority**: MUST - Never violate
4
+ > **ID**: R006
5
+
6
+ ## Agent Structure
7
+
8
+ ### Required Files
9
+ ```
10
+ agents/{type}/{name}/
11
+ ├── AGENT.md # Agent definition (REQUIRED)
12
+ ├── index.yaml # Agent metadata (REQUIRED)
13
+ └── refs/ # Symlinks to guides/skills (OPTIONAL)
14
+ ```
15
+
16
+ ### AGENT.md Must NOT Contain
17
+ ```
18
+ ✗ Detailed skill instructions (use skills/ instead)
19
+ ✗ Reference documentation (use guides/ instead)
20
+ ✗ Implementation scripts (use skills/scripts/ instead)
21
+ ```
22
+
23
+ ### AGENT.md Should Contain
24
+ ```
25
+ ✓ Agent purpose and role
26
+ ✓ Capabilities overview (not details)
27
+ ✓ Required skills (by reference)
28
+ ✓ Workflow description
29
+ ✓ Source info (if external)
30
+ ```
31
+
32
+ ## External Agent Requirements
33
+
34
+ External agents (from GitHub, npm, etc.) MUST include:
35
+
36
+ ### index.yaml Fields
37
+ ```yaml
38
+ metadata:
39
+ name: agent-name
40
+ type: worker | orchestrator
41
+ source:
42
+ type: external
43
+ origin: github | npm | other
44
+ url: https://github.com/org/repo
45
+ version: 1.0.0
46
+ last_updated: 2025-01-22
47
+ update_command: "npx add-skill org/repo"
48
+ ```
49
+
50
+ ### Update Tracking
51
+ ```
52
+ - version: Current version installed
53
+ - last_updated: Date of last sync
54
+ - update_command: Command to update
55
+ - changelog_url: Where to check updates
56
+ ```
57
+
58
+ ## Separation of Concerns
59
+
60
+ ### agents/
61
+ ```
62
+ Purpose: Define WHAT the agent does
63
+ Content: Role, capabilities, workflow
64
+ NOT: How to do it (that's skills/)
65
+ ```
66
+
67
+ ### skills/
68
+ ```
69
+ Purpose: Define HOW to do tasks
70
+ Content: Instructions, scripts, rules
71
+ Location: skills/{category}/{name}/
72
+ ```
73
+
74
+ ### guides/
75
+ ```
76
+ Purpose: Reference documentation
77
+ Content: Best practices, tutorials
78
+ Location: guides/{topic}/
79
+ ```
80
+
81
+ ## Linking
82
+
83
+ ### Agent → Skills
84
+ ```yaml
85
+ # In AGENT.md or index.yaml
86
+ skills:
87
+ - category: development
88
+ name: react-best-practices
89
+ path: ../../../../skills/development/react-best-practices
90
+ ```
91
+
92
+ ### Agent → Guides
93
+ ```bash
94
+ # Symlink in refs/
95
+ ln -s ../../../../guides/web-design refs/web-design
96
+ ```
97
+
98
+ ## Naming Conventions
99
+
100
+ | Type | Pattern | Example |
101
+ |------|---------|---------|
102
+ | Agent folder | `kebab-case` | `vercel-agent` |
103
+ | Skill folder | `kebab-case` | `react-best-practices` |
104
+ | Guide folder | `kebab-case` | `web-design` |
105
+ | AGENT.md | UPPERCASE | `AGENT.md` |
106
+ | SKILL.md | UPPERCASE | `SKILL.md` |
107
+ | index.yaml | lowercase | `index.yaml` |
@@ -0,0 +1,108 @@
1
+ # [MUST] Agent Identification Rules
2
+
3
+ > **Priority**: MUST - ENFORCED, NO EXCEPTIONS
4
+ > **ID**: R007
5
+ > **Violation**: Immediate correction required
6
+
7
+ ## CRITICAL
8
+
9
+ **EVERY response MUST start with agent identification. This is NON-NEGOTIABLE.**
10
+
11
+ Failure to include agent identification = Rule violation = Must be corrected immediately.
12
+
13
+ ## Purpose
14
+
15
+ Display which agent is responding and which skills are being used for transparency and traceability.
16
+
17
+ ## Response Header Format
18
+
19
+ Every response MUST start with an agent identification block:
20
+
21
+ ```
22
+ ┌─ Agent: {agent-name} ({agent-type})
23
+ ├─ Skill: {skill-name} (if applicable)
24
+ └─ Task: {brief-task-description}
25
+ ```
26
+
27
+ ## Examples
28
+
29
+ ### Single Agent Response
30
+ ```
31
+ ┌─ Agent: creator (manager)
32
+ └─ Task: Creating new agent
33
+
34
+ [Response content...]
35
+ ```
36
+
37
+ ### With Skill Usage
38
+ ```
39
+ ┌─ Agent: vercel-agent (worker)
40
+ ├─ Skill: react-best-practices
41
+ └─ Task: Optimizing React component
42
+
43
+ [Response content...]
44
+ ```
45
+
46
+ ### Multiple Skills
47
+ ```
48
+ ┌─ Agent: vercel-agent (worker)
49
+ ├─ Skills: react-best-practices, web-design-guidelines
50
+ └─ Task: Full code review
51
+
52
+ [Response content...]
53
+ ```
54
+
55
+ ### No Specific Agent (Default)
56
+ ```
57
+ ┌─ Agent: claude (default)
58
+ └─ Task: General assistance
59
+
60
+ [Response content...]
61
+ ```
62
+
63
+ ## When to Display
64
+
65
+ | Situation | Display |
66
+ |-----------|---------|
67
+ | Agent-specific task | Full header with agent |
68
+ | Using skill | Include skill name |
69
+ | General conversation | "claude (default)" |
70
+ | Multiple agents | Show primary agent |
71
+
72
+ ## Agent Types
73
+
74
+ | Type | Symbol | Example |
75
+ |------|--------|---------|
76
+ | manager | 🔧 | creator, updater |
77
+ | worker | ⚙️ | vercel-agent |
78
+ | orchestrator | 🎯 | (future) |
79
+ | default | 💬 | claude |
80
+
81
+ ## Simplified Format (Optional)
82
+
83
+ For brief responses, use inline format:
84
+
85
+ ```
86
+ [creator] Creating agent structure...
87
+ ```
88
+
89
+ Or with skill:
90
+
91
+ ```
92
+ [vercel-agent → react-best-practices] Analyzing performance...
93
+ ```
94
+
95
+ ## Status Updates
96
+
97
+ During long tasks, show progress with agent context:
98
+
99
+ ```
100
+ ┌─ Agent: updater (manager)
101
+ └─ Task: Checking external updates
102
+
103
+ [Progress] Scanning agents/index.yaml (1/3)
104
+ [Progress] Scanning skills/index.yaml (2/3)
105
+ [Progress] Scanning guides/index.yaml (3/3)
106
+
107
+ [Done] Found 2 updates available
108
+ ```
@@ -0,0 +1,132 @@
1
+ # [MUST] Continuous Improvement Rules
2
+
3
+ > **Priority**: MUST - Top-level enforcement
4
+ > **ID**: R016
5
+ > **Trigger**: User points out rule violation
6
+
7
+ ## CRITICAL
8
+
9
+ **When user points out a rule violation, you MUST update the rules to prevent future violations BEFORE continuing with the task.**
10
+
11
+ ```
12
+ ╔══════════════════════════════════════════════════════════════════╗
13
+ ║ WHEN USER POINTS OUT A VIOLATION: ║
14
+ ║ ║
15
+ ║ 1. STOP current task immediately ║
16
+ ║ 2. UPDATE the relevant rule to be clearer/stronger ║
17
+ ║ 3. COMMIT the rule update ║
18
+ ║ 4. THEN continue with the original task ║
19
+ ║ ║
20
+ ║ DO NOT just apologize and continue. ║
21
+ ║ DO NOT promise to do better next time. ║
22
+ ║ ACTUALLY UPDATE THE RULES. ║
23
+ ╚══════════════════════════════════════════════════════════════════╝
24
+ ```
25
+
26
+ ## Workflow
27
+
28
+ ```
29
+ User points out violation
30
+
31
+
32
+ ┌─────────────────────────┐
33
+ │ 1. Acknowledge violation │
34
+ └───────────┬─────────────┘
35
+
36
+
37
+ ┌─────────────────────────┐
38
+ │ 2. Identify root cause │
39
+ │ - Which rule was weak?│
40
+ │ - What was unclear? │
41
+ └───────────┬─────────────┘
42
+
43
+
44
+ ┌─────────────────────────┐
45
+ │ 3. Update the rule │
46
+ │ - Add clarity │
47
+ │ - Add examples │
48
+ │ - Add self-checks │
49
+ └───────────┬─────────────┘
50
+
51
+
52
+ ┌─────────────────────────┐
53
+ │ 4. Commit the change │
54
+ └───────────┬─────────────┘
55
+
56
+
57
+ ┌─────────────────────────┐
58
+ │ 5. Continue original task│
59
+ │ (now following rules) │
60
+ └─────────────────────────┘
61
+ ```
62
+
63
+ ## Examples
64
+
65
+ ### Example 1: Parallel Execution Violation
66
+
67
+ ```
68
+ User: "병렬 실행을 안 지킨거 아닌가?"
69
+
70
+ WRONG Response:
71
+ "맞습니다, 죄송합니다. 다음부터 잘 지키겠습니다."
72
+ [continues task without updating rules]
73
+
74
+ CORRECT Response:
75
+ 1. "맞습니다. R009 위반입니다."
76
+ 2. [Updates MUST-parallel-execution.md with clearer guidance]
77
+ 3. [Commits the update]
78
+ 4. [Continues task with proper parallel execution]
79
+ ```
80
+
81
+ ### Example 2: Wrong Agent Used
82
+
83
+ ```
84
+ User: "creator 에이전트를 써야 하는거 아닌가?"
85
+
86
+ WRONG Response:
87
+ "맞습니다. creator를 사용하겠습니다."
88
+ [continues without updating rules]
89
+
90
+ CORRECT Response:
91
+ 1. "맞습니다. R010 위반입니다."
92
+ 2. [Updates relevant rules to clarify agent delegation]
93
+ 3. [Commits the update]
94
+ 4. [Continues with proper agent delegation]
95
+ ```
96
+
97
+ ## Why This Matters
98
+
99
+ ```
100
+ Without rule updates:
101
+ Violation → Apology → Same mistake later → Apology → ...
102
+
103
+ With rule updates:
104
+ Violation → Rule improvement → Better behavior → Learning preserved
105
+ ```
106
+
107
+ 1. **Institutional Memory**: Rules capture learnings permanently
108
+ 2. **Prevents Recurrence**: Clearer rules = fewer future violations
109
+ 3. **Continuous Improvement**: System gets better over time
110
+ 4. **Accountability**: Actions, not just words
111
+
112
+ ## Integration with Other Rules
113
+
114
+ This rule takes precedence when violations are pointed out:
115
+
116
+ | Situation | Action |
117
+ |-----------|--------|
118
+ | User points out violation | STOP → Update rule → Continue |
119
+ | Self-detected violation | Fix immediately, consider rule update |
120
+ | Ambiguous situation | Ask user, then update if needed |
121
+
122
+ ## Enforcement
123
+
124
+ ```
125
+ Violation of this rule = Ignoring user feedback = Unacceptable
126
+
127
+ When caught violating this rule:
128
+ 1. Stop immediately
129
+ 2. Update THIS rule to be even clearer
130
+ 3. Update the ORIGINAL violated rule
131
+ 4. Continue with proper behavior
132
+ ```