@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,71 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Chroma Regex Filtering
|
|
3
|
-
description: Learn how to use regex filters in Chroma queries
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Regex Filtering in Chroma
|
|
7
|
-
|
|
8
|
-
Chroma supports regex filtering on document content. This is useful when you need exact pattern matching that semantic search can't provide.
|
|
9
|
-
|
|
10
|
-
### When to use regex vs semantic search
|
|
11
|
-
|
|
12
|
-
**Use regex when:**
|
|
13
|
-
- Matching exact patterns like email addresses, URLs, or code identifiers
|
|
14
|
-
- Finding documents containing specific formats (dates, phone numbers, IDs)
|
|
15
|
-
- Filtering by prefixes or suffixes in structured data
|
|
16
|
-
- You need deterministic, repeatable matches
|
|
17
|
-
|
|
18
|
-
**Use semantic search when:**
|
|
19
|
-
- Looking for conceptually similar content regardless of exact wording
|
|
20
|
-
- The user's query is natural language
|
|
21
|
-
- You want to find related content even if it uses different terminology
|
|
22
|
-
|
|
23
|
-
You can combine both: use regex to narrow results, then rank by semantic similarity.
|
|
24
|
-
|
|
25
|
-
### Imports and boilerplate
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
import { DefaultEmbeddingFunction } from '@chroma-core/default-embed';
|
|
29
|
-
import { ChromaClient } from 'chromadb';
|
|
30
|
-
|
|
31
|
-
const client = new ChromaClient();
|
|
32
|
-
const embedder = new DefaultEmbeddingFunction();
|
|
33
|
-
|
|
34
|
-
const collection = await client.getOrCreateCollection({
|
|
35
|
-
name: 'example-collection',
|
|
36
|
-
embeddingFunction: embedder,
|
|
37
|
-
});
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Basic Regex Filter
|
|
41
|
-
|
|
42
|
-
Use the `$regex` operator in `where_document` to match document content against a regular expression. The regex follows standard regex syntax.
|
|
43
|
-
|
|
44
|
-
```typescript
|
|
45
|
-
await collection.query({
|
|
46
|
-
queryTexts: ['find support tickets with email addresses'],
|
|
47
|
-
whereDocument: {
|
|
48
|
-
$regex: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$',
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Combining regex with metadata filters
|
|
54
|
-
|
|
55
|
-
Regex filters can be combined with metadata filters using `$and` and `$or` operators. This is powerful for narrowing results by both content patterns and structured metadata. Note however regex can not be used on metadata string values.
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
await collection.query({
|
|
59
|
-
queryTexts: ['query1', 'query2'],
|
|
60
|
-
whereDocument: {
|
|
61
|
-
$and: [{ $contains: 'search_string_1' }, { $regex: '[a-z]+' }],
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Performance considerations
|
|
67
|
-
|
|
68
|
-
Regex filtering happens after the initial vector search retrieves candidates. For best performance:
|
|
69
|
-
- Keep regex patterns simple when possible
|
|
70
|
-
- Use metadata filters to reduce the candidate set before regex matching
|
|
71
|
-
- Consider whether a metadata field with pre-extracted values would be faster than runtime regex
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Integrating Chroma into an existing system
|
|
3
|
-
description: Guidance for adding Chroma search to an existing application
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Integrating Chroma into an existing system
|
|
7
|
-
|
|
8
|
-
Adding search to an existing application requires understanding the data flow and planning both the initial import and ongoing synchronization. This guide helps identify the key questions to answer.
|
|
9
|
-
|
|
10
|
-
### Key questions to ask the user
|
|
11
|
-
|
|
12
|
-
Before writing any code, clarify:
|
|
13
|
-
|
|
14
|
-
1. **What data should be searchable?** (documents, products, messages, etc.)
|
|
15
|
-
2. **Where does that data currently live?** (database, S3, API, files)
|
|
16
|
-
3. **How is the data structured?** (helps determine chunking strategy)
|
|
17
|
-
4. **How often does the data change?** (informs sync strategy)
|
|
18
|
-
5. **What latency is acceptable for updates to appear in search?**
|
|
19
|
-
|
|
20
|
-
## Understanding the source data
|
|
21
|
-
|
|
22
|
-
Before designing the import pipeline, ask the user if you can look at a sample of the data that will be made searchable. Seeing real records is far more useful than a description of the schema.
|
|
23
|
-
|
|
24
|
-
**If the data is in a database:** Write a short script that connects to the database and prints a few records. For example, a script that queries 3-5 rows from the relevant table and prints them to the terminal. This lets you see the actual field names, content lengths, and metadata available.
|
|
25
|
-
|
|
26
|
-
**If the data is on disk:** Read a few of the files directly to understand their structure, format, and size. For example, if indexing markdown files, read 2-3 of them to see how they're organized.
|
|
27
|
-
|
|
28
|
-
What to look for:
|
|
29
|
-
- **Which field(s) contain the searchable text** — this becomes the document content in Chroma
|
|
30
|
-
- **How long the content is** — determines whether chunking is needed
|
|
31
|
-
- **What metadata is available** — fields like category, author, date, or tenant ID that could be useful for filtering
|
|
32
|
-
- **How records are identified** — the primary key or filename that will link Chroma documents back to the source
|
|
33
|
-
|
|
34
|
-
This step prevents guesswork and leads to better chunking and metadata design decisions.
|
|
35
|
-
|
|
36
|
-
## Initial data import (offline ingest)
|
|
37
|
-
|
|
38
|
-
The first step is getting existing data into Chroma. This typically involves:
|
|
39
|
-
|
|
40
|
-
1. **Reading from the source** - database queries, S3 listing, API pagination
|
|
41
|
-
2. **Chunking** - breaking large documents into searchable pieces (see data-model.md)
|
|
42
|
-
3. **Embedding** - converting text chunks to vectors
|
|
43
|
-
4. **Writing to Chroma** - batching for efficiency
|
|
44
|
-
|
|
45
|
-
Build this as a reusable pipeline, not a one-off script. The same chunking and embedding logic will be needed for ongoing updates.
|
|
46
|
-
|
|
47
|
-
**Progress tracking:** For large imports, track which records have been processed. This allows resuming after failures and re-running for updates. A simple approach is storing the last processed ID or timestamp.
|
|
48
|
-
|
|
49
|
-
## Keeping data in sync (online writes)
|
|
50
|
-
|
|
51
|
-
After the initial import, new and updated data must flow to Chroma. There are two main patterns:
|
|
52
|
-
|
|
53
|
-
### Asynchronous (recommended)
|
|
54
|
-
|
|
55
|
-
Use a message queue (SQS, RabbitMQ, Redis streams, etc.) to decouple the primary write path from Chroma updates:
|
|
56
|
-
|
|
57
|
-
1. Application writes to primary database
|
|
58
|
-
2. Application publishes an event with the record ID
|
|
59
|
-
3. Queue consumer fetches the record, chunks, embeds, and writes to Chroma
|
|
60
|
-
|
|
61
|
-
**Benefits:** Primary writes aren't slowed by embedding latency. Retries are handled by the queue. Search updates can lag slightly without affecting the main application.
|
|
62
|
-
|
|
63
|
-
### Synchronous
|
|
64
|
-
|
|
65
|
-
If no queue infrastructure exists and slight latency is acceptable, update Chroma in the same request:
|
|
66
|
-
|
|
67
|
-
1. Application writes to primary database
|
|
68
|
-
2. Application chunks, embeds, and writes to Chroma
|
|
69
|
-
3. Request completes
|
|
70
|
-
|
|
71
|
-
**Tradeoffs:** Simpler infrastructure but adds latency to every write. Failures in Chroma can affect the primary write path unless carefully handled.
|
|
72
|
-
|
|
73
|
-
**Ask the user:** Do they have an async queue? If not, is synchronous acceptable, or should we set one up?
|
|
74
|
-
|
|
75
|
-
## Handling updates and deletes
|
|
76
|
-
|
|
77
|
-
- **Updates:** Re-chunk and re-embed the document, then use `upsert` to replace existing chunks
|
|
78
|
-
- **Deletes:** Delete all chunks for the document by ID prefix or metadata filter
|
|
79
|
-
|
|
80
|
-
Storing the source record ID in chunk metadata makes this straightforward. For example, if a blog post with ID `post-123` has 3 chunks, store `{"source_id": "post-123", "chunk_index": 0}` etc. on each chunk.
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Updating and Deleting
|
|
3
|
-
description: Update existing documents and delete data from collections
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Updating and Deleting
|
|
7
|
-
|
|
8
|
-
Chroma provides `update`, `upsert`, and `delete` methods for modifying data after initial insertion. Understanding when to use each is important for building reliable data sync pipelines.
|
|
9
|
-
|
|
10
|
-
### Method overview
|
|
11
|
-
|
|
12
|
-
| Method | Behavior | Use when |
|
|
13
|
-
|--------|----------|----------|
|
|
14
|
-
| `update` | Modifies existing documents, fails if ID doesn't exist | You know the document exists |
|
|
15
|
-
| `upsert` | Updates if exists, inserts if not | Syncing from external data source |
|
|
16
|
-
| `delete` | Removes documents by ID or filter | Removing stale or unwanted data |
|
|
17
|
-
|
|
18
|
-
### Imports
|
|
19
|
-
|
|
20
|
-
```python
|
|
21
|
-
import time
|
|
22
|
-
from typing import TypedDict
|
|
23
|
-
|
|
24
|
-
import chromadb
|
|
25
|
-
|
|
26
|
-
client = chromadb.HttpClient(host="localhost", port=8000)
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Update
|
|
30
|
-
|
|
31
|
-
Update modifies existing documents. If an ID doesn't exist, the operation fails silently for that ID (no error thrown, but nothing is updated).
|
|
32
|
-
|
|
33
|
-
**Important:** When you update a document's text, Chroma re-computes the embedding automatically using the collection's embedding function.
|
|
34
|
-
|
|
35
|
-
```python
|
|
36
|
-
collection = client.get_or_create_collection(name="my_collection")
|
|
37
|
-
|
|
38
|
-
collection.add(
|
|
39
|
-
ids=["doc1", "doc2"],
|
|
40
|
-
documents=["Original text for doc1", "Original text for doc2"],
|
|
41
|
-
metadatas=[{"category": "draft"}, {"category": "draft"}],
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
collection.update(
|
|
45
|
-
ids=["doc1"],
|
|
46
|
-
documents=["Updated text for doc1"],
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
collection.update(
|
|
50
|
-
ids=["doc1", "doc2"],
|
|
51
|
-
metadatas=[{"category": "published"}, {"category": "published"}],
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
collection.update(
|
|
55
|
-
ids=["doc2"],
|
|
56
|
-
documents=["Completely revised doc2 content"],
|
|
57
|
-
metadatas=[{"category": "published", "revision": 2}],
|
|
58
|
-
)
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Upsert
|
|
62
|
-
|
|
63
|
-
Upsert is the preferred method for syncing data from an external source. It inserts new documents and updates existing ones in a single operation.
|
|
64
|
-
|
|
65
|
-
**When to use upsert vs update:**
|
|
66
|
-
- Use `upsert` when syncing from a primary database (you don't know which records are new)
|
|
67
|
-
- Use `update` when you're certain the document already exists
|
|
68
|
-
|
|
69
|
-
```python
|
|
70
|
-
collection2 = client.get_or_create_collection(name="articles")
|
|
71
|
-
|
|
72
|
-
collection2.upsert(
|
|
73
|
-
ids=["article-123", "article-456", "article-789"],
|
|
74
|
-
documents=[
|
|
75
|
-
"Content of article 123",
|
|
76
|
-
"Content of article 456",
|
|
77
|
-
"Content of article 789",
|
|
78
|
-
],
|
|
79
|
-
metadatas=[
|
|
80
|
-
{"source_id": "123", "updated_at": int(time.time())},
|
|
81
|
-
{"source_id": "456", "updated_at": int(time.time())},
|
|
82
|
-
{"source_id": "789", "updated_at": int(time.time())},
|
|
83
|
-
],
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
collection2.upsert(
|
|
87
|
-
ids=["article-123", "article-456"],
|
|
88
|
-
documents=[
|
|
89
|
-
"Updated content of article 123",
|
|
90
|
-
"Updated content of article 456",
|
|
91
|
-
],
|
|
92
|
-
metadatas=[
|
|
93
|
-
{"source_id": "123", "updated_at": int(time.time())},
|
|
94
|
-
{"source_id": "456", "updated_at": int(time.time())},
|
|
95
|
-
],
|
|
96
|
-
)
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## Delete by ID
|
|
100
|
-
|
|
101
|
-
The simplest way to delete documents is by their IDs.
|
|
102
|
-
|
|
103
|
-
```python
|
|
104
|
-
awaiting_cleanup = ["article-789", "article-456"]
|
|
105
|
-
collection2.delete(ids=awaiting_cleanup)
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Delete by filter
|
|
109
|
-
|
|
110
|
-
Delete documents matching metadata or content filters without knowing specific IDs. Useful for bulk cleanup operations.
|
|
111
|
-
|
|
112
|
-
```python
|
|
113
|
-
collection2.delete(
|
|
114
|
-
where={"source_id": "123"},
|
|
115
|
-
)
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## Syncing from an external data source
|
|
119
|
-
|
|
120
|
-
A common pattern is keeping Chroma in sync with a primary database. This example shows how to handle creates, updates, and deletes.
|
|
121
|
-
|
|
122
|
-
```python
|
|
123
|
-
class SourceRecord(TypedDict):
|
|
124
|
-
id: str
|
|
125
|
-
content: str
|
|
126
|
-
deleted: bool
|
|
127
|
-
updated_at: int
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
def sync_records(records: list[SourceRecord]) -> None:
|
|
131
|
-
active_records = [record for record in records if not record["deleted"]]
|
|
132
|
-
deleted_ids = [record["id"] for record in records if record["deleted"]]
|
|
133
|
-
|
|
134
|
-
if active_records:
|
|
135
|
-
collection2.upsert(
|
|
136
|
-
ids=[record["id"] for record in active_records],
|
|
137
|
-
documents=[record["content"] for record in active_records],
|
|
138
|
-
metadatas=[
|
|
139
|
-
{
|
|
140
|
-
"source_id": record["id"],
|
|
141
|
-
"updated_at": record["updated_at"],
|
|
142
|
-
}
|
|
143
|
-
for record in active_records
|
|
144
|
-
],
|
|
145
|
-
)
|
|
146
|
-
|
|
147
|
-
if deleted_ids:
|
|
148
|
-
collection2.delete(ids=deleted_ids)
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Sync strategy tips
|
|
152
|
-
|
|
153
|
-
**Track source IDs:** Always store the primary database ID in metadata so you can find and update documents later.
|
|
154
|
-
|
|
155
|
-
**Batch operations:** Process updates in batches of 100-500 to balance throughput and memory usage.
|
|
156
|
-
|
|
157
|
-
**Handle deletes:** When records are deleted from your primary database, delete them from Chroma too. Use metadata filters if you track `source_id`.
|
|
158
|
-
|
|
159
|
-
**Idempotent syncs:** Use `upsert` so re-running a sync doesn't create duplicates.
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Updating and Deleting
|
|
3
|
-
description: Update existing documents and delete data from collections
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Updating and Deleting
|
|
7
|
-
|
|
8
|
-
Chroma provides `update`, `upsert`, and `delete` methods for modifying data after initial insertion. Understanding when to use each is important for building reliable data sync pipelines.
|
|
9
|
-
|
|
10
|
-
### Method overview
|
|
11
|
-
|
|
12
|
-
| Method | Behavior | Use when |
|
|
13
|
-
|--------|----------|----------|
|
|
14
|
-
| `update` | Modifies existing documents, fails if ID doesn't exist | You know the document exists |
|
|
15
|
-
| `upsert` | Updates if exists, inserts if not | Syncing from external data source |
|
|
16
|
-
| `delete` | Removes documents by ID or filter | Removing stale or unwanted data |
|
|
17
|
-
|
|
18
|
-
### Imports
|
|
19
|
-
|
|
20
|
-
```typescript
|
|
21
|
-
import { ChromaClient } from 'chromadb';
|
|
22
|
-
import { DefaultEmbeddingFunction } from '@chroma-core/default-embed';
|
|
23
|
-
|
|
24
|
-
const client = new ChromaClient();
|
|
25
|
-
const embeddingFunction = new DefaultEmbeddingFunction();
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Update
|
|
29
|
-
|
|
30
|
-
Update modifies existing documents. If an ID doesn't exist, the operation fails silently for that ID (no error thrown, but nothing is updated).
|
|
31
|
-
|
|
32
|
-
**Important:** When you update a document's text, Chroma re-computes the embedding automatically using the collection's embedding function.
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
const collection = await client.getOrCreateCollection({
|
|
36
|
-
name: 'my_collection',
|
|
37
|
-
embeddingFunction,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
await collection.add({
|
|
41
|
-
ids: ['doc1', 'doc2'],
|
|
42
|
-
documents: ['Original text for doc1', 'Original text for doc2'],
|
|
43
|
-
metadatas: [{ category: 'draft' }, { category: 'draft' }],
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
await collection.update({
|
|
47
|
-
ids: ['doc1'],
|
|
48
|
-
documents: ['Updated text for doc1'],
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
await collection.update({
|
|
52
|
-
ids: ['doc1', 'doc2'],
|
|
53
|
-
metadatas: [{ category: 'published' }, { category: 'published' }],
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
await collection.update({
|
|
57
|
-
ids: ['doc2'],
|
|
58
|
-
documents: ['Completely revised doc2 content'],
|
|
59
|
-
metadatas: [{ category: 'published', revision: 2 }],
|
|
60
|
-
});
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Upsert
|
|
64
|
-
|
|
65
|
-
Upsert is the preferred method for syncing data from an external source. It inserts new documents and updates existing ones in a single operation.
|
|
66
|
-
|
|
67
|
-
**When to use upsert vs update:**
|
|
68
|
-
- Use `upsert` when syncing from a primary database (you don't know which records are new)
|
|
69
|
-
- Use `update` when you're certain the document already exists
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
const collection2 = await client.getOrCreateCollection({
|
|
73
|
-
name: 'articles',
|
|
74
|
-
embeddingFunction,
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
await collection2.upsert({
|
|
78
|
-
ids: ['article-123', 'article-456', 'article-789'],
|
|
79
|
-
documents: [
|
|
80
|
-
'Content of article 123',
|
|
81
|
-
'Content of article 456',
|
|
82
|
-
'Content of article 789',
|
|
83
|
-
],
|
|
84
|
-
metadatas: [
|
|
85
|
-
{ source_id: '123', updated_at: Date.now() },
|
|
86
|
-
{ source_id: '456', updated_at: Date.now() },
|
|
87
|
-
{ source_id: '789', updated_at: Date.now() },
|
|
88
|
-
],
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
await collection2.upsert({
|
|
92
|
-
ids: ['article-123', 'article-456'],
|
|
93
|
-
documents: [
|
|
94
|
-
'Updated content of article 123',
|
|
95
|
-
'Updated content of article 456',
|
|
96
|
-
],
|
|
97
|
-
metadatas: [
|
|
98
|
-
{ source_id: '123', updated_at: Date.now() },
|
|
99
|
-
{ source_id: '456', updated_at: Date.now() },
|
|
100
|
-
],
|
|
101
|
-
});
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Delete by ID
|
|
105
|
-
|
|
106
|
-
The simplest way to delete documents is by their IDs.
|
|
107
|
-
|
|
108
|
-
```typescript
|
|
109
|
-
const collection3 = await client.getOrCreateCollection({
|
|
110
|
-
name: 'my_collection',
|
|
111
|
-
embeddingFunction,
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
await collection3.delete({
|
|
115
|
-
ids: ['doc1', 'doc2'],
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
await collection3.delete({
|
|
119
|
-
ids: ['doc3'],
|
|
120
|
-
});
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## Delete by filter
|
|
124
|
-
|
|
125
|
-
Delete documents matching metadata or content filters without knowing specific IDs. Useful for bulk cleanup operations.
|
|
126
|
-
|
|
127
|
-
```typescript
|
|
128
|
-
const collection4 = await client.getOrCreateCollection({
|
|
129
|
-
name: 'my_collection',
|
|
130
|
-
embeddingFunction,
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
await collection4.delete({
|
|
134
|
-
where: { status: 'archived' },
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
await collection4.delete({
|
|
138
|
-
where: { source_id: 'old-source-123' },
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
await collection4.delete({
|
|
142
|
-
whereDocument: { $contains: 'DEPRECATED' },
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
await collection4.delete({
|
|
146
|
-
ids: ['doc1', 'doc2', 'doc3', 'doc4'],
|
|
147
|
-
where: { category: 'temp' },
|
|
148
|
-
});
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Syncing from an external data source
|
|
152
|
-
|
|
153
|
-
A common pattern is keeping Chroma in sync with a primary database. This example shows how to handle creates, updates, and deletes.
|
|
154
|
-
|
|
155
|
-
```typescript
|
|
156
|
-
interface SourceRecord {
|
|
157
|
-
id: string;
|
|
158
|
-
content: string;
|
|
159
|
-
updated_at: number;
|
|
160
|
-
category: string;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
async function syncToChroma(
|
|
164
|
-
collectionName: string,
|
|
165
|
-
records: SourceRecord[],
|
|
166
|
-
deletedIds: string[]
|
|
167
|
-
) {
|
|
168
|
-
const collection = await client.getOrCreateCollection({
|
|
169
|
-
name: collectionName,
|
|
170
|
-
embeddingFunction,
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
if (records.length > 0) {
|
|
174
|
-
const batchSize = 100;
|
|
175
|
-
|
|
176
|
-
for (let i = 0; i < records.length; i += batchSize) {
|
|
177
|
-
const batch = records.slice(i, i + batchSize);
|
|
178
|
-
|
|
179
|
-
await collection.upsert({
|
|
180
|
-
ids: batch.map((record) => `source-${record.id}`),
|
|
181
|
-
documents: batch.map((record) => record.content),
|
|
182
|
-
metadatas: batch.map((record) => ({
|
|
183
|
-
source_id: record.id,
|
|
184
|
-
updated_at: record.updated_at,
|
|
185
|
-
category: record.category,
|
|
186
|
-
})),
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (deletedIds.length > 0) {
|
|
192
|
-
await collection.delete({
|
|
193
|
-
ids: deletedIds.map((id) => `source-${id}`),
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return { synced: records.length, deleted: deletedIds.length };
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
const changedRecords: SourceRecord[] = [
|
|
201
|
-
{
|
|
202
|
-
id: '1',
|
|
203
|
-
content: 'Article about TypeScript',
|
|
204
|
-
updated_at: Date.now(),
|
|
205
|
-
category: 'tech',
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
id: '2',
|
|
209
|
-
content: 'Guide to vector databases',
|
|
210
|
-
updated_at: Date.now(),
|
|
211
|
-
category: 'tech',
|
|
212
|
-
},
|
|
213
|
-
];
|
|
214
|
-
|
|
215
|
-
const deletedRecordIds = ['old-1', 'old-2'];
|
|
216
|
-
|
|
217
|
-
await syncToChroma('articles', changedRecords, deletedRecordIds);
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### Sync strategy tips
|
|
221
|
-
|
|
222
|
-
**Track source IDs:** Always store the primary database ID in metadata so you can find and update documents later.
|
|
223
|
-
|
|
224
|
-
**Batch operations:** Process updates in batches of 100-500 to balance throughput and memory usage.
|
|
225
|
-
|
|
226
|
-
**Handle deletes:** When records are deleted from your primary database, delete them from Chroma too. Use metadata filters if you track `source_id`.
|
|
227
|
-
|
|
228
|
-
**Idempotent syncs:** Use `upsert` so re-running a sync doesn't create duplicates.
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: find-skills
|
|
3
|
-
description: "Discover and install agent skills from the open ecosystem. Use when asking how to do something, finding skills, looking for capabilities, or needing functionality that might exist as an installable skill."
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
metadata:
|
|
6
|
-
version: "1.0.0"
|
|
7
|
-
author: "xujianjiang"
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Find Skills
|
|
11
|
-
|
|
12
|
-
This skill helps you discover and install skills from the open agent skills ecosystem.
|
|
13
|
-
|
|
14
|
-
## When to Use This Skill
|
|
15
|
-
|
|
16
|
-
Use this skill when the user:
|
|
17
|
-
|
|
18
|
-
- Asks "how do I do X" where X might be a common task with an existing skill
|
|
19
|
-
- Says "find a skill for X" or "is there a skill for X"
|
|
20
|
-
- Asks "can you do X" where X is a specialized capability
|
|
21
|
-
- Expresses interest in extending agent capabilities
|
|
22
|
-
- Wants to search for tools, templates, or workflows
|
|
23
|
-
- Mentions they wish they had help with a specific domain (design, testing, deployment, etc.)
|
|
24
|
-
|
|
25
|
-
## What is the Skills CLI?
|
|
26
|
-
|
|
27
|
-
The Skills CLI (`npx skills`) is the package manager for the open agent skills ecosystem. Skills are modular packages that extend agent capabilities with specialized knowledge, workflows, and tools.
|
|
28
|
-
|
|
29
|
-
**Key commands:**
|
|
30
|
-
|
|
31
|
-
- `npx skills find [query]` - Search for skills interactively or by keyword
|
|
32
|
-
- `npx skills add <package>` - Install a skill from GitHub or other sources
|
|
33
|
-
- `npx skills check` - Check for skill updates
|
|
34
|
-
- `npx skills update` - Update all installed skills
|
|
35
|
-
|
|
36
|
-
**Browse skills at:** https://skills.sh/
|
|
37
|
-
|
|
38
|
-
## How to Help Users Find Skills
|
|
39
|
-
|
|
40
|
-
### Step 1: Understand What They Need
|
|
41
|
-
|
|
42
|
-
When a user asks for help with something, identify:
|
|
43
|
-
|
|
44
|
-
1. The domain (e.g., React, testing, design, deployment)
|
|
45
|
-
2. The specific task (e.g., writing tests, creating animations, reviewing PRs)
|
|
46
|
-
3. Whether this is a common enough task that a skill likely exists
|
|
47
|
-
|
|
48
|
-
### Step 2: Search for Skills
|
|
49
|
-
|
|
50
|
-
Run the find command with a relevant query:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
npx skills find [query]
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
For example:
|
|
57
|
-
|
|
58
|
-
- User asks "how do I make my React app faster?" → `npx skills find react performance`
|
|
59
|
-
- User asks "can you help me with PR reviews?" → `npx skills find pr review`
|
|
60
|
-
- User asks "I need to create a changelog" → `npx skills find changelog`
|
|
61
|
-
|
|
62
|
-
The command will return results like:
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
Install with npx skills add <owner/repo@skill>
|
|
66
|
-
|
|
67
|
-
vercel-labs/agent-skills@vercel-react-best-practices
|
|
68
|
-
└ https://skills.sh/vercel-labs/agent-skills/vercel-react-best-practices
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Step 3: Present Options to the User
|
|
72
|
-
|
|
73
|
-
When you find relevant skills, present them to the user with:
|
|
74
|
-
|
|
75
|
-
1. The skill name and what it does
|
|
76
|
-
2. The install command they can run
|
|
77
|
-
3. A link to learn more at skills.sh
|
|
78
|
-
|
|
79
|
-
Example response:
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
I found a skill that might help! The "vercel-react-best-practices" skill provides
|
|
83
|
-
React and Next.js performance optimization guidelines from Vercel Engineering.
|
|
84
|
-
|
|
85
|
-
To install it:
|
|
86
|
-
npx skills add vercel-labs/agent-skills@vercel-react-best-practices
|
|
87
|
-
|
|
88
|
-
Learn more: https://skills.sh/vercel-labs/agent-skills/vercel-react-best-practices
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Step 4: Offer to Install
|
|
92
|
-
|
|
93
|
-
If the user wants to proceed, you can install the skill for them:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
npx skills add <owner/repo@skill> -g -y
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
The `-g` flag installs globally (user-level) and `-y` skips confirmation prompts.
|
|
100
|
-
|
|
101
|
-
## Common Skill Categories
|
|
102
|
-
|
|
103
|
-
When searching, consider these common categories:
|
|
104
|
-
|
|
105
|
-
| Category | Example Queries |
|
|
106
|
-
| --------------- | ---------------------------------------- |
|
|
107
|
-
| Web Development | react, nextjs, typescript, css, tailwind |
|
|
108
|
-
| Testing | testing, jest, playwright, e2e |
|
|
109
|
-
| DevOps | deploy, docker, kubernetes, ci-cd |
|
|
110
|
-
| Documentation | docs, readme, changelog, api-docs |
|
|
111
|
-
| Code Quality | review, lint, refactor, best-practices |
|
|
112
|
-
| Design | ui, ux, design-system, accessibility |
|
|
113
|
-
| Productivity | workflow, automation, git |
|
|
114
|
-
|
|
115
|
-
## Tips for Effective Searches
|
|
116
|
-
|
|
117
|
-
1. **Use specific keywords**: "react testing" is better than just "testing"
|
|
118
|
-
2. **Try alternative terms**: If "deploy" doesn't work, try "deployment" or "ci-cd"
|
|
119
|
-
3. **Check popular sources**: Many skills come from `vercel-labs/agent-skills` or `ComposioHQ/awesome-claude-skills`
|
|
120
|
-
|
|
121
|
-
## When No Skills Are Found
|
|
122
|
-
|
|
123
|
-
If no relevant skills exist:
|
|
124
|
-
|
|
125
|
-
1. Acknowledge that no existing skill was found
|
|
126
|
-
2. Offer to help with the task directly using your general capabilities
|
|
127
|
-
3. Suggest the user could create their own skill with `npx skills init`
|
|
128
|
-
|
|
129
|
-
Example:
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
I searched for skills related to "xyz" but didn't find any matches.
|
|
133
|
-
I can still help you with this task directly! Would you like me to proceed?
|
|
134
|
-
|
|
135
|
-
If this is something you do often, you could create your own skill:
|
|
136
|
-
npx skills init my-xyz-skill
|
|
137
|
-
```
|