oh-my-codex-cli 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 (292) hide show
  1. package/.agent/skills/agent-kb/HOW_TO_USE.md +428 -0
  2. package/.agent/skills/agent-kb/README.md +46 -0
  3. package/.agent/skills/agent-kb/SKILL.md +128 -0
  4. package/.agent/skills/agent-kb/references/intelligent-analysis-explained.md +333 -0
  5. package/.agent/skills/agent-kb/references/query-optimization.md +225 -0
  6. package/.agent/skills/aireview/SKILL.md +704 -0
  7. package/.agent/skills/analyze/SKILL.md +81 -0
  8. package/.agent/skills/architect-planner/HOW_TO_USE.md +238 -0
  9. package/.agent/skills/architect-planner/README.md +41 -0
  10. package/.agent/skills/architect-planner/SKILL.md +539 -0
  11. package/.agent/skills/auto-mbti/SKILL.md +291 -0
  12. package/.agent/skills/autopilot/SKILL.md +222 -0
  13. package/.agent/skills/backend-patterns/SKILL.md +602 -0
  14. package/.agent/skills/bdd-generator/README.md +78 -0
  15. package/.agent/skills/bdd-generator/SKILL.md +436 -0
  16. package/.agent/skills/brainstorming/HOW_TO_USE.md +289 -0
  17. package/.agent/skills/brainstorming/README.md +41 -0
  18. package/.agent/skills/brainstorming/SKILL.md +165 -0
  19. package/.agent/skills/build-fix/SKILL.md +190 -0
  20. package/.agent/skills/cancel/SKILL.md +658 -0
  21. package/.agent/skills/checkpoint/SKILL.md +94 -0
  22. package/.agent/skills/code-review/SKILL.md +273 -0
  23. package/.agent/skills/coding-standards/SKILL.md +535 -0
  24. package/.agent/skills/conductor/SKILL.md +128 -0
  25. package/.agent/skills/conductor/commands/conductor/implement.toml +358 -0
  26. package/.agent/skills/conductor/commands/conductor/newTrack.toml +142 -0
  27. package/.agent/skills/conductor/commands/conductor/revert.toml +123 -0
  28. package/.agent/skills/conductor/commands/conductor/setup.toml +429 -0
  29. package/.agent/skills/conductor/commands/conductor/status.toml +57 -0
  30. package/.agent/skills/conductor/scripts/install.sh +89 -0
  31. package/.agent/skills/conductor/templates/code_styleguides/csharp.md +115 -0
  32. package/.agent/skills/conductor/templates/code_styleguides/dart.md +238 -0
  33. package/.agent/skills/conductor/templates/code_styleguides/general.md +23 -0
  34. package/.agent/skills/conductor/templates/code_styleguides/go.md +48 -0
  35. package/.agent/skills/conductor/templates/code_styleguides/html-css.md +49 -0
  36. package/.agent/skills/conductor/templates/code_styleguides/javascript.md +51 -0
  37. package/.agent/skills/conductor/templates/code_styleguides/python.md +37 -0
  38. package/.agent/skills/conductor/templates/code_styleguides/typescript.md +43 -0
  39. package/.agent/skills/conductor/templates/rules/README.md +23 -0
  40. package/.agent/skills/conductor/templates/rules/agents.md +49 -0
  41. package/.agent/skills/conductor/templates/rules/coding-style.md +70 -0
  42. package/.agent/skills/conductor/templates/rules/dev.md +20 -0
  43. package/.agent/skills/conductor/templates/rules/git-workflow.md +45 -0
  44. package/.agent/skills/conductor/templates/rules/hooks.md +6 -0
  45. package/.agent/skills/conductor/templates/rules/patterns.md +55 -0
  46. package/.agent/skills/conductor/templates/rules/performance.md +47 -0
  47. package/.agent/skills/conductor/templates/rules/research.md +26 -0
  48. package/.agent/skills/conductor/templates/rules/review.md +22 -0
  49. package/.agent/skills/conductor/templates/rules/security.md +36 -0
  50. package/.agent/skills/conductor/templates/rules/testing.md +30 -0
  51. package/.agent/skills/conductor/templates/workflow.md +333 -0
  52. package/.agent/skills/consensus/HOW_TO_USE.md +191 -0
  53. package/.agent/skills/consensus/README.md +41 -0
  54. package/.agent/skills/consensus/SKILL.md +317 -0
  55. package/.agent/skills/content-research-writer/SKILL.md +537 -0
  56. package/.agent/skills/debug-analysis/SKILL.md +331 -0
  57. package/.agent/skills/deepinit/SKILL.md +347 -0
  58. package/.agent/skills/deepsearch/SKILL.md +56 -0
  59. package/.agent/skills/doctor/SKILL.md +158 -0
  60. package/.agent/skills/drawio/EXAMPLES.md +382 -0
  61. package/.agent/skills/drawio/QUICK_START.md +237 -0
  62. package/.agent/skills/drawio/README.md +315 -0
  63. package/.agent/skills/drawio/SETUP_GUIDE.md +254 -0
  64. package/.agent/skills/drawio/SKILL.md +1176 -0
  65. package/.agent/skills/e2e/SKILL.md +396 -0
  66. package/.agent/skills/ecomode/SKILL.md +160 -0
  67. package/.agent/skills/electron-driver/SKILL.md +144 -0
  68. package/.agent/skills/electron-driver/scripts/driver-template.js +71 -0
  69. package/.agent/skills/eval/SKILL.md +140 -0
  70. package/.agent/skills/eval-harness/SKILL.md +242 -0
  71. package/.agent/skills/evolve/SKILL.md +213 -0
  72. package/.agent/skills/frontend-design/SKILL.md +42 -0
  73. package/.agent/skills/frontend-patterns/SKILL.md +646 -0
  74. package/.agent/skills/frontend-ui-ux/SKILL.md +70 -0
  75. package/.agent/skills/git-master/SKILL.md +75 -0
  76. package/.agent/skills/help/SKILL.md +89 -0
  77. package/.agent/skills/iterative-retrieval/SKILL.md +217 -0
  78. package/.agent/skills/local-skills-setup/SKILL.md +483 -0
  79. package/.agent/skills/log-analyzer/SKILL.md +187 -0
  80. package/.agent/skills/mcp-setup/SKILL.md +226 -0
  81. package/.agent/skills/multi-model-research/HOW_TO_USE.md +614 -0
  82. package/.agent/skills/multi-model-research/README.md +233 -0
  83. package/.agent/skills/multi-model-research/SKILL.md +541 -0
  84. package/.agent/skills/multi-model-research/references/troubleshooting.md +415 -0
  85. package/.agent/skills/note/SKILL.md +80 -0
  86. package/.agent/skills/omc-setup/SKILL.md +219 -0
  87. package/.agent/skills/orchestrate/SKILL.md +620 -0
  88. package/.agent/skills/patent-workflow/IMPLEMENTATION_SUMMARY.md +500 -0
  89. package/.agent/skills/patent-workflow/README.md +455 -0
  90. package/.agent/skills/patent-workflow/SKILL.md +1036 -0
  91. package/.agent/skills/patent-workflow/tools/irr_checker.py +260 -0
  92. package/.agent/skills/patent-workflow/tools/sample_terminology.json +49 -0
  93. package/.agent/skills/patent-workflow/tools/term_checker.py +355 -0
  94. package/.agent/skills/pattern-recognition/SKILL.md +792 -0
  95. package/.agent/skills/pipeline/SKILL.md +448 -0
  96. package/.agent/skills/plan/SKILL.md +309 -0
  97. package/.agent/skills/planning-methodology/SKILL.md +370 -0
  98. package/.agent/skills/planning-with-files/SKILL.md +210 -0
  99. package/.agent/skills/planning-with-files/examples.md +202 -0
  100. package/.agent/skills/planning-with-files/reference.md +218 -0
  101. package/.agent/skills/planning-with-files/scripts/check-complete.ps1 +42 -0
  102. package/.agent/skills/planning-with-files/scripts/check-complete.sh +44 -0
  103. package/.agent/skills/planning-with-files/scripts/init-session.ps1 +120 -0
  104. package/.agent/skills/planning-with-files/scripts/init-session.sh +120 -0
  105. package/.agent/skills/planning-with-files/scripts/session-catchup.py +208 -0
  106. package/.agent/skills/planning-with-files/templates/findings.md +95 -0
  107. package/.agent/skills/planning-with-files/templates/progress.md +114 -0
  108. package/.agent/skills/planning-with-files/templates/task_plan.md +132 -0
  109. package/.agent/skills/project-analyze/CLAUDE.md +18 -0
  110. package/.agent/skills/project-analyze/HOW_TO_USE.md +145 -0
  111. package/.agent/skills/project-analyze/README.md +42 -0
  112. package/.agent/skills/project-analyze/SKILL.md +289 -0
  113. package/.agent/skills/project-analyze/SKILL.md.backup +287 -0
  114. package/.agent/skills/project-analyze/SKILL.md.backup_20260105_093646 +287 -0
  115. package/.agent/skills/project-analyze/assets/analysis-report-template.md +433 -0
  116. package/.agent/skills/project-analyze/references/analysis-patterns.md +422 -0
  117. package/.agent/skills/project-analyze/references/projectmind-explained.md +535 -0
  118. package/.agent/skills/project-session-manager/SKILL.md +428 -0
  119. package/.agent/skills/project-session-manager/lib/config.sh +86 -0
  120. package/.agent/skills/project-session-manager/lib/parse.sh +121 -0
  121. package/.agent/skills/project-session-manager/lib/session.sh +132 -0
  122. package/.agent/skills/project-session-manager/lib/tmux.sh +103 -0
  123. package/.agent/skills/project-session-manager/lib/worktree.sh +171 -0
  124. package/.agent/skills/project-session-manager/psm.sh +629 -0
  125. package/.agent/skills/project-session-manager/templates/feature.md +56 -0
  126. package/.agent/skills/project-session-manager/templates/issue-fix.md +57 -0
  127. package/.agent/skills/project-session-manager/templates/pr-review.md +65 -0
  128. package/.agent/skills/project-session-manager/templates/projects.json +19 -0
  129. package/.agent/skills/quality-check/HOW_TO_USE.md +171 -0
  130. package/.agent/skills/quality-check/README.md +50 -0
  131. package/.agent/skills/quality-check/SKILL.md +240 -0
  132. package/.agent/skills/quality-check/SKILL.md.backup +238 -0
  133. package/.agent/skills/quality-check/SKILL.md.backup_20260105_093646 +238 -0
  134. package/.agent/skills/quality-check/assets/quality-report-template.md +437 -0
  135. package/.agent/skills/quality-check/references/refactoring-patterns.md +550 -0
  136. package/.agent/skills/quality-check/references/scoring-criteria.md +454 -0
  137. package/.agent/skills/quality-validation/SKILL.md +519 -0
  138. package/.agent/skills/quality-validation/SKILL.md.backup +573 -0
  139. package/.agent/skills/quality-validation/SKILL.md.backup_20260105_093646 +573 -0
  140. package/.agent/skills/ralph/SKILL.md +236 -0
  141. package/.agent/skills/ralph-init/SKILL.md +78 -0
  142. package/.agent/skills/ralplan/SKILL.md +58 -0
  143. package/.agent/skills/refactor-clean/SKILL.md +49 -0
  144. package/.agent/skills/release/SKILL.md +84 -0
  145. package/.agent/skills/research/SKILL.md +526 -0
  146. package/.agent/skills/research-methodology/SKILL.md +268 -0
  147. package/.agent/skills/review/SKILL.md +53 -0
  148. package/.agent/skills/security-review/SKILL.md +509 -0
  149. package/.agent/skills/security-review/cloud-infrastructure-security.md +361 -0
  150. package/.agent/skills/setup-pm/SKILL.md +102 -0
  151. package/.agent/skills/skill/SKILL.md +424 -0
  152. package/.agent/skills/skill-create/SKILL.md +209 -0
  153. package/.agent/skills/skill-debugger/HOW_TO_USE.md +244 -0
  154. package/.agent/skills/skill-debugger/README.md +44 -0
  155. package/.agent/skills/skill-debugger/SKILL.md +326 -0
  156. package/.agent/skills/skill-debugger/diagnostic_checklist.md +115 -0
  157. package/.agent/skills/skill-development/SKILL.md +661 -0
  158. package/.agent/skills/skill-development/references/skill-creator-original.md +209 -0
  159. package/.agent/skills/skill-doc-generator/README.md +37 -0
  160. package/.agent/skills/skill-doc-generator/SKILL.md +331 -0
  161. package/.agent/skills/skill-quality-analyzer/HOW_TO_USE.md +243 -0
  162. package/.agent/skills/skill-quality-analyzer/README.md +61 -0
  163. package/.agent/skills/skill-quality-analyzer/SKILL.md +247 -0
  164. package/.agent/skills/skill-quality-analyzer/analyzer.py +209 -0
  165. package/.agent/skills/skill-quality-analyzer/expected_output.json +81 -0
  166. package/.agent/skills/skill-quality-analyzer/sample_input.json +9 -0
  167. package/.agent/skills/skill-tester/README.md +46 -0
  168. package/.agent/skills/skill-tester/SKILL.md +345 -0
  169. package/.agent/skills/start-dev/SKILL.md +701 -0
  170. package/.agent/skills/swarm/SKILL.md +691 -0
  171. package/.agent/skills/task-kb-lookup/SKILL.md +211 -0
  172. package/.agent/skills/task-kb-record/SKILL.md +417 -0
  173. package/.agent/skills/tdd/SKILL.md +446 -0
  174. package/.agent/skills/tdd-generator/DEMO.md +516 -0
  175. package/.agent/skills/tdd-generator/README.md +89 -0
  176. package/.agent/skills/tdd-generator/SKILL.md +278 -0
  177. package/.agent/skills/tdd-workflow/SKILL.md +424 -0
  178. package/.agent/skills/test-coverage/SKILL.md +48 -0
  179. package/.agent/skills/thinkdeep/HOW_TO_USE.md +183 -0
  180. package/.agent/skills/thinkdeep/README.md +41 -0
  181. package/.agent/skills/thinkdeep/SKILL.md +343 -0
  182. package/.agent/skills/ui-ux-pro-max/SKILL.md +228 -0
  183. package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  184. package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  185. package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  186. package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  187. package/.agent/skills/ui-ux-pro-max/data/prompts.csv +24 -0
  188. package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  189. package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  190. package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  191. package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  192. package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  193. package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  194. package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  195. package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  196. package/.agent/skills/ui-ux-pro-max/data/styles.csv +59 -0
  197. package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  198. package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  199. package/.agent/skills/ui-ux-pro-max/scripts/core.py +236 -0
  200. package/.agent/skills/ui-ux-pro-max/scripts/search.py +61 -0
  201. package/.agent/skills/ultrapilot/SKILL.md +647 -0
  202. package/.agent/skills/ultraqa/SKILL.md +152 -0
  203. package/.agent/skills/ultrawork/SKILL.md +123 -0
  204. package/.agent/skills/update-codemaps/SKILL.md +38 -0
  205. package/.agent/skills/update-docs/SKILL.md +52 -0
  206. package/.agent/skills/verification-loop/SKILL.md +140 -0
  207. package/.agent/skills/verify/SKILL.md +80 -0
  208. package/.agent/skills/writer-memory/SKILL.md +459 -0
  209. package/.agent/skills/writer-memory/lib/character-tracker.ts +338 -0
  210. package/.agent/skills/writer-memory/lib/memory-manager.ts +804 -0
  211. package/.agent/skills/writer-memory/lib/relationship-graph.ts +400 -0
  212. package/.agent/skills/writer-memory/lib/scene-organizer.ts +544 -0
  213. package/.agent/skills/writer-memory/lib/synopsis-builder.ts +339 -0
  214. package/.agent/skills/writer-memory/templates/synopsis-template.md +46 -0
  215. package/.governance/skill-lint.allowlist +4 -0
  216. package/.governance/skill-llm.allowlist +4 -0
  217. package/AGENTS.md +59 -0
  218. package/LICENSE +21 -0
  219. package/README.md +169 -0
  220. package/README.zh.md +145 -0
  221. package/bin/omcodex.js +8 -0
  222. package/commands/conductor/implement.toml +358 -0
  223. package/commands/conductor/newTrack.toml +142 -0
  224. package/commands/conductor/revert.toml +123 -0
  225. package/commands/conductor/setup.toml +429 -0
  226. package/commands/conductor/status.toml +57 -0
  227. package/docs/ALIGNMENT.md +40 -0
  228. package/docs/CODEX.md +133 -0
  229. package/docs/NOTIFY.md +81 -0
  230. package/docs/SKILL_GOVERNANCE.md +72 -0
  231. package/docs/SKILL_GOVERNANCE_FRAMEWORK.md +182 -0
  232. package/docs/SKILL_GOVERNANCE_FRAMEWORK.zh.md +170 -0
  233. package/package.json +50 -0
  234. package/prompts/architect.md +105 -0
  235. package/prompts/executor.md +134 -0
  236. package/prompts/planner.md +113 -0
  237. package/scripts/check-skill-governance.sh +84 -0
  238. package/scripts/check-skill-llm-governance.js +302 -0
  239. package/scripts/eval-skills.js +217 -0
  240. package/scripts/generate-catalog-docs.js +95 -0
  241. package/scripts/generate-codex-mcp-config.sh +22 -0
  242. package/scripts/install-codex-force.sh +5 -0
  243. package/scripts/install-codex-incremental.sh +5 -0
  244. package/scripts/install-codex.sh +79 -0
  245. package/scripts/notify-dispatch.js +15 -0
  246. package/scripts/setup-package-manager.js +137 -0
  247. package/src/catalog/generated/public-catalog.json +547 -0
  248. package/src/catalog/manifest.json +542 -0
  249. package/src/catalog/reader.js +43 -0
  250. package/src/catalog/schema.js +79 -0
  251. package/src/cli/doctor.js +62 -0
  252. package/src/cli/index.js +85 -0
  253. package/src/cli/notify.js +127 -0
  254. package/src/cli/route.js +43 -0
  255. package/src/cli/setup.js +155 -0
  256. package/src/cli/team.js +125 -0
  257. package/src/config/generator.js +119 -0
  258. package/src/mcp/memory-server.js +241 -0
  259. package/src/mcp/state-server.js +112 -0
  260. package/src/mcp/trace-server.js +168 -0
  261. package/src/notify/dispatch.js +74 -0
  262. package/src/notify/extensibility/dispatcher.js +113 -0
  263. package/src/notify/extensibility/events.js +15 -0
  264. package/src/notify/extensibility/loader.js +54 -0
  265. package/src/router/skill-router.js +90 -0
  266. package/src/team/auto-advance.js +72 -0
  267. package/src/team/orchestrator.js +82 -0
  268. package/src/team/state-store.js +33 -0
  269. package/src/utils/paths.js +33 -0
  270. package/templates/AGENTS.md +15 -0
  271. package/templates/catalog-manifest.json +542 -0
  272. package/templates/code_styleguides/csharp.md +115 -0
  273. package/templates/code_styleguides/dart.md +238 -0
  274. package/templates/code_styleguides/general.md +23 -0
  275. package/templates/code_styleguides/go.md +48 -0
  276. package/templates/code_styleguides/html-css.md +49 -0
  277. package/templates/code_styleguides/javascript.md +51 -0
  278. package/templates/code_styleguides/python.md +37 -0
  279. package/templates/code_styleguides/typescript.md +43 -0
  280. package/templates/rules/README.md +23 -0
  281. package/templates/rules/agents.md +49 -0
  282. package/templates/rules/coding-style.md +70 -0
  283. package/templates/rules/dev.md +20 -0
  284. package/templates/rules/git-workflow.md +45 -0
  285. package/templates/rules/notify.md +6 -0
  286. package/templates/rules/patterns.md +55 -0
  287. package/templates/rules/performance.md +47 -0
  288. package/templates/rules/research.md +26 -0
  289. package/templates/rules/review.md +22 -0
  290. package/templates/rules/security.md +36 -0
  291. package/templates/rules/testing.md +30 -0
  292. package/templates/workflow.md +333 -0
