sb-setup
Skill1 starsChanged 40 days agoApache-2.0View on GitHub
Onboard a repository into Stable Baseline: discover IDs, analyse the repo, create a bespoke documentation structure, and augment AGENTS.md with sync rules. Use when user wants to set up Stable Baseline, onboard a project, generate initial documentation, or run sb-setup.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- strongeron/storybook-workbenchtheir own version, first seen Jun 16, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- strongeron/storybook-workbench★ 37same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
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-syncSkill
- sb-updateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
35 rules. About 0 are common, 22 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈22
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 14
Follow every step in order.
- Very specific: line 20
Test the connection by calling listWorkspaces.
- Very specific: line 22
If the call FAILS (error, timeout, auth failure, or tool not found): Then STOP.
- Distinctive: line 27
Follow the setup guide: https://stablebaseline.io/docs/mcp/setup
- Distinctive: line 32
If the call SUCCEEDS, the connection is working.
- Very specific: line 80
Create .sb/config.json in the repository root:
- Very specific: line 104
Add .sb/ to .gitignore if not already present.
- Very specific: line 110
Call getProjectHierarchy with the projectId from Step 2 to check if documentation already exists.
- Distinctive: line 123
Wait for the user to choose before proceeding.
- Distinctive: line 125
If the user chooses Augment:
- Distinctive: line 131
If the user chooses Replace:
- Very specific: line 132
Delete all existing folders and documents (call deleteFolder for root folders, deleteDocument for root-level documents).
- Distinctive: line 135
If the user chooses Cancel:
- Very specific: line 136
STOP. Tell the user: "No changes made.
- Distinctive: line 137
Do NOT proceed to any further steps.
- Distinctive: line 143
Before creating any documentation, you MUST deeply understand this repository.
- Very specific: line 158
Read key files: README, package.json/Cargo.toml/go.mod/etc., config files, directory listings, a sample of core source files.
- Distinctive: line 174
Drift Prevention: Document the "why" behind every significant decision so future developers don't deviate without understanding the …
- Distinctive: line 177
Create folders and nesting that match THIS repo's natural boundaries
- Distinctive: line 179
Every document must have a clear purpose: no placeholder docs
- Distinctive: line 181
Do NOT create generic folders like "Miscellaneous" or "Other"
- Distinctive: line 182
Keep nesting shallow (3 levels max) unless the repo is genuinely complex
- Very specific: line 190
Call createFolder for each folder (use parentId for nesting).
- Very specific: line 192
Call createDocument for each document with substantive CDMD content.
- Distinctive: line 193
Write REAL content based on what you learned in Step 5.
- Very specific: line 194
Use the CDMD format (call sb://cdmd-guide resource if unsure of syntax).
- Very specific: line 195
Do NOT include DIAGRAM or IMAGE markers in the cdmd body.
- Distinctive: line 197
After creating EACH document, you MUST generate diagrams.
- Distinctive: line 199
Diagram generation is MANDATORY: Every document that covers architecture, data flow, system design, component relationships, API contracts, …
- Distinctive: line 208
Write documents that are immediately useful.
- Distinctive: line 220
Read the entire file first.
- Distinctive: line 222
If a "Stable Baseline" section already exists from a previous run, update ONLY that section in-place.
- Distinctive: line 225
Create it with the Stable Baseline section below.
- Distinctive: line 267
When done, provide a summary:
- Very specific: line 276
After the summary, update .sb/config.json cache.lastUpdated to the current ISO 8601 timestamp.
≈ “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: Project Setup
You are connected to the Stable Baseline MCP server. Your job is to fully onboard this repository.
IMPORTANT (Tool Usage):
All MCP tools (listWorkspaces, listProjects, getProjectHierarchy, createFolder, createDocument, insertDiagramInDocument, etc.) are ALREADY available. Call them directly by name. Do NOT use searchTools to discover or activate them: searchTools is a convenience meta-tool, not an activation mechanism. If a tool call fails with "tool not found", retry the call directly: do NOT search for alternatives.
Follow every step in order. Do NOT skip any step. Steps 1 and 2 are PREREQUISITES: if either fails, STOP and tell the user what to fix. Do NOT continue to Step 3+.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 1: Verify MCP connection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Test the connection by calling listWorkspaces.
If the call FAILS (error, timeout, auth failure, or tool not found):
Then STOP. Tell the user exactly this:
"The Stable Baseline MCP server (sb) is not connected or not authenticated.
What to do:
- Follow the setup guide: https://stablebaseline.io/docs/mcp/setup
- Once the MCP connection is configured and working, come back here and type continue." Then wait for the user to say "continue" (or equivalent). When they do, restart from Step 1. Then do NOT proceed to any further steps until the connection succeeds.
If the call SUCCEEDS, the connection is working. Continue to Step 2.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 2: Resolve workspace and project ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Using the result from Step 1:
a) No workspaces returned (empty list): Then STOP. Tell the user exactly this: "No workspaces found on your Stable Baseline account.
**What to do:**
1. Go to https://app.stablebaseline.io/ and create a workspace (and a project inside it).
2. Once done, come back here and type **continue**."Then wait for the user to say "continue" (or equivalent). When they do, restart from Step 2. Then do NOT proceed until workspaces exist.
b) Multiple workspaces returned: Then ASK the user which workspace to use. List them by name. Wait for their answer before continuing.
c) Exactly one workspace: Then use it automatically.
Once you have a workspaceId, call listProjects with that workspaceId:
d) No projects returned (empty list): Then STOP. Tell the user exactly this: "No projects found in this workspace.
**What to do:**
1. Go to https://app.stablebaseline.io/ and create a project in your workspace.
2. Once done, come back here and type **continue**."Then wait for the user to say "continue" (or equivalent). When they do, re-call listProjects and continue from Step 2d.
Then do NOT proceed until a project exists.
e) Multiple projects returned: Then ASK the user which project to use. List them by name. Wait for their answer before continuing.
f) Exactly one project: Then use it automatically.
Store the workspaceId and projectId: you will need them for every subsequent call.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 3: Create local config ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Create .sb/config.json in the repository root:
{
"workspaceId": "<workspace-id>",
"projectId": "<project-id>",
"defaultFolderId": null,
"mcp": {
"server": "sb"
},
"cache": {
"documents": {},
"folders": {},
"lastUpdated": "<ISO-8601-timestamp>"
}
}The cache object stores document and folder IDs so that future sync operations (sb-sync, sb-update) can skip getProjectHierarchy and jump directly to getDocument(docId). You will populate it in Step 7 as you create docs and folders.
cache.documents: Maps document titles to{ "id": "<doc-id>", "folderId": "<folder-id-or-null>" }cache.folders: Maps folder names to their folder IDscache.lastUpdated: ISO 8601 timestamp of the last cache update
Add .sb/ to .gitignore if not already present.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 4: Check for existing documentation ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Call getProjectHierarchy with the projectId from Step 2 to check if documentation already exists.
A) Project is EMPTY (no folders or documents): So this is a fresh project. Continue to Step 5.
B) Project has EXISTING documentation (folders and/or documents found): Then STOP. Show the user what already exists: list the folder tree and document titles. Then ASK the user to choose one of these options:
- Augment: "Keep your existing documentation. I'll analyse your repo, identify gaps, and only create what's missing or needs updating. Existing documents won't be modified."
- Replace: "Delete all existing folders and documents, then create a fresh documentation set from scratch. This is destructive: version history will be lost."
- Cancel: "Stop here so you can review your existing documentation first. Re-run
/sb-setupwhen ready."
Wait for the user to choose before proceeding.
If the user chooses Augment:
- In Step 6, you MUST account for existing docs. Read each existing document (call
getDocument) to understand what's already covered. - Design your structure around what already exists: fill gaps, don't duplicate.
- In Step 7, only create NEW folders/documents for areas not yet covered. Do NOT recreate or overwrite existing docs.
- In Step 8, include BOTH existing and new documents in the AGENTS.md auto-sync table.
If the user chooses Replace:
- Delete all existing folders and documents (call
deleteFolderfor root folders,deleteDocumentfor root-level documents). - Then continue to Step 5 as if the project were empty.
If the user chooses Cancel:
- STOP. Tell the user: "No changes made. Your existing documentation is untouched. Run
/sb-setupagain when you're ready." - Do NOT proceed to any further steps.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 5: Analyse the repository ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Before creating any documentation, you MUST deeply understand this repository. Analyse:
a) Tech stack: languages, frameworks, runtimes, package managers, build tools b) Architecture: monolith vs microservices, frontend/backend split, API patterns, data layer c) Directory structure: how is the code organised? what are the key directories? d) Entry points: where does execution start? what are the main modules? e) Dependencies: critical third-party libraries, internal shared packages f) Infrastructure: deployment targets (cloud, containers, serverless), CI/CD, IaC g) Data & storage: databases, caches, message queues, file storage h) Auth & security: authentication providers, authorization model, secrets management i) Testing: test frameworks, test structure, coverage approach j) Existing documentation: READMEs, wiki, docs folder, inline comments quality k) Domain context: what business problem does this solve? who are the users? l) Pain points: what areas look under-documented, inconsistent, or risky?
Read key files: README, package.json/Cargo.toml/go.mod/etc., config files, directory listings, a sample of core source files. Be thorough.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 6: Design a bespoke documentation structure ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Based on your analysis, design a folder-and-document structure in Stable Baseline that is specific to this repository. There is NO fixed template. Every repo gets a different structure.
PRINCIPLES:
- Technical Standards & Coding Patterns: How code should be written, naming conventions, style guides, code review checklists relevant to THIS stack
- Architectural Patterns: System design, component relationships, data flows, API contracts, integration points specific to THIS codebase
- Security Patterns: Auth flows, authorization model, data protection, secrets management, vulnerability handling relevant to THIS system
- Operational & Maintenance: Deployment procedures, monitoring, alerting, incident response, runbooks for THIS infrastructure
- Compliance & Governance: Regulatory requirements, audit trails, data retention policies applicable to THIS domain
- Business Context: Business rules, domain models, stakeholder requirements, product decisions, user personas for THIS product
- Drift Prevention: Document the "why" behind every significant decision so future developers don't deviate without understanding the consequences
RULES for structure design:
- Create folders and nesting that match THIS repo's natural boundaries
- Group documents by how people will FIND them, not by type
- Every document must have a clear purpose: no placeholder docs
- Include architecture diagrams where visual representation adds value
- Do NOT create generic folders like "Miscellaneous" or "Other"
- Keep nesting shallow (3 levels max) unless the repo is genuinely complex
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 7: Create the documentation in Stable Baseline ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Using the structure you designed:
- Call
createFolderfor each folder (use parentId for nesting). Then after EACHcreateFoldercall, update.sb/config.jsoncache.folderswith the folder name mapped to the folder ID. - Call
createDocumentfor each document with substantive CDMD content.- Write REAL content based on what you learned in Step 5. Not stubs, not TODOs.
- Use the CDMD format (call
sb://cdmd-guideresource if unsure of syntax). - Do NOT include DIAGRAM or IMAGE markers in the cdmd body.
Then after EACH
createDocumentcall, update.sb/config.jsoncache.documentswith the document title mapped to{ "id": "<doc-id>", "folderId": "<folder-id-or-null>" }.
After creating EACH document, you MUST generate diagrams. This is NOT optional.
Diagram generation is MANDATORY. Every document that covers architecture, data flow, system design, component relationships, API contracts, deployment topology, state machines, data models, sequence flows, pipelines, or infrastructure MUST include at least one diagram.
For each document: a) Decide the best diagram type. Call
getDiagramTypeGuidefor the type you pick to learn the correct DSL syntax. b) Write the diagram DSL following the guide. c) CallinsertDiagramInDocumentwith appropriate afterLine placement.The ONLY documents exempt from diagrams are pure text documents like glossaries, coding style guides, or checklists.
Write documents that are immediately useful. A developer joining tomorrow should be able to read these docs and understand the system.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 8: AGENTS.md (augment or create) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
AGENTS.md is the cross-IDE standard for agent instructions (supported by Cursor, VS Code Copilot, Claude Code, OpenCode, Windsurf, Zed, Warp, Roo Code, Aider, and 15+ other tools).
CRITICAL: Check if AGENTS.md already exists in the repository root BEFORE writing.
If AGENTS.md ALREADY EXISTS:
- You MUST NOT replace, overwrite, or remove ANY existing content.
- Read the entire file first.
- APPEND the Stable Baseline section below to the END of the existing file.
- If a "Stable Baseline" section already exists from a previous run, update ONLY that section in-place.
If AGENTS.md does NOT exist:
- Create it with the Stable Baseline section below.
Use the /sb-sync skill to generate the Stable Baseline section, OR write it directly following this structure. If AGENTS.md already has the section from an older version of this plugin (the same heading with a long dash in place of the colon), update that one in place and give it this heading; never add a second one.
## Stable Baseline: Documentation Sync
This project's documentation lives in Stable Baseline.
- Workspace: `<workspace-id>`
- Project: `<project-id>`
- MCP Server: `sb`
### Auto-Sync Rules
When you make changes to any of the following, update the corresponding
Stable Baseline documentation using MCP tools:
| File Pattern | Documentation Impact | Action |
|---|---|---|
| <patterns specific to THIS repo> | <what docs to update> | <editDocument / createDocument> |
### MCP Tool Usage
- Use MCP tools for ALL document/folder/diagram/image operations
- Never manually write DIAGRAM_OMITTED, IMAGE_OMITTED, or marker HTML
- Always call `getDocument` before `editDocument` (need versionTimestamp)
- Create documents first, then insert diagrams/images with dedicated tools
- For bulk text changes use `findAndReplaceTextInDocument`
### Resources
- `sb://cdmd-guide`: CDMD syntax reference
- `sb://diagram-types`: Available diagram types
- `sb://server-info`: Server capabilitiesThe file patterns in the Auto-Sync Rules table MUST be specific to THIS repo.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 9: Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
When done, provide a summary:
- Workspace and project IDs used
- Folder structure created (tree view)
- Documents created (with titles and brief descriptions)
- Diagrams inserted (list each diagram with its type and which document it belongs to)
- AGENTS.md location and key auto-sync rules
.sb/config.jsoncache status: confirm all created folders and documents are cached- Suggested next steps for the user
After the summary, update .sb/config.json cache.lastUpdated to the current ISO 8601 timestamp.
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.

