---
name: eck:develop
version: "0.7.4"
description: "Development orchestrator: load design artifacts, generate dev plan, execute tasks with fresh contexts, wave parallelism, TDD support, and code simplification."
disable-model-invocation: false
---

# Develop

Load design artifacts, generate a dev plan, then execute tasks with fresh 200k contexts, wave parallelism, and optional TDD enforcement. Threads AC-IDs from FRD.md through each task.

---

## Context Budget — Agent Dispatch Required

> **Stages 2, 5, and 6 MUST dispatch their sub-skills via the Agent tool**, not inline invocation. The develop orchestrator has 11 stages with code-generating stages (plan, execute, refactor) that produce verbose output. Stage 5 already dispatches tasks via `agent:fresh-context`. Stages 2 and 6 must also dispatch via Agent to prevent context exhaustion before reaching Stage 10 (Review).

---

## Visual Framework

Follow the visual framework defined in the `output:visual-framework` primitive.

---

## Task Registration

### Planning Sub-stage

| Stage | Subject            | Active Form         | Statusline       |
| ----- | ------------------ | ------------------- | ---------------- |
| 1     | Stage 1: Calibrate | Calibrating session | Calibrate (1/11) |
| 2     | Stage 2: Plan      | Generating plan     | Plan (2/11)      |

### Execution Sub-stage

| Stage | Subject           | Active Form             | Statusline      |
| ----- | ----------------- | ----------------------- | --------------- |
| 3     | Stage 3: Graph    | Building graph          | Graph (3/11)    |
| 4     | Stage 4: Waves    | Computing waves         | Waves (4/11)    |
| 5     | Stage 5: Execute  | Executing tasks         | Execute (5/11)  |
| 6     | Stage 6: Refactor | Refactoring code        | Refactor (6/11) |
| 7     | Stage 7: Verify   | Running checks          | Verify (7/11)   |
| 8     | Stage 8: Push     | Pushing and creating PR | Push (8/11)     |
| 9     | Stage 9: Report   | Generating report       | Report (9/11)   |
| 10    | Stage 10: Review  | Reviewing develop       | Review (10/11)  |
| 11    | Stage 11: Tracker | Updating tracker        | Tracker (11/11) |

## Statusline Stage Updates

At the start of each stage:

```bash
bash $ECK_HOME/update-stage.sh "Name (N/11)"
```

At skill completion (success or error):

```bash
bash $ECK_HOME/update-stage.sh
```

## Usage

```bash
/eck:develop <epic-key or plan-ref>                  # Load design, generate plan, execute all waves
/eck:develop <epic-key or plan-ref> --tdd            # Enforce red/green/green TDD gates
/eck:develop <epic-key or plan-ref> --sprint         # Use dev-sprint for tracker execution
/eck:develop <epic-key or plan-ref> --rigor lite|standard|strict
/eck:develop <epic-key or plan-ref> --plan-only      # Generate dev plan then exit
/eck:develop <epic-key or plan-ref> --skip-plan      # Skip dev-plan, load existing TASKS.md
--force                                              # Override prerequisite gate check (not available at strict rigor)
```

### Flags

| Flag                             | Description                                                      |
| -------------------------------- | ---------------------------------------------------------------- |
| `--tdd`                          | Enforce red/green/green gates on every dev-task                  |
| `--sprint`                       | Use dev-sprint for tracker-based execution                       |
| `--rigor lite\|standard\|strict` | Override development rigor                                       |
| `--plan-only`                    | Run Stage 1-2 (design load + dev plan) then exit                 |
| `--skip-plan`                    | Skip Stage 2 (dev-plan), load existing TASKS.md directly         |
| `--force`                        | Override prerequisite gate check (not available at strict rigor) |

### Sub-skill Dispatch

