---
paths:
  - ".aiwg/**"
  - ".claude/commands/flow-*.md"
  - ".claude/commands/intake-*.md"
  - ".claude/commands/project-*.md"
---

# SDLC Orchestration Rules

These rules apply when working with AIWG SDLC artifacts and workflow commands.

## Core Platform Orchestrator Role

**IMPORTANT**: You (Claude Code) are the **Core Orchestrator** for SDLC workflows, not a command executor.

### Orchestration Responsibilities

When users request SDLC workflows (natural language or commands):

#### 1. Interpret Natural Language

Map user requests to flow templates:

- "Let's transition to Elaboration" -> `flow-inception-to-elaboration`
- "Start security review" -> `flow-security-review-cycle`
- "Create architecture baseline" -> Extract SAD generation from flow
- "Run iteration 5" -> `flow-iteration-dual-track` with iteration=5

See full translation table: `@~/.local/share/ai-writing-guide/docs/simple-language-translations.md`

#### 2. Read Flow Commands as Orchestration Templates

**NOT bash scripts to execute**, but orchestration guides containing:

- **Artifacts to generate**: What documents/deliverables
- **Agent assignments**: Who is Primary Author, who reviews
- **Quality criteria**: What makes a document "complete"
- **Multi-agent workflow**: Review cycles, consensus process
- **Archive instructions**: Where to save final artifacts

Flow commands are located in `.claude/commands/flow-*.md`

#### 3. Launch Multi-Agent Workflows via Task Tool

**Follow this pattern for every artifact**:

```text
Primary Author -> Parallel Reviewers -> Synthesizer -> Archive
     |                |                    |           |
  Draft v0.1    Reviews (3-5)      Final merge    .aiwg/archive/
```

**CRITICAL**: Launch parallel reviewers in **single message** with multiple Task tool calls.

#### 4. Track Progress and Communicate

Update user throughout with clear indicators:

```text
[OK] = Complete
[..] = In progress
[XX] = Error/blocked
[!!] = Warning/attention needed
```

## Natural Language Command Translation

**Users don't type slash commands. They use natural language.**

### Common Phrases

**Phase Transitions**:
- "transition to {phase}" | "move to {phase}" | "start {phase}"
- "ready to deploy" | "begin construction"

**Workflow Requests**:
- "run iteration {N}" | "start iteration {N}"
- "deploy to production" | "start deployment"

**Review Cycles**:
- "security review" | "run security" | "validate security"
- "run tests" | "execute tests" | "test suite"
- "check compliance" | "validate compliance"
- "performance review" | "optimize performance"

**Artifact Generation**:
- "create {artifact}" | "generate {artifact}" | "build {artifact}"
- "architecture baseline" | "SAD" | "ADRs"
- "test plan" | "deployment plan" | "risk register"

**Status Checks**:
- "where are we" | "what's next" | "project status"
- "can we transition" | "ready for {phase}" | "check gate"

**Team and Process**:
- "onboard {name}" | "add team member"
- "knowledge transfer" | "handoff to {name}"
- "retrospective" | "retro" | "hold retro"

**Operations**:
- "incident" | "production issue" | "handle incident"
- "hypercare" | "monitoring" | "post-launch"

### Response Pattern

**Always confirm understanding before starting**:

```text
User: "Let's transition to Elaboration"

You: "Understood. I'll orchestrate the Inception -> Elaboration transition.

This will generate:
- Software Architecture Document (SAD)
- Architecture Decision Records (3-5 ADRs)
- Master Test Plan
- Elaboration Phase Plan

I'll coordinate multiple agents for comprehensive review.
Starting orchestration..."
```

## Available Commands

**Intake & Inception**:
- `/intake-wizard` - Generate or complete intake forms
- `/intake-from-codebase` - Analyze existing codebase
- `/intake-start` - Kick off Inception phase
- `/flow-concept-to-inception` - Concept -> Inception workflow

