tribunal-kit 9.2.3 → 9.2.4

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 (563) hide show
  1. package/.agent/.tribunal/session.jsonl +15 -0
  2. package/.agent/ARCHITECTURE.md +4 -4
  3. package/.agent/agents/agent-shield-auditor.md +18 -0
  4. package/.agent/agents/harness-manager.md +49 -0
  5. package/.agent/agents/human-gate-negotiator.md +22 -0
  6. package/.agent/agents/kernel-scheduler.md +56 -0
  7. package/.agent/agents/memory-archivist.md +37 -0
  8. package/.agent/agents/orchestrator.md +5 -0
  9. package/.agent/agents/project-planner.md +5 -0
  10. package/.agent/agents/security-auditor.md +5 -0
  11. package/.agent/rules/GEMINI.md +1 -1
  12. package/.agent/scripts/_utils.js +1 -1
  13. package/.agent/scripts/checklist.js +1 -1
  14. package/.agent/scripts/context_compiler.js +1 -1
  15. package/.agent/scripts/guardrail_engine.js +1 -1
  16. package/.agent/scripts/harness_manager.js +60 -0
  17. package/.agent/scripts/lint_runner.js +1 -1
  18. package/.agent/scripts/mcp_server.js +181 -0
  19. package/.agent/scripts/memory_archivist.js +97 -0
  20. package/.agent/scripts/memory_consolidator.js +37 -0
  21. package/.agent/scripts/memory_engine.js +61 -21
  22. package/.agent/scripts/pipeline_engine.js +17 -2
  23. package/.agent/scripts/session_logger.js +115 -0
  24. package/.agent/scripts/session_manager.js +10 -0
  25. package/.agent/scripts/swarm_dispatcher.js +74 -1
  26. package/.agent/scripts/syscall_registry.js +105 -0
  27. package/.agent/scripts/test_runner.js +1 -1
  28. package/.agent/scripts/verify_all.js +2 -2
  29. package/.agent/skill_topic_map.json +28 -1
  30. package/.agent/skills/agent-syscall-guidelines/SKILL.md +25 -0
  31. package/.agent/skills/agentic-workflows-2026/SKILL.md +8 -0
  32. package/.agent/skills/agentshield-security/SKILL.md +26 -0
  33. package/.agent/skills/context-engineering-pro/SKILL.md +7 -0
  34. package/.agent/skills/fabel-protocol/SKILL.md +5 -0
  35. package/.agent/skills/graph-engineering/SKILL.md +28 -0
  36. package/.agent/skills/harness-protocol/SKILL.md +8 -0
  37. package/.agent/skills/hf-cli/SKILL.md +239 -0
  38. package/.agent/skills/hf-cloud-aws-context-discovery/SKILL.md +74 -0
  39. package/.agent/skills/hf-cloud-python-env-setup/SKILL.md +90 -0
  40. package/.agent/skills/hf-cloud-python-env-setup/requirements.txt +17 -0
  41. package/.agent/skills/hf-cloud-python-env-setup/scripts/check_versions.py +29 -0
  42. package/.agent/skills/hf-cloud-python-env-setup/scripts/setup_env.py +143 -0
  43. package/.agent/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +90 -0
  44. package/.agent/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +102 -0
  45. package/.agent/skills/hf-cloud-sagemaker-iam-preflight/references/minimum-permissions.json +47 -0
  46. package/.agent/skills/hf-cloud-sagemaker-iam-preflight/references/trust-policy.json +12 -0
  47. package/.agent/skills/hf-cloud-sagemaker-iam-preflight/scripts/check_role.py +184 -0
  48. package/.agent/skills/hf-cloud-sagemaker-iam-preflight/scripts/create_role.py +118 -0
  49. package/.agent/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +419 -0
  50. package/.agent/skills/hf-cloud-sagemaker-production-defaults/references/deployment-template.md +59 -0
  51. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/_common.py +148 -0
  52. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy.py +327 -0
  53. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_async.py +434 -0
  54. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_ic.py +506 -0
  55. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/invoke_endpoint.py +180 -0
  56. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/teardown.py +246 -0
  57. package/.agent/skills/hf-cloud-serving-image-selection/SKILL.md +220 -0
  58. package/.agent/skills/hf-cloud-serving-image-selection/references/model-to-image.md +111 -0
  59. package/.agent/skills/hf-cloud-serving-image-selection/scripts/mirror_image.py +145 -0
  60. package/.agent/skills/hf-mem/SKILL.md +79 -0
  61. package/.agent/skills/huggingface-best/SKILL.md +134 -0
  62. package/.agent/skills/huggingface-community-evals/SKILL.md +207 -0
  63. package/.agent/skills/huggingface-community-evals/examples/.env.example +3 -0
  64. package/.agent/skills/huggingface-community-evals/examples/USAGE_EXAMPLES.md +101 -0
  65. package/.agent/skills/huggingface-community-evals/scripts/inspect_eval_uv.py +104 -0
  66. package/.agent/skills/huggingface-community-evals/scripts/inspect_vllm_uv.py +306 -0
  67. package/.agent/skills/huggingface-community-evals/scripts/lighteval_vllm_uv.py +297 -0
  68. package/.agent/skills/huggingface-datasets/SKILL.md +107 -0
  69. package/.agent/skills/huggingface-gradio/SKILL.md +298 -0
  70. package/.agent/skills/huggingface-gradio/examples.md +613 -0
  71. package/.agent/skills/huggingface-llm-trainer/SKILL.md +738 -0
  72. package/.agent/skills/huggingface-llm-trainer/references/gguf_conversion.md +296 -0
  73. package/.agent/skills/huggingface-llm-trainer/references/hardware_guide.md +283 -0
  74. package/.agent/skills/huggingface-llm-trainer/references/hub_saving.md +364 -0
  75. package/.agent/skills/huggingface-llm-trainer/references/local_training_macos.md +231 -0
  76. package/.agent/skills/huggingface-llm-trainer/references/reliability_principles.md +371 -0
  77. package/.agent/skills/huggingface-llm-trainer/references/trackio_guide.md +191 -0
  78. package/.agent/skills/huggingface-llm-trainer/references/training_methods.md +150 -0
  79. package/.agent/skills/huggingface-llm-trainer/references/training_patterns.md +203 -0
  80. package/.agent/skills/huggingface-llm-trainer/references/troubleshooting.md +282 -0
  81. package/.agent/skills/huggingface-llm-trainer/references/unsloth.md +313 -0
  82. package/.agent/skills/huggingface-llm-trainer/scripts/convert_to_gguf.py +424 -0
  83. package/.agent/skills/huggingface-llm-trainer/scripts/dataset_inspector.py +417 -0
  84. package/.agent/skills/huggingface-llm-trainer/scripts/estimate_cost.py +150 -0
  85. package/.agent/skills/huggingface-llm-trainer/scripts/hf_benchmarks.py +659 -0
  86. package/.agent/skills/huggingface-llm-trainer/scripts/train_dpo_example.py +106 -0
  87. package/.agent/skills/huggingface-llm-trainer/scripts/train_grpo_example.py +89 -0
  88. package/.agent/skills/huggingface-llm-trainer/scripts/train_sft_example.py +122 -0
  89. package/.agent/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py +512 -0
  90. package/.agent/skills/huggingface-local-models/SKILL.md +113 -0
  91. package/.agent/skills/huggingface-local-models/references/hardware.md +38 -0
  92. package/.agent/skills/huggingface-local-models/references/hub-discovery.md +178 -0
  93. package/.agent/skills/huggingface-local-models/references/quantization.md +256 -0
  94. package/.agent/skills/huggingface-lora-space-builder/SKILL.md +394 -0
  95. package/.agent/skills/huggingface-lora-space-builder/references/adapting-to-the-lora.md +113 -0
  96. package/.agent/skills/huggingface-lora-space-builder/references/base-models/krea-2.md +63 -0
  97. package/.agent/skills/huggingface-lora-space-builder/references/base-models/ltx.md +205 -0
  98. package/.agent/skills/huggingface-lora-space-builder/references/base-models/qwen-image.md +144 -0
  99. package/.agent/skills/huggingface-lora-space-builder/references/creative-mode.md +262 -0
  100. package/.agent/skills/huggingface-lora-space-builder/references/tasks.md +124 -0
  101. package/.agent/skills/huggingface-lora-space-builder/references/zerogpu-and-publishing.md +196 -0
  102. package/.agent/skills/huggingface-paper-publisher/SKILL.md +624 -0
  103. package/.agent/skills/huggingface-paper-publisher/examples/example_usage.md +326 -0
  104. package/.agent/skills/huggingface-paper-publisher/references/quick_reference.md +216 -0
  105. package/.agent/skills/huggingface-paper-publisher/scripts/paper_manager.py +606 -0
  106. package/.agent/skills/huggingface-paper-publisher/templates/arxiv.md +299 -0
  107. package/.agent/skills/huggingface-paper-publisher/templates/ml-report.md +358 -0
  108. package/.agent/skills/huggingface-paper-publisher/templates/modern.md +319 -0
  109. package/.agent/skills/huggingface-paper-publisher/templates/standard.md +201 -0
  110. package/.agent/skills/huggingface-papers/SKILL.md +239 -0
  111. package/.agent/skills/huggingface-spaces/README.md +9 -0
  112. package/.agent/skills/huggingface-spaces/SKILL.md +242 -0
  113. package/.agent/skills/huggingface-spaces/references/3d-cuda-extensions.md +109 -0
  114. package/.agent/skills/huggingface-spaces/references/3d-generation.md +98 -0
  115. package/.agent/skills/huggingface-spaces/references/3d-gsplat.md +53 -0
  116. package/.agent/skills/huggingface-spaces/references/3d-models.md +227 -0
  117. package/.agent/skills/huggingface-spaces/references/3d-outputs.md +114 -0
  118. package/.agent/skills/huggingface-spaces/references/buckets.md +89 -0
  119. package/.agent/skills/huggingface-spaces/references/debugging.md +236 -0
  120. package/.agent/skills/huggingface-spaces/references/gradio.md +200 -0
  121. package/.agent/skills/huggingface-spaces/references/grants.md +63 -0
  122. package/.agent/skills/huggingface-spaces/references/inference-providers.md +97 -0
  123. package/.agent/skills/huggingface-spaces/references/known-errors.md +232 -0
  124. package/.agent/skills/huggingface-spaces/references/requirements.md +169 -0
  125. package/.agent/skills/huggingface-spaces/references/zerogpu.md +349 -0
  126. package/.agent/skills/huggingface-tool-builder/SKILL.md +120 -0
  127. package/.agent/skills/huggingface-tool-builder/references/baseline_hf_api.py +57 -0
  128. package/.agent/skills/huggingface-tool-builder/references/baseline_hf_api.sh +40 -0
  129. package/.agent/skills/huggingface-tool-builder/references/baseline_hf_api.tsx +57 -0
  130. package/.agent/skills/huggingface-tool-builder/references/find_models_by_paper.sh +230 -0
  131. package/.agent/skills/huggingface-tool-builder/references/hf_enrich_models.sh +96 -0
  132. package/.agent/skills/huggingface-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
  133. package/.agent/skills/huggingface-tool-builder/references/hf_model_papers_auth.sh +171 -0
  134. package/.agent/skills/huggingface-trackio/SKILL.md +142 -0
  135. package/.agent/skills/huggingface-trackio/references/alerts.md +196 -0
  136. package/.agent/skills/huggingface-trackio/references/logging_metrics.md +212 -0
  137. package/.agent/skills/huggingface-trackio/references/retrieving_metrics.md +251 -0
  138. package/.agent/skills/huggingface-vision-trainer/SKILL.md +593 -0
  139. package/.agent/skills/huggingface-vision-trainer/references/finetune_sam2_trainer.md +254 -0
  140. package/.agent/skills/huggingface-vision-trainer/references/hub_saving.md +618 -0
  141. package/.agent/skills/huggingface-vision-trainer/references/image_classification_training_notebook.md +279 -0
  142. package/.agent/skills/huggingface-vision-trainer/references/object_detection_training_notebook.md +700 -0
  143. package/.agent/skills/huggingface-vision-trainer/references/reliability_principles.md +310 -0
  144. package/.agent/skills/huggingface-vision-trainer/references/timm_trainer.md +91 -0
  145. package/.agent/skills/huggingface-vision-trainer/scripts/dataset_inspector.py +814 -0
  146. package/.agent/skills/huggingface-vision-trainer/scripts/estimate_cost.py +217 -0
  147. package/.agent/skills/huggingface-vision-trainer/scripts/image_classification_training.py +383 -0
  148. package/.agent/skills/huggingface-vision-trainer/scripts/object_detection_training.py +710 -0
  149. package/.agent/skills/huggingface-vision-trainer/scripts/sam_segmentation_training.py +382 -0
  150. package/.agent/skills/huggingface-zerogpu/SKILL.md +289 -0
  151. package/.agent/skills/huggingface-zerogpu/references/concurrency.md +79 -0
  152. package/.agent/skills/huggingface-zerogpu/references/cuda-and-deps.md +66 -0
  153. package/.agent/skills/huggingface-zerogpu/references/how-quota-works.md +74 -0
  154. package/.agent/skills/huggingface-zerogpu/references/how-zerogpu-works.md +50 -0
  155. package/.agent/skills/human-gate-negotiation/SKILL.md +30 -0
  156. package/.agent/skills/intelligent-routing/SKILL.md +10 -4
  157. package/.agent/skills/semantic-filesystem-navigation/SKILL.md +24 -0
  158. package/.agent/skills/session-log-interrogation/SKILL.md +29 -0
  159. package/.agent/skills/subagent-driven-development/SKILL.md +32 -0
  160. package/.agent/skills/systematic-debugging/SKILL.md +5 -0
  161. package/.agent/skills/train-sentence-transformers/SKILL.md +109 -0
  162. package/.agent/skills/train-sentence-transformers/references/base_model_selection.md +79 -0
  163. package/.agent/skills/train-sentence-transformers/references/dataset_formats.md +128 -0
  164. package/.agent/skills/train-sentence-transformers/references/evaluators_cross_encoder.md +116 -0
  165. package/.agent/skills/train-sentence-transformers/references/evaluators_multi_vector_encoder.md +101 -0
  166. package/.agent/skills/train-sentence-transformers/references/evaluators_sentence_transformer.md +151 -0
  167. package/.agent/skills/train-sentence-transformers/references/evaluators_sparse_encoder.md +121 -0
  168. package/.agent/skills/train-sentence-transformers/references/hardware_guide.md +105 -0
  169. package/.agent/skills/train-sentence-transformers/references/hf_jobs_execution.md +173 -0
  170. package/.agent/skills/train-sentence-transformers/references/losses_cross_encoder.md +137 -0
  171. package/.agent/skills/train-sentence-transformers/references/losses_multi_vector_encoder.md +100 -0
  172. package/.agent/skills/train-sentence-transformers/references/losses_sentence_transformer.md +246 -0
  173. package/.agent/skills/train-sentence-transformers/references/losses_sparse_encoder.md +106 -0
  174. package/.agent/skills/train-sentence-transformers/references/model_architectures.md +178 -0
  175. package/.agent/skills/train-sentence-transformers/references/prompts_and_instructions.md +160 -0
  176. package/.agent/skills/train-sentence-transformers/references/training_args.md +270 -0
  177. package/.agent/skills/train-sentence-transformers/references/troubleshooting.md +225 -0
  178. package/.agent/skills/train-sentence-transformers/scripts/mine_hard_negatives.py +199 -0
  179. package/.agent/skills/train-sentence-transformers/scripts/train_cross_encoder_distillation_example.py +254 -0
  180. package/.agent/skills/train-sentence-transformers/scripts/train_cross_encoder_example.py +253 -0
  181. package/.agent/skills/train-sentence-transformers/scripts/train_cross_encoder_listwise_example.py +282 -0
  182. package/.agent/skills/train-sentence-transformers/scripts/train_multi_vector_encoder_example.py +240 -0
  183. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_distillation_example.py +303 -0
  184. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_example.py +227 -0
  185. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_make_multilingual_example.py +308 -0
  186. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_matryoshka_example.py +212 -0
  187. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_multi_dataset_example.py +258 -0
  188. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_static_embedding_example.py +273 -0
  189. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_with_lora_example.py +275 -0
  190. package/.agent/skills/train-sentence-transformers/scripts/train_sparse_encoder_distillation_example.py +262 -0
  191. package/.agent/skills/train-sentence-transformers/scripts/train_sparse_encoder_example.py +237 -0
  192. package/.agent/skills/transformers-js/SKILL.md +692 -0
  193. package/.agent/skills/transformers-js/references/CACHE.md +339 -0
  194. package/.agent/skills/transformers-js/references/CONFIGURATION.md +438 -0
  195. package/.agent/skills/transformers-js/references/EXAMPLES.md +620 -0
  196. package/.agent/skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
  197. package/.agent/skills/transformers-js/references/MODEL_REGISTRY.md +197 -0
  198. package/.agent/skills/transformers-js/references/PIPELINE_OPTIONS.md +557 -0
  199. package/.agent/skills/transformers-js/references/TEXT_GENERATION.md +315 -0
  200. package/.agent/skills/tribunal-instincts-memory/SKILL.md +31 -0
  201. package/.agent/skills/trl-training/SKILL.md +318 -0
  202. package/.agent/workflows/assimilate.md +21 -0
  203. package/.agent/workflows/audit.md +5 -0
  204. package/.agent/workflows/generate.md +5 -0
  205. package/.agent/workflows/htop.md +22 -0
  206. package/.agent/workflows/marathon.md +5 -0
  207. package/.agent/workflows/resume.md +20 -0
  208. package/.agent/workflows/team-mode.md +22 -0
  209. package/.agents/skills/agent-syscall-guidelines/SKILL.md +25 -0
  210. package/.agents/skills/agentic-workflows-2026/SKILL.md +8 -0
  211. package/.agents/skills/agentshield-security/SKILL.md +26 -0
  212. package/.agents/skills/context-engineering-pro/SKILL.md +7 -0
  213. package/.agents/skills/fabel-protocol/SKILL.md +5 -0
  214. package/.agents/skills/graph-engineering/SKILL.md +28 -0
  215. package/.agents/skills/harness-protocol/SKILL.md +8 -0
  216. package/.agents/skills/hf-cli/SKILL.md +239 -0
  217. package/.agents/skills/hf-cloud-aws-context-discovery/SKILL.md +74 -0
  218. package/.agents/skills/hf-cloud-python-env-setup/SKILL.md +90 -0
  219. package/.agents/skills/hf-cloud-python-env-setup/requirements.txt +17 -0
  220. package/.agents/skills/hf-cloud-python-env-setup/scripts/check_versions.py +29 -0
  221. package/.agents/skills/hf-cloud-python-env-setup/scripts/setup_env.py +143 -0
  222. package/.agents/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +90 -0
  223. package/.agents/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +102 -0
  224. package/.agents/skills/hf-cloud-sagemaker-iam-preflight/references/minimum-permissions.json +47 -0
  225. package/.agents/skills/hf-cloud-sagemaker-iam-preflight/references/trust-policy.json +12 -0
  226. package/.agents/skills/hf-cloud-sagemaker-iam-preflight/scripts/check_role.py +184 -0
  227. package/.agents/skills/hf-cloud-sagemaker-iam-preflight/scripts/create_role.py +118 -0
  228. package/.agents/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +419 -0
  229. package/.agents/skills/hf-cloud-sagemaker-production-defaults/references/deployment-template.md +59 -0
  230. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/_common.py +148 -0
  231. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy.py +327 -0
  232. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_async.py +434 -0
  233. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_ic.py +506 -0
  234. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/invoke_endpoint.py +180 -0
  235. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/teardown.py +246 -0
  236. package/.agents/skills/hf-cloud-serving-image-selection/SKILL.md +220 -0
  237. package/.agents/skills/hf-cloud-serving-image-selection/references/model-to-image.md +111 -0
  238. package/.agents/skills/hf-cloud-serving-image-selection/scripts/mirror_image.py +145 -0
  239. package/.agents/skills/hf-mem/SKILL.md +79 -0
  240. package/.agents/skills/huggingface-best/SKILL.md +134 -0
  241. package/.agents/skills/huggingface-community-evals/SKILL.md +207 -0
  242. package/.agents/skills/huggingface-community-evals/examples/.env.example +3 -0
  243. package/.agents/skills/huggingface-community-evals/examples/USAGE_EXAMPLES.md +101 -0
  244. package/.agents/skills/huggingface-community-evals/scripts/inspect_eval_uv.py +104 -0
  245. package/.agents/skills/huggingface-community-evals/scripts/inspect_vllm_uv.py +306 -0
  246. package/.agents/skills/huggingface-community-evals/scripts/lighteval_vllm_uv.py +297 -0
  247. package/.agents/skills/huggingface-datasets/SKILL.md +107 -0
  248. package/.agents/skills/huggingface-gradio/SKILL.md +298 -0
  249. package/.agents/skills/huggingface-gradio/examples.md +613 -0
  250. package/.agents/skills/huggingface-llm-trainer/SKILL.md +738 -0
  251. package/.agents/skills/huggingface-llm-trainer/references/gguf_conversion.md +296 -0
  252. package/.agents/skills/huggingface-llm-trainer/references/hardware_guide.md +283 -0
  253. package/.agents/skills/huggingface-llm-trainer/references/hub_saving.md +364 -0
  254. package/.agents/skills/huggingface-llm-trainer/references/local_training_macos.md +231 -0
  255. package/.agents/skills/huggingface-llm-trainer/references/reliability_principles.md +371 -0
  256. package/.agents/skills/huggingface-llm-trainer/references/trackio_guide.md +191 -0
  257. package/.agents/skills/huggingface-llm-trainer/references/training_methods.md +150 -0
  258. package/.agents/skills/huggingface-llm-trainer/references/training_patterns.md +203 -0
  259. package/.agents/skills/huggingface-llm-trainer/references/troubleshooting.md +282 -0
  260. package/.agents/skills/huggingface-llm-trainer/references/unsloth.md +313 -0
  261. package/.agents/skills/huggingface-llm-trainer/scripts/convert_to_gguf.py +424 -0
  262. package/.agents/skills/huggingface-llm-trainer/scripts/dataset_inspector.py +417 -0
  263. package/.agents/skills/huggingface-llm-trainer/scripts/estimate_cost.py +150 -0
  264. package/.agents/skills/huggingface-llm-trainer/scripts/hf_benchmarks.py +659 -0
  265. package/.agents/skills/huggingface-llm-trainer/scripts/train_dpo_example.py +106 -0
  266. package/.agents/skills/huggingface-llm-trainer/scripts/train_grpo_example.py +89 -0
  267. package/.agents/skills/huggingface-llm-trainer/scripts/train_sft_example.py +122 -0
  268. package/.agents/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py +512 -0
  269. package/.agents/skills/huggingface-local-models/SKILL.md +113 -0
  270. package/.agents/skills/huggingface-local-models/references/hardware.md +38 -0
  271. package/.agents/skills/huggingface-local-models/references/hub-discovery.md +178 -0
  272. package/.agents/skills/huggingface-local-models/references/quantization.md +256 -0
  273. package/.agents/skills/huggingface-lora-space-builder/SKILL.md +394 -0
  274. package/.agents/skills/huggingface-lora-space-builder/references/adapting-to-the-lora.md +113 -0
  275. package/.agents/skills/huggingface-lora-space-builder/references/base-models/krea-2.md +63 -0
  276. package/.agents/skills/huggingface-lora-space-builder/references/base-models/ltx.md +205 -0
  277. package/.agents/skills/huggingface-lora-space-builder/references/base-models/qwen-image.md +144 -0
  278. package/.agents/skills/huggingface-lora-space-builder/references/creative-mode.md +262 -0
  279. package/.agents/skills/huggingface-lora-space-builder/references/tasks.md +124 -0
  280. package/.agents/skills/huggingface-lora-space-builder/references/zerogpu-and-publishing.md +196 -0
  281. package/.agents/skills/huggingface-paper-publisher/SKILL.md +624 -0
  282. package/.agents/skills/huggingface-paper-publisher/examples/example_usage.md +326 -0
  283. package/.agents/skills/huggingface-paper-publisher/references/quick_reference.md +216 -0
  284. package/.agents/skills/huggingface-paper-publisher/scripts/paper_manager.py +606 -0
  285. package/.agents/skills/huggingface-paper-publisher/templates/arxiv.md +299 -0
  286. package/.agents/skills/huggingface-paper-publisher/templates/ml-report.md +358 -0
  287. package/.agents/skills/huggingface-paper-publisher/templates/modern.md +319 -0
  288. package/.agents/skills/huggingface-paper-publisher/templates/standard.md +201 -0
  289. package/.agents/skills/huggingface-papers/SKILL.md +239 -0
  290. package/.agents/skills/huggingface-spaces/README.md +9 -0
  291. package/.agents/skills/huggingface-spaces/SKILL.md +242 -0
  292. package/.agents/skills/huggingface-spaces/references/3d-cuda-extensions.md +109 -0
  293. package/.agents/skills/huggingface-spaces/references/3d-generation.md +98 -0
  294. package/.agents/skills/huggingface-spaces/references/3d-gsplat.md +53 -0
  295. package/.agents/skills/huggingface-spaces/references/3d-models.md +227 -0
  296. package/.agents/skills/huggingface-spaces/references/3d-outputs.md +114 -0
  297. package/.agents/skills/huggingface-spaces/references/buckets.md +89 -0
  298. package/.agents/skills/huggingface-spaces/references/debugging.md +236 -0
  299. package/.agents/skills/huggingface-spaces/references/gradio.md +200 -0
  300. package/.agents/skills/huggingface-spaces/references/grants.md +63 -0
  301. package/.agents/skills/huggingface-spaces/references/inference-providers.md +97 -0
  302. package/.agents/skills/huggingface-spaces/references/known-errors.md +232 -0
  303. package/.agents/skills/huggingface-spaces/references/requirements.md +169 -0
  304. package/.agents/skills/huggingface-spaces/references/zerogpu.md +349 -0
  305. package/.agents/skills/huggingface-tool-builder/SKILL.md +120 -0
  306. package/.agents/skills/huggingface-tool-builder/references/baseline_hf_api.py +57 -0
  307. package/.agents/skills/huggingface-tool-builder/references/baseline_hf_api.sh +40 -0
  308. package/.agents/skills/huggingface-tool-builder/references/baseline_hf_api.tsx +57 -0
  309. package/.agents/skills/huggingface-tool-builder/references/find_models_by_paper.sh +230 -0
  310. package/.agents/skills/huggingface-tool-builder/references/hf_enrich_models.sh +96 -0
  311. package/.agents/skills/huggingface-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
  312. package/.agents/skills/huggingface-tool-builder/references/hf_model_papers_auth.sh +171 -0
  313. package/.agents/skills/huggingface-trackio/SKILL.md +142 -0
  314. package/.agents/skills/huggingface-trackio/references/alerts.md +196 -0
  315. package/.agents/skills/huggingface-trackio/references/logging_metrics.md +212 -0
  316. package/.agents/skills/huggingface-trackio/references/retrieving_metrics.md +251 -0
  317. package/.agents/skills/huggingface-vision-trainer/SKILL.md +593 -0
  318. package/.agents/skills/huggingface-vision-trainer/references/finetune_sam2_trainer.md +254 -0
  319. package/.agents/skills/huggingface-vision-trainer/references/hub_saving.md +618 -0
  320. package/.agents/skills/huggingface-vision-trainer/references/image_classification_training_notebook.md +279 -0
  321. package/.agents/skills/huggingface-vision-trainer/references/object_detection_training_notebook.md +700 -0
  322. package/.agents/skills/huggingface-vision-trainer/references/reliability_principles.md +310 -0
  323. package/.agents/skills/huggingface-vision-trainer/references/timm_trainer.md +91 -0
  324. package/.agents/skills/huggingface-vision-trainer/scripts/dataset_inspector.py +814 -0
  325. package/.agents/skills/huggingface-vision-trainer/scripts/estimate_cost.py +217 -0
  326. package/.agents/skills/huggingface-vision-trainer/scripts/image_classification_training.py +383 -0
  327. package/.agents/skills/huggingface-vision-trainer/scripts/object_detection_training.py +710 -0
  328. package/.agents/skills/huggingface-vision-trainer/scripts/sam_segmentation_training.py +382 -0
  329. package/.agents/skills/huggingface-zerogpu/SKILL.md +289 -0
  330. package/.agents/skills/huggingface-zerogpu/references/concurrency.md +79 -0
  331. package/.agents/skills/huggingface-zerogpu/references/cuda-and-deps.md +66 -0
  332. package/.agents/skills/huggingface-zerogpu/references/how-quota-works.md +74 -0
  333. package/.agents/skills/huggingface-zerogpu/references/how-zerogpu-works.md +50 -0
  334. package/.agents/skills/human-gate-negotiation/SKILL.md +30 -0
  335. package/.agents/skills/intelligent-routing/SKILL.md +10 -4
  336. package/.agents/skills/semantic-filesystem-navigation/SKILL.md +24 -0
  337. package/.agents/skills/session-log-interrogation/SKILL.md +29 -0
  338. package/.agents/skills/subagent-driven-development/SKILL.md +32 -0
  339. package/.agents/skills/systematic-debugging/SKILL.md +5 -0
  340. package/.agents/skills/train-sentence-transformers/SKILL.md +109 -0
  341. package/.agents/skills/train-sentence-transformers/references/base_model_selection.md +79 -0
  342. package/.agents/skills/train-sentence-transformers/references/dataset_formats.md +128 -0
  343. package/.agents/skills/train-sentence-transformers/references/evaluators_cross_encoder.md +116 -0
  344. package/.agents/skills/train-sentence-transformers/references/evaluators_multi_vector_encoder.md +101 -0
  345. package/.agents/skills/train-sentence-transformers/references/evaluators_sentence_transformer.md +151 -0
  346. package/.agents/skills/train-sentence-transformers/references/evaluators_sparse_encoder.md +121 -0
  347. package/.agents/skills/train-sentence-transformers/references/hardware_guide.md +105 -0
  348. package/.agents/skills/train-sentence-transformers/references/hf_jobs_execution.md +173 -0
  349. package/.agents/skills/train-sentence-transformers/references/losses_cross_encoder.md +137 -0
  350. package/.agents/skills/train-sentence-transformers/references/losses_multi_vector_encoder.md +100 -0
  351. package/.agents/skills/train-sentence-transformers/references/losses_sentence_transformer.md +246 -0
  352. package/.agents/skills/train-sentence-transformers/references/losses_sparse_encoder.md +106 -0
  353. package/.agents/skills/train-sentence-transformers/references/model_architectures.md +178 -0
  354. package/.agents/skills/train-sentence-transformers/references/prompts_and_instructions.md +160 -0
  355. package/.agents/skills/train-sentence-transformers/references/training_args.md +270 -0
  356. package/.agents/skills/train-sentence-transformers/references/troubleshooting.md +225 -0
  357. package/.agents/skills/train-sentence-transformers/scripts/mine_hard_negatives.py +199 -0
  358. package/.agents/skills/train-sentence-transformers/scripts/train_cross_encoder_distillation_example.py +254 -0
  359. package/.agents/skills/train-sentence-transformers/scripts/train_cross_encoder_example.py +253 -0
  360. package/.agents/skills/train-sentence-transformers/scripts/train_cross_encoder_listwise_example.py +282 -0
  361. package/.agents/skills/train-sentence-transformers/scripts/train_multi_vector_encoder_example.py +240 -0
  362. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_distillation_example.py +303 -0
  363. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_example.py +227 -0
  364. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_make_multilingual_example.py +308 -0
  365. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_matryoshka_example.py +212 -0
  366. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_multi_dataset_example.py +258 -0
  367. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_static_embedding_example.py +273 -0
  368. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_with_lora_example.py +275 -0
  369. package/.agents/skills/train-sentence-transformers/scripts/train_sparse_encoder_distillation_example.py +262 -0
  370. package/.agents/skills/train-sentence-transformers/scripts/train_sparse_encoder_example.py +237 -0
  371. package/.agents/skills/transformers-js/SKILL.md +692 -0
  372. package/.agents/skills/transformers-js/references/CACHE.md +339 -0
  373. package/.agents/skills/transformers-js/references/CONFIGURATION.md +438 -0
  374. package/.agents/skills/transformers-js/references/EXAMPLES.md +620 -0
  375. package/.agents/skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
  376. package/.agents/skills/transformers-js/references/MODEL_REGISTRY.md +197 -0
  377. package/.agents/skills/transformers-js/references/PIPELINE_OPTIONS.md +557 -0
  378. package/.agents/skills/transformers-js/references/TEXT_GENERATION.md +315 -0
  379. package/.agents/skills/tribunal-instincts-memory/SKILL.md +31 -0
  380. package/.agents/skills/trl-training/SKILL.md +318 -0
  381. package/CONTRIBUTING.md +2 -2
  382. package/README.md +135 -435
  383. package/bin/adapter-install.js +1 -1
  384. package/bin/mcp-server.js +5 -5
  385. package/dist/tui/banner.js +1 -1
  386. package/gemini-extension.json +1 -1
  387. package/mcp_config.json +1 -1
  388. package/package.json +7 -7
  389. package/plugin.json +1 -1
  390. package/scripts/context_compiler.js +1 -1
  391. package/scripts/skill_enhancement_engine.js +6 -6
  392. package/skills/agent-syscall-guidelines/SKILL.md +25 -0
  393. package/skills/agentic-workflows-2026/SKILL.md +8 -0
  394. package/skills/agentshield-security/SKILL.md +26 -0
  395. package/skills/context-engineering-pro/SKILL.md +7 -0
  396. package/skills/fabel-protocol/SKILL.md +5 -0
  397. package/skills/graph-engineering/SKILL.md +28 -0
  398. package/skills/harness-protocol/SKILL.md +8 -0
  399. package/skills/hf-cli/SKILL.md +239 -0
  400. package/skills/hf-cloud-aws-context-discovery/SKILL.md +74 -0
  401. package/skills/hf-cloud-python-env-setup/SKILL.md +90 -0
  402. package/skills/hf-cloud-python-env-setup/requirements.txt +17 -0
  403. package/skills/hf-cloud-python-env-setup/scripts/check_versions.py +29 -0
  404. package/skills/hf-cloud-python-env-setup/scripts/setup_env.py +143 -0
  405. package/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +90 -0
  406. package/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +102 -0
  407. package/skills/hf-cloud-sagemaker-iam-preflight/references/minimum-permissions.json +47 -0
  408. package/skills/hf-cloud-sagemaker-iam-preflight/references/trust-policy.json +12 -0
  409. package/skills/hf-cloud-sagemaker-iam-preflight/scripts/check_role.py +184 -0
  410. package/skills/hf-cloud-sagemaker-iam-preflight/scripts/create_role.py +118 -0
  411. package/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +419 -0
  412. package/skills/hf-cloud-sagemaker-production-defaults/references/deployment-template.md +59 -0
  413. package/skills/hf-cloud-sagemaker-production-defaults/scripts/_common.py +148 -0
  414. package/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy.py +327 -0
  415. package/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_async.py +434 -0
  416. package/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_ic.py +506 -0
  417. package/skills/hf-cloud-sagemaker-production-defaults/scripts/invoke_endpoint.py +180 -0
  418. package/skills/hf-cloud-sagemaker-production-defaults/scripts/teardown.py +246 -0
  419. package/skills/hf-cloud-serving-image-selection/SKILL.md +220 -0
  420. package/skills/hf-cloud-serving-image-selection/references/model-to-image.md +111 -0
  421. package/skills/hf-cloud-serving-image-selection/scripts/mirror_image.py +145 -0
  422. package/skills/hf-mem/SKILL.md +79 -0
  423. package/skills/huggingface-best/SKILL.md +134 -0
  424. package/skills/huggingface-community-evals/SKILL.md +207 -0
  425. package/skills/huggingface-community-evals/examples/.env.example +3 -0
  426. package/skills/huggingface-community-evals/examples/USAGE_EXAMPLES.md +101 -0
  427. package/skills/huggingface-community-evals/scripts/inspect_eval_uv.py +104 -0
  428. package/skills/huggingface-community-evals/scripts/inspect_vllm_uv.py +306 -0
  429. package/skills/huggingface-community-evals/scripts/lighteval_vllm_uv.py +297 -0
  430. package/skills/huggingface-datasets/SKILL.md +107 -0
  431. package/skills/huggingface-gradio/SKILL.md +298 -0
  432. package/skills/huggingface-gradio/examples.md +613 -0
  433. package/skills/huggingface-llm-trainer/SKILL.md +738 -0
  434. package/skills/huggingface-llm-trainer/references/gguf_conversion.md +296 -0
  435. package/skills/huggingface-llm-trainer/references/hardware_guide.md +283 -0
  436. package/skills/huggingface-llm-trainer/references/hub_saving.md +364 -0
  437. package/skills/huggingface-llm-trainer/references/local_training_macos.md +231 -0
  438. package/skills/huggingface-llm-trainer/references/reliability_principles.md +371 -0
  439. package/skills/huggingface-llm-trainer/references/trackio_guide.md +191 -0
  440. package/skills/huggingface-llm-trainer/references/training_methods.md +150 -0
  441. package/skills/huggingface-llm-trainer/references/training_patterns.md +203 -0
  442. package/skills/huggingface-llm-trainer/references/troubleshooting.md +282 -0
  443. package/skills/huggingface-llm-trainer/references/unsloth.md +313 -0
  444. package/skills/huggingface-llm-trainer/scripts/convert_to_gguf.py +424 -0
  445. package/skills/huggingface-llm-trainer/scripts/dataset_inspector.py +417 -0
  446. package/skills/huggingface-llm-trainer/scripts/estimate_cost.py +150 -0
  447. package/skills/huggingface-llm-trainer/scripts/hf_benchmarks.py +659 -0
  448. package/skills/huggingface-llm-trainer/scripts/train_dpo_example.py +106 -0
  449. package/skills/huggingface-llm-trainer/scripts/train_grpo_example.py +89 -0
  450. package/skills/huggingface-llm-trainer/scripts/train_sft_example.py +122 -0
  451. package/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py +512 -0
  452. package/skills/huggingface-local-models/SKILL.md +113 -0
  453. package/skills/huggingface-local-models/references/hardware.md +38 -0
  454. package/skills/huggingface-local-models/references/hub-discovery.md +178 -0
  455. package/skills/huggingface-local-models/references/quantization.md +256 -0
  456. package/skills/huggingface-lora-space-builder/SKILL.md +394 -0
  457. package/skills/huggingface-lora-space-builder/references/adapting-to-the-lora.md +113 -0
  458. package/skills/huggingface-lora-space-builder/references/base-models/krea-2.md +63 -0
  459. package/skills/huggingface-lora-space-builder/references/base-models/ltx.md +205 -0
  460. package/skills/huggingface-lora-space-builder/references/base-models/qwen-image.md +144 -0
  461. package/skills/huggingface-lora-space-builder/references/creative-mode.md +262 -0
  462. package/skills/huggingface-lora-space-builder/references/tasks.md +124 -0
  463. package/skills/huggingface-lora-space-builder/references/zerogpu-and-publishing.md +196 -0
  464. package/skills/huggingface-paper-publisher/SKILL.md +624 -0
  465. package/skills/huggingface-paper-publisher/examples/example_usage.md +326 -0
  466. package/skills/huggingface-paper-publisher/references/quick_reference.md +216 -0
  467. package/skills/huggingface-paper-publisher/scripts/paper_manager.py +606 -0
  468. package/skills/huggingface-paper-publisher/templates/arxiv.md +299 -0
  469. package/skills/huggingface-paper-publisher/templates/ml-report.md +358 -0
  470. package/skills/huggingface-paper-publisher/templates/modern.md +319 -0
  471. package/skills/huggingface-paper-publisher/templates/standard.md +201 -0
  472. package/skills/huggingface-papers/SKILL.md +239 -0
  473. package/skills/huggingface-spaces/README.md +9 -0
  474. package/skills/huggingface-spaces/SKILL.md +242 -0
  475. package/skills/huggingface-spaces/references/3d-cuda-extensions.md +109 -0
  476. package/skills/huggingface-spaces/references/3d-generation.md +98 -0
  477. package/skills/huggingface-spaces/references/3d-gsplat.md +53 -0
  478. package/skills/huggingface-spaces/references/3d-models.md +227 -0
  479. package/skills/huggingface-spaces/references/3d-outputs.md +114 -0
  480. package/skills/huggingface-spaces/references/buckets.md +89 -0
  481. package/skills/huggingface-spaces/references/debugging.md +236 -0
  482. package/skills/huggingface-spaces/references/gradio.md +200 -0
  483. package/skills/huggingface-spaces/references/grants.md +63 -0
  484. package/skills/huggingface-spaces/references/inference-providers.md +97 -0
  485. package/skills/huggingface-spaces/references/known-errors.md +232 -0
  486. package/skills/huggingface-spaces/references/requirements.md +169 -0
  487. package/skills/huggingface-spaces/references/zerogpu.md +349 -0
  488. package/skills/huggingface-tool-builder/SKILL.md +120 -0
  489. package/skills/huggingface-tool-builder/references/baseline_hf_api.py +57 -0
  490. package/skills/huggingface-tool-builder/references/baseline_hf_api.sh +40 -0
  491. package/skills/huggingface-tool-builder/references/baseline_hf_api.tsx +57 -0
  492. package/skills/huggingface-tool-builder/references/find_models_by_paper.sh +230 -0
  493. package/skills/huggingface-tool-builder/references/hf_enrich_models.sh +96 -0
  494. package/skills/huggingface-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
  495. package/skills/huggingface-tool-builder/references/hf_model_papers_auth.sh +171 -0
  496. package/skills/huggingface-trackio/SKILL.md +142 -0
  497. package/skills/huggingface-trackio/references/alerts.md +196 -0
  498. package/skills/huggingface-trackio/references/logging_metrics.md +212 -0
  499. package/skills/huggingface-trackio/references/retrieving_metrics.md +251 -0
  500. package/skills/huggingface-vision-trainer/SKILL.md +593 -0
  501. package/skills/huggingface-vision-trainer/references/finetune_sam2_trainer.md +254 -0
  502. package/skills/huggingface-vision-trainer/references/hub_saving.md +618 -0
  503. package/skills/huggingface-vision-trainer/references/image_classification_training_notebook.md +279 -0
  504. package/skills/huggingface-vision-trainer/references/object_detection_training_notebook.md +700 -0
  505. package/skills/huggingface-vision-trainer/references/reliability_principles.md +310 -0
  506. package/skills/huggingface-vision-trainer/references/timm_trainer.md +91 -0
  507. package/skills/huggingface-vision-trainer/scripts/dataset_inspector.py +814 -0
  508. package/skills/huggingface-vision-trainer/scripts/estimate_cost.py +217 -0
  509. package/skills/huggingface-vision-trainer/scripts/image_classification_training.py +383 -0
  510. package/skills/huggingface-vision-trainer/scripts/object_detection_training.py +710 -0
  511. package/skills/huggingface-vision-trainer/scripts/sam_segmentation_training.py +382 -0
  512. package/skills/huggingface-zerogpu/SKILL.md +289 -0
  513. package/skills/huggingface-zerogpu/references/concurrency.md +79 -0
  514. package/skills/huggingface-zerogpu/references/cuda-and-deps.md +66 -0
  515. package/skills/huggingface-zerogpu/references/how-quota-works.md +74 -0
  516. package/skills/huggingface-zerogpu/references/how-zerogpu-works.md +50 -0
  517. package/skills/human-gate-negotiation/SKILL.md +30 -0
  518. package/skills/intelligent-routing/SKILL.md +10 -4
  519. package/skills/semantic-filesystem-navigation/SKILL.md +24 -0
  520. package/skills/session-log-interrogation/SKILL.md +29 -0
  521. package/skills/subagent-driven-development/SKILL.md +32 -0
  522. package/skills/systematic-debugging/SKILL.md +5 -0
  523. package/skills/train-sentence-transformers/SKILL.md +109 -0
  524. package/skills/train-sentence-transformers/references/base_model_selection.md +79 -0
  525. package/skills/train-sentence-transformers/references/dataset_formats.md +128 -0
  526. package/skills/train-sentence-transformers/references/evaluators_cross_encoder.md +116 -0
  527. package/skills/train-sentence-transformers/references/evaluators_multi_vector_encoder.md +101 -0
  528. package/skills/train-sentence-transformers/references/evaluators_sentence_transformer.md +151 -0
  529. package/skills/train-sentence-transformers/references/evaluators_sparse_encoder.md +121 -0
  530. package/skills/train-sentence-transformers/references/hardware_guide.md +105 -0
  531. package/skills/train-sentence-transformers/references/hf_jobs_execution.md +173 -0
  532. package/skills/train-sentence-transformers/references/losses_cross_encoder.md +137 -0
  533. package/skills/train-sentence-transformers/references/losses_multi_vector_encoder.md +100 -0
  534. package/skills/train-sentence-transformers/references/losses_sentence_transformer.md +246 -0
  535. package/skills/train-sentence-transformers/references/losses_sparse_encoder.md +106 -0
  536. package/skills/train-sentence-transformers/references/model_architectures.md +178 -0
  537. package/skills/train-sentence-transformers/references/prompts_and_instructions.md +160 -0
  538. package/skills/train-sentence-transformers/references/training_args.md +270 -0
  539. package/skills/train-sentence-transformers/references/troubleshooting.md +225 -0
  540. package/skills/train-sentence-transformers/scripts/mine_hard_negatives.py +199 -0
  541. package/skills/train-sentence-transformers/scripts/train_cross_encoder_distillation_example.py +254 -0
  542. package/skills/train-sentence-transformers/scripts/train_cross_encoder_example.py +253 -0
  543. package/skills/train-sentence-transformers/scripts/train_cross_encoder_listwise_example.py +282 -0
  544. package/skills/train-sentence-transformers/scripts/train_multi_vector_encoder_example.py +240 -0
  545. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_distillation_example.py +303 -0
  546. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_example.py +227 -0
  547. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_make_multilingual_example.py +308 -0
  548. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_matryoshka_example.py +212 -0
  549. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_multi_dataset_example.py +258 -0
  550. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_static_embedding_example.py +273 -0
  551. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_with_lora_example.py +275 -0
  552. package/skills/train-sentence-transformers/scripts/train_sparse_encoder_distillation_example.py +262 -0
  553. package/skills/train-sentence-transformers/scripts/train_sparse_encoder_example.py +237 -0
  554. package/skills/transformers-js/SKILL.md +692 -0
  555. package/skills/transformers-js/references/CACHE.md +339 -0
  556. package/skills/transformers-js/references/CONFIGURATION.md +438 -0
  557. package/skills/transformers-js/references/EXAMPLES.md +620 -0
  558. package/skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
  559. package/skills/transformers-js/references/MODEL_REGISTRY.md +197 -0
  560. package/skills/transformers-js/references/PIPELINE_OPTIONS.md +557 -0
  561. package/skills/transformers-js/references/TEXT_GENERATION.md +315 -0
  562. package/skills/tribunal-instincts-memory/SKILL.md +31 -0
  563. package/skills/trl-training/SKILL.md +318 -0
