@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.
Files changed (126) hide show
  1. package/config/agent/extensions/aicode-provider-scope.ts +388 -0
  2. package/config/agent/skills/agent-browser/LICENSE +201 -0
  3. package/config/agent/skills/agent-browser/SKILL.md +55 -0
  4. package/config/agent/skills/codebase-design/DEEPENING.md +37 -0
  5. package/config/agent/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  6. package/config/agent/skills/{chroma → codebase-design}/LICENSE +1 -1
  7. package/config/agent/skills/codebase-design/SKILL.md +118 -0
  8. package/config/agent/skills/codebase-design/agents/openai.yaml +3 -0
  9. package/config/agent/skills/domain-modeling/ADR-FORMAT.md +47 -0
  10. package/config/agent/skills/domain-modeling/GLOSSARY-FORMAT.md +61 -0
  11. package/config/agent/skills/{fireworks-tech-graph → domain-modeling}/LICENSE +1 -1
  12. package/config/agent/skills/domain-modeling/SKILL.md +78 -0
  13. package/config/agent/skills/domain-modeling/agents/openai.yaml +3 -0
  14. package/config/agent/skills/frontend-design/SKILL.md +55 -26
  15. package/config/agent/skills/grill-with-docs/LICENSE +21 -0
  16. package/config/agent/skills/grill-with-docs/SKILL.md +21 -0
  17. package/config/agent/skills/grill-with-docs/agents/openai.yaml +5 -0
  18. package/config/agent/skills/grilling/LICENSE +21 -0
  19. package/config/agent/skills/grilling/SKILL.md +34 -0
  20. package/config/agent/skills/grilling/agents/openai.yaml +3 -0
  21. package/config/agent/skills/tdd/LICENSE +21 -0
  22. package/config/agent/skills/tdd/SKILL.md +42 -0
  23. package/config/agent/skills/tdd/agents/openai.yaml +3 -0
  24. package/config/agent/skills/tdd/mocking.md +59 -0
  25. package/config/agent/skills/tdd/tests.md +77 -0
  26. package/config/agent/skills/ui-taste/CHECKSUMS.sha256 +25 -0
  27. package/config/agent/skills/{milvus-skill → ui-taste}/LICENSE +12 -23
  28. package/config/agent/skills/ui-taste/MANIFEST.json +256 -0
  29. package/config/agent/skills/ui-taste/MODIFICATIONS.md +23 -0
  30. package/config/agent/skills/ui-taste/NOTICE +74 -0
  31. package/config/agent/skills/ui-taste/SKILL.md +90 -0
  32. package/config/agent/skills/ui-taste/agents/openai.yaml +4 -0
  33. package/config/agent/skills/ui-taste/reference/anti-slop-craft.md +138 -0
  34. package/config/agent/skills/ui-taste/reference/audit.md +71 -0
  35. package/config/agent/skills/ui-taste/reference/audit.native.md +78 -0
  36. package/config/agent/skills/ui-taste/reference/craft.md +48 -0
  37. package/config/agent/skills/ui-taste/reference/distill.md +20 -0
  38. package/config/agent/skills/ui-taste/reference/image-assets.md +31 -0
  39. package/config/agent/skills/ui-taste/reference/ios.md +35 -0
  40. package/config/agent/skills/ui-taste/reference/mobile-controls.md +37 -0
  41. package/config/agent/skills/ui-taste/reference/mobile-state-performance.md +34 -0
  42. package/config/agent/skills/ui-taste/reference/native-verification.md +33 -0
  43. package/config/agent/skills/ui-taste/reference/new-work.md +87 -0
  44. package/config/agent/skills/ui-taste/reference/operate.md +37 -0
  45. package/config/agent/skills/ui-taste/reference/overdrive.md +65 -0
  46. package/config/agent/skills/ui-taste/reference/polish.md +63 -0
  47. package/config/agent/skills/ui-taste/reference/research.md +45 -0
  48. package/config/agent/skills/ui-taste/references/uizze-image-to-ui.md +77 -0
  49. package/config/agent/skills/ui-taste/references/uizze-reference-policy.md +27 -0
  50. package/config/agent/skills/ui-taste/references/uizze-visual-verification.md +62 -0
  51. package/config/agent/skills/ui-taste/scripts/verify-visual-evidence.mjs +108 -0
  52. package/package.json +5 -5
  53. package/config/agent/skills/chroma/chroma-local/SKILL.md +0 -165
  54. package/config/agent/skills/chroma/chroma-local/cli.md +0 -48
  55. package/config/agent/skills/chroma/chroma-local/data-model.md +0 -103
  56. package/config/agent/skills/chroma/chroma-local/error-handling/python.md +0 -166
  57. package/config/agent/skills/chroma/chroma-local/error-handling/typescript.md +0 -231
  58. package/config/agent/skills/chroma/chroma-local/local-chroma/python.md +0 -95
  59. package/config/agent/skills/chroma/chroma-local/local-chroma/typescript.md +0 -101
  60. package/config/agent/skills/chroma/chroma-local/metadata/python.md +0 -154
  61. package/config/agent/skills/chroma/chroma-local/metadata/typescript.md +0 -153
  62. package/config/agent/skills/chroma/chroma-local/querying/python.md +0 -147
  63. package/config/agent/skills/chroma/chroma-local/querying/typescript.md +0 -157
  64. package/config/agent/skills/chroma/chroma-local/regex/python.md +0 -69
  65. package/config/agent/skills/chroma/chroma-local/regex/typescript.md +0 -71
  66. package/config/agent/skills/chroma/chroma-local/understanding-a-codebase.md +0 -80
  67. package/config/agent/skills/chroma/chroma-local/updating-deleting/python.md +0 -159
  68. package/config/agent/skills/chroma/chroma-local/updating-deleting/typescript.md +0 -228
  69. package/config/agent/skills/find-skills/SKILL.md +0 -137
  70. package/config/agent/skills/fireworks-tech-graph/README.md +0 -528
  71. package/config/agent/skills/fireworks-tech-graph/README.zh.md +0 -499
  72. package/config/agent/skills/fireworks-tech-graph/SKILL.md +0 -538
  73. package/config/agent/skills/fireworks-tech-graph/agentloop-core.svg +0 -101
  74. package/config/agent/skills/fireworks-tech-graph/agents/openai.yaml +0 -4
  75. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style1-flat.png +0 -0
  76. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style2-dark.png +0 -0
  77. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style3-blueprint.png +0 -0
  78. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style4-notion.png +0 -0
  79. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style5-glass.png +0 -0
  80. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style6-claude.png +0 -0
  81. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style7-openai.png +0 -0
  82. package/config/agent/skills/fireworks-tech-graph/fixtures/agent-memory-types-style4.json +0 -181
  83. package/config/agent/skills/fireworks-tech-graph/fixtures/api-flow-style7.json +0 -40
  84. package/config/agent/skills/fireworks-tech-graph/fixtures/mem0-style1.json +0 -297
  85. package/config/agent/skills/fireworks-tech-graph/fixtures/microservices-style3.json +0 -64
  86. package/config/agent/skills/fireworks-tech-graph/fixtures/multi-agent-style5.json +0 -45
  87. package/config/agent/skills/fireworks-tech-graph/fixtures/system-architecture-style6.json +0 -48
  88. package/config/agent/skills/fireworks-tech-graph/fixtures/tool-call-style2.json +0 -182
  89. package/config/agent/skills/fireworks-tech-graph/package.json +0 -42
  90. package/config/agent/skills/fireworks-tech-graph/references/icons.md +0 -406
  91. package/config/agent/skills/fireworks-tech-graph/references/style-1-flat-icon.md +0 -108
  92. package/config/agent/skills/fireworks-tech-graph/references/style-2-dark-terminal.md +0 -107
  93. package/config/agent/skills/fireworks-tech-graph/references/style-3-blueprint.md +0 -113
  94. package/config/agent/skills/fireworks-tech-graph/references/style-4-notion-clean.md +0 -94
  95. package/config/agent/skills/fireworks-tech-graph/references/style-5-glassmorphism.md +0 -125
  96. package/config/agent/skills/fireworks-tech-graph/references/style-6-claude-official.md +0 -209
  97. package/config/agent/skills/fireworks-tech-graph/references/style-7-openai.md +0 -215
  98. package/config/agent/skills/fireworks-tech-graph/references/style-diagram-matrix.md +0 -135
  99. package/config/agent/skills/fireworks-tech-graph/references/svg-layout-best-practices.md +0 -100
  100. package/config/agent/skills/fireworks-tech-graph/scripts/README.md +0 -244
  101. package/config/agent/skills/fireworks-tech-graph/scripts/generate-diagram.sh +0 -157
  102. package/config/agent/skills/fireworks-tech-graph/scripts/generate-from-template.py +0 -1556
  103. package/config/agent/skills/fireworks-tech-graph/scripts/test-all-styles.sh +0 -135
  104. package/config/agent/skills/fireworks-tech-graph/scripts/validate-svg.sh +0 -292
  105. package/config/agent/skills/fireworks-tech-graph/templates/agent-architecture.svg +0 -28
  106. package/config/agent/skills/fireworks-tech-graph/templates/architecture.svg +0 -23
  107. package/config/agent/skills/fireworks-tech-graph/templates/comparison-matrix.svg +0 -14
  108. package/config/agent/skills/fireworks-tech-graph/templates/data-flow.svg +0 -28
  109. package/config/agent/skills/fireworks-tech-graph/templates/er-diagram.svg +0 -21
  110. package/config/agent/skills/fireworks-tech-graph/templates/flowchart.svg +0 -21
  111. package/config/agent/skills/fireworks-tech-graph/templates/sequence.svg +0 -20
  112. package/config/agent/skills/fireworks-tech-graph/templates/state-machine.svg +0 -20
  113. package/config/agent/skills/fireworks-tech-graph/templates/timeline.svg +0 -19
  114. package/config/agent/skills/fireworks-tech-graph/templates/use-case.svg +0 -21
  115. package/config/agent/skills/hello/SKILL.md +0 -26
  116. package/config/agent/skills/librarian/SKILL.md +0 -199
  117. package/config/agent/skills/milvus-skill/README.md +0 -37
  118. package/config/agent/skills/milvus-skill/SKILL.md +0 -259
  119. package/config/agent/skills/milvus-skill/references/collection.md +0 -86
  120. package/config/agent/skills/milvus-skill/references/database.md +0 -24
  121. package/config/agent/skills/milvus-skill/references/index.md +0 -69
  122. package/config/agent/skills/milvus-skill/references/partition.md +0 -29
  123. package/config/agent/skills/milvus-skill/references/patterns.md +0 -150
  124. package/config/agent/skills/milvus-skill/references/user-role.md +0 -90
  125. package/config/agent/skills/milvus-skill/references/vector.md +0 -247
  126. package/config/agent/skills/pr/SKILL.md +0 -59