| Sub-skill      | Invocation                                | Purpose                                   |
| -------------- | ----------------------------------------- | ----------------------------------------- |
| dev-plan       | `/<PROJECT_KEY_LOWERCASE>:dev-plan`       | Generate TASKS.md from design artifacts   |
| dev-task       | `/<PROJECT_KEY_LOWERCASE>:dev-task`       | Atomic unit: TDD, develop, review, commit |
| dev-sprint     | `/<PROJECT_KEY_LOWERCASE>:dev-sprint`     | Multi-task with tracker recovery          |
| dev-test       | `/<PROJECT_KEY_LOWERCASE>:dev-test`       | Test generation (TDD red phase)           |
| dev-simplify   | `/<PROJECT_KEY_LOWERCASE>:dev-simplify`   | Post-development code simplification      |
| dev-push       | `/<PROJECT_KEY_LOWERCASE>:dev-push`       | Push feature branch to remote             |
| dev-pr         | `/<PROJECT_KEY_LOWERCASE>:dev-pr`         | Create/update pull request                |
| develop-review | `/<PROJECT_KEY_LOWERCASE>:develop-review` | Review gate (mandatory)                   |
| deploy-tracker | `/<PROJECT_KEY_LOWERCASE>:deploy-tracker` | Update tracker issue status               |

> **Sub-skill invocation rule:** All sub-skills above MUST be invoked with the project key prefix derived from `PROJECT_KEY` in `.claude/project-constants.md`. For example, if `PROJECT_KEY=WA`, invoke `/wa:dev-task`, not `/dev-task`.

---

## Stage 0: Gate Check

> **Pre-execution prerequisite validation — does not appear in Task Registration.**

### Inputs

- Feature slug from `<FEATURE_SLUG>` or `$ARGUMENTS`
- `--force` flag (if present)

### Activities

1. Invoke `core/ops:gate-check` primitive with:
   - `feature_slug`: current feature
   - `required_step`: `design`
   - `rigor`: current rigor level from `core/mode:read-dev-rigor`
2. If gate check passes: proceed to Stage 1.
3. If gate check fails:
   - **Without `--force`**: Display blocking reason and guidance. STOP.

     ```
     ⚠ Prerequisite not met: design phase must be complete with passing review gate.
     Current status: <status> | Gate verdict: <verdict>

     Options:
     - Complete /eck:design first
     - Re-run with --force to override (not available at strict rigor)
     ```

   - **With `--force`** (lite/standard only): Record override in lifecycle.json and proceed.
     At strict rigor, `--force` is rejected with: "Hard block at strict rigor — complete prerequisites first."

### Outputs

- Gate check result (pass/fail/forced)

### Exit Criteria

- Prerequisites verified OR override recorded

---

## Stage 1: Calibrate

```bash
bash $ECK_HOME/update-stage.sh "Calibrate (1/11)"
```

### Inputs

- `$ARGUMENTS` — feature reference or epic key
- `docs/{feature}/DESIGN-REVIEW.md` — reviewed design (preferred)
- `docs/{feature}/ARCHITECTURE.md` — system architecture
- `docs/{feature}/DESIGN.md` — component design
- `docs/{feature}/FRD.md` — acceptance criteria (if exists)
- `.claude/project-constants.md` — project configuration

### Feature Resolution

Before proceeding, resolve the target <KEY>-XXX:

1. If `$ARGUMENTS` matches `FEAT-\d{3}` (case-insensitive) → normalize to uppercase, use directly
2. If `$ARGUMENTS` is non-empty text → `node $ECK_HOME/manage-features.js resolve "$ARGUMENTS"` → extract `id` from JSON output
3. If `$ARGUMENTS` is empty → read `active_feature` from session file:
   ```bash
   if [ -n "$CLAUDE_SESSION_ID" ]; then
     FEAT_ID=$(jq -r '.active_feature // empty' "$CLAUDE_PROJECT_DIR/.claude/sessions/${CLAUDE_SESSION_ID}.json" 2>/dev/null)
   fi
   ```
4. If still empty → read from lifecycle-state.json (fallback: lifecycle.json):
   ```bash
   FEAT_ID=$(jq -r '.active_feature // empty' "$CLAUDE_PROJECT_DIR/.claude/lifecycle-state.json" 2>/dev/null)
   [ -z "$FEAT_ID" ] && FEAT_ID=$(jq -r '.active_feature // empty' "$CLAUDE_PROJECT_DIR/.claude/lifecycle.json" 2>/dev/null)
   ```
