---
name: eck:dev-rigor
version: "0.7.4"
description: Display or switch the active dev rigor level (lite/standard/strict)
disable-model-invocation: true
---

# Dev Rigor

Display or switch the active dev rigor level. Rigor controls TDD enforcement, security review depth, documentation requirements, and other behavior flags across all workflow skills.

---

## Visual Framework

Follow these conventions for all terminal output displayed to the user via the Bash tool.

### Output Mode Awareness

Before producing output, read the user's preferred output mode:

```bash
cat $ECK_HOME/user-preferences.json 2>/dev/null
```

Extract the `outputMode` field and adapt verbosity:

- **guided** — Add explanatory prose after key steps. Describe what is happening and why.
- **standard** (default) — Balanced. Show steps with brief context for non-obvious decisions.
- **concise** — Steps and summary box only. No prose, no explanations.

If the file is missing or `outputMode` is absent, use **standard**.

### ANSI Colors

Declare these variables at the top of **every** Bash tool call (shell state does not persist between calls):

```bash
source $ECK_HOME/colors.sh
```

Every color sequence **must** end with `${RESET}`. No exceptions.

### Stage Banners

Mark major stage transitions with a clean bold header. One blank line before and after.

```bash
echo ""
printf '%b\n' "${ORANGE}${BOLD}Stage Name${RESET}"
echo ""
```

### Status Symbols

| Symbol | Meaning          | Color       |
| ------ | ---------------- | ----------- |
| `[*]`  | Active / running | `${CYAN}`   |
| `[x]`  | Completed        | `${GREEN}`  |
| `[!]`  | Error            | `${RED}`    |
| `[-]`  | Skipped          | `${DIM}`    |
| `[>]`  | In progress      | `${YELLOW}` |
| `[ ]`  | Pending          | `${DIM}`    |

```bash
printf '%b\n' "${GREEN}[x]${RESET} Step completed"
printf '%b\n' "${RED}[!]${RESET} Something failed"
```

No emoji in output. Use only these bracket symbols for status.

### Summary Blocks

Display at checkpoints and at the end of the skill. One blank line before and after.

```bash
echo ""
printf '%b\n' "${ORANGE}${BOLD}Title${RESET}"
echo ""
printf '%b\n' "Label: Value"
echo ""
```

### Error Format

```bash
printf '%b\n' "${RED}[!]${RESET} Error message here"
printf '%b\n' "    ${DIM}Recovery guidance here.${RESET}"
```

### Spacing Rules

- One blank line before and after stage banners and summary boxes.
- No blank lines within step lists.
- Maximum output line width: 70 characters.

### Statusline Stage Updates

At the **start** of each stage, update the statusline:

```bash
bash $ECK_HOME/update-stage.sh "{Statusline text from table}"
```

At **skill completion** (success or error), reset:

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

---

## Task Registration

| Stage | Subject                     | Active Form             | Statusline    |
| ----- | --------------------------- | ----------------------- | ------------- |
| 1     | Stage 1: Read Current Rigor | Reading current rigor   | Read (1/3)    |
| 2     | Stage 2: Update Rigor       | Updating dev rigor      | Update (2/3)  |
| 3     | Stage 3: Confirm            | Confirming rigor change | Confirm (3/3) |

## Usage

```bash
/eck:dev-rigor                       # Show current rigor with behavior summary
/eck:dev-rigor lite                  # Switch to lite rigor
/eck:dev-rigor standard              # Switch to standard rigor
/eck:dev-rigor strict                # Switch to strict rigor
```

---

## Stage 1: Read Current Rigor

### Inputs

- `$ECK_HOME/user-preferences.json` — global `devRigor` field
- `.claude/project-constants.md` — project-level `PROJECT_TYPE` row (if present)

### Activities

1. Read `user-preferences.json` and extract `devRigor` (default: `standard`)
2. Read `.claude/project-constants.md` and extract `PROJECT_TYPE` row (if in a project)
3. Derive current rigor from PROJECT_TYPE mapping: 1-2=lite, 3=standard, 4-5=strict
4. Parse the `$ARGUMENTS` for a target rigor (`lite`, `standard`, `strict`)

### Outputs

- Current global rigor value
- Current project rigor value (if applicable)
- Parsed target rigor (if provided)

### Exit Criteria

- Current rigor is known
- If a target rigor was provided, it is one of: `lite`, `standard`, `strict`

**If no target rigor was provided**, display the current rigor and behavior summary, then stop (skip Stages 2 and 3):

```bash
source $ECK_HOME/colors.sh

echo ""
printf '%b\n' "${ORANGE}${BOLD}Current Rigor${RESET}"
echo ""
printf '%b\n' "Global: {current_rigor}"
printf '%b\n' "Project: {project_rigor or 'n/a'}"
printf '%b\n' "Project Type: {level}: {label}"
echo ""
printf '%b\n' "${BOLD}Key Behaviors${RESET}"
printf '%b\n' "TDD: {skip/enforce all}"
printf '%b\n' "Security: {skip/conditional/always}"
printf '%b\n' "Docs: {lightweight/standard/full}"
printf '%b\n' "Quality Gates: {tests/tests+lint/tests+lint+types}"
echo ""
printf '%b\n' "${DIM}Switch: /eck:dev-rigor lite|standard|strict${RESET}"
echo ""
```

Fill the behavior values from this matrix:

| Behavior      | lite        | standard     | strict               |
| ------------- | ----------- | ------------ | -------------------- |
| TDD           | skip        | skip         | enforce for all      |
| Security      | skip        | conditional  | always               |
| Docs          | lightweight | standard     | full                 |
| Quality Gates | tests only  | tests + lint | tests + lint + types |

**If the target rigor is invalid** (not one of lite/standard/strict):

```bash
source $ECK_HOME/colors.sh

printf '%b\n' "${RED}[!]${RESET} Invalid rigor: {value}"
printf '%b\n' "    ${DIM}Valid levels: lite, standard, strict${RESET}"
```

Then reset statusline and stop.

---

## Stage 2: Update Rigor

### Inputs

- Target rigor from Stage 1

### Activities

1. Read `$ECK_HOME/user-preferences.json`
2. Update the `devRigor` field to the target rigor
3. Write the updated JSON back
4. If `.claude/project-constants.md` exists:
   - Update `PROJECT_TYPE` to the default level for the target rigor:
     - `lite` → PROJECT_TYPE=2, DEV_RIGOR=lite
     - `standard` → PROJECT_TYPE=3, DEV_RIGOR=standard
     - `strict` → PROJECT_TYPE=4, DEV_RIGOR=strict
   - Update the `DEV_RIGOR` row value
   - Write the file back

### Outputs

- Updated `user-preferences.json`
- Updated `project-constants.md` (if in a project)

### Exit Criteria

- `user-preferences.json` contains the new `devRigor` value
- If in a project: `project-constants.md` `PROJECT_TYPE` and `DEV_RIGOR` rows reflect the new values

---

## Stage 3: Confirm

### Inputs

- Previous rigor value
- New rigor value
- Whether project-constants.md was updated

### Activities

1. Display summary box with the rigor change and key behavior flags

### Outputs

- Confirmation output to user

### Exit Criteria

- User sees the new rigor and understands what changed

### Output

```bash
source $ECK_HOME/colors.sh

echo ""
printf '%b\n' "${ORANGE}${BOLD}Dev Rigor${RESET}"
echo ""
printf '%b\n' "${GREEN}[x]${RESET} Rigor updated: {old_rigor} -> {new_rigor}"
printf '%b\n' "${GREEN}[x]${RESET} user-preferences.json updated"
# If in a project:
printf '%b\n' "${GREEN}[x]${RESET} project-constants.md updated (Type {level}: {label})"
echo ""
printf '%b\n' "Rigor: ${CYAN}{new_rigor}${RESET}"
printf '%b\n' "Project Type: {level}: {label}"
printf '%b\n' "TDD: {value}"
printf '%b\n' "Security: {value}"
printf '%b\n' "Docs: {value}"
printf '%b\n' "Quality Gates: {value}"
echo ""
```

Reset statusline on completion:

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

---

## Error Handling

Follow the `output:error-handler` primitive for all error scenarios:

- Missing `user-preferences.json` — create it with default values
- Invalid rigor argument — show valid options and stop
- Missing `project-constants.md` — warn and skip project update
- JSON parse failure — report error with file path

---

## Related Documents

- `mode:read-dev-rigor` primitive — full behavior matrix and resolution order
- `scaffold/project/output-modes/README.md` — output mode descriptions
- `scaffold/project/primitives/core/output/visual-framework.md` — visual conventions
- `scaffold/project/primitives/core/output/error-handler.md` — error handling conventions
