Skip to content

refactor(skills): convert market research workflow to native skill#1929

Closed
alexeyv wants to merge 2 commits intobmad-code-org:mainfrom
alexeyv:convert-market-research-skill
Closed

refactor(skills): convert market research workflow to native skill#1929
alexeyv wants to merge 2 commits intobmad-code-org:mainfrom
alexeyv:convert-market-research-skill

Conversation

@alexeyv
Copy link
Copy Markdown
Collaborator

@alexeyv alexeyv commented Mar 12, 2026

Summary

  • convert workflow-market-research.md from launcher-style type:workflow packaging to native type:skill packaging under src/bmm/workflows/1-analysis/research/bmad-market-research/
  • move market step files into the new skill directory and apply only required load-path rewrites ({project-root}/_bmad/.../market-steps/* -> ./market-steps/*)
  • remove market entry from shared src/bmm/workflows/1-analysis/research/bmad-skill-manifest.yaml (domain + technical remain)
  • update dependent references:
    • src/bmm/module-help.csv Market Research row now uses skill:bmad-market-research
    • src/bmm/agents/analyst.agent.yaml MR exec now points to _bmad/bmm/workflows/1-analysis/research/bmad-market-research/workflow.md

Mechanical Equivalence Checks

  • workflow content diff confirms only frontmatter name changed (market-research -> bmad-market-research)
  • all moved market step files are byte-equivalent after the expected absolute->relative path rewrite normalization

Validation

  • node tools/cli/bmad-cli.js install --directory /Users/alex/src/bmad --modules bmm --tools claude-code --yes
  • npm test
  • post-install verification:
    • .claude/skills/bmad-market-research/ exists with self-contained files
    • _bmad/_config/skill-manifest.csv contains bmad-market-research
    • legacy _bmad/bmm/workflows/1-analysis/research/workflow-market-research.md no longer present

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 12, 2026

🤖 Augment PR Summary

Summary: Migrates the Market Research workflow to native skill packaging so it installs as a standalone skill.

Changes: Moves the workflow + step files into src/bmm/workflows/1-analysis/research/bmad-market-research/ and adds SKILL.md + a local type: skill manifest.

Rewrites internal step file load references from installed absolute paths to relative paths within the skill directory.

Adds a self-contained research.template.md alongside the workflow.

Updates the Analyst agent MR entrypoint to the new installed workflow location.

Removes the legacy market workflow entry from the shared 1-analysis/research manifest (domain + technical remain).

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

- Update frontmatter: `stepsCompleted: [1]`
- Add confirmation note to document: "Scope confirmed by user on {{date}}"
- Load: `{project-root}/_bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-behavior.md`
- Load: `./market-steps/step-02-customer-behavior.md`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step file already lives under market-steps/, but the Load: target is ./market-steps/...; relative refs are resolved from the current file’s directory (and validated that way in tools/validate-file-refs.js). That likely resolves to a non-existent market-steps/market-steps/... path and would break step-to-step navigation.

Severity: medium

Other Locations
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-01-init.md:180
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-02-customer-behavior.md:182
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-02-customer-behavior.md:235
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-03-customer-pain-points.md:193
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-03-customer-pain-points.md:247
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-04-customer-decisions.md:203
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-04-customer-decisions.md:257

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 12, 2026

📝 Walkthrough

Walkthrough

The PR reorganizes the market research workflow from workflow-market-research.md to a new skill-based directory structure at bmad-market-research/. It updates the analyst agent reference, converts absolute file paths to relative paths in workflow steps, creates new skill manifests and documentation, and removes the old workflow entry from the research manifest.

Changes

Cohort / File(s) Summary
Agent Configuration
src/bmm/agents/analyst.agent.yaml
Updates market research workflow reference from workflow-market-research.md to bmad-market-research/workflow.md.
Skill Directory Structure
src/bmm/workflows/1-analysis/research/bmad-market-research/SKILL.md, src/bmm/workflows/1-analysis/research/bmad-market-research/bmad-skill-manifest.yaml, src/bmm/workflows/1-analysis/research/bmad-market-research/workflow.md, src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md
Adds new skill infrastructure: SKILL.md documentation file, bmad-skill-manifest.yaml manifest, renames workflow from "market-research" to "bmad-market-research", and creates structured research template with front matter for data population.
Workflow Steps
src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-01-init.md, step-02-customer-behavior.md, step-03-customer-pain-points.md, step-04-customer-decisions.md
Converts absolute \{project-root\} file path references to relative paths for inter-step document loading (e.g., {project-root}/_bmad/bmm/workflows/1-analysis/research/market-steps/step-02..../market-steps/step-02...).
Manifest Cleanup
src/bmm/workflows/1-analysis/research/bmad-skill-manifest.yaml
Removes old workflow-market-research.md workflow entry (including canonicalId, type, and description) from the research skill manifest.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'refactor(skills): convert market research workflow to native skill' accurately and concisely describes the main change—converting a workflow to a native skill with the proper conventional commit format.
Description check ✅ Passed The PR description is directly related to the changeset, providing clear details about converting the market research workflow to a skill, the specific file movements, path rewrites, and validation steps performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan for PR comments
  • Generate coding plan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

🧹 Nitpick comments (4)
src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md (4)

29-29: There is no stable place for citations or references.

source_verification: true implies the final artifact should preserve evidence, but the template has no dedicated References/Sources section for deterministic appends.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`
at line 29, The template lacks a stable, appendable References/Sources section
to preserve evidence when source_verification is true; update the
research.template.md to include a dedicated header (e.g., "## References" or "##
Sources") and a clearly marked placeholder region that the workflow can
deterministically append to, and ensure the workflow that checks the
source_verification flag targets this section for appending citations so every
step can reliably add references.

2-3: Input provenance is captured but never surfaced.

inputDocuments exists only in front matter. If this markdown file is shared outside the workflow runtime, readers lose visibility into which documents informed the report.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`
around lines 2 - 3, The front-matter key inputDocuments is being captured but
not rendered in the template, so add a visible "Input documents" section in the
Markdown body that iterates over inputDocuments and displays each item's
provenance (e.g., title, source/id, URL and a short note) so readers outside the
runtime can see the sources; update the template near where stepsCompleted or
report content is assembled (referencing inputDocuments and stepsCompleted
symbols) to render a friendly list or table and show a placeholder like "No
input documents provided" when the array is empty.

8-8: Goals are stored as an opaque string.

research_goals is naturally multi-item, but the template models it as a single scalar. That forces later steps to parse ad hoc delimiters instead of working with structured data.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`
at line 8, The template models research_goals as a single scalar string, making
downstream steps parse ad-hoc delimiters; change research_goals to a structured
YAML sequence (i.e., a list/array) in the template so it produces an actual
array of goal items, and update any consumers to expect and iterate over
research_goals as an array rather than splitting a string.

23-24: Give methodology its own section.

The placeholder says “overview and methodology,” but the template only defines ## Research Overview. Appending both into one bucket makes downstream output order less predictable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`
around lines 23 - 24, The template currently defines only "## Research
Overview"; split the combined placeholder into two distinct sections by adding a
separate "## Methodology" header (e.g., keep "## Research Overview" for summary
content and add "## Methodology" for approach/techniques), update any
placeholders or prompts that reference "overview and methodology" to map to
these two headers, and ensure downstream generators consume "Research Overview"
and "Methodology" separately so output order is predictable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-02-customer-behavior.md`:
- Line 182: The Load directive in step-02-customer-behavior.md incorrectly
duplicates the directory prefix ("Load:
`./market-steps/step-03-customer-pain-points.md`"); update the Load line to
reference the sibling file directly (e.g., `Load:
./step-03-customer-pain-points.md`), ensuring the "Load" token and the target
filename `step-03-customer-pain-points.md` are updated accordingly so the
relative link resolves within the same market-steps directory.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-03-customer-pain-points.md`:
- Line 193: The link text currently references
`./market-steps/step-04-customer-decisions.md` which duplicates the containing
directory name; update the reference in step-03-customer-pain-points.md by
removing the extra `market-steps/` prefix so it reads
`./step-04-customer-decisions.md` (or the correct relative path within the same
directory) to fix the broken path.
- Line 247: In
src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-03-customer-pain-points.md
the NEXT STEP link incorrectly points to
"./market-steps/step-04-customer-decisions.md"; update that reference to the
correct relative path for the next step (replace
"./market-steps/step-04-customer-decisions.md" with
"./step-04-customer-decisions.md") so the "After user selects 'C'..."
instruction loads the actual step-04 file.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-04-customer-decisions.md`:
- Line 203: The markdown contains a broken path: the Load entry uses a
duplicated "market-steps/" prefix
("./market-steps/step-05-competitive-analysis.md"); update that reference to the
correct relative path by removing the extra segment so it reads
"./step-05-competitive-analysis.md" (or the proper relative path from this file)
and verify any other Load references follow the same pattern; locate the string
"Load: `./market-steps/step-05-competitive-analysis.md`" to apply the change.
- Line 257: Update the NEXT STEP link in step-04-customer-decisions.md: the line
that reads "After user selects 'C', load
`./market-steps/step-05-competitive-analysis.md`..." uses an incorrect relative
path; change it to reference the sibling file
`./step-05-competitive-analysis.md` (i.e., update the string in the line inside
step-04-customer-decisions.md so it points to
./step-05-competitive-analysis.md).

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`:
- Around line 15-19: The template's header only shows {{research_type}} so runs
are indistinguishable; update the header in research.template.md to include the
{{research_topic}} variable (either appended to the title, e.g. "Research
Report: {{research_type}} — {{research_topic}}", or added as a separate metadata
line like "Topic: {{research_topic}}") and ensure the metadata block contains
Date: {{date}} and Author: {{user_name}} unchanged; locate the title and
metadata lines that reference {{research_type}} and add or insert
{{research_topic}} accordingly.
- Around line 23-29: The template currently captures a front-matter field named
research_goals but never renders it into the document body; update the template
(research.template.md) to display the research_goals front-matter under the
"Research Overview" section by adding a clear "Goals" or "Scope" subsection that
injects the research_goals value so readers can see the declared goals when the
report is rendered (reference the research_goals front-matter symbol and the
"Research Overview" heading when making the change).
- Around line 11-12: The template currently hardcodes web_research_enabled: true
and source_verification: true which bakes runtime policy into the artifact;
change the template to inherit these flags from execution context instead of
fixed booleans—remove the hardcoded true values for web_research_enabled and
source_verification and replace them with context-driven placeholders or
optional keys (e.g., templated variables like {{web_research_enabled}} /
{{source_verification}} or omit the keys so the executor supplies defaults) so
offline or no-browse runs are respected; update any code that renders this
template to pass the runtime flags into these placeholders (look for usages
referencing web_research_enabled and source_verification).
- Line 25: Replace the visible placeholder "[Research overview and methodology
will be appended here]" in research.template.md with a non-rendering HTML
comment (e.g. <!-- Research overview and methodology will be appended here -->)
or remove the text entirely so the scaffold does not leak into partial outputs;
update the template section that contains that exact bracketed placeholder to
use the HTML comment or be left empty.
- Around line 2-5: The template sets stepsCompleted: [] but hardcodes lastStep:
1 which is inconsistent; remove the hardcoded lastStep key or set it to 0 in
research.template.md so the initial state matches an empty stepsCompleted, and
if lastStep is meant for resume logic instead of being a static field, change
runtime code to compute lastStep dynamically as the max value of the
stepsCompleted array (e.g., lastStep = Math.max(...stepsCompleted, 0)) rather
than relying on a hardcoded template value.
- Around line 6-10: The YAML frontmatter currently wraps interpolated values
with single quotes (fields research_type, research_topic, research_goals,
user_name, date), which allows embedded apostrophes/newlines to break parsing;
update those fields to use double-quoted interpolation (e.g., change
single-quoted '{{research_topic}}' to double-quoted "{{research_topic}}") so
user-supplied values are properly escaped by YAML parsers.

---

Nitpick comments:
In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`:
- Line 29: The template lacks a stable, appendable References/Sources section to
preserve evidence when source_verification is true; update the
research.template.md to include a dedicated header (e.g., "## References" or "##
Sources") and a clearly marked placeholder region that the workflow can
deterministically append to, and ensure the workflow that checks the
source_verification flag targets this section for appending citations so every
step can reliably add references.
- Around line 2-3: The front-matter key inputDocuments is being captured but not
rendered in the template, so add a visible "Input documents" section in the
Markdown body that iterates over inputDocuments and displays each item's
provenance (e.g., title, source/id, URL and a short note) so readers outside the
runtime can see the sources; update the template near where stepsCompleted or
report content is assembled (referencing inputDocuments and stepsCompleted
symbols) to render a friendly list or table and show a placeholder like "No
input documents provided" when the array is empty.
- Line 8: The template models research_goals as a single scalar string, making
downstream steps parse ad-hoc delimiters; change research_goals to a structured
YAML sequence (i.e., a list/array) in the template so it produces an actual
array of goal items, and update any consumers to expect and iterate over
research_goals as an array rather than splitting a string.
- Around line 23-24: The template currently defines only "## Research Overview";
split the combined placeholder into two distinct sections by adding a separate
"## Methodology" header (e.g., keep "## Research Overview" for summary content
and add "## Methodology" for approach/techniques), update any placeholders or
prompts that reference "overview and methodology" to map to these two headers,
and ensure downstream generators consume "Research Overview" and "Methodology"
separately so output order is predictable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f35a6fe6-9ade-4e94-b3e1-b7a6da79abe0

📥 Commits

Reviewing files that changed from the base of the PR and between 861716f and 0b5e900.

⛔ Files ignored due to path filters (1)
  • src/bmm/module-help.csv is excluded by !**/*.csv
📒 Files selected for processing (12)
  • src/bmm/agents/analyst.agent.yaml
  • src/bmm/workflows/1-analysis/research/bmad-market-research/SKILL.md
  • src/bmm/workflows/1-analysis/research/bmad-market-research/bmad-skill-manifest.yaml
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-01-init.md
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-02-customer-behavior.md
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-03-customer-pain-points.md
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-04-customer-decisions.md
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-05-competitive-analysis.md
  • src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-06-research-completion.md
  • src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md
  • src/bmm/workflows/1-analysis/research/bmad-market-research/workflow.md
  • src/bmm/workflows/1-analysis/research/bmad-skill-manifest.yaml
💤 Files with no reviewable changes (1)
  • src/bmm/workflows/1-analysis/research/bmad-skill-manifest.yaml

- **CONTENT ALREADY WRITTEN TO DOCUMENT**
- Update frontmatter: `stepsCompleted: [1, 2]`
- Load: `{project-root}/_bmad/bmm/workflows/1-analysis/research/market-steps/step-03-customer-pain-points.md`
- Load: `./market-steps/step-03-customer-pain-points.md`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Broken path reference: duplicates market-steps/ prefix.

Same issue as step-01-init.md. Since this file is inside market-steps/, the Load directive should reference the sibling file directly.

🐛 Proposed fix
-- Load: `./market-steps/step-03-customer-pain-points.md`
+- Load: `./step-03-customer-pain-points.md`
🧰 Tools
🪛 GitHub Check: validate

[warning] 182-182:
Broken reference: ./market-steps/step-03-customer-pain-points.md → src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/market-steps/step-03-customer-pain-points.md

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-02-customer-behavior.md`
at line 182, The Load directive in step-02-customer-behavior.md incorrectly
duplicates the directory prefix ("Load:
`./market-steps/step-03-customer-pain-points.md`"); update the Load line to
reference the sibling file directly (e.g., `Load:
./step-03-customer-pain-points.md`), ensuring the "Load" token and the target
filename `step-03-customer-pain-points.md` are updated accordingly so the
relative link resolves within the same market-steps directory.

- **CONTENT ALREADY WRITTEN TO DOCUMENT**
- Update frontmatter: `stepsCompleted: [1, 2, 3]`
- Load: `{project-root}/_bmad/bmm/workflows/1-analysis/research/market-steps/step-04-customer-decisions.md`
- Load: `./market-steps/step-04-customer-decisions.md`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Broken path reference: duplicates market-steps/ prefix.

🐛 Proposed fix
-- Load: `./market-steps/step-04-customer-decisions.md`
+- Load: `./step-04-customer-decisions.md`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Load: `./market-steps/step-04-customer-decisions.md`
- Load: `./step-04-customer-decisions.md`
🧰 Tools
🪛 GitHub Check: validate

[warning] 193-193:
Broken reference: ./market-steps/step-04-customer-decisions.md → src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/market-steps/step-04-customer-decisions.md

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-03-customer-pain-points.md`
at line 193, The link text currently references
`./market-steps/step-04-customer-decisions.md` which duplicates the containing
directory name; update the reference in step-03-customer-pain-points.md by
removing the extra `market-steps/` prefix so it reads
`./step-04-customer-decisions.md` (or the correct relative path within the same
directory) to fix the broken path.

## NEXT STEP:

After user selects 'C', load `{project-root}/_bmad/bmm/workflows/1-analysis/research/market-steps/step-04-customer-decisions.md` to analyze customer decision processes, journey mapping, and decision factors for {{research_topic}}.
After user selects 'C', load `./market-steps/step-04-customer-decisions.md` to analyze customer decision processes, journey mapping, and decision factors for {{research_topic}}.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

NEXT STEP documentation also has incorrect path.

🐛 Proposed fix
-After user selects 'C', load `./market-steps/step-04-customer-decisions.md` to analyze customer decision processes, journey mapping, and decision factors for {{research_topic}}.
+After user selects 'C', load `./step-04-customer-decisions.md` to analyze customer decision processes, journey mapping, and decision factors for {{research_topic}}.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
After user selects 'C', load `./market-steps/step-04-customer-decisions.md` to analyze customer decision processes, journey mapping, and decision factors for {{research_topic}}.
After user selects 'C', load `./step-04-customer-decisions.md` to analyze customer decision processes, journey mapping, and decision factors for {{research_topic}}.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-03-customer-pain-points.md`
at line 247, In
src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-03-customer-pain-points.md
the NEXT STEP link incorrectly points to
"./market-steps/step-04-customer-decisions.md"; update that reference to the
correct relative path for the next step (replace
"./market-steps/step-04-customer-decisions.md" with
"./step-04-customer-decisions.md") so the "After user selects 'C'..."
instruction loads the actual step-04 file.

- **CONTENT ALREADY WRITTEN TO DOCUMENT**
- Update frontmatter: `stepsCompleted: [1, 2, 3, 4]`
- Load: `{project-root}/_bmad/bmm/workflows/1-analysis/research/market-steps/step-05-competitive-analysis.md`
- Load: `./market-steps/step-05-competitive-analysis.md`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Broken path reference: duplicates market-steps/ prefix.

🐛 Proposed fix
-- Load: `./market-steps/step-05-competitive-analysis.md`
+- Load: `./step-05-competitive-analysis.md`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Load: `./market-steps/step-05-competitive-analysis.md`
- Load: `./step-05-competitive-analysis.md`
🧰 Tools
🪛 GitHub Check: validate

[warning] 203-203:
Broken reference: ./market-steps/step-05-competitive-analysis.md → src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/market-steps/step-05-competitive-analysis.md

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-04-customer-decisions.md`
at line 203, The markdown contains a broken path: the Load entry uses a
duplicated "market-steps/" prefix
("./market-steps/step-05-competitive-analysis.md"); update that reference to the
correct relative path by removing the extra segment so it reads
"./step-05-competitive-analysis.md" (or the proper relative path from this file)
and verify any other Load references follow the same pattern; locate the string
"Load: `./market-steps/step-05-competitive-analysis.md`" to apply the change.

## NEXT STEP:

After user selects 'C', load `{project-root}/_bmad/bmm/workflows/1-analysis/research/market-steps/step-05-competitive-analysis.md` to analyze competitive landscape, market positioning, and competitive strategies for {{research_topic}}.
After user selects 'C', load `./market-steps/step-05-competitive-analysis.md` to analyze competitive landscape, market positioning, and competitive strategies for {{research_topic}}.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

NEXT STEP documentation also has incorrect path.

🐛 Proposed fix
-After user selects 'C', load `./market-steps/step-05-competitive-analysis.md` to analyze competitive landscape, market positioning, and competitive strategies for {{research_topic}}.
+After user selects 'C', load `./step-05-competitive-analysis.md` to analyze competitive landscape, market positioning, and competitive strategies for {{research_topic}}.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
After user selects 'C', load `./market-steps/step-05-competitive-analysis.md` to analyze competitive landscape, market positioning, and competitive strategies for {{research_topic}}.
After user selects 'C', load `./step-05-competitive-analysis.md` to analyze competitive landscape, market positioning, and competitive strategies for {{research_topic}}.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-04-customer-decisions.md`
at line 257, Update the NEXT STEP link in step-04-customer-decisions.md: the
line that reads "After user selects 'C', load
`./market-steps/step-05-competitive-analysis.md`..." uses an incorrect relative
path; change it to reference the sibling file
`./step-05-competitive-analysis.md` (i.e., update the string in the line inside
step-04-customer-decisions.md so it points to
./step-05-competitive-analysis.md).

Comment on lines +6 to +10
research_type: '{{research_type}}'
research_topic: '{{research_topic}}'
research_goals: '{{research_goals}}'
user_name: '{{user_name}}'
date: '{{date}}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find how markdown templates are rendered and whether values are YAML-escaped before write.
rg -n -C4 '\{\{research_(type|topic|goals)\}\}|\{\{user_name\}\}|\{\{date\}\}' src tools
rg -n -C4 'gray-matter|front.?matter|js-yaml|yaml|mustache|handlebars|template' src tools

Repository: bmad-code-org/BMAD-METHOD

Length of output: 50385


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find template processing code - search for tools that parse/render these templates
fd -e js -e ts -e mjs | xargs rg -l 'template|frontmatter|yaml|mustache|handlebars' | head -20

# Search specifically in tools/cli for template rendering logic
fd -e js -e ts -e mjs -p 'tools/cli' | xargs rg -l 'render|interpolate|substitute|{{' 2>/dev/null | head -20

Repository: bmad-code-org/BMAD-METHOD

Length of output: 780


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look for the actual template rendering code in tools/cli/installers
find tools/cli/installers -name '*.js' -o -name '*.ts' | head -20

# Check what's in the _config-driven.js file mentioned in learnings
cat tools/cli/installers/lib/ide/_config-driven.js 2>/dev/null | head -100 || echo "File not found or too large"

Repository: bmad-code-org/BMAD-METHOD

Length of output: 4895


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for where {{research_type}} and similar placeholders are interpolated
rg -n 'research\.template\.md|research_type|research_topic|research_goals' tools src --type md --type js --type ts | grep -E '\.(js|ts|md):' | head -30

Repository: bmad-code-org/BMAD-METHOD

Length of output: 5239


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look at the template engine
wc -l tools/cli/lib/agent/template-engine.js
head -150 tools/cli/lib/agent/template-engine.js

Repository: bmad-code-org/BMAD-METHOD

Length of output: 4700


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find where research.template.md is actually used/rendered
rg -n 'research\.template|research_type.*research_topic' src tools --context 3 | head -80

Repository: bmad-code-org/BMAD-METHOD

Length of output: 3412


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check how YAML is being written with placeholders in _config-driven.js
grep -n -A5 -B5 'yaml.stringify\|yaml.dump\|{{' tools/cli/installers/lib/ide/_config-driven.js | head -100

Repository: bmad-code-org/BMAD-METHOD

Length of output: 4001


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find where research.template.md is actually read and processed
rg -n 'research.template.md' src tools --context 5

Repository: bmad-code-org/BMAD-METHOD

Length of output: 4725


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look at how the research template file is used - find references
fd -type f -name '*.md' -o -name '*.js' | xargs rg -l 'research\.template' | head -10

Repository: bmad-code-org/BMAD-METHOD

Length of output: 462


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check the actual research.template.md file to see current state
cat src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md

Repository: bmad-code-org/BMAD-METHOD

Length of output: 649


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look for any input validation on research_topic, research_goals before they're interpolated
rg -n 'research_topic|research_goals|research_type' src/bmm/workflows/1-analysis/research --context 3 | grep -E '(validate|sanitize|escape|check)' || echo "No validation found"

# Check if there's any escaping happening in workflow.md files that invoke the template
grep -n -A10 -B10 'research.template.md' src/bmm/workflows/1-analysis/research/bmad-market-research/workflow.md

Repository: bmad-code-org/BMAD-METHOD

Length of output: 1079


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Test: what happens if we have an apostrophe in a single-quoted YAML string
python3 << 'EOF'
import yaml

# This is what the template produces with user input containing an apostrophe
test_yaml = """---
research_topic: '{{research_topic}}'
---"""

# Simulate interpolation with problematic input
problematic_input = "what's trending in AI"
rendered = test_yaml.replace('{{research_topic}}', problematic_input)
print("Rendered YAML:")
print(rendered)
print("\nAttempting to parse:")
try:
    parsed = yaml.safe_load(rendered)
    print("Parsed successfully:", parsed)
except yaml.YAMLError as e:
    print("YAML ERROR (ISSUE CONFIRMED):", str(e)[:200])
EOF

Repository: bmad-code-org/BMAD-METHOD

Length of output: 384


Quote YAML frontmatter values with double quotes to escape special characters.

Lines 6-10 interpolate arbitrary user input directly into single-quoted YAML. An apostrophe or embedded newline breaks the frontmatter; for example, if research_topic contains "what's trending", it produces:

research_topic: 'what's trending'

which fails YAML parsing.

Change to:

research_type: "{{research_type}}"
research_topic: "{{research_topic}}"
research_goals: "{{research_goals}}"
user_name: "{{user_name}}"
date: "{{date}}"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`
around lines 6 - 10, The YAML frontmatter currently wraps interpolated values
with single quotes (fields research_type, research_topic, research_goals,
user_name, date), which allows embedded apostrophes/newlines to break parsing;
update those fields to use double-quoted interpolation (e.g., change
single-quoted '{{research_topic}}' to double-quoted "{{research_topic}}") so
user-supplied values are properly escaped by YAML parsers.

Comment on lines +11 to +12
web_research_enabled: true
source_verification: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Do not hardcode web access and source verification on.

This bakes policy into the artifact instead of inheriting execution context. Offline runs or user-requested no-browse sessions will still serialize as enabled.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`
around lines 11 - 12, The template currently hardcodes web_research_enabled:
true and source_verification: true which bakes runtime policy into the artifact;
change the template to inherit these flags from execution context instead of
fixed booleans—remove the hardcoded true values for web_research_enabled and
source_verification and replace them with context-driven placeholders or
optional keys (e.g., templated variables like {{web_research_enabled}} /
{{source_verification}} or omit the keys so the executor supplies defaults) so
offline or no-browse runs are respected; update any code that renders this
template to pass the runtime flags into these placeholders (look for usages
referencing web_research_enabled and source_verification).

Comment on lines +15 to +19
# Research Report: {{research_type}}

**Date:** {{date}}
**Author:** {{user_name}}
**Research Type:** {{research_type}}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

The report header omits the actual topic.

The artifact shows only the research type, so two runs of the same type are indistinguishable at a glance. research_topic should be in the title or metadata block.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`
around lines 15 - 19, The template's header only shows {{research_type}} so runs
are indistinguishable; update the header in research.template.md to include the
{{research_topic}} variable (either appended to the title, e.g. "Research
Report: {{research_type}} — {{research_topic}}", or added as a separate metadata
line like "Topic: {{research_topic}}") and ensure the metadata block contains
Date: {{date}} and Author: {{user_name}} unchanged; locate the title and
metadata lines that reference {{research_type}} and add or insert
{{research_topic}} accordingly.

Comment on lines +23 to +29
## Research Overview

[Research overview and methodology will be appended here]

---

<!-- Content will be appended sequentially through research workflow steps -->
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

The declared goals never appear in the document body.

You capture research_goals in front matter, but readers of the rendered report cannot see the scope they are supposed to judge the findings against.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`
around lines 23 - 29, The template currently captures a front-matter field named
research_goals but never renders it into the document body; update the template
(research.template.md) to display the research_goals front-matter under the
"Research Overview" section by adding a clear "Goals" or "Scope" subsection that
injects the research_goals value so readers can see the declared goals when the
report is rendered (reference the research_goals front-matter symbol and the
"Research Overview" heading when making the change).


## Research Overview

[Research overview and methodology will be appended here]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Visible scaffold text will leak into partial outputs.

If the workflow stops early, this bracketed placeholder becomes user-facing content in the saved report. Make it an HTML comment or leave the section empty.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`
at line 25, Replace the visible placeholder "[Research overview and methodology
will be appended here]" in research.template.md with a non-rendering HTML
comment (e.g. <!-- Research overview and methodology will be appended here -->)
or remove the text entirely so the scaffold does not leak into partial outputs;
update the template section that contains that exact bracketed placeholder to
use the HTML comment or be left empty.

@alexeyv
Copy link
Copy Markdown
Collaborator Author

alexeyv commented Mar 15, 2026

Already happened.

@alexeyv alexeyv closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant