Skip to content
Security
Command

/enhance-workspace

Refresh an existing workspace-level CLAUDE.md by adding missing Bitwarden domain modules

BOOST
From plugin
ai-plugins
15910 skills4 agents10 commands1 MCP
Install
> /plugin marketplace add bitwarden/ai-plugins

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/enhance-workspace

Context preview

What this command does when you run it.

Refresh an existing workspace-level CLAUDE.md by adding missing Bitwarden domain modules

Command definition

enhance-workspace.md
description: Refresh an existing workspace-level CLAUDE.md by adding missing Bitwarden domain modules
allowed-tools: Read, Write, Edit, Bash(diff:*), Bash(cp:*), Bash(date:*), Bash(rm:*), Glob

Refresh an existing workspace-level CLAUDE.md by detecting which Bitwarden domain modules are already present and offering to add the missing ones. Same safety guardrails as `/bitwarden-init:init-workspace` — backup before overwrite, diff preview, explicit Apply confirmation.

Prerequisites

A workspace-level CLAUDE.md must already exist. If it doesn't, stop and point the user at `/bitwarden-init:init-workspace` instead.

Steps

1. **Ask the user for the workspace root.** Use `AskUserQuestion` with options pre-filled as common candidates (e.g. `~/Source/bw`, `~/dev/bitwarden`, `~/code/bw`) — the "Other" affordance lets them type anything. Validate that the resolved `<workspace-root>/.claude/CLAUDE.md` exists; if not, re-ask. No auto-detection — a user invoking `enhance-workspace` has already chosen where this file lives during a prior `init-workspace` session.

2. **Locate the target file.** Target is `<workspace-root>/.claude/CLAUDE.md`. If it does not exist, exit with the message above.

3. **Detect installed modules.** For each module in `${CLAUDE_PLUGIN_ROOT}/templates/workspace/`, extract the top-level `## Heading` and check whether it appears in the existing file.

Build **Installed** and **Missing** lists.

4. **Offer missing modules.** Use `AskUserQuestion` with `multiSelect: true` showing only **Missing** modules. If empty, tell the user all known modules are already present and exit cleanly. Use the one-line summaries from `/bitwarden-init:init-workspace`.

5. **Render new content.**

  • Start from the existing file content.
  • For each selected missing module, append its body to the end, separated by a single blank line.
  • Do not modify or reorder existing content.

6. **Diff + confirm.** Write the rendered content to a temp file. Run `diff -u <target> <temp>` and display. Use `AskUserQuestion` with **Apply**, **Show diff again**, **Cancel**.

7. **Backup, then write.**

  • Copy the existing target to `<target>.bak-$(date -u +%Y%m%dT%H%M%SZ)`.
  • Use `Edit` to update the target with the full rendered content. (`Write` works as a fallback if `Edit`'s old-string match fails for any reason — the file always exists at this point.)
  • Clean up the temp preview.

8. **Summary.** Report which modules were added, the backup path, and a reminder that this file applies to every Bitwarden repo under `<workspace-root>`.

Notes

  • This command **only adds** modules. For a from-scratch rebuild, use `/bitwarden-init:init-workspace` with the **Replace** option.
  • If the user added the `sources-of-truth.md` module, newly-appended modules will continue to use the same bracketed reference numbers. The numbers stay meaningful as long as `sources-of-truth.md` is present.
Read more
Ships withai-plugins

A curated collection of plugins for AI-assisted development at Bitwarden. Enables discovery and distribution of quality-controlled plugins for use with Claude Code.

Get the whole plugin

Other commands on ai-plugins.