check-code-quality
You are performing static code quality analysis on the Scopy package: `$ARGUMENTS`
You are creating JavaScript unit test scripts for a Scopy plugin that test every IIOWidget attribute via `readWidget`/`writeWidget` and API getter/setter methods.
> /plugin marketplace add analogdevicesinc/scopy > /plugin install scopy_dev_plugin@scopy-plugins
How it fires
How this command gets triggered: by you, by Claude, or both.
/create-unit-testsContext preview
What this command does when you run it.
You are creating JavaScript unit test scripts for a Scopy plugin that test every IIOWidget attribute via `readWidget`/`writeWidget` and API getter/setter methods.
You are creating JavaScript unit test scripts for a Scopy plugin that test every IIOWidget attribute via `readWidget`/`writeWidget` and API getter/setter methods.
**Plugin:** `$ARGUMENTS`
Use the Read tool to check if a port state file exists:
Before writing tests, verify this input exists: 1. **Plugin API class** — use the Glob tool to search for `*_api.h` in `scopy/packages/$ARGUMENTS/`
If the API class does not exist, stop and tell the user to run `/create-api $ARGUMENTS` first.
Read these specific files to discover all testable widgets and API methods:
1. **Plugin API header** (all `Q_INVOKABLE` methods):
2. **Widget factory source** (all IIOWidgetBuilder calls):
3. **EMU XML** (device structure and attribute defaults):
4. **Tool source files** (for tool names and advanced tool detection):
5. **Existing test files** (avoid duplication):
6. **Test framework API**:
After reading all source material, present a structured classification report:
var PHY = "<device-name>/"; // from EMU XML
| Section | Widget Key | Type | Min | Max | Mid | Options | Test Helper | UID | |---------|-----------|------|-----|-----|-----|---------|-------------|-----| | Global | ensm_mode | combo | - | - | - | ["radio_on", "radio_off"] | testCombo + API | UNIT.GLOBAL.ENSM_MODE | | RX | voltage0_in/hardwaregain | range | 0 | 30 | 15 | - | testRange + testConversion | UNIT.RX.CH0_HARDWARE_GAIN | | ... | ... | ... | ... | ... | ... | ... | ... | ... |
Group by tab name:
| Tab | Widget Key | Type | Min | Max | Mid | Options | Test Helper | UID | |-----|-----------|------|-----|-----|-----|---------|-------------|-----| | CLK Settings | adi,clocks-device-clock_khz | range | 30720 | 320000 | 122880 | - | testRange | UNIT.CLK.DEVICE_CLOCK_KHZ | | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| Method | Test Type | UID | |--------|-----------|-----| | getRxRssi(channel) (readonly) | testReadOnly via API | UNIT.RX.CH0_RSSI | | calibrate() | complex test | UNIT.CAL.CALIBRATE_TRIGGER | | ... | ... | ... |
Scan the API header for these method signature triggers and list matching complex tests:
| # | Pattern | API Trigger | UID | |---|---------|-------------|-----| | C1 | Calibration Flow | `calibrate()` found | UNIT.CAL.FULL_CALIBRATION_FLOW | | C2 | Profile Loading | `loadProfile()` found | UNIT.PROFILE.LOAD_AND_VERIFY | | C3 | Gain Mode Interaction | `getXxxGainControlMode()` + `setXxxHardwareGain()` found | UNIT.RX.GAIN_MODE_INTERACTION | | C4 | State Transitions | `getEnsmMode()`/`setEnsmMode()` found | UNIT.GLOBAL.ENSM_STATE_TRANSITIONS | | C5 | DPD Operations | `dpdReset()` + `getDpdStatus()` found | UNIT.DPD.RESET_AND_STATUS_CH0 | | C6 | Channel Independence | Setter with `int channel`, 2+ channels | UNIT.TX.CHANNEL_INDEPENDENCE | | C7 | Phase Rotation | `getPhaseRotation()`/`setPhaseRotation()` found | UNIT.FPGA.PHASE_ROTATION_CH0 | | C8 | Frequency Tuning | Hz-to-MHz conversion in getter/setter | UNIT.RX.LO_FREQUENCY | | C9 | UDC LO Splitting | `hasUdc()`/`getUdcEnabled()` found | UNIT.UDC.LO_SPLITTING | | C10 | Refresh Cycle | `refresh()` found | UNIT.UTIL.REFRESH_ALL |
Only list patterns where the API trigger was actually found.
Apply adaptive splitting:
If the plugin supports device variants (e.g., AD9371 vs AD9375), describe:
**Wait for user approval before writing any JavaScript.**
After presenting the plan, ask the user: 1. "Which complex tests should I include?" (present the matched list) 2. "Are there any plugin-specific complex scenarios not in the standard patterns?" 3. "Are there variant-specific features that need skip guards?"
Generate each file following the `unit-test-patterns` skill. Use the `file-structure.md` pattern for boilerplate.
**File locations:**
You are performing static code quality analysis on the Scopy package: `$ARGUMENTS`
**Recommended model:** Opus — this command performs deep codebase exploration and multi-step reasoning to produce high-quality…
You are creating a JavaScript API class for a Scopy plugin so it can be controlled from test automation scripts.
You are creating JavaScript automated test scripts for a Scopy plugin, mapping RST manual test cases to API calls.
You are creating Sphinx RST documentation for a Scopy plugin user guide.
You are creating Sphinx RST test case documentation for a Scopy plugin, following the established test documentation format.