5. If still empty → AskUserQuestion listing features from `node $ECK_HOME/manage-features.js list`
6. Validate <KEY>-XXX exists: `node $ECK_HOME/manage-features.js read "$FEAT_ID"`. If not found, STOP.
7. If not in lifecycle.json, auto-register: `node $ECK_HOME/update-lifecycle.js register "$FEAT_ID"`
8. Get slug: `FEATURE_SLUG=$(node $ECK_HOME/manage-features.js read "$FEAT_ID" | jq -r '.slug')`

Set `FEATURE_ID` to the <KEY>-XXX value. Use `FEATURE_ID` for all lifecycle calls.
Use `FEATURE_SLUG` only for docs folder paths: `docs/${FEATURE_ID}-${FEATURE_SLUG}/`

### Activities

1. Check for existing state file:

   ```bash
   cat "$CLAUDE_PROJECT_DIR/docs/${FEATURE_ID}-${FEATURE_SLUG}/DEVELOP-STATE.md" 2>/dev/null || echo "No state file"
   ```

   If found, offer resume via AskUserQuestion:

   ```
   Found DEVELOP-STATE.md from a previous session.
   Options:
     1 - Resume from where you left off
     2 - Start fresh (discard previous state)
   ```

   If resume: load state, skip completed waves/tasks, resume from the last incomplete stage.

2. Detect the development scope from `$ARGUMENTS`:

| Scope       | Detection                             | Dispatch                     |
| ----------- | ------------------------------------- | ---------------------------- |
| **Feature** | Epic key pattern or feature reference | Full wave pipeline           |
| **Sprint**  | `--sprint` flag                       | `dev-sprint` (tracker-based) |
| **Task**    | Single task key or `--task` flag      | `dev-task` (atomic unit)     |

3. Verify design artifacts exist. Look for, in priority order:
   - `docs/{feature}/DESIGN-REVIEW.md` (preferred — post-review artifact)
   - `docs/{feature}/ARCHITECTURE.md` + `docs/{feature}/DESIGN.md` (acceptable)
4. If neither set is found, STOP:

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${RED}[!]${RESET} No design artifacts found for {FEATURE}."
printf '%b\n' "    ${DIM}Run /eck:design to produce DESIGN-REVIEW.md before developing.${RESET}"
```

5. Load the design artifacts and inject key excerpts as context for subsequent stages:
   - Architecture decisions and component boundaries from ARCHITECTURE.md or DESIGN-REVIEW.md
   - Interface contracts, data models, and integration points from DESIGN.md or DESIGN-REVIEW.md
6. Load `docs/{feature}/FRD.md` if it exists. Extract AC-IDs for task-level threading. Also extract the **Verification** column for each AC-ID — look for entries containing "Unit test", "Integration test", or "Automated test".
7. If FRD.md not found, note the absence for later stages:

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${YELLOW}[>]${RESET} No FRD.md found — AC-ID tracking unavailable"
printf '%b\n' "    ${DIM}Run /eck:spec for AC-ID tracking.${RESET}"
```

8. Resolve the active development mode using the `mode:read-dev-rigor` primitive.
9. Resolve TDD enforcement:
   - If `--tdd` is present → enable TDD for all tasks.
   - If `--tdd` is NOT present but FRD.md was loaded in step 6 and **any AC-ID** has a Verification column containing "Unit test", "Integration test", or "Automated test" → **auto-enable TDD** for tasks mapped to those AC-IDs. Log: `"Auto-enabling TDD: AC-XX verification method requires tests"`.
   - Otherwise → TDD is off.
10. If `--sprint` is present, read sprint context from the task tracker.

### Outputs

- Design artifact excerpts loaded as context
- AC-IDs extracted (if FRD.md present)
- Development mode and flags resolved

### Exit Criteria

- DESIGN-REVIEW.md or (ARCHITECTURE.md + DESIGN.md) verified to exist
- Design context injected
- Development mode resolved

### Display Design Load Summary

```bash
source $ECK_HOME/colors.sh

echo ""
printf '%b\n' "${ORANGE}${BOLD}Design Loaded${RESET}"
echo ""
printf '%b\n' "Feature: {FEATURE_REF}"
printf '%b\n' "Design Source: {DESIGN_ARTIFACT}"
printf '%b\n' "AC-IDs: {AC_COUNT} criteria tracked"
printf '%b\n' "Dev Mode: {DEV_RIGOR}"
printf '%b\n' "TDD: {TDD_STATUS}"
printf '%b\n' "Sprint Mode: {SPRINT_STATUS}"
echo ""
```

---

## Stage 2: Plan

```bash
bash $ECK_HOME/update-stage.sh "Plan (2/11)"
```

### Inputs

- Design artifact context from Stage 1
- `$ARGUMENTS` — feature reference
- `--skip-plan` flag — skip this stage if set
- `--plan-only` flag — exit after this stage if set

### Activities

1. If `--skip-plan` is present, skip this stage entirely:

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${DIM}[-]${RESET} Stage 2 skipped (--skip-plan)"
```

Then proceed to Stage 3 loading existing TASKS.md.

2. Otherwise, **MUST** dispatch `/<PROJECT_KEY_LOWERCASE>:dev-plan` via the **Agent tool** to keep orchestrator context lean:
   - Pass the feature reference and design context summaries
   - The agent writes `docs/{feature}/TASKS.md` with tasks, dependencies, AC-ID mappings, and estimates
   - The agent returns a **compact summary only**: task count, dependency count, AC-ID coverage count
   - Do NOT return full TASKS.md content

3. **MUST** verify TASKS.md was produced and contains tracker keys. If missing, STOP:

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${RED}[!]${RESET} /dev-plan did not produce TASKS.md."
printf '%b\n' "    ${DIM}Check design artifacts and retry, or use --skip-plan with an existing TASKS.md.${RESET}"
```

Do NOT proceed without TASKS.md.

4. **MUST** verify every task in TASKS.md has a non-empty `Tracker Key` value. If any task is missing a tracker key, STOP:

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${RED}[!]${RESET} Tasks in TASKS.md are missing Tracker Key values."
printf '%b\n' "    ${DIM}Re-run /dev-plan or manually add tracker keys before continuing.${RESET}"
```

5. Register all tasks from TASKS.md in Claude's TaskList for progress tracking:

   For each task in TASKS.md:

   ```
   TaskCreate: subject="T-{N}: {title}", description="{description from TASKS.md}"
   ```

   This MUST be done so the user can see progress during wave execution.
   If tasks were already registered by dev-plan, verify they exist via `TaskList` and skip duplicates.

6. If `--plan-only` is present, display a summary and exit:

```bash
source $ECK_HOME/colors.sh

echo ""
printf '%b\n' "${ORANGE}${BOLD}Dev Plan Complete${RESET}"
echo ""
printf '%b\n' "TASKS.md: docs/{feature}/TASKS.md"
printf '%b\n' "Tasks: {TASK_COUNT}"
printf '%b\n' "${DIM}  Next: /eck:develop {FEATURE_REF} --skip-plan${RESET}"
echo ""
```

Then reset statusline and exit.

### Outputs

- `docs/{feature}/TASKS.md` generated (or confirmed existing with `--skip-plan`)

### Exit Criteria

- TASKS.md exists and is non-empty
- If `--plan-only`: exit after displaying summary

### Stage Exit Verification

Before proceeding to Stage 3, **MUST** verify:

- [ ] `docs/{feature}/TASKS.md` exists and is non-empty
- [ ] Every task in TASKS.md has a non-empty `Tracker Key` value

**Rigor behavior:**

- **strict**: STOP on failure, no override
- **standard**: STOP on failure, `--force` available
- **lite**: Warn and continue

If verification fails at current rigor level (read via `mode:read-dev-rigor`): apply rigor behavior above.

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${RED}[!]${RESET} Stage exit verification failed: TASKS.md missing or tasks lack tracker keys"
```

---

## Stage 3: Graph

```bash
bash $ECK_HOME/update-stage.sh "Graph (3/11)"
```

### Inputs

- `docs/{feature}/TASKS.md` — task list from Stage 2 (or existing, if `--skip-plan`)
- AC-IDs from Stage 1

### Activities

1. Load TASKS.md from `docs/{feature}/TASKS.md` or `.claude/TASKS.md` if not already in memory.
2. Parse the task list: extract task IDs, descriptions, dependencies, AC-IDs, estimates, and assignments.
3. Build a directed acyclic graph (DAG) from task dependency declarations.
4. Detect cycles. If any cycle found, STOP:

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${RED}[!]${RESET} Dependency cycle detected: {TASK_A} -> {TASK_B} -> {TASK_A}"
printf '%b\n' "    ${DIM}Resolve the cycle in TASKS.md before continuing.${RESET}"
```

5. Identify tasks with no dependencies (Wave 1 candidates).

### Outputs

- Parsed task list with dependencies and AC-IDs
- DAG structure
- Independent task set identified

### Exit Criteria

- TASKS.md loaded and parsed
- At least one task found
- DAG built without cycles

### Display Dependency Visualization

```bash
source $ECK_HOME/colors.sh
echo ""
printf '%b\n' "${ORANGE}${BOLD}Dependency Graph${RESET}"
echo ""
printf '%b\n' "Tasks Ref: {PLAN_REF}"
printf '%b\n' "Tasks: {TASK_COUNT}"
printf '%b\n' "  ${DIM}Independent (no deps):${RESET} {TASK_LIST}"
printf '%b\n' "  ${DIM}Has deps:${RESET}              {TASK_LIST}"
echo ""
```

---

## Stage 4: Wave Computation

```bash
bash $ECK_HOME/update-stage.sh "Waves (4/11)"
```

### Inputs

- DAG from Stage 3

### Activities

1. Group tasks into waves: a task belongs to Wave N when all dependencies appear in waves 1 through N-1.
2. Wave 1 contains all tasks with no dependencies.
3. Use AskUserQuestion to confirm the wave plan:

```
Wave plan ready. {N} waves, {TASK_COUNT} tasks total. Proceed?
Options:
  - "Proceed"
  - "Cancel"
```

### Outputs

- Ordered wave plan

### Exit Criteria

- User confirmed the wave plan
- All tasks assigned to a wave

### Display Wave Plan

```bash
source $ECK_HOME/colors.sh
echo ""
printf '%b\n' "${ORANGE}${BOLD}Wave Plan${RESET}"
echo ""
printf '%b\n' "  ${CYAN}[*]${RESET} Wave 1 (independent): {TASK_A}, {TASK_B}, {TASK_C}"
printf '%b\n' "  ${CYAN}[*]${RESET} Wave 2: {TASK_D} (depends {TASK_A}+{TASK_B})"
printf '%b\n' "  ${CYAN}[*]${RESET} Wave 3: {TASK_F} (depends {TASK_D}+{TASK_E})"
echo ""
```

### Stage Exit Verification

Before proceeding to Stage 5, **MUST** verify:

- [ ] Wave plan is confirmed by user (not cancelled)
- [ ] All tasks are assigned to a wave (no orphan tasks)

**Rigor behavior:**

- **strict**: STOP on failure, no override
- **standard**: STOP on failure, `--force` available
- **lite**: Warn and continue

If verification fails at current rigor level (read via `mode:read-dev-rigor`): apply rigor behavior above.

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${RED}[!]${RESET} Stage exit verification failed: wave plan not confirmed or tasks unassigned"
```

---

## Stage 5: Execute Waves

```bash
bash $ECK_HOME/update-stage.sh "Execute (5/11)"
```

### Inputs

- Wave plan from Stage 4
- AC-IDs from FRD.md (for task-level threading)
- Project constants and heuristics

### Activities

For each wave in sequence:

1. Display wave banner:

