agentleFS
jiten-singh-shahijiten-singh-shahi/salesforce-claude-code/.cursor/skills/update-docs/SKILL.md

update-docs

Skill15 starsChanged 7 months agoMITView on GitHub

Use when syncing documentation after Salesforce Apex code changes. Update README, API docs, and deploy metadata references to match the current org codebase.

87 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use get-pr-reviews, push-everything and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • saffron-healthSkill

    get-pr-reviews

    Get nicely formatted output of the last review comments on a PR. Used internally by other skills.

    Also in 3 projects that use this

  • saffron-healthSkill

    push-everything

    Stage ALL changes in the repository (not just session changes), commit, and push. Use when you need to commit all pending changes.

    Also in 3 projects that use this

  • TheKREATORSSkill

    instinct-export

    Export instincts from project/global scope to a file

    Also in 3 projects that use this

  • TheKREATORSSkill

    instinct-import

    Import instincts from file or URL into project/global scope

    Also in 3 projects that use this

  • NVIDIASkill

    generate-spec

    Produce a feature specification covering API changes, backward compatibility, cross-language impact, performance, and a file-level change plan. Use when designing a new feature, planning a significant change, or the user asks to spec something out.

    Also in 3 projects that use this

  • belokonmSkill

    fullstack-developer

    End-to-end feature expert specializing in frontend-backend integration, system architecture, and complete application development

    Also in 4 projects that use this

  • +1 more from saffron-health

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 9 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 81 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After making code changes that affect the project structure or API surface

    line 14
  2. Distinctive:

    When new Apex classes, triggers, LWC components, or flows have been added or removed

    line 15
  3. Distinctive:

    When deployment steps or prerequisites have changed

    line 16
  4. Very specific:

    When regenerating API documentation for @RestResource, @AuraEnabled, or @InvocableMethod classes

    line 18
  5. Distinctive:

    Read project configuration to understand the tech stack:

    line 24
  6. Very specific:

    Update these sections with <!-- AUTO-GENERATED-START --> / <!-- AUTO-GENERATED-END --> markers:

    line 66
  7. Distinctive:

    Document any custom sfdx plugins

    line 92
  8. Distinctive:

    Create or update deployment documentation:

    line 112
  9. Very specific:

    Ensure all auto-generated sections have proper markers so future updates don't clobber manual content.

    line 146
  10. Distinctive:

    Only update sections between auto-generated markers

    line 150
  11. Distinctive:

    Never overwrite manually-written content

    line 151
  12. Distinctive:

    Always show a diff before writing changes

    line 152

“Common” is measured: kept by at least 6 in 10 of the 81 edited versions of this file we could read. “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

Update Docs — Synchronize Documentation with Codebase

Synchronize documentation with the current state of the Salesforce codebase. Scans metadata, extracts project structure, and updates documentation files.

When to Use

  • After making code changes that affect the project structure or API surface
  • When new Apex classes, triggers, LWC components, or flows have been added or removed
  • When deployment steps or prerequisites have changed
  • To check for stale documentation that hasn't been updated in 90+ days
  • When regenerating API documentation for @RestResource, @AuraEnabled, or @InvocableMethod classes

Workflow

Step 1 — Scan Project Metadata

Read project configuration to understand the tech stack:

# Core project config
cat sfdx-project.json

# Package dependencies
cat sfdx-project.json | grep -A5 "packageDirectories"

# Node.js tooling
cat package.json 2>/dev/null | grep -A10 '"scripts"'

Step 2 — Inventory Source Components

Count and categorize all Salesforce metadata:

# Apex classes
find force-app -name "*.cls" -not -name "*Test.cls" | wc -l

# Apex test classes
find force-app -name "*Test.cls" | wc -l

# Apex triggers
find force-app -name "*.trigger" | wc -l

# LWC components
find force-app -path "*/lwc/*/*.js" | wc -l

# Custom objects
find force-app -name "*.object-meta.xml" | wc -l

# Flows
find force-app -name "*.flow-meta.xml" | wc -l

# Permission sets
find force-app -name "*.permissionset-meta.xml" | wc -l

Step 3 — Update README Sections

Update these sections with <!-- AUTO-GENERATED-START --> / <!-- AUTO-GENERATED-END --> markers:

Project Structure:

## Project Structure

| Component | Count | Location |
|-----------|-------|----------|
| Apex Classes | 45 | `force-app/main/default/classes/` |
| Apex Triggers | 8 | `force-app/main/default/triggers/` |
| Test Classes | 32 | `force-app/main/default/classes/*Test.cls` |
| LWC Components | 12 | `force-app/main/default/lwc/` |
| Custom Objects | 15 | `force-app/main/default/objects/` |
| Flows | 6 | `force-app/main/default/flows/` |

Setup Instructions:

  • Scratch org creation command from config/project-scratch-def.json
  • Data seeding scripts if present
  • Permission set assignments

Available Commands:

  • List custom SF CLI commands from package.json scripts
  • Document any custom sfdx plugins

Step 4 — Generate API Documentation

For classes with @RestResource, @AuraEnabled, or @InvocableMethod:

## API Endpoints

### AccountController (@RestResource)
- `GET /services/apexrest/accounts` — List accounts
- `POST /services/apexrest/accounts` — Create account

### AccountService (@AuraEnabled methods)
- `getAccountDetails(Id accountId)` — Returns account with contacts
- `updateAccountStatus(Id accountId, String status)` — Updates status

Step 5 — Generate Deployment Guide

Create or update deployment documentation:

## Deployment Guide

### Prerequisites
- SF CLI v2.x installed
- Target org authenticated: `sf org login web --alias <alias>`

### Deploy Steps
1. Validate: `sf project deploy validate --target-org <alias> --test-level RunLocalTests`
2. Deploy: `sf project deploy start --target-org <alias> --test-level RunLocalTests`

### Metadata Dependencies
`sf project deploy start` handles dependency resolution automatically — no manual ordering is needed. If a deployment fails due to a missing dependency, verify that all referenced metadata is included in the source being deployed.

Step 6 — Check Staleness

Flag documentation files not updated in 90+ days:

find . -name "README.md" -o -name "CONTRIBUTING.md" -o -name "*.md" -path "*/docs/*" | while read f; do
  last_modified=$(git log -1 --format=%ai -- "$f" 2>/dev/null)
  if [ -n "$last_modified" ]; then
    last_epoch=$(date -d "$last_modified" +%s 2>/dev/null || date -j -f "%Y-%m-%d %H:%M:%S %z" "$last_modified" +%s 2>/dev/null)
    days=$(( ($(date +%s) - $last_epoch) / 86400 ))
    if [ "$days" -gt 90 ]; then echo "STALE ($days days): $f"; fi
  fi
done

Step 7 — Verify Auto-Generated Markers

Ensure all auto-generated sections have proper markers so future updates don't clobber manual content. Only modify content between <!-- AUTO-GENERATED-START --> and <!-- AUTO-GENERATED-END --> markers.

Rules

  • Only update sections between auto-generated markers
  • Never overwrite manually-written content
  • Always show a diff before writing changes
  • Preserve existing formatting and style of the document

Examples

/update-docs
/update-docs Sync the README with the new Agentforce integration feature
/update-docs Regenerate API documentation for all @RestResource classes
/update-docs Check for stale documentation and suggest updates

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.