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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (2026-05-17)
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Core extension: replaces Pi's inject-all skill descriptions with on-demand search tool + category summary
|
|
7
|
+
- `skill-search` tool with query (1-500 chars) and limit (1-20, default 5)
|
|
8
|
+
- Category classifier with 14 domain rules, 76+ keywords
|
|
9
|
+
- Synonym dictionary with 50+ entries across 10 domains
|
|
10
|
+
- 70+ English stopwords for accurate search scoring
|
|
11
|
+
- Strip regex to remove Pi's `<available_skills>` block from system prompt
|
|
12
|
+
- Category summary injection via `before_agent_start` event
|
|
13
|
+
- Proactive suggestion hook for Python package detection (opt-in)
|
|
14
|
+
- **258 bundled skills** from 10 source repos:
|
|
15
|
+
- scientific-agent-skills (137), oh-my-claudecode (29), vetc-dev-kit (33)
|
|
16
|
+
- pi-crew (27), superpowers (14), oh-my-pi (2), claude-mem (12)
|
|
17
|
+
- gstack (1), context-mode (1), spec-kit (1)
|
|
18
|
+
- 14/14 categories, 0 Other
|
|
19
|
+
- 123 tests across 14 test files including search quality benchmarks
|
|
20
|
+
- Biome lint + TypeScript strict mode clean
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 pi-skill-search contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# pi-skill-search
|
|
2
|
+
|
|
3
|
+
> Pi extension: replace "inject all skill descriptions" with on-demand search tool + category summary.
|
|
4
|
+
|
|
5
|
+
## Problem
|
|
6
|
+
|
|
7
|
+
Pi injects **all** skill `<available_skills>` descriptions into every agent's system prompt. With 258 skills across 14 categories, that's ~40,000+ tokens wasted per turn — even when the agent never uses any skill.
|
|
8
|
+
|
|
9
|
+
## Solution
|
|
10
|
+
|
|
11
|
+
- **Strip** the `<available_skills>` block from the system prompt on `before_agent_start`
|
|
12
|
+
- **Inject** a compact `## Available Skill Domains` category summary (≤250 tokens)
|
|
13
|
+
- **Register** a `skill-search` tool the agent calls on-demand to find relevant skills
|
|
14
|
+
|
|
15
|
+
Result: **~97% token reduction** in skill-related system prompt content.
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Install
|
|
21
|
+
npm install
|
|
22
|
+
|
|
23
|
+
# Run tests
|
|
24
|
+
npm test
|
|
25
|
+
|
|
26
|
+
# Build fixture from scientific-agent-skills
|
|
27
|
+
npx tsx scripts/build-skills-fixture.ts
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Architecture
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
index.ts ← Extension entry (before_agent_start + skill-search tool)
|
|
34
|
+
src/
|
|
35
|
+
types.ts ← PiSkill, SkillEntry, SearchResult, SkillIndex
|
|
36
|
+
text.ts ← Tokenizer (SPEC §5.3)
|
|
37
|
+
synonyms.ts ← Synonym dictionary + expandQuery
|
|
38
|
+
categories.ts ← 14 category rules + classify()
|
|
39
|
+
indexer.ts ← buildIndex() two-pass + fingerprintSkills()
|
|
40
|
+
search.ts ← Scored search (SPEC §5.1)
|
|
41
|
+
strip.ts ← Regex strip <available_skills>
|
|
42
|
+
format.ts ← Category summary + result formatting
|
|
43
|
+
proactive.ts ← Python package detection (Phase 10, opt-in)
|
|
44
|
+
test/
|
|
45
|
+
text.test.ts ← 12 tests
|
|
46
|
+
synonyms.test.ts ← 8 tests
|
|
47
|
+
classify.test.ts ← 8 tests
|
|
48
|
+
indexer.test.ts ← 12 tests
|
|
49
|
+
search.test.ts ← 11 tests
|
|
50
|
+
format.test.ts ← 12 tests
|
|
51
|
+
strip.test.ts ← 6 tests
|
|
52
|
+
lifecycle.test.ts ← 15 tests
|
|
53
|
+
integration.test.ts ← 8 tests (258-skill corpus)
|
|
54
|
+
failure-isolation.test.ts ← 3 tests
|
|
55
|
+
coverage.test.ts ← 3 tests (classifier coverage)
|
|
56
|
+
proactive.test.ts ← 9 tests
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Tool: `skill-search`
|
|
60
|
+
|
|
61
|
+
| Parameter | Type | Required | Description |
|
|
62
|
+
|-----------|------|----------|-------------|
|
|
63
|
+
| `query` | string | ✅ | Search query (1–500 chars) |
|
|
64
|
+
| `limit` | number | ❌ | Max results (1–20, default 5) |
|
|
65
|
+
|
|
66
|
+
Returns formatted skill descriptions with name, description, category, and file path.
|
|
67
|
+
|
|
68
|
+
## Configuration
|
|
69
|
+
|
|
70
|
+
No configuration needed — the extension auto-indexes skills from Pi's `systemPromptOptions.skills` on the first `before_agent_start` event.
|
|
71
|
+
|
|
72
|
+
## Bundled Skills (`skills/`)
|
|
73
|
+
|
|
74
|
+
The extension ships with **25 bundled skills** covering 14 scientific domains. These live in `skills/` and are scanned by the extension directly — Pi does **not** discover them at startup.
|
|
75
|
+
|
|
76
|
+
| Category | Skills |
|
|
77
|
+
|---|---|
|
|
78
|
+
| Cheminformatics & Drug Discovery | rdkit |
|
|
79
|
+
| Bioinformatics & Genomics | scanpy, biopython, huggingface, openephys, rdkit |
|
|
80
|
+
| Machine Learning & AI | pytorch, huggingface, xgboost, xgboost-ts |
|
|
81
|
+
| Clinical & Medical | clinical-trial, pubmed-search |
|
|
82
|
+
| Physics & Quantum | astropy |
|
|
83
|
+
| Databases & Data Sources | sqlite-pandas, fastapi, pyspark, pubmed-search |
|
|
84
|
+
| Data Analysis & Visualization | matplotlib, statsmodels, xgboost-ts, nilearn, pyspark |
|
|
85
|
+
| Scientific Writing & Communication | matplotlib, pubmed-search, research-reproducibility |
|
|
86
|
+
| Geospatial & Remote Sensing | landsat, astropy, matplotlib |
|
|
87
|
+
| Lab Automation & Integration | docker-sandbox, celery-pipeline |
|
|
88
|
+
| Time Series & Forecasting | statsmodels, xgboost-ts, openephys |
|
|
89
|
+
| Materials Science & Engineering | pymatgen |
|
|
90
|
+
| Research Methodology | research-reproducibility, statsmodels |
|
|
91
|
+
| Integration Platforms | rdflib, markitdown-docs, sqlite-pandas |
|
|
92
|
+
| Meta | skill-search (this tool usage guide) |
|
|
93
|
+
|
|
94
|
+
To add new skills: create `skills/<name>/SKILL.md` with YAML frontmatter (`name`, `description`). The extension picks them up automatically.
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
MIT
|
package/index.ts
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pi-skill-search — Extension entry point.
|
|
3
|
+
* Implement theo SPEC §7.3, §7.4.
|
|
4
|
+
*
|
|
5
|
+
* Thay the Pi's inject-all pattern bang on-demand search tool + category summary.
|
|
6
|
+
*/
|
|
7
|
+
import * as path from "node:path";
|
|
8
|
+
import { formatCategorySummary, formatResults, renderToolDescription } from "./src/format.ts";
|
|
9
|
+
import { buildIndex, fingerprintSkills } from "./src/indexer.ts";
|
|
10
|
+
import { resolveExtensionRoot, scanSkillDirectory } from "./src/scanner.ts";
|
|
11
|
+
import { search } from "./src/search.ts";
|
|
12
|
+
import { stripAvailableSkillsBlock } from "./src/strip.ts";
|
|
13
|
+
import type {
|
|
14
|
+
BeforeAgentStartEvent,
|
|
15
|
+
BeforeAgentStartEventResult,
|
|
16
|
+
ExtensionAPI,
|
|
17
|
+
PiSkill,
|
|
18
|
+
SkillIndex,
|
|
19
|
+
} from "./src/types.ts";
|
|
20
|
+
/** JSON Schema cho skill-search tool parameters */
|
|
21
|
+
const SEARCH_PARAMETERS = {
|
|
22
|
+
type: "object" as const,
|
|
23
|
+
properties: {
|
|
24
|
+
query: { type: "string" as const, description: "Search query — 1 to 500 characters" },
|
|
25
|
+
limit: { type: "number" as const, description: "Max results (1-20, default 5)" },
|
|
26
|
+
},
|
|
27
|
+
required: ["query"],
|
|
28
|
+
additionalProperties: false,
|
|
29
|
+
};
|
|
30
|
+
/** path.join wrapper */
|
|
31
|
+
const pathJoin = path.join;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Merge Pi skills + sample skills. Dedupe by name — sample skills win ties.
|
|
35
|
+
*/
|
|
36
|
+
function mergeSkills(piSkills: PiSkill[], sampleSkills: PiSkill[]): PiSkill[] {
|
|
37
|
+
if (sampleSkills.length === 0) return piSkills;
|
|
38
|
+
if (piSkills.length === 0) return sampleSkills;
|
|
39
|
+
const byName = new Map<string, PiSkill>();
|
|
40
|
+
for (const s of piSkills) byName.set(s.name, s);
|
|
41
|
+
for (const s of sampleSkills) byName.set(s.name, s); // sample overwrites
|
|
42
|
+
return [...byName.values()];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default function (pi: ExtensionAPI): void {
|
|
46
|
+
let index: SkillIndex | undefined;
|
|
47
|
+
let lastSkillsFingerprint = "";
|
|
48
|
+
let toolRegistered = false;
|
|
49
|
+
|
|
50
|
+
// Scan skills/ directory — bộ skill chính thức do pi-skill-search quản lý
|
|
51
|
+
const extensionRoot = resolveExtensionRoot();
|
|
52
|
+
const skillsDir = pathJoin(extensionRoot, "skills");
|
|
53
|
+
const bundledSkills = scanSkillDirectory(skillsDir);
|
|
54
|
+
if (bundledSkills.length > 0) {
|
|
55
|
+
console.log(`pi-skill-search: loaded ${bundledSkills.length} bundled skills from ${skillsDir}`);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Build (hoac rebuild) index.
|
|
59
|
+
* Merge Pi's visible skills + bundled skills/ (dedupe by name, bundled wins).
|
|
60
|
+
* Bundled skills chi duoc load khi co it nhat 1 Pi skill visible
|
|
61
|
+
* (khong tao index khi Pi khong co skills nao).
|
|
62
|
+
* Fingerprint short-circuit de tranh rebuild khong can thiet.
|
|
63
|
+
*/
|
|
64
|
+
function ensureIndex(skills: PiSkill[] | undefined): SkillIndex | undefined {
|
|
65
|
+
const piVisible = (skills ?? []).filter((s) => !s.disableModelInvocation);
|
|
66
|
+
// Chi merge sample skills khi co it nhat 1 Pi skill visible
|
|
67
|
+
const merged = piVisible.length > 0 ? mergeSkills(piVisible, bundledSkills) : bundledSkills;
|
|
68
|
+
if (merged.length === 0) return undefined;
|
|
69
|
+
const fingerprint = fingerprintSkills(merged);
|
|
70
|
+
if (fingerprint === lastSkillsFingerprint && index) return index;
|
|
71
|
+
try {
|
|
72
|
+
index = buildIndex(merged);
|
|
73
|
+
lastSkillsFingerprint = fingerprint;
|
|
74
|
+
return index;
|
|
75
|
+
} catch (err) {
|
|
76
|
+
console.error("pi-skill-search: index build failed", err);
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* before_agent_start handler:
|
|
82
|
+
* - Build/rebuild index
|
|
83
|
+
* - Register skill-search tool (first time only)
|
|
84
|
+
* - Strip <available_skills> block (ALWAYS — prevent Pi reset)
|
|
85
|
+
* - Inject category summary (when skills exist)
|
|
86
|
+
*/
|
|
87
|
+
pi.on("before_agent_start", async (event: BeforeAgentStartEvent): Promise<BeforeAgentStartEventResult> => {
|
|
88
|
+
const skills = event.systemPromptOptions?.skills as PiSkill[] | undefined;
|
|
89
|
+
const idx = ensureIndex(skills);
|
|
90
|
+
|
|
91
|
+
// ALWAYS strip — if extension returns undefined, Pi resets to
|
|
92
|
+
// baseSystemPrompt which still contains <available_skills> block.
|
|
93
|
+
const stripped = stripAvailableSkillsBlock(event.systemPrompt);
|
|
94
|
+
|
|
95
|
+
if (!idx || idx.entries.size === 0) {
|
|
96
|
+
// No skills → strip block nhung khong inject summary
|
|
97
|
+
return { systemPrompt: stripped };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Dang ky tool lan dau tien
|
|
101
|
+
if (!toolRegistered) {
|
|
102
|
+
pi.registerTool({
|
|
103
|
+
name: "skill-search",
|
|
104
|
+
label: "Skill Search",
|
|
105
|
+
description: renderToolDescription(idx),
|
|
106
|
+
parameters: SEARCH_PARAMETERS,
|
|
107
|
+
async execute(
|
|
108
|
+
_toolCallId: string,
|
|
109
|
+
input: { query?: string; limit?: number },
|
|
110
|
+
_signal: AbortSignal | undefined,
|
|
111
|
+
_onUpdate: unknown,
|
|
112
|
+
_ctx: unknown,
|
|
113
|
+
) {
|
|
114
|
+
return makeSearchResult(() => index, input);
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
toolRegistered = true;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Inject category summary
|
|
121
|
+
const summary = formatCategorySummary(idx);
|
|
122
|
+
return { systemPrompt: `${stripped}\n\n${summary}` };
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Xu ly search request voi validation va error handling.
|
|
127
|
+
* Tra ve AgentToolResult format.
|
|
128
|
+
*/
|
|
129
|
+
function makeSearchResult(
|
|
130
|
+
getIndex: () => SkillIndex | undefined,
|
|
131
|
+
input: { query?: string; limit?: number },
|
|
132
|
+
): { content: Array<{ type: "text"; text: string }>; details: Record<string, unknown> } {
|
|
133
|
+
try {
|
|
134
|
+
const idx = getIndex();
|
|
135
|
+
if (!idx || idx.entries.size === 0) {
|
|
136
|
+
return { content: [{ type: "text", text: "No skills indexed." }], details: {} };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const query = (input.query ?? "").trim();
|
|
140
|
+
if (query.length === 0) {
|
|
141
|
+
return { content: [{ type: "text", text: "Query is required." }], details: {} };
|
|
142
|
+
}
|
|
143
|
+
if (query.length > 500) {
|
|
144
|
+
return { content: [{ type: "text", text: "Query too long (max 500 chars)." }], details: {} };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Clamp limit to [1, 20]; default 5
|
|
148
|
+
const rawLimit = input.limit != null && Number.isFinite(input.limit) ? input.limit : 5;
|
|
149
|
+
const limit = Math.max(1, Math.min(20, Math.floor(rawLimit)));
|
|
150
|
+
|
|
151
|
+
const results = search(idx, query, limit);
|
|
152
|
+
const text = formatResults(query, results, idx.entries.size);
|
|
153
|
+
|
|
154
|
+
return {
|
|
155
|
+
content: [{ type: "text", text }],
|
|
156
|
+
details: { query, resultCount: results.length },
|
|
157
|
+
};
|
|
158
|
+
} catch (err) {
|
|
159
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
160
|
+
console.error("pi-skill-search: search failed", err);
|
|
161
|
+
return { content: [{ type: "text", text: `Search failed: ${message}` }], details: {} };
|
|
162
|
+
}
|
|
163
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-skill-search",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "On-demand skill search extension for Pi — replaces inject-all with search tool + category summary",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "index.ts",
|
|
7
|
+
"main": "index.ts",
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"@earendil-works/pi-coding-agent": ">=0.74.1"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@earendil-works/pi-coding-agent": ">=0.74.1",
|
|
13
|
+
"typescript": "^5.7.0",
|
|
14
|
+
"vitest": "^3.1.0",
|
|
15
|
+
"tsx": "^4.19.0",
|
|
16
|
+
"@biomejs/biome": "^1.9.0",
|
|
17
|
+
"tinybench": "^4.0.0",
|
|
18
|
+
"tiktoken": "^1.0.0",
|
|
19
|
+
"@types/node": "^22.0.0",
|
|
20
|
+
"js-yaml": "^4.1.0",
|
|
21
|
+
"@types/js-yaml": "^4.0.0"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"check": "biome check . && tsc --noEmit",
|
|
25
|
+
"test": "tsx node_modules/vitest/dist/cli.js --run",
|
|
26
|
+
"test:watch": "tsx node_modules/vitest/dist/cli.js",
|
|
27
|
+
"bench:index": "tsx bench/buildIndex.bench.ts",
|
|
28
|
+
"bench:search": "tsx bench/search.bench.ts",
|
|
29
|
+
"bench": "npm run bench:index && npm run bench:search",
|
|
30
|
+
"format": "biome format --write ."
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"index.ts",
|
|
34
|
+
"src/**/*.ts",
|
|
35
|
+
"skills/",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"CHANGELOG.md"
|
|
39
|
+
],
|
|
40
|
+
"keywords": [
|
|
41
|
+
"pi",
|
|
42
|
+
"extension",
|
|
43
|
+
"skill-search",
|
|
44
|
+
"skills",
|
|
45
|
+
"agent"
|
|
46
|
+
],
|
|
47
|
+
"license": "MIT"
|
|
48
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adaptyv
|
|
3
|
+
description: "How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Adaptyv Bio Foundry API
|
|
7
|
+
|
|
8
|
+
Adaptyv Bio is a cloud lab that turns protein sequences into experimental data. Users submit amino acid sequences via API or UI; Adaptyv's automated lab runs assays (binding, thermostability, expression, fluorescence) and delivers results in ~21 days.
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
**Base URL:** `https://foundry-api-public.adaptyvbio.com/api/v1`
|
|
13
|
+
|
|
14
|
+
**Authentication:** Bearer token in the `Authorization` header. Tokens are obtained from [foundry.adaptyvbio.com](https://foundry.adaptyvbio.com/) sidebar.
|
|
15
|
+
|
|
16
|
+
When writing code, always read the API key from the environment variable `ADAPTYV_API_KEY` or from a `.env` file — never hardcode tokens. Check for a `.env` file in the project root first; if one exists, use a library like `python-dotenv` to load it.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
export FOUNDRY_API_TOKEN="abs0_..."
|
|
20
|
+
curl https://foundry-api-public.adaptyvbio.com/api/v1/targets?limit=3 \
|
|
21
|
+
-H "Authorization: Bearer $FOUNDRY_API_TOKEN"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Every request except `GET /openapi.json` requires authentication. Store tokens in environment variables or `.env` files — never commit them to source control.
|
|
25
|
+
|
|
26
|
+
## Python SDK
|
|
27
|
+
|
|
28
|
+
Install: `uv add adaptyv-sdk` (falls back to `uv pip install adaptyv-sdk` if no `pyproject.toml` exists)
|
|
29
|
+
|
|
30
|
+
**Environment variables** (set in shell or `.env` file):
|
|
31
|
+
```bash
|
|
32
|
+
ADAPTYV_API_KEY=your_api_key
|
|
33
|
+
ADAPTYV_API_URL=https://foundry-api-public.adaptyvbio.com/api/v1
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Decorator Pattern
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from adaptyv import lab
|
|
40
|
+
|
|
41
|
+
@lab.experiment(target="PD-L1", experiment_type="screening", method="bli")
|
|
42
|
+
def design_binders():
|
|
43
|
+
return {"design_a": "MVKVGVNG...", "design_b": "MKVLVAG..."}
|
|
44
|
+
|
|
45
|
+
result = design_binders()
|
|
46
|
+
print(f"Experiment: {result.experiment_url}")
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Client Pattern
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from adaptyv import FoundryClient
|
|
53
|
+
|
|
54
|
+
client = FoundryClient(api_key="...", base_url="https://foundry-api-public.adaptyvbio.com/api/v1")
|
|
55
|
+
|
|
56
|
+
# Browse targets
|
|
57
|
+
targets = client.targets.list(search="EGFR", selfservice_only=True)
|
|
58
|
+
|
|
59
|
+
# Estimate cost
|
|
60
|
+
estimate = client.experiments.cost_estimate({
|
|
61
|
+
"experiment_spec": {
|
|
62
|
+
"experiment_type": "screening",
|
|
63
|
+
"method": "bli",
|
|
64
|
+
"target_id": "target-uuid",
|
|
65
|
+
"sequences": {"seq1": "EVQLVESGGGLVQ..."},
|
|
66
|
+
"n_replicates": 3
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
# Create and submit
|
|
71
|
+
exp = client.experiments.create({...})
|
|
72
|
+
client.experiments.submit(exp.experiment_id)
|
|
73
|
+
|
|
74
|
+
# Later: retrieve results
|
|
75
|
+
results = client.experiments.get_results(exp.experiment_id)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Experiment Types
|
|
79
|
+
|
|
80
|
+
| Type | Method | Measures | Requires Target |
|
|
81
|
+
|---|---|---|---|
|
|
82
|
+
| `affinity` | `bli` or `spr` | KD, kon, koff kinetics | Yes |
|
|
83
|
+
| `screening` | `bli` or `spr` | Yes/no binding | Yes |
|
|
84
|
+
| `thermostability` | — | Melting temperature (Tm) | No |
|
|
85
|
+
| `expression` | — | Expression yield | No |
|
|
86
|
+
| `fluorescence` | — | Fluorescence intensity | No |
|
|
87
|
+
|
|
88
|
+
## Experiment Lifecycle
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Draft → WaitingForConfirmation → QuoteSent → WaitingForMaterials → InQueue → InProduction → DataAnalysis → InReview → Done
|
|
92
|
+
```
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: add-community-extension
|
|
3
|
+
description: 'Add a community extension to the Spec Kit catalog from a GitHub issue submission. USE FOR: processing extension submission issues, validating catalog entries, updating catalog.community.json and docs/community/extensions.md, creating PRs. DO NOT USE FOR: creating new extensions from scratch, or first-party extension work.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Add Community Extension
|
|
7
|
+
|
|
8
|
+
Process an extension submission issue and add or update it in the community catalog.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- A new `[Extension]` submission issue is filed
|
|
13
|
+
- An existing extension submits an update issue (new version, changed metadata)
|
|
14
|
+
- You need to add or update a community extension in `extensions/catalog.community.json` and `docs/community/extensions.md`
|
|
15
|
+
|
|
16
|
+
## Procedure
|
|
17
|
+
|
|
18
|
+
### 1. Fetch the submission issue
|
|
19
|
+
|
|
20
|
+
Read the GitHub issue to extract all metadata:
|
|
21
|
+
- Extension ID, name, version, description, author
|
|
22
|
+
- Repository URL, download URL, homepage, documentation, changelog
|
|
23
|
+
- License, required spec-kit version, optional tool dependencies
|
|
24
|
+
- Number of commands and hooks
|
|
25
|
+
- Tags
|
|
26
|
+
|
|
27
|
+
### 2. Validate against publishing rules
|
|
28
|
+
|
|
29
|
+
Check **all** of the following (per `extensions/EXTENSION-PUBLISHING-GUIDE.md`):
|
|
30
|
+
|
|
31
|
+
| Check | How |
|
|
32
|
+
|-------|-----|
|
|
33
|
+
| Repository exists and is public | Fetch the repository URL |
|
|
34
|
+
| `extension.yml` manifest present | Confirm in repo file listing |
|
|
35
|
+
| README.md present | Confirm in repo file listing |
|
|
36
|
+
| LICENSE file present | Confirm in repo file listing |
|
|
37
|
+
| GitHub release exists matching version | Check releases on the repo page |
|
|
38
|
+
| Download URL is accessible | Verify it follows `archive/refs/tags/vX.Y.Z.zip` pattern and release exists |
|
|
39
|
+
| Extension ID is lowercase-with-hyphens only | Regex: `^[a-z][a-z0-9-]*$` |
|
|
40
|
+
| Version follows semver | Format: `X.Y.Z` |
|
|
41
|
+
| Submission checklists are all checked | Confirm in issue body |
|
|
42
|
+
|
|
43
|
+
### 3. Determine if this is an add or update
|
|
44
|
+
|
|
45
|
+
Search `extensions/catalog.community.json` for the extension ID.
|
|
46
|
+
|
|
47
|
+
- **Not found** → this is a **new addition**. Proceed to step 4.
|
|
48
|
+
- **Found** → this is an **update**. Proceed to step 4 but replace the existing entry in-place instead of inserting.
|
|
49
|
+
|
|
50
|
+
### 4. Add or update `extensions/catalog.community.json`
|
|
51
|
+
|
|
52
|
+
**New extension:** Insert the entry in **alphabetical order** by extension ID.
|
|
53
|
+
|
|
54
|
+
**Update:** Replace the existing entry in-place. Update only the fields that changed (typically `version`, `download_url`, `description`, `provides`, `requires`, `tags`, `updated_at`). Preserve `created_at` and `downloads`/`stars` from the existing entry.
|
|
55
|
+
|
|
56
|
+
Use the existing entries as the format template. Required fields:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"<id>": {
|
|
61
|
+
"name": "",
|
|
62
|
+
"id": "<id>",
|
|
63
|
+
"description": "<description>",
|
|
64
|
+
"author": "<author>",
|
|
65
|
+
"version": "<version>",
|
|
66
|
+
"download_url": "<download_url>",
|
|
67
|
+
"repository": "<repository>",
|
|
68
|
+
"homepage": "<homepage>",
|
|
69
|
+
"documentation": "<documentation>",
|
|
70
|
+
"changelog": "<changelog>",
|
|
71
|
+
"license": "<license>",
|
|
72
|
+
"requires": {
|
|
73
|
+
"speckit_version": "<speckit_version>"
|
|
74
|
+
},
|
|
75
|
+
"provides": {
|
|
76
|
+
"commands": <N>,
|
|
77
|
+
"hooks": <N>
|
|
78
|
+
},
|
|
79
|
+
"tags": ["<tag1>", "<tag2>"],
|
|
80
|
+
"verified": false,
|
|
81
|
+
"downloads": 0,
|
|
82
|
+
"stars": 0,
|
|
83
|
+
"created_at": "<today>T00:00:00Z",
|
|
84
|
+
"updated_at": "<today>T00:00:00Z"
|
|
85
|
+
```
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aeon
|
|
3
|
+
description: This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Aeon Time Series Machine Learning
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Aeon is a scikit-learn compatible Python toolkit for time series machine learning. It provides state-of-the-art algorithms for classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search.
|
|
11
|
+
|
|
12
|
+
## When to Use This Skill
|
|
13
|
+
|
|
14
|
+
Apply this skill when:
|
|
15
|
+
- Classifying or predicting from time series data
|
|
16
|
+
- Detecting anomalies or change points in temporal sequences
|
|
17
|
+
- Clustering similar time series patterns
|
|
18
|
+
- Forecasting future values
|
|
19
|
+
- Finding repeated patterns (motifs) or unusual subsequences (discords)
|
|
20
|
+
- Comparing time series with specialized distance metrics
|
|
21
|
+
- Extracting features from temporal data
|
|
22
|
+
|
|
23
|
+
## Core Capabilities
|
|
24
|
+
|
|
25
|
+
### 1. Time Series Classification
|
|
26
|
+
|
|
27
|
+
Categorize time series into predefined classes. See `(see docs)` for complete algorithm catalog.
|
|
28
|
+
|
|
29
|
+
**Quick Start:**
|
|
30
|
+
```python
|
|
31
|
+
from aeon.classification.convolution_based import RocketClassifier
|
|
32
|
+
from aeon.datasets import load_classification
|
|
33
|
+
|
|
34
|
+
# Load data
|
|
35
|
+
X_train, y_train = load_classification("GunPoint", split="train")
|
|
36
|
+
X_test, y_test = load_classification("GunPoint", split="test")
|
|
37
|
+
|
|
38
|
+
# Train classifier
|
|
39
|
+
clf = RocketClassifier(n_kernels=10000)
|
|
40
|
+
clf.fit(X_train, y_train)
|
|
41
|
+
accuracy = clf.score(X_test, y_test)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Algorithm Selection:**
|
|
45
|
+
- **Speed + Performance**: `MiniRocketClassifier`, `Arsenal`
|
|
46
|
+
- **Maximum Accuracy**: `HIVECOTEV2`, `InceptionTimeClassifier`
|
|
47
|
+
- **Interpretability**: `ShapeletTransformClassifier`, `Catch22Classifier`
|
|
48
|
+
- **Small Datasets**: `KNeighborsTimeSeriesClassifier` with DTW distance
|
|
49
|
+
|
|
50
|
+
### 2. Time Series Regression
|
|
51
|
+
|
|
52
|
+
Predict continuous values from time series. See `(see docs)` for algorithms.
|
|
53
|
+
|
|
54
|
+
**Quick Start:**
|
|
55
|
+
```python
|
|
56
|
+
from aeon.regression.convolution_based import RocketRegressor
|
|
57
|
+
from aeon.datasets import load_regression
|
|
58
|
+
|
|
59
|
+
X_train, y_train = load_regression("Covid3Month", split="train")
|
|
60
|
+
X_test, y_test = load_regression("Covid3Month", split="test")
|
|
61
|
+
|
|
62
|
+
reg = RocketRegressor()
|
|
63
|
+
reg.fit(X_train, y_train)
|
|
64
|
+
predictions = reg.predict(X_test)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 3. Time Series Clustering
|
|
68
|
+
|
|
69
|
+
Group similar time series without labels. See `(see docs)` for methods.
|
|
70
|
+
|
|
71
|
+
**Quick Start:**
|
|
72
|
+
```python
|
|
73
|
+
from aeon.clustering import TimeSeriesKMeans
|
|
74
|
+
|
|
75
|
+
clusterer = TimeSeriesKMeans(
|
|
76
|
+
n_clusters=3,
|
|
77
|
+
distance="dtw",
|
|
78
|
+
averaging_method="ba"
|
|
79
|
+
)
|
|
80
|
+
labels = clusterer.fit_predict(X_train)
|
|
81
|
+
centers = clusterer.cluster_centers_
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 4. Forecasting
|
|
85
|
+
|
|
86
|
+
Predict future time series values. See `(see docs)` for forecasters.
|
|
87
|
+
|
|
88
|
+
**Quick Start:**
|
|
89
|
+
```python
|
|
90
|
+
from aeon.forecasting.arima import ARIMA
|
|
91
|
+
|
|
92
|
+
forecaster = ARIMA(order=(1, 1, 1))
|
|
93
|
+
forecaster.fit(y_train)
|
|
94
|
+
y_pred = forecaster.predict(fh=[1, 2, 3, 4, 5])
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 5. Anomaly Detection
|
|
98
|
+
|
|
99
|
+
Identify unusual patterns or outliers. See `(see docs)` for detectors.
|
|
100
|
+
|
|
101
|
+
**Quick Start:**
|
|
102
|
+
```python
|
|
103
|
+
from aeon.anomaly_detection import STOMP
|
|
104
|
+
|
|
105
|
+
detector = STOMP(window_size=50)
|
|
106
|
+
anomaly_scores = detector.fit_predict(y)
|
|
107
|
+
|
|
108
|
+
# Higher scores indicate anomalies
|
|
109
|
+
threshold = np.percentile(anomaly_scores, 95)
|
|
110
|
+
anomalies = anomaly_scores > threshold
|
|
111
|
+
```
|