```bash
source $ECK_HOME/colors.sh
echo ""
printf '%b\n' "${ORANGE}${BOLD}Wave {N} of {TOTAL}${RESET}"
echo ""
```

2. For each task in the wave:

   a. **Verify tracker key exists**: Read the task's `Tracker Key` from TASKS.md. If empty or missing, STOP:

   ```bash
   source $ECK_HOME/colors.sh
   printf '%b\n' "${RED}[!]${RESET} Task {T-ID} has no Tracker Key. Cannot dispatch dev-task."
   printf '%b\n' "    ${DIM}Re-run /dev-plan or manually add the tracker key to TASKS.md.${RESET}"
   ```

   Do NOT dispatch dev-task without a valid tracker key.

   **Per-task Stage Exit Verification:** Before dispatching dev-task, **MUST** verify the tracker issue exists for this task's Tracker Key. If the tracker key references a non-existent issue, apply rigor behavior:
   - **strict**: STOP on failure, no override
   - **standard**: STOP on failure, `--force` available
   - **lite**: Warn and continue

   ```bash
   source $ECK_HOME/colors.sh
   printf '%b\n' "${RED}[!]${RESET} Stage exit verification failed: tracker issue not found for task {T-ID}"
   ```

   b. **MUST** update TaskList: Set the task to `in_progress` via `TaskUpdate`. Do NOT skip this step.

   c. **MUST** dispatch via Agent tool with a fresh subagent context via `agent:fresh-context`:
   - Inject task description, tracker key, AC-IDs, relevant file paths, active heuristics, project constants
   - If TDD is enabled (via `--tdd` flag or auto-enabled from AC verification methods): invoke `/dev-test <key>` first (red), then `/dev-task <key>` (green)
   - Otherwise: invoke `/dev-task <key>` directly
   - Do NOT implement code directly in the orchestrator — delegate to the subagent.

   d. **MUST** update TaskList: On completion, set the task to `completed` via `TaskUpdate`. On failure, keep as `in_progress`. Do NOT skip task status updates.

3. Collect atomic commit reference from each subagent.
4. Verify every task produced a commit. Failed tasks with no commit:

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${RED}[!]${RESET} Wave {N} failed: {TASK_ID} did not complete."
printf '%b\n' "    ${DIM}Failure details: {REASON}${RESET}"
```

Then AskUserQuestion: "Continue remaining waves?" / "Stop and save state"

5. Flag tasks not mapped to any AC-ID in the report:

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${YELLOW}[>]${RESET} Unmapped task: {TASK_ID} has no AC-ID assignment"
```

### Outputs

- Completed task commits
- Per-wave completion status
- Unmapped task warnings

### Exit Criteria

- All waves executed (or user chose to stop)
- Each task has a commit (or is recorded as failed)

### Display Wave Completion

```bash
source $ECK_HOME/colors.sh

echo ""
printf '%b\n' "${ORANGE}${BOLD}Wave {N} Complete${RESET}"
echo ""
printf '%b\n' "Tasks Completed: {N}"
printf '%b\n' "Commits: {N}"
echo ""
```

---

## Stage 6: Refactor

```bash
bash $ECK_HOME/update-stage.sh "Refactor (6/11)"
```

### Inputs

- All files changed during Stage 5
- Development mode

### Activities