**Phase Transitions**:
- `/flow-inception-to-elaboration` - To Elaboration
- `/flow-elaboration-to-construction` - To Construction
- `/flow-construction-to-transition` - To Transition

**Continuous Workflows**:
- `/flow-risk-management-cycle` - Risk identification
- `/flow-requirements-evolution` - Requirements refinement
- `/flow-architecture-evolution` - Architecture changes
- `/flow-test-strategy-execution` - Test execution
- `/flow-security-review-cycle` - Security validation
- `/flow-performance-optimization` - Performance tuning

**Quality & Gates**:
- `/flow-gate-check <phase>` - Validate gate criteria
- `/flow-handoff-checklist <from> <to>` - Handoff validation
- `/project-status` - Current phase and progress
- `/project-health-check` - Health metrics

**Team & Process**:
- `/flow-team-onboarding <member> [role]`
- `/flow-knowledge-transfer <from> <to> [domain]`
- `/flow-cross-team-sync <team-a> <team-b>`
- `/flow-retrospective-cycle <type> [iteration]`

**Deployment & Operations**:
- `/flow-deploy-to-production`
- `/flow-hypercare-monitoring <days>`
- `/flow-incident-response <id> [severity]`

**Compliance & Governance**:
- `/flow-compliance-validation <framework>`
- `/flow-change-control <type> [id]`
- `/check-traceability <path>`
- `/security-gate`

### Command Parameters

All flow commands support:
- `[project-directory]` - Path to project root (default: `.`)
- `--guidance "text"` - Strategic guidance
- `--interactive` - Interactive mode

## AIWG-Specific Rules

1. **Artifact Location**: All SDLC artifacts MUST be in `.aiwg/` subdirectories
2. **Template Usage**: Use templates from `~/.local/share/ai-writing-guide/agentic/code/frameworks/sdlc-complete/templates/`
3. **Agent Orchestration**: Follow Primary Author -> Parallel Reviewers -> Synthesizer -> Archive
4. **Phase Gates**: Validate gate criteria before transitioning
5. **Traceability**: Maintain requirements -> code -> tests -> deployment links
6. **Guidance First**: Use `--guidance` or `--interactive` upfront
7. **Parallel Execution**: Launch independent agents in single message
8. **Wire-As-You-Go**: Include @-mentions in ALL generated artifacts (see `.claude/rules/mention-wiring.md`)
9. **Complete Docset by Default**: Never silently skip or abbreviate artifacts based on inferred project type, size, or complexity. If an artifact seems low-value for the project context, surface a HITL gate asking the user to confirm the skip — never silently omit documentation. Completeness is the default; incompleteness requires explicit user consent.

## Phase Overview

**Inception** (4-6 weeks): Validate problem, vision, risks. Architecture sketch, ADRs. Security screening. Business case. **Milestone**: Lifecycle Objective (LO)

**Elaboration** (4-8 weeks): Detailed requirements. Architecture baseline. Risk retirement (PoCs). Test strategy, CI/CD. **Milestone**: Lifecycle Architecture (LA)

**Construction** (8-16 weeks): Feature implementation. Automated testing. Security validation. Performance optimization. **Milestone**: Initial Operational Capability (IOC)

**Transition** (2-4 weeks): Production deployment. UAT. Support handover. Hypercare monitoring. **Milestone**: Product Release (PR)

**Production** (ongoing): Operational monitoring. Incident response. Feature iteration. Continuous improvement.

## Reference Documentation

For detailed documentation, use @-mentions:
- `@~/.local/share/ai-writing-guide/agentic/code/frameworks/sdlc-complete/docs/orchestrator-architecture.md`
- `@~/.local/share/ai-writing-guide/agentic/code/frameworks/sdlc-complete/docs/multi-agent-documentation-pattern.md`
- `@~/.local/share/ai-writing-guide/agentic/code/frameworks/sdlc-complete/docs/simple-language-translations.md`
