From b244ae8597aca138c07c3968248aeb8707d6fbc5 Mon Sep 17 00:00:00 2001 From: Sam Gutentag <1404219+samgutentag@users.noreply.github.com> Date: Wed, 18 Mar 2026 11:49:26 -0700 Subject: [PATCH 1/5] Add Claude Code Plugin setup page Co-Authored-By: Claude Opus 4.6 --- .../use-mcp-server/configuration/README.md | 2 +- .../configuration/claude-code-plugin.md | 73 +++++++++++++++++++ summary.md | 1 + 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 flaky-tests/use-mcp-server/configuration/claude-code-plugin.md diff --git a/flaky-tests/use-mcp-server/configuration/README.md b/flaky-tests/use-mcp-server/configuration/README.md index d210e990..ce81055a 100644 --- a/flaky-tests/use-mcp-server/configuration/README.md +++ b/flaky-tests/use-mcp-server/configuration/README.md @@ -1,3 +1,3 @@ # Configuration -
Cover image
Claude Codeclaude.pngclaude-code-cli.md
Cursorcursor.pngcursor-ide.md
GitHub Copilotgithub copilot.pnggithub-copilot-ide.md
Geminigemini.pnggemini-cli.md
+
Cover image
Claude Codeclaude.pngclaude-code-cli.md
Claude Code Pluginclaude.pngclaude-code-plugin.md
Cursorcursor.pngcursor-ide.md
GitHub Copilotgithub copilot.pnggithub-copilot-ide.md
Geminigemini.pnggemini-cli.md
diff --git a/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md b/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md new file mode 100644 index 00000000..e585c336 --- /dev/null +++ b/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md @@ -0,0 +1,73 @@ +--- +description: Install the Trunk plugin for Claude Code +--- + +# Claude Code Plugin + +The Trunk plugin for Claude Code bundles the MCP server connection, slash commands, and skills into a single install. This is the recommended way to connect Trunk to Claude Code. + +## Install the Plugin + +```bash +/plugin install trunk@claude-plugin-directory +``` + +This adds the Trunk MCP server and gives you access to slash commands and skills that activate automatically. + +You can also install manually — clone the [plugin repo](https://github.com/trunk-io/claude-code-plugin) and run `/plugin` from Claude Code to add it. + +## Authentication + +After installing, Claude Code will prompt you to authenticate with Trunk on first use. + +1. Run any Trunk command (e.g., `/trunk:fix-flaky`) or trigger an MCP tool call +2. Claude Code will open a browser window for OAuth login +3. Log in with your Trunk account and authorize the connection +4. You'll see `Authentication successful. Connected to trunk.` back in the terminal + +## Slash Commands + +| Command | What it does | +|---|---| +| `/trunk:fix-flaky ` | Retrieves root cause analysis for a flaky test and offers to apply the fix | +| `/trunk:why-flaky ` | Explains why a test is flaky without making changes — good for triage | +| `/trunk:setup-uploads` | Detects your test framework and CI provider, then generates the upload configuration | + +### Fix a flaky test + +``` +/trunk:fix-flaky test_user_login +``` + +Trunk analyzes the test, explains the root cause (race condition, shared state, time dependency, etc.), and shows a proposed fix with a diff. Say yes to apply the changes directly. + +### Understand why a test is flaky + +``` +/trunk:why-flaky test_payment_processing +``` + +Same analysis as `fix-flaky`, but read-only. Useful when you want to understand the problem before deciding how to handle it — especially for tests you didn't write. + +### Set up test uploads + +``` +/trunk:setup-uploads +``` + +Walks through configuring your repo to upload test results to Trunk. The plugin detects your CI provider and test framework automatically, then generates copy-pasteable config snippets. + +## Skills + +The plugin includes two skills that activate automatically based on context: + +**Flaky test patterns** — activates when you're debugging or writing tests. Provides common flaky test patterns and proven fixes so Claude Code can reference them without you asking. + +**Trunk CI setup** — activates when you're editing CI configuration files (`.github/workflows/`, `.circleci/config.yml`, etc.). Provides best practices for test upload configuration. + +## Also Available For + +- [Cursor](https://docs.trunk.io/flaky-tests/use-mcp-server/configuration/cursor-ide) (one-click install) +- [GitHub Copilot](https://docs.trunk.io/flaky-tests/use-mcp-server/configuration/github-copilot-ide) (one-click install) +- [Gemini CLI](https://docs.trunk.io/flaky-tests/use-mcp-server/configuration/gemini-cli) +- [Any MCP client](https://github.com/trunk-io/mcp-server) — manual configuration diff --git a/summary.md b/summary.md index 8718033d..9bcf793c 100644 --- a/summary.md +++ b/summary.md @@ -119,6 +119,7 @@ * [Cursor (IDE)](flaky-tests/use-mcp-server/configuration/cursor-ide.md) * [GitHub Copilot (IDE)](flaky-tests/use-mcp-server/configuration/github-copilot-ide.md) * [Claude Code (CLI)](flaky-tests/use-mcp-server/configuration/claude-code-cli.md) + * [Claude Code Plugin](flaky-tests/use-mcp-server/configuration/claude-code-plugin.md) * [Gemini (CLI)](flaky-tests/use-mcp-server/configuration/gemini-cli.md) * [MCP Tool Reference](flaky-tests/use-mcp-server/mcp-tool-reference/README.md) * [Get root cause analysis](flaky-tests/use-mcp-server/mcp-tool-reference/get-root-cause-analysis.md) From 937cc3a4669219ce4cc1ad7e1f9dd099a494273c Mon Sep 17 00:00:00 2001 From: Sam Gutentag <1404219+samgutentag@users.noreply.github.com> Date: Wed, 18 Mar 2026 14:02:10 -0700 Subject: [PATCH 2/5] Fix cross-links to use relative paths instead of absolute URLs Co-Authored-By: Claude Opus 4.6 --- .../use-mcp-server/configuration/claude-code-plugin.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md b/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md index e585c336..a806deb8 100644 --- a/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md +++ b/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md @@ -67,7 +67,7 @@ The plugin includes two skills that activate automatically based on context: ## Also Available For -- [Cursor](https://docs.trunk.io/flaky-tests/use-mcp-server/configuration/cursor-ide) (one-click install) -- [GitHub Copilot](https://docs.trunk.io/flaky-tests/use-mcp-server/configuration/github-copilot-ide) (one-click install) -- [Gemini CLI](https://docs.trunk.io/flaky-tests/use-mcp-server/configuration/gemini-cli) +- [Cursor](cursor-ide.md) (one-click install) +- [GitHub Copilot](github-copilot-ide.md) (one-click install) +- [Gemini CLI](gemini-cli.md) - [Any MCP client](https://github.com/trunk-io/mcp-server) — manual configuration From d1ec55571a6209c85f4d296687cdc0505c2b9855 Mon Sep 17 00:00:00 2001 From: Sam Gutentag <1404219+samgutentag@users.noreply.github.com> Date: Fri, 27 Mar 2026 11:33:08 -0700 Subject: [PATCH 3/5] Update flaky-tests/use-mcp-server/configuration/claude-code-plugin.md Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> --- flaky-tests/use-mcp-server/configuration/claude-code-plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md b/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md index a806deb8..9f871955 100644 --- a/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md +++ b/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md @@ -9,7 +9,7 @@ The Trunk plugin for Claude Code bundles the MCP server connection, slash comman ## Install the Plugin ```bash -/plugin install trunk@claude-plugin-directory +/plugin install trunk@https://github.com/trunk-io/claude-code-plugin ``` This adds the Trunk MCP server and gives you access to slash commands and skills that activate automatically. From 0fc710280fc4234b2941fe17b0c25715db458fbf Mon Sep 17 00:00:00 2001 From: Sam Gutentag <1404219+samgutentag@users.noreply.github.com> Date: Fri, 27 Mar 2026 11:33:15 -0700 Subject: [PATCH 4/5] Update flaky-tests/use-mcp-server/configuration/claude-code-plugin.md Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> --- flaky-tests/use-mcp-server/configuration/claude-code-plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md b/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md index 9f871955..d852f85e 100644 --- a/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md +++ b/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md @@ -55,7 +55,7 @@ Same analysis as `fix-flaky`, but read-only. Useful when you want to understand /trunk:setup-uploads ``` -Walks through configuring your repo to upload test results to Trunk. The plugin detects your CI provider and test framework automatically, then generates copy-pasteable config snippets. +Walks through configuring your repo to upload test results to Trunk. The plugin detects your CI provider and test framework automatically, then generates ready-to-paste config snippets. ## Skills From fed036f60675f13f7a4aef37339fafa6c7ab9c32 Mon Sep 17 00:00:00 2001 From: Sam Gutentag <1404219+samgutentag@users.noreply.github.com> Date: Fri, 27 Mar 2026 11:33:24 -0700 Subject: [PATCH 5/5] Update flaky-tests/use-mcp-server/configuration/claude-code-plugin.md Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> --- flaky-tests/use-mcp-server/configuration/claude-code-plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md b/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md index d852f85e..8207b8ab 100644 --- a/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md +++ b/flaky-tests/use-mcp-server/configuration/claude-code-plugin.md @@ -14,7 +14,7 @@ The Trunk plugin for Claude Code bundles the MCP server connection, slash comman This adds the Trunk MCP server and gives you access to slash commands and skills that activate automatically. -You can also install manually — clone the [plugin repo](https://github.com/trunk-io/claude-code-plugin) and run `/plugin` from Claude Code to add it. +You can also install directly from the repo without waiting for directory approval: ## Authentication