chore: initial monorepo scaffold + WDS Phase 1+2 artifacts

- 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>
This commit is contained in:
2026-05-27 14:34:20 +00:00
commit 17c08e6392
3631 changed files with 855518 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
# 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:**
```bash
Execute the BMAD create-story workflow.
```
This causes create-story to create ALL stories in the epic, not just one.
**CORRECT:**
```bash
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:**
1. Count story files BEFORE spawning session
2. Count story files AFTER session completes
3. Verify exactly ONE new file created
4. 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:
1. Update `currentStep` in state document
2. Log action with timestamp
3. 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)
1. Delete marker: run `orchestrator-helper marker remove` via the installed story-automator helper
2. Set state to PAUSED
3. Present menu (stop hook won't interfere)
4. 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`)