skills/update-docs/SKILL.md
Use when syncing documentation after Salesforce Apex code changes. Update README, API docs, and deploy metadata references to match the current org codebase.
npx skillsauth add jiten-singh-shahi/salesforce-claude-code update-docsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Synchronize documentation with the current state of the Salesforce codebase. Scans metadata, extracts project structure, and updates documentation files.
@RestResource, @AuraEnabled, or @InvocableMethod classesRead 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"'
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
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:
config/project-scratch-def.jsonAvailable Commands:
package.json scriptsFor 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
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.
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
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.
/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
development
Update Salesforce platform reference docs with latest release features and deprecation announcements. Use when SessionStart hook warns docs are outdated or a new Salesforce release has shipped. Do NOT use for Apex or LWC development.
development
Use when managing context during long Salesforce Apex development sessions. Suggests manual compaction at logical intervals to preserve deploy and org context across phases.
tools
Visualforce development — pages, controllers, extensions, ViewState, JS Remoting, LWC migration. Use when maintaining VF pages, building PDFs, or planning VF-to-LWC migration. Do NOT use for LWC, Aura, or Flow.
development
Salesforce Apex trigger framework patterns — TriggerHandler, FFLIB Domain, TDTM, bypass and recursion control. Use when adopting or refactoring triggers.