Skip to content

bmad-quick-dev: replace hardcoded code -r editor opens with OS-aware/configurable file-opening behavior #2119

@thecontstruct

Description

@thecontstruct

Summary

The bmad-quick-dev workflow currently hardcodes code -r when opening review artifacts/files for the user. This assumes VS Code is the correct editor and breaks on machines where code points at a different editor than the one the user is actively using.

This should be replaced with an OS-aware opening strategy, plus an override for workflows that truly need a specific editor command.

Affected locations

Exact hardcoded opener instructions found in the repo:

  1. .claude/skills/bmad-quick-dev/step-05-present.md

    • Current instruction:
    code -r "{absolute-root}" "{absolute-spec-file}"
  2. .claude/skills/bmad-quick-dev/step-oneshot.md

    • Current instruction:
    code -r "{absolute-root}" <absolute-changed-file-paths>

Related VS Code-specific wording:

  1. .claude/skills/bmad-quick-dev/step-03-implement.md
    • Refers to links being “clickable in VS Code”.
    • This is not the main bug, but it shows the workflow is biased toward one editor.

Problem

The workflow currently conflates two separate concerns:

  • opening a file for the user
  • opening a repo/workspace in a specific IDE

Hardcoding code -r causes several issues:

  • Assumes VS Code is installed.
  • Assumes code is the desired editor.
  • Ignores the OS-configured default app for the target file type.
  • Opens the wrong editor on systems where code exists but is not the active IDE.
  • Is not portable across macOS, Linux, and Windows as a “default opener” strategy.

Expected behavior

When a workflow says “open this file for the user”, it should use an OS-appropriate default opener unless the workflow explicitly requires a specific IDE.

Proposed fix

Introduce a small abstraction for “open path for user” and make it OS-specific.

Suggested default behavior:

  • macOS:

    open "{path}"
  • Linux:

    xdg-open "{path}"
  • Windows:

    start "" "{path}"

    or an equivalent PowerShell Start-Process

If the workflow explicitly needs a specific editor/workspace command, that should be configurable rather than hardcoded.

Suggested override options:

  • environment variable such as BMAD_OPEN_COMMAND
  • workflow config
  • user-level config
  • frontmatter setting for workflows that truly require a specific editor

Design guidance

The fallback/default should be:

  • OS-specific
  • editor-agnostic
  • based on the system-configured default app for the file type

It should not simply be changed from code -r to the macOS-only open, because that just swaps one hardcoded platform assumption for another.

Suggested acceptance criteria

  • step-05-present.md no longer hardcodes code -r.
  • step-oneshot.md no longer hardcodes code -r.
  • Default open behavior is OS-specific and uses the platform’s default file opener.
  • There is a documented override for workflows/users that want a specific editor command.
  • The workflow distinguishes between:
    • “open this file/path for the user”
    • “open in a specific IDE/workspace”
  • Failure messaging reflects the new open strategy.

Notes

A fair counterargument is that opening both the repo root and changed files in a single IDE can improve navigation. That’s valid, but it should be an explicit configured mode, not the universal default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    quick-devIssues and PRs related to the bmad-quick-dev workflow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions