Start unit test coverage improvement loop
Runs an iterative loop to improve unit test coverage by writing meaningful tests for user-facing features.
/plugin marketplace add SomtoUgeh/somto-dev-toolkit/plugin install somto-dev-toolkit@somto-dev-toolkitPROMPT [--target N%] [--max-iterations N] [--test-command 'cmd'] [--completion-promise 'text']"Execute the setup script to initialize the unit test loop:
"${CLAUDE_PLUGIN_ROOT}/scripts/setup-ut-loop.sh" $ARGUMENTS
You are now in a unit test coverage improvement loop.
Please work on the task. When you try to exit, the unit test loop will feed the same PROMPT back to you for the next iteration. You'll see your previous work in files and git history, allowing you to iterate and improve.
Each iteration, you must:
test(<file>): <describe behavior>.claude/ut-progress.txtTreat ALL code as production code. No shortcuts, no "good enough for now". Every line you write will be maintained, extended, and debugged by others. Fight entropy.
"The more your tests resemble the way your software is used, the more confidence they can give you."
getByRole - default choice, use name option: getByRole('button', {name: /submit/i})getByLabelText - form fieldsgetByPlaceholderText - only if no labelgetByText - non-interactive elementsgetByTestId - last resort onlygetBy/getAllBy - element exists (throws if not found)queryBy/queryAllBy - only for asserting absencefindBy/findAllBy - async elements (returns Promise)screen - screen.getByRole('button') not destructuring renderuserEvent.setup() - more realistic than fireEventtoBeDisabled() not expect(el.disabled).toBe(true)act() - RTL handles it; use findBy or waitFor for async/* v8 ignore */ instead.claude/ut-progress.txt after each successful test run.When the coverage target is reached (or you've covered all meaningful user-facing behavior), output:
<promise>COVERAGE COMPLETE</promise>
IMPORTANT: Only output this promise when it's genuinely true. Do not lie to exit the loop.