name: 'step-05-crosscutting' description: 'Address cross-cutting concerns that affect all game systems'
workflow_path: '{installed_path}'
thisStepFile: './step-05-crosscutting.md' nextStepFile: './step-06-structure.md' workflowFile: '{workflow_path}/workflow.md' outputFile: '{output_folder}/game-architecture.md'
advancedElicitationTask: 'skill:bmad-advanced-elicitation'
Progress: Step 5 of 9 - Next: Project Structure
Define patterns for concerns that affect EVERY system in the game: error handling, logging, configuration, events, and debugging. These decisions ensure consistency across all AI agent implementations.
{communication_language}stepsCompleted: [1, 2, 3, 4, 5] before loading next step"Now let's define cross-cutting concerns - patterns that apply to EVERY system.
Why this matters: If one AI agent handles errors differently than another, your game breaks. If logging formats vary, debugging becomes impossible. These patterns are the 'constitution' that all code must follow.
Let's define each one."
"Error Handling
How should ALL systems handle errors?
Options:
| Approach | Description | Best For |
|---|---|---|
| Try-Catch Everywhere | Explicit handling at each point | Critical systems |
| Global Handler | Centralized error management | Consistent recovery |
| Signal/Event Based | Emit errors as events | Decoupled systems |
| Result Objects | Return success/failure objects | Functional style |
Game-specific considerations:
What's your error handling strategy?"
"Logging Strategy
How should ALL systems log information?
Log Levels:
Questions:
What's your logging approach?"
"Configuration Management
How will game settings be organized and accessed?
Configuration Types:
Storage options:
How should configuration be managed?"
"Event System
How should systems communicate without tight coupling?
Options:
| Pattern | Description | Complexity |
|---|---|---|
| Observer | Direct subscription | Simple |
| Event Bus | Central dispatcher | Medium |
| Signal/Slot | Type-safe connections | Medium |
| Message Queue | Async processing | Complex |
Questions:
What's your event system approach?"
"Debug & Development Tools
What development tools should be built in?
Common debug features:
Questions:
What debug tools do you want?"
Based on the conversation, prepare the content:
## Cross-cutting Concerns
These patterns apply to ALL systems and must be followed by every implementation.
### Error Handling
**Strategy:** {{error_strategy}}
**Error Levels:**
{{error_level_definitions}}
**Example:**
```{{language}}
{{error_handling_example}}
```
Format: {{logging_format}} Destination: {{log_destination}}
Log Levels: {{log_level_usage}}
Example:
}
{{logging_example}}
Approach: {{config_approach}}
Configuration Structure: {{config_structure}}
Pattern: {{event_pattern}}
Event Naming: {{naming_convention}}
Example:
}
{{event_example}}
Available Tools: {{debug_tool_list}}
Activation: {{how_to_enable}}
### 8. Present Content and Menu
Show the generated content to the user and present:
"I've documented all cross-cutting concerns.
**Here's what I'll add to the document:**
[Show the complete markdown content from step 7]
**Validation Check:**
- Do these patterns cover all systems?
- Are the examples clear enough for AI agents?
- Any edge cases we missed?
**Select an Option:**
[A] Advanced Elicitation - Deep dive into specific concerns
[P] Party Mode - Get perspectives on patterns
[C] Continue - Save this and move to Project Structure (Step 6 of 9)"
### 9. Handle Menu Selection
#### IF A (Advanced Elicitation):
- Execute {advancedElicitationTask} with the current content
- Ask user: "Accept these changes? (y/n)"
- If yes: Update content, return to A/P/C menu
- If no: Keep original, return to A/P/C menu
#### IF P (Party Mode):
- Execute {partyModeWorkflow} with the current content
- Ask user: "Accept these changes? (y/n)"
- If yes: Update content, return to A/P/C menu
- If no: Keep original, return to A/P/C menu
#### IF C (Continue):
- Append the final content to `{outputFile}`
- Update frontmatter: `stepsCompleted: [1, 2, 3, 4, 5]`
- Load `{nextStepFile}`
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN [C continue option] is selected and [cross-cutting content saved with frontmatter updated], will you then load and read fully `{nextStepFile}`.
---
## SYSTEM SUCCESS/FAILURE METRICS
### SUCCESS:
- Error handling strategy defined with example
- Logging approach documented
- Configuration management established
- Event system pattern selected
- Debug tools identified
- A/P/C menu presented and handled correctly
- Frontmatter updated with stepsCompleted: [1, 2, 3, 4, 5]
### SYSTEM FAILURE:
- Missing any cross-cutting concern
- No concrete examples provided
- Patterns too vague for AI agents to follow
- Not presenting A/P/C menu after documentation
- Proceeding without user selecting 'C'
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.