sb-sync
Skill1 starsChanged 40 days agoApache-2.0View on GitHub
Generate or update the Stable Baseline section in AGENTS.md for cross-IDE auto-sync. Preserves all existing AGENTS.md content. Use when user wants to sync AGENTS.md, regenerate sync rules, or run sb-sync.
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-dataSkill
- sb-manage-imagesSkill
- sb-searchSkill
- sb-setupSkill
- sb-updateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 9 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Add or update the Stable Baseline section in the repository's AGENTS.md file.
- Very specific: line 11
If you don't have IDs yet, read .sb/config.json or call listWorkspaces then listProjects to discover them.
- Distinctive: line 14
If AGENTS.md already exists, READ IT FIRST.
- Distinctive: line 15
ONLY append or update the "Stable Baseline: Documentation Sync" section.
- Distinctive: line 16
If that section already exists from a previous run, update it in-place.
- Distinctive: line 18
If AGENTS.md does not exist, create a new file with ONLY the Stable Baseline section below (do not invent other rules).
- Distinctive: line 20
BEFORE writing the section, you MUST analyse the repository to understand:
- Very specific: line 65
Read .sb/config.json to get workspaceId, projectId, AND the cache object
- Very specific: line 66
Look up the target document in cache.documents by title
- Very specific: line 67
Cache HIT: Call getDocument directly with the cached document ID (skip getProjectHierarchy entirely)
- Very specific: line 68
Cache MISS or 404: Call getProjectHierarchy to find the document, then update cache.documents with the discovered ID so future syncs are …
- Very specific: line 69
Read the document's current content and get its versionTimestamp
- Very specific: line 71
Call editDocument with targeted patches (NOT full rewrites)
- Very specific: line 72
If no matching document exists, call createDocument in the appropriate folder, then add it to cache.documents
- Very specific: line 73
Update cache.lastUpdated in .sb/config.json with the current ISO 8601 timestamp
- Very specific: line 81
Use sb tools for ALL document, folder, diagram, and image operations
- Very specific: line 82
NEVER manually write or edit DIAGRAM_OMITTED, IMAGE_OMITTED, or <!-- DIAGRAM: ...
- Very specific: line 83
ALWAYS call getDocument before editDocument (versionTimestamp is required for optimistic locking)
- Distinctive: line 84
Create documents first, THEN insert diagrams/images with dedicated tools
- Very specific: line 86
Prefer editDocument with small patches over full document rewrites
- Distinctive: line 94
Document the "why" behind decisions, not just the "what"
- Distinctive: line 97
Every document should be immediately useful to a developer joining tomorrow
≈ “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: Sync AGENTS.md
Add or update the Stable Baseline section in the repository's AGENTS.md file. This is the cross-IDE standard for agent instructions: it works in Cursor, VS Code Copilot, Claude Code, OpenCode, Windsurf, Zed, Warp, Roo Code, Aider, and all other AGENTS.md-compatible tools.
If you don't have IDs yet, read .sb/config.json or call listWorkspaces then listProjects to discover them.
CRITICAL (PRESERVE EXISTING CONTENT):
- If
AGENTS.mdalready exists, READ IT FIRST. You MUST NOT remove, replace, or overwrite ANY existing content. - ONLY append or update the "Stable Baseline: Documentation Sync" section.
- If that section already exists from a previous run, update it in-place. Leave all other sections untouched.
- A section from an older version of this plugin has the same heading with a long dash in place of the colon: it is this section. Update it in place and give it this heading; never add a second one.
- If
AGENTS.mddoes not exist, create a new file with ONLY the Stable Baseline section below (do not invent other rules).
BEFORE writing the section, you MUST analyse the repository to understand:
- What languages, frameworks, and tools are used
- What the key directories and file patterns are
- What areas of the codebase are architecturally significant
- What existing documentation exists in Stable Baseline (call
getProjectHierarchy)
Then generate the Stable Baseline section with ALL of the following sub-sections:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SECTION 1: Project Documentation Link ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Under the heading ## Stable Baseline: Documentation Sync, state that this project's documentation lives in Stable Baseline.
Include the workspaceId, projectId, and MCP server name (sb).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SECTION 2: Auto-Sync Rules ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This is the CRITICAL section. Create a table mapping file patterns to documentation actions.
The agent reading this file must know: "When I change file X, I need to update document Y in Stable Baseline."
Rules for building the table:
- File patterns MUST be specific to THIS repo (based on your analysis)
- Map each pattern to the specific Stable Baseline document that covers it
- Include the action:
editDocumentfor updates,createDocumentfor new docs - Cover ALL architecturally significant areas
Categories to consider (include only what's relevant to THIS repo):
- Architecture changes: system design files, service boundaries, API schemas
- Security changes: auth config, authorization rules, secrets management
- Data model changes: migrations, schema files, ORM models
- Infrastructure changes: Dockerfiles, CI/CD configs, IaC templates, deploy scripts
- API contract changes: OpenAPI specs, protobuf, GraphQL schemas, route definitions
- Dependency changes: package.json, go.mod, Cargo.toml, requirements.txt
- Configuration changes: environment configs, feature flags, build configs
- Business logic changes: core domain logic, business rules, workflow definitions
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SECTION 3: Sync Workflow ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Explain the step-by-step workflow the agent must follow when a sync trigger fires:
- Read
.sb/config.jsonto get workspaceId, projectId, AND thecacheobject - Look up the target document in
cache.documentsby title- Cache HIT: Call
getDocumentdirectly with the cached document ID (skipgetProjectHierarchyentirely) - Cache MISS or 404: Call
getProjectHierarchyto find the document, then updatecache.documentswith the discovered ID so future syncs are fast
- Cache HIT: Call
- Read the document's current content and get its
versionTimestamp - Determine what changed and how the documentation should be updated
- Call
editDocumentwith targeted patches (NOT full rewrites) - If no matching document exists, call
createDocumentin the appropriate folder, then add it tocache.documents - Update
cache.lastUpdatedin.sb/config.jsonwith the current ISO 8601 timestamp
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SECTION 4: MCP Tool Rules ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Include these universal rules:
- Use
sbtools for ALL document, folder, diagram, and image operations - NEVER manually write or edit
DIAGRAM_OMITTED,IMAGE_OMITTED, or<!-- DIAGRAM: ... -->markers - ALWAYS call
getDocumentbeforeeditDocument(versionTimestamp is required for optimistic locking) - Create documents first, THEN insert diagrams/images with dedicated tools
- For bulk text substitutions use
findAndReplaceTextInDocument - Prefer
editDocumentwith small patches over full document rewrites
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SECTION 5: Documentation Principles ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Include a brief section on documentation philosophy:
- Document the "why" behind decisions, not just the "what"
- Technical and business documentation must be consistent and reference each other
- Documentation should prevent architectural drift by recording rationale
- Every document should be immediately useful to a developer joining tomorrow
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SECTION 6: Resources ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
List the MCP resources:
sb://cdmd-guide: CDMD syntax referencesb://diagram-types: Available diagram types and their rendererssb://server-info: Server capabilities, tools, and promptssb://projects/{projectId}/hierarchy: Project folder/document structure
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
OUTPUT: If AGENTS.md already exists, read it first, then output the UPDATED file preserving ALL existing content and appending/updating ONLY the Stable Baseline section. If it does not exist, output a new file containing ONLY the Stable Baseline section. The Stable Baseline section must be self-contained: an agent reading it with zero prior context must understand what to do.
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.