@@ -0,0 +1,62 @@
1
+ # Evidence for visual completion
2
+
3
+ Use this for an implemented or changed interface. Scope the checks to the requested work and supported product behavior. Do not invent a dark theme, device target, or new feature to satisfy a checklist. A source-only audit does not need manufactured screenshots.
4
+
5
+ These checks establish concrete behavior, reference fidelity and reviewable evidence. An AI-authored rating, another agent's preference, or a passed-check count does not establish good taste or that the result is better than a reference. Run the applicable checks and corrections autonomously and deliver the result with its evidence. Do not create a mandatory human taste-review gate; report concrete discrepancies without presenting them as a “less slop” score or claiming user approval.
6
+
7
+ ## Define the checks before the final pass
8
+
9
+ Name the important states and sizes: the primary path, affected empty/loading/error/recovery states, the reported failing viewport, and relevant keyboard, text-size or theme settings. For a flow, include entry, exit, Back/dismissal, and state carried between steps. For motion, include entry, interruption, exit and reduced-motion behavior. Use real product state; an unavailable backend is a limitation, not successful submission.
10
+
11
+ For forms, exercise invalid input → correction → blur/submit, then leave and revisit the step when supported. Check the visible message, error styling and accessible invalid state together: corrected input must not retain an unexplained error, and navigation must not hide a message while leaving its error marker behind. Include this recovery cycle in the receipt; a successful retry of a server request does not verify field-validation recovery.
12
+
13
+ Capture the actual running result after fonts and images load. Inspect its pixels against the approved target or the existing product system. Reject blank, wrong-screen, half-loaded or wrong-size captures. Fix named material issues together, then recapture the affected checks. Stop when the scoped checks pass; record unresolved issues instead of looping indefinitely.
14
+
15
+ ## Save a reviewable receipt
16
+
17
+ Keep a compact `visual-evidence.json` beside local captures (outside public product assets). Record:
18
+
19
+ - The scope and affected source/style/asset files with SHA-256 hashes of the bytes used for the final render.
20
+ - The comparison mode: an actual saved target, or the existing system. A target image is evidence only after it was inspected and compared with a real render.
21
+ - The required checks, actual browser/simulator/device and viewport dimensions, state, observed findings, and saved screenshot/video paths and hashes.
22
+ - The interaction steps exercised, and all unresolved or unavailable checks. A blocked check remains blocked; do not remove it to obtain a pass.
23
+
24
+ Use a small receipt for a small change. Example shape (replace every example value with measured evidence):
25
+
26
+ ```json
27
+ {
28
+ "schemaVersion": "uizze.visual-evidence.v1",
29
+ "scope": "Checkout error-state spacing",
30
+ "platform": "web",
31
+ "sources": [{ "path": "../src/checkout.tsx", "sha256": "actual-sha256" }],
32
+ "comparison": "existing-system",
33
+ "requiredChecks": [{ "id": "mobile-error", "kind": "visual" }],
34
+ "checks": [{
35
+ "id": "mobile-error",
36
+ "status": "pass",
37
+ "state": "Payment declined, retry enabled",
38
+ "environment": { "kind": "browser", "name": "Chromium", "width": 390, "height": 844 },
39
+ "observed": "Error wraps beneath the input; retry remains visible with no overlap.",
40
+ "artifacts": [{ "path": "mobile-error.png", "kind": "image", "sha256": "actual-sha256" }]
41
+ }],
42
+ "unresolved": []
43
+ }
44
+ ```
45
+
46
+ For `comparison: "target"`, add `target: {"path": "target.png", "kind": "image", "sha256": "actual-sha256"}` and record the target's real dimensions in the scope or observations. Compare at matching dimensions. Retain a separate actual render; reusing or copying the target is not runtime evidence. Paths resolve relative to the receipt; absolute local paths also work. Compute hashes from actual files with the host's tools—never invent them. Include every affected input that could invalidate the visual result, not just one convenient file.
47
+
48
+ Declare `platform: "web"`, `"ios"` or `"android"` according to the implemented surface. A browser imitation cannot verify iOS/Android UI; native checks require simulator/device evidence. A missing native runner leaves those checks blocked even if a browser mockup looks correct.
49
+
50
+ An `interaction` check needs an image and nonempty `steps`. A `motion` check needs a saved video and `steps`; watch it at normal speed and inspect the relevant transitions. Record `status: "blocked"` or `"fail"` and the reason in `observed` when verification cannot complete.
51
+
52
+ ## Check integrity when execution is available
53
+
54
+ If the host permits local Node execution, run the bundled helper using its actual installed path:
55
+
56
+ ```sh
57
+ node /path/to/installed-skill/scripts/verify-visual-evidence.mjs /path/to/visual-evidence.json
58
+ ```
59
+
60
+ It reads local files only. It rejects missing/stale files, incomplete declared checks, unresolved issues, non-media placeholders and motion claims backed only by stills. It does not execute project code, install dependencies, upload evidence, judge aesthetics, or prove that the agent inspected the pixels. If execution is unavailable, retain the same receipt and inspect the links manually; report that integrity validation did not run.
61
+
62
+ Later source/style/asset or target changes invalidate affected checks. Re-render, reinspect, then update the hashes; changing a hash alone is not revalidation. A passing script is evidence integrity, never a substitute for the visual comparison. In the handoff, link the receipt and relevant captures, state the covered states/sizes, and name remaining limitations. Do not claim a complete visual pass while required evidence is blocked or missing.
@@ -0,0 +1,108 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { readFileSync, realpathSync } from 'node:fs';
3
+ import { dirname, resolve } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ // Checks local evidence integrity and coverage, not visual quality or whether a
7
+ // person/agent actually inspected the pixels. No network, installs, or writes.
8
+ export function verifyVisualEvidence(receiptPath) {
9
+ const errors = [];
10
+ let checkedFiles = 0;
11
+ const fail = message => errors.push(message);
12
+ const nonempty = value => typeof value === 'string' && value.trim().length > 0;
13
+ const positive = value => Number.isInteger(value) && value > 0;
14
+ const base = dirname(resolve(receiptPath));
15
+ function artifact(value, label, media = false) {
16
+ if (!value || !nonempty(value.path) || /^[a-z][a-z0-9+.-]*:\/\//i.test(value.path)
17
+ || !/^[a-f0-9]{64}$/.test(value.sha256 || '')) {
18
+ fail(`${label}: supply a local path and its actual SHA-256.`);
19
+ return;
20
+ }
21
+ try {
22
+ const bytes = readFileSync(resolve(base, value.path));
23
+ checkedFiles++;
24
+ if (!bytes.length || createHash('sha256').update(bytes).digest('hex') !== value.sha256) {
25
+ fail(`${label}: file is empty or changed; recapture/review and update the receipt.`);
26
+ }
27
+ if (media) {
28
+ const image = bytes.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))
29
+ || bytes.subarray(0, 3).equals(Buffer.from([255, 216, 255]))
30
+ || (bytes.toString('ascii', 0, 4) === 'RIFF' && bytes.toString('ascii', 8, 12) === 'WEBP');
31
+ const video = bytes.toString('ascii', 4, 8) === 'ftyp'
32
+ || bytes.subarray(0, 4).equals(Buffer.from([0x1a, 0x45, 0xdf, 0xa3]));
33
+ if (!(value.kind === 'image' ? image : value.kind === 'video' && video)) {
34
+ fail(`${label}: expected a PNG/JPEG/WebP image or MP4/MOV/WebM video matching kind.`);
35
+ }
36
+ }
37
+ } catch {
38
+ fail(`${label}: local file cannot be read.`);
39
+ }
40
+ }
41
+ let receipt;
42
+ try { receipt = JSON.parse(readFileSync(resolve(receiptPath), 'utf8')); }
43
+ catch { return { ok: false, errors: ['Receipt must be a readable JSON file.'], checkedFiles }; }
44
+ if (!receipt || typeof receipt !== 'object' || Array.isArray(receipt)) {
45
+ return { ok: false, errors: ['Receipt must be a JSON object.'], checkedFiles };
46
+ }
47
+ if (receipt.schemaVersion !== 'uizze.visual-evidence.v1') fail('Unsupported receipt schemaVersion.');
48
+ if (!nonempty(receipt.scope)) fail('Name the surface and change being verified.');
49
+ if (!['web', 'ios', 'android'].includes(receipt.platform)) fail('Declare the implemented platform: web, ios, or android.');
50
+ if (!Array.isArray(receipt.sources) || !receipt.sources.length) fail('Record the affected source files, including styles/assets that determine this render.');
51
+ else receipt.sources.forEach((file, index) => artifact(file, `sources[${index}]`));
52
+ if (!['target', 'existing-system'].includes(receipt.comparison)) fail('comparison must be target or existing-system.');
53
+ if (receipt.comparison === 'target') {
54
+ artifact(receipt.target, 'target', true);
55
+ if (receipt.target?.kind !== 'image') fail('The comparison target must be an image.');
56
+ }
57
+ if (!Array.isArray(receipt.unresolved) || receipt.unresolved.length) fail('List unresolved issues; a nonempty list cannot pass.');
58
+ const required = Array.isArray(receipt.requiredChecks) ? receipt.requiredChecks : [];
59
+ const checks = Array.isArray(receipt.checks) ? receipt.checks : [];
60
+ if (!required.length) fail('Define requiredChecks before claiming coverage.');
61
+ if (new Set(required.map(check => check?.id)).size !== required.length) fail('Required check IDs must be unique.');
62
+ if (new Set(checks.map(check => check?.id)).size !== checks.length) fail('Check results must have unique IDs.');
63
+ for (const requirement of required) {
64
+ if (!nonempty(requirement?.id) || !['visual', 'interaction', 'motion'].includes(requirement.kind)) {
65
+ fail('Each required check needs an id and kind: visual, interaction, or motion.'); continue;
66
+ }
67
+ const check = checks.find(value => value?.id === requirement.id);
68
+ if (!check) { fail(`${requirement.id}: missing check result.`); continue; }
69
+ if (check.status !== 'pass') fail(`${requirement.id}: ${check.status || 'unknown'} is not a pass.`);
70
+ if (!nonempty(check.observed) || !nonempty(check.state)) fail(`${requirement.id}: record the actual state and observed comparison/behavior.`);
71
+ if (!['browser', 'simulator', 'device'].includes(check.environment?.kind)
72
+ || !nonempty(check.environment?.name) || !positive(check.environment?.width) || !positive(check.environment?.height)) {
73
+ fail(`${requirement.id}: record browser/device and actual viewport dimensions.`);
74
+ }
75
+ if (['ios', 'android'].includes(receipt.platform) && check.environment?.kind === 'browser') {
76
+ fail(`${requirement.id}: browser evidence cannot verify a native interface; use simulator/device evidence or keep the check blocked.`);
77
+ }
78
+ const artifacts = Array.isArray(check.artifacts) ? check.artifacts : [];
79
+ const requiredKind = requirement.kind === 'motion' ? 'video' : 'image';
80
+ if (!artifacts.some(file => file?.kind === requiredKind)) fail(`${requirement.id}: missing ${requiredKind} evidence.`);
81
+ artifacts.forEach((file, index) => artifact(file, `${requirement.id}.artifacts[${index}]`, true));
82
+ if (receipt.comparison === 'target' && nonempty(receipt.target?.path)) {
83
+ for (const file of artifacts) {
84
+ if (!nonempty(file?.path)) continue;
85
+ try {
86
+ if (realpathSync(resolve(base, file.path)) === realpathSync(resolve(base, receipt.target.path))) {
87
+ fail(`${requirement.id}: the target file is not a rendered-result capture; retain independent evidence.`);
88
+ }
89
+ } catch { /* Missing files are reported by artifact(). */ }
90
+ }
91
+ }
92
+ if (requirement.kind !== 'visual' && (!Array.isArray(check.steps) || !check.steps.length || !check.steps.every(nonempty))) {
93
+ fail(`${requirement.id}: record the interaction steps actually exercised.`);
94
+ }
95
+ }
96
+ for (const check of checks) {
97
+ if (!required.some(requirement => requirement?.id === check?.id)) fail('Every result must correspond to a declared required check.');
98
+ }
99
+ return { ok: errors.length === 0, scope: receipt.scope, errors, checkedFiles,
100
+ note: 'Validates local artifact integrity and declared coverage. It does not judge UI quality or prove visual inspection.' };
101
+ }
102
+
103
+ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
104
+ const result = process.argv[2] ? verifyVisualEvidence(process.argv[2])
105
+ : { ok: false, errors: ['Usage: node verify-visual-evidence.mjs /path/to/visual-evidence.json'] };
106
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
107
+ process.exitCode = result.ok ? 0 : 1;
108
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ia-ccun/code-agent-cli",
3
- "version": "0.0.59-beta.5",
3
+ "version": "0.0.59-beta.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -36,10 +36,10 @@
36
36
  "prepare": "husky"