@@ -0,0 +1,333 @@
1
+ # Intelligent Analysis System - Technical Details
2
+
3
+ ## Architecture Overview
4
+
5
+ ```
6
+ User Query
7
+
8
+ ├─→ Semantic Search (~/Agent-KB/claude_kb_query_optimized.py)
9
+ │ ├─ Vector database query
10
+ │ ├─ Keyword matching
11
+ │ └─ Similarity ranking
12
+ │ ↓
13
+ ├─→ Retrieve Top Cases (Top 10-20 matches)
14
+ │ ↓
15
+ ├─→ Local LLM Analysis (~/Agent-KB/intelligent_summarizer.py)
16
+ │ ├─ Context understanding
17
+ │ ├─ Pattern extraction
18
+ │ ├─ Insight synthesis
19
+ │ └─ Recommendation generation
20
+ │ ↓
21
+ └─→ 400-Word Summary
22
+ ├─ Core recommendations
23
+ ├─ Quantitative metrics
24
+ ├─ Common pitfalls
25
+ ├─ Best practices
26
+ └─ Related topics
27
+ ```
28
+
29
+ ## Two-Tier System
30
+
31
+ ### Tier 1: Optimized Query (Fallback)
32
+
33
+ **Script**: `claude_kb_query_optimized.py`
34
+
35
+ **What it does**:
36
+ - Semantic search across 300+ cases
37
+ - Returns raw case content (2500+ words)
38
+ - No LLM processing
39
+ - Fast but verbose
40
+
41
+ **When to use**:
42
+ - Need complete case details
43
+ - `intelligent_summarizer.py` times out
44
+ - Want to see original expert responses
45
+
46
+ ### Tier 2: Intelligent Summarization (Primary)
47
+
48
+ **Script**: `intelligent_summarizer.py`
49
+
50
+ **What it does**:
51
+ - Calls `claude_kb_query_optimized.py` for retrieval
52
+ - Processes results with local LLM
53
+ - Synthesizes into 400-word summary
54
+ - Adds confidence scores and metrics
55
+
56
+ **Benefits**:
57
+ - 83% context reduction (2500+ → 400 words)
58
+ - Actionable insights extracted
59
+ - Patterns identified across cases
60
+ - Confidence levels added
61
+
62
+ ## LLM Analysis Process
63
+
64
+ ### Step 1: Context Understanding
65
+
66
+ LLM analyzes query intent:
67
+ ```
68
+ Query: "How to optimize React list rendering?"
69
+
70
+ Intent detected:
71
+ - Domain: Frontend performance
72
+ - Technology: React
73
+ - Problem: Rendering efficiency
74
+ - Scale: Lists (likely large)
75
+ ```
76
+
77
+ ### Step 2: Case Relevance Filtering
78
+
79
+ LLM filters retrieved cases:
80
+ ```
81
+ 10 cases retrieved
82
+
83
+ 7 cases relevant (React performance)
84
+
85
+ 5 cases highly relevant (list rendering)
86
+
87
+ 3 cases with metrics (quantified improvements)
88
+ ```
89
+
90
+ ### Step 3: Pattern Extraction
91
+
92
+ LLM identifies common patterns:
93
+ ```
94
+ Pattern 1: Memoization (React.memo, useMemo, useCallback)
95
+ - Frequency: 5/5 cases
96
+ - Confidence: Very High
97
+
98
+ Pattern 2: Virtualization (react-window, react-virtualized)
99
+ - Frequency: 4/5 cases
100
+ - Confidence: High
101
+
102
+ Pattern 3: Pagination/Infinite Scroll
103
+ - Frequency: 3/5 cases
104
+ - Confidence: Medium
105
+ ```
106
+
107
+ ### Step 4: Insight Synthesis
108
+
109
+ LLM synthesizes recommendations:
110
+ ```
111
+ Primary recommendation: React.memo + useMemo for expensive computations
112
+ Supporting data: 60-80% re-render reduction (from cases)
113
+ Confidence: High (consistent across 5 cases)
114
+
115
+ Secondary recommendation: Virtualization for 1000+ items
116
+ Supporting data: 95%+ performance gain (from 4 cases)
117
+ Confidence: High
118
+
119
+ Tertiary recommendation: Pagination/infinite scroll
120
+ Supporting data: User experience trade-off
121
+ Confidence: Medium (depends on use case)
122
+ ```
123
+
124
+ ### Step 5: Output Generation
125
+
126
+ LLM generates structured output:
127
+ ```markdown
128
+ ### Core Recommendations
129
+ 1. Use React.memo for expensive components
130
+ 2. useMemo for heavy computations
131
+ 3. Virtualization (react-window) for 1000+ items
132
+
133
+ ### Quantitative Metrics
134
+ - React.memo: 60-80% re-render reduction
135
+ - useMemo: 40-70% computation time savings
136
+ - Virtualization: 95%+ performance gain for large lists
137
+
138
+ ### Common Pitfalls
139
+ - Over-memoization adds complexity
140
+ - Missing dependencies in useMemo/useCallback
141
+ - Premature optimization
142
+
143
+ ### Best Practices
144
+ 1. Profile with React DevTools first
145
+ 2. Measure before/after impact
146
+ 3. Focus on frequently re-rendering components
147
+ ```
148
+
149
+ ## Context Optimization Details
150
+
151
+ ### Token Reduction Strategy
152
+
153
+ **Before optimization**:
154
+ ```
155
+ 10 cases × 250 words = 2500 words
156
+ Token count: ~3000 tokens
157
+ Reading time: 10 minutes
158
+ ```
159
+
160
+ **After optimization**:
161
+ ```
162
+ Synthesized summary: 400 words
163
+ Token count: ~500 tokens (83% reduction)
164
+ Reading time: 2 minutes
165
+ ```
166
+
167
+ ### Information Preservation
168
+
169
+ **What's kept**:
170
+ - Actionable recommendations (100%)
171
+ - Quantitative metrics (100%)
172
+ - Common patterns (100%)
173
+ - Best practices (100%)
174
+
175
+ **What's removed**:
176
+ - Duplicate information across cases
177
+ - Verbose explanations
178
+ - Context-specific details not applicable to query
179
+ - Preamble and conclusions
180
+
181
+ ## Confidence Scoring
182
+
183
+ ### Confidence Levels
184
+
185
+ **Very High (90-100%)**:
186
+ - Recommendation appears in 80%+ of cases
187
+ - Consistent metrics across cases
188
+ - No contradictory information
189
+ - Example: "Use Redis for caching" (95% confidence)
190
+
191
+ **High (75-89%)**:
192
+ - Recommendation in 60-79% of cases
193
+ - Mostly consistent metrics
194
+ - Minor variations explained
195
+ - Example: "PostgreSQL for transactional data" (80% confidence)
196
+
197
+ **Medium (50-74%)**:
198
+ - Recommendation in 40-59% of cases
199
+ - Some contradictory evidence
200
+ - Context-dependent
201
+ - Example: "Microservices for team of 20" (60% confidence)
202
+
203
+ **Low (<50%)**:
204
+ - Limited case coverage
205
+ - Significant contradictory information
206
+ - Highly context-dependent
207
+ - Example: "NoSQL for all use cases" (30% confidence)
208
+
209
+ ### Confidence Calculation
210
+
211
+ ```
212
+ Confidence Score = (
213
+ Frequency Score (40%) +
214
+ Consistency Score (30%) +
215
+ Metric Quality Score (20%) +
216
+ Recency Score (10%)
217
+ )
218
+
219
+ Frequency Score = cases_with_recommendation / total_relevant_cases
220
+ Consistency Score = 1 - (std_dev of metrics / mean)
221
+ Metric Quality Score = cases_with_quantified_results / total_cases
222
+ Recency Score = weighted by case timestamp (recent cases weighted higher)
223
+ ```
224
+
225
+ ## Performance Characteristics
226
+
227
+ ### Cold Query (First Time)
228
+
229
+ ```
230
+ Semantic search: 5s
231
+ LLM analysis: 3s
232
+ Total: ~8s
233
+ ```
234
+
235
+ ### Cached Query (Repeated)
236
+
237
+ ```
238
+ Cache lookup: 0.001s
239
+ Total: ~0.001s (8000x faster)
240
+ ```
241
+
242
+ ### Cache Hit Rate
243
+
244
+ ```
245
+ Common questions (10%): ~100% hit rate
246
+ Similar questions (30%): ~80% hit rate (partial match)
247
+ Novel questions (60%): 0% hit rate (cold query)
248
+
249
+ Overall hit rate: ~35% (gradually increasing)
250
+ ```
251
+
252
+ ## Knowledge Base Coverage
253
+
254
+ ### Domain Distribution
255
+
256
+ ```
257
+ Frontend (40%):
258
+ - React/Vue/Angular performance
259
+ - State management patterns
260
+ - Component design
261
+ - Build optimization
262
+
263
+ Backend (30%):
264
+ - API design (REST, GraphQL)
265
+ - Database optimization
266
+ - Microservices patterns
267
+ - Authentication/authorization
268
+
269
+ Database (15%):
270
+ - SQL query optimization
271
+ - NoSQL data modeling
272
+ - Indexing strategies
273
+ - Replication/sharding
274
+
275
+ Architecture (10%):
276
+ - System design patterns
277
+ - Scalability strategies
278
+ - Distributed systems
279
+ - Event-driven architecture
280
+
281
+ DevOps (5%):
282
+ - CI/CD pipelines
283
+ - Deployment strategies
284
+ - Monitoring/alerting
285
+ - Infrastructure as code
286
+ ```
287
+
288
+ ### Quality Metrics
289
+
290
+ ```
291
+ Cases with quantitative metrics: 70%
292
+ Cases with code examples: 60%
293
+ Cases with failure analysis: 50%
294
+ Cases updated in last 6 months: 40%
295
+ ```
296
+
297
+ ## Limitations
298
+
299
+ ### What It Does Well ✅
300
+
301
+ - Common patterns and best practices
302
+ - Performance optimization advice
303
+ - Technology trade-off analysis
304
+ - Well-covered domains (React, Node.js, PostgreSQL)
305
+
306
+ ### What It Struggles With ❌
307
+
308
+ - Very new technologies (<6 months old)
309
+ - Niche use cases with few cases
310
+ - Highly context-specific problems
311
+ - Bleeding-edge experimental techniques
312
+
313
+ ### When to Complement with Other Skills
314
+
315
+ **Use agent-kb + multi-model-research when**:
316
+ - Need current technology analysis (agent-kb is historical)
317
+ - Want fresh perspectives + validated patterns
318
+ - Critical decision needing multiple viewpoints
319
+
320
+ **Use agent-kb + thinkdeep when**:
321
+ - Need deep reasoning beyond historical cases
322
+ - Novel problem without precedent
323
+ - Complex trade-off analysis
324
+
325
+ ## Future Enhancements
326
+
327
+ ### Planned Improvements
328
+
329
+ 1. **Real-time case updates**: Auto-import from Agent-KB records
330
+ 2. **Confidence trending**: Track how confidence changes over time
331
+ 3. **Case quality scoring**: Prioritize high-quality cases
332
+ 4. **Hybrid retrieval**: Combine semantic + keyword search
333
+ 5. **User feedback loop**: Learn from query refinements
@@ -0,0 +1,225 @@
1
+ # Agent-KB Query Optimization Guide
2
+
3
+ ## Query Formulation Best Practices
4
+
5
+ ### Include Specific Context
6
+
7
+ **Good queries** ✅:
8
+ ```
9
+ "How to optimize PostgreSQL queries with 10M+ rows and complex joins?"
10
+ "React performance optimization for list with 10,000+ items and frequent updates"
11
+ "Microservices communication pattern for 50+ services with event sourcing"
12
+ ```
13
+
14
+ **Poor queries** ❌:
15
+ ```
16
+ "Optimize database"
17
+ "React performance"
18
+ "Microservices pattern"
19
+ ```
20
+
21
+ ### Use Domain-Specific Keywords
22
+
23
+ **Technology stack**:
24
+ - Languages: JavaScript, TypeScript, Python, Go, Rust
25
+ - Frameworks: React, Vue, Express, Django, Spring Boot
26
+ - Databases: PostgreSQL, MongoDB, Redis, Cassandra
27
+ - Infrastructure: Kubernetes, Docker, AWS, GCP
28
+
29
+ **Problem domain**:
30
+ - Performance, scalability, security
31
+ - Real-time, batch processing, stream processing
32
+ - Microservices, monolith, serverless
33
+
34
+ **Constraints**:
35
+ - User scale (100k, 1M, 10M users)
36
+ - Data volume (1GB, 100GB, 10TB)
37
+ - Latency requirements (<100ms, <1s)
38
+ - Team size (5, 20, 100 developers)
39
+
40
+ ## Query Patterns
41
+
42
+ ### Pattern 1: "How to" Questions
43
+
44
+ ```
45
+ "How to [action] [technology] for [use case] with [constraints]?"
46
+ ```
47
+
48
+ **Examples**:
49
+ - "How to scale Redis cluster for 1M concurrent connections with <10ms latency?"
50
+ - "How to implement GraphQL subscriptions in Node.js for real-time dashboard with 50k clients?"
51
+
52
+ ### Pattern 2: Comparison Questions
53
+
54
+ ```
55
+ "[Technology A] vs [Technology B] for [use case] - pros/cons?"
56
+ ```
57
+
58
+ **Examples**:
59
+ - "PostgreSQL vs MongoDB for product catalog with complex filtering - trade-offs?"
60
+ - "REST vs GraphQL for mobile app with 50+ API endpoints?"
61
+
62
+ ### Pattern 3: Best Practice Questions
63
+
64
+ ```
65
+ "Best practices for [technology/pattern] in [context]?"
66
+ ```
67
+
68
+ **Examples**:
69
+ - "Best practices for error handling in microservices with async communication?"
70
+ - "Code organization best practices for React app with 100+ components?"
71
+
72
+ ## Cache Behavior
73
+
74
+ ### When Queries Are Cached
75
+
76
+ - **Exact match**: Same query text (case-sensitive)
77
+ - **Cache duration**: Indefinite (until manual clear)
78
+ - **Cache location**: `~/Agent-KB/.cache/`
79
+ - **Cache hit**: ~0.001s response time
80
+
81
+ ### When to Clear Cache
82
+
83
+ ```bash
84
+ rm -rf ~/Agent-KB/.cache/
85
+ ```
86
+
87
+ **Clear when**:
88
+ - Query should reflect updated knowledge base
89
+ - Corrupted cache entries
90
+ - Testing new query formulations
91
+
92
+ ## Iteration Strategies
93
+
94
+ ### Start Broad, Then Narrow
95
+
96
+ ```
97
+ Query 1: "Microservices communication patterns"
98
+ ↓ (get overview)
99
+ Query 2: "Synchronous vs asynchronous communication in microservices"
100
+ ↓ (pick approach)
101
+ Query 3: "Message queue selection for microservices - Kafka vs RabbitMQ"
102
+ ↓ (get specific)
103
+ Query 4: "Kafka configuration for microservices with 1M messages/day"
104
+ ```
105
+
106
+ ### Follow-Up Questions
107
+
108
+ After initial analysis:
109
+ - "Can you provide code examples for [recommendation]?"
110
+ - "What are common pitfalls with [approach]?"
111
+ - "How to migrate from [current] to [recommended]?"
112
+
113
+ ## Query Refinement
114
+
115
+ ### If Results Are Too Generic
116
+
117
+ **Add**:
118
+ - Specific technologies
119
+ - Scale/constraints
120
+ - Business context
121
+ - Team considerations
122
+
123
+ **Example**:
124
+ ```
125
+ Generic: "API rate limiting"
126
+
127
+ Refined: "API rate limiting for public API with 1M requests/day using Express.js and Redis"
128
+ ```
129
+
130
+ ### If Results Are Off-Topic
131
+
132
+ **Refine by**:
133
+ - Using different keywords
134
+ - Adding exclusions (e.g., "not focusing on X")
135
+ - Specifying scope (e.g., "backend only, not frontend")
136
+
137
+ ## Advanced Query Techniques
138
+
139
+ ### Multi-Dimensional Queries
140
+
141
+ Ask for analysis across multiple dimensions:
142
+ ```
143
+ "Analyze Redis vs Memcached across:
144
+ - Performance (throughput, latency)
145
+ - Operational complexity
146
+ - Feature set (data structures, persistence)
147
+ - Cost (infrastructure, developer time)
148
+ - Team expertise required"
149
+ ```
150
+
151
+ ### Constraint-Based Queries
152
+
153
+ Explicitly state constraints:
154
+ ```
155
+ "How to implement real-time notifications with:
156
+ - Budget: $500/month for 100k users
157
+ - Team: 5 developers, backend focus
158
+ - Stack: Node.js, PostgreSQL, AWS
159
+ - Timeline: 3 weeks to MVP"
160
+ ```
161
+
162
+ ### Trade-Off Analysis Queries
163
+
164
+ Request explicit trade-off analysis:
165
+ ```
166
+ "Trade-offs between:
167
+ - Microservices vs modular monolith
168
+ Given:
169
+ - Team size: 15 developers
170
+ - Traffic: 500k DAU
171
+ - Complexity: 8 bounded contexts
172
+ - Deployment frequency: Daily"
173
+ ```
174
+
175
+ ## Troubleshooting
176
+
177
+ ### Problem: Results Don't Match Question
178
+
179
+ **Cause**: Keyword mismatch with knowledge base
180
+
181
+ **Solution**: Try synonyms
182
+ ```
183
+ "REST API" → "HTTP API", "Web service API"
184
+ "caching" → "cache strategy", "memoization"
185
+ "microservices" → "service-oriented architecture", "distributed systems"
186
+ ```
187
+
188
+ ### Problem: Results Too Shallow
189
+
190
+ **Cause**: Query too broad
191
+
192
+ **Solution**: Add specificity
193
+ ```
194
+ "Performance optimization"
195
+
196
+ "React component re-render optimization for large lists (1000+ items)"
197
+ ```
198
+
199
+ ### Problem: Multiple Topics Mixed
200
+
201
+ **Cause**: Query covers too much
202
+
203
+ **Solution**: Split into separate queries
204
+ ```
205
+ "Authentication and caching strategy"
206
+
207
+ Query 1: "JWT vs session-based authentication for React + Node.js SaaS"
208
+ Query 2: "Redis caching strategy for authenticated API responses"
209
+ ```
210
+
211
+ ## Query Success Metrics
212
+
213
+ **Good result indicators**:
214
+ - Specific, actionable recommendations
215
+ - Quantitative metrics (e.g., "40% reduction in render time")
216
+ - Code examples or patterns
217
+ - Clear decision criteria
218
+ - Common pitfalls identified
219
+
220
+ **Poor result indicators**:
221
+ - Generic advice ("consider best practices")
222
+ - No metrics or benchmarks
223
+ - No code examples
224
+ - Vague recommendations
225
+ - Missing context