@booklib/core 2.0.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 (374) hide show
  1. package/.cursor/rules/booklib-standards.mdc +40 -0
  2. package/.gemini/context.md +372 -0
  3. package/AGENTS.md +166 -0
  4. package/CHANGELOG.md +226 -0
  5. package/CLAUDE.md +81 -0
  6. package/CODE_OF_CONDUCT.md +31 -0
  7. package/CONTRIBUTING.md +304 -0
  8. package/LICENSE +21 -0
  9. package/PLAN.md +28 -0
  10. package/README.ja.md +198 -0
  11. package/README.ko.md +198 -0
  12. package/README.md +503 -0
  13. package/README.pt-BR.md +198 -0
  14. package/README.uk.md +241 -0
  15. package/README.zh-CN.md +198 -0
  16. package/SECURITY.md +9 -0
  17. package/agents/architecture-reviewer.md +136 -0
  18. package/agents/booklib-reviewer.md +90 -0
  19. package/agents/data-reviewer.md +107 -0
  20. package/agents/jvm-reviewer.md +146 -0
  21. package/agents/python-reviewer.md +128 -0
  22. package/agents/rust-reviewer.md +115 -0
  23. package/agents/ts-reviewer.md +110 -0
  24. package/agents/ui-reviewer.md +117 -0
  25. package/assets/logo.svg +36 -0
  26. package/bin/booklib-mcp.js +304 -0
  27. package/bin/booklib.js +1705 -0
  28. package/bin/skills.cjs +1292 -0
  29. package/booklib-router.mdc +36 -0
  30. package/booklib.config.json +19 -0
  31. package/commands/animation-at-work.md +10 -0
  32. package/commands/clean-code-reviewer.md +10 -0
  33. package/commands/data-intensive-patterns.md +10 -0
  34. package/commands/data-pipelines.md +10 -0
  35. package/commands/design-patterns.md +10 -0
  36. package/commands/domain-driven-design.md +10 -0
  37. package/commands/effective-java.md +10 -0
  38. package/commands/effective-kotlin.md +10 -0
  39. package/commands/effective-python.md +10 -0
  40. package/commands/effective-typescript.md +10 -0
  41. package/commands/kotlin-in-action.md +10 -0
  42. package/commands/lean-startup.md +10 -0
  43. package/commands/microservices-patterns.md +10 -0
  44. package/commands/programming-with-rust.md +10 -0
  45. package/commands/refactoring-ui.md +10 -0
  46. package/commands/rust-in-action.md +10 -0
  47. package/commands/skill-router.md +10 -0
  48. package/commands/spring-boot-in-action.md +10 -0
  49. package/commands/storytelling-with-data.md +10 -0
  50. package/commands/system-design-interview.md +10 -0
  51. package/commands/using-asyncio-python.md +10 -0
  52. package/commands/web-scraping-python.md +10 -0
  53. package/community/registry.json +1616 -0
  54. package/hooks/hooks.json +23 -0
  55. package/hooks/posttooluse-capture.mjs +67 -0
  56. package/hooks/suggest.js +153 -0
  57. package/lib/agent-behaviors.js +40 -0
  58. package/lib/agent-detector.js +96 -0
  59. package/lib/config-loader.js +39 -0
  60. package/lib/conflict-resolver.js +148 -0
  61. package/lib/context-builder.js +574 -0
  62. package/lib/discovery-engine.js +298 -0
  63. package/lib/doctor/hook-installer.js +83 -0
  64. package/lib/doctor/usage-tracker.js +87 -0
  65. package/lib/engine/ai-features.js +253 -0
  66. package/lib/engine/auditor.js +103 -0
  67. package/lib/engine/bm25-index.js +178 -0
  68. package/lib/engine/capture.js +120 -0
  69. package/lib/engine/corrections.js +198 -0
  70. package/lib/engine/doctor.js +195 -0
  71. package/lib/engine/graph-injector.js +137 -0
  72. package/lib/engine/graph.js +161 -0
  73. package/lib/engine/handoff.js +405 -0
  74. package/lib/engine/indexer.js +242 -0
  75. package/lib/engine/parser.js +53 -0
  76. package/lib/engine/query-expander.js +42 -0
  77. package/lib/engine/reranker.js +40 -0
  78. package/lib/engine/rrf.js +59 -0
  79. package/lib/engine/scanner.js +151 -0
  80. package/lib/engine/searcher.js +139 -0
  81. package/lib/engine/session-coordinator.js +306 -0
  82. package/lib/engine/session-manager.js +429 -0
  83. package/lib/engine/synthesizer.js +70 -0
  84. package/lib/installer.js +70 -0
  85. package/lib/instinct-block.js +33 -0
  86. package/lib/mcp-config-writer.js +88 -0
  87. package/lib/paths.js +57 -0
  88. package/lib/profiles/design.md +19 -0
  89. package/lib/profiles/general.md +16 -0
  90. package/lib/profiles/research-analysis.md +22 -0
  91. package/lib/profiles/software-development.md +23 -0
  92. package/lib/profiles/writing-content.md +19 -0
  93. package/lib/project-initializer.js +916 -0
  94. package/lib/registry/skills.js +102 -0
  95. package/lib/registry-searcher.js +99 -0
  96. package/lib/rules/rules-manager.js +169 -0
  97. package/lib/skill-fetcher.js +333 -0
  98. package/lib/well-known-builder.js +70 -0
  99. package/lib/wizard/index.js +404 -0
  100. package/lib/wizard/integration-detector.js +41 -0
  101. package/lib/wizard/project-detector.js +100 -0
  102. package/lib/wizard/prompt.js +156 -0
  103. package/lib/wizard/registry-embeddings.js +107 -0
  104. package/lib/wizard/skill-recommender.js +69 -0
  105. package/llms-full.txt +254 -0
  106. package/llms.txt +70 -0
  107. package/package.json +45 -0
  108. package/research-reports/2026-04-01-current-architecture.md +160 -0
  109. package/research-reports/IDEAS.md +93 -0
  110. package/rules/common/clean-code.md +42 -0
  111. package/rules/java/effective-java.md +42 -0
  112. package/rules/kotlin/effective-kotlin.md +37 -0
  113. package/rules/python/effective-python.md +38 -0
  114. package/rules/rust/rust.md +37 -0
  115. package/rules/typescript/effective-typescript.md +42 -0
  116. package/scripts/gen-llms-full.mjs +36 -0
  117. package/scripts/gen-og.mjs +142 -0
  118. package/scripts/validate-frontmatter.js +25 -0
  119. package/skills/animation-at-work/SKILL.md +270 -0
  120. package/skills/animation-at-work/assets/example_asset.txt +1 -0
  121. package/skills/animation-at-work/evals/evals.json +44 -0
  122. package/skills/animation-at-work/evals/results.json +13 -0
  123. package/skills/animation-at-work/examples/after.md +64 -0
  124. package/skills/animation-at-work/examples/before.md +35 -0
  125. package/skills/animation-at-work/references/api_reference.md +369 -0
  126. package/skills/animation-at-work/references/review-checklist.md +79 -0
  127. package/skills/animation-at-work/scripts/audit_animations.py +295 -0
  128. package/skills/animation-at-work/scripts/example.py +1 -0
  129. package/skills/clean-code-reviewer/SKILL.md +444 -0
  130. package/skills/clean-code-reviewer/audit.json +35 -0
  131. package/skills/clean-code-reviewer/evals/evals.json +185 -0
  132. package/skills/clean-code-reviewer/evals/results.json +13 -0
  133. package/skills/clean-code-reviewer/examples/after.md +48 -0
  134. package/skills/clean-code-reviewer/examples/before.md +33 -0
  135. package/skills/clean-code-reviewer/references/api_reference.md +158 -0
  136. package/skills/clean-code-reviewer/references/practices-catalog.md +282 -0
  137. package/skills/clean-code-reviewer/references/review-checklist.md +254 -0
  138. package/skills/clean-code-reviewer/scripts/pre-review.py +206 -0
  139. package/skills/data-intensive-patterns/SKILL.md +267 -0
  140. package/skills/data-intensive-patterns/assets/example_asset.txt +1 -0
  141. package/skills/data-intensive-patterns/evals/evals.json +54 -0
  142. package/skills/data-intensive-patterns/evals/results.json +13 -0
  143. package/skills/data-intensive-patterns/examples/after.md +61 -0
  144. package/skills/data-intensive-patterns/examples/before.md +38 -0
  145. package/skills/data-intensive-patterns/references/api_reference.md +34 -0
  146. package/skills/data-intensive-patterns/references/patterns-catalog.md +551 -0
  147. package/skills/data-intensive-patterns/references/review-checklist.md +193 -0
  148. package/skills/data-intensive-patterns/scripts/adr.py +213 -0
  149. package/skills/data-intensive-patterns/scripts/example.py +1 -0
  150. package/skills/data-pipelines/SKILL.md +259 -0
  151. package/skills/data-pipelines/assets/example_asset.txt +1 -0
  152. package/skills/data-pipelines/evals/evals.json +45 -0
  153. package/skills/data-pipelines/evals/results.json +13 -0
  154. package/skills/data-pipelines/examples/after.md +97 -0
  155. package/skills/data-pipelines/examples/before.md +37 -0
  156. package/skills/data-pipelines/references/api_reference.md +301 -0
  157. package/skills/data-pipelines/references/review-checklist.md +181 -0
  158. package/skills/data-pipelines/scripts/example.py +1 -0
  159. package/skills/data-pipelines/scripts/new_pipeline.py +444 -0
  160. package/skills/design-patterns/SKILL.md +271 -0
  161. package/skills/design-patterns/assets/example_asset.txt +1 -0
  162. package/skills/design-patterns/evals/evals.json +46 -0
  163. package/skills/design-patterns/evals/results.json +13 -0
  164. package/skills/design-patterns/examples/after.md +52 -0
  165. package/skills/design-patterns/examples/before.md +29 -0
  166. package/skills/design-patterns/references/api_reference.md +1 -0
  167. package/skills/design-patterns/references/patterns-catalog.md +726 -0
  168. package/skills/design-patterns/references/review-checklist.md +173 -0
  169. package/skills/design-patterns/scripts/example.py +1 -0
  170. package/skills/design-patterns/scripts/scaffold.py +807 -0
  171. package/skills/domain-driven-design/SKILL.md +142 -0
  172. package/skills/domain-driven-design/assets/example_asset.txt +1 -0
  173. package/skills/domain-driven-design/evals/evals.json +48 -0
  174. package/skills/domain-driven-design/evals/results.json +13 -0
  175. package/skills/domain-driven-design/examples/after.md +80 -0
  176. package/skills/domain-driven-design/examples/before.md +43 -0
  177. package/skills/domain-driven-design/references/api_reference.md +1 -0
  178. package/skills/domain-driven-design/references/patterns-catalog.md +545 -0
  179. package/skills/domain-driven-design/references/review-checklist.md +158 -0
  180. package/skills/domain-driven-design/scripts/example.py +1 -0
  181. package/skills/domain-driven-design/scripts/scaffold.py +421 -0
  182. package/skills/effective-java/SKILL.md +227 -0
  183. package/skills/effective-java/assets/example_asset.txt +1 -0
  184. package/skills/effective-java/evals/evals.json +46 -0
  185. package/skills/effective-java/evals/results.json +13 -0
  186. package/skills/effective-java/examples/after.md +83 -0
  187. package/skills/effective-java/examples/before.md +37 -0
  188. package/skills/effective-java/references/api_reference.md +1 -0
  189. package/skills/effective-java/references/items-catalog.md +955 -0
  190. package/skills/effective-java/references/review-checklist.md +216 -0
  191. package/skills/effective-java/scripts/checkstyle_setup.py +211 -0
  192. package/skills/effective-java/scripts/example.py +1 -0
  193. package/skills/effective-kotlin/SKILL.md +271 -0
  194. package/skills/effective-kotlin/assets/example_asset.txt +1 -0
  195. package/skills/effective-kotlin/audit.json +29 -0
  196. package/skills/effective-kotlin/evals/evals.json +45 -0
  197. package/skills/effective-kotlin/evals/results.json +13 -0
  198. package/skills/effective-kotlin/examples/after.md +36 -0
  199. package/skills/effective-kotlin/examples/before.md +38 -0
  200. package/skills/effective-kotlin/references/api_reference.md +1 -0
  201. package/skills/effective-kotlin/references/practices-catalog.md +1228 -0
  202. package/skills/effective-kotlin/references/review-checklist.md +126 -0
  203. package/skills/effective-kotlin/scripts/example.py +1 -0
  204. package/skills/effective-python/SKILL.md +441 -0
  205. package/skills/effective-python/evals/evals.json +44 -0
  206. package/skills/effective-python/evals/results.json +13 -0
  207. package/skills/effective-python/examples/after.md +56 -0
  208. package/skills/effective-python/examples/before.md +40 -0
  209. package/skills/effective-python/ref-01-pythonic-thinking.md +202 -0
  210. package/skills/effective-python/ref-02-lists-and-dicts.md +146 -0
  211. package/skills/effective-python/ref-03-functions.md +186 -0
  212. package/skills/effective-python/ref-04-comprehensions-generators.md +211 -0
  213. package/skills/effective-python/ref-05-classes-interfaces.md +188 -0
  214. package/skills/effective-python/ref-06-metaclasses-attributes.md +209 -0
  215. package/skills/effective-python/ref-07-concurrency.md +213 -0
  216. package/skills/effective-python/ref-08-robustness-performance.md +248 -0
  217. package/skills/effective-python/ref-09-testing-debugging.md +253 -0
  218. package/skills/effective-python/ref-10-collaboration.md +175 -0
  219. package/skills/effective-python/references/api_reference.md +218 -0
  220. package/skills/effective-python/references/practices-catalog.md +483 -0
  221. package/skills/effective-python/references/review-checklist.md +190 -0
  222. package/skills/effective-python/scripts/lint.py +173 -0
  223. package/skills/effective-typescript/SKILL.md +262 -0
  224. package/skills/effective-typescript/audit.json +29 -0
  225. package/skills/effective-typescript/evals/evals.json +37 -0
  226. package/skills/effective-typescript/evals/results.json +13 -0
  227. package/skills/effective-typescript/examples/after.md +70 -0
  228. package/skills/effective-typescript/examples/before.md +47 -0
  229. package/skills/effective-typescript/references/api_reference.md +118 -0
  230. package/skills/effective-typescript/references/practices-catalog.md +371 -0
  231. package/skills/effective-typescript/scripts/review.py +169 -0
  232. package/skills/kotlin-in-action/SKILL.md +261 -0
  233. package/skills/kotlin-in-action/assets/example_asset.txt +1 -0
  234. package/skills/kotlin-in-action/evals/evals.json +43 -0
  235. package/skills/kotlin-in-action/evals/results.json +13 -0
  236. package/skills/kotlin-in-action/examples/after.md +53 -0
  237. package/skills/kotlin-in-action/examples/before.md +39 -0
  238. package/skills/kotlin-in-action/references/api_reference.md +1 -0
  239. package/skills/kotlin-in-action/references/practices-catalog.md +436 -0
  240. package/skills/kotlin-in-action/references/review-checklist.md +204 -0
  241. package/skills/kotlin-in-action/scripts/example.py +1 -0
  242. package/skills/kotlin-in-action/scripts/setup_detekt.py +224 -0
  243. package/skills/lean-startup/SKILL.md +160 -0
  244. package/skills/lean-startup/assets/example_asset.txt +1 -0
  245. package/skills/lean-startup/evals/evals.json +43 -0
  246. package/skills/lean-startup/evals/results.json +13 -0
  247. package/skills/lean-startup/examples/after.md +80 -0
  248. package/skills/lean-startup/examples/before.md +34 -0
  249. package/skills/lean-startup/references/api_reference.md +319 -0
  250. package/skills/lean-startup/references/review-checklist.md +137 -0
  251. package/skills/lean-startup/scripts/example.py +1 -0
  252. package/skills/lean-startup/scripts/new_experiment.py +286 -0
  253. package/skills/microservices-patterns/SKILL.md +384 -0
  254. package/skills/microservices-patterns/evals/evals.json +45 -0
  255. package/skills/microservices-patterns/evals/results.json +13 -0
  256. package/skills/microservices-patterns/examples/after.md +69 -0
  257. package/skills/microservices-patterns/examples/before.md +40 -0
  258. package/skills/microservices-patterns/references/patterns-catalog.md +391 -0
  259. package/skills/microservices-patterns/references/review-checklist.md +169 -0
  260. package/skills/microservices-patterns/scripts/new_service.py +583 -0
  261. package/skills/programming-with-rust/SKILL.md +209 -0
  262. package/skills/programming-with-rust/evals/evals.json +37 -0
  263. package/skills/programming-with-rust/evals/results.json +13 -0
  264. package/skills/programming-with-rust/examples/after.md +107 -0
  265. package/skills/programming-with-rust/examples/before.md +59 -0
  266. package/skills/programming-with-rust/references/api_reference.md +152 -0
  267. package/skills/programming-with-rust/references/practices-catalog.md +335 -0
  268. package/skills/programming-with-rust/scripts/review.py +142 -0
  269. package/skills/refactoring-ui/SKILL.md +362 -0
  270. package/skills/refactoring-ui/assets/example_asset.txt +1 -0
  271. package/skills/refactoring-ui/evals/evals.json +45 -0
  272. package/skills/refactoring-ui/evals/results.json +13 -0
  273. package/skills/refactoring-ui/examples/after.md +85 -0
  274. package/skills/refactoring-ui/examples/before.md +58 -0
  275. package/skills/refactoring-ui/references/api_reference.md +355 -0
  276. package/skills/refactoring-ui/references/review-checklist.md +114 -0
  277. package/skills/refactoring-ui/scripts/audit_css.py +250 -0
  278. package/skills/refactoring-ui/scripts/example.py +1 -0
  279. package/skills/rust-in-action/SKILL.md +350 -0
  280. package/skills/rust-in-action/evals/evals.json +38 -0
  281. package/skills/rust-in-action/evals/results.json +13 -0
  282. package/skills/rust-in-action/examples/after.md +156 -0
  283. package/skills/rust-in-action/examples/before.md +56 -0
  284. package/skills/rust-in-action/references/practices-catalog.md +346 -0
  285. package/skills/rust-in-action/scripts/review.py +147 -0
  286. package/skills/skill-router/SKILL.md +186 -0
  287. package/skills/skill-router/evals/evals.json +38 -0
  288. package/skills/skill-router/evals/results.json +13 -0
  289. package/skills/skill-router/examples/after.md +63 -0
  290. package/skills/skill-router/examples/before.md +39 -0
  291. package/skills/skill-router/references/api_reference.md +24 -0
  292. package/skills/skill-router/references/routing-heuristics.md +89 -0
  293. package/skills/skill-router/references/skill-catalog.md +174 -0
  294. package/skills/skill-router/scripts/route.py +266 -0
  295. package/skills/spring-boot-in-action/SKILL.md +340 -0
  296. package/skills/spring-boot-in-action/evals/evals.json +39 -0
  297. package/skills/spring-boot-in-action/evals/results.json +13 -0
  298. package/skills/spring-boot-in-action/examples/after.md +185 -0
  299. package/skills/spring-boot-in-action/examples/before.md +84 -0
  300. package/skills/spring-boot-in-action/references/practices-catalog.md +403 -0
  301. package/skills/spring-boot-in-action/scripts/review.py +184 -0
  302. package/skills/storytelling-with-data/SKILL.md +241 -0
  303. package/skills/storytelling-with-data/assets/example_asset.txt +1 -0
  304. package/skills/storytelling-with-data/evals/evals.json +47 -0
  305. package/skills/storytelling-with-data/evals/results.json +13 -0
  306. package/skills/storytelling-with-data/examples/after.md +50 -0
  307. package/skills/storytelling-with-data/examples/before.md +33 -0
  308. package/skills/storytelling-with-data/references/api_reference.md +379 -0
  309. package/skills/storytelling-with-data/references/review-checklist.md +111 -0
  310. package/skills/storytelling-with-data/scripts/chart_review.py +301 -0
  311. package/skills/storytelling-with-data/scripts/example.py +1 -0
  312. package/skills/system-design-interview/SKILL.md +233 -0
  313. package/skills/system-design-interview/assets/example_asset.txt +1 -0
  314. package/skills/system-design-interview/evals/evals.json +46 -0
  315. package/skills/system-design-interview/evals/results.json +13 -0
  316. package/skills/system-design-interview/examples/after.md +94 -0
  317. package/skills/system-design-interview/examples/before.md +27 -0
  318. package/skills/system-design-interview/references/api_reference.md +582 -0
  319. package/skills/system-design-interview/references/review-checklist.md +201 -0
  320. package/skills/system-design-interview/scripts/example.py +1 -0
  321. package/skills/system-design-interview/scripts/new_design.py +421 -0
  322. package/skills/using-asyncio-python/SKILL.md +290 -0
  323. package/skills/using-asyncio-python/assets/example_asset.txt +1 -0
  324. package/skills/using-asyncio-python/evals/evals.json +43 -0
  325. package/skills/using-asyncio-python/evals/results.json +13 -0
  326. package/skills/using-asyncio-python/examples/after.md +68 -0
  327. package/skills/using-asyncio-python/examples/before.md +39 -0
  328. package/skills/using-asyncio-python/references/api_reference.md +267 -0
  329. package/skills/using-asyncio-python/references/review-checklist.md +149 -0
  330. package/skills/using-asyncio-python/scripts/check_blocking.py +270 -0
  331. package/skills/using-asyncio-python/scripts/example.py +1 -0
  332. package/skills/web-scraping-python/SKILL.md +280 -0
  333. package/skills/web-scraping-python/assets/example_asset.txt +1 -0
  334. package/skills/web-scraping-python/evals/evals.json +46 -0
  335. package/skills/web-scraping-python/evals/results.json +13 -0
  336. package/skills/web-scraping-python/examples/after.md +109 -0
  337. package/skills/web-scraping-python/examples/before.md +40 -0
  338. package/skills/web-scraping-python/references/api_reference.md +393 -0
  339. package/skills/web-scraping-python/references/review-checklist.md +163 -0
  340. package/skills/web-scraping-python/scripts/example.py +1 -0
  341. package/skills/web-scraping-python/scripts/new_scraper.py +231 -0
  342. package/skills/writing-plans/audit.json +34 -0
  343. package/tests/agent-detector.test.js +83 -0
  344. package/tests/corrections.test.js +245 -0
  345. package/tests/doctor/hook-installer.test.js +72 -0
  346. package/tests/doctor/usage-tracker.test.js +140 -0
  347. package/tests/engine/benchmark-eval.test.js +31 -0
  348. package/tests/engine/bm25-index.test.js +85 -0
  349. package/tests/engine/capture-command.test.js +35 -0
  350. package/tests/engine/capture.test.js +17 -0
  351. package/tests/engine/graph-augmented-search.test.js +107 -0
  352. package/tests/engine/graph-injector.test.js +44 -0
  353. package/tests/engine/graph.test.js +216 -0
  354. package/tests/engine/hybrid-searcher.test.js +74 -0
  355. package/tests/engine/indexer-bm25.test.js +37 -0
  356. package/tests/engine/mcp-tools.test.js +73 -0
  357. package/tests/engine/project-initializer-mcp.test.js +99 -0
  358. package/tests/engine/query-expander.test.js +36 -0
  359. package/tests/engine/reranker.test.js +51 -0
  360. package/tests/engine/rrf.test.js +49 -0
  361. package/tests/engine/srag-prefix.test.js +47 -0
  362. package/tests/instinct-block.test.js +23 -0
  363. package/tests/mcp-config-writer.test.js +60 -0
  364. package/tests/project-initializer-new-agents.test.js +48 -0
  365. package/tests/rules/rules-manager.test.js +230 -0
  366. package/tests/well-known-builder.test.js +40 -0
  367. package/tests/wizard/integration-detector.test.js +31 -0
  368. package/tests/wizard/project-detector.test.js +51 -0
  369. package/tests/wizard/prompt-session.test.js +61 -0
  370. package/tests/wizard/prompt.test.js +16 -0
  371. package/tests/wizard/registry-embeddings.test.js +35 -0
  372. package/tests/wizard/skill-recommender.test.js +34 -0
  373. package/tests/wizard/slot-count.test.js +25 -0
  374. package/vercel.json +21 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,226 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [2.0.0] - 2026-04-01
9
+
10
+ ### Breaking
11
+ - **Repo renamed** from `booklib-ai/booklib` to `booklib-ai/booklib`
12
+ - **npm package renamed** from `@booklib/skills` to `booklib` — install with `npm install -g booklib`
13
+ - **Config file generation** completely rewritten — generates 30-60 line files instead of 3,000-10,000 line content dumps. Old config files should be regenerated with `booklib init --reset`
14
+ - **`booklib fetch` and `booklib add` deprecated** — use `booklib install <name>` instead
15
+
16
+ ### Added
17
+ - **Hybrid search pipeline (Spec 2)** — BM25 + vector search + Reciprocal Rank Fusion + cross-encoder reranking. 40-60% precision improvement over vector-only
18
+ - **SRAG metadata prefix embeddings** — each chunk's vector encodes domain context (`[skill:X] [type:Y] [tags:Z]`), 30% QA improvement (arxiv:2603.26670)
19
+ - **Knowledge graph (Spec 3)** — `booklib capture` creates knowledge nodes with typed edges, `--graph` flag augments search with one-hop graph traversal
20
+ - **MCP integration for 10 tools** — auto-configures MCP server for Claude Code, Cursor, Copilot (VS Code), Gemini CLI, Codex, Windsurf, Roo Code, Goose, Zed, Continue
21
+ - **Trigger-oriented MCP tool descriptions** — each tool description says WHEN to use it, not just what it does
22
+ - **Instinct block** — 5-10 lines of behavioral triggers in config files tell agents when to use BookLib tools
23
+ - **5 activity-based profiles** — software-development, writing-content, research-analysis, design, general
24
+ - **Config assembler** — profile template + instinct block + skill table + references = clean config file
25
+ - **Copilot detection** via VS Code extensions directory (`~/.vscode/extensions/github.copilot*`)
26
+ - **`booklib install <name>`** — unified install command with three-tier lookup (installed → bundled → cached)
27
+ - **`booklib doctor` diagnostic engine** — 6 checks (slot overload, oversized configs, missing index, stale skills, orphaned skills, missing config files) + `--cure` flag
28
+ - **`booklib init --reset`** — force re-run setup wizard
29
+ - **Rank-based display scores** — meaningful percentages instead of all-100% reranker saturation
30
+ - **Recommendation explanations** — wizard shows WHY each skill was recommended with matching chunk snippets
31
+ - **Safe config file handling** — `onFileConflict` callback before modifying existing files
32
+ - **Official docs references** — generated config files link to each tool's official documentation
33
+ - **Index progress callback** — `onProgress` in `indexDirectory()` for real-time feedback
34
+ - **Shared readline session** — `createSession()` eliminates race conditions in sequential prompts
35
+ - **@clack/prompts wizard UI** — colors, spinners, arrow-key selection, animated progress
36
+ - **`benchmark/RESEARCH.md`** — maps retrieval quality metrics to arxiv 2602.12430 claims
37
+
38
+ ### Changed
39
+ - **13 supported AI tools** (up from 8): added Roo Code, OpenHands, Junie, Goose, OpenCode, Letta
40
+ - **24 bundled skills** (up from 22)
41
+ - **62 tests** across all modules
42
+ - **Wizard flow reordered** — index build before recommendations (uses search engine for recommendations instead of shallow description embeddings)
43
+
44
+ ## [1.12.0] - 2026-03-30
45
+
46
+ ### Added
47
+ - **`booklib init` Phase 2: MCP server setup** — after writing standards docs, `booklib init` now offers an interactive prompt to wire up the BookLib MCP server for Claude Code, Cursor, Gemini CLI, Codex, Zed, and Continue.dev
48
+ - **MCP config generation** — writes project-level config files: `.claude/settings.json`, `.cursor/mcp.json`, `.gemini/settings.json`, `.codex/config.toml`, `.zed/settings.json`, `.continue/mcpServers/booklib.yaml`; merges safely into existing configs without overwriting other MCP servers
49
+ - **`booklib-mcp` named bin** — `booklib-mcp` is now a first-class binary entry in `package.json`; MCP configs reference it directly by name
50
+ - **`--mcp-tool=X` flag** — skip the interactive prompt and specify tools directly (e.g. `booklib init --mcp-tool=claude,cursor`); selection persisted to `booklib.config.json`
51
+ - **Knowledge Graph** — unified node+edge model where any piece of knowledge (research, notes, decisions) and any part of your project (components, features) is a node; relationships are typed edges stored in `.booklib/knowledge/graph.jsonl`
52
+ - **`booklib note "<title>"`** — create a note node from `$EDITOR`, stdin pipe, or interactive input
53
+ - **`booklib dictate`** — type or dictate a note; AI structures the text, fixes grammar, extracts title and tags; `--raw` flag saves verbatim with no AI processing
54
+ - **`booklib save-chat`** — save the current agent conversation as a knowledge node; `--summarize` flag uses AI to extract key decisions and findings into a clean note with transcript attached
55
+ - **`booklib research "<topic>"`** — create a research stub node pre-populated with a template
56
+ - **`booklib component add <name> "<glob>"`** — define a project component with glob path patterns; component nodes replace `areas.yaml` (additive migration)
57
+ - **`booklib link <node1> <node2> --type <edge-type>`** — add a typed edge between any two nodes; edge types: `implements` · `contradicts` · `extends` · `applies-to` · `see-also` · `inspired-by` · `supersedes` · `depends-on`
58
+ - **`booklib nodes list`** / **`booklib nodes show <id>`** — list and inspect knowledge nodes
59
+ - **`booklib context --file <path>`** — graph-aware context injection: finds the file's owning component, traverses edges via BFS (up to 2 hops), combines with semantic search, injects book wisdom + personal knowledge together
60
+ - **PostToolUse hook** (`hooks/posttooluse-capture.mjs`) — fires after `WebFetch`/`WebSearch` tool calls and suggests saving captured knowledge as a node
61
+ - **`lib/engine/graph.js`** — node CRUD, edge append, BFS traversal with cycle prevention
62
+ - **`lib/engine/capture.js`** — node creation helpers: stdin, `$EDITOR`, interactive readline, Anthropic API structuring
63
+ - **`lib/engine/graph-injector.js`** — injection pipeline: semantic search + BFS graph traversal + dedup + ranking
64
+ - **Knowledge nodes indexed** — `booklib index` now indexes `.booklib/knowledge/nodes/` alongside skills; `booklib search` returns both with `📝` prefix for knowledge hits
65
+ - **`minimatch`** added as a runtime dependency for component path-glob matching
66
+
67
+ ## [1.11.0] - 2026-03-30
68
+
69
+ ### Added
70
+ - **Non-code domain support** — `booklib context` now works for product, writing, strategy, design, and legal domains using the same semantic extraction as code skills
71
+ - **6 new community skills in registry** — `article-writing`, `product-lens`, `market-research`, `investor-materials`, `brand-guidelines`, `web-design-guidelines` with accurate source URLs
72
+ - **`booklib scan --docs` mode** — prose quality checks (passive voice, unresolved placeholders, hedge words, user story completeness) for `.md`/`.txt` files
73
+ - **`writing-plans/audit.json`** — bundled static rules for markdown document scanning
74
+ - **New profiles** — `product`, `writer`, `strategist`, `designer`, `legal` roles added to `booklib profile` and `booklib swarm-config`
75
+ - **`skill-router` extended** — now routes non-code tasks to PM, legal, writing, strategy, brand, and web design skills; added 5 new routing rules and 3 conflict resolution entries
76
+ - **Prose sentence extraction** — `extractItems()` now splits long prose blocks by sentence boundary so non-code skill content surfaces as individual, rankable principles
77
+
78
+ ### Fixed
79
+ - **Self-conflict bug** — `booklib context` no longer shows `skill vs skill` conflict warnings when the same skill name appears in both bundled and community index; deduplication by skill name now runs before conflict resolution
80
+ - **Community skills indexed** — `booklib index` now indexes `~/.booklib/skills/` after rebuilding the bundled index, so community skills appear in `booklib search` and `booklib context` results
81
+ - **YAML parse errors** — `booklib index` now skips malformed skill files with a warning instead of aborting the entire index rebuild
82
+
83
+ ## [1.10.0] - 2026-03-28
84
+
85
+ ### Added
86
+ - **Rules system** — Standalone rule files for Cursor and other AI editors
87
+ - **Standalone `--hooks` flag** — Install hooks independently of skills
88
+ - **Landing page update** — Improved GitHub Pages documentation
89
+
90
+ ### Changed
91
+ - Multi-language README support (中文, 日本語, 한국어, Português)
92
+ - README overhaul for v1.10.0 with improved clarity and examples
93
+
94
+ ### Fixed
95
+ - Book covers now load via Google Books JSON API (eliminates false-positive placeholders)
96
+ - Cover image detection improved to skip 1×1 pixel placeholders
97
+
98
+ ## [1.9.0] - 2026-02-27
99
+
100
+ ### Added
101
+ - **Agents system** — `@python-reviewer`, `@ts-reviewer`, `@architecture-reviewer`, and more
102
+ - **Cursor support** — Install skills and rules to `.cursor/rules/` for Cursor IDE
103
+ - **Installation profiles** — Quick-start profiles for common stacks (python, ts, jvm, rust, architecture, data, ui, lean, core)
104
+ - **Slash commands** — `/effective-python`, `/design-patterns`, etc. for explicit skill invocation
105
+ - **Hook system** — Auto-suggestion when asking for code reviews
106
+ - **GitHub Pages site** — Interactive skill browser with book covers
107
+
108
+ ### Changed
109
+ - AGENTS.md rewritten with profiles and cross-platform setup
110
+ - README structure reorganized around profiles and tiers
111
+
112
+ ### Removed
113
+ - Hardcoded skill count (now dynamic)
114
+
115
+ ## [1.8.0] - 2026-02-26
116
+
117
+ ### Added
118
+ - **Installation profiles** — Platform-specific quick-install (e.g., `--profile=ts`, `--profile=python`)
119
+ - **Benchmark suite** — Performance testing infrastructure
120
+ - **Skill quality checker** — `npx booklib check <skill-name>`
121
+
122
+ ### Changed
123
+ - Project logo added and displayed in README
124
+ - Community health files added
125
+ - NPM ignore list improved
126
+
127
+ ## [1.7.0] - 2026-02-24
128
+
129
+ ### Added
130
+ - **Agents system** — `@booklib-reviewer`, `@python-reviewer`, `@ts-reviewer` for autonomous code review
131
+ - **Skill-router meta-skill** — Auto-routing to best skill based on context
132
+ - **GitHub Actions workflows** — Automated testing and release pipeline
133
+ - **Skill evaluation framework** — `evals.json` test cases for quality assurance
134
+
135
+ ### Changed
136
+ - All skills upgraded to **Platinum** quality (13/13 checks)
137
+ - Scripts added to all skills for practical examples
138
+ - Skill structure standardized with examples/ and references/ directories
139
+
140
+ ## [1.6.0] - 2026-02-20
141
+
142
+ ### Added
143
+ - **Slash commands system** — Explicit skill invocation without relying on auto-trigger
144
+ - **Skill verification** — `npx booklib eval <skill-name>` for running test cases
145
+
146
+ ## [1.5.0] - 2026-02-18
147
+
148
+ ### Added
149
+ - `spring-boot-in-action` skill — Enterprise Java best practices
150
+ - Spring Boot patterns and architecture guidance
151
+
152
+ ## [1.4.0] - 2026-02-16
153
+
154
+ ### Added
155
+ - `effective-typescript` skill — Dan Vanderkam's TypeScript best practices
156
+ - `programming-with-rust` skill — Donis Marshall's practical Rust patterns
157
+ - `rust-in-action` skill — Tim McNamara's systems programming with Rust
158
+
159
+ ### Changed
160
+ - Upgraded to Platinum quality across new skills
161
+
162
+ ## [1.3.0] - 2026-02-15
163
+
164
+ ### Added
165
+ - **Skill-router** — Meta-skill that automatically selects the best skill for your task
166
+ - Improved skill discovery mechanism
167
+ - Better error messages for missing skills
168
+
169
+ ## [1.2.0] - 2026-02-14
170
+
171
+ ### Added
172
+ - GitHub Pages site with skill browser
173
+ - Animated demo GIF
174
+ - Improved README with better visual hierarchy
175
+
176
+ ## [1.1.0] - 2026-02-13
177
+
178
+ ### Added
179
+ - NPM version, downloads, and license badges
180
+ - Better documentation structure
181
+ - CLAUDE.md with project overview
182
+
183
+ ## [1.0.0] - 2026-02-10
184
+
185
+ ### Added
186
+ - **Initial release** with 18 core skills:
187
+ - `animation-at-work`
188
+ - `clean-code-reviewer`
189
+ - `data-intensive-patterns`
190
+ - `data-pipelines`
191
+ - `design-patterns`
192
+ - `domain-driven-design`
193
+ - `effective-java`
194
+ - `effective-kotlin`
195
+ - `effective-python`
196
+ - `kotlin-in-action`
197
+ - `lean-startup`
198
+ - `microservices-patterns`
199
+ - `refactoring-ui`
200
+ - `storytelling-with-data`
201
+ - `system-design-interview`
202
+ - `using-asyncio-python`
203
+ - `web-scraping-python`
204
+ - Plus 4 additional skills
205
+
206
+ - **Installation system** — NPM-based skill installation
207
+ - **Skill structure** — Standardized SKILL.md format with YAML frontmatter
208
+ - **Auto-triggering** — Skills load automatically based on file context
209
+ - **MIT License** — Open-source and permissive
210
+ - **Security policy** — Responsible disclosure guidelines
211
+ - **Code of Conduct** — Community standards
212
+
213
+ ---
214
+
215
+ ## Release Notes
216
+
217
+ For detailed release notes, see [GitHub Releases](https://github.com/booklib-ai/booklib/releases).
218
+
219
+ ## Versioning Policy
220
+
221
+ This project follows **Semantic Versioning**:
222
+ - **MAJOR** — Breaking changes to skill APIs or skill removal
223
+ - **MINOR** — New skills, new features, non-breaking improvements
224
+ - **PATCH** — Bug fixes, documentation improvements, skill enhancements
225
+
226
+ New skills are added regularly and will increment the MINOR version.
package/CLAUDE.md ADDED
@@ -0,0 +1,81 @@
1
+ # BookLib: Claude Operational Guidelines
2
+
3
+ You are operating within the BookLib repository, a curated library of software architecture and best-practice distillations. Your goal is to apply these high-level principles to the user's codebase using the built-in search engine.
4
+
5
+ <corrections>
6
+ When the user corrects your approach ("don't do that", "always use X", "stop doing Y"), run immediately:
7
+ `node bin/booklib.js correction add "brief rule"`
8
+ This records the correction. Repeated corrections are promoted automatically into your always-on context.
9
+ </corrections>
10
+
11
+ <workflow>
12
+ When a user asks you to write, review, or refactor code, you MUST follow this sequence:
13
+
14
+ 1. **Semantic Search**: Use your terminal to query the BookLib index for relevant architectural wisdom:
15
+ `node bin/booklib.js search "<conceptual query>"`
16
+ *Example: `node bin/booklib.js search "handling nulls in Kotlin"`*
17
+
18
+ 2. **Retrieve Skill**: If the search points to a specific file (e.g., `skills/effective-kotlin/SKILL.md`), use your file-reading tool to read it for detailed principles.
19
+
20
+ 3. **Apply Principles**: Strictly follow the `<core_principles>` and avoid the `<anti_patterns>` found in the search results and skill files.
21
+
22
+ 4. **Cite Your Source**: When outputting code or reviews, you MUST append a brief citation indicating which book or skill guided your decision.
23
+ *Example: "> Refactored per Effective Kotlin: Item 1 (Limit Mutability)"*
24
+
25
+ <handoff_protocol>
26
+ If you are finishing a planning session and the user wants to switch to a coding agent (or vice-versa), run:
27
+ `node bin/booklib.js save-state --goal "<final goal>" --next "<immediate next task>"`
28
+ This creates a snapshot that the next agent can resume.
29
+ </handoff_protocol>
30
+ </workflow>
31
+
32
+ <navigation_map>
33
+ - **Kotlin**: `skills/effective-kotlin/`
34
+ - **Java**: `skills/effective-java/`
35
+ - **TypeScript**: `skills/effective-typescript/`
36
+ - **Python**: `skills/effective-python/`
37
+ - **DDD**: `skills/domain-driven-design/`
38
+ - **Clean Code**: `skills/clean-code-reviewer/`
39
+ - **Architecture**: `skills/data-intensive-patterns/`, `skills/system-design-interview/`
40
+ </navigation_map>
41
+
42
+ <universal_indexer>
43
+ Before using the search tool for the first time, ensure the index is built:
44
+ `node bin/booklib.js index`
45
+ </universal_indexer>
46
+
47
+ See @.claude/rules/booklib-tools.md for analysis tools (scan, audit, session handoff).
48
+
49
+
50
+ <!-- booklib-standards-start -->
51
+ ## Stack
52
+ javascript (Node.js >= 18, ES modules)
53
+
54
+ ## Commands
55
+ - Install: `npm install`
56
+ - Build index: `node bin/booklib.js index`
57
+ - Scan codebase: `node bin/booklib.js scan`
58
+ - Audit file: `node bin/booklib.js audit <skill-name> <file-path>`
59
+
60
+ ## BookLib
61
+ BookLib MCP tools are available for code quality guidance.
62
+ - Before answering best-practices questions → search_skills
63
+ - When reviewing or writing code → search_skills for relevant principles
64
+ - When user says "remember/note/capture this" → create_note
65
+ - For deep file review against a skill → audit_content
66
+ - When code quality issues accumulate → suggest running `booklib doctor`
67
+
68
+ ## Active Skills
69
+ | Skill | Focus | Tags |
70
+ |-------|-------|------|
71
+ | clean-code-reviewer | Reviews code against Robert C. Martin's Clean Code principles | all-languages, quality, naming, refactoring |
72
+ | skill-router | Select the 1-2 most relevant booklib for a given file or task | meta, routing, agent-skills |
73
+
74
+
75
+ ## References
76
+
77
+ - [How to customize this file](https://docs.anthropic.com/en/docs/claude-code/claude-md)
78
+ - [BookLib documentation](https://booklib-ai.github.io/booklib/)
79
+ - [BookLib skills catalog](https://github.com/booklib-ai/booklib)
80
+
81
+ <!-- booklib-standards-end -->
@@ -0,0 +1,31 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to a positive environment:
10
+
11
+ * Demonstrating empathy and kindness toward other people
12
+ * Being respectful of differing opinions, viewpoints, and experiences
13
+ * Giving and gracefully accepting constructive feedback
14
+ * Accepting responsibility and apologizing to those affected by our mistakes
15
+ * Focusing on what is best for the overall community
16
+
17
+ Examples of unacceptable behavior:
18
+
19
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
20
+ * Trolling, insulting or derogatory comments, and personal or political attacks
21
+ * Public or private harassment
22
+ * Publishing others' private information without explicit permission
23
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+ ## Enforcement
26
+
27
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting the maintainers directly. All complaints will be reviewed and investigated promptly and fairly.
28
+
29
+ ## Attribution
30
+
31
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
@@ -0,0 +1,304 @@
1
+ # Contributing
2
+
3
+ Thanks for wanting to add a skill. A skill packages expert knowledge from a book into reusable instructions that AI agents can apply to real tasks.
4
+
5
+ ## What makes a good skill?
6
+
7
+ A skill is worth adding when the source book:
8
+ - Contains specific, actionable advice (not just general philosophy)
9
+ - Covers a topic useful to software engineers or designers
10
+ - Has enough depth to fill a meaningful SKILL.md (300+ lines)
11
+
12
+ ## Adding a new skill
13
+
14
+ ### 1. Create the folder
15
+
16
+ ```
17
+ skills/skill-name/
18
+ ├── SKILL.md # Required
19
+ ├── examples/
20
+ │ ├── before.md # Code or artifact before applying the skill
21
+ │ └── after.md # The improved version
22
+ └── evals/
23
+ └── evals.json # Test cases
24
+ ```
25
+
26
+ The folder name must be lowercase, hyphen-separated, and match the `name` field in `SKILL.md` exactly.
27
+
28
+ ### 2. Write SKILL.md
29
+
30
+ ```markdown
31
+ ---
32
+ name: skill-name
33
+ description: >
34
+ What this skill does and when to trigger it. Include specific
35
+ keywords agents should look for. Max 1024 characters.
36
+ ---
37
+
38
+ # Skill Title
39
+
40
+ You are an expert in [domain] grounded in [Book Title] by [Author].
41
+
42
+ ## When to use this skill
43
+
44
+ [Describe trigger conditions — what user requests or code patterns activate this skill]
45
+
46
+ ## Core principles
47
+
48
+ [The key ideas from the book, organized for an AI agent to apply]
49
+
50
+ ## How to apply
51
+
52
+ [Step-by-step process the agent follows]
53
+
54
+ ## Examples
55
+
56
+ [At least one concrete before/after showing the skill in action]
57
+ ```
58
+
59
+ **Requirements:**
60
+ - `name`: lowercase letters and hyphens only, matches folder name
61
+ - `description`: 1–1024 characters, describes what it does AND when to use it
62
+ - Body: clear instructions an AI agent can follow immediately
63
+
64
+ **Keep SKILL.md under 500 lines.** Move deep reference material to `references/` and link to it.
65
+
66
+ ### 3. Add before/after examples
67
+
68
+ `examples/before.md` — code or artifact that violates the book's principles.
69
+ `examples/after.md` — the same thing improved by applying the skill.
70
+
71
+ These power the `npx booklib demo <name>` command.
72
+
73
+ ### 4. Add evals
74
+
75
+ `evals/evals.json` — array of test cases verifying the skill works:
76
+
77
+ ```json
78
+ {
79
+ "evals": [
80
+ {
81
+ "id": "eval-01-short-description",
82
+ "prompt": "The prompt to send to the agent (include code or a scenario)",
83
+ "expectations": [
84
+ "The agent should do X",
85
+ "The agent should flag Y",
86
+ "The agent should NOT do Z"
87
+ ]
88
+ }
89
+ ]
90
+ }
91
+ ```
92
+
93
+ Aim for 3–5 evals per skill covering:
94
+ 1. A clear violation of the book's principles
95
+ 2. A subtle or intermediate case
96
+ 3. Already-good code (the agent should recognize it and not manufacture issues)
97
+
98
+ ### 5. Run evals and commit results
99
+
100
+ ```bash
101
+ ANTHROPIC_API_KEY=your-key npx booklib eval <name>
102
+ ```
103
+
104
+ This runs each eval **with and without** the skill and writes `evals/results.json`. Commit this file — it is how CI and readers verify the skill actually works.
105
+
106
+ **Quality thresholds** (calibrated to `claude-haiku-4-5` as judge):
107
+
108
+ | Metric | Minimum | Good | Excellent |
109
+ |--------|---------|------|-----------|
110
+ | Pass rate (with skill) | ≥ 80% | ≥ 85% | ≥ 90% |
111
+ | Delta over baseline | ≥ 20pp | ≥ 25pp | ≥ 30pp |
112
+ | Baseline (without skill) | any | < 70% | < 60% |
113
+
114
+ A high delta matters as much as a high pass rate — it proves the skill is doing real work, not just measuring what Claude already knows. A skill with 90% pass rate and 5pp delta is less valuable than one with 85% and 30pp delta.
115
+
116
+ The 80% threshold is calibrated to the judge model's own noise floor. Consistently hitting 80%+ with haiku as judge means the skill reliably catches what it claims to catch.
117
+
118
+ ### 6. Submit a PR
119
+
120
+ ```bash
121
+ git checkout -b skill/book-name
122
+ # add your skill folder
123
+ git add skills/skill-name/
124
+ git commit -m "feat: add skill-name skill"
125
+ gh pr create --title "feat: add skill-name" --body "..."
126
+ ```
127
+
128
+ PR checklist:
129
+ - [ ] Folder name matches `name` in SKILL.md
130
+ - [ ] `description` is under 1024 characters
131
+ - [ ] SKILL.md is under 500 lines
132
+ - [ ] `examples/before.md` and `examples/after.md` exist
133
+ - [ ] `evals/evals.json` has at least 3 test cases
134
+ - [ ] `evals/results.json` committed (run `npx booklib eval <name>`)
135
+ - [ ] Pass rate ≥ 80% and delta ≥ 20pp in results.json
136
+ - [ ] README.md skills table updated
137
+
138
+ ## Adding an Agent
139
+
140
+ An agent is a multi-step autonomous reviewer that orchestrates one or more skills. If you are packaging a single book's principles, write a skill. If you need to combine multiple skills, detect code patterns to route between them, or run a full review pipeline across a whole codebase, write an agent.
141
+
142
+ | Write a skill when... | Write an agent when... |
143
+ |-----------------------|------------------------|
144
+ | You are packaging one book's principles | You need two or more skills applied together |
145
+ | The logic is a single lens on code | You need routing logic (detect language → pick skill) |
146
+ | Instructions fit in one SKILL.md | You need a multi-step process (diff → detect → review → output) |
147
+
148
+ ### 1. Create the file
149
+
150
+ Agents live in a flat directory at the repo root:
151
+
152
+ ```
153
+ agents/<agent-name>.md
154
+ ```
155
+
156
+ The filename must be lowercase and hyphen-separated. It does not need a matching folder — unlike skills, agents have no `examples/` or `evals/` subdirectories.
157
+
158
+ ### 2. Write the frontmatter
159
+
160
+ Every agent file starts with YAML frontmatter:
161
+
162
+ ```markdown
163
+ ---
164
+ name: agent-name
165
+ description: >
166
+ When to invoke this agent and what it does. Include language names,
167
+ domain terms, and trigger conditions. Claude Code uses this field
168
+ for auto-invocation, so make it specific. Max 1024 characters.
169
+ tools: ["Read", "Grep", "Glob", "Bash"]
170
+ model: sonnet
171
+ ---
172
+ ```
173
+
174
+ **Required fields:**
175
+
176
+ - `name` — lowercase, hyphens only, matches filename exactly (without `.md`)
177
+ - `description` — used by Claude Code to decide when to invoke the agent automatically; include what it does, which skills it applies, and when to use it over alternatives
178
+ - `tools` — list of Claude Code tools the agent may call; `["Read", "Grep", "Glob", "Bash"]` covers most reviewers
179
+ - `model` — controls cost and capability (see model selection below)
180
+
181
+ ### 3. Write the body
182
+
183
+ A good agent body has five parts:
184
+
185
+ **Opening sentence** — one sentence identifying what the agent is, which books it draws from, and its scope.
186
+
187
+ **Process** — numbered steps the agent follows every time it runs:
188
+
189
+ 1. **Get the scope** — how to determine what to review (e.g., `git diff HEAD`, specific files passed by the user, or a directory scan)
190
+ 2. **Detect signals** — bash commands or grep patterns that route to the right skill(s)
191
+ 3. **Apply skill(s)** — one `### Step N` section per skill, each with `HIGH`/`MEDIUM`/`LOW` focus areas
192
+ 4. **Output** — the standard output format
193
+
194
+ **Detection table** — a Markdown table mapping code signals to skills:
195
+
196
+ ```markdown
197
+ | Code contains | Apply |
198
+ |---------------|-------|
199
+ | `async def`, `await`, `asyncio` | `using-asyncio-python` |
200
+ | `BeautifulSoup`, `scrapy` | `web-scraping-python` |
201
+ | General Python | `effective-python` |
202
+ ```
203
+
204
+ **Per-skill focus areas** — for each skill applied, list what to look for under `HIGH`, `MEDIUM`, and `LOW` headings. Pull these from the skills' own SKILL.md files, but trim to what is relevant for this agent's scope.
205
+
206
+ **Output format** — end the body with the standard output block:
207
+
208
+ ```markdown
209
+ ### Step N — Output format
210
+
211
+ ​```
212
+ **Skills applied:** `skill-name(s)`
213
+ **Scope:** [files reviewed]
214
+
215
+ ### HIGH
216
+ - `file:line` — finding
217
+
218
+ ### MEDIUM
219
+ - `file:line` — finding
220
+
221
+ ### LOW
222
+ - `file:line` — finding
223
+
224
+ **Summary:** X HIGH, Y MEDIUM, Z LOW findings.
225
+ ​```
226
+ ```
227
+
228
+ ### 4. Choose the right model
229
+
230
+ | Model | When to use |
231
+ |-------|-------------|
232
+ | `haiku` | Fast, cheap; use for simple or narrow tasks with a single skill and little routing logic |
233
+ | `sonnet` | Default for most reviewers; handles multi-skill routing and structured output well |
234
+ | `opus` | Only for architecture or reasoning-heavy agents where depth matters more than cost (e.g., `architecture-reviewer`) |
235
+
236
+ When in doubt, use `sonnet`.
237
+
238
+ ### 5. Follow naming conventions
239
+
240
+ | Pattern | Examples | Use for |
241
+ |---------|----------|---------|
242
+ | `<language>-reviewer` | `python-reviewer`, `jvm-reviewer`, `ts-reviewer` | Language-cluster agents combining all relevant skills for a language |
243
+ | `<domain>-reviewer` | `architecture-reviewer`, `data-reviewer`, `ui-reviewer` | Domain-cluster agents cutting across languages |
244
+ | Descriptive name | `booklib-reviewer` | Meta or router agents that don't fit a single language or domain |
245
+
246
+ ### 6. Installation
247
+
248
+ Agents install to `.claude/agents/` alongside skills:
249
+
250
+ ```bash
251
+ # Install one agent
252
+ npx skills add booklib-ai/booklib --agent=python-reviewer
253
+
254
+ # Install everything (skills + agents)
255
+ npx skills add booklib-ai/booklib --all
256
+ ```
257
+
258
+ Once installed, Claude Code reads the agent's `description` field and auto-invokes it when a matching request arrives — no slash command needed.
259
+
260
+ ### 7. No eval system (yet)
261
+
262
+ There is no `evals/` system for agents. Instead:
263
+
264
+ - Make the `description` accurate — it controls when the agent auto-invokes
265
+ - Check that every `### Step N` section has a clear, testable action
266
+ - Test manually: install the agent locally and run it against a real codebase
267
+
268
+ ### 8. Submit a PR
269
+
270
+ ```bash
271
+ git checkout -b agent/agent-name
272
+ git add agents/agent-name.md
273
+ git commit -m "feat: add agent-name agent"
274
+ gh pr create --title "feat: add agent-name agent" --body "..."
275
+ ```
276
+
277
+ PR checklist:
278
+ - [ ] Filename matches `name` in frontmatter
279
+ - [ ] `description` is under 1024 characters and describes when to invoke it
280
+ - [ ] `model` is appropriate for the agent's complexity
281
+ - [ ] Process steps are numbered and each has a clear action
282
+ - [ ] Detection table covers the signals the agent handles
283
+ - [ ] Output format section matches the standard `HIGH`/`MEDIUM`/`LOW` format
284
+
285
+ ## Requesting a skill
286
+
287
+ Open an issue titled **"Skill Request: [Book Name]"** and describe why the book would make a good skill. Community members can then pick it up.
288
+
289
+ ## AI disclosure
290
+
291
+ If you used an AI tool to help write or review your contribution, disclose it in your PR description. This is required — not optional.
292
+
293
+ **Acceptable examples:**
294
+ - "Written primarily with Claude Code; I reviewed and tested each section manually."
295
+ - "I used Copilot for boilerplate; the examples and evals are hand-written."
296
+ - "No AI tools used."
297
+
298
+ **Not acceptable:** submitting AI-generated content without reviewing it yourself. Skills are grounded in specific books — the AI can hallucinate citations, misattribute principles, or invent heuristic codes. You are responsible for accuracy.
299
+
300
+ Trivial fixes (typos, formatting) don't need a disclosure.
301
+
302
+ ## Questions
303
+
304
+ Use [GitHub Discussions](../../discussions) for questions, ideas, and feedback.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.