37
37
  },
38
38
  "dependencies": {
39
- "@earendil-works/pi-agent-core": "1.6.0",
40
- "@earendil-works/pi-ai": "1.6.0",
41
- "@earendil-works/pi-coding-agent": "1.6.0",
42
- "@earendil-works/pi-tui": "1.6.0"
39
+ "@earendil-works/pi-agent-core": "1.6.1",
40
+ "@earendil-works/pi-ai": "1.6.1",
41
+ "@earendil-works/pi-coding-agent": "1.6.1",
42
+ "@earendil-works/pi-tui": "1.6.1"
43
43
  },
44
44
  "overrides": {
45
45
  "glob": "^11.0.0",
@@ -1,165 +0,0 @@
1
- ---
2
- name: chroma-local
3
- description: Use when the user needs self-hosted or local Chroma for semantic search, including `ChromaClient`, `HttpClient`, or Python `EphemeralClient`, local persistence, Docker or `chroma run`, or OSS Chroma without Chroma Cloud features.
4
- ---
5
-
6
- ## Instructions
7
-
8
- Determine these before writing code. Prefer discovering them from the repo and the user request. Ask only when the choice materially changes the implementation.
9
-
10
- 1. **Runtime shape**
11
- - Are they connecting to a running local server, embedding Chroma into tests, or setting up local development from scratch?
12
- - Decide whether they need `chroma run`, a Docker or service command, `HttpClient` or `ChromaClient`, or Python `EphemeralClient`.
13
-
14
- 2. **Persistence**
15
- - Persistent local data: choose an intentional data path.
16
- - Disposable test data: use defaults or a temp directory.
17
-
18
- 3. **Embedding model**
19
- - Reuse the app's existing embedding provider when possible.
20
- - Otherwise default to `@chroma-core/default-embed` in TypeScript or the standard local default in Python.
21
- - If the user explicitly wants OpenAI embeddings in TypeScript, install and use `@chroma-core/openai`.
22
-
23
- 4. **Indexed data shape**
24
- - Determine what is being indexed, how it should be chunked, and what metadata is needed for filtering and updates.
25
-
26
- ## Routing
27
-
28
- - **Existing local server**
29
- - Confirm host and port before changing client code.
30
- - Validate the server is reachable before assuming collections are missing.
31
-
32
- - **Fresh local development**
33
- - Add a local startup path such as `chroma run` or the repo's existing Docker or service command.
34
- - Default to `localhost:8000` unless the repo already uses another address.
35
-
36
- - **Python tests or disposable local workflows**
37
- - Prefer `EphemeralClient` when persistence is unnecessary.
38
- - Call out that data is lost when the process exits.
39
-
40
- - **Persistent local development**
41
- - Use a stable data path and make persistence explicit in code or config.
42
- - Do not silently switch between ephemeral and persistent modes.
43
-
44
- - **Search integration work**
45
- - Use `getOrCreateCollection()` in TypeScript or `get_or_create_collection()` in Python.
46
- - Design document IDs and metadata so upserts and deletes are straightforward.
47
- - Batch writes when syncing large datasets.
48
-
49
- ## Ask vs proceed
50
-
51
- **Ask first:**
52
- - Embedding model choice (cost and quality implications)
53
- - Whether they need persistent local data
54
- - How they are starting the local server
55
- - Multi-tenant data isolation strategy
56
-
57
- **Proceed with sensible defaults:**
58
- - Use `getOrCreateCollection()` (TypeScript) / `get_or_create_collection()` (Python)
59
- - Use cosine similarity (most common)
60
- - Chunk size under 8KB
61
- - Store source IDs in metadata for updates/deletes
62
- - Use a local server on `localhost:8000` unless the repo already configures another address or is using Python `EphemeralClient`
63
-
64
- ## What to validate
65
-
66
- - Correct client import (`ChromaClient`, `HttpClient`, or `Client`)
67
- - Embedding function package is installed (TypeScript)
68
- - Local server is reachable before assuming collections are missing
69
- - Local path and persistence mode are intentional
70
-
71
- ## Implementation notes
72
-
73
- - Local Chroma is the right default for development, tests, and self-hosted deployments.
74
- - OSS Chroma does not include Chroma Cloud-only features such as `Schema()` and `Search()`.
75
- - If the user asks for hybrid dense and sparse retrieval, treat that as a likely Chroma Cloud requirement unless the repo already implements an OSS workaround.
76
- - For open source Chroma, dense retrieval with a single embedding function is the normal baseline.
77
-
78
- ## Minimal patterns
79
-
80
- Start a local Chroma server when the repo needs one:
81
-
82
- ```bash
83
- chroma run
84
- ```
85
-
86
- Default address: `localhost:8000`.
87
-
88
- TypeScript local client:
89
-
90
- ```typescript
91
- import { ChromaClient } from 'chromadb';
92
- import { DefaultEmbeddingFunction } from '@chroma-core/default-embed';
93
-
94
- const client = new ChromaClient();
95
-
96
- const embeddingFunction = new DefaultEmbeddingFunction();
97
- const collection = await client.getOrCreateCollection({
98
- name: 'my_collection',
99
- embeddingFunction,
100
- });
101
-
102
- // Add documents
103
- await collection.add({
104
- ids: ['doc1', 'doc2'],
105
- documents: ['First document text', 'Second document text'],
106
- });
107
-
108
- // Query
109
- const results = await collection.query({
110
- queryTexts: ['search query'],
111
- nResults: 5,
112
- });
113
- ```
114
-
115
- Python local client:
116
-
117
- ```python
118
- import chromadb
119
-
120
- client = chromadb.HttpClient(host="localhost", port=8000)
121
-
122
- collection = client.get_or_create_collection(name="my_collection")
123
-
124
- # Add documents
125
- collection.add(
126
- ids=["doc1", "doc2"] ,
127
- documents=["First document text", "Second document text"],
128
- )
129
-
130
- # Query
131
- results = collection.query(
132
- query_texts=["search query"],
133
- n_results=5,
134
- )
135
- ```
136
-
137
- ## Learn More
138
-
139
- Fetch Chroma's `llms.txt` only when you need API or product details that are not already in the repo or this skill: https://docs.trychroma.com/llms.txt
140
-
141
- ## Available Topics
142
-
143
- ### Typescript
144
-
145
- - [Chroma Regex Filtering](./regex/typescript.md) - Learn how to use regex filters in Chroma queries
146
- - [Query and Get](./querying/typescript.md) - Query and Get Data from Chroma Collections
147
- - [Metadata](./metadata/typescript.md) - Store and query metadata, including filters and array values
148
- - [Updating and Deleting](./updating-deleting/typescript.md) - Update existing documents and delete data from collections
149
- - [Error Handling](./error-handling/typescript.md) - Handling errors and failures when working with Chroma
150
- - [Local Chroma](./local-chroma/typescript.md) - How to run and use local chroma
151
-
152
- ### Python
153
-
154
- - [Chroma Regex Filtering](./regex/python.md) - Learn how to use regex filters in Chroma queries
155
- - [Query and Get](./querying/python.md) - Query and Get Data from Chroma Collections
156
- - [Metadata](./metadata/python.md) - Store and query metadata, including filters and array values
157
- - [Updating and Deleting](./updating-deleting/python.md) - Update existing documents and delete data from collections
158
- - [Error Handling](./error-handling/python.md) - Handling errors and failures when working with Chroma
159
- - [Local Chroma](./local-chroma/python.md) - How to run and use local chroma
160
-
161
- ## General
162
-
163
- - [Data Model](./data-model.md) - An overview of how Chroma stores data
164
- - [Integrating Chroma into an existing system](./understanding-a-codebase.md) - Guidance for adding Chroma search to an existing application
165
- - [Chroma CLI](./cli.md) - Starting and managing a local open source Chroma server from the CLI
@@ -1,48 +0,0 @@
1
- ---
2
- name: Chroma CLI
3
- description: Starting and managing a local open source Chroma server from the CLI
4
- ---
5
-
6
- ## Chroma CLI
7
-
8
- The Chroma CLI can also be used for local open source Chroma workflows. This topic focuses on starting and managing a local server, not Chroma Cloud account setup.
9
-
10
- ### Install
11
-
12
- ```bash
13
- pip install chromadb
14
- ```
15
-
16
- ### Start a local server
17
-
18
- Run Chroma locally on the default address:
19
-
20
- ```bash
21
- chroma run
22
- ```
23
-
24
- This starts a server on `localhost:8000`.
25
-
26
- ### Choose a persistent data directory
27
-
28
- Store local data in a specific path instead of the default working directory:
29
-
30
- ```bash
31
- chroma run --path ./chroma-data
32
- ```
33
-
34
- ### Change the port
35
-
36
- If another process already uses port `8000`, pick another one:
37
-
38
- ```bash
39
- chroma run --port 8001
40
- ```
41
-
42
- Update your client code to match the chosen host and port.
43
-
44
- ### Local workflow tips
45
-
46
- - Use a dedicated data directory per environment so dev and test data do not mix.
47
- - In tests, use disposable directories or clear collections between runs.
48
- - Check that the server is running before debugging client-side collection errors.
@@ -1,103 +0,0 @@
1
- ---
2
- name: Data Model
3
- description: An overview of how Chroma stores data
4
- ---
5
-
6
- ## Data Model
7
-
8
- Use this reference when designing collection layout, chunking, IDs, metadata, and filtering for Chroma.
9
-
10
- ### Core concepts
11
-
12
- **Collections** are the top-level containers, similar to tables in a relational database. Each collection has its own embedding configuration and indexes.
13
-
14
- **Documents** are the searchable units within a collection. Each document has:
15
- - **ID** - A unique string identifier
16
- - **Content** - The text that gets embedded and searched
17
- - **Embedding** - The vector representation
18
- - **Metadata** - Key-value pairs for filtering
19
-
20
- ## Chunking
21
-
22
- Most real-world data is too large to fit in a single document. Chunking splits content into searchable pieces.
23
-
24
- ### Chunking strategy
25
-
26
- **Recommended chunk size:** Keep chunks comfortably below product limits and small enough to preserve search precision and context. Generally, 8KB or less is a good default starting point.
27
-
28
- **Good chunking preserves meaning:**
29
- - Split at natural boundaries (paragraphs, sentences, sections)
30
- - Don't cut mid-sentence or mid-word
31
- - Include enough context for the chunk to be meaningful on its own
32
-
33
- **Determine from the repo or ask if ambiguous:**
34
- - What type of content are they indexing?
35
- - Are there natural boundaries (chapters, sections, records)?
36
- - How much context does a search result need to be useful?
37
-
38
- ### Tracking chunks with metadata
39
-
40
- When a single source document becomes multiple chunks, use metadata to track the relationship:
41
-
42
- ```
43
- {
44
- "source_id": "post-123", // ID in the primary database
45
- "source_type": "blog_post", // Type of content
46
- "chunk_index": 0, // Position in sequence
47
- "total_chunks": 3 // Total chunks from this source
48
- }
49
- ```
50
-
51
- This approach is better than encoding information in the document ID because:
52
- - IDs can be simple UUIDs
53
- - Metadata is filterable
54
- - Updates and deletes are easier (filter by `source_id`)
55
-
56
- ## Collection organization
57
-
58
- For multi-tenant applications, separate collections per tenant are a strong default when isolation, deletion, and search quality matter more than minimizing collection count.
59
-
60
- **Why this works better:**
61
- - Nearest neighbor search is more accurate with fewer candidates
62
- - Lower latency with smaller collections
63
- - Natural isolation between tenants
64
- - Easy to delete all tenant data by dropping the collection
65
-
66
- **Example:** A knowledge base SaaS might have collections like `kb_customer_123`, `kb_customer_456`, etc.
67
-
68
- **Determine from the repo or ask if ambiguous:** What's the smallest logical unit of data isolation in their application?
69
-
70
- ## Filtering
71
-
72
- Metadata filtering reduces the candidate set before vector search runs, making queries faster and more precise.
73
-
74
- ### Filter operators
75
-
76
- | Operator | Description | Types |
77
- |----------|-------------|-------|
78
- | `$eq` | Equal (default) | string, int, bool |
79
- | `$ne` | Not equal | string, int, bool |
80
- | `$gt`, `$gte` | Greater than (or equal) | int |
81
- | `$lt`, `$lte` | Less than (or equal) | int |
82
- | `$in` | In list | string, int |
83
- | `$nin` | Not in list | string, int |
84
- | `$and`, `$or` | Logical combinators | filter arrays |
85
- | `$contains`, `$not_contains` | Check within arrays | arrays of string, int, bool |
86
-
87
- ### Document content filtering
88
-
89
- Beyond metadata, you can filter on the document text itself using `where_document`:
90
- - `$contains` - Full-text substring search
91
- - `$regex` - Regular expression matching
92
-
93
- ## Dense vs sparse vectors
94
-
95
- **Dense vectors** (default) are produced by neural embedding models. They capture semantic meaning, so "car" and "automobile" will be similar.
96
-
97
- **Sparse vectors** (BM25, SPLADE) are high-dimensional but mostly zeros. They excel at exact keyword matching.
98
-
99
- **Hybrid search** combines both, often outperforming either alone. Chroma Cloud supports hybrid search through the Schema and Search APIs.
100
-
101
- ### Important note
102
-
103
- When creating collections, `get_or_create_collection()` accepts either an `embedding_function` OR a `schema`, but not both. Use Schema when you need multiple indexes or sparse embeddings.