# Feature → Command Parity Check

## Context

Module: {{MODULE_NAME}}
Feature docs: {{FEATURE_DOCS}}
Command docs: {{COMMAND_DOCS}}

## Instructions

1. Read ALL feature docs at the paths above
2. Read ALL command docs at the paths above
3. For each feature, extract scenario patterns and test cases
4. For each command doc, extract business rules, error scenarios, process flows
5. Run every parity check below against each feature
6. Return results as JSON per the Output Format section

## Extraction: Feature Docs

From each feature doc, extract:

### Scenario Patterns

- **Add <entity>**: ... → Expected command: create<Entity>
- **Change default <entity>**: ... → Expected command: setDefault<Entity>

### Test Cases

- "Adding a <entity> with valid data creates it in active status"
  → Maps to business rule in create<Entity>
- "Only one <entity> can be default per <parent> at a time"
  → Maps to business rule in setDefault<Entity>

## Expected Command Docs for Feature

See [command naming convention](../../erp-kit-module-3-plan/references/naming.md) for the full rule, disambiguation guide, and banned verbs.

| Feature Operation    | Expected Command Doc | Notes                          |
| -------------------- | -------------------- | ------------------------------ |
| "Create X" / "Add X" | `createX`            | Never `addX`                   |
| "Update X"           | `updateX`            |                                |
| "Delete X"           | `deleteX`            | Hard delete only               |
| "Deactivate X"       | `deactivateX`        | Soft-disable (reversible)      |
| "Activate X"         | `activateX`          | Enable entity                  |
| "Reactivate X"       | `reactivateX`        | Re-enable after deactivation   |
| "Set default X"      | `setDefaultX`        | Singular value/reference       |
| "Assign X to Y"      | `assignXToY`         | Never `addXToY`                |
| "Remove X from Y"    | `removeXFromY`       | Generic relationship unlinking |
| "Revoke X from Y"    | `revokeXFromY`       | RBAC/security domain only      |
| "Move X"             | `moveX`              | Hierarchy position change      |
| "Log X"              | `logX`               | Append-only audit/event        |

**Banned verbs** — flag as naming violation inconsistency:
`archive`, `unarchive`, `disable`, `enable`, `add...To...`, `unlink`

## Parity Checks

For each feature's scenarios and test cases:

| Check ID               | Question                                                                   |
| ---------------------- | -------------------------------------------------------------------------- |
| command_existence      | Does a command doc exist to implement the scenario?                        |
| business_rule_coverage | Are feature test cases covered by command business rules?                  |
| error_handling         | Are expected error cases from feature included in command error scenarios? |
| process_flow_alignment | Does feature process flow match command process flow?                      |

### How to Check

1. List all scenario patterns from feature
2. Identify required operations (verbs) for each scenario
3. Verify corresponding command doc exists using the Expected Command Docs table
4. Map feature test cases to command business rules / error scenarios

## Common Gap Patterns

Watch for these specific patterns:

- **Orphaned scenarios**: Feature describes operation but no command doc exists
- **Missing CRUD**: Feature implies create/update/delete but only some are documented
- **Implicit commands**: Feature scenario requires helper command not documented
- **Default handling**: Feature mentions "default" selection but no setDefault command

## Output Format

Return a JSON object matching this structure:

```json
{
  "check_type": "feature-command-parity",
  "module": "{{MODULE_NAME}}",
  "gaps": [...],
  "inconsistencies": [...],
  "summary": { "total_checks": N, "passed": N, "failed": N, "skipped": N }
}
```

See [parity-report-format.md](parity-report-format.md) for field definitions.
