Skip to content

chore: add AI documentation and best practices#853

Open
AndrewLPetersonSF wants to merge 1 commit intosalesforcecli:mainfrom
AndrewLPetersonSF:chore/template-docs
Open

chore: add AI documentation and best practices#853
AndrewLPetersonSF wants to merge 1 commit intosalesforcecli:mainfrom
AndrewLPetersonSF:chore/template-docs

Conversation

@AndrewLPetersonSF
Copy link

@AndrewLPetersonSF AndrewLPetersonSF commented Feb 20, 2026

What does this PR do?

  • W-21198400
  • Adding human-readable DEVELOPMENT.md for developers adding new template generators and exposing them to the CLI
  • Adding AI-first documentation/skills for Claude, Cursor, and Windsurf

What issues does this PR fix or reference?

N/A

@AndrewLPetersonSF AndrewLPetersonSF requested a review from a team as a code owner February 20, 2026 19:55
@@ -0,0 +1,149 @@
## Add Template Generator to CLI

**Repo**: [salesforcecli/plugin-templates](https://github.com/salesforcecli/plugin-templates/tree/main/src/commands) (Public GitHub, requires access to `forcedotcom` org)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Repo**: [salesforcecli/plugin-templates](https://github.com/salesforcecli/plugin-templates/tree/main/src/commands) (Public GitHub, requires access to `forcedotcom` org)
**Repo**: [salesforcecli/plugin-templates](https://github.com/salesforcecli/plugin-templates/tree/main/src/commands) (Public GitHub, requires access to `salesforcecli` org)


#### Nightly

The CLI has a `nightly` release. The day after your PR is merged, you can update to the latest with `sf update nightly`. Keep in mind that if you have previously run `sf plugins link .` during development, you have to run `sf plugins unlink @salesforce/plugin-templates`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The CLI has a `nightly` release. The day after your PR is merged, you can update to the latest with `sf update nightly`. Keep in mind that if you have previously run `sf plugins link .` during development, you have to run `sf plugins unlink @salesforce/plugin-templates`.
The CLI has a `nightly` release. The day after your PR is merged, you can update to the latest with `sf update nightly` or `npm install @salesforce/cli@nightly --global`. Keep in mind that if you have previously run `sf plugins link .` during development, you have to run `sf plugins unlink @salesforce/plugin-templates`.


#### Release Candidate

The release candidate branch is updated weekly, on Wednesdays, around noon CST (10am PST). To update to the release candidate, you can run `sf update latest-rc`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The release candidate branch is updated weekly, on Wednesdays, around noon CST (10am PST). To update to the release candidate, you can run `sf update latest-rc`.
The release candidate is updated weekly, on Wednesdays, around noon CST (10am PST). To update to the release candidate, you can run `sf update stable-rc` or `npm install @salesforce/cli@latest-rc --global`.

Note the stable vs latest naming... Its been this way for a long time


#### Latest

A week after promotion to the release candidate, the RC is promoted to `latest`. Final sanity checks should be done during this week, and emergency patch fixes can be made if required. Update with `sf update latest`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A week after promotion to the release candidate, the RC is promoted to `latest`. Final sanity checks should be done during this week, and emergency patch fixes can be made if required. Update with `sf update latest`.
A week after promotion to the release candidate, the RC is promoted to `latest`. Final sanity checks should be done during this week, and emergency patch fixes can be made if required. Update with `sf update stable` or `npm install @salesforce/cli --global`.

2. If you're introducing new templates in `salesforcedx-templates`, update your `package.json` in plugin-templates to reference your local path to the root directory of `salesforcedx-templates`
3. Run `yarn build` after all changes to your templates or generator (in dx-templates)
4. Run `yarn install --force` and `yarn build` in `plugin-templates` to fetch newly built changes from your local salesforcedx-templates directory
5. When introducing your CLI command for the **first time**, run `sf plugins link .` from `plugin-templates`, which will override your local CLI with the new command that you’re working on. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. When introducing your CLI command for the **first time**, run `sf plugins link .` from `plugin-templates`, which will override your local CLI with the new command that you’re working on.
5. When introducing your CLI command for the **first time**, run `sf plugins link .` from `plugin-templates`, which will override your local CLI with the new command that you’re working on.
a. Alternatively, you can run your new command directly from the plugin-templates directory with: `./bin/run.js template generate your-command`

Use the interactive flag generator for each flag you need:

```bash
sf dev generate flag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, this command is interactive only. Might want to mention that so that the LLM instructs the user to run it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants