agentleFS
stablebaselinestablebaseline/claude-code/skills/sb-update/SKILL.md

sb-update

Skill1 starsChanged 40 days agoApache-2.0View on GitHub

Update Stable Baseline documentation with changes, decisions, and knowledge from the current conversation. Use mid-conversation when architectural changes, key decisions, or important implementation details need to be captured. Use when user says sb-update, update docs, sync docs, or capture changes.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

26 rules. About 0 are common, 10 are distinctive, and 16 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 16

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow this workflow EXACTLY:

    line 11
  2. Very specific:

    Read .sb/config.json to get the workspaceId, projectId, AND the cache object (cache.documents, cache.folders, cache.lastUpdated).

    line 17
  3. Distinctive:

    Use a cache-first approach to find existing documents:

    line 37
  4. Very specific:

    Check cache.documents from .sb/config.json for each change area from Step 2.

    line 39
  5. Very specific:

    Cache HIT: Call getDocument directly with the cached document ID (skip getProjectHierarchy).

    line 40
  6. Very specific:

    If cache.documents is empty or missing, call getProjectHierarchy once, map all documents, and populate the cache.

    line 43
  7. Very specific:

    Call getDocument to read the current content and get the versionTimestamp (required for optimistic locking)

    line 53
  8. Very specific:

    Call editDocument with targeted patches, NOT full rewrites

    line 55
  9. Distinctive:

    Patch, don't rewrite: Only change the sections that are affected.

    line 58
  10. Distinctive:

    Update, don't duplicate: If the document already covers a topic, update that section in-place rather than adding a new section that repeats …

    line 61
  11. Very specific:

    Update cache: After all edits in this step, update .sb/config.json cache.lastUpdated to the current ISO 8601 timestamp.

    line 63
  12. Distinctive:

    If a change area has no matching document:

    line 69
  13. Very specific:

    Call createDocument in that folder with well-structured content

    line 72
  14. Very specific:

    Follow CDMD format (read sb://cdmd-guide if unsure about syntax)

    line 73
  15. Very specific:

    Update .sb/config.json cache.documents with the new document's title mapped to { "id": "<doc-id>", "folderId": "<folder-id-or-null>" }

    line 74
  16. Distinctive:

    Only create new documents for substantial new areas.

    line 76
  17. Distinctive:

    If the changes affect system architecture, data flow, component relationships, or any visual structure:

    line 82
  18. Very specific:

    Check if existing diagrams need updating (read sb://diagram-types for available types)

    line 84
  19. Very specific:

    Use insertDiagramInDocument to add new diagrams where they aid understanding

    line 85
  20. Distinctive:

    Prefer updating existing diagrams over creating duplicates

    line 86
  21. Distinctive:

    After all updates are complete, provide a summary:

    line 98
  22. Very specific:

    Use sb tools for ALL operations

    line 105
  23. Very specific:

    ALWAYS call getDocument before editDocument (versionTimestamp is required)

    line 106
  24. Very specific:

    NEVER manually write or edit DIAGRAM_OMITTED, IMAGE_OMITTED, or <!-- DIAGRAM: ...

    line 107
  25. Very specific:

    Prefer editDocument with small patches over full document rewrites

    line 108
  26. Distinctive:

    Document the "why" behind decisions, not just the "what"

    line 110

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Stable Baseline: Update Documentation

You are updating Stable Baseline documentation to reflect changes, decisions, or knowledge from this conversation.

Follow this workflow EXACTLY:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 1: Read Configuration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Read .sb/config.json to get the workspaceId, projectId, AND the cache object (cache.documents, cache.folders, cache.lastUpdated). If the file doesn't exist, ask the user which workspace and project to update.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 2: Analyse Conversation Context ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Review what was changed or decided in this conversation. Identify:

  • Code changes: Files modified, features added, bugs fixed, refactors performed
  • Architectural decisions: Design choices, tradeoffs considered, patterns adopted or rejected
  • Key decisions: Why something was done a certain way (the rationale, not just the what)
  • New knowledge: Discovered constraints, gotchas, limitations, or important context
  • Schema changes: Database migrations, new tables/columns, RLS policy changes
  • API changes: New endpoints, modified contracts, auth flow changes

For each item, determine which Stable Baseline document it belongs to.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 3: Discover Existing Documentation ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Use a cache-first approach to find existing documents:

  1. Check cache.documents from .sb/config.json for each change area from Step 2.
    • Cache HIT: Call getDocument directly with the cached document ID (skip getProjectHierarchy).
    • Cache MISS or 404: Fall back to getProjectHierarchy with the projectId, find the document, then update cache.documents with the discovered ID.
  2. If cache.documents is empty or missing, call getProjectHierarchy once, map all documents, and populate the cache.

Map each change area from Step 2 to an existing document. If no document exists for a change area, note it for creation in Step 5.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 4: Update Existing Documents ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

For each document that needs updating:

  1. Call getDocument to read the current content and get the versionTimestamp (required for optimistic locking)
  2. Determine what sections need to be added, updated, or expanded
  3. Call editDocument with targeted patches, NOT full rewrites

Rules for editing:

  • Patch, don't rewrite: Only change the sections that are affected. Leave everything else untouched.
  • Capture rationale: For architectural decisions, document WHY the decision was made, what alternatives were considered, and what tradeoffs were accepted.
  • Be specific: Include file paths, function names, configuration keys (concrete references that a developer can follow).
  • Update, don't duplicate: If the document already covers a topic, update that section in-place rather than adding a new section that repeats it.
  • Timestamp decisions: For significant architectural decisions, note when they were made (use the current date).
  • Update cache: After all edits in this step, update .sb/config.json cache.lastUpdated to the current ISO 8601 timestamp.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 5: Create New Documents (if needed) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

If a change area has no matching document:

  1. Identify the most appropriate existing folder for the new document
  2. Call createDocument in that folder with well-structured content
  3. Follow CDMD format (read sb://cdmd-guide if unsure about syntax)
  4. Update .sb/config.json cache.documents with the new document's title mapped to { "id": "<doc-id>", "folderId": "<folder-id-or-null>" }

Only create new documents for substantial new areas. Minor changes should be folded into existing documents.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 6: Generate or Update Diagrams (if applicable) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

If the changes affect system architecture, data flow, component relationships, or any visual structure:

  1. Check if existing diagrams need updating (read sb://diagram-types for available types)
  2. Use insertDiagramInDocument to add new diagrams where they aid understanding
  3. Prefer updating existing diagrams over creating duplicates

Diagram types to consider:

  • Architecture changes suggest C4 Context/Container diagrams, component diagrams
  • Data model changes suggest entity-relationship diagrams (ERD)
  • Flow changes suggest sequence diagrams, flowcharts, BPMN
  • API changes suggest sequence diagrams showing request/response flows

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 7: Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

After all updates are complete, provide a summary:

  • List each document updated (with document name and what was changed)
  • List any new documents created
  • List any diagrams added or updated
  • Note any areas that may need future documentation but weren't covered

IMPORTANT RULES:

  • Use sb tools for ALL operations
  • ALWAYS call getDocument before editDocument (versionTimestamp is required)
  • NEVER manually write or edit DIAGRAM_OMITTED, IMAGE_OMITTED, or <!-- DIAGRAM: ... --> markers: use the dedicated diagram/image tools
  • Prefer editDocument with small patches over full document rewrites
  • For bulk text substitutions use findAndReplaceTextInDocument
  • Document the "why" behind decisions, not just the "what"

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.