Skip to content

Gate direct bd calls in commands/skills on useBeads userConfig #53

@cofin

Description

@cofin

Background

plugin.json declares a useBeads boolean in userConfig (default true) so users can disable Beads task persistence and run Flow in degraded mode. As of #TBD (the manifest fix that wired up userConfig reads), the SessionStart hook (hooks/detect-env.sh and hooks/detect-env.ps1) honors this toggle: detect_beads() and active_work() both short-circuit when CLAUDE_PLUGIN_OPTION_USEBEADS != true.

However, direct bd invocations elsewhere in the plugin are still ungated. If a user disables Beads via /config, the SessionStart context correctly reports "disabled," but slash commands and skills can still try to shell out to bd and either succeed (defeating the toggle) or fail noisily (if bd isn't installed).

Scope

Audit and gate all direct bd call sites in:

  • commands/ — every *.md slash command that invokes bd in a bash block
  • skills/ — every skill that calls bd directly or instructs the agent to
  • tools/ — any Python helpers that shell out to bd
  • agents/ — agent prompts that assume bd availability

For each site, either:

  1. Skip cleanly when useBeads=false (preferred for non-interactive contexts), or
  2. Surface a clear "Beads is disabled" message and exit with a non-error status (preferred for slash commands the user explicitly invoked).

Per the Plugins Reference, the env var CLAUDE_PLUGIN_OPTION_USEBEADS is available to all plugin subprocesses, and \${user_config.useBeads} is available for template substitution in command/MCP/LSP configs.

Acceptance criteria

  • Grep for \bbd\b across commands/, skills/, tools/, agents/ returns no ungated invocations
  • Setting useBeads=false and invoking each affected command produces a clean "disabled" message instead of a bd: command not found error or silent success
  • PowerShell parity: same gating applied wherever .ps1 mirrors exist

Related

  • Manifest fix and SessionStart hook gating (the useBeads toggle was introduced there but only enforced in detect-env.{sh,ps1})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions