plugins/plugin-development/skills/create-mattermost-plugin/SKILL.md
Create a new Mattermost plugin from the starter template in the current directory. Use when creating a new plugin from scratch, scaffolding a Mattermost plugin, or bootstrapping a plugin project.
npx skillsauth add mattermost/mattermost-ai-marketplace create-mattermost-pluginInstall 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.
Scaffold a new Mattermost plugin by cloning the starter template into the current directory and customizing it.
The plugin name is the current folder name (e.g. if pwd is /home/user/mattermost-plugin-foo, the plugin name is mattermost-plugin-foo).
The Go module path is github.com/mattermost/<plugin-name>.
Check if pwd has files beyond dotfiles. If non-empty, warn the user with AskUserQuestion and let them choose to proceed or abort.
Prefer Option A so GitHub records the new repo as "Generated from mattermost/mattermost-plugin-starter-template" in its UI. Fall back to Option B when gh is unavailable or not authenticated.
Decide which path to take with:
if command -v gh >/dev/null 2>&1 && gh auth status >/dev/null 2>&1; then
# Option A
else
# Option B
fi
ghUse AskUserQuestion to gather:
gh api user --jq .login; offer mattermost as an alternative for staff plugins.--public, --private, or --internal.Create the remote repo from the template, then clone it into pwd via a tmpdir so the .git (with the new remote already wired up) is preserved:
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT INT TERM
gh repo create "$OWNER/$PLUGIN_NAME" \
--template mattermost/mattermost-plugin-starter-template \
"$VISIBILITY_FLAG"
git clone "https://github.com/$OWNER/$PLUGIN_NAME.git" "$TMPDIR"
if command -v rsync >/dev/null 2>&1; then
rsync -a "$TMPDIR"/ ./
else
cp -R "$TMPDIR"/. ./
fi
gh is unavailablePlain shallow clone of the template, no remote:
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT INT TERM
git clone --depth 1 https://github.com/mattermost/mattermost-plugin-starter-template "$TMPDIR"
rm -rf "$TMPDIR/.git"
if command -v rsync >/dev/null 2>&1; then
rsync -a "$TMPDIR"/ ./
else
cp -R "$TMPDIR"/. ./
fi
Derive values:
PLUGIN_NAME = basename of pwd (e.g. mattermost-plugin-foo)MODULE_PATH = github.com/mattermost/$PLUGIN_NAMEPLUGIN_ID = com.mattermost.$PLUGIN_NAME (dots replaced for the id portion after com.mattermost.)Edit plugin.json: set id, name, description (use the plugin name as a sensible default for name/description, the user can refine later). Update homepage_url and support_url to point to https://$MODULE_PATH and https://$MODULE_PATH/issues.
Replace the old module path everywhere: Use Grep to find all files containing github.com/mattermost/mattermost-plugin-starter-template, then Edit each with replace_all to substitute the new MODULE_PATH.
.git is already present and tied to the new remote. Stage + commit, then push..git does not exist, run git init first..git already existed before the skill ran (i.e. pwd was an existing repo), use AskUserQuestion to choose: reuse and commit, skip all git ops, or abort.Commit:
git add -A
git commit -m "Initial plugin scaffold from mattermost-plugin-starter-template"
If Option A, push the initial commit to the new remote:
git push
Run make to confirm the scaffolded plugin builds end-to-end. If it fails, surface the error and stop — do not proceed to the summary until the build is green. Analyze the problems shown during the build and address them.
Print what was created and confirm that make completed successfully.
tools
Analyze a GitHub pull request for risk level and generate concrete QA recommendations. Accepts a PR URL or "owner/repo#number" reference. Uses `gh` CLI to fetch the diff and metadata, computes blast radius, scores six risk dimensions, and returns a structured JSON risk assessment. Use when the user invokes /qa-analysis:qa-analysis with a GitHub PR URL or reference, or asks for a PR risk assessment, QA recommendations, or "what should I test?" for a given pull request.
tools
Add an MCP (Model Context Protocol) server to a Mattermost plugin so the Agents plugin can call its tools. Use when implementing cross-plugin MCP, exposing AI tools from a Mattermost plugin to the Agents plugin, or wiring up the `pluginmcp` helper from mattermost-plugin-agents.
development
Orchestrates test-driven fixes for Mattermost security tickets (Jira/Atlassian) with a Staff Security Engineer mindset: failing secure-behavior tests first, then implementation, then security review and edge-case loops, then opening a non-draft PR that follows `.github/PULL_REQUEST_TEMPLATE.md` when present, with a vague public description (no exploit detail). Use when the user invokes /security-fix:security-fix with a mattermost.atlassian.net browse URL, MM-* security work, backend permission or authorization bugs, or asks for this security TDD workflow.
tools
Brief description of what this skill does