@ia-ccun/code-agent-cli 0.0.59-beta.5 → 0.0.59-beta.6
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/config/agent/extensions/aicode-provider-scope.ts +388 -0
- package/config/agent/skills/agent-browser/LICENSE +201 -0
- package/config/agent/skills/agent-browser/SKILL.md +55 -0
- package/config/agent/skills/codebase-design/DEEPENING.md +37 -0
- package/config/agent/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/config/agent/skills/{chroma → codebase-design}/LICENSE +1 -1
- package/config/agent/skills/codebase-design/SKILL.md +118 -0
- package/config/agent/skills/codebase-design/agents/openai.yaml +3 -0
- package/config/agent/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/config/agent/skills/domain-modeling/GLOSSARY-FORMAT.md +61 -0
- package/config/agent/skills/{fireworks-tech-graph → domain-modeling}/LICENSE +1 -1
- package/config/agent/skills/domain-modeling/SKILL.md +78 -0
- package/config/agent/skills/domain-modeling/agents/openai.yaml +3 -0
- package/config/agent/skills/frontend-design/SKILL.md +55 -26
- package/config/agent/skills/grill-with-docs/LICENSE +21 -0
- package/config/agent/skills/grill-with-docs/SKILL.md +21 -0
- package/config/agent/skills/grill-with-docs/agents/openai.yaml +5 -0
- package/config/agent/skills/grilling/LICENSE +21 -0
- package/config/agent/skills/grilling/SKILL.md +34 -0
- package/config/agent/skills/grilling/agents/openai.yaml +3 -0
- package/config/agent/skills/tdd/LICENSE +21 -0
- package/config/agent/skills/tdd/SKILL.md +42 -0
- package/config/agent/skills/tdd/agents/openai.yaml +3 -0
- package/config/agent/skills/tdd/mocking.md +59 -0
- package/config/agent/skills/tdd/tests.md +77 -0
- package/config/agent/skills/ui-taste/CHECKSUMS.sha256 +25 -0
- package/config/agent/skills/{milvus-skill → ui-taste}/LICENSE +12 -23
- package/config/agent/skills/ui-taste/MANIFEST.json +256 -0
- package/config/agent/skills/ui-taste/MODIFICATIONS.md +23 -0
- package/config/agent/skills/ui-taste/NOTICE +74 -0
- package/config/agent/skills/ui-taste/SKILL.md +90 -0
- package/config/agent/skills/ui-taste/agents/openai.yaml +4 -0
- package/config/agent/skills/ui-taste/reference/anti-slop-craft.md +138 -0
- package/config/agent/skills/ui-taste/reference/audit.md +71 -0
- package/config/agent/skills/ui-taste/reference/audit.native.md +78 -0
- package/config/agent/skills/ui-taste/reference/craft.md +48 -0
- package/config/agent/skills/ui-taste/reference/distill.md +20 -0
- package/config/agent/skills/ui-taste/reference/image-assets.md +31 -0
- package/config/agent/skills/ui-taste/reference/ios.md +35 -0
- package/config/agent/skills/ui-taste/reference/mobile-controls.md +37 -0
- package/config/agent/skills/ui-taste/reference/mobile-state-performance.md +34 -0
- package/config/agent/skills/ui-taste/reference/native-verification.md +33 -0
- package/config/agent/skills/ui-taste/reference/new-work.md +87 -0
- package/config/agent/skills/ui-taste/reference/operate.md +37 -0
- package/config/agent/skills/ui-taste/reference/overdrive.md +65 -0
- package/config/agent/skills/ui-taste/reference/polish.md +63 -0
- package/config/agent/skills/ui-taste/reference/research.md +45 -0
- package/config/agent/skills/ui-taste/references/uizze-image-to-ui.md +77 -0
- package/config/agent/skills/ui-taste/references/uizze-reference-policy.md +27 -0
- package/config/agent/skills/ui-taste/references/uizze-visual-verification.md +62 -0
- package/config/agent/skills/ui-taste/scripts/verify-visual-evidence.mjs +108 -0
- package/package.json +5 -5
- package/config/agent/skills/chroma/chroma-local/SKILL.md +0 -165
- package/config/agent/skills/chroma/chroma-local/cli.md +0 -48
- package/config/agent/skills/chroma/chroma-local/data-model.md +0 -103
- package/config/agent/skills/chroma/chroma-local/error-handling/python.md +0 -166
- package/config/agent/skills/chroma/chroma-local/error-handling/typescript.md +0 -231
- package/config/agent/skills/chroma/chroma-local/local-chroma/python.md +0 -95
- package/config/agent/skills/chroma/chroma-local/local-chroma/typescript.md +0 -101
- package/config/agent/skills/chroma/chroma-local/metadata/python.md +0 -154
- package/config/agent/skills/chroma/chroma-local/metadata/typescript.md +0 -153
- package/config/agent/skills/chroma/chroma-local/querying/python.md +0 -147
- package/config/agent/skills/chroma/chroma-local/querying/typescript.md +0 -157
- package/config/agent/skills/chroma/chroma-local/regex/python.md +0 -69
- package/config/agent/skills/chroma/chroma-local/regex/typescript.md +0 -71
- package/config/agent/skills/chroma/chroma-local/understanding-a-codebase.md +0 -80
- package/config/agent/skills/chroma/chroma-local/updating-deleting/python.md +0 -159
- package/config/agent/skills/chroma/chroma-local/updating-deleting/typescript.md +0 -228
- package/config/agent/skills/find-skills/SKILL.md +0 -137
- package/config/agent/skills/fireworks-tech-graph/README.md +0 -528
- package/config/agent/skills/fireworks-tech-graph/README.zh.md +0 -499
- package/config/agent/skills/fireworks-tech-graph/SKILL.md +0 -538
- package/config/agent/skills/fireworks-tech-graph/agentloop-core.svg +0 -101
- package/config/agent/skills/fireworks-tech-graph/agents/openai.yaml +0 -4
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style1-flat.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style2-dark.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style3-blueprint.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style4-notion.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style5-glass.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style6-claude.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style7-openai.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/fixtures/agent-memory-types-style4.json +0 -181
- package/config/agent/skills/fireworks-tech-graph/fixtures/api-flow-style7.json +0 -40
- package/config/agent/skills/fireworks-tech-graph/fixtures/mem0-style1.json +0 -297
- package/config/agent/skills/fireworks-tech-graph/fixtures/microservices-style3.json +0 -64
- package/config/agent/skills/fireworks-tech-graph/fixtures/multi-agent-style5.json +0 -45
- package/config/agent/skills/fireworks-tech-graph/fixtures/system-architecture-style6.json +0 -48
- package/config/agent/skills/fireworks-tech-graph/fixtures/tool-call-style2.json +0 -182
- package/config/agent/skills/fireworks-tech-graph/package.json +0 -42
- package/config/agent/skills/fireworks-tech-graph/references/icons.md +0 -406
- package/config/agent/skills/fireworks-tech-graph/references/style-1-flat-icon.md +0 -108
- package/config/agent/skills/fireworks-tech-graph/references/style-2-dark-terminal.md +0 -107
- package/config/agent/skills/fireworks-tech-graph/references/style-3-blueprint.md +0 -113
- package/config/agent/skills/fireworks-tech-graph/references/style-4-notion-clean.md +0 -94
- package/config/agent/skills/fireworks-tech-graph/references/style-5-glassmorphism.md +0 -125
- package/config/agent/skills/fireworks-tech-graph/references/style-6-claude-official.md +0 -209
- package/config/agent/skills/fireworks-tech-graph/references/style-7-openai.md +0 -215
- package/config/agent/skills/fireworks-tech-graph/references/style-diagram-matrix.md +0 -135
- package/config/agent/skills/fireworks-tech-graph/references/svg-layout-best-practices.md +0 -100
- package/config/agent/skills/fireworks-tech-graph/scripts/README.md +0 -244
- package/config/agent/skills/fireworks-tech-graph/scripts/generate-diagram.sh +0 -157
- package/config/agent/skills/fireworks-tech-graph/scripts/generate-from-template.py +0 -1556
- package/config/agent/skills/fireworks-tech-graph/scripts/test-all-styles.sh +0 -135
- package/config/agent/skills/fireworks-tech-graph/scripts/validate-svg.sh +0 -292
- package/config/agent/skills/fireworks-tech-graph/templates/agent-architecture.svg +0 -28
- package/config/agent/skills/fireworks-tech-graph/templates/architecture.svg +0 -23
- package/config/agent/skills/fireworks-tech-graph/templates/comparison-matrix.svg +0 -14
- package/config/agent/skills/fireworks-tech-graph/templates/data-flow.svg +0 -28
- package/config/agent/skills/fireworks-tech-graph/templates/er-diagram.svg +0 -21
- package/config/agent/skills/fireworks-tech-graph/templates/flowchart.svg +0 -21
- package/config/agent/skills/fireworks-tech-graph/templates/sequence.svg +0 -20
- package/config/agent/skills/fireworks-tech-graph/templates/state-machine.svg +0 -20
- package/config/agent/skills/fireworks-tech-graph/templates/timeline.svg +0 -19
- package/config/agent/skills/fireworks-tech-graph/templates/use-case.svg +0 -21
- package/config/agent/skills/hello/SKILL.md +0 -26
- package/config/agent/skills/librarian/SKILL.md +0 -199
- package/config/agent/skills/milvus-skill/README.md +0 -37
- package/config/agent/skills/milvus-skill/SKILL.md +0 -259
- package/config/agent/skills/milvus-skill/references/collection.md +0 -86
- package/config/agent/skills/milvus-skill/references/database.md +0 -24
- package/config/agent/skills/milvus-skill/references/index.md +0 -69
- package/config/agent/skills/milvus-skill/references/partition.md +0 -29
- package/config/agent/skills/milvus-skill/references/patterns.md +0 -150
- package/config/agent/skills/milvus-skill/references/user-role.md +0 -90
- package/config/agent/skills/milvus-skill/references/vector.md +0 -247
- package/config/agent/skills/pr/SKILL.md +0 -59
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hello
|
|
3
|
-
description: "Custom skill example. Use when testing skill functionality or as a template for creating new skills."
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
metadata:
|
|
6
|
-
version: "1.0.0"
|
|
7
|
-
author: "xujianjiang"
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# My Custom Skill
|
|
11
|
-
|
|
12
|
-
## 描述
|
|
13
|
-
这是一个自定义 Skill 示例
|
|
14
|
-
|
|
15
|
-
## 触发方式
|
|
16
|
-
`/skill:hello`
|
|
17
|
-
|
|
18
|
-
## 执行步骤
|
|
19
|
-
1. 问候用户
|
|
20
|
-
2. 询问需要什么帮助
|
|
21
|
-
|
|
22
|
-
## 输出
|
|
23
|
-
```
|
|
24
|
-
Hello! 我是你的自定义助手。
|
|
25
|
-
请问需要我帮你做什么?
|
|
26
|
-
```
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: librarian
|
|
3
|
-
description: "Research open-source libraries with evidence-backed answers and GitHub permalinks. Use when asking about library internals, implementation details, source code references, or why something was changed."
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
metadata:
|
|
6
|
-
version: "1.0.0"
|
|
7
|
-
author: "xujianjiang"
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Librarian
|
|
11
|
-
|
|
12
|
-
Answer questions about open-source libraries by finding evidence with GitHub permalinks. Every claim backed by actual code.
|
|
13
|
-
|
|
14
|
-
## Execution Model
|
|
15
|
-
|
|
16
|
-
Pi executes tool calls sequentially, even when you emit multiple calls in one turn. But batching independent calls in a single turn still saves LLM round-trips (~5-10s each). Use these patterns:
|
|
17
|
-
|
|
18
|
-
| Pattern | When | Actually parallel? |
|
|
19
|
-
|---------|------|-------------------|
|
|
20
|
-
| Batch tool calls in one turn | Independent ops (web_search + fetch_content + read) | No, but saves round-trips |
|
|
21
|
-
| `fetch_content({ urls: [...] })` | Multiple URLs to fetch | Yes (3 concurrent) |
|
|
22
|
-
| Bash with `&` + `wait` | Multiple git/gh commands | Yes (OS-level) |
|
|
23
|
-
|
|
24
|
-
## Step 1: Classify the Request
|
|
25
|
-
|
|
26
|
-
Before doing anything, classify the request to pick the right research strategy.
|
|
27
|
-
|
|
28
|
-
| Type | Trigger | Primary Approach |
|
|
29
|
-
|------|---------|-----------------|
|
|
30
|
-
| **Conceptual** | "How do I use X?", "Best practice for Y?" | web_search + fetch_content (README/docs) |
|
|
31
|
-
| **Implementation** | "How does X implement Y?", "Show me the source" | fetch_content (clone) + code search |
|
|
32
|
-
| **Context/History** | "Why was this changed?", "History of X?" | git log + git blame + issue/PR search |
|
|
33
|
-
| **Comprehensive** | Complex or ambiguous requests, "deep dive" | All of the above |
|
|
34
|
-
|
|
35
|
-
## Step 2: Research by Type
|
|
36
|
-
|
|
37
|
-
### Conceptual Questions
|
|
38
|
-
|
|
39
|
-
Batch these in one turn:
|
|
40
|
-
|
|
41
|
-
1. **web_search**: `"library-name topic"` via Perplexity for recent articles and discussions
|
|
42
|
-
2. **fetch_content**: the library's GitHub repo URL to clone and check README, docs, or examples
|
|
43
|
-
|
|
44
|
-
Synthesize web results + repo docs. Cite official documentation and link to relevant source files.
|
|
45
|
-
|
|
46
|
-
### Implementation Questions
|
|
47
|
-
|
|
48
|
-
The core workflow -- clone, find, permalink:
|
|
49
|
-
|
|
50
|
-
1. **fetch_content** the GitHub repo URL -- this clones it locally and returns the file tree
|
|
51
|
-
2. Use **bash** to search the cloned repo: `grep -rn "function_name"`, `find . -name "*.ts"`
|
|
52
|
-
3. Use **read** to examine specific files once you've located them
|
|
53
|
-
4. Get the commit SHA: `cd /tmp/pi-github-repos/owner/repo && git rev-parse HEAD`
|
|
54
|
-
5. Construct permalink: `https://github.com/owner/repo/blob/<sha>/path/to/file#L10-L20`
|
|
55
|
-
|
|
56
|
-
Batch the initial calls: fetch_content (clone) + web_search (recent discussions) in one turn. Then dig into the clone with grep/read once it's available.
|
|
57
|
-
|
|
58
|
-
### Context/History Questions
|
|
59
|
-
|
|
60
|
-
Use git operations on the cloned repo:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
cd /tmp/pi-github-repos/owner/repo
|
|
64
|
-
|
|
65
|
-
# Recent changes to a specific file
|
|
66
|
-
git log --oneline -n 20 -- path/to/file.ts
|
|
67
|
-
|
|
68
|
-
# Who changed what and when
|
|
69
|
-
git blame -L 10,30 path/to/file.ts
|
|
70
|
-
|
|
71
|
-
# Full diff for a specific commit
|
|
72
|
-
git show <sha> -- path/to/file.ts
|
|
73
|
-
|
|
74
|
-
# Search commit messages
|
|
75
|
-
git log --oneline --grep="keyword" -n 10
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
For issues and PRs, use bash:
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
# Search issues
|
|
82
|
-
gh search issues "keyword" --repo owner/repo --state all --limit 10
|
|
83
|
-
|
|
84
|
-
# Search merged PRs
|
|
85
|
-
gh search prs "keyword" --repo owner/repo --state merged --limit 10
|
|
86
|
-
|
|
87
|
-
# View specific issue/PR with comments
|
|
88
|
-
gh issue view <number> --repo owner/repo --comments
|
|
89
|
-
gh pr view <number> --repo owner/repo --comments
|
|
90
|
-
|
|
91
|
-
# Release notes
|
|
92
|
-
gh api repos/owner/repo/releases --jq '.[0:5] | .[].tag_name'
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Comprehensive Research
|
|
96
|
-
|
|
97
|
-
Combine everything. Batch these in one turn:
|
|
98
|
-
|
|
99
|
-
1. **web_search**: recent articles and discussions
|
|
100
|
-
2. **fetch_content**: clone the repo (or multiple repos if comparing)
|
|
101
|
-
3. **bash**: `gh search issues "keyword" --repo owner/repo --limit 10 & gh search prs "keyword" --repo owner/repo --state merged --limit 10 & wait`
|
|
102
|
-
|
|
103
|
-
Then dig into the clone with grep, read, git blame, git log as needed.
|
|
104
|
-
|
|
105
|
-
## Step 3: Construct Permalinks
|
|
106
|
-
|
|
107
|
-
Permalinks are the whole point. They make your answers citable and verifiable.
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
https://github.com/<owner>/<repo>/blob/<commit-sha>/<filepath>#L<start>-L<end>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Getting the SHA from a cloned repo:
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
cd /tmp/pi-github-repos/owner/repo && git rev-parse HEAD
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Getting the SHA from a tag:
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
gh api repos/owner/repo/git/refs/tags/v1.0.0 --jq '.object.sha'
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Always use full commit SHAs, not branch names. Branch links break when code changes. Permalinks don't.
|
|
126
|
-
|
|
127
|
-
## Step 4: Cite Everything
|
|
128
|
-
|
|
129
|
-
Every code-related claim needs a permalink. Format:
|
|
130
|
-
|
|
131
|
-
```markdown
|
|
132
|
-
The stale time check happens in [`notifyManager.ts`](https://github.com/TanStack/query/blob/abc123/packages/query-core/src/notifyManager.ts#L42-L50):
|
|
133
|
-
|
|
134
|
-
\`\`\`typescript
|
|
135
|
-
function isStale(query: Query, staleTime: number): boolean {
|
|
136
|
-
return query.state.dataUpdatedAt + staleTime < Date.now()
|
|
137
|
-
}
|
|
138
|
-
\`\`\`
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
For conceptual answers, link to official docs and relevant source files. For implementation answers, every function/class reference should have a permalink.
|
|
142
|
-
|
|
143
|
-
## Video Analysis
|
|
144
|
-
|
|
145
|
-
For questions about video tutorials, conference talks, or screen recordings:
|
|
146
|
-
|
|
147
|
-
```typescript
|
|
148
|
-
// Full extraction (transcript + visual descriptions)
|
|
149
|
-
fetch_content({ url: "https://youtube.com/watch?v=abc" })
|
|
150
|
-
|
|
151
|
-
// Ask a specific question about a video
|
|
152
|
-
fetch_content({ url: "https://youtube.com/watch?v=abc", prompt: "What libraries are imported in this tutorial?" })
|
|
153
|
-
|
|
154
|
-
// Single frame at a known moment
|
|
155
|
-
fetch_content({ url: "https://youtube.com/watch?v=abc", timestamp: "23:41" })
|
|
156
|
-
|
|
157
|
-
// Range scan for visual discovery
|
|
158
|
-
fetch_content({ url: "https://youtube.com/watch?v=abc", timestamp: "23:41-25:00" })
|
|
159
|
-
|
|
160
|
-
// Custom density across a range
|
|
161
|
-
fetch_content({ url: "https://youtube.com/watch?v=abc", timestamp: "23:41-25:00", frames: 3 })
|
|
162
|
-
|
|
163
|
-
// Whole-video sampling
|
|
164
|
-
fetch_content({ url: "https://youtube.com/watch?v=abc", frames: 6 })
|
|
165
|
-
|
|
166
|
-
// Analyze a local recording
|
|
167
|
-
fetch_content({ url: "/path/to/demo.mp4", prompt: "What error message appears on screen?" })
|
|
168
|
-
|
|
169
|
-
// Batch multiple videos with the same question
|
|
170
|
-
fetch_content({
|
|
171
|
-
urls: ["https://youtube.com/watch?v=abc", "https://youtube.com/watch?v=def"],
|
|
172
|
-
prompt: "What packages are installed?"
|
|
173
|
-
})
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Use single timestamps for known moments, ranges for visual scanning, and frames-alone for a quick overview of the whole video.
|
|
177
|
-
|
|
178
|
-
The `prompt` parameter only applies to video content (YouTube URLs and local video files). For non-video URLs, it's ignored.
|
|
179
|
-
|
|
180
|
-
## Failure Recovery
|
|
181
|
-
|
|
182
|
-
| Failure | Recovery |
|
|
183
|
-
|---------|----------|
|
|
184
|
-
| grep finds nothing | Broaden the query, try concept names instead of exact function names |
|
|
185
|
-
| gh CLI rate limited | Use the already-cloned repo in /tmp/pi-github-repos/ for git operations |
|
|
186
|
-
| Repo too large to clone | fetch_content returns an API-only view automatically; use that or add `forceClone: true` |
|
|
187
|
-
| File not found in clone | Branch name with slashes may have misresolved; list the repo tree and navigate manually |
|
|
188
|
-
| Uncertain about implementation | State your uncertainty explicitly, propose a hypothesis, show what evidence you did find |
|
|
189
|
-
| Video extraction fails | Ensure Chrome is signed into gemini.google.com (free) or set GEMINI_API_KEY |
|
|
190
|
-
| Page returns 403/bot block | Gemini fallback triggers automatically; no action needed if Gemini is configured |
|
|
191
|
-
| web_search fails | Check provider config; try explicit `provider: "gemini"` if Perplexity key is missing |
|
|
192
|
-
|
|
193
|
-
## Guidelines
|
|
194
|
-
|
|
195
|
-
- Vary search queries when running multiple searches -- different angles, not the same pattern repeated
|
|
196
|
-
- Prefer recent sources; filter out outdated results when they conflict with newer information
|
|
197
|
-
- For version-specific questions, clone the tagged version: `fetch_content("https://github.com/owner/repo/tree/v1.0.0")`
|
|
198
|
-
- When the repo is already cloned from a previous fetch_content call, reuse it -- check the path before cloning again
|
|
199
|
-
- Answer directly. Skip preamble like "I'll help you with..." -- go straight to findings
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# milvus-skill
|
|
2
|
-
|
|
3
|
-
An agent skill that teaches LLMs how to use [pymilvus](https://github.com/milvus-io/pymilvus) to operate [Milvus](https://milvus.io/) vector database.
|
|
4
|
-
|
|
5
|
-
## What's Included
|
|
6
|
-
|
|
7
|
-
- **SKILL.md** — Main skill definition with connection, collection management, vector operations, and index management
|
|
8
|
-
- **references/** — Detailed reference docs for each feature area:
|
|
9
|
-
- `collection.md` — Data types, schema fields, collection operations
|
|
10
|
-
- `vector.md` — Insert, search, hybrid search, full-text search, iterators, filters
|
|
11
|
-
- `index.md` — Index types, metric types, create/manage indexes
|
|
12
|
-
- `partition.md` — Partition CRUD
|
|
13
|
-
- `database.md` — Database management
|
|
14
|
-
- `user-role.md` — RBAC: users, roles, privileges
|
|
15
|
-
- `patterns.md` — Common patterns (RAG, semantic search, hybrid search, full-text search)
|
|
16
|
-
|
|
17
|
-
## Install as Claude Code Skill
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
claude skill add --url https://github.com/zilliztech/milvus-skill
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Capabilities
|
|
24
|
-
|
|
25
|
-
- Connect to Milvus Lite, Standalone, Cluster, or Zilliz Cloud
|
|
26
|
-
- Create collections with quick or custom schemas
|
|
27
|
-
- Insert, upsert, search, query, get, delete vectors
|
|
28
|
-
- Hybrid search with RRF/Weighted reranking
|
|
29
|
-
- Full-text search with BM25
|
|
30
|
-
- Paginated iteration over large result sets
|
|
31
|
-
- Index management (AUTOINDEX, HNSW, IVF_FLAT, etc.)
|
|
32
|
-
- Partition, database, and RBAC management
|
|
33
|
-
|
|
34
|
-
## Requirements
|
|
35
|
-
|
|
36
|
-
- Python 3.8+
|
|
37
|
-
- `pymilvus` (`pip install pymilvus`)
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: milvus-skill
|
|
3
|
-
description: Operate Milvus vector database with pymilvus Python SDK. Use when the user wants to connect to Milvus, create collections, insert vectors, perform similarity search, hybrid search, full-text search, manage indexes, partitions, databases, or RBAC via Python code.
|
|
4
|
-
license: Apache-2.0
|
|
5
|
-
compatibility: Requires Python 3.8+ and pymilvus (pip install pymilvus). Runs on macOS and Linux.
|
|
6
|
-
metadata:
|
|
7
|
-
author: zilliztech
|
|
8
|
-
version: "1.0.0"
|
|
9
|
-
allowed-tools: Bash Read Write
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# Milvus Vector Database Skill
|
|
13
|
-
|
|
14
|
-
Operate [Milvus](https://milvus.io/) vector databases directly through Python code using the `pymilvus` SDK. Covers the full lifecycle — connecting, schema design, collection management, vector CRUD, search, hybrid search, full-text search, indexing, partitions, databases, and RBAC.
|
|
15
|
-
|
|
16
|
-
## When to Use
|
|
17
|
-
|
|
18
|
-
Use this skill when the user wants to:
|
|
19
|
-
- Connect to a Milvus instance (local, standalone, cluster, or Milvus Lite)
|
|
20
|
-
- Create collections with custom schemas
|
|
21
|
-
- Insert, upsert, search, query, get, or delete vectors
|
|
22
|
-
- Perform hybrid search with reranking
|
|
23
|
-
- Perform full-text search (BM25)
|
|
24
|
-
- Manage indexes, partitions, databases
|
|
25
|
-
- Set up users, roles, and access control (RBAC)
|
|
26
|
-
- Build RAG pipelines, semantic search, or recommendation systems with Milvus
|
|
27
|
-
- Iterate over large result sets with search/query iterators
|
|
28
|
-
|
|
29
|
-
## Requirements
|
|
30
|
-
|
|
31
|
-
- Python 3.8+
|
|
32
|
-
- `pymilvus` (`pip install pymilvus`)
|
|
33
|
-
- A running Milvus instance, or use Milvus Lite (embedded, file-based) for development
|
|
34
|
-
|
|
35
|
-
## Capabilities Overview
|
|
36
|
-
|
|
37
|
-
| Area | What You Can Do |
|
|
38
|
-
|------|----------------|
|
|
39
|
-
| **Connection** | Connect to Milvus Lite, Standalone, Cluster, or Zilliz Cloud |
|
|
40
|
-
| **Collections** | Create (quick or custom schema), list, describe, drop, rename, truncate, load, release |
|
|
41
|
-
| **Vectors** | Insert, upsert, search, hybrid search, query, get, delete |
|
|
42
|
-
| **Full-Text Search** | BM25-based keyword search with sparse vectors |
|
|
43
|
-
| **Iterators** | Paginated search and query over large datasets |
|
|
44
|
-
| **Indexes** | Create (AUTOINDEX, HNSW, IVF_FLAT, etc.), list, describe, drop |
|
|
45
|
-
| **Partitions** | Create, list, load, release, drop |
|
|
46
|
-
| **Databases** | Create, list, switch, drop |
|
|
47
|
-
| **RBAC** | Users, roles, privileges management |
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## Connection
|
|
52
|
-
|
|
53
|
-
> **IMPORTANT: Before writing any connection code, you MUST ask the user for their connection details.** Ask:
|
|
54
|
-
> 1. **Deployment type** — Milvus Lite (local file), Standalone/Cluster (self-hosted), or Zilliz Cloud (managed)?
|
|
55
|
-
> 2. **URI** — For self-hosted: host and port (e.g., `http://localhost:19530`). For Zilliz Cloud: the endpoint URL.
|
|
56
|
-
> 3. **Authentication** — Token, API key, or username/password if required.
|
|
57
|
-
> 4. **Database name** — If not using the default database.
|
|
58
|
-
>
|
|
59
|
-
> **Never assume or hardcode connection parameters.** Use Milvus Lite (`uri="./milvus.db"`) only if the user explicitly wants local/embedded mode for development.
|
|
60
|
-
|
|
61
|
-
```python
|
|
62
|
-
from pymilvus import MilvusClient
|
|
63
|
-
|
|
64
|
-
# Milvus Lite (embedded, file-based — great for dev/test)
|
|
65
|
-
client = MilvusClient(uri="./milvus.db")
|
|
66
|
-
|
|
67
|
-
# Standalone / Cluster Milvus (ask user for actual host:port and credentials)
|
|
68
|
-
client = MilvusClient(uri="<USER_URI>", token="<USER_TOKEN>")
|
|
69
|
-
|
|
70
|
-
# Zilliz Cloud (ask user for endpoint and API key)
|
|
71
|
-
client = MilvusClient(uri="<USER_ZILLIZ_ENDPOINT>", token="<USER_API_KEY>")
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
**Parameters:**
|
|
75
|
-
|
|
76
|
-
| Parameter | Type | Description |
|
|
77
|
-
|-----------|------|-------------|
|
|
78
|
-
| `uri` | str | `"./file.db"` for Milvus Lite, `"http://host:19530"` for server |
|
|
79
|
-
| `token` | str | API key or `"username:password"` |
|
|
80
|
-
| `user` | str | Username (alternative to token) |
|
|
81
|
-
| `password` | str | Password (alternative to token) |
|
|
82
|
-
| `db_name` | str | Target database (default: `"default"`) |
|
|
83
|
-
| `timeout` | float | Operation timeout in seconds |
|
|
84
|
-
|
|
85
|
-
### Async Client
|
|
86
|
-
|
|
87
|
-
```python
|
|
88
|
-
from pymilvus import AsyncMilvusClient
|
|
89
|
-
|
|
90
|
-
async with AsyncMilvusClient(uri="<USER_URI>") as client:
|
|
91
|
-
results = await client.search(collection_name="my_collection", data=[query_vector], limit=10)
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Collection Management
|
|
97
|
-
|
|
98
|
-
### Quick Create (auto schema + auto index + auto load)
|
|
99
|
-
|
|
100
|
-
```python
|
|
101
|
-
client.create_collection(
|
|
102
|
-
collection_name="my_collection",
|
|
103
|
-
dimension=768,
|
|
104
|
-
metric_type="COSINE" # Optional: "COSINE" (default), "L2", "IP"
|
|
105
|
-
)
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
This automatically creates an `id` field (INT64, primary key, auto_id), a `vector` field (FLOAT_VECTOR), AUTOINDEX, and auto-loads the collection.
|
|
109
|
-
|
|
110
|
-
### Custom Schema Create
|
|
111
|
-
|
|
112
|
-
```python
|
|
113
|
-
from pymilvus import DataType
|
|
114
|
-
|
|
115
|
-
schema = client.create_schema(auto_id=False, enable_dynamic_field=True)
|
|
116
|
-
schema.add_field("id", DataType.INT64, is_primary=True)
|
|
117
|
-
schema.add_field("text", DataType.VARCHAR, max_length=512)
|
|
118
|
-
schema.add_field("embedding", DataType.FLOAT_VECTOR, dim=768)
|
|
119
|
-
|
|
120
|
-
index_params = client.prepare_index_params()
|
|
121
|
-
index_params.add_index(field_name="embedding", index_type="AUTOINDEX", metric_type="COSINE")
|
|
122
|
-
|
|
123
|
-
client.create_collection(collection_name="my_collection", schema=schema, index_params=index_params)
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
**See [references/collection.md](references/collection.md) for data types, add_field parameters, and all collection operations.**
|
|
127
|
-
|
|
128
|
-
### Other Collection Operations
|
|
129
|
-
|
|
130
|
-
```python
|
|
131
|
-
client.list_collections()
|
|
132
|
-
client.describe_collection(collection_name="my_collection")
|
|
133
|
-
client.has_collection(collection_name="my_collection")
|
|
134
|
-
client.rename_collection(old_name="old", new_name="new")
|
|
135
|
-
client.drop_collection(collection_name="my_collection")
|
|
136
|
-
client.truncate_collection(collection_name="my_collection")
|
|
137
|
-
client.load_collection(collection_name="my_collection")
|
|
138
|
-
client.release_collection(collection_name="my_collection")
|
|
139
|
-
client.get_load_state(collection_name="my_collection")
|
|
140
|
-
client.get_collection_stats(collection_name="my_collection")
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
- Quick create is best for prototyping; use custom schema for production.
|
|
144
|
-
- A collection must be **loaded** before search or query.
|
|
145
|
-
- Use `enable_dynamic_field=True` to allow inserting fields not defined in the schema.
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Vector Operations
|
|
150
|
-
|
|
151
|
-
**See [references/vector.md](references/vector.md) for hybrid search, full-text search, iterators, filter syntax, and detailed examples.**
|
|
152
|
-
|
|
153
|
-
### Insert / Upsert
|
|
154
|
-
|
|
155
|
-
```python
|
|
156
|
-
# Vectors must come from an embedding model — never use fake/placeholder vectors
|
|
157
|
-
from pymilvus import model
|
|
158
|
-
|
|
159
|
-
embedding_fn = model.dense.SentenceTransformerEmbeddingFunction(model_name="all-MiniLM-L6-v2")
|
|
160
|
-
|
|
161
|
-
docs = ["AI advances in 2024", "ML basics for beginners"]
|
|
162
|
-
vectors = embedding_fn.encode_documents(docs)
|
|
163
|
-
|
|
164
|
-
data = [
|
|
165
|
-
{"id": 1, "text": docs[0], "embedding": vectors[0]},
|
|
166
|
-
{"id": 2, "text": docs[1], "embedding": vectors[1]},
|
|
167
|
-
]
|
|
168
|
-
client.insert(collection_name="my_collection", data=data)
|
|
169
|
-
client.upsert(collection_name="my_collection", data=data)
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### Search (vector similarity)
|
|
173
|
-
|
|
174
|
-
```python
|
|
175
|
-
# Use the same embedding model to encode the query
|
|
176
|
-
query_vectors = embedding_fn.encode_queries(["What is artificial intelligence?"])
|
|
177
|
-
|
|
178
|
-
results = client.search(
|
|
179
|
-
collection_name="my_collection",
|
|
180
|
-
data=query_vectors,
|
|
181
|
-
anns_field="embedding",
|
|
182
|
-
limit=10,
|
|
183
|
-
output_fields=["text", "id"],
|
|
184
|
-
filter='age > 20 and status == "active"',
|
|
185
|
-
search_params={"metric_type": "COSINE", "params": {"nprobe": 10}}
|
|
186
|
-
)
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### Query / Get / Delete
|
|
190
|
-
|
|
191
|
-
```python
|
|
192
|
-
# Query by filter
|
|
193
|
-
client.query(collection_name="my_collection", filter='id in [1, 2, 3]', output_fields=["text"], limit=100)
|
|
194
|
-
|
|
195
|
-
# Get by primary key
|
|
196
|
-
client.get(collection_name="my_collection", ids=[1, 2, 3], output_fields=["text"])
|
|
197
|
-
|
|
198
|
-
# Delete
|
|
199
|
-
client.delete(collection_name="my_collection", ids=[1, 2, 3])
|
|
200
|
-
client.delete(collection_name="my_collection", filter='status == "obsolete"')
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
- **Never use fake or placeholder vectors** (e.g., `[0.1, 0.2, ...]`). Always generate vectors from an embedding model.
|
|
204
|
-
- Use `pip install "pymilvus[model]"` for built-in embedding functions, or use any embedding model (OpenAI, Cohere, etc.).
|
|
205
|
-
- Vector dimension in search must match the collection schema exactly.
|
|
206
|
-
- The query embedding model must be the **same model** used to generate the stored vectors.
|
|
207
|
-
- For large inserts, batch data into chunks (e.g., 1000 rows per batch).
|
|
208
|
-
- For large result sets, use iterators — see [references/vector.md](references/vector.md).
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## Index Management
|
|
213
|
-
|
|
214
|
-
**See [references/index.md](references/index.md) for index types, metric types, and parameters.**
|
|
215
|
-
|
|
216
|
-
```python
|
|
217
|
-
index_params = client.prepare_index_params()
|
|
218
|
-
index_params.add_index(
|
|
219
|
-
field_name="embedding",
|
|
220
|
-
index_type="HNSW",
|
|
221
|
-
metric_type="COSINE",
|
|
222
|
-
params={"M": 16, "efConstruction": 256}
|
|
223
|
-
)
|
|
224
|
-
client.create_index(collection_name="my_collection", index_params=index_params)
|
|
225
|
-
|
|
226
|
-
client.list_indexes(collection_name="my_collection")
|
|
227
|
-
client.describe_index(collection_name="my_collection", index_name="my_index")
|
|
228
|
-
client.drop_index(collection_name="my_collection", index_name="my_index")
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
- `AUTOINDEX` is recommended for most use cases.
|
|
232
|
-
- An index is required before loading a collection.
|
|
233
|
-
|
|
234
|
-
---
|
|
235
|
-
|
|
236
|
-
## Additional Features
|
|
237
|
-
|
|
238
|
-
| Feature | Reference |
|
|
239
|
-
|---------|-----------|
|
|
240
|
-
| Partition Management | [references/partition.md](references/partition.md) |
|
|
241
|
-
| Database Management | [references/database.md](references/database.md) |
|
|
242
|
-
| User & Role Management (RBAC) | [references/user-role.md](references/user-role.md) |
|
|
243
|
-
| Common Patterns (RAG, Semantic Search) | [references/patterns.md](references/patterns.md) |
|
|
244
|
-
|
|
245
|
-
---
|
|
246
|
-
|
|
247
|
-
## General Guidance
|
|
248
|
-
|
|
249
|
-
- **Always ask the user for connection details** (URI, token/credentials) before writing connection code. Never assume or hardcode connection parameters.
|
|
250
|
-
- **Never generate fake or placeholder vectors.** Always use an embedding model to produce real vectors. Suggest `pip install "pymilvus[model]"` for built-in embedding functions.
|
|
251
|
-
- For quick prototyping, use **Milvus Lite** (`uri="./file.db"`) — no server needed, but only if the user explicitly requests local/embedded mode.
|
|
252
|
-
- A collection must be **loaded into memory** before search/query.
|
|
253
|
-
- The vector dimension in search data must **exactly match** the collection schema.
|
|
254
|
-
- The query embedding model must be the **same model** used to generate the stored vectors.
|
|
255
|
-
- Before any destructive operation (drop collection, drop database, delete vectors), always confirm with the user.
|
|
256
|
-
- Use `enable_dynamic_field=True` when the schema may evolve.
|
|
257
|
-
- Prefer `AUTOINDEX` unless the user has specific performance requirements.
|
|
258
|
-
- Use `truncate_collection` to clear all data without dropping the collection.
|
|
259
|
-
- For large datasets, use iterators (`search_iterator`, `query_iterator`) instead of increasing limit.
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
# Collection Management — Detailed Reference
|
|
2
|
-
|
|
3
|
-
## Supported Data Types
|
|
4
|
-
|
|
5
|
-
### Scalar Types
|
|
6
|
-
|
|
7
|
-
| DataType | Notes |
|
|
8
|
-
|----------|-------|
|
|
9
|
-
| `DataType.BOOL` | Boolean |
|
|
10
|
-
| `DataType.INT8` / `INT16` / `INT32` / `INT64` | Integers |
|
|
11
|
-
| `DataType.FLOAT` / `DOUBLE` | Floating point |
|
|
12
|
-
| `DataType.VARCHAR` | String (requires `max_length`) |
|
|
13
|
-
| `DataType.JSON` | JSON object |
|
|
14
|
-
| `DataType.ARRAY` | Array (requires `element_type`, `max_capacity`) |
|
|
15
|
-
|
|
16
|
-
### Vector Types
|
|
17
|
-
|
|
18
|
-
| DataType | Notes |
|
|
19
|
-
|----------|-------|
|
|
20
|
-
| `DataType.FLOAT_VECTOR` | Float32 vector (requires `dim`) |
|
|
21
|
-
| `DataType.FLOAT16_VECTOR` | Float16 vector (requires `dim`) |
|
|
22
|
-
| `DataType.BFLOAT16_VECTOR` | BFloat16 vector (requires `dim`) |
|
|
23
|
-
| `DataType.BINARY_VECTOR` | Binary vector (requires `dim`) |
|
|
24
|
-
| `DataType.SPARSE_FLOAT_VECTOR` | Sparse vector (no `dim` needed) |
|
|
25
|
-
| `DataType.INT8_VECTOR` | Int8 vector (requires `dim`) |
|
|
26
|
-
|
|
27
|
-
## add_field Parameters
|
|
28
|
-
|
|
29
|
-
```python
|
|
30
|
-
schema.add_field(
|
|
31
|
-
field_name="my_field",
|
|
32
|
-
datatype=DataType.VARCHAR,
|
|
33
|
-
is_primary=False,
|
|
34
|
-
auto_id=False,
|
|
35
|
-
max_length=256, # Required for VARCHAR
|
|
36
|
-
dim=768, # Required for vector types (except sparse)
|
|
37
|
-
element_type=DataType.INT64, # Required for ARRAY
|
|
38
|
-
max_capacity=100, # Required for ARRAY
|
|
39
|
-
nullable=False,
|
|
40
|
-
default_value=None,
|
|
41
|
-
is_partition_key=False,
|
|
42
|
-
description=""
|
|
43
|
-
)
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## All Collection Operations
|
|
47
|
-
|
|
48
|
-
```python
|
|
49
|
-
# List all collections
|
|
50
|
-
collections = client.list_collections()
|
|
51
|
-
|
|
52
|
-
# Describe a collection
|
|
53
|
-
info = client.describe_collection(collection_name="my_collection")
|
|
54
|
-
|
|
55
|
-
# Check if collection exists
|
|
56
|
-
exists = client.has_collection(collection_name="my_collection")
|
|
57
|
-
|
|
58
|
-
# Rename a collection
|
|
59
|
-
client.rename_collection(old_name="old_name", new_name="new_name")
|
|
60
|
-
|
|
61
|
-
# Drop a collection
|
|
62
|
-
client.drop_collection(collection_name="my_collection")
|
|
63
|
-
|
|
64
|
-
# Truncate a collection (delete all data, keep schema and index)
|
|
65
|
-
client.truncate_collection(collection_name="my_collection")
|
|
66
|
-
|
|
67
|
-
# Load collection into memory (required before search/query)
|
|
68
|
-
client.load_collection(collection_name="my_collection")
|
|
69
|
-
|
|
70
|
-
# Release collection from memory
|
|
71
|
-
client.release_collection(collection_name="my_collection")
|
|
72
|
-
|
|
73
|
-
# Get load state
|
|
74
|
-
state = client.get_load_state(collection_name="my_collection")
|
|
75
|
-
|
|
76
|
-
# Get collection statistics
|
|
77
|
-
stats = client.get_collection_stats(collection_name="my_collection")
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Guidance
|
|
81
|
-
|
|
82
|
-
- Quick create is best for prototyping; use custom schema for production.
|
|
83
|
-
- A collection must be **loaded** before search or query operations.
|
|
84
|
-
- Before dropping a collection, confirm with the user — this deletes all data.
|
|
85
|
-
- Use `enable_dynamic_field=True` to allow inserting fields not defined in the schema.
|
|
86
|
-
- Use `truncate_collection` to clear all data while preserving the collection structure.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Database Management
|
|
2
|
-
|
|
3
|
-
```python
|
|
4
|
-
# Create a database
|
|
5
|
-
client.create_database(db_name="my_database")
|
|
6
|
-
|
|
7
|
-
# List all databases
|
|
8
|
-
databases = client.list_databases()
|
|
9
|
-
# Returns: ["default", "my_database"]
|
|
10
|
-
|
|
11
|
-
# Switch to a database
|
|
12
|
-
client.using_database(db_name="my_database")
|
|
13
|
-
|
|
14
|
-
# Drop a database (must drop all collections first)
|
|
15
|
-
client.drop_database(db_name="my_database")
|
|
16
|
-
|
|
17
|
-
# Or connect to a specific database at init (use the user's actual URI and credentials)
|
|
18
|
-
client = MilvusClient(uri="<USER_URI>", token="<USER_TOKEN>", db_name="my_database")
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Guidance
|
|
22
|
-
|
|
23
|
-
- Every Milvus instance has a `"default"` database.
|
|
24
|
-
- Before dropping a database, all collections in it must be dropped first.
|