- Nx 22.7 monorepo (pnpm 11.1, TypeScript 5.9, Node 24) - apps/api: NestJS 11 (CJS conforme CODING-RULES.md PGD-DB-004) - apps/web: React 19 + Vite 8 (ESM) - libs/shared/api-interface: Zod contract base - Docker Compose dev: Postgres 18, Valkey 8, MinIO, Mailpit - WDS artifacts: - design-artifacts/A-Product-Brief/ (5 docs canônicos + 16 dialogs) - design-artifacts/B-Trigger-Map/ (hub + 4 personas + feature impact) - Stack canon: STACK.md v2.2 + CODING-RULES.md v2.0 + brand.md - AGENTS.md + README.md como entrada para devs/agentes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.7 KiB
Orchestrator Rules Appendix
Session Naming
See tmux-commands.md for complete session naming documentation.
Pattern: sa-{project_slug}-{timestamp}-e{epic}-s{N}-{type} where type = create, dev, auto, review-{cycle}
Workflow Command Arguments
CRITICAL: ALWAYS pass required positional arguments to BMAD workflows.
Story ID Requirement
create-story, dev-story, code-review, automate (testarch-automate or qa-generate-e2e-tests) — All require the story ID as a positional argument.
WRONG:
Execute the BMAD create-story workflow.
This causes create-story to create ALL stories in the epic, not just one.
CORRECT:
Execute the BMAD create-story workflow for story 5.3.
This creates ONLY story 5.3.
Validation After create-story
After create-story session completes:
- Count story files BEFORE spawning session
- Count story files AFTER session completes
- Verify exactly ONE new file created
- IF 0 or >1 files → Escalate with file list
This prevents runaway story creation where create-story creates 5.3, 5.4, 5.5, etc. instead of just the requested story.
State Updates
After EVERY action:
- Update
currentStepin state document - Log action with timestamp
- Update story progress table
Escalation Protocol
See data/escalation-triggers.md for complete trigger definitions and behavior.
Quick Reference
| Category | Marker Action | State | When |
|---|---|---|---|
| CRITICAL | DELETE | PAUSED | Cannot proceed (retries exhausted) |
| PREFERENCE | Keep | IN_PROGRESS | Could proceed either way |
CRITICAL Escalation (Key Steps)
- Delete marker: run
orchestrator-helper marker removevia the installed story-automator helper - Set state to PAUSED
- Present menu (stop hook won't interfere)
- On resume: recreate marker, set IN_PROGRESS
Dev-Story Smart Retry
Before escalating, check if story is blocking:
- Blocking: Retry up to 3 times → then CRITICAL
- Not blocking: Retry once → then PREFERENCE (can skip)
Session Monitoring & Output Parsing
CRITICAL: These topics have dedicated reference files. Load them when needed:
-
Session Monitoring: See
data/monitoring-pattern.md- FORBIDDEN patterns (capture-pane, etc.)
- Status script usage and CSV format
- Decision tree for poll results
- Polling loop with state tracking
-
Output Parsing: See
data/monitoring-pattern.md(Sub-Agent Invocation section)- NEVER parse output yourself
- ALWAYS use sub-agents (Task tool, haiku)
- Verification checkpoint before proceeding
-
Sub-Agent Prompts: See
data/subagent-prompts.md- Session Output Parser
- Code Review Analyzer (also see
subagent-prompts-analysis.md)