1. Skip this stage entirely when `--rigor lite` is active:

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${DIM}[-]${RESET} Stage 6 skipped (lite mode)"
```

2. **MUST** dispatch `/<PROJECT_KEY_LOWERCASE>:dev-simplify` via the **Agent tool** to keep orchestrator context lean. Pass the list of changed files from Stage 5.

   The Agent prompt should instruct the subagent to:
   - Run the dev-simplify sub-skill across all changed files
   - Review for duplicate logic, naming inconsistencies, dead code
   - Commit simplification changes directly
   - Return a **compact summary only**: files reviewed, changes made, commit SHA
   - Do NOT return full diff or review output

### Outputs

- Simplified code with commit

### Exit Criteria

- Simplification pass completed (or skipped in lite mode)

---

## Stage 7: Verify

```bash
bash $ECK_HOME/update-stage.sh "Verify (7/11)"
```

### Inputs

- All files changed during Stages 5-6

### Activities

This is a quick verification pass, not a full `/eck:validate` run.

1. Run the `review:test` primitive — all tests must pass.
2. Run the `review:lint` primitive — no new lint errors.
3. Display results:

```bash
source $ECK_HOME/colors.sh
# On pass:
printf '%b\n' "${GREEN}[x]${RESET} Tests passing"
printf '%b\n' "${GREEN}[x]${RESET} Lint clean"
# On failure:
printf '%b\n' "${RED}[!]${RESET} Verification failed: {TEST_OR_LINT} reported errors."
printf '%b\n' "    ${DIM}Run /eck:validate for full diagnostic analysis.${RESET}"
```

### Outputs

- Test and lint results

### Exit Criteria

- Test and lint primitives executed
- Results recorded for final report

---

## Stage 8: Push

```bash
bash $ECK_HOME/update-stage.sh "Push (8/11)"
```

### Inputs

- Feature branch with committed code from Stages 5-7
- FRD.md AC-IDs from Stage 1 (for PR description threading)
- TASKS.md content from Stage 2

### Activities

1. Invoke `/dev-push` to push the feature branch to remote with upstream tracking.

2. On push failure, display error and STOP:

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${RED}[!]${RESET} dev-push failed — cannot create PR without remote branch"
printf '%b\n' "    ${DIM}Address the error and re-run /eck:develop.${RESET}"
```

3. Invoke `/dev-pr` to create or update the pull request against `<DEV_BRANCH>`.

Pass as context:

- Current branch name
- FRD.md AC-IDs (if available from Stage 1)
- TASKS.md content (if available from Stage 2)
- Recent commit history for PR description

4. Display PR summary:

```bash
source $ECK_HOME/colors.sh
printf '%b\n' "${GREEN}[x]${RESET} PR ready: {PR_URL}"
printf '%b\n' "    ${DIM}Title: {PR_TITLE}${RESET}"
```

### Outputs

- Branch pushed to remote; PR created or updated

### Exit Criteria

- Branch pushed successfully (upstream tracking set)
- PR created or updated with AC-ID references

---

## Stage 9: Report

```bash
bash $ECK_HOME/update-stage.sh "Report (9/11)"
```

### Inputs

- All stage results
- AC-ID coverage data

### Activities

1. Calculate AC-ID coverage: how many acceptance criteria have tasks that completed.
2. Display pre-review summary.

### Outputs

- Development report displayed to user

### Exit Criteria

- Report displayed

### Display Pre-Review Summary

```bash
source $ECK_HOME/colors.sh

echo ""
printf '%b\n' "${ORANGE}${BOLD}Development Complete${RESET}"
echo ""
printf '%b\n' "Plan Ref: {PLAN_REF}"
printf '%b\n' "Tasks: {COMPLETED} / {TOTAL} completed"
printf '%b\n' "Waves: {WAVE_COUNT} executed"
printf '%b\n' "Commits: {COMMIT_COUNT} total"
printf '%b\n' "AC Coverage: {N} of {TOTAL} criteria addressed"
printf '%b\n' "Tests: {TEST_STATUS}"
echo ""
```

---

## Stage 10: Review (10/11)

> **Mandatory — cannot be skipped or deselected.**

```bash
bash $ECK_HOME/update-stage.sh "Review (10/11)"
```

### Inputs

- All stage artifacts produced by prior stages
- Feature slug
- Rigor level

### Activities

1. **MUST** dispatch to `<PK>:develop-review` sub-skill. Do NOT skip the review gate.
2. Review skill validates mandatory artifacts, runs quality checks, computes verdict.
3. Review skill **MUST** record verdict via `update-lifecycle.js gate-verdict`.
4. On PASS or CONDITIONAL:
   - Call `update-lifecycle.js done "$FEATURE_ID" develop`
   - Display: "✓ Develop gate PASSED. Next: Stage 11 (Tracker), then /eck:validate"
