The BMad Method provides 23 tasks (21 core tasks + 2 common shared tasks) for reusable executable procedures across document management, story creation, quality assurance, and more. Tasks are markdown files with structured instructions that agents execute to perform specific functions.
.bmad-core/tasks/, these are the primary BMad Method taskscommon/tasks/, these are shared utilities used by both core and expansion pack agents:
create-doc - Template-driven document creationexecute-checklist - Quality checklist execution// Task organization by category
type TaskCategory =
| 'document-management' // Document creation and manipulation
| 'story-epic' // Story and epic management
| 'development-support' // Development workflow support
| 'quality-assurance' // QA and testing tasks
| 'research-analysis' // Research and elicitation
| 'integration'; // External tool integration
// Task execution pattern
interface TaskExecution {
// Tasks are loaded on-demand by agents
location: '{root}/tasks/{task-name}.md';
// Tasks reference other resources
references: string[]; // Templates, checklists, data files
// Tasks produce artifacts
artifacts: string[]; // Files created or updated
}| Category | Tasks | Primary Users |
|---|---|---|
| Document Management (Core) | shard-doc, document-project, index-docs | PO, PM, Architect |
| Document Management (Common) | create-doc* | All agents |
| Story/Epic | create-next-story, brownfield-create-story, create-brownfield-story, brownfield-create-epic, review-story, validate-next-story | SM, PM, PO |
| Development Support | apply-qa-fixes, correct-course | Dev, SM, PO |
| Quality Assurance (Core) | qa-gate, test-design, trace-requirements, risk-profile, nfr-assess | QA |
| Quality Assurance (Common) | execute-checklist* | All agents |
| Research/Analysis | create-deep-research-prompt, advanced-elicitation, facilitate-brainstorming-session | Analyst |
| Integration | generate-ai-frontend-prompt, kb-mode-interaction | UX Expert, Orchestrator |
* Common tasks are located in common/tasks/ and shared across core and expansion packs
All tasks follow a consistent structure:
interface Task {
title: string; // Task name
purpose: string; // What the task accomplishes
instructions: TaskStep[]; // Sequential execution steps
inputs?: string[]; // Required input files or data
outputs?: string[]; // Files or artifacts created
dependencies?: string[]; // Other tasks or resources required
notes?: string[]; // Important considerations
}
interface TaskStep {
stepNumber: number; // Execution order
description: string; // What to do in this step
substeps?: string[]; // Detailed substep instructions
conditions?: string[]; // Conditional execution logic
validation?: string[]; // Validation checks
}interface TaskInvocation {
byAgents: 'Agent loads task during command execution';
byUsers: '*task <task-name> (via Orchestrator)';
byTasks: 'Tasks can invoke other tasks';
location: '{root}/tasks/{task-name}.md';
}While tasks are primarily designed for agent execution, they can also be loaded and interpreted programmatically:
const fs = require('fs');
const path = require('path');
/**
* Load task definition
* @param {string} taskName - Task name (e.g., 'shard-doc', 'create-next-story')
* @param {string} projectRoot - Project root directory (default: process.cwd())
* @returns {Promise<string>} - Task markdown content
*/
async function loadTask(taskName, projectRoot = process.cwd()) {
const taskPath = path.join(projectRoot, '.bmad-core', 'tasks', `${taskName}.md`);
return fs.promises.readFile(taskPath, 'utf-8');
}
/**
* Parse task metadata (if task has YAML frontmatter)
* @param {string} taskContent - Task markdown content
* @returns {TaskMetadata}
*/
function parseTaskMetadata(taskContent) {
// Parse YAML frontmatter if present
// Returns task metadata like purpose, inputs, outputs, dependencies
}
interface TaskMetadata {
title: string;
purpose: string;
inputs?: string[];
outputs?: string[];
dependencies?: string[];
category?: string;
}Example: Loading and Reading a Task
const fs = require('fs');
const path = require('path');
async function getTaskDetails(taskName) {
const projectRoot = process.cwd();
const taskPath = path.join(projectRoot, '.bmad-core', 'tasks', `${taskName}.md`);
try {
const taskContent = await fs.promises.readFile(taskPath, 'utf-8');
console.log(`Task: ${taskName}`);
console.log('Location:', taskPath);
console.log('Content preview:', taskContent.slice(0, 200));
return taskContent;
} catch (error) {
if (error.code === 'ENOENT') {
console.error(`Task not found: ${taskName}`);
console.error('Available tasks in .bmad-core/tasks/');
}
throw error;
}
}
// Usage
const shardDocTask = await getTaskDetails('shard-doc');
const createStoryTask = await getTaskDetails('create-next-story');Example: Listing All Available Tasks
const fs = require('fs');
const path = require('path');
async function listAllTasks(projectRoot = process.cwd()) {
const tasksDir = path.join(projectRoot, '.bmad-core', 'tasks');
try {
const files = await fs.promises.readdir(tasksDir);
const tasks = files
.filter(f => f.endsWith('.md'))
.map(f => f.replace('.md', ''));
return tasks;
} catch (error) {
console.error('Failed to list tasks:', error.message);
throw error;
}
}
// Usage
const tasks = await listAllTasks();
console.log('Available tasks:', tasks);
// Output: ['shard-doc', 'create-next-story', 'qa-gate', ...]Note: Tasks are markdown files with natural language instructions designed for AI agents to interpret and execute. Programmatic execution typically involves:
For full automation, consider using the agent system programmatically via the Web Builder and Dependency Resolver APIs (see Programmatic API Reference).
Splits large documents into manageable chunks based on level 2 sections.
interface ShardDocTask {
purpose: 'Split large documents into multiple smaller documents';
inputs: {
document: 'Large markdown file to shard';
output_location: 'Destination directory';
};
outputs: {
index: 'index.md: Navigation file with links';
shards: '{section-name}.md: Individual section files';
};
execution: {
automatic: {
prereq: 'markdownExploder: true in core-config.yaml';
command: 'md-tree explode {source} {destination}';
tool: '@kayvan/markdown-tree-parser (npm install -g)';
};
manual: {
1: 'Read entire document';
2: 'Identify ## level 2 sections';
3: 'Extract each section with subsections';
4: 'Generate filename from heading (lowercase-dash-case)';
5: 'Adjust heading levels (## → #, ### → ##)';
6: 'Write content to individual files';
7: 'Create index.md with links';
};
};
usedBy: ['PO (shard PRD/architecture for development)'];
}Complete Usage Example:
# Step 1: Load PO agent
*agent po
# Step 2: Shard PRD
*shard-doc
# PO agent:
# "Which document would you like to shard?"
# Options:
# 1. PRD (docs/prd.md)
# 2. Architecture (docs/architecture.md)
# 3. Custom document
# User selects: 1 (PRD)
# Automatic sharding (if markdownExploder: true):
# PO executes: md-tree explode docs/prd.md docs/prd
# Output structure:
# docs/prd/
# ├── index.md
# ├── epic-1.md
# ├── epic-2.md
# ├── epic-3.md
# └── ...
# Manual sharding (if markdownExploder: false):
# PO reads docs/prd.md
# Identifies sections:
# ## Epic 1: User Authentication
# ## Epic 2: Product Catalog
# ## Epic 3: Shopping Cart
# Extracts each section
# Creates files:
# epic-1-user-authentication.md
# epic-2-product-catalog.md
# epic-3-shopping-cart.md
# Creates index.md with navigation
# Step 3: Shard Architecture
*shard-doc
# User selects: 2 (Architecture)
# Output structure:
# docs/architecture/
# ├── index.md
# ├── tech-stack.md
# ├── unified-project-structure.md
# ├── coding-standards.md
# ├── testing-strategy.md
# ├── data-models.md
# ├── database-schema.md
# ├── backend-architecture.md
# ├── rest-api-spec.md
# ├── frontend-architecture.md
# ├── components.md
# └── core-workflows.mdEdge Cases:
interface ShardDocEdgeCases {
codeBlocks: {
scenario: 'Document contains code blocks with ## inside';
handling: 'markdown-tree-parser preserves code blocks correctly';
manual: 'Agent must identify code block boundaries before splitting';
};
nestedSections: {
scenario: 'Section has multiple levels (##, ###, ####)';
handling: 'All subsections included in shard';
headingAdjustment: '## becomes #, ### becomes ##, etc.';
};
emptySections: {
scenario: 'Section heading exists but no content';
handling: 'Creates file with heading only, notes empty section';
};
specialCharacters: {
scenario: 'Section heading contains special characters';
handling: 'Filename sanitized (spaces → dashes, special chars removed)';
example: '## API Endpoints & Routes' → 'api-endpoints-routes.md';
};
}Documents existing projects for brownfield development.
interface DocumentProjectTask {
purpose: 'Document existing projects for brownfield development';
inputs: {
codebase: 'Flattened XML or directory structure';
project_type: 'fullstack | service | ui';
};
outputs: {
prd: 'brownfield-prd.md: Requirements document';
architecture: 'brownfield-architecture.md: Architecture document';
};
execution: {
1: 'Flatten codebase (npx bmad-method flatten)';
2: 'Analyze code structure and patterns';
3: 'Extract architecture decisions';
4: 'Document current state and capabilities';
5: 'Generate brownfield PRD';
6: 'Generate brownfield architecture';
};
usedBy: ['PM, Architect (brownfield workflows)'];
}Creates documentation indexes for sharded documents.
interface IndexDocsTask {
purpose: 'Create documentation indexes';
execution: {
1: 'Scan directory for markdown files';
2: 'Extract section titles';
3: 'Generate index.md with title';
4: 'Create links to section files';
5: 'Preserve introduction content';
};
usedBy: ['PO (after document sharding)'];
}Creates documents from YAML-driven templates with interactive user elicitation.
interface CreateDocTask {
purpose: 'Generate structured documents from templates with user interaction';
output: 'Complete document following template structure';
inputs: {
template: 'YAML template file path';
mode: '"interactive" | "yolo"'; // Interactive = section-by-section, YOLO = all at once
};
outputs: {
document: 'Generated markdown document';
};
features: [
'YAML template parsing and discovery',
'Mandatory 1-9 elicitation format when elicit: true',
'Interactive user elicitation with 8 methods from data/elicitation-methods',
'YOLO mode for non-interactive batch processing',
'Agent permission enforcement (owner/editors/readonly)',
'Section-by-section processing with detailed rationale',
'Progressive content building with user feedback'
];
execution: {
1: 'Parse YAML template for metadata and sections';
2: 'Set processing mode (Interactive or YOLO)';
3: 'For each template section:';
4: ' - Skip if condition unmet';
5: ' - Check agent permissions (owner/editors)';
6: ' - Draft content using section instruction';
7: ' - Present content with detailed rationale';
8: ' - IF elicit: true, present 1-9 options (1=proceed, 2-9=elicitation methods)';
9: ' - Wait for user response';
10: ' - Apply user feedback or proceed';
11: 'Save completed document to specified location';
};
elicitation: {
format: 'Mandatory 1-9 numbered options';
option1: 'Always "Proceed to next section"';
options2_9: 'Select from data/elicitation-methods';
prompt: 'Select 1-9 or just type your question/feedback:';
rationale: 'Explain trade-offs, assumptions, and key decisions';
};
}Used By: Multiple agents (PM, Architect, UX Expert) for template-driven document generation
Critical Features:
elicit: true, must use exact 1-9 format (never yes/no questions)#yoloExample Usage:
Agent command: *create-prd
Executes: create-doc with template prd-tmpl.yaml
Elicits user input for each PRD section
Generates: docs/prd.mdGenerates next story file with complete implementation context.
interface CreateNextStoryTask {
purpose: 'Generate next story with full context';
inputs: {
config: 'core-config.yaml: Project configuration';
epicFiles: 'PRD epics (sharded or monolithic)';
architecture: 'Sharded architecture documents';
previousStory: 'Last completed story (if exists)';
};
outputs: {
story: '{epicNum}.{storyNum}.story.md: Story file with context';
};
execution: {
0: 'Load core-config.yaml and check workflow';
1: 'Identify next story (sequential logic)';
2: 'Gather story requirements + previous story context';
3: 'Gather architecture context (selective reading)';
4: 'Verify project structure alignment';
5: 'Populate story template with full context';
6: 'Story draft completion and validation';
};
contextGathering: {
allStories: ['tech-stack', 'unified-project-structure', 'coding-standards', 'testing-strategy'];
backendStories: ['data-models', 'database-schema', 'backend-architecture', 'rest-api-spec', 'external-apis'];
frontendStories: ['frontend-architecture', 'components', 'core-workflows', 'data-models'];
};
usedBy: ['SM (create stories for development)'];
}Complete Usage Example:
# Step 1: Load SM agent (Bob)
*agent sm
# Step 2: Create next story
*draft
# SM agent executes create-next-story task:
# Step 2a: Load configuration
# Reads: .bmad-core/core-config.yaml
# Checks: prdSharded: true, architectureSharded: true
# Step 2b: Identify next story
# Scans: docs/stories/ directory
# Finds: 1.1.user-authentication.md (Done)
# Finds: 1.2.password-reset.md (Done)
# Next: 1.3.session-management.md (not found)
# Reads: docs/prd/epic-1.md
# Extracts: Story 1.3 from epic
# Step 2c: Gather story requirements
# Reads: docs/prd/epic-1.md
# Extracts:
# Story: "As a user, I want to manage my session, so that I can stay logged in securely"
# Acceptance Criteria:
# 1. Session expires after 30 minutes of inactivity
# 2. User can extend session
# 3. Session invalidated on logout
# Step 2d: Gather previous story context
# Reads: docs/stories/1.2.password-reset.md
# Extracts learnings:
# - Used JWT for password reset tokens
# - Similar pattern can be used for sessions
# - Auth middleware already created
# Step 2e: Gather architecture context (selective)
# Story type: Backend (session management)
# Loads all stories sections:
# - docs/architecture/tech-stack.md
# - docs/architecture/unified-project-structure.md
# - docs/architecture/coding-standards.md
# - docs/architecture/testing-strategy.md
# Loads backend-specific sections:
# - docs/architecture/data-models.md
# - docs/architecture/backend-architecture.md
# - docs/architecture/rest-api-spec.md
# Does NOT load frontend sections (not needed)
# Step 2f: Create story file
# Populates story-tmpl.yaml with:
# Status: Draft
# Story: Full user story from epic
# Acceptance Criteria: From epic
# Tasks:
# [ ] Task 1: Create session model
# [ ] Task 2: Implement session middleware
# [ ] Task 3: Add session endpoints
# Dev Notes:
# [Source: docs/architecture/backend-architecture.md#middleware]
# Use Express middleware pattern
# [Source: docs/architecture/data-models.md#user-model]
# Extend User model with session fields
# [Source: docs/stories/1.2.password-reset.md#implementation]
# Similar JWT pattern as password reset
# Step 2g: Validate story
# Executes: story-draft-checklist
# Checks:
# ✓ Story structure complete
# ✓ Acceptance criteria clear
# ✓ Technical context sufficient
# ✓ Source references included
# ✓ Tasks breakdown appropriate
# Output: docs/stories/1.3.session-management.mdEdge Cases:
interface CreateNextStoryEdgeCases {
firstStory: {
scenario: 'No previous stories exist';
handling: 'Skips previous story context gathering';
note: 'All other context gathering still occurs';
};
missingArchitecture: {
scenario: 'Required architecture section not found';
error: 'Story creation halts';
message: 'Missing architecture section: tech-stack.md';
solution: 'Ensure architecture is sharded or section exists';
};
storyTypeDetection: {
scenario: 'Story spans backend and frontend';
handling: 'Loads both backend and frontend architecture sections';
example: 'Full-stack story loads all relevant sections';
};
epicNotFound: {
scenario: 'Epic file pattern doesn\'t match';
error: 'Epic file not found for story';
solution: 'Check epicFilePattern in core-config.yaml matches actual files';
};
}Creates single user story for very small brownfield enhancements (single-session completion).
interface BrownfieldCreateStoryTask {
purpose: 'Create single stories for minimal brownfield enhancements';
useCase: 'Small additions or bug fixes requiring existing system integration';
constraints: [
'Story completable in one session (< 4 hours)',
'No architecture or significant design required',
'Must follow existing patterns exactly',
'Integration straightforward with minimal risk',
'Change isolated with clear boundaries'
];
execution: {
1: 'Quick Project Assessment';
2: 'Story Creation with integration context';
3: 'Risk Check and compatibility verification';
4: 'Validation for single-session scope';
};
usedBy: ['PM agent (*create-brownfield-story command)'];
whenToUse: 'Enhancement completable in single story, no new architecture, follows existing patterns';
whenNotToUse: 'Use brownfield-create-epic for 2-3 story enhancements, or full PRD/Architecture for complex changes';
}Creates detailed, implementation-ready stories for brownfield projects where traditional sharded PRD/architecture may not exist.
interface CreateBrownfieldStoryTask {
purpose: 'Create detailed stories from non-standard brownfield documentation';
useCase: 'Brownfield projects without v4+ structured documentation';
inputs: {
documentation: 'document-project output, brownfield PRD, epics, or user docs';
storySource: 'Specific enhancement to implement';
userContext: 'Additional info gathered interactively';
};
outputs: {
story: 'story.md: Complete story with technical context and safety checks';
};
features: [
'Works with non-standard documentation',
'Interactive context gathering',
'Technical debt identification',
'Integration approach documentation',
'Existing functionality protection',
'Risk assessment and mitigation',
'Rollback planning'
];
execution: {
1: 'Documentation Context: Check for sharded PRD, brownfield docs, epics, user docs';
2: 'Story Identification: Extract or define with user';
3: 'Context Gathering: Affected functionality, integration, patterns, constraints, gotchas';
4: 'Extract Technical Context from sources';
5: 'Create Story Structure with known info';
6: 'Develop Acceptance Criteria: Include maintaining existing functionality';
7: 'Gather Technical Guidance: Interactive for missing info';
8: 'Generate Tasks: Exploration, implementation, verification, testing';
9: 'Risk Assessment: Risks, mitigation, rollback';
10: 'Final Validation: Completeness, safety, gap checks';
};
safetyFeatures: {
existingProtection: 'Acceptance criteria for existing functionality';
riskAssessment: 'Risks, mitigation, verification';
rollbackPlan: 'Steps to undo changes';
explorationTasks: 'When understanding incomplete';
verificationTasks: 'Test existing unchanged';
};
usedBy: ['PM, Architect (brownfield workflows)'];
whenToUse: 'Non-standard documentation, document-project output, brownfield epics, need interactive context';
whenNotToUse: 'Use create-next-story for sharded PRD/architecture, brownfield-create-story for single-session enhancements';
}Creates epics for existing projects with enhancement focus.
interface BrownfieldCreateEpicTask {
purpose: 'Create epics for existing projects';
execution: {
1: 'Extract epic from brownfield PRD';
2: 'Analyze impact on existing systems';
3: 'Identify dependencies and integration';
4: 'Document compatibility requirements';
5: 'Create epic with brownfield context';
};
usedBy: ['SM (brownfield workflows)'];
}Review and validate story files for completeness.
interface ReviewValidateTasks {
purpose: 'Review and validate stories';
reviewStory: {
execution: {
1: 'Review structure and completeness';
2: 'Validate acceptance criteria clarity';
3: 'Check technical context sufficiency';
4: 'Verify task breakdown';
5: 'Provide feedback';
};
};
validateNextStory: {
execution: {
1: 'Load story draft and checklist';
2: 'Execute story-draft-checklist';
3: 'Check context completeness';
4: 'Verify architecture source references';
5: 'Validate task breakdown';
6: 'Report PASS | FAIL with issues';
};
};
usedBy: ['Analyst, PM, PO'];
}Addresses QA feedback systematically with story updates.
interface ApplyQAFixesTask {
purpose: 'Address QA feedback systematically';
execution: {
1: 'Review QA feedback in story';
2: 'Prioritize issues (critical → minor)';
3: 'Apply fixes systematically';
4: 'Run tests to verify';
5: 'Update Dev Agent Record with QA resolutions';
6: 'Update story status';
};
usedBy: ['Dev (address QA feedback)'];
}Adjusts processes when they go off track.
interface CorrectCourseTask {
purpose: 'Adjust when processes go off track';
execution: {
1: 'Analyze current vs expected process';
2: 'Identify deviation points';
3: 'Determine root cause';
4: 'Generate corrective action plan';
5: 'Provide guidance to return to proper workflow';
};
usedBy: ['PO, SM (process adjustment)'];
}Creates comprehensive test scenarios and plans.
interface TestDesignTask {
purpose: 'Create comprehensive test scenarios';
execution: {
1: 'Analyze requirements and acceptance criteria';
2: 'Review architecture for constraints';
3: 'Apply test-levels-framework';
4: 'Apply test-priorities-matrix';
5: 'Generate test scenarios by level';
6: 'Create test plan with coverage';
};
usedBy: ['QA (test planning)'];
}Makes quality gate decisions with detailed rationale.
interface QAGateTask {
purpose: 'Quality gate decisions';
gateDecisions: {
PASS: 'All quality criteria met, ready for production';
CONCERNS: 'Issues found but not blocking, proceed with monitoring';
FAIL: 'Critical issues, must address before proceeding';
WAIVED: 'Issues identified but waived by stakeholder';
};
execution: {
1: 'Review implementation against requirements';
2: 'Analyze test results and coverage';
3: 'Identify quality issues and risks';
4: 'Assess severity and impact';
5: 'Make gate decision with rationale';
6: 'Document using qa-gate-tmpl';
};
usedBy: ['QA (quality gates)'];
}Validates documentation against checklists with systematic item-by-item verification.
interface ExecuteChecklistTask {
purpose: 'Systematic validation against checklists';
features: [
'Fuzzy checklist name matching',
'Interactive or YOLO modes',
'Pass/Fail/Partial/N/A marking',
'Section-by-section pass rates',
'Comprehensive report with recommendations',
'Document/artifact gathering per checklist'
];
execution: {
1: 'Identify and load checklist (fuzzy matching)';
2: 'Confirm mode (interactive or YOLO)';
3: 'Gather required documents/artifacts';
4: 'For each section:';
5: ' Review all items following embedded instructions';
6: ' Check against documentation';
7: ' Mark: ✅ PASS / ❌ FAIL / ⚠️ PARTIAL / N/A';
8: ' Calculate section pass rate';
9: ' Identify failure themes';
10: 'Generate final report with recommendations';
};
usedBy: ['Architect, PO, SM, Dev, QA for documentation validation'];
}QA analysis tasks.
interface QAAnalysisTasks {
traceRequirements: {
purpose: 'Requirements traceability analysis';
output: 'Traceability matrix, coverage analysis';
};
riskProfile: {
purpose: 'Risk assessment for changes';
output: 'Risk profile, mitigation plan';
severity: 'High/Medium/Low';
};
nfrAssess: {
purpose: 'Non-functional requirements validation';
categories: ['Performance', 'Security', 'Scalability', 'Reliability', 'Maintainability', 'Usability', 'Compatibility'];
output: 'NFR compliance report, findings';
};
usedBy: ['QA'];
}Generates structured research prompts for web search or AI.
interface CreateDeepResearchPromptTask {
purpose: 'Generate structured research prompts';
execution: {
1: 'Analyze topic and context';
2: 'Identify key research questions';
3: 'Structure prompt with objectives';
4: 'Generate targeted search queries';
5: 'Include evaluation criteria';
6: 'Format for web search or AI';
};
usedBy: ['Analyst (market research, competitive analysis)'];
}Provides 10 structured elicitation methods for requirements gathering.
interface AdvancedElicitationTask {
purpose: '10 structured elicitation methods';
methods: [
'SCAMPER: Substitute, Combine, Adapt, Modify, Put to other uses, Eliminate, Reverse',
'5 Whys: Root cause analysis',
'Jobs-to-be-Done: Functional, emotional, social jobs',
'Six Thinking Hats: Parallel thinking',
'Stakeholder Mapping: Identify and analyze needs',
'Assumption Testing: Challenge and validate',
'Laddering: Attribute-consequence-value chains',
'Forced Connections: Random word association',
'Reversal: Explore opposites',
'Context Mapping: Environmental analysis'
];
usedBy: ['Analyst (brainstorming, requirements)'];
}Facilitates structured brainstorming sessions.
interface FacilitateBrainstormingTask {
purpose: 'Structured brainstorming facilitation';
techniques: [
'Classic Brainstorming: Free-form idea generation',
'Brainwriting: Silent individual writing',
'Round Robin: Structured turn-taking',
'Mind Mapping: Visual clustering',
'SCAMPER: Innovation through prompts',
'Starbursting: Question-focused ideation'
];
usedBy: ['Analyst'];
}Generates prompts for v0, Lovable, and other AI UI generation tools.
interface GenerateAIFrontendPromptTask {
purpose: 'Generate v0/Lovable UI generation prompts';
targets: {
v0: 'React + Tailwind + shadcn/ui';
lovable: 'Full-stack web applications';
other: 'Generic AI UI tools';
};
execution: {
1: 'Extract UI requirements from front-end-spec';
2: 'Identify components and user flows';
3: 'Analyze frontend architecture constraints';
4: 'Structure prompt for target tool';
5: 'Include technical specs (React, Tailwind)';
6: 'Add component hierarchy and state';
7: 'Provide integration guidance';
};
usedBy: ['UX Expert (UI generation)'];
}Enables knowledge base interaction mode for enhanced responses.
interface KBModeInteractionTask {
purpose: 'Knowledge base interaction mode';
execution: {
1: 'Load BMad knowledge base (bmad-kb.md)';
2: 'Parse user query';
3: 'Search KB for relevant info';
4: 'Provide KB-informed response';
5: 'Reference KB sections';
};
usedBy: ['Orchestrator (*kb-mode command)'];
}Agents load and execute tasks on-demand:
# Agent loads task during command execution
*shard-doc # PO agent loads shard-doc.md task
*draft # SM agent loads create-next-story.md task
*review # QA agent loads qa-gate.md taskUsers can invoke tasks directly through Orchestrator:
# Direct task execution
*task shard-doc
*task create-next-storyTasks can invoke other tasks:
Execute `{root}/tasks/shard-doc` `{root}/docs/prd.md`interface SequentialExecution {
pattern: 'SEQUENTIAL - Do not proceed until current step complete';
steps: {
0: 'Prerequisite checks and validation';
1: 'Primary execution step';
2: 'Context gathering';
3: 'Processing and transformation';
4: 'Validation and quality checks';
5: 'Output generation';
6: 'Completion and reporting';
};
}interface ConditionalExecution {
conditions: [
'If file exists: Load and process',
'If not exists: Create new',
'If validation fails: Report error and halt',
'If optional feature enabled: Execute additional steps'
];
}interface TaskDependencies {
dependencyTypes: {
tasks: 'Other tasks to execute';
templates: 'Templates to use';
checklists: 'Checklists to run';
data: 'Data files to load';
};
example: {
task: 'create-next-story';
dependencies: {
templates: ['story-tmpl'];
checklists: ['story-draft-checklist'];
data: ['technical-preferences'];
};
};
}.bmad-core/tasks/
├── advanced-elicitation.md
├── apply-qa-fixes.md
├── brownfield-create-epic.md
├── brownfield-create-story.md
├── correct-course.md
├── create-brownfield-story.md
├── create-deep-research-prompt.md
├── create-doc.md
├── create-next-story.md
├── document-project.md
├── execute-checklist.md
├── facilitate-brainstorming-session.md
├── generate-ai-frontend-prompt.md
├── index-docs.md
├── kb-mode-interaction.md
├── nfr-assess.md
├── qa-gate.md
├── review-story.md
├── risk-profile.md
├── shard-doc.md
├── test-design.md
├── trace-requirements.md
└── validate-next-story.mdTasks should load minimal required context:
Edge Cases:
Tasks should always cite sources:
[Source: architecture/tech-stack.md#frameworks][Source: prd/epic-1.md#story-requirements]Source Reference Format:
[Source: {relative-path}#{section-anchor}]
Examples:
- [Source: docs/architecture/tech-stack.md#frameworks]
- [Source: docs/prd/epic-1.md#story-1.2]
- [Source: docs/stories/1.1.user-auth.md#acceptance-criteria]Tasks should validate inputs and outputs:
Validation Edge Cases:
Tasks should handle errors gracefully:
Error Handling Patterns:
interface TaskErrorHandling {
criticalErrors: {
behavior: 'Halt execution immediately';
examples: [
'Required file not found',
'Invalid configuration value',
'Missing dependency',
'Permission denied'
];
};
recoverableErrors: {
behavior: 'Report error, suggest fix, allow retry';
examples: [
'File locked by another process',
'Network timeout',
'Temporary file system issue'
];
};
errorMessages: {
format: 'Clear description + expected vs actual + remediation steps';
example: 'PRD file not found. Expected: docs/prd.md. Solution: Create PRD using PM agent *create-prd command';
};
}Tasks must execute steps sequentially:
Sequential Execution Rules:
interface SequentialExecution {
rule: 'Steps must execute in order, no parallel execution';
validation: 'Each step validates prerequisites before execution';
interruption: 'User can interrupt between steps, not during step execution';
rollback: 'Completed steps cannot be rolled back automatically';
}