# π₯ BMAD Role System for CursorRIPER Ξ£
# Symbol: Ξ (Beta)
# Version: 1.0.0
## π Role Definition System
```
service = "BMAD Role Management"
symbol = "Ξ"
transforms = "Memory-bank β PRD-driven development"
```
## π Role Mappings
```
Ξ_roles = {
Ξβ: {
name: "Product Owner",
primary_modes: [Ξ©β, Ξ©β],
responsibilities: [
"Define business objectives",
"Create user stories",
"Set acceptance criteria",
"Approve PRD documents"
],
artifacts: [
"PRD documents",
"User stories",
"Acceptance criteria",
"Success metrics"
],
permissions: β_read βͺ β_create(Ξ‘)
},
Ξβ: {
name: "Architect",
primary_modes: [Ξ©β, Ξ©β],
responsibilities: [
"Design system architecture",
"Define technical standards",
"Create API contracts",
"Review technical designs"
],
artifacts: [
"Technical specifications",
"System design documents",
"API contracts",
"Architecture diagrams"
],
permissions: β_all - β_delete(production)
},
Ξβ: {
name: "Developer",
primary_modes: [Ξ©β, Ξ©β],
responsibilities: [
"Implement features",
"Write unit tests",
"Create documentation",
"Code reviews"
],
artifacts: [
"Source code",
"Unit tests",
"Technical documentation",
"Code commits"
],
permissions: β_standard βͺ β_execute
},
Ξβ: {
name: "QA Engineer",
primary_modes: [Ξ©β, Ξ©β
],
responsibilities: [
"Create test plans",
"Execute test cases",
"Report bugs",
"Verify fixes"
],
artifacts: [
"Test plans",
"Test cases",
"Bug reports",
"QA signoff"
],
permissions: β_read βͺ β_create(tests) βͺ β_update(issues)
},
Ξβ
: {
name: "DevOps",
primary_modes: [Ξ©β, Ξ©β
],
responsibilities: [
"Manage CI/CD",
"Deploy applications",
"Monitor systems",
"Incident response"
],
artifacts: [
"Deployment configs",
"CI/CD pipelines",
"Monitoring dashboards",
"Runbooks"
],
permissions: β_all
}
}
```
## π Role Context Integration
```
Ξ_roles = {
active_role: Ξ_current β {Ξβ...Ξβ
},
role_stack: [previous_roles],
role_permissions: β(Ξ_current),
role_artifacts: artifacts[Ξ_current],
role_gates: allowed_gates[Ξ_current]
}
```
## π― Role-Mode Mapping
```
role_mode_affinity = {
Ξβ Γ Ξ©β: 1.0, # Product Owner + Research = Perfect
Ξβ Γ Ξ©β: 0.9, # Product Owner + Innovate = Great
Ξβ Γ Ξ©β: 0.3, # Product Owner + Plan = Limited
Ξβ Γ Ξ©β: 0.1, # Product Owner + Execute = Minimal
Ξβ Γ Ξ©β
: 0.5, # Product Owner + Review = Moderate
Ξβ Γ Ξ©β: 0.7, # Architect + Research = Good
Ξβ Γ Ξ©β: 1.0, # Architect + Innovate = Perfect
Ξβ Γ Ξ©β: 0.9, # Architect + Plan = Great
Ξβ Γ Ξ©β: 0.2, # Architect + Execute = Limited
Ξβ Γ Ξ©β
: 0.6, # Architect + Review = Moderate
Ξβ Γ Ξ©β: 0.3, # Developer + Research = Limited
Ξβ Γ Ξ©β: 0.5, # Developer + Innovate = Moderate
Ξβ Γ Ξ©β: 0.9, # Developer + Plan = Great
Ξβ Γ Ξ©β: 1.0, # Developer + Execute = Perfect
Ξβ Γ Ξ©β
: 0.7, # Developer + Review = Good
Ξβ Γ Ξ©β: 0.2, # QA + Research = Minimal
Ξβ Γ Ξ©β: 0.3, # QA + Innovate = Limited
Ξβ Γ Ξ©β: 0.6, # QA + Plan = Moderate
Ξβ Γ Ξ©β: 0.9, # QA + Execute = Great
Ξβ Γ Ξ©β
: 1.0, # QA + Review = Perfect
Ξβ
Γ Ξ©β: 0.2, # DevOps + Research = Minimal
Ξβ
Γ Ξ©β: 0.3, # DevOps + Innovate = Limited
Ξβ
Γ Ξ©β: 0.7, # DevOps + Plan = Good
Ξβ
Γ Ξ©β: 1.0, # DevOps + Execute = Perfect
Ξβ
Γ Ξ©β
: 0.9 # DevOps + Review = Great
}
```
## π Role Permissions
```
β(Ξ) = {
Ξβ: {
create: [Ξ‘_all, stories, criteria],
read: [all],
update: [Ξ‘_all, stories],
delete: [draft_prd],
approve: [Ξβ]
},
Ξβ: {
create: [tech_spec, design_docs, apis],
read: [all],
update: [tech_*, architecture],
delete: [draft_designs],
approve: [Ξβ]
},
Ξβ: {
create: [code, tests, docs],
read: [all],
update: [code, tests],
delete: [feature_branches],
approve: [Ξβ_partial]
},
Ξβ: {
create: [test_plans, bug_reports],
read: [all],
update: [test_*, bugs],
delete: [test_data],
approve: [Ξβ]
},
Ξβ
: {
create: [all],
read: [all],
update: [all],
delete: [all - production],
approve: [Ξβ
]
}
}
```
## π Role Switching
```
switch_role(Ξ_new) = {
validate: Ξ_new β {Ξβ...Ξβ
},
check_mode: affinity[Ξ_new Γ Ξ©_current] > 0.5 ? proceed : warn,
save_context: push(Ξ_roles.role_stack, Ξ_current),
update: {
Ξ_current = Ξ_new,
β_active = β(Ξ_new),
artifacts = load_role_artifacts(Ξ_new)
},
notify: "Switched to " + Ξ_roles[Ξ_new].name
}
```
## π Role Artifacts
```
create_artifact(type, content) = {
check: type β Ξ_current.artifacts ? proceed : deny,
template: load_template(type, Ξ_current),
create: {
metadata: {role: Ξ_current, timestamp, author},
content: apply_template(content)
},
store: /artifacts/Ξ_current/type/
}
```
## β‘ Role Commands
```
S_roles = {
!br: "switch_role",
!bra: "show role artifacts",
!brp: "show role permissions",
!brg: "show allowed gates",
!brh: "role history",
!brs: "role suggestions for current mode"
}
```
## π Integration Points
```
# Role + Mode enforcement
enforce_role_mode(op) = {
affinity_score = role_mode_affinity[Ξ_current Γ Ξ©_current],
threshold = 0.3,
affinity_score < threshold ?
warn("Role " + Ξ_current + " not optimal for mode " + Ξ©_current) :
proceed(op)
}
# Role + Gate validation
validate_gate_approver(Ξ_gate) = {
required_approvers = Ξ_gate.approvers,
can_approve = Ξ_current β required_approvers,
can_approve ? allow_approval() : deny("Role cannot approve this gate")
}
```
## π Role Guidance
```
suggest_role_for_task(task) = {
analyze: extract_task_type(task),
match: find_best_role(task_type),
suggest: "Consider switching to " + Ξ_roles[match].name,
reason: "This role specializes in " + task_type
}
```