update-from-starter-template
Update Mattermost plugin repositories with common files from mattermost-plugin-starter-template and fix all linter issues. Use when syncing build tooling, updating golangci-lint config, or fixing lint
SKILL.mdplugins/plugin-development/skills/update-from-starter-template/SKILL.md
GitHubUpdate from Starter Template
Update this Mattermost plugin repository with common build/config files from the mattermost-plugin-starter-template and fix all linter issues.
Instructions
Phase 0: Prepare the repository
- Switch to the main branch:
git checkout master(ormain) - Pull latest changes:
git pull - Create a new branch for the updates:
git switch -c update-from-starter-template
Phase 1: Update common files from starter template
Fetch and compare these files from mattermost/mattermost-plugin-starter-template (master branch):
Build files:
build/manifest/*.gobuild/pluginctl/*.gobuild/setup.mkMakefile
Config files:
.editorconfig.gitattributes.github/workflows/ci.yml.gitignore.golangci.yml.nvmrcgo.mod(for Go version only)server/.gitignore
When updating:
- Preserve plugin-specific customizations (plugin ID, custom targets)
- Update tool versions (golangci-lint, gotestsum, Node.js)
- Adopt new linter configurations
- Update Go version in
go.modif the starter template uses a newer version (compare thegodirective). Also update the Go version in.github/workflows/ci.ymlto match. After updating, rungo mod tidyto updatego.sum - Preserve license headers
- Some plugins use
github.com/mattermost/mattermost-govetin their Makefile to check for license headers. Do NOT remove that linter. If it reports missing license headers, add them to the affected source files.
Phase 2: Fix linter issues
- Run
make check-styleto identify issues - Install gofumpt if needed:
go install mvdan.cc/gofumpt@latest - Run
gofumpt -w server/to auto-fix formatting - Fix remaining issues manually
Phase 3: Verify and commit
- Run
make testto verify all tests pass - Run
make check-styleto confirm 0 issues - Create a descriptive commit and PR. Use the pull request template from https://github.com/mattermost/.github/blob/master/PULL_REQUEST_TEMPLATE.md.
Phase 4: Update Go dependencies (optional)
Ask the user if they want to update all direct Go dependencies. If yes:
- Run
go get -u ./...to update all direct dependencies - Run
go mod tidyto clean upgo.sum - Run
make testto verify all tests still pass - Run
make check-styleto confirm 0 issues - Create a separate commit for the dependency updates
Example commit message
Update common files from starter template and fix linter issues
Troubleshooting
Mock files have linter errors:
- Generated mocks may need regeneration:
go generate ./... - Or exclude from linting if they're third-party generated