# summary

Update stale AI agent rule files to the current plugin version.

# description

Scans the current project for rule files generated by `sf setup-agents local` and re-generates any
files whose embedded `pluginVersion` (or `<!-- setup-agents: -->` comment) does not match the
current plugin version.

Detection logic:

- `.cursor/rules/*.mdc` — checks `pluginVersion:` in frontmatter.
- `.github/copilot-instructions.md` — checks `<!-- setup-agents: x.y.z -->` comment.
- `AGENTS.md` — checks `<!-- setup-agents: x.y.z -->` comment.
- `CLAUDE.md` — checks `<!-- setup-agents: x.y.z -->` comment.
- `.a4drules/*.md` — checks `<!-- setup-agents: x.y.z -->` comment.

Active profiles are inferred from the filenames in `.cursor/rules/` (e.g. `developer-standards.mdc`
maps to the `developer` profile). Use `--dry-run` to preview changes without writing files.
Files with setup-agents managed blocks update only the generated block content; user content outside
those blocks is preserved.

# flags.dry-run.summary

Preview changes without writing any files.

# flags.dry-run.description

List all stale files that would be updated without actually modifying them.
Useful to audit what would change before committing to an update.

# flags.check.summary

Check for stale files without writing changes.

# flags.check.description

Report stale files and whether each file can be updated through setup-agents managed blocks.
This is intended for CI or pre-PR validation.

# flags.yes.summary

Skip confirmation prompt.

# flags.yes.description

Automatically confirm the update without interactive prompting.
Useful in CI/CD pipelines or scripted environments.

# examples

- Preview which rule files are stale:

  <%= config.bin %> <%= command.id %> --dry-run

- Update all stale files with confirmation:

  <%= config.bin %> <%= command.id %>

- Update all stale files without prompting (CI mode):

  <%= config.bin %> <%= command.id %> --yes

- Regenerate all rule files from saved config without re-selecting profiles:

  <%= config.bin %> <%= command.id %> --force

# info.nothingToUpdate

All rule files are up to date (plugin version: %s). Nothing to do.

# info.staleFilesFound

Found %s stale file(s):

# info.dryRun

Dry run complete. No files were modified.

# info.check

Check complete. No files were modified.

# info.managedBlocks

managed blocks

# info.fullFile

full file

# info.cancelled

Update cancelled.

# info.updating

Updating %s rules...

# info.done

Update complete. %s file(s) refreshed.

# prompt.confirmUpdate

Proceed with update? (managed blocks will be refreshed; files without managed blocks may be overwritten)

# flags.doc-reference.summary

Regenerate reference doc rule files (salesforce-pdf-registry.mdc) from existing config without re-running setup.

# info.docReferenceWritten

Wrote reference doc: %s

# warn.docReferenceNoConfig

No .setup-agents/config.json found. Run sf setup-agents init first.

# flags.fetch-refs.summary

Download Salesforce reference PDFs and HTML docs to .setup-agents/references/ for local agent access.

# flags.force.summary

Regenerate all rule files and skills from saved workspace config, regardless of version.

# info.fetchRefsDownloaded

Downloaded: %s

# info.fetchRefsCached

Already cached (skipped): %s

# warn.fetchRefsFailed

Failed to fetch %s (status: %s) — skipping.

# warn.forceNoConfig

No .setup-agents/config.json found. Run sf setup-agents init first.

# info.forceUpdating

Force-regenerating %s rules from saved config...

# info.forceDone

Force update complete. Regenerated rules for %s tool(s).
