sb-manage-data
Skill1 starsChanged 40 days agoApache-2.0View on GitHub
Upload, reference, and manage data files (CSV, JSON, TSV) for Vega/Vega-Lite diagrams in a Stable Baseline document. Use when user wants to upload data files, create charts with data, or run sb-manage-data.
In this repository14 other files it gives its agents.
- sb-agentSkill
- sb-connectSkill
- sb-create-diagramSkill
- sb-create-docSkill
- sb-create-whiteboardSkill
- sb-dashboardSkill
- sb-databaseSkill
- sb-edit-docSkill
- sb-edit-whiteboardSkill
- sb-manage-imagesSkill
- sb-searchSkill
- sb-setupSkill
- sb-syncSkill
- sb-updateSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 0 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
If you don't know the documentId: use listWorkspaces, then listProjects, then listDocuments or getProjectHierarchy to find it.
- Very specific: line 19
Call createVegaDataUploadSession with { documentId, fileName }.
- Very specific: line 24
PUT the raw file bytes to uploadUrl with header Content-Type: <contentType>.
- Very specific: line 27
Use the assetUrl in your Vega or Vega-Lite spec:
- Very specific: line 52
Update any existing Vega/Vega-Lite diagrams to point to the new assetUrl:
- Very specific: line 53
Call getDocument to find DIAGRAM_OMITTED markers.
- Very specific: line 54
Call getDiagramInDocument to read the current spec.
- Very specific: line 55
Call updateDiagramInDocument with updated diagramCode referencing the new assetUrl.
- Very specific: line 56
Delete the old data file with deleteVegaDataFile.
- Very specific: line 63
ALWAYS upload data files via createVegaDataUploadSession + PUT.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stable Baseline: Manage Data Files
Manage data files for Vega/Vega-Lite diagrams in a Stable Baseline document.
If you don't know the documentId: use listWorkspaces, then listProjects, then listDocuments or getProjectHierarchy to find it. Or read .sb/config.json for cached IDs.
Data files are sidebar attachments: they are NOT embedded in the document body. They are referenced by URL in Vega/Vega-Lite diagram specs.
Supported formats: CSV (.csv), JSON (.json), TSV (.tsv), plain text (.txt). Max 10MB.
Uploading a data file and creating a Vega diagram
- Call
createVegaDataUploadSessionwith{ documentId, fileName }.- Content type is auto-detected from the file extension (.csv becomes text/csv, etc.).
- You can override with the
contentTypeparameter if needed. It returnsuploadUrlandassetUrl.
- PUT the raw file bytes to
uploadUrlwith headerContent-Type: <contentType>.- The URL is single-use and expires in 5 minutes.
- Use the
assetUrlin your Vega or Vega-Lite spec:{ "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": { "url": "<assetUrl>" }, "mark": "bar", "encoding": { ... } } - Call
insertDiagramInDocumentwith:type: the Vega or Vega-Lite diagram type (checklistDiagramTypesfor the exact type name)diagramCode: the JSON spec referencing the assetUrldocumentId,documentVersionTimestamp(fromgetDocument)afterLine,prompt,nlDescription, etc.
Deleting a data file
- Call
deleteVegaDataFilewith{ documentId, attachmentId }. - This removes the storage file and database record.
- NOTE: Any diagrams referencing the deleted file's
assetUrlwill break. Update or remove those diagrams first.
Replacing a data file
- Upload the new file using the upload-session flow above (step 1-2).
- Update any existing Vega/Vega-Lite diagrams to point to the new
assetUrl:- Call
getDocumentto find DIAGRAM_OMITTED markers. - Call
getDiagramInDocumentto read the current spec. - Call
updateDiagramInDocumentwith updateddiagramCodereferencing the new assetUrl.
- Call
- Delete the old data file with
deleteVegaDataFile.
Multiple data files in one diagram
A single Vega spec can reference multiple data sources. Upload each file separately, then reference all their assetUrls in the spec.
Hard rules:
- ALWAYS upload data files via
createVegaDataUploadSession+ PUT. Never embed large datasets inline in diagram code. - The
assetUrlis permanent and JWT-authenticated: it requires a valid user session to access. - Data files are NOT part of the document body. They won't appear in
getDocumentoutput. - Clean up unused data files with
deleteVegaDataFileto avoid orphaned storage.
Reference:
sb://diagram-typesto find exact Vega/Vega-Lite type namessb://cdmd-guidefor document syntax
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

