refactor(skills): convert market-research to native skill directory#1994
refactor(skills): convert market-research to native skill directory#1994
Conversation
📝 WalkthroughWalkthroughThis PR refactors the market research workflow from a file-based workflow into a native skill package. The analyst agent's market research trigger now invokes the skill "skill:bmad-market-research" instead of a filesystem workflow path. A new skill directory structure with step-based workflow documentation, templates, and manifests is introduced. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 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. Comment |
🤖 Augment PR SummarySummary: This PR migrates the legacy Changes:
Technical Notes: The new workflow is structured as a multi-step research process that writes into a templated output document and tracks progress via 🤖 Was this summary useful? React with 👍 or 👎 |
| - Competitive threats and challenges documented | ||
|
|
||
| **Ready to complete the market research?** | ||
| [C] Complete Research - Save final document and conclude |
There was a problem hiding this comment.
Step 5 currently offers [C] Complete Research and ends the workflow, but this skill also includes step-06-research-completion.md, so the final synthesis step would never run. Consider routing to step 06 (like the technical research workflow does) before completion.
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| #### If 'C' (Complete Research): | ||
|
|
||
| - Append the final content to the research document | ||
| - Update frontmatter: `stepsCompleted: [1, 2, 3]` |
There was a problem hiding this comment.
The stepsCompleted update here ([1, 2, 3]) conflicts with the step-5 protocol above and would regress progress tracking for the output document. This should reflect all completed steps through the current step.
Severity: medium
Other Locations
src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-05-competitive-analysis.md:20
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
|
|
||
| - **Replace** the template placeholder `[Research overview and methodology will be appended here]` in the `## Research Overview` section near the top of the document with a concise 2-3 paragraph overview summarizing the research scope, key findings, and a pointer to the full executive summary in the Research Synthesis section | ||
| - Append the final content to the research document | ||
| - Update frontmatter: `stepsCompleted: [1, 2, 3, 4]` |
There was a problem hiding this comment.
Step 6 updates stepsCompleted to [1, 2, 3, 4], which doesn’t match the step number and conflicts with the protocol that says to mark [1, 2, 3, 4, 5, 6]. This inconsistency can break workflow state/progress handling.
Severity: medium
Other Locations
src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-06-research-completion.md:20src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-06-research-completion.md:451
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
|
|
||
| #### If 'C' (Complete Research): | ||
|
|
||
| - **Replace** the template placeholder `[Research overview and methodology will be appended here]` in the `## Research Overview` section near the top of the document with a concise 2-3 paragraph overview summarizing the research scope, key findings, and a pointer to the full executive summary in the Research Synthesis section |
There was a problem hiding this comment.
This instruction references “the full executive summary in the Research Synthesis section”, but the provided document structure uses an ## Executive Summary section and doesn’t define a “Research Synthesis” section. That mismatch may confuse the agent about where to point readers or what to generate.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
60920ae to
87f4762
Compare
There was a problem hiding this comment.
Actionable comments posted: 16
🧹 Nitpick comments (2)
src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md (1)
15-20: Top-level report title should key off topic, not type.
# Research Report: {{research_type}}produces low-signal titles (e.g., “market”). Use{{research_topic}}so artifacts are self-identifying when opened outside path context.Suggested fix
-# Research Report: {{research_type}} +# Research Report: {{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/research.template.md` around lines 15 - 20, Replace the top-level heading so the title uses the specific topic instead of the generic type: change the header string referenced in the template (currently "# Research Report: {{research_type}}") to use "{{research_topic}}" (e.g., "# Research Report: {{research_topic}}"); you can keep the existing "Research Type: {{research_type}}" metadata line unchanged so type is still recorded below the title.src/bmm/workflows/1-analysis/research/workflow-market-research.md (1)
4-4:standalone: falseshould be paired with a deprecation redirect to prevent logic drift.The file is now hidden from standalone launch, but it still carries full runnable instructions. That creates dual sources of truth with
bmad-market-research/workflow.md.Suggested fix
--- name: market-research description: 'Conduct market research on competition and customers. Use when the user says "create a market research report about [business idea]".' standalone: false --- -# Market Research Workflow -... +This workflow has been converted to native skill execution. +Use: `skill:bmad-market-research` +Source of truth: `src/bmm/workflows/1-analysis/research/bmad-market-research/workflow.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/workflow-market-research.md` at line 4, This file sets "standalone: false" but still contains full runnable instructions, causing dual sources of truth; update the same file to add a deprecation/redirect block that clearly points users to bmad-market-research/workflow.md (e.g., a top-of-file notice or YAML frontmatter redirect) and remove or collapse the runnable steps into a short deprecation message so that "standalone: false" is paired with an explicit redirect and no duplicate runnable content.
🤖 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-01-init.md`:
- Around line 73-115: Add an explicit document language field to the artifact
template and enforce it when writing: update the markdown block to include a
"Document Language: {{document_output_language}}" (or similar) metadata line
near "Research Initialization"/the header and ensure the writer that produces
this artifact checks and uses the {{document_output_language}} placeholder
rather than only the spoken language; locate the template in step-01-init.md and
modify the initialization section where "Research Initialization" and
"Topic/Goals/Date" are set so the document output language is unambiguous and
required.
- Around line 120-134: The opening presentation quote starting with "I've
documented our understanding and initial scope for **{{research_topic}}**..." is
never closed; add a matching closing quote mark (") after the final paragraph
("**Document Status:** Initial scope written to research file for your review")
or immediately before the choice lines ([C] Continue...) so the quoted block is
explicitly terminated and prevents prompt-boundary leakage; update the content
in step-01-init.md around the block that contains the "{{research_topic}}" text
accordingly.
In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-02-customer-behavior.md`:
- Around line 95-97: The immediate-write flow ("WRITE IMMEDIATELY TO DOCUMENT")
can create duplicate "## Customer Behavior and Segments" entries on retries;
update the step logic so that before writing it searches the document for the
header "## Customer Behavior and Segments" and, if found, replaces that entire
section content with the new analysis, otherwise appends the section; apply the
same replace-if-present/append-if-missing behavior to the other identical write
location referenced in the file to prevent duplicates on regeneration.
- Around line 174-186: Update the "6. Handle Continue Selection" section to
remove the contradictory "Save this to document" wording and make the continue
action explicit: change the 'C' (Continue) prompt wording to "Proceed to next
step" (or equivalent), keep the frontmatter update `stepsCompleted: [1, 2]` and
the load instruction `./step-03-customer-pain-points.md`, and retain the
"Content is already written to document" note under APPEND TO DOCUMENT so there
is no mention of additional saving in this step.
In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-03-customer-pain-points.md`:
- Around line 95-97: Ensure writes are idempotent by detecting the markdown
header "## Customer Pain Points and Needs" before writing: if that header
exists, replace the content from that header until the next top-level "## "
header (or EOF) in-place; otherwise append the new section. Implement this logic
in the module that saves/updates step content so repeated runs update the
existing section instead of duplicating it, and apply the same replace-in-place
behavior for the other pain-point sections referenced in this step.
In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-04-customer-decisions.md`:
- Around line 195-207: The Continue option currently says “Save this to
document” but the document was already written in step 4, causing inconsistent
messaging; update the block for the 'C' (Continue) option in
step-04-customer-decisions.md so it does not instruct another save/append and
only advances routing: replace the line "Continue - Save this to document and
proceed to competitive analysis" and remove "CONTENT ALREADY WRITTEN TO
DOCUMENT" / "No additional append needed" ambiguities, and make the action
explicitly: update frontmatter stepsCompleted: [1, 2, 3, 4] and Load:
./step-05-competitive-analysis.md (i.e., proceed to next step without
re-saving).
In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-05-competitive-analysis.md`:
- Around line 118-125: Add an idempotency guard to the "When user selects 'C'"
path so repeated 'C' actions or retries do not duplicate the Competitive
section: before appending the final content (the structure referenced from step
2), search the target document for the header string "## Competitive Landscape"
and if found, replace or update that existing section rather than appending a
new one; otherwise append as before. Ensure the frontmatter/stepsCompleted
update logic still runs (e.g., update `stepsCompleted: [1, 2, 3]`) after the
replace/append action so workflow state remains correct.
- Around line 116-121: The completion branch in step-05 currently says to
"Complete the market research workflow" directly; change the branch for the "If
'C' (Complete Research)" path to route to the dedicated completion step file
(step-06-research-completion.md) instead of terminating here, ensure you append
the final content and update frontmatter (stepsCompleted: [1,2,3]) before
redirecting to step-06-research-completion.md so the explicit completion step
runs.
- Around line 119-120: The frontmatter on step-05-competitive-analysis.md
incorrectly sets stepsCompleted: [1, 2, 3], which regresses completion state;
update the frontmatter to include the current step (e.g., stepsCompleted: [1, 2,
3, 4, 5] or whatever sequence your workflow uses) so the state advances through
step 5, and verify the frontmatter key name stepsCompleted remains unchanged and
consistent with other steps in the workflow.
In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-06-research-completion.md`:
- Line 57: The search prompts in step-06 currently use a hardcoded query "market
entry strategies best practices" (and the similar instance at line 69) which
ignores the {{research_topic}} variable; update both search instructions to
include the template variable so queries are topic-specific (e.g., replace the
literal query with a templated prompt that incorporates {{research_topic}} such
as "Search the web: \"{{research_topic}} market entry strategies best
practices\"" or a similar phrasing that injects {{research_topic}} into the
query) so results are focused on the given research topic.
- Around line 451-452: Update the stale completion summary text in
step-06-research-completion.md: replace the line "All market research steps
completed (1-4)" with an accurate statement reflecting the six-step workflow
(e.g., "All market research steps completed (1-6)"), and ensure any adjacent
summary lines (like "Comprehensive market research document generated") remain
correct or are expanded to reflect final artifacts of steps 1–6; search for the
exact string "All market research steps completed (1-4)" to locate and update
the content.
- Around line 350-353: The hardcoded "Market Confidence Level: High" and
"authoritative" must be replaced with computed assertions derived from the run's
evidence and source quality: replace the literal header block that contains
"Market Confidence Level" with an interpolated value (e.g.,
{{confidence_level}}) computed from metrics like evidenceCoverage,
sourceQualityScore, and authoritativeSourceCount, and only append the term
"authoritative" when authoritativeSourceCount exceeds a configured threshold;
also include a brief evidence summary (e.g., total sources and top-quality
sources) or a link/reference to the evidence summary (e.g.,
{{evidence_summary}}) so the statement reflects actual data rather than
hardcoded text.
In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`:
- Around line 2-5: The template initializes inconsistent workflow state:
stepsCompleted is an empty array while lastStep is 1; update the template so
lastStep reflects stepsCompleted (e.g., set lastStep: 0) or compute lastStep
from stepsCompleted.length at bootstrap; modify the research template to either
set lastStep to 0 or add logic in the workflow loader to derive lastStep =
stepsCompleted.length to ensure resume/initialization logic is consistent (refer
to the stepsCompleted and lastStep fields in the research.template.md).
In `@src/bmm/workflows/1-analysis/research/bmad-market-research/workflow.md`:
- Line 48: The workflow currently says to create an “exact copy” of
./research.template.md which leaves template placeholders unresolved; change the
creation step to render the template with explicit variables (e.g.,
research_topic, date, user_name, etc.) and write the resulting rendered content
to {planning_artifacts}/research/market-{{research_topic}}-research-{{date}}.md
so no {{...}} tokens remain; implement this by invoking your template rendering
utility (or a render_template(template_path, context) step) using the workflow
inputs for research_topic and date and any other required fields, and validate
the produced file contains no unresolved placeholders before finishing.
- Line 48: The filename template currently embeds the raw user-derived
{{research_topic}} into the path
({planning_artifacts}/research/market-{{research_topic}}-research-{{date}}.md);
change this to use a sanitized slug (e.g., slugified_research_topic) instead of
the raw value by adding a sanitizer function (sanitize_slug/slugify) that
strips/normalizes unsafe characters, trims length, and rejects path separators,
then use that sanitized value in the filename generation and when creating the
starter file (copying research.template.md into the new path).
- Line 53: The workflow enforces {communication_language} but never declares a
write-language contract for generated artifacts; update the workflow spec
(bmad-market-research workflow.md) to add an explicit {document_output_language}
requirement and propagate it to any agent output/templates that produce written
artifacts (e.g., artifact generation, report templates, and agent response
handlers) so that functions/components that produce documents must receive and
use {document_output_language} instead of relying only on
{communication_language}. Ensure the new contract is validated in the workflow
preamble and referenced where templates/agents render text.
---
Nitpick comments:
In
`@src/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md`:
- Around line 15-20: Replace the top-level heading so the title uses the
specific topic instead of the generic type: change the header string referenced
in the template (currently "# Research Report: {{research_type}}") to use
"{{research_topic}}" (e.g., "# Research Report: {{research_topic}}"); you can
keep the existing "Research Type: {{research_type}}" metadata line unchanged so
type is still recorded below the title.
In `@src/bmm/workflows/1-analysis/research/workflow-market-research.md`:
- Line 4: This file sets "standalone: false" but still contains full runnable
instructions, causing dual sources of truth; update the same file to add a
deprecation/redirect block that clearly points users to
bmad-market-research/workflow.md (e.g., a top-of-file notice or YAML frontmatter
redirect) and remove or collapse the runnable steps into a short deprecation
message so that "standalone: false" is paired with an explicit redirect and no
duplicate runnable content.
🪄 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: c875299c-1d04-4013-8af0-1a2de5ecd150
⛔ Files ignored due to path filters (1)
src/bmm/module-help.csvis excluded by!**/*.csv
📒 Files selected for processing (13)
src/bmm/agents/analyst.agent.yamlsrc/bmm/workflows/1-analysis/research/bmad-market-research/SKILL.mdsrc/bmm/workflows/1-analysis/research/bmad-market-research/bmad-skill-manifest.yamlsrc/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-01-init.mdsrc/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-02-customer-behavior.mdsrc/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-03-customer-pain-points.mdsrc/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-04-customer-decisions.mdsrc/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-05-competitive-analysis.mdsrc/bmm/workflows/1-analysis/research/bmad-market-research/market-steps/step-06-research-completion.mdsrc/bmm/workflows/1-analysis/research/bmad-market-research/research.template.mdsrc/bmm/workflows/1-analysis/research/bmad-market-research/workflow.mdsrc/bmm/workflows/1-analysis/research/bmad-skill-manifest.yamlsrc/bmm/workflows/1-analysis/research/workflow-market-research.md
💤 Files with no reviewable changes (1)
- src/bmm/workflows/1-analysis/research/bmad-skill-manifest.yaml
| **WRITE IMMEDIATELY TO DOCUMENT** | ||
|
|
||
| Write initial research scope to document: | ||
|
|
||
| ```markdown | ||
| # Market Research: {{research_topic}} | ||
|
|
||
| ## Research Initialization | ||
|
|
||
| ### Research Understanding Confirmed | ||
|
|
||
| **Topic**: {{research_topic}} | ||
| **Goals**: {{research_goals}} | ||
| **Research Type**: Market Research | ||
| **Date**: {{date}} | ||
|
|
||
| ### Research Scope | ||
|
|
||
| **Market Analysis Focus Areas:** | ||
|
|
||
| - Market size, growth projections, and dynamics | ||
| - Customer segments, behavior patterns, and insights | ||
| - Competitive landscape and positioning analysis | ||
| - Strategic recommendations and implementation guidance | ||
|
|
||
| **Research Methodology:** | ||
|
|
||
| - Current web data with source verification | ||
| - Multiple independent sources for critical claims | ||
| - Confidence level assessment for uncertain data | ||
| - Comprehensive coverage with no critical gaps | ||
|
|
||
| ### Next Steps | ||
|
|
||
| **Research Workflow:** | ||
|
|
||
| 1. ✅ Initialization and scope setting (current step) | ||
| 2. Customer Insights and Behavior Analysis | ||
| 3. Competitive Landscape Analysis | ||
| 4. Strategic Synthesis and Recommendations | ||
|
|
||
| **Research Status**: Scope confirmed, ready to proceed with detailed market analysis | ||
| ``` |
There was a problem hiding this comment.
Artifact writing is missing an explicit {document_output_language} requirement.
This step writes document content but only enforces spoken output language (Line 12). Without a write-language contract, generated artifacts can drift from configured document language.
Suggested fix
-Write initial research scope to document:
+Write initial research scope to document in `{document_output_language}`:🤖 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-01-init.md`
around lines 73 - 115, Add an explicit document language field to the artifact
template and enforce it when writing: update the markdown block to include a
"Document Language: {{document_output_language}}" (or similar) metadata line
near "Research Initialization"/the header and ensure the writer that produces
this artifact checks and uses the {{document_output_language}} placeholder
rather than only the spoken language; locate the template in step-01-init.md and
modify the initialization section where "Research Initialization" and
"Topic/Goals/Date" are set so the document output language is unambiguous and
required.
| "I've documented our understanding and initial scope for **{{research_topic}}** market research. | ||
|
|
||
| **What I've established:** | ||
|
|
||
| - Research topic and goals confirmed | ||
| - Market analysis focus areas defined | ||
| - Research methodology verification | ||
| - Clear workflow progression | ||
|
|
||
| **Document Status:** Initial scope written to research file for your review | ||
|
|
||
| **Ready to begin detailed market research?** | ||
| [C] Continue - Confirm scope and proceed to customer insights analysis | ||
| [Modify] Suggest changes to research scope before proceeding | ||
|
|
There was a problem hiding this comment.
Close the presentation quote block to avoid prompt-boundary leakage.
The quoted assistant message opened on Line 120 is never explicitly closed before control instructions continue. That makes the parser/agent boundary ambiguous.
Suggested fix
**Ready to begin detailed market research?**
[C] Continue - Confirm scope and proceed to customer insights analysis
[Modify] Suggest changes to research scope before proceeding
+"📝 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.
| "I've documented our understanding and initial scope for **{{research_topic}}** market research. | |
| **What I've established:** | |
| - Research topic and goals confirmed | |
| - Market analysis focus areas defined | |
| - Research methodology verification | |
| - Clear workflow progression | |
| **Document Status:** Initial scope written to research file for your review | |
| **Ready to begin detailed market research?** | |
| [C] Continue - Confirm scope and proceed to customer insights analysis | |
| [Modify] Suggest changes to research scope before proceeding | |
| "I've documented our understanding and initial scope for **{{research_topic}}** market research. | |
| **What I've established:** | |
| - Research topic and goals confirmed | |
| - Market analysis focus areas defined | |
| - Research methodology verification | |
| - Clear workflow progression | |
| **Document Status:** Initial scope written to research file for your review | |
| **Ready to begin detailed market research?** | |
| [C] Continue - Confirm scope and proceed to customer insights analysis | |
| [Modify] Suggest changes to research scope before proceeding | |
| " |
🤖 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-01-init.md`
around lines 120 - 134, The opening presentation quote starting with "I've
documented our understanding and initial scope for **{{research_topic}}**..." is
never closed; add a matching closing quote mark (") after the final paragraph
("**Document Status:** Initial scope written to research file for your review")
or immediately before the choice lines ([C] Continue...) so the quoted block is
explicitly terminated and prevents prompt-boundary leakage; update the content
in step-01-init.md around the block that contains the "{{research_topic}}" text
accordingly.
| **WRITE IMMEDIATELY TO DOCUMENT** | ||
|
|
||
| Prepare customer behavior analysis with web search citations: |
There was a problem hiding this comment.
Immediate write flow needs duplicate-protection on retries.
Because writing happens before C, regeneration/retry loops can duplicate ## Customer Behavior and Segments content.
Add instruction to replace existing section if present, append only if missing.
Also applies to: 184-187
🤖 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`
around lines 95 - 97, The immediate-write flow ("WRITE IMMEDIATELY TO DOCUMENT")
can create duplicate "## Customer Behavior and Segments" entries on retries;
update the step logic so that before writing it searches the document for the
header "## Customer Behavior and Segments" and, if found, replaces that entire
section content with the new analysis, otherwise appends the section; apply the
same replace-if-present/append-if-missing behavior to the other identical write
location referenced in the file to prevent duplicates on regeneration.
| [C] Continue - Save this to document and proceed to pain points analysis | ||
|
|
||
| ### 6. Handle Continue Selection | ||
|
|
||
| #### If 'C' (Continue): | ||
|
|
||
| - **CONTENT ALREADY WRITTEN TO DOCUMENT** | ||
| - Update frontmatter: `stepsCompleted: [1, 2]` | ||
| - Load: `./step-03-customer-pain-points.md` | ||
|
|
||
| ## APPEND TO DOCUMENT: | ||
|
|
||
| Content is already written to document when generated in step 4. No additional append needed. |
There was a problem hiding this comment.
The save semantics are contradictory in the same step.
Line 174 says “Save this to document and proceed,” but Line 186 says content is already written in step 4. This creates execution ambiguity.
Make the continue prompt explicitly “Proceed to next step” and remove “Save” wording.
🤖 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`
around lines 174 - 186, Update the "6. Handle Continue Selection" section to
remove the contradictory "Save this to document" wording and make the continue
action explicit: change the 'C' (Continue) prompt wording to "Proceed to next
step" (or equivalent), keep the frontmatter update `stepsCompleted: [1, 2]` and
the load instruction `./step-03-customer-pain-points.md`, and retain the
"Content is already written to document" note under APPEND TO DOCUMENT so there
is no mention of additional saving in this step.
| **WRITE IMMEDIATELY TO DOCUMENT** | ||
|
|
||
| Prepare customer pain points analysis with web search citations: |
There was a problem hiding this comment.
This step also needs a duplicate-write safeguard.
Immediate writes without a replace/update rule will duplicate pain-point sections when the agent reruns generation.
Define: “If ## Customer Pain Points and Needs exists, update it in place.”
Also applies to: 195-198
🤖 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`
around lines 95 - 97, Ensure writes are idempotent by detecting the markdown
header "## Customer Pain Points and Needs" before writing: if that header
exists, replace the content from that header until the next top-level "## "
header (or EOF) in-place; otherwise append the new section. Implement this logic
in the module that saves/updates step content so repeated runs update the
existing section instead of duplicating it, and apply the same replace-in-place
behavior for the other pain-point sections referenced in this step.
| **Market Confidence Level:** High - based on multiple authoritative market sources | ||
|
|
||
| _This comprehensive market research document serves as an authoritative market reference on {{research_topic}} and provides strategic market insights for informed decision-making._ | ||
| ``` |
There was a problem hiding this comment.
Do not hardcode “High confidence” and “authoritative” as unconditional facts.
These claims should be derived from actual evidence coverage and source quality per run. Hardcoded confidence language can overstate certainty.
🤖 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-06-research-completion.md`
around lines 350 - 353, The hardcoded "Market Confidence Level: High" and
"authoritative" must be replaced with computed assertions derived from the run's
evidence and source quality: replace the literal header block that contains
"Market Confidence Level" with an interpolated value (e.g.,
{{confidence_level}}) computed from metrics like evidenceCoverage,
sourceQualityScore, and authoritativeSourceCount, and only append the term
"authoritative" when authoritativeSourceCount exceeds a configured threshold;
also include a brief evidence summary (e.g., total sources and top-quality
sources) or a link/reference to the evidence summary (e.g.,
{{evidence_summary}}) so the statement reflects actual data rather than
hardcoded text.
| - All market research steps completed (1-4) | ||
| - Comprehensive market research document generated |
There was a problem hiding this comment.
Completion summary still claims only steps 1–4 were done.
This is stale logic in the terminal step and contradicts the six-step workflow definition.
Suggested fix
-- All market research steps completed (1-4)
+- All market research steps completed (1-6)📝 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.
| - All market research steps completed (1-4) | |
| - Comprehensive market research document generated | |
| - All market research steps completed (1-6) | |
| - Comprehensive market research document generated |
🤖 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-06-research-completion.md`
around lines 451 - 452, Update the stale completion summary text in
step-06-research-completion.md: replace the line "All market research steps
completed (1-4)" with an accurate statement reflecting the six-step workflow
(e.g., "All market research steps completed (1-6)"), and ensure any adjacent
summary lines (like "Comprehensive market research document generated") remain
correct or are expanded to reflect final artifacts of steps 1–6; search for the
exact string "All market research steps completed (1-4)" to locate and update
the content.
| stepsCompleted: [] | ||
| inputDocuments: [] | ||
| workflowType: 'research' | ||
| lastStep: 1 |
There was a problem hiding this comment.
Template state initializes as already advanced.
stepsCompleted is empty, but lastStep is 1. That’s contradictory bootstrap state and can cause resume logic to skip initialization.
Suggested fix
stepsCompleted: []
inputDocuments: []
workflowType: 'research'
-lastStep: 1
+lastStep: 0📝 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.
| stepsCompleted: [] | |
| inputDocuments: [] | |
| workflowType: 'research' | |
| lastStep: 1 | |
| stepsCompleted: [] | |
| inputDocuments: [] | |
| workflowType: 'research' | |
| lastStep: 0 |
🤖 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 - 5, The template initializes inconsistent workflow state:
stepsCompleted is an empty array while lastStep is 1; update the template so
lastStep reflects stepsCompleted (e.g., set lastStep: 0) or compute lastStep
from stepsCompleted.length at bootstrap; modify the research template to either
set lastStep to 0 or add logic in the workflow loader to derive lastStep =
stepsCompleted.length to ensure resume/initialization logic is consistent (refer
to the stepsCompleted and lastStep fields in the research.template.md).
| 1. Set `research_type = "market"` | ||
| 2. Set `research_topic = [discovered topic from discussion]` | ||
| 3. Set `research_goals = [discovered goals from discussion]` | ||
| 4. Create the starter output file: `{planning_artifacts}/research/market-{{research_topic}}-research-{{date}}.md` with exact copy of the `./research.template.md` contents |
There was a problem hiding this comment.
“Exact copy” conflicts with runtime variable expectations in the template.
The template includes placeholders ({{research_topic}}, {{user_name}}, etc.). “Exact copy” is ambiguous and can leave unresolved tokens in the artifact. Require explicit variable instantiation at creation.
🤖 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/workflow.md` at
line 48, The workflow currently says to create an “exact copy” of
./research.template.md which leaves template placeholders unresolved; change the
creation step to render the template with explicit variables (e.g.,
research_topic, date, user_name, etc.) and write the resulting rendered content
to {planning_artifacts}/research/market-{{research_topic}}-research-{{date}}.md
so no {{...}} tokens remain; implement this by invoking your template rendering
utility (or a render_template(template_path, context) step) using the workflow
inputs for research_topic and date and any other required fields, and validate
the produced file contains no unresolved placeholders before finishing.
Do not interpolate raw user topic into filesystem path.
{{research_topic}} is user-derived. Using it directly in the filename can create invalid paths or traversal-like tokens. Introduce a sanitized slug.
Suggested fix
-4. Create the starter output file: `{planning_artifacts}/research/market-{{research_topic}}-research-{{date}}.md` with exact copy of the `./research.template.md` contents
+4. Derive `research_topic_slug` from `research_topic` using lowercase alphanumerics + hyphens only
+5. Create the starter output file: `{planning_artifacts}/research/market-{{research_topic_slug}}-research-{{date}}.md` with instantiated `./research.template.md` contents
-5. Load: `./market-steps/step-01-init.md` with topic context
+6. Load: `./market-steps/step-01-init.md` with topic context🤖 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/workflow.md` at
line 48, The filename template currently embeds the raw user-derived
{{research_topic}} into the path
({planning_artifacts}/research/market-{{research_topic}}-research-{{date}}.md);
change this to use a sanitized slug (e.g., slugified_research_topic) instead of
the raw value by adding a sanitizer function (sanitize_slug/slugify) that
strips/normalizes unsafe characters, trims length, and rejects path separators,
then use that sanitized value in the filename generation and when creating the
starter file (copying research.template.md into the new path).
|
|
||
| **Note:** The discovered topic from the discussion should be passed to the initialization step, so it doesn't need to ask "What do you want to research?" again - it can focus on refining the scope for market research. | ||
|
|
||
| **✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`** |
There was a problem hiding this comment.
Workflow still lacks a write-language contract for generated documents.
You enforce communication language, but this workflow writes artifacts and never explicitly requires {document_output_language} for document text. That breaks multilingual consistency.
Suggested fix
**✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`**
+**✅ YOU MUST ALWAYS WRITE all artifact/document content in `{document_output_language}`**🤖 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/workflow.md` at
line 53, The workflow enforces {communication_language} but never declares a
write-language contract for generated artifacts; update the workflow spec
(bmad-market-research workflow.md) to add an explicit {document_output_language}
requirement and propagate it to any agent output/templates that produce written
artifacts (e.g., artifact generation, report templates, and agent response
handlers) so that functions/components that produce documents must receive and
use {document_output_language} instead of relying only on
{communication_language}. Ensure the new contract is validated in the workflow
preamble and referenced where templates/agents render text.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add co-located HALT instructions after every menu in all 6 step files - Fix step-05 to route to step-06 instead of declaring workflow complete - Rename market-steps/ to steps/ for standard naming convention Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The market-research workflow now lives entirely in bmad-market-research/ as a native skill directory. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
bmad-market-researchfromtype:workflowtotype:skill(native skill directory)src/bmm/workflows/1-analysis/research/bmad-market-research/with SKILL.md, workflow.md, market-steps/, research.template.mdanalyst.agent.yamlexec toskill:bmad-market-researchmodule-help.csvworkflow-file toskill:bmad-market-research{project-root}/_bmad/...installed-path references in step files to relative./pathsstandalone: falseto source workflow to prevent duplicate manifest registrationValidation
.claude/skills/bmad-market-research/with complete file treeskill-manifest.csvhasbmad-market-researchentryworkflow-manifest.csventry🤖 Generated with Claude Code