From qt-suite
Generate unit tests for Qt/PySide6 source files. Claude scans the project, identifies files that need better test coverage, and writes test files following the project's testing conventions.
How this command is triggered — by the user, by Claude, or both
Slash command
/qt-suite:generate [optional: specific file or class to generate tests for]This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# /qt-suite:generate — AI Test Generation Generate unit tests for this Qt project. When an argument is provided, generate tests for that specific file or class. When no argument is provided, scan the project to identify the files most in need of tests. ## Step 1: Identify Targets **If an argument was provided** (e.g., `/qt-suite:generate src/calculator.py`): - Use the argument as the target file or class name - Find the file with Glob if only a filename was given **If no argument was provided**: 1. Read `.qt-test.json` if present to determine `project_type` and `test_dir` 2. Detect proj...
Generate unit tests for this Qt project. When an argument is provided, generate tests for that specific file or class. When no argument is provided, scan the project to identify the files most in need of tests.
If an argument was provided (e.g., /qt-suite:generate src/calculator.py):
If no argument was provided:
.qt-test.json if present to determine project_type and test_dirCMakeLists.txt (C++) or pyproject.toml/setup.cfg (Python)**/*.py (excluding tests/, __init__.py, migration files)**/*.cpp and **/*.h (excluding tests/, moc_*, ui_*, build/)tests/test_<module>.py for src/<module>.pytests/<name>_test.cpp or tests/test_<name>.cpp for src/<name>.cppRead the target source file completely. Identify:
If a test file already exists for this source:
Python projects:
tests/test_<module_name>.pyQWidget/QDialog/etc. → use qtbot fixtureC++ projects:
tests/<ClassName>Test.cpp (or tests/test_<name>.cpp)QObject subclass with Q_OBJECT macroQTEST_MAIN(TestClassName) and #include "<file>.moc"QML:
tests/tst_<ComponentName>.qmlTestCase itemWrite comprehensive tests targeting:
QSignalSpy in C++, waitSignal/waitSignals in pytest-qt)Reference the qtest-patterns skill for correct syntax and patterns.
For pytest-qt tests, always use qtbot.addWidget() for any widget created in a test.
For QTest C++ tests, use init() / cleanup() slots for per-test setup/teardown.
Write the test file to the determined location. If the file already exists, append new test classes/functions — never overwrite existing tests.
Report concisely:
tests/test_calculator.pypytest tests/test_calculator.py -v (Python) or cmake --build build && ctest -R TestCalculator (C++)npx claudepluginhub l3digitalnet/claude-code-plugins --plugin qt-suite/test-fileGenerates unit tests for a specified file using the project's testing framework from package.json. Covers edge cases, errors, positive/negative scenarios following conventions.
/generate-testsGenerate production-ready unit tests for source code files or snippets. Auto-detects framework (Jest, pytest, JUnit, etc.), covers happy paths, edges, errors, mocks.
/testGenerates tests for completed code phases by auto-detecting the test framework and targeting key files.
/generate-testsGenerates unit, integration, edge case, mock, and framework-specific tests for specified code, following project testing conventions and adapting to Jest, Vitest, Cypress.
/generate-test-casesGenerates unit, integration, edge case, performance, and error-handling test cases for target code or functions, including mocks, stubs, data-driven tests, and coverage analysis.
/generateGenerates a complete wiki for the current repo as a VitePress site with catalogue, onboarding guides, pages, dark-mode Mermaid diagrams, and citations.