Creating Workflows with BMAD

🎥 Video lesson — video not yet migrated (source Skool video id: cb3b16ed8e814dc68bef9c66e198c8ff).

Building Your First BMAD Workflow — Competitive Research Agent

This is the final piece of the BMAD puzzle. We've built the module, we've built the agent — now we're building the actual workflow that powers it. In this video we create the Competitive Research workflow for our Content Strategist agent, complete with YouTube API integration, transcript analysis, and outlier scoring.

Where we're at:

  • Module ✅ (Content Creation Suite)
  • Agent ✅ (Content Strategist — "Scout")
  • Workflow — this video

What we build: A competitive research workflow with two modes:

  1. Trend Discovery — scans competitor YouTube channels, calculates outlier scores, identifies what's performing well right now
  2. Idea Validation — takes a video idea you already have and weighs it against current trends to see how competitive it might be

Step-by-step process:

  1. Run /workflow-builder and pass in the workflow spec using @ to load the file
  2. Go through discovery — define the purpose, inputs, outputs, and how success is measured
  3. Use Exa MCP to research how other people handle YouTube trend analysis (don't reinvent the wheel)
  4. Build the workflow steps — initialise, load data, scan trends, transcript analysis, gap identification, and report generation
  5. Move completed workflow from bmad-output/ into the actual module folder
  6. Set up environment variables for the YouTube Data API
  7. Test, debug, and iterate until it runs cleanly

The workflow produces a 7-step pipeline:

  1. Initialise and load sidecar data (competitors list, niche scope)
  2. Present mode selection (trend discovery or idea validation)
  3. Scan competitor channels using YouTube Data API
  4. Analyse top-performing content and calculate outlier scores
  5. Download and analyse video transcripts
  6. Identify content gaps and opportunities
  7. Generate a structured research report

Key concepts covered:

  • Sub-agents for parallel scanning — Claude Code can spawn multiple sub-agents that each scan a different competitor simultaneously rather than going through them one by one sequentially
  • Context window management — the conversation used nearly 88% of the 1M token context window during the build. When it gets full, use /compact to summarise and start fresh
  • BMAD Output as a staging area — workflows get built in bmad-output/ first (think of it as your dev environment), then moved into the live module folder when ready
  • Sidecar data — the workflow loads a competitors list and niche scope from separate files, making it easy for someone in a completely different niche to swap in their own competitors and run the same workflow
  • Environment variables and security — API keys go in a .env file in the project root, and a .gitignore file ensures they never get pushed to GitHub

Setting up the YouTube Data API:

  1. Go to Google Cloud Console → APIs & Services
  2. Search for and enable "YouTube Data API v3"
  3. Go to Credentials → Create API Key
  4. Restrict the key to YouTube Data API v3 only (so even if leaked, it can't be used for anything else)
  5. Add the key to your .env file as YOUTUBE_API_KEY=your_key_here
  6. Add .env to your .gitignore file

Debugging covered in the video:

  • Initial API call returned a 403 error — turned out to be parameter issues in the script, not the API key itself
  • Used Exa MCP to research the correct API call format and fix the parameters
  • Transcript downloading couldn't use the API directly — Exa MCP found a Python library (youtube-transcript-api) as the simplest solution
  • Both fixes were fed back into the workflow steps so the errors won't happen again on future runs

Tips from the video:

  • Use Exa MCP constantly during builds — for researching how other people solve the same problem, verifying API documentation is current, and finding code examples. It's the single most useful MCP in your workflow
  • Iteration is the process — we went back and edited the module mid-build to add a dual project mode (project-based vs standalone). This is normal. When you notice something missing, go back and fix it at the foundation layer rather than patching it later
  • Understanding the structure matters — the AI left the completed workflow in bmad-output/ instead of moving it to the live folder. Knowing how the BMAD folder structure works meant we could catch that and ask it to fix it
  • --dangerously-skip-permissions — used for the final test run so the workflow could execute end-to-end without stopping to ask for approval at every step
  • /fast mode exists but costs more — runs on Opus 4.6 only and burns through tokens quicker. Only use it if speed genuinely matters more than cost
  • Cmd+S to save — if your .env file changes aren't being picked up, make sure the file is actually saved before re-running

Results from the first live run: The workflow successfully scanned 8+ competitor channels simultaneously using sub-agents, identified top-performing videos by outlier score, and confirmed that Claude Code and AI coding content is dominating right now. Transcript analysis was added as a bonus step to understand why certain videos are outperforming.

What's next: The full BMAD infrastructure is now built (modules → agents → commands → workflows). From here it's about filling out the rest of the to-do list — building the remaining workflows for the Content Strategist agent, then moving on to the other agents (Copywriter, Creative Director, Video Editor, Editor, Publisher).