5. On FAIL:
   - Step status set to "gated" (yellow in statusline)
   - Display: "✗ Develop gate FAILED. Fix issues and re-run /eck:develop."
   - STOP (do not display next-stage guidance)

### Outputs

- `docs/{feature}/DEVELOP-REVIEW.md` verdict artifact
- lifecycle.json updated with gate verdict

### Exit Criteria

- Review gate verdict recorded
- Step marked "done" (on PASS) or "gated" (on FAIL)

### Reset Statusline

```bash
bash $ECK_HOME/update-stage.sh
```

---

## Stage 11: Tracker

```bash
bash $ECK_HOME/update-stage.sh "Tracker (11/11)"
```

### Inputs

- Child issue keys from TASKS.md
- PR number from Stage 8

### Activities

1. Invoke `/deploy-tracker --status in-review` to update tracker issue statuses.
   - On success: display `[x] Tracker issues updated to In Review`
   - On failure: display `[!] deploy-tracker failed — update tracker manually`. Non-blocking.

### Outputs

- Tracker issues updated with "In Review" status

### Exit Criteria

- `/deploy-tracker` completed (success or failure logged)

---

## Lifecycle Integration

### Entry Protocol (Stage 1)

At the start of Stage 1, after feature resolution, run:

```bash
echo "$(date +%s)" > /tmp/eck-skill-start-$$

node $ECK_HOME/update-lifecycle.js register "$FEATURE_ID" --branch "$(git branch --show-current 2>/dev/null)"
node $ECK_HOME/update-lifecycle.js start "$FEATURE_ID" "develop"
node $ECK_HOME/update-lifecycle.js activate "$FEATURE_ID"
```

### Exit Protocol (after Stage 11)

```bash
START_TS=$(cat /tmp/eck-skill-start-$$ 2>/dev/null || echo "0")
END_TS=$(date +%s)
DURATION=$((END_TS - START_TS))

node $ECK_HOME/update-lifecycle.js done "$FEATURE_ID" "develop"

node $ECK_HOME/log-activity.js \
  --skill "eck:develop" --feature "$FEATURE_ID" --outcome "success" \
  --duration "$DURATION" --summary "{SUMMARY_TEXT}" --step "develop"

```

On failure, replace `done` with `fail` and outcome with `"failed"`.

---

## Error Handling

### Task Failure Within a Wave

When a task fails during Stage 5:

- Halt that wave immediately after the failed task is identified.
- Report the failure with diagnostic details.
- Use AskUserQuestion to ask whether to continue with remaining waves or stop.
- Never silently skip a failed task.

### Save State on Failure

If the user chooses to stop, or if an unrecoverable error occurs, write `DEVELOP-STATE.md` using the `ops:state-save` primitive:

```markdown
## Development State

**Plan Ref:** {PLAN_REF}
**Halted At:** Stage {N}, Wave {W}, Task {TASK_ID}
**Reason:** {ERROR_DESCRIPTION}
**Timestamp:** {ISO_8601}

### Completed Tasks

{list of completed task IDs and their commits}

### Pending Tasks

{list of task IDs not yet started}

### Failed Task

- ID: {TASK_ID}
- Error: {DESCRIPTION}
- Recovery: {SUGGESTED_ACTION}
```

Write this state to `docs/{feature}/DEVELOP-STATE.md`. This file enables `/eck:resume` to pick up where execution halted. The `/eck:pause` command will write this state file automatically when invoked during a develop session.

### Statusline Reset on Exit

At completion (success or error), always reset the statusline:

```bash
bash $ECK_HOME/update-stage.sh
```

---

## Related Documents

- `/eck:spec` — spec orchestrator (lifecycle predecessor)
- `/eck:design` — design orchestrator (lifecycle predecessor)
- `/eck:validate` — validate orchestrator (lifecycle successor)
- `/eck:fresh-context` — subagent-based context continuation
- `/dev-push` — push feature branch to remote
- `/dev-pr` — create/update pull request
- `/deploy-tracker` — update tracker issue status
