pi-skill-search 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/LICENSE +21 -0
- package/README.md +97 -0
- package/index.ts +163 -0
- package/package.json +48 -0
- package/skills/adaptyv/SKILL.md +92 -0
- package/skills/add-community-extension/SKILL.md +85 -0
- package/skills/aeon/SKILL.md +111 -0
- package/skills/ai-slop-cleaner/SKILL.md +118 -0
- package/skills/anndata/SKILL.md +83 -0
- package/skills/arboreto/SKILL.md +107 -0
- package/skills/ask/SKILL.md +55 -0
- package/skills/astropy/SKILL.md +30 -0
- package/skills/async-worker-recovery/SKILL.md +44 -0
- package/skills/autopilot/SKILL.md +63 -0
- package/skills/autoresearch/SKILL.md +64 -0
- package/skills/autoskill/SKILL.md +116 -0
- package/skills/babysit/SKILL.md +43 -0
- package/skills/benchling-integration/SKILL.md +106 -0
- package/skills/bgpt-paper-search/SKILL.md +67 -0
- package/skills/biopython/SKILL.md +29 -0
- package/skills/bioservices/SKILL.md +96 -0
- package/skills/brainstorming/SKILL.md +104 -0
- package/skills/cancel/SKILL.md +85 -0
- package/skills/ccg/SKILL.md +87 -0
- package/skills/celery-pipeline/SKILL.md +30 -0
- package/skills/cellxgene-census/SKILL.md +104 -0
- package/skills/child-pi-spawning/SKILL.md +85 -0
- package/skills/cirq/SKILL.md +113 -0
- package/skills/citation-management/SKILL.md +91 -0
- package/skills/clinical-decision-support/SKILL.md +117 -0
- package/skills/clinical-reports/SKILL.md +118 -0
- package/skills/clinical-trial/SKILL.md +28 -0
- package/skills/cobrapy/SKILL.md +116 -0
- package/skills/configure-notifications/SKILL.md +85 -0
- package/skills/consciousness-council/SKILL.md +120 -0
- package/skills/context-artifact-hygiene/SKILL.md +85 -0
- package/skills/context-mode-ops/SKILL.md +87 -0
- package/skills/dask/SKILL.md +85 -0
- package/skills/database-lookup/SKILL.md +118 -0
- package/skills/datamol/SKILL.md +108 -0
- package/skills/debug/SKILL.md +32 -0
- package/skills/deep-dive/SKILL.md +114 -0
- package/skills/deep-interview/SKILL.md +90 -0
- package/skills/deepchem/SKILL.md +117 -0
- package/skills/deepinit/SKILL.md +100 -0
- package/skills/deeptools/SKILL.md +118 -0
- package/skills/delegation-patterns/SKILL.md +56 -0
- package/skills/depmap/SKILL.md +94 -0
- package/skills/dhdna-profiler/SKILL.md +86 -0
- package/skills/diffdock/SKILL.md +101 -0
- package/skills/dispatching-parallel-agents/SKILL.md +119 -0
- package/skills/dnanexus-integration/SKILL.md +118 -0
- package/skills/do/SKILL.md +48 -0
- package/skills/docker-sandbox/SKILL.md +29 -0
- package/skills/docx/SKILL.md +119 -0
- package/skills/esm/SKILL.md +116 -0
- package/skills/etetoolkit/SKILL.md +103 -0
- package/skills/event-log-tracing/SKILL.md +85 -0
- package/skills/exa-search/SKILL.md +72 -0
- package/skills/executing-plans/SKILL.md +69 -0
- package/skills/exploratory-data-analysis/SKILL.md +118 -0
- package/skills/external-context/SKILL.md +80 -0
- package/skills/fastapi/SKILL.md +30 -0
- package/skills/finishing-a-development-branch/SKILL.md +106 -0
- package/skills/flowio/SKILL.md +114 -0
- package/skills/fluidsim/SKILL.md +108 -0
- package/skills/generate-image/SKILL.md +108 -0
- package/skills/geniml/SKILL.md +117 -0
- package/skills/geomaster/SKILL.md +109 -0
- package/skills/geopandas/SKILL.md +114 -0
- package/skills/get-available-resources/SKILL.md +100 -0
- package/skills/gget/SKILL.md +111 -0
- package/skills/ginkgo-cloud-lab/SKILL.md +52 -0
- package/skills/git-master/SKILL.md +85 -0
- package/skills/glycoengineering/SKILL.md +104 -0
- package/skills/gtars/SKILL.md +104 -0
- package/skills/hackernews-frontpage/SKILL.md +46 -0
- package/skills/histolab/SKILL.md +98 -0
- package/skills/how-it-works/SKILL.md +25 -0
- package/skills/hud/SKILL.md +86 -0
- package/skills/hugging-science/SKILL.md +93 -0
- package/skills/huggingface/SKILL.md +30 -0
- package/skills/hypogenic/SKILL.md +107 -0
- package/skills/hypothesis-generation/SKILL.md +118 -0
- package/skills/imaging-data-commons/SKILL.md +119 -0
- package/skills/infographics/SKILL.md +102 -0
- package/skills/iso-13485-certification/SKILL.md +114 -0
- package/skills/knowledge-agent/SKILL.md +83 -0
- package/skills/labarchive-integration/SKILL.md +98 -0
- package/skills/lamindb/SKILL.md +119 -0
- package/skills/landsat/SKILL.md +29 -0
- package/skills/latchbio-integration/SKILL.md +118 -0
- package/skills/latex-posters/SKILL.md +112 -0
- package/skills/learn-codebase/SKILL.md +24 -0
- package/skills/learner/SKILL.md +118 -0
- package/skills/literature-review/SKILL.md +118 -0
- package/skills/live-agent-lifecycle/SKILL.md +85 -0
- package/skills/mailbox-interactive/SKILL.md +85 -0
- package/skills/make-plan/SKILL.md +59 -0
- package/skills/markdown-mermaid-writing/SKILL.md +118 -0
- package/skills/market-research-reports/SKILL.md +119 -0
- package/skills/markitdown/SKILL.md +111 -0
- package/skills/markitdown-docs/SKILL.md +28 -0
- package/skills/matchms/SKILL.md +91 -0
- package/skills/matlab/SKILL.md +118 -0
- package/skills/matplotlib/SKILL.md +30 -0
- package/skills/mcp-setup/SKILL.md +84 -0
- package/skills/medchem/SKILL.md +109 -0
- package/skills/mem-search/SKILL.md +96 -0
- package/skills/modal/SKILL.md +104 -0
- package/skills/model-routing-context/SKILL.md +85 -0
- package/skills/molecular-dynamics/SKILL.md +116 -0
- package/skills/molfeat/SKILL.md +110 -0
- package/skills/multi-perspective-review/SKILL.md +85 -0
- package/skills/networkx/SKILL.md +111 -0
- package/skills/neurokit2/SKILL.md +114 -0
- package/skills/neuropixels-analysis/SKILL.md +112 -0
- package/skills/nilearn/SKILL.md +29 -0
- package/skills/observability-reliability/SKILL.md +43 -0
- package/skills/omc-doctor/SKILL.md +86 -0
- package/skills/omc-reference/SKILL.md +119 -0
- package/skills/omc-setup/SKILL.md +82 -0
- package/skills/omc-teams/SKILL.md +81 -0
- package/skills/omero-integration/SKILL.md +111 -0
- package/skills/open-notebook/SKILL.md +100 -0
- package/skills/openephys/SKILL.md +28 -0
- package/skills/opentrons-integration/SKILL.md +110 -0
- package/skills/optimize-for-gpu/SKILL.md +119 -0
- package/skills/orchestration/SKILL.md +85 -0
- package/skills/ownership-session-security/SKILL.md +43 -0
- package/skills/paper-lookup/SKILL.md +119 -0
- package/skills/paperzilla/SKILL.md +114 -0
- package/skills/parallel-web/SKILL.md +64 -0
- package/skills/pathfinder/SKILL.md +114 -0
- package/skills/pathml/SKILL.md +98 -0
- package/skills/pdf/SKILL.md +113 -0
- package/skills/peer-review/SKILL.md +119 -0
- package/skills/pennylane/SKILL.md +119 -0
- package/skills/phylogenetics/SKILL.md +102 -0
- package/skills/pi-extension-lifecycle/SKILL.md +41 -0
- package/skills/plan/SKILL.md +66 -0
- package/skills/polars/SKILL.md +114 -0
- package/skills/polars-bio/SKILL.md +84 -0
- package/skills/pptx/SKILL.md +118 -0
- package/skills/pptx-posters/SKILL.md +112 -0
- package/skills/primekg/SKILL.md +97 -0
- package/skills/project-session-manager/SKILL.md +85 -0
- package/skills/protocolsio-integration/SKILL.md +119 -0
- package/skills/pubmed-search/SKILL.md +29 -0
- package/skills/pufferlib/SKILL.md +103 -0
- package/skills/pydeseq2/SKILL.md +106 -0
- package/skills/pydicom/SKILL.md +115 -0
- package/skills/pyhealth/SKILL.md +117 -0
- package/skills/pylabrobot/SKILL.md +100 -0
- package/skills/pymatgen/SKILL.md +28 -0
- package/skills/pymc/SKILL.md +108 -0
- package/skills/pymoo/SKILL.md +90 -0
- package/skills/pyopenms/SKILL.md +119 -0
- package/skills/pysam/SKILL.md +118 -0
- package/skills/pyspark/SKILL.md +30 -0
- package/skills/pytdc/SKILL.md +102 -0
- package/skills/pytorch/SKILL.md +31 -0
- package/skills/pytorch-lightning/SKILL.md +119 -0
- package/skills/pyzotero/SKILL.md +104 -0
- package/skills/qiskit/SKILL.md +119 -0
- package/skills/qutip/SKILL.md +111 -0
- package/skills/ralph/SKILL.md +23 -0
- package/skills/ralplan/SKILL.md +105 -0
- package/skills/rdflib/SKILL.md +29 -0
- package/skills/rdkit/SKILL.md +30 -0
- package/skills/read-only-explorer/SKILL.md +85 -0
- package/skills/receiving-code-review/SKILL.md +103 -0
- package/skills/release/SKILL.md +117 -0
- package/skills/remember/SKILL.md +39 -0
- package/skills/requesting-code-review/SKILL.md +85 -0
- package/skills/requirements-to-task-packet/SKILL.md +65 -0
- package/skills/research-grants/SKILL.md +118 -0
- package/skills/research-lookup/SKILL.md +117 -0
- package/skills/research-reproducibility/SKILL.md +28 -0
- package/skills/resource-discovery-config/SKILL.md +43 -0
- package/skills/rowan/SKILL.md +100 -0
- package/skills/runtime-state-reader/SKILL.md +46 -0
- package/skills/safe-bash/SKILL.md +85 -0
- package/skills/scanpy/SKILL.md +32 -0
- package/skills/scholar-evaluation/SKILL.md +115 -0
- package/skills/scientific-brainstorming/SKILL.md +118 -0
- package/skills/scientific-critical-thinking/SKILL.md +119 -0
- package/skills/scientific-schematics/SKILL.md +116 -0
- package/skills/scientific-slides/SKILL.md +117 -0
- package/skills/scientific-visualization/SKILL.md +109 -0
- package/skills/scientific-writing/SKILL.md +119 -0
- package/skills/scikit-bio/SKILL.md +92 -0
- package/skills/scikit-learn/SKILL.md +99 -0
- package/skills/scikit-survival/SKILL.md +110 -0
- package/skills/sciomc/SKILL.md +86 -0
- package/skills/scvelo/SKILL.md +106 -0
- package/skills/scvi-tools/SKILL.md +114 -0
- package/skills/seaborn/SKILL.md +97 -0
- package/skills/secure-agent-orchestration-review/SKILL.md +47 -0
- package/skills/self-improve/SKILL.md +119 -0
- package/skills/semantic-compression/SKILL.md +62 -0
- package/skills/setup/SKILL.md +42 -0
- package/skills/shap/SKILL.md +103 -0
- package/skills/simpy/SKILL.md +116 -0
- package/skills/skill/SKILL.md +117 -0
- package/skills/skill-search/SKILL.md +67 -0
- package/skills/skillify/SKILL.md +46 -0
- package/skills/smart-explore/SKILL.md +94 -0
- package/skills/sqlite-pandas/SKILL.md +30 -0
- package/skills/stable-baselines3/SKILL.md +86 -0
- package/skills/state-mutation-locking/SKILL.md +44 -0
- package/skills/statistical-analysis/SKILL.md +108 -0
- package/skills/statsmodels/SKILL.md +29 -0
- package/skills/subagent-driven-development/SKILL.md +89 -0
- package/skills/sympy/SKILL.md +115 -0
- package/skills/system-prompts/SKILL.md +116 -0
- package/skills/systematic-debugging/SKILL.md +119 -0
- package/skills/team/SKILL.md +85 -0
- package/skills/test-driven-development/SKILL.md +84 -0
- package/skills/tiledbvcf/SKILL.md +119 -0
- package/skills/timeline-report/SKILL.md +85 -0
- package/skills/timesfm-forecasting/SKILL.md +112 -0
- package/skills/torch-geometric/SKILL.md +118 -0
- package/skills/torchdrug/SKILL.md +118 -0
- package/skills/trace/SKILL.md +118 -0
- package/skills/transformers/SKILL.md +110 -0
- package/skills/treatment-plans/SKILL.md +119 -0
- package/skills/ui-render-performance/SKILL.md +41 -0
- package/skills/ultragoal/SKILL.md +63 -0
- package/skills/ultraqa/SKILL.md +85 -0
- package/skills/ultrawork/SKILL.md +20 -0
- package/skills/umap-learn/SKILL.md +119 -0
- package/skills/usfiscaldata/SKILL.md +118 -0
- package/skills/using-git-worktrees/SKILL.md +112 -0
- package/skills/using-superpowers/SKILL.md +85 -0
- package/skills/using-vetc/SKILL.md +92 -0
- package/skills/vaex/SKILL.md +111 -0
- package/skills/venue-templates/SKILL.md +113 -0
- package/skills/verification-before-completion/SKILL.md +88 -0
- package/skills/verification-before-done/SKILL.md +68 -0
- package/skills/verify/SKILL.md +33 -0
- package/skills/version-bump/SKILL.md +54 -0
- package/skills/vetc-analyze-ba/SKILL.md +117 -0
- package/skills/vetc-analyze-codebase/SKILL.md +118 -0
- package/skills/vetc-api-design/SKILL.md +103 -0
- package/skills/vetc-brainstorming/SKILL.md +116 -0
- package/skills/vetc-change-proposal/SKILL.md +111 -0
- package/skills/vetc-cicd/SKILL.md +113 -0
- package/skills/vetc-continuous-learning/SKILL.md +115 -0
- package/skills/vetc-deep-interview/SKILL.md +103 -0
- package/skills/vetc-docgen/SKILL.md +108 -0
- package/skills/vetc-frontend-patterns/SKILL.md +99 -0
- package/skills/vetc-iterative-retrieval/SKILL.md +110 -0
- package/skills/vetc-java-patterns/SKILL.md +113 -0
- package/skills/vetc-meta-skill-creator/SKILL.md +99 -0
- package/skills/vetc-oracle-patterns/SKILL.md +109 -0
- package/skills/vetc-performance-testing/SKILL.md +104 -0
- package/skills/vetc-pr-response/SKILL.md +106 -0
- package/skills/vetc-ralph/SKILL.md +108 -0
- package/skills/vetc-ralplan/SKILL.md +116 -0
- package/skills/vetc-receiving-review/SKILL.md +106 -0
- package/skills/vetc-reconcile-patterns/SKILL.md +117 -0
- package/skills/vetc-refactoring/SKILL.md +96 -0
- package/skills/vetc-runbook/SKILL.md +118 -0
- package/skills/vetc-sast/SKILL.md +118 -0
- package/skills/vetc-sdlc/SKILL.md +97 -0
- package/skills/vetc-security/SKILL.md +117 -0
- package/skills/vetc-spec-driven/SKILL.md +111 -0
- package/skills/vetc-spec-quality/SKILL.md +117 -0
- package/skills/vetc-systematic-debugging/SKILL.md +74 -0
- package/skills/vetc-tdd/SKILL.md +96 -0
- package/skills/vetc-thinking-pm/SKILL.md +110 -0
- package/skills/vetc-ui-visual-qa/SKILL.md +117 -0
- package/skills/vetc-verify/SKILL.md +101 -0
- package/skills/visual-verdict/SKILL.md +59 -0
- package/skills/what-if-oracle/SKILL.md +87 -0
- package/skills/widget-rendering/SKILL.md +85 -0
- package/skills/wiki/SKILL.md +69 -0
- package/skills/workspace-isolation/SKILL.md +85 -0
- package/skills/worktree-isolation/SKILL.md +85 -0
- package/skills/wowerpoint/SKILL.md +101 -0
- package/skills/writer-memory/SKILL.md +82 -0
- package/skills/writing-plans/SKILL.md +115 -0
- package/skills/writing-skills/SKILL.md +115 -0
- package/skills/xgboost/SKILL.md +29 -0
- package/skills/xgboost-ts/SKILL.md +28 -0
- package/skills/xlsx/SKILL.md +111 -0
- package/skills/zarr-python/SKILL.md +101 -0
- package/src/categories.ts +383 -0
- package/src/format.ts +104 -0
- package/src/indexer.ts +101 -0
- package/src/proactive.ts +51 -0
- package/src/scanner.ts +85 -0
- package/src/search.ts +89 -0
- package/src/strip.ts +29 -0
- package/src/synonyms.ts +83 -0
- package/src/text.ts +118 -0
- package/src/types.ts +64 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Category classifier — phan loai skill theo category.
|
|
3
|
+
* Implement theo SPEC §6.1 rules va §6.2 logic.
|
|
4
|
+
*
|
|
5
|
+
* Luu y: Word-boundary matching cho single-word keywords de tranh false positives.
|
|
6
|
+
* Multi-word keywords (phrases) match exact substring.
|
|
7
|
+
*/
|
|
8
|
+
export interface CategoryRule {
|
|
9
|
+
name: string;
|
|
10
|
+
keywords: string[];
|
|
11
|
+
maxExamples: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 14 category rules tu SPEC §6.1.
|
|
16
|
+
* Thu tu khai bao quyet dinh thu tu trong summary output.
|
|
17
|
+
*/
|
|
18
|
+
export const CATEGORY_RULES: CategoryRule[] = [
|
|
19
|
+
{
|
|
20
|
+
name: "Cheminformatics & Drug Discovery",
|
|
21
|
+
keywords: [
|
|
22
|
+
"molecular",
|
|
23
|
+
"molecule",
|
|
24
|
+
"drug",
|
|
25
|
+
"compound",
|
|
26
|
+
"chemic",
|
|
27
|
+
"smiles",
|
|
28
|
+
"docking",
|
|
29
|
+
"fingerprint",
|
|
30
|
+
"admet",
|
|
31
|
+
"cheminformatics",
|
|
32
|
+
"medicinal",
|
|
33
|
+
"rdkit",
|
|
34
|
+
"virtual screening",
|
|
35
|
+
"lead optim",
|
|
36
|
+
],
|
|
37
|
+
maxExamples: 5,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "Bioinformatics & Genomics",
|
|
41
|
+
keywords: [
|
|
42
|
+
"gene",
|
|
43
|
+
"genomic",
|
|
44
|
+
"rna-seq",
|
|
45
|
+
"single-cell",
|
|
46
|
+
"transcriptom",
|
|
47
|
+
"protein",
|
|
48
|
+
"sequence",
|
|
49
|
+
"variant",
|
|
50
|
+
"alignment",
|
|
51
|
+
"phylogen",
|
|
52
|
+
"pathway",
|
|
53
|
+
"gene regul",
|
|
54
|
+
"anndata",
|
|
55
|
+
"h5ad",
|
|
56
|
+
"neural recording",
|
|
57
|
+
"neuropixel",
|
|
58
|
+
"spikeglx",
|
|
59
|
+
"openephys",
|
|
60
|
+
"electrophysiolog",
|
|
61
|
+
"cytometry",
|
|
62
|
+
"imaging",
|
|
63
|
+
"radiology",
|
|
64
|
+
"pathology",
|
|
65
|
+
"knowledge graph",
|
|
66
|
+
"microscopy",
|
|
67
|
+
],
|
|
68
|
+
maxExamples: 5,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "Machine Learning & AI",
|
|
72
|
+
keywords: [
|
|
73
|
+
"machine learning",
|
|
74
|
+
"deep learning",
|
|
75
|
+
"neural network",
|
|
76
|
+
"reinforcement learn",
|
|
77
|
+
"gradient boost",
|
|
78
|
+
"random forest",
|
|
79
|
+
"model train",
|
|
80
|
+
"pytorch",
|
|
81
|
+
"tensorflow",
|
|
82
|
+
"transformer",
|
|
83
|
+
"gan",
|
|
84
|
+
"cnn",
|
|
85
|
+
"rnn",
|
|
86
|
+
"lstm",
|
|
87
|
+
"interpret",
|
|
88
|
+
"shap",
|
|
89
|
+
"feature engineer",
|
|
90
|
+
"scikit",
|
|
91
|
+
"sklearn",
|
|
92
|
+
"quantum comput",
|
|
93
|
+
"probabilistic",
|
|
94
|
+
"bayesian",
|
|
95
|
+
"mcmc",
|
|
96
|
+
],
|
|
97
|
+
maxExamples: 5,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: "Clinical & Medical",
|
|
101
|
+
keywords: [
|
|
102
|
+
"clinical",
|
|
103
|
+
"patient",
|
|
104
|
+
"medical",
|
|
105
|
+
"diagnosis",
|
|
106
|
+
"treatment",
|
|
107
|
+
"ehr",
|
|
108
|
+
"electronic health",
|
|
109
|
+
"hospital",
|
|
110
|
+
"therap",
|
|
111
|
+
"trial",
|
|
112
|
+
"icd",
|
|
113
|
+
"hipaa",
|
|
114
|
+
],
|
|
115
|
+
maxExamples: 5,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "Data Visualization & EDA",
|
|
119
|
+
keywords: [
|
|
120
|
+
"visualization",
|
|
121
|
+
"plotting",
|
|
122
|
+
"chart",
|
|
123
|
+
"datafram",
|
|
124
|
+
"eda",
|
|
125
|
+
"network analysis",
|
|
126
|
+
"time series",
|
|
127
|
+
"forecast",
|
|
128
|
+
],
|
|
129
|
+
maxExamples: 5,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "Scientific Writing & Communication",
|
|
133
|
+
keywords: [
|
|
134
|
+
"writing",
|
|
135
|
+
"paper",
|
|
136
|
+
"publication",
|
|
137
|
+
"peer review",
|
|
138
|
+
"citation",
|
|
139
|
+
"bibtex",
|
|
140
|
+
"literature",
|
|
141
|
+
"poster",
|
|
142
|
+
"slide",
|
|
143
|
+
"schematic",
|
|
144
|
+
"infographic",
|
|
145
|
+
"markdown",
|
|
146
|
+
"document convert",
|
|
147
|
+
"report",
|
|
148
|
+
"research proposal",
|
|
149
|
+
"latex",
|
|
150
|
+
],
|
|
151
|
+
maxExamples: 5,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "Geospatial & Remote Sensing",
|
|
155
|
+
keywords: [
|
|
156
|
+
"geospatial",
|
|
157
|
+
"gis",
|
|
158
|
+
"satellite",
|
|
159
|
+
"spatial",
|
|
160
|
+
"terrain",
|
|
161
|
+
"remote sensing",
|
|
162
|
+
"raster",
|
|
163
|
+
"vector",
|
|
164
|
+
"coordinate",
|
|
165
|
+
"map",
|
|
166
|
+
],
|
|
167
|
+
maxExamples: 5,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "Lab Automation & Integration",
|
|
171
|
+
keywords: [
|
|
172
|
+
"lab",
|
|
173
|
+
"laboratory",
|
|
174
|
+
"liquid handl",
|
|
175
|
+
"plate reader",
|
|
176
|
+
"workflow automat",
|
|
177
|
+
"lims",
|
|
178
|
+
"pipette",
|
|
179
|
+
"robot",
|
|
180
|
+
"opentrons",
|
|
181
|
+
"benchling",
|
|
182
|
+
"latchbio",
|
|
183
|
+
"microscopy",
|
|
184
|
+
"hpc",
|
|
185
|
+
],
|
|
186
|
+
maxExamples: 5,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "Time Series & Forecasting",
|
|
190
|
+
keywords: ["time series", "forecast", "anomaly detect", "signal process", "timesfm", "aeon"],
|
|
191
|
+
maxExamples: 5,
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: "Materials Science & Engineering",
|
|
195
|
+
keywords: [
|
|
196
|
+
"crystal",
|
|
197
|
+
"material",
|
|
198
|
+
"phase diagram",
|
|
199
|
+
"metabolic model",
|
|
200
|
+
"simulation",
|
|
201
|
+
"optimization",
|
|
202
|
+
"pymoo",
|
|
203
|
+
"simpy",
|
|
204
|
+
"pymatgen",
|
|
205
|
+
"fluid dynamics",
|
|
206
|
+
"navier-stokes",
|
|
207
|
+
"turbulence",
|
|
208
|
+
],
|
|
209
|
+
maxExamples: 5,
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "Research Methodology",
|
|
213
|
+
keywords: [
|
|
214
|
+
"hypothesis",
|
|
215
|
+
"brainstorm",
|
|
216
|
+
"critical thinking",
|
|
217
|
+
"grant",
|
|
218
|
+
"scholar",
|
|
219
|
+
"peer review",
|
|
220
|
+
"reproducib",
|
|
221
|
+
"experimental design",
|
|
222
|
+
"nsf",
|
|
223
|
+
"nih",
|
|
224
|
+
"doe",
|
|
225
|
+
"darpa",
|
|
226
|
+
"proposal",
|
|
227
|
+
],
|
|
228
|
+
maxExamples: 5,
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: "Integration Platforms",
|
|
232
|
+
keywords: [
|
|
233
|
+
"benchling",
|
|
234
|
+
"modal",
|
|
235
|
+
"streamlit",
|
|
236
|
+
"gradio",
|
|
237
|
+
"api",
|
|
238
|
+
"rest",
|
|
239
|
+
"webhook",
|
|
240
|
+
"service",
|
|
241
|
+
"deploy",
|
|
242
|
+
],
|
|
243
|
+
maxExamples: 5,
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: "Developer Tools & Workflow",
|
|
247
|
+
keywords: [
|
|
248
|
+
"debug",
|
|
249
|
+
"profile",
|
|
250
|
+
"test",
|
|
251
|
+
"ci/cd",
|
|
252
|
+
"lint",
|
|
253
|
+
"format",
|
|
254
|
+
"types",
|
|
255
|
+
"version control",
|
|
256
|
+
"repo",
|
|
257
|
+
"github",
|
|
258
|
+
],
|
|
259
|
+
maxExamples: 5,
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: "AI Agent & Pi Extensions",
|
|
263
|
+
keywords: [
|
|
264
|
+
"agent",
|
|
265
|
+
"crew",
|
|
266
|
+
"team",
|
|
267
|
+
"worker",
|
|
268
|
+
"pipeline",
|
|
269
|
+
"memory",
|
|
270
|
+
"pi-extension",
|
|
271
|
+
"extension",
|
|
272
|
+
"pi-skill",
|
|
273
|
+
"pi extension",
|
|
274
|
+
"skill",
|
|
275
|
+
"llm",
|
|
276
|
+
"prompt",
|
|
277
|
+
"task",
|
|
278
|
+
"orchestrat",
|
|
279
|
+
"async",
|
|
280
|
+
"parallel",
|
|
281
|
+
"pi-crew",
|
|
282
|
+
"pi crew",
|
|
283
|
+
"autonomous",
|
|
284
|
+
"react-agent",
|
|
285
|
+
"react agent",
|
|
286
|
+
"codegen",
|
|
287
|
+
"code generat",
|
|
288
|
+
"browser-agent",
|
|
289
|
+
"browser agent",
|
|
290
|
+
"langchain",
|
|
291
|
+
"langgraph",
|
|
292
|
+
"crewai",
|
|
293
|
+
"ultraqa",
|
|
294
|
+
"ultragoal",
|
|
295
|
+
"omc ",
|
|
296
|
+
"claude mem",
|
|
297
|
+
"deep-interview",
|
|
298
|
+
"deep interview",
|
|
299
|
+
"deepinit",
|
|
300
|
+
"deep codebase",
|
|
301
|
+
"learner",
|
|
302
|
+
"make-plan",
|
|
303
|
+
"make plan",
|
|
304
|
+
"mcp",
|
|
305
|
+
"code review",
|
|
306
|
+
"pull request",
|
|
307
|
+
"subagent",
|
|
308
|
+
"dispatching",
|
|
309
|
+
"executing plan",
|
|
310
|
+
"verification-before",
|
|
311
|
+
"systematic debug",
|
|
312
|
+
"semantic compress",
|
|
313
|
+
"smart-explore",
|
|
314
|
+
"smart explore",
|
|
315
|
+
"consciousness",
|
|
316
|
+
"hud",
|
|
317
|
+
"autoresearch",
|
|
318
|
+
"self-improve",
|
|
319
|
+
"babysit",
|
|
320
|
+
"writer-memory",
|
|
321
|
+
"writer memory",
|
|
322
|
+
"visual-verdict",
|
|
323
|
+
"visual verdict",
|
|
324
|
+
"external-context",
|
|
325
|
+
"external context",
|
|
326
|
+
"remember",
|
|
327
|
+
"system prompt",
|
|
328
|
+
"spec-kit",
|
|
329
|
+
"community extension",
|
|
330
|
+
"verify",
|
|
331
|
+
"plan",
|
|
332
|
+
"finishing",
|
|
333
|
+
"development branch",
|
|
334
|
+
"learn-codebase",
|
|
335
|
+
"semantic-compression",
|
|
336
|
+
"systematic-debugging",
|
|
337
|
+
],
|
|
338
|
+
maxExamples: 5,
|
|
339
|
+
},
|
|
340
|
+
];
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Phan loai skill vao cac categories.
|
|
344
|
+
* Word-boundary matching: keyword phai la mot "word" trong text.
|
|
345
|
+
* Multi-word keywords (phrases) phai xuat hien exactly trong text.
|
|
346
|
+
* Gioi han false positives nhu "gene" matching "generation".
|
|
347
|
+
*/
|
|
348
|
+
export function classify(entry: { name: string; description: string }): string[] {
|
|
349
|
+
const text = `${entry.name} ${entry.description}`.toLowerCase();
|
|
350
|
+
const matched: string[] = [];
|
|
351
|
+
|
|
352
|
+
for (const rule of CATEGORY_RULES) {
|
|
353
|
+
if (rule.keywords.some((kw) => matchKeyword(kw, text))) {
|
|
354
|
+
matched.push(rule.name);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
return matched.length > 0 ? matched : ["Other"];
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Match keyword trong text voi word-boundary semantics.
|
|
363
|
+
* - Single-word keyword: phai la mot "word" (bounded boi non-alphanumeric/start/end)
|
|
364
|
+
* - Multi-word keyword: phai xuat hien exactly trong text
|
|
365
|
+
*/
|
|
366
|
+
function matchKeyword(keyword: string, text: string): boolean {
|
|
367
|
+
const kw = keyword.toLowerCase();
|
|
368
|
+
if (kw.includes(" ")) {
|
|
369
|
+
// Multi-word: exact substring match
|
|
370
|
+
return text.includes(kw);
|
|
371
|
+
}
|
|
372
|
+
// Single-word: word boundary match
|
|
373
|
+
// Match: bounded by non-alphanumeric or start/end
|
|
374
|
+
const pattern = new RegExp(`(?:[^a-z0-9]|^)${escapeRegex(kw)}(?:[^a-z0-9]|$)`, "i");
|
|
375
|
+
return pattern.test(text);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Escape regex special characters.
|
|
380
|
+
*/
|
|
381
|
+
function escapeRegex(s: string): string {
|
|
382
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
383
|
+
}
|
package/src/format.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output formatters — render category summary, tool description, search results.
|
|
3
|
+
* Implement theo SPEC §4.4, §4.5, §6.3.
|
|
4
|
+
*/
|
|
5
|
+
import type { SearchResult, SkillIndex } from "./types.ts";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Uong tinh token count (chars / 3.5).
|
|
9
|
+
*/
|
|
10
|
+
export function estimateTokens(text: string): number {
|
|
11
|
+
return Math.ceil(text.length / 3.5);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Render category summary cho system prompt.
|
|
16
|
+
* SPEC §6.3 format voi token budget enforcement (≤250 tokens).
|
|
17
|
+
*/
|
|
18
|
+
export function formatCategorySummary(index: SkillIndex): string {
|
|
19
|
+
// Render voi progressive truncation: maxExamples 5 → 4 → 3 → 2 → 1 → 0
|
|
20
|
+
for (let maxEx = 5; maxEx >= 0; maxEx--) {
|
|
21
|
+
const summary = renderSummary(index, maxEx);
|
|
22
|
+
if (estimateTokens(summary) <= 250) {
|
|
23
|
+
return summary;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// Fallback: chi category names
|
|
27
|
+
return renderCategoryNamesOnly(index);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Render summary voi specific maxExamples.
|
|
32
|
+
*/
|
|
33
|
+
function renderSummary(index: SkillIndex, maxExamples: number): string {
|
|
34
|
+
const lines: string[] = ["## Available Skill Domains", ""];
|
|
35
|
+
|
|
36
|
+
for (const cat of index.categories) {
|
|
37
|
+
const examples = cat.examples.slice(0, maxExamples);
|
|
38
|
+
const exStr = examples.length > 0 ? ` (${examples.join(", ")})` : "";
|
|
39
|
+
lines.push(`- **${cat.name}**: ${cat.count} skills${exStr}`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
lines.push("");
|
|
43
|
+
lines.push("Use the `skill-search` tool to find specific skills by keyword.");
|
|
44
|
+
|
|
45
|
+
return lines.join("\n");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Render chi category names khi summary vuot token budget.
|
|
50
|
+
*/
|
|
51
|
+
function renderCategoryNamesOnly(index: SkillIndex): string {
|
|
52
|
+
const names = index.categories.map((c) => c.name).join(", ");
|
|
53
|
+
return `## Available Skill Domains\n\n${names}\n\nUse the \`skill-search\` tool to find specific skills.`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Render tool description voi live category list.
|
|
58
|
+
* SPEC §4.4 template.
|
|
59
|
+
*/
|
|
60
|
+
export function renderToolDescription(index: SkillIndex): string {
|
|
61
|
+
const categoryList = index.categories.map((c) => c.name.toLowerCase()).join(", ");
|
|
62
|
+
|
|
63
|
+
// Top 3 categories by count (ties by declaration order)
|
|
64
|
+
const sorted = [...index.categories].sort((a, b) => {
|
|
65
|
+
if (b.count !== a.count) return b.count - a.count;
|
|
66
|
+
return index.categories.indexOf(a) - index.categories.indexOf(b);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const top3 = sorted.slice(0, 3);
|
|
70
|
+
const examples = top3
|
|
71
|
+
.filter((c) => c.examples.length > 0)
|
|
72
|
+
.map((c) => `"${c.examples[0]}"`)
|
|
73
|
+
.join(", ");
|
|
74
|
+
|
|
75
|
+
return [
|
|
76
|
+
"Search for skills by keyword. Returns top matching skills with name, description, and path.",
|
|
77
|
+
`Available domains: ${categoryList}.`,
|
|
78
|
+
`Try queries like: ${examples}.`,
|
|
79
|
+
"Use the `read` tool to load a skill's full SKILL.md after finding it.",
|
|
80
|
+
].join(" ");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Format search results cho tool output.
|
|
85
|
+
* SPEC §4.3 format.
|
|
86
|
+
*/
|
|
87
|
+
export function formatResults(query: string, results: SearchResult[], totalIndexed: number): string {
|
|
88
|
+
if (results.length === 0) {
|
|
89
|
+
return `No skills found matching '${query}'. ${totalIndexed} skills indexed. Try broader terms.`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const lines: string[] = [`Found ${results.length} skills for "${query}":`, ""];
|
|
93
|
+
|
|
94
|
+
for (const r of results) {
|
|
95
|
+
lines.push(`## ${r.name} (score: ${r.score.toFixed(2)})`);
|
|
96
|
+
lines.push(r.description);
|
|
97
|
+
lines.push(`Path: ${r.path}`);
|
|
98
|
+
lines.push("");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
lines.push("Use the `read` tool to load a skill's full instructions from the path above.");
|
|
102
|
+
|
|
103
|
+
return lines.join("\n");
|
|
104
|
+
}
|
package/src/indexer.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { CATEGORY_RULES, classify } from "./categories.ts";
|
|
2
|
+
import { tokenize } from "./text.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Index builder — buildIndex va fingerprintSkills.
|
|
5
|
+
* Implement theo SPEC §6.4.
|
|
6
|
+
*/
|
|
7
|
+
import type { CategorySummary, PiSkill, SkillEntry, SkillIndex } from "./types.ts";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Build search index tu danh sach Pi skills.
|
|
11
|
+
* Two-pass algorithm per SPEC §6.4:
|
|
12
|
+
* Pass 1: classify + tokenize moi skill
|
|
13
|
+
* Pass 2: build CategorySummary[] theo CATEGORY_RULES declaration order
|
|
14
|
+
*
|
|
15
|
+
* Deterministic: cung input → cung output (last-write-wins nameIndex).
|
|
16
|
+
*/
|
|
17
|
+
export function buildIndex(skills: PiSkill[]): SkillIndex {
|
|
18
|
+
const entries = new Map<string, SkillEntry>();
|
|
19
|
+
const nameIndex = new Map<string, string>();
|
|
20
|
+
|
|
21
|
+
// Pass 1: build entries
|
|
22
|
+
for (const skill of skills) {
|
|
23
|
+
const categories = classify(skill);
|
|
24
|
+
const nameTokens = tokenize(skill.name);
|
|
25
|
+
const descTokens = tokenize(skill.description);
|
|
26
|
+
|
|
27
|
+
const entry: SkillEntry = {
|
|
28
|
+
name: skill.name,
|
|
29
|
+
description: skill.description,
|
|
30
|
+
path: skill.filePath,
|
|
31
|
+
categories,
|
|
32
|
+
nameTokens,
|
|
33
|
+
descTokens,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
entries.set(skill.name, entry);
|
|
37
|
+
|
|
38
|
+
// Build nameIndex: tokenized name fragment → skill name
|
|
39
|
+
for (const token of nameTokens) {
|
|
40
|
+
nameIndex.set(token, skill.name);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Pass 2: build CategorySummary[] in CATEGORY_RULES declaration order
|
|
45
|
+
const categoryMap = new Map<string, string[]>();
|
|
46
|
+
|
|
47
|
+
// Khoi tao tat ca categories theo declaration order
|
|
48
|
+
for (const rule of CATEGORY_RULES) {
|
|
49
|
+
categoryMap.set(rule.name, []);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Phan bo skills vao categories
|
|
53
|
+
for (const entry of entries.values()) {
|
|
54
|
+
for (const cat of entry.categories) {
|
|
55
|
+
const list = categoryMap.get(cat);
|
|
56
|
+
if (list) {
|
|
57
|
+
list.push(entry.name);
|
|
58
|
+
} else {
|
|
59
|
+
// "Other" — khong co trong CATEGORY_RULES
|
|
60
|
+
categoryMap.set(cat, [entry.name]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Build CategorySummary[] — chi bao gom categories co skills
|
|
66
|
+
const categories: CategorySummary[] = [];
|
|
67
|
+
|
|
68
|
+
for (const rule of CATEGORY_RULES) {
|
|
69
|
+
const skills = categoryMap.get(rule.name);
|
|
70
|
+
if (skills && skills.length > 0) {
|
|
71
|
+
categories.push({
|
|
72
|
+
name: rule.name,
|
|
73
|
+
count: skills.length,
|
|
74
|
+
examples: skills.slice(0, rule.maxExamples),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Them "Other" cuoi cung neu co
|
|
80
|
+
const otherSkills = categoryMap.get("Other");
|
|
81
|
+
if (otherSkills && otherSkills.length > 0) {
|
|
82
|
+
categories.push({
|
|
83
|
+
name: "Other",
|
|
84
|
+
count: otherSkills.length,
|
|
85
|
+
examples: otherSkills.slice(0, 5),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return { entries, categories, nameIndex };
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Tao fingerprint tu danh sach skills de detect thay doi.
|
|
94
|
+
* Sorted filePath join — deterministic.
|
|
95
|
+
*/
|
|
96
|
+
export function fingerprintSkills(skills: PiSkill[]): string {
|
|
97
|
+
return skills
|
|
98
|
+
.map((s) => `${s.filePath}:${s.name}:${s.description.length}:${s.disableModelInvocation ? 1 : 0}`)
|
|
99
|
+
.sort()
|
|
100
|
+
.join("\n");
|
|
101
|
+
}
|
package/src/proactive.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 10 — Proactive suggestion hook.
|
|
3
|
+
* Detect Python package imports trong bash commands va suggest matching skills.
|
|
4
|
+
* SPEC §11 E02-S01.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Regex patterns cho detecting Python package imports/installs.
|
|
9
|
+
*/
|
|
10
|
+
const PATTERNS = [
|
|
11
|
+
{ re: /\bimport\s+([a-zA-Z_][\w]*)/g, multi: false },
|
|
12
|
+
{ re: /\bfrom\s+([a-zA-Z_][\w]*)\s+import\b/g, multi: false },
|
|
13
|
+
{ re: /\bpip\s+install\s+(.+)/g, multi: true },
|
|
14
|
+
{ re: /\buv\s+(?:add|pip\s+install)\s+(.+)/g, multi: true },
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Detect Python package names tu bash command.
|
|
19
|
+
* Tra ve danh sach package names da detect.
|
|
20
|
+
*/
|
|
21
|
+
export function detectPythonPackages(command: string): string[] {
|
|
22
|
+
const packages = new Set<string>();
|
|
23
|
+
|
|
24
|
+
// Skip comments
|
|
25
|
+
if (command.trim().startsWith("#")) return [];
|
|
26
|
+
|
|
27
|
+
for (const { re, multi } of PATTERNS) {
|
|
28
|
+
const regex = new RegExp(re.source, re.flags);
|
|
29
|
+
let match: RegExpExecArray | null = regex.exec(command);
|
|
30
|
+
while (match !== null) {
|
|
31
|
+
if (multi) {
|
|
32
|
+
// Split by whitespace, filter out flags like -r, -U, etc
|
|
33
|
+
const parts = match[1].split(/\s+/);
|
|
34
|
+
for (const part of parts) {
|
|
35
|
+
const pkg = part.split(/[=><@]/)[0].trim();
|
|
36
|
+
if (pkg && pkg.length >= 2 && !pkg.startsWith("-")) {
|
|
37
|
+
packages.add(pkg.toLowerCase());
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
const pkg = match[1].split(/[=><@]/)[0].trim();
|
|
42
|
+
if (pkg && pkg.length >= 2) {
|
|
43
|
+
packages.add(pkg.toLowerCase());
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
match = regex.exec(command);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return [...packages];
|
|
51
|
+
}
|