@@ -0,0 +1,79 @@
1
+ # Concurrency Safety
2
+
3
+ Gradio handlers run **in parallel by default on ZeroGPU**. Code that works fine in single-user testing can silently corrupt or leak data in production. Always assume handlers execute concurrently.
4
+
5
+ ## No mutable global state
6
+
7
+ Per-request or per-user data must not live in module-level mutable variables. Concurrent requests will overwrite each other.
8
+
9
+ ```python
10
+ # BAD — concurrent requests overwrite each other
11
+ results = {}
12
+
13
+ def process(text):
14
+ results["output"] = expensive_compute(text) # race condition
15
+ return results["output"]
16
+ ```
17
+
18
+ ```python
19
+ # GOOD — pure function, no shared mutable state
20
+ def process(text):
21
+ return expensive_compute(text)
22
+ ```
23
+
24
+ For state that must persist within a single user session, use `gr.State`:
25
+
26
+ ```python
27
+ with gr.Blocks() as demo:
28
+ history = gr.State(value=[])
29
+
30
+ def add_message(msg, hist):
31
+ hist.append(msg)
32
+ return hist, hist
33
+
34
+ btn.click(fn=add_message, inputs=[msg, history], outputs=[chatbot, history])
35
+ ```
36
+
37
+ Note that on ZeroGPU, `gr.State` is pickled across the worker boundary on every yield — see "Process Isolation and Pickle" in SKILL.md for the implications.
38
+
39
+ ## No fixed file paths for outputs
40
+
41
+ Hardcoded output filenames cause concurrent requests to overwrite each other's files. This corrupts outputs and, worse, can leak one user's data to another.
42
+
43
+ ```python
44
+ # BAD — concurrent calls clobber the same file
45
+ def generate_image(prompt):
46
+ image = pipe(prompt).images[0]
47
+ image.save("output.png")
48
+ return "output.png"
49
+ ```
50
+
51
+ ```python
52
+ # GOOD — unique path per invocation
53
+ import tempfile
54
+
55
+ def generate_image(prompt):
56
+ image = pipe(prompt).images[0]
57
+ with tempfile.NamedTemporaryFile(suffix=".png", delete=False) as f:
58
+ image.save(f.name)
59
+ return f.name
60
+ ```
61
+
62
+ The same applies to any intermediate files (audio, video, CSV exports). Always generate a unique path per invocation.
63
+
64
+ ## Read-only globals are safe
65
+
66
+ Model objects, tokenizers, and configs loaded once at startup and only read during requests are safe and encouraged. This is the standard ZeroGPU pattern: load at module scope, read inside `@spaces.GPU` handlers.
67
+
68
+ ```python
69
+ # SAFE — loaded once at module scope, read-only during requests
70
+ model = load_model().to("cuda")
71
+ tokenizer = load_tokenizer()
72
+
73
+ @spaces.GPU
74
+ def predict(text):
75
+ tokens = tokenizer(text, return_tensors="pt").to("cuda")
76
+ return model.generate(**tokens)
77
+ ```
78
+
79
+ The "no mutable global state" rule targets *writes* from handlers, not reads. A handler that only reads from a global is concurrency-safe.
@@ -0,0 +1,66 @@
1
+ # CUDA Dependencies on ZeroGPU
2
+
3
+ Detailed guidance for installing CUDA-dependent packages on ZeroGPU. SKILL.md establishes the bottom line — wheels are the recommended path because the ZeroGPU build phase has no `nvcc`. This document covers wheel filename tag reading, the kernels-community fallback, and torch-family side-car drift.
4
+
5
+ ## When no wheel is available on PyPI
6
+
7
+ Common workarounds, in preference order:
8
+
9
+ 1. **Pre-built wheel via direct URL.** For `flash-attn`, the upstream project ships a fairly complete matrix at https://github.com/Dao-AILab/flash-attention/releases — check there first and pin the matching wheel URL.
10
+ 2. **Build the wheel yourself and host it** (e.g. on a public HF Hub repo) when no upstream wheel matches the Space environment.
11
+ 3. **Use a kernels-community kernel** (see below) — handles ABI matching for you, no version pinning needed.
12
+
13
+ ## Reading a CUDA wheel filename
14
+
15
+ A wheel filename like
16
+
17
+ ```
18
+ flash_attn-2.8.0.post2+cu12torch2.8cxx11abiFALSE-cp312-cp312-linux_x86_64.whl
19
+ ```
20
+
21
+ encodes four build-time choices:
22
+
23
+ | Tag | Meaning |
24
+ |-----|---------|
25
+ | `cu12` | CUDA major version |
26
+ | `torch2.8` | torch major.minor the wheel was compiled against |
27
+ | `cxx11abiFALSE` | C++ stdlib ABI choice (`TRUE` or `FALSE`) |
28
+ | `cp312-cp312` | CPython version (3.12) |
29
+
30
+ The wheel's compiled C-extension will `ImportError` on ABI/symbol mismatches if any of these drift at install time.
31
+
32
+ If you hand pip a wheel URL without pinning the surrounding environment, pip may resolve `torch` to a version different from the wheel's build target, and the Space will fail on first import. Therefore:
33
+
34
+ - Pin `torch==X.Y.Z` in `requirements.txt` to match the wheel's `torch2.X` tag.
35
+ - Set `python_version:` in the Space frontmatter to match the `cp3XX` tag.
36
+ - Check the runtime's cxx11-ABI choice against the wheel; if unsure, try the opposite ABI wheel.
37
+
38
+ ## Prefer kernels-community when unsure
39
+
40
+ If you are not sure about the ZeroGPU runtime's torch / Python / ABI combination, prefer a [kernels-community](https://huggingface.co/kernels-community) kernel (e.g. `kernels-community/flash-attn2`) instead of a raw wheel URL. The kernels runtime handles ABI matching on your behalf, so no version pinning is required in your Space.
41
+
42
+ ## torch-family side-car drift
43
+
44
+ `torchvision`, `torchaudio`, `torchcodec`, and similar side-car packages are built against a specific `torch` major.minor (and CUDA major). On ZeroGPU, the runtime's supported `torch` list lags behind PyPI, so projects often pin a non-latest `torch` — and a bare `uv add <side-car>` can silently resolve to a newer release that targets a different `torch` / CUDA, producing ABI/import failures even though `uv lock` succeeded without warnings.
45
+
46
+ Concretely observed (2026-04) with `torch==2.9.1` pinned:
47
+
48
+ - `torchaudio` resolves to `2.11.0`, which targets torch 2.11 / CUDA 13. The `2.11.0` release **dropped the `Requires-Dist: torch==X.Y.Z` line** that every earlier release had, so uv sees no constraint and picks it.
49
+ - `torchcodec` resolves to a release targeting torch 2.11. No torchcodec release on PyPI declares a `torch` dependency at all; the compatibility table lives only in the project README.
50
+ - `torchvision` happens to resolve correctly because torchvision still declares `Requires-Dist: torch==X.Y.Z`. Which side-cars are affected changes over time — treat every torch-family package as suspect, not just these.
51
+
52
+ ### Verify at add/upgrade time
53
+
54
+ After any `uv add <torch-side-car>` or `uv lock --upgrade`, verify the resolved version targets the same `torch` major.minor as pinned. Two-step fallback because PyPI metadata is not always sufficient:
55
+
56
+ 1. Query PyPI for the resolved version's `requires_dist`:
57
+ ```bash
58
+ curl -s https://pypi.org/pypi/<pkg>/<version>/json \
59
+ | python3 -c "import json,sys,re; rd=json.load(sys.stdin)['info'].get('requires_dist') or []; print('\n'.join(x for x in rd if re.match(r'^torch(?![a-z])', x)) or '(no torch constraint declared)')"
60
+ ```
61
+ If a `torch==X.Y.Z` line appears and matches the pinned torch, good. If it appears and does NOT match, the side-car is wrong — pin it down explicitly.
62
+ 2. If the query prints `(no torch constraint declared)`, PyPI metadata is silent and cannot be trusted. Fall back to the project's own compatibility table (GitHub README / docs site) — torchcodec, for example, maintains one at https://github.com/pytorch/torchcodec. Pick the side-car version the table maps to the pinned torch major.minor, and pin it explicitly.
63
+
64
+ ### Preventive pin
65
+
66
+ Once the correct side-car version is known, pin it in `pyproject.toml` alongside torch so uv cannot drift on future `uv lock --upgrade`. The side-car version numbers for a given torch major.minor change each release; always re-verify, do not copy a mapping from an older project.
@@ -0,0 +1,74 @@
1
+ # How ZeroGPU duration and quota are checked
2
+
3
+ Mechanism for `duration` validation and quota pre-checks. Useful when choosing `duration` values, debugging `illegal duration` vs `quota exceeded` errors, and understanding why the default 60s is pessimistic for short tasks.
4
+
5
+ For per-tier numerical thresholds (free vs Pro vs Team vs Enterprise quota minutes), the daily quota window length, runs-per-day limits, and pay-as-you-go pricing, see [the ZeroGPU docs](https://huggingface.co/docs/hub/spaces-zerogpu) — those values change over time and are deliberately kept out of this skill.
6
+
7
+ ## What `duration` actually requests
8
+
9
+ Whatever value is passed to `@spaces.GPU(duration=N)` (or the default 60s when unspecified) becomes the `requested duration` the platform checks against. For `xlarge`, the request is doubled internally:
10
+
11
+ ```
12
+ requested = N * 2 if size == "xlarge" else N
13
+ ```
14
+
15
+ So `@spaces.GPU(duration=60, size="xlarge")` is internally a 120-second request — both for the tier-max check and the quota pre-check below.
16
+
17
+ ## Two distinct error modes
18
+
19
+ Two failure messages can come back from the scheduler before the call runs:
20
+
21
+ | Error | Trigger | What helps |
22
+ |---|---|---|
23
+ | **`ZeroGPU illegal duration`** | `requested duration > visitor's tier per-call cap` | Lower `duration`. Sign in / upgrade tier. **Waiting does not help.** |
24
+ | **`ZeroGPU quota exceeded`** | `remaining quota < requested duration`, OR runs-per-day cap reached | Wait for the quota window to reset. For Pro / Team / Enterprise, pay-as-you-go credits cover the overflow. |
25
+
26
+ The error wording for `quota exceeded` includes the explicit numbers, e.g.:
27
+
28
+ ```
29
+ You have exceeded your Pro ZeroGPU quota
30
+ (60s requested vs. 30s left). Try again in 1:23:45.
31
+ ```
32
+
33
+ The comparison is **`requested` vs `remaining`** — not `actual run time` vs `remaining`. A 10-second task left at the default 60s requests 60s of quota; once `remaining < 60s` the call fails even though the actual work would have fit.
34
+
35
+ ## Why the default 60s is pessimistic for short tasks
36
+
37
+ `DEFAULT_SCHEDULE_DURATION` in the `spaces` package is **60 seconds**. So an undecorated `@spaces.GPU` (or `@spaces.GPU()` with no `duration=`) requests 60s of quota.
38
+
39
+ For a task that actually takes ~10 seconds:
40
+
41
+ - The user's 60s quota gets reserved up front.
42
+ - Once their remaining quota drops below 60s, your Space fails for them — even though they could have run many more 10s tasks if the request matched reality.
43
+ - Your call also ranks lower in the queue than equivalent calls declaring smaller durations.
44
+
45
+ The fix is to declare the realistic duration explicitly:
46
+
47
+ ```python
48
+ @spaces.GPU(duration=15)
49
+ def fast_task(...):
50
+ ...
51
+ ```
52
+
53
+ For workloads where runtime depends on inputs, use a callable (per-request estimator):
54
+
55
+ ```python
56
+ def estimate_duration(prompt, steps):
57
+ return int(steps * 3.5)
58
+
59
+ @spaces.GPU(duration=estimate_duration)
60
+ def variable_task(prompt, steps):
61
+ ...
62
+ ```
63
+
64
+ This preserves quota for light inputs and reserves more only when needed.
65
+
66
+ ## Quota window: 24h fixed from first use
67
+
68
+ The quota window's TTL is set when the first call of a fresh window lands and counts down unconditionally — it is not a sliding window, not a calendar-day reset, and not extended by subsequent use. A user who runs a call at 14:00 sees their next reset at 14:00 the following day, regardless of how heavily or lightly they use the Space in between.
69
+
70
+ For exact tier thresholds, runs-per-day caps, and pay-as-you-go billing rates, see the [ZeroGPU docs](https://huggingface.co/docs/hub/spaces-zerogpu).
71
+
72
+ ## Queue priority
73
+
74
+ The queue is **node-level** — requests from every Space scheduled on the same physical node compete for that node's GPU slots. Among queued requests, **shorter declared `duration` ranks higher**. So tight per-request `duration` estimates serve two goals at once: they preserve the user's quota and move the request up the queue.
@@ -0,0 +1,50 @@
1
+ # How ZeroGPU works (mechanism)
2
+
3
+ Conceptual lifecycle of model weights, processes, and worker reuse on ZeroGPU. Useful when reasoning about cold-starts, why module-scope warmup does not carry over to requests, why returning CUDA tensors hangs the call, or why `gr.State` mutations do not persist across the worker boundary.
4
+
5
+ For numerical limits (concurrency slots per Space, queue priority by tier, etc.), see [the ZeroGPU docs](https://huggingface.co/docs/hub/spaces-zerogpu) — those values change over time and are deliberately kept out of this skill.
6
+
7
+ ## Two processes, two lifetimes
8
+
9
+ A ZeroGPU Space runs as **two separate processes**:
10
+
11
+ - **Main web process** — long-lived. Imports `app.py`, launches Gradio, stays up for the life of the Space. Holds no VRAM and, after the startup "pack" step, holds no model weights in RAM either.
12
+ - **GPU worker processes** — short-lived. Forked per `@spaces.GPU` request (or reused if warm). Run the task and are eventually killed by the ZeroGPU scheduler when another Space needs the GPU slot. Your Space code never kills its own worker.
13
+
14
+ ## Module-scope `.to("cuda")` is captured to disk
15
+
16
+ When `import spaces` is active, `model.to("cuda")` at module scope is intercepted. The call is rewritten to `to("cpu")`, so the tensor data physically lives in main process RAM at this point. A "fake" CUDA-presenting tensor is registered alongside the original CPU tensor.
17
+
18
+ At a startup "pack" step, the backend writes those original CPU tensors to disk via direct I/O (`O_DIRECT`), then frees the corresponding RAM. After pack, the main process holds no model weights anywhere — the data lives only on disk.
19
+
20
+ This is why module-scope `pipe(...)` / `model.generate(...)` / `model(...)` calls do not run on a real GPU: there is no GPU attached to the main process, and after pack there are no weights to compute against either. Such calls either fail or silently fall back to CPU on the fake tensors.
21
+
22
+ ## Worker init: disk → pinned memory → VRAM
23
+
24
+ When a `@spaces.GPU` call lands, the scheduler routes it to a worker:
25
+
26
+ 1. **Cold worker** — forked from the main process. The patched torch is unpatched, real CUDA is initialized, and weights are read from the disk offload directory into pinned host memory and streamed onto VRAM through a double-buffered pipeline (essentially `pin_memory().cuda(non_blocking=True)` per batch). This is the "cold-start" cost.
27
+ 2. **Warm worker (reused)** — an alive worker bound to the same GPU slot is reused if the scheduler reports it idle. Init is skipped; weights stay on VRAM from the previous call. Subsequent requests within a burst hit this path.
28
+
29
+ A warm worker is eventually killed by the scheduler when another Space needs the GPU slot. The next call after that point pays the disk → VRAM cost again. Occasional cold-starts on a low-traffic Space are normal.
30
+
31
+ ## Why module-scope warmup does not help
32
+
33
+ A common instinct is to call `pipe("warmup")` at module scope to "prepare" the model. This does not work on ZeroGPU:
34
+
35
+ - At module scope, no real GPU is attached. The fake CUDA tensors do not have data after pack, so `pipe(...)` either fails or silently runs on something other than a real GPU.
36
+ - Even if you wrap the warmup in `@spaces.GPU`, the worker that ran the warmup will eventually be killed before the first real user request lands — leaving them with a cold worker anyway.
37
+
38
+ The right answer is to load eagerly at module scope (`pipe = pipeline(..., device="cuda")`) and accept that the first user request after a quiet period will be a cold worker. Cold-start is fast on ZeroGPU because of the pinned-memory disk pipeline; it is not free, but it is not "minutes of model download" either.
39
+
40
+ ## Why returning CUDA tensors hangs the call
41
+
42
+ The main process never has a CUDA context — it has no GPU attached and its torch never initialized CUDA. When a worker returns a CUDA tensor, unpickling it in the main process triggers `torch.cuda._lazy_init()`, which would attempt to initialize CUDA in the main process. ZeroGPU blocks this, and the call hangs.
43
+
44
+ The fix is purely client-side: convert to CPU before returning (`.cpu()`, `.cpu().numpy()`, etc.). See "Process Isolation and Pickle" in SKILL.md.
45
+
46
+ ## Why `gr.State` does not share by reference across the boundary
47
+
48
+ Worker processes are forked separately and exchange data with the main process via pickle. `gr.State` values cross this boundary on every yield, so mutations inside a `@spaces.GPU` generator are local to the worker until the mutated state is explicitly yielded back. The main process gets a fresh deserialized copy each time — `id()` differs, in-place mutations are invisible across the boundary.
49
+
50
+ See "Process Isolation and Pickle" in SKILL.md for the practical implications and `references/concurrency.md` for related parallel-handler concerns.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: human-gate-negotiation
3
+ description: "Use when preparing concise impact reports before approval requests for high-risk, non-idempotent actions."
4
+ version: 1.0.0
5
+ last-updated: 2026-09-25
6
+ skills:
7
+ - fabel-protocol
8
+ tools: Read, Grep, Glob, Bash, Edit, Write
9
+ scripts-binding:
10
+ - .agent/scripts/harness_manager.js
11
+ ---
12
+
13
+ # Human Gate Negotiation
14
+
15
+ ## Context
16
+ When an agent attempts a high-risk operation (deploying to production, running `rm -rf`, running a database migration), it MUST be paused, and explicit approval must be sought from the Human Gate.
17
+
18
+ ## The Impact Report Format
19
+ Never just ask "Can I run this?". You must provide a structured report outlining the consequences of the action so the human can make an informed decision.
20
+
21
+ **Mandatory Report Structure:**
22
+ 1. **Proposed Action**: The exact command or script to be executed.
23
+ 2. **Purpose**: Why this is necessary.
24
+ 3. **Files/Resources Affected**: Which systems will be mutated.
25
+ 4. **Expected Side Effects**: Downtime, data loss, irreversible state changes.
26
+ 5. **Verification Status**: Proof that tests passed before reaching this gate.
27
+ 6. **Rollback Instructions**: How to undo this action if it fails in production.
28
+
29
+ ## Agent Behavior
30
+ Once the report is generated, the agent must enter a sleep/wait state and CANNOT proceed until the human explicitly provides an approval token.
@@ -49,10 +49,10 @@ scripts-binding:
49
49
  └────┬─────┘ Load co-requires automatically
50
50
  │
51
51
  ┌────▼─────┐
52
- │ PHASE 3 │ Agent Activation
53
- │ Dispatch │ Route to specialist agent
54
- └──────────┘ Announce & load skills
55
- ```
52
+ │ PHASE 3 │ Agent Activation & Dynamic Topologies
53
+ │ Dispatch │ Route to dynamic micro-teams (Team Mode)
54
+ └──────────┘ based on AST impact.
55
+ (e.g., Frontend + Security parallel wave)
56
56
 
57
57
  ---
58
58
 
@@ -196,3 +196,9 @@ When keywords belong to multiple domains, use these explicit rules:
196
196
  ## 6. Regenerating the Index
197
197
 
198
198
  When new skills are added or existing frontmatter is modified, the index regenerates automatically.
199
+
200
+
201
+ ## 7. Dynamic Sub-Agent Delegation (Team Mode)
202
+
203
+ The router MUST NOT dump files into a static 3-wave pipeline. Instead, it must selectively route tasks to micro-teams (Team Mode) based on file impact and topological graph dependencies.
204
+ - Example: If the AST diff impacts `db/schema.prisma` and `src/components/User.tsx`, the router spawns a `database-architect` sub-agent and a `frontend-specialist` sub-agent in a parallel DAG wave, instead of running the entire 28-reviewer gauntlet on both files.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: semantic-filesystem-navigation
3
+ description: "Use when navigating complex codebases, preferring exact file operations but falling back to semantic vector search when paths are unknown."
4
+ version: 1.0.0
5
+ last-updated: 2026-09-25
6
+ skills:
7
+ - context-engineering-pro
8
+ tools: Read, Grep, Glob, Bash, Edit, Write
9
+ scripts-binding:
10
+ - .agent/scripts/context_compiler.js
11
+ ---
12
+
13
+ # Semantic Filesystem Navigation
14
+
15
+ ## The Rule of Exact Paths
16
+ When an agent knows the exact file path (e.g., `src/index.js`), it MUST use standard file read operations to fetch it. Exact lookups are O(1), cheap, and guarantee zero hallucination.
17
+
18
+ ## Semantic Fallback
19
+ When an agent is asked a fuzzy question (e.g., "Where is the user authentication middleware defined?"), it should invoke the Semantic Search tools.
20
+ The system will run a local embedding match against the `routing_index.json` or pre-compiled TF-IDF maps to locate the file.
21
+
22
+ ## Guardrails
23
+ - **Do not guess file names**: Never write `fs.readFileSync('auth.js')` unless you have verified `auth.js` exists in the current working directory.
24
+ - **Limit Context Hits**: Semantic search should return file *paths*, not full file *contents*, to avoid context window explosion. The agent must then selectively `view_file` the most relevant hit.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: session-log-interrogation
3
+ description: "Use when teaching selective access to session history to prevent context window bloat during long-running sessions."
4
+ version: 1.0.0
5
+ last-updated: 2026-09-25
6
+ skills:
7
+ - context-engineering-pro
8
+ tools: Read, Grep, Glob, Bash, Edit, Write
9
+ scripts-binding:
10
+ - .agent/scripts/session_logger.js
11
+ ---
12
+
13
+ # Session Log Interrogation
14
+
15
+ ## The Context Problem
16
+ Long-running agent workflows generate thousands of events (Syscalls, Model turns, Tool Responses). Injecting the full session history into a prompt degrades reasoning, wastes tokens, and eventually hits hard limits.
17
+
18
+ ## The Solution: Selective Interrogation
19
+ The agent must filter and request specific event ranges rather than loading the entire file.
20
+
21
+ ## Tactics
22
+ 1. **Time-Bounded Queries**: Request events only since the last major Checkpoint (e.g., "Give me all events since Wave 2 started").
23
+ 2. **Error-Focused Scans**: Query specifically for `ToolFailed` or `SessionFailed` events to understand what went wrong, ignoring the happy-path `ToolCompleted` events.
24
+ 3. **Provenance Validation**: When referencing past actions, cite the exact `eventId`.
25
+ 4. **Context Budgets**: Never load more than 50 events into context at once. If the query yields more, aggregate them into a summary locally before passing to the model.
26
+
27
+ ## Anti-Patterns
28
+ - ❌ Reading the raw `.agent_session.json` line-by-line using `cat`.
29
+ - ✅ Using the `session_logger.js` or `harness_manager.js` to fetch structured, filtered logs.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: subagent-driven-development
3
+ description: "Use when decomposing tasks, delegating to subagents, executing code in isolation, and reviewing AI-generated output. Integrates tightly with Tribunal OS governance."
4
+ version: 1.0.0
5
+ last-updated: 2026-09-25
6
+ skills:
7
+ - tdd-workflow
8
+ - verification-before-completion
9
+ tools: Read, Grep, Glob, Bash, Edit, Write
10
+ scripts-binding:
11
+ - .agent/scripts/swarm_dispatcher.js
12
+ ---
13
+
14
+ # Subagent-Driven Development (SDD)
15
+
16
+ ## Core Philosophy
17
+ Monolithic tasks must be broken down into atomic, testable units, delegated to specialized agents, and executed in bounded isolation. No single agent should both write code and approve it for production.
18
+
19
+ ## The SDD Lifecycle
20
+ 1. **Decomposition**: Break the Epic down into sub-tasks (Waves). No sub-task should touch more than 5 files.
21
+ 2. **Delegation**: Assign each sub-task to the agent with the most appropriate profile (e.g., `frontend-specialist`, `database-architect`).
22
+ 3. **Execution (Hands)**: The subagent implements the required changes in a localized context.
23
+ 4. **Verification**: The subagent runs tests. If tests fail, it iterates.
24
+ 5. **Review (Tribunal)**: The code changes are subjected to parallel static analysis reviewers (`/tribunal-full`).
25
+ 6. **Handoff**: The subagent reports back to the Orchestrator with concrete proof of verification.
26
+
27
+ ## Mandatory Guardrails
28
+ - **Zero-Trust Delegation**: Never assume a subagent succeeded just because it didn't throw an error. Demand terminal output proof.
29
+ - **Context Isolation**: Do NOT pass the entire conversation history to a subagent. Pass only the required `.md` instructions and relevant file paths.
30
+
31
+ ## Failure Handling
32
+ If a subagent fails 3 times, the Orchestrator must abort the wave, clean up any uncommitted side-effects, and flag the issue for the Human Gate.
@@ -122,3 +122,8 @@ Do not skim. Stack traces tell the exact sequence of destruction.
122
122
  1. **Top line:** The final fatal blow (e.g., `TypeError: Cannot read properties of undefined (reading 'map')`).
123
123
  2. **First Application Function:** Scroll down past `node_modules` and framework internals. Find the absolute top-most function call that YOU wrote (e.g., `at UserList (src/components/UserList.tsx:45)`).
124
124
  3. **The Parameter Conclusion:** Therefore, line 45 invoked `.map` on a variable that was `undefined`. Why did the parent layer pass `undefined` instead of `[]`?
125
+
126
+
127
+ ## Integration with Durable Session Log
128
+
129
+ When debugging fails, the agent MUST read the `.agent/.tribunal/session.jsonl` durable log to understand exactly where the previous wave crashed. Do not guess; read the event trace to see the exact sequence of tool calls and errors that led to the crash. You can grep this file or parse it to extract the latest `ErrorEncountered` or failed `ToolCompleted` events.
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: train-sentence-transformers
3
+ description: Train or fine-tune sentence-transformers models across `SentenceTransformer` (bi-encoder, dense or static embedding model for retrieval, similarity, clustering, classification, paraphrase mining, dedup, multimodal), `CrossEncoder` (reranker, pair scoring for two-stage retrieval / pair classification), `SparseEncoder` (SPLADE, sparse embedding model for learned-sparse retrieval), and `MultiVectorEncoder` (ColBERT / late-interaction, per-token embeddings scored with MaxSim). Covers loss selection, hard-negative mining, evaluators, distillation, LoRA, Matryoshka, and Hugging Face Hub publishing. Use for any sentence-transformers training task.
4
+ ---
5
+
6
+ # Train a sentence-transformers Model
7
+
8
+ **This SKILL.md is a router, not a manual.** It tells you which references and example scripts to load for your task. The actual content (recommended losses, evaluators, training-script structure, model selection, training-arg knobs, troubleshooting) lives in `references/` and `scripts/`.
9
+
10
+ **Do not synthesize a training script from this file alone.** Open the per-type production template (`scripts/train_<type>_example.py`) and copy it as your starting point. The templates contain load-bearing scaffolding (autocast helper, model-card class, logger silencing list, `force=True`, `seed`, TF32, version-compatible imports, named-evaluator metric handling) that prior agent runs have repeatedly missed when rolling their own from a synthesized snippet.
11
+
12
+ ## 1. Identify the model type
13
+
14
+ | Tag | Class | What it does | When to pick |
15
+ |---|---|---|---|
16
+ | **[SentenceTransformer]** | `SentenceTransformer` (bi-encoder) | Maps each input to a fixed-dim dense vector | Retrieval, similarity, clustering, classification, paraphrase mining, dedup |
17
+ | **[CrossEncoder]** | `CrossEncoder` (reranker) | Scores `(query, passage)` pairs jointly | Two-stage retrieval (rerank top-100 from bi-encoder), pair classification |
18
+ | **[SparseEncoder]** | `SparseEncoder` (SPLADE) | Sparse vectors over the vocabulary | Learned-sparse retrieval, inverted-index backends (Elasticsearch / OpenSearch / Lucene) |
19
+ | **[MultiVectorEncoder]** | `MultiVectorEncoder` (ColBERT) | One embedding per token, scored with MaxSim | Late-interaction retrieval, recall gains over bi-encoders at higher storage cost, multimodal (ColPali / ColQwen2) |
20
+
21
+ Tiebreakers when the request is ambiguous: "embedding model" / "vector search" / "similarity" → **[SentenceTransformer]**. "rerank" / "ranker" / "two-stage" → **[CrossEncoder]**. "SPLADE" / "sparse" / "inverted index" → **[SparseEncoder]**. "ColBERT" / "late interaction" / "multi-vector" / "MaxSim" / "ColPali" / "ColQwen" → **[MultiVectorEncoder]**. If still unclear, ask.
22
+
23
+ ## 2. Required reading
24
+
25
+ **Read these in full before writing any code. Do not triage by perceived relevance.**
26
+
27
+ ### Per-type: always required
28
+
29
+ **[SentenceTransformer]**
30
+ - `references/losses_sentence_transformer.md`: loss-to-data-shape mapping, `BatchSamplers.NO_DUPLICATES` requirement for MNRL-family, `Cached*` ↔ `gradient_checkpointing` incompatibility.
31
+ - `references/evaluators_sentence_transformer.md`: evaluator-to-task mapping, `metric_for_best_model` key construction (named vs unnamed), per-evaluator `primary_metric` values.
32
+ - `references/model_architectures.md`: encoder vs decoder vs static vs Router pipelines, pooling rules (mean / cls / lasttoken), auto-mean-pooling behavior for fresh-start MLM bases.
33
+ - `scripts/train_sentence_transformer_example.py`: production template. Copy this as your starting point.
34
+
35
+ **[CrossEncoder]**
36
+ - `references/losses_cross_encoder.md`: pointwise / pairwise / listwise / distillation, `pos_weight` derivation, `activation_fn=Identity()` mandatory for non-BCE losses (silent eval-rank collapse otherwise).
37
+ - `references/evaluators_cross_encoder.md`: `CrossEncoderRerankingEvaluator` recipe, named-evaluator key format `eval_{name}_{primary_metric}`.
38
+ - `scripts/train_cross_encoder_example.py`: production template. Copy this as your starting point.
39
+
40
+ **[SparseEncoder]**
41
+ - `references/losses_sparse_encoder.md`: `SpladeLoss` wrapper requirement, FLOPS regularizer weights, smoke-test active-dim ramp behavior.
42
+ - `references/evaluators_sparse_encoder.md`: `SparseNanoBEIREvaluator` (English-only) and the in-domain alternative, `eval_{name}_{primary_metric}` key format.
43
+ - `scripts/train_sparse_encoder_example.py`: production template. Copy this as your starting point.
44
+
45
+ **[MultiVectorEncoder]**
46
+ - `references/losses_multi_vector_encoder.md`: MaxSim scoring, scale choice per scoring mode (`scale=1.0` for MaxSim, roughly the average query length for MeanMaxSim), MNRL / CachedMNRL / MarginMSE / DistillKLDiv, XTR-vs-ColBERT scoring, CachedMNRL ↔ `gradient_checkpointing` incompatibility.
47
+ - `references/evaluators_multi_vector_encoder.md`: `MultiVectorNanoBEIREvaluator` (English-only) and the in-domain alternative, `eval_NanoBEIR_mean_maxsim_ndcg@10` key format, distillation-eval spearman variant.
48
+ - `scripts/train_multi_vector_encoder_example.py`: production template. Copy this as your starting point.
49
+
50
+ ### Cross-cutting: always required (regardless of task)
51
+
52
+ - `references/training_args.md`: `TrainingArguments` knobs, precision rules (load fp32 + autocast bf16/fp16, never `torch_dtype=bfloat16`), `warmup_steps` (float) vs deprecated `warmup_ratio`, `save_steps` must be a multiple of `eval_steps` for `load_best_model_at_end`, schedulers, HPO, tracker, resume, hub-push variants.
53
+ - `references/dataset_formats.md`: column-matching rules (label name auto-detection, column-order-not-name), reshaping recipes, hard-negative mining options.
54
+ - `references/base_model_selection.md`: discovery commands, per-type model namespaces, ModernBERT-family `max_seq_length=8192` trap, `datasets >= 4` script-loader rejection, non-English starting-point shortcuts.
55
+ - `references/troubleshooting.md`: symptom-indexed failure recipes. Skim the section headings on every run, even a healthy one. The "Metrics don't improve" and "Hub push fails" entries cover bugs that bite frequently and are cheaper to recognize before they fire than to debug after.
56
+
57
+ ### Cross-cutting: load when applicable
58
+
59
+ - `references/hardware_guide.md`: VRAM sizing, multi-GPU, FSDP / DeepSpeed, HF Jobs flavors. Required for >24GB models, multi-GPU, or HF Jobs runs.
60
+ - `references/hf_jobs_execution.md`: required when running on HF Jobs.
61
+ - `references/prompts_and_instructions.md`: required when using prompt-tuned bases (E5, BGE, GTE, Qwen3-Embedding, Instructor, Nomic, etc.) or adding `query: ` / `passage: ` style prefixes.
62
+
63
+ ### Variant scripts (open when the task matches)
64
+ - **[SentenceTransformer]** `scripts/train_sentence_transformer_<matryoshka|multi_dataset|with_lora|distillation|make_multilingual|static_embedding>_example.py`.
65
+ - **[CrossEncoder]** `scripts/train_cross_encoder_<distillation|listwise>_example.py`.
66
+ - **[SparseEncoder]** `scripts/train_sparse_encoder_distillation_example.py`.
67
+ - Hard-negative mining CLI: `scripts/mine_hard_negatives.py`.
68
+
69
+ ## 3. Defaults
70
+
71
+ Override only if the user specifies otherwise:
72
+ - **Local execution.** Pitch HF Jobs only if local hardware can't fit the job.
73
+ - **Single run.** After it completes, propose experimentation if the user would benefit (weak/marginal verdict, "see how high you can push it" framing, etc.). Iteration rules in `references/training_args.md` (Experimentation section).
74
+ - **Public Hub push at end-of-run, wrapped in try-except.** On HF Jobs (ephemeral env) ALSO enable in-trainer push (`push_to_hub=True` + `hub_strategy="every_save"`). Details in `references/hf_jobs_execution.md`.
75
+
76
+ ## 4. Constraints the produced script must satisfy
77
+
78
+ These are non-negotiable contracts. Implementation lives in the production templates and references. Do not reinvent.
79
+
80
+ - Capture the pre-training evaluator score as `baseline_eval` **before** `trainer.train()`.
81
+ - Emit a single end-of-run line: `VERDICT: WIN|MARGINAL|REGRESSION | score=... | baseline=... | delta=...`. A monitor scrapes for this.
82
+ - Silence `httpx`, `httpcore`, `huggingface_hub`, `urllib3`, `filelock`, `fsspec` to WARNING (otherwise HF download URLs flood the agent's context).
83
+ - Tee logs to `logs/{RUN_NAME}.log`.
84
+ - End with `model.push_to_hub(...)` wrapped in `try/except`.
85
+ - Smoke-test before any long run (`max_steps=1` + tiny dataset slice). The production templates show one common pattern (`SMOKE_TEST` env var).
86
+ - **[CrossEncoder]** Include `EarlyStoppingCallback(patience>=3)`. CE rerankers often peak mid-training and regress.
87
+ - **[SparseEncoder]** Log `query_active_dims` / `corpus_active_dims` on the verdict line. High nDCG with collapsed sparsity is not a win. The keys come back name-prefixed (e.g. `..._query_active_dims`). Use suffix matching to pluck them. See the SPARSE production template for the exact pattern.
88
+ - **[MultiVectorEncoder]** Match `scale` to the scoring mode on any MNRL-family loss: near `1.0` for unnormalized MaxSim (do not copy `scale=20.0` from bi-encoder MNRL), roughly the average query length with length-normalized MeanMaxSim, since each score is divided by its query's token count. `XTRScores` is a train-only `similarity_fct`: the evaluators reject it, so evaluation always scores with MaxSim, including for XTR-trained models.
89
+
90
+ ## 5. Workflow
91
+
92
+ 1. Identify the model type (§1). Ask if ambiguous.
93
+ 2. Load the §2 required-reading files for that type.
94
+ 3. Open `scripts/train_<type>_example.py` and copy it as your starting point.
95
+ 4. Replace `MODEL_NAME`, `DATASET_NAME`, `RUN_NAME`, the loss, and the evaluator with the user's task. Cross-check loss/data-shape match against `references/losses_<type>.md`. Cross-check the `metric_for_best_model` key against `references/evaluators_<type>.md` (named evaluators format the key as `eval_{name}_{primary_metric}`).
96
+ 5. Smoke-test (`max_steps=1`).
97
+ 6. Run.
98
+ 7. After the run, append to `logs/experiments.md` and propose iteration if the verdict is weak/marginal.
99
+
100
+ ## Prerequisites
101
+
102
+ ```bash
103
+ pip install "sentence-transformers[train]>=5.0" # add [train,image] / [audio] / [video] for [SentenceTransformer] multimodal
104
+ # [MultiVectorEncoder] requires >=6.0
105
+ pip install trackio # optional tracker (or wandb / tensorboard / mlflow)
106
+ hf auth login # or set HF_TOKEN with write scope (for Hub push)
107
+ ```
108
+
109
+ GPU strongly recommended. CPU works only for demos and `[SentenceTransformer]` `StaticEmbedding`.
@@ -0,0 +1,79 @@
1
+ # Base Model Selection
2
+
3
+ Leaderboards rotate every few months. Don't trust any hardcoded "best" pick. Discover current options live. Run **both** sort orders since most-downloaded surfaces proven options and trending surfaces recent SOTA that may not have download volume yet.
4
+
5
+ ## Discovery commands
6
+
7
+ **[BI]**:
8
+ ```bash
9
+ hf models list --filter sentence-transformers --sort downloads --limit 20
10
+ hf models list --filter sentence-transformers --sort trending --limit 20
11
+ ```
12
+
13
+ **[CE]**:
14
+ ```bash
15
+ hf models list --filter sentence-transformers --filter text-ranking --sort downloads --limit 20
16
+ hf models list --filter sentence-transformers --filter text-ranking --sort trending --limit 20
17
+ ```
18
+
19
+ **[SPARSE]**:
20
+ ```bash
21
+ hf models list --filter sentence-transformers --filter sparse-encoder --sort downloads --limit 20
22
+ hf models list --filter sentence-transformers --filter sparse-encoder --sort trending --limit 20
23
+ ```
24
+
25
+ Optional language narrowing (any type): add `--filter <language-code>`. Not all multilingual models tag each language, so missing matches doesn't mean the model can't handle that language. Re-run without the filter to compare.
26
+
27
+ ```bash
28
+ hf models card <id> --text # confirm dimensions, max_seq_length, license, languages
29
+ ```
30
+
31
+ Cross-check the [MTEB leaderboard](https://huggingface.co/spaces/mteb/leaderboard) (pick the relevant tab) before committing to a multi-hour run.
32
+
33
+ ## [BI] Bi-Encoder
34
+
35
+ Continue from an existing retriever beats fresh-start + 100k-500k pairs. Common namespaces as of 2026-Q2 (verify against discovery commands, since the field rotates):
36
+
37
+ - **English encoder retrievers**: `sentence-transformers/all-*` (MiniLM-L6-v2, mpnet-base-v2 still the most-downloaded models on the Hub), `BAAI/bge-*-en-v1.5`, `nomic-ai/nomic-embed-text-v1.5`, `mixedbread-ai/mxbai-embed-large-v1`, `Alibaba-NLP/gte-*`, `Snowflake/snowflake-arctic-embed-*`, `jinaai/jina-embeddings-v5-text-small` / `-nano`, `microsoft/harrier-oss-v1-270m` / `-0.6b`.
38
+ - **Multilingual encoder retrievers**: `sentence-transformers/paraphrase-multilingual-*`, `intfloat/multilingual-e5-*`, `ibm-granite/granite-embedding-*-multilingual-r2`, `google/embeddinggemma-300m`, `voyageai/voyage-4-nano`.
39
+ - **Long documents (8k+)**: `nomic-ai/modernbert-embed-*`, `answerdotai/ModernBERT-large`.
40
+ - **Decoder LLM retrievers** (multilingual, **need last-token pooling**): `Qwen/Qwen3-Embedding-*` (0.6B / 4B / 8B), `Qwen/Qwen3-VL-Embedding-*` (multimodal), `codefuse-ai/F2LLM-v2-*`.
41
+ - **Fresh-start English** (≥500k pairs + domain-fit reason): `microsoft/mpnet-base`, `answerdotai/ModernBERT-base`, `google-bert/bert-base-uncased`, `jhu-clsp/ettin-encoder-*` (17m / 32m / 68m / 150m / 400m / 1b, paired ModernBERT encoder family).
42
+ - **Fresh-start multilingual**: `FacebookAI/xlm-roberta-base` (MLM-only, needs contrastive training), `microsoft/mdeberta-v3-base`, `jhu-clsp/mmBERT-base` / `-small`.
43
+ - **CPU / small footprint** (`StaticEmbedding`): `StaticEmbedding(tokenizer, embedding_dim=...)`. **Model size = `vocab_size × dim × 4 bytes`**. Pick a small-vocab tokenizer or you get a giant model: 30k-vocab `bert-base-uncased` × 128 dim ≈ 15 MB, **250k-vocab `paraphrase-multilingual-MiniLM-L12-v2` × 256 dim ≈ 256 MB**. Random init needs 1M+ pairs. Warm-start (`StaticEmbedding.from_distillation(...)`) helps under ~100k pairs.
44
+
45
+ Architecture variants (encoder / decoder / static / Router), pooling rules, and decoder-vs-encoder setup paths: `model_architectures.md`.
46
+
47
+ **ModernBERT-family bases default to `max_seq_length=8192`.** That allocates activation memory for 8192-token sequences regardless of your data length and silently drives Windows VRAM into "shared memory" spillover. After loading any ModernBERT / mmBERT / Ettin / gte-modernbert / nomic-modernbert base, **explicitly set `model.max_seq_length = 256` (or 512 for documents)** unless you actually need long context.
48
+
49
+ ## [CE] Cross-Encoder
50
+
51
+ Continue from an existing reranker beats fresh-start + 100k-500k pairs in most domains. Default to this unless you have a strong reason otherwise. Common namespaces as of 2026-Q2:
52
+
53
+ - **English encoder rerankers**: `cross-encoder/ms-marco-*`, `BAAI/bge-reranker-*`, `mixedbread-ai/mxbai-rerank-*-v1` / `-v2`, `Alibaba-NLP/gte-reranker-modernbert-*`, `ibm-granite/granite-embedding-reranker-english-*`.
54
+ - **Multilingual encoder rerankers**: `cross-encoder/mmarco-*`, `BAAI/bge-reranker-v2-m3`, `Alibaba-NLP/gte-multilingual-reranker-*`, `ibm-granite/granite-embedding-reranker-multilingual-*`.
55
+ - **Decoder LLM rerankers** (multilingual, `num_labels=1` last-token-style scoring): `Qwen/Qwen3-Reranker-*` (0.6B / 4B / 8B), `Qwen/Qwen3-VL-Reranker-*` (multimodal).
56
+ - **Fresh-start**: `microsoft/MiniLM-L12-H384-uncased`, `answerdotai/ModernBERT-base` / `-large`, `jhu-clsp/ettin-encoder-*`, `FacebookAI/xlm-roberta-base` (multilingual), `microsoft/mdeberta-v3-base` (multilingual), `jhu-clsp/mmBERT-base` / `-small` (multilingual). Pass `num_labels >= 2` for classification cross-encoders.
57
+
58
+ Encoder-only bases are still the latency-efficient default (bidirectional attention is well-suited to the reranking use case at small parameter counts), but decoder LLM rerankers are now competitive at the top of MTEB Reranking when latency / memory budget allows.
59
+
60
+ **Minimum dataset:** 500k+ labeled `(query, passage, label)` tuples for production. 10k-100k labeled pairs for continue-training on domain data. Low-resource languages may have less than 10k labeled pairs. In that case, lean on a multilingual base's pretraining and accept a noisier signal.
61
+
62
+ **"Small" multilingual is ~100M+ params**, not 17M-50M like the English small models. mMiniLMv2-L12-H384 (~117M) is roughly the small-end for usable multilingual rerankers.
63
+
64
+ ## [SPARSE] Sparse Encoder (SPLADE)
65
+
66
+ SPLADE requires a fill-mask / `AutoModelForMaskedLM`-compatible checkpoint. Encoder-only MLM models work out of the box. **Decoder LLMs do not**.
67
+
68
+ - **Continue from existing SPLADE (English)**: `naver/splade-*` (the canonical family), `opensearch-project/opensearch-neural-sparse-encoding-*` (incl. `-doc-v2-distill`, `-doc-v3-distill` / `-doc-v3-gte`), `prithivida/Splade_PP_en_v*`, `ibm-granite/granite-embedding-30m-sparse`.
69
+ - **Continue from existing SPLADE (multilingual)**: `opensearch-project/opensearch-neural-sparse-encoding-multilingual-v1`.
70
+ - **Fresh-start English** (≥500k pairs): any encoder with an MLM head (`distilbert/distilbert-base-uncased`, `google-bert/bert-base-uncased`). Pure `AutoModel` checkpoints without MLM won't work. Discover MLM bases: `hf models list --filter fill-mask --sort downloads --limit 20`.
71
+ - **Fresh-start multilingual**: `FacebookAI/xlm-roberta-base` (has MLM head). For other multilingual MLM bases: add `--filter <language-code>`.
72
+
73
+ **Minimum dataset:** 500k+ triplets (with mined hard negatives) for a competitive SPLADE. 50k+ triplets for domain adaptation on existing SPLADE.
74
+
75
+ ## Cross-cutting tips
76
+
77
+ - **Non-English retrieval starting points** (when language tag returns 0 results): check `intfloat/multilingual_e5_train_data` for parallel pair data, MIRACL via the `sentence-transformers/miracl` mirror for multilingual retrieval, mMARCO via `unicamp-dl/mmarco` (14 languages, parquet-backed).
78
+ - **Avoid script-based dataset loaders.** `datasets >= 4` rejects them with `RuntimeError: Dataset scripts are no longer supported`. Look for parquet-backed mirrors (e.g. `sentence-transformers/miracl` instead of `miracl/miracl`).
79
+ - **`hf datasets sql` requires DuckDB** (`pip install duckdb`). Without it, fall back to `python -c "from datasets import load_dataset; ds = load_dataset('<id>', ...); print(ds.column_names, ds